Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
2e0f7a82
Commit
2e0f7a82
authored
Jan 23, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More complete stub sources
parent
57985365
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
65 additions
and
25 deletions
+65
-25
BuildSource.kt
buildSrc/src/main/java/BuildSource.kt
+1
-0
gradle.properties
gradle.properties
+1
-0
build.gradle.kts
stub/build.gradle.kts
+1
-1
AndroidManifest.xml
stub/src/main/AndroidManifest.xml
+16
-8
Q.java
stub/src/main/java/a/Q.java
+1
-2
ii.java
stub/src/main/java/a/ii.java
+1
-2
r.java
stub/src/main/java/a/r.java
+1
-2
u7.java
stub/src/main/java/a/u7.java
+1
-2
z.java
stub/src/main/java/a/z.java
+5
-0
DelegateComponentFactory.java
...n/java/com/topjohnwu/magisk/DelegateComponentFactory.java
+5
-4
InjectAPK.java
stub/src/main/java/com/topjohnwu/magisk/InjectAPK.java
+1
-4
Mapping.java
stub/src/main/java/com/topjohnwu/magisk/Mapping.java
+31
-0
No files found.
buildSrc/src/main/java/BuildSource.kt
View file @
2e0f7a82
...
@@ -20,6 +20,7 @@ object Config {
...
@@ -20,6 +20,7 @@ object Config {
val
version
:
String
=
get
(
"version"
)
?:
commitHash
val
version
:
String
=
get
(
"version"
)
?:
commitHash
val
versionCode
:
Int
get
()
=
get
(
"magisk.versionCode"
)
!!
.
toInt
()
val
versionCode
:
Int
get
()
=
get
(
"magisk.versionCode"
)
!!
.
toInt
()
val
stubVersion
:
String
get
()
=
get
(
"magisk.stubVersion"
)
!!
}
}
class
MagiskPlugin
:
Plugin
<
Project
>
{
class
MagiskPlugin
:
Plugin
<
Project
>
{
...
...
gradle.properties
View file @
2e0f7a82
...
@@ -27,6 +27,7 @@ android.injected.testOnly=false
...
@@ -27,6 +27,7 @@ android.injected.testOnly=false
kapt.incremental.apt
=
true
kapt.incremental.apt
=
true
# Magisk
# Magisk
magisk.stubVersion
=
16
magisk.versionCode
=
21401
magisk.versionCode
=
21401
magisk.ndkVersion
=
21d
magisk.ndkVersion
=
21d
magisk.fullNdkVersion
=
21.3.6528147
magisk.fullNdkVersion
=
21.3.6528147
stub/build.gradle.kts
View file @
2e0f7a82
...
@@ -9,7 +9,7 @@ android {
...
@@ -9,7 +9,7 @@ android {
applicationId
=
"com.topjohnwu.magisk"
applicationId
=
"com.topjohnwu.magisk"
versionCode
=
1
versionCode
=
1
versionName
=
Config
.
version
versionName
=
Config
.
version
buildConfigField
(
"int"
,
"STUB_VERSION"
,
"16"
)
buildConfigField
(
"int"
,
"STUB_VERSION"
,
Config
.
stubVersion
)
buildConfigField
(
"String"
,
"DEV_CHANNEL"
,
Config
[
"DEV_CHANNEL"
]
?:
"null"
)
buildConfigField
(
"String"
,
"DEV_CHANNEL"
,
Config
[
"DEV_CHANNEL"
]
?:
"null"
)
buildConfigField
(
"boolean"
,
"CANARY"
,
if
(
canary
)
"true"
else
"false"
)
buildConfigField
(
"boolean"
,
"CANARY"
,
if
(
canary
)
"true"
else
"false"
)
}
}
...
...
stub/src/main/AndroidManifest.xml
View file @
2e0f7a82
...
@@ -8,12 +8,12 @@
...
@@ -8,12 +8,12 @@
<uses-permission
android:name=
"android.permission.USE_FINGERPRINT"
/>
<uses-permission
android:name=
"android.permission.USE_FINGERPRINT"
/>
<application
<application
android:name=
"a.
e
"
android:name=
"a.
Q
"
android:appComponentFactory=
"
.DelegateComponentFactory
"
android:appComponentFactory=
"
a.z
"
tools:ignore=
"GoogleAppIndexingWarning,MissingApplicationIcon,UnusedAttribute"
>
tools:ignore=
"GoogleAppIndexingWarning,MissingApplicationIcon,UnusedAttribute"
>
<!-- Splash -->
<!-- Splash -->
<activity
android:name=
"a.
c
"
>
<activity
android:name=
"a.
u7
"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.MAIN"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
...
@@ -25,11 +25,11 @@
...
@@ -25,11 +25,11 @@
</activity>
</activity>
<!-- Main -->
<!-- Main -->
<activity
android:name=
"
a.b
"
/>
<activity
android:name=
"
xt.R
"
/>
<!-- Superuser -->
<!-- Superuser -->
<activity
<activity
android:name=
"
a.m
"
android:name=
"
lt5.a
"
android:directBootAware=
"true"
android:directBootAware=
"true"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:exported=
"false"
android:exported=
"false"
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<!-- Receiver -->
<!-- Receiver -->
<receiver
<receiver
android:name=
"a.
h
"
android:name=
"a.
r
"
android:directBootAware=
"true"
android:directBootAware=
"true"
android:exported=
"false"
>
android:exported=
"false"
>
<intent-filter>
<intent-filter>
...
@@ -58,16 +58,24 @@
...
@@ -58,16 +58,24 @@
</receiver>
</receiver>
<!-- DownloadService -->
<!-- DownloadService -->
<service
android:name=
"
a.j
"
/>
<service
android:name=
"
d.s
"
/>
<!-- FileProvider -->
<!-- FileProvider -->
<provider
<provider
android:name=
"a.
p
"
android:name=
"a.
ii
"
android:authorities=
"${applicationId}.provider"
android:authorities=
"${applicationId}.provider"
android:directBootAware=
"true"
android:directBootAware=
"true"
android:exported=
"false"
android:exported=
"false"
android:grantUriPermissions=
"true"
/>
android:grantUriPermissions=
"true"
/>
<!-- WorkManager -->
<service
android:name=
"w.d"
android:directBootAware=
"false"
android:enabled=
"true"
android:exported=
"true"
android:permission=
"android.permission.BIND_JOB_SERVICE"
/>
<!-- Hardcode GMS version -->
<!-- Hardcode GMS version -->
<meta-data
<meta-data
android:name=
"com.google.android.gms.version"
android:name=
"com.google.android.gms.version"
...
...
stub/src/main/java/a/
e
.java
→
stub/src/main/java/a/
Q
.java
View file @
2e0f7a82
...
@@ -2,5 +2,4 @@ package a;
...
@@ -2,5 +2,4 @@ package a;
import
com.topjohnwu.magisk.DelegateApplication
;
import
com.topjohnwu.magisk.DelegateApplication
;
public
class
e
extends
DelegateApplication
{
public
class
Q
extends
DelegateApplication
{}
}
stub/src/main/java/a/
p
.java
→
stub/src/main/java/a/
ii
.java
View file @
2e0f7a82
...
@@ -2,5 +2,4 @@ package a;
...
@@ -2,5 +2,4 @@ package a;
import
com.topjohnwu.magisk.FileProvider
;
import
com.topjohnwu.magisk.FileProvider
;
public
class
p
extends
FileProvider
{
public
class
ii
extends
FileProvider
{}
}
stub/src/main/java/a/
h
.java
→
stub/src/main/java/a/
r
.java
View file @
2e0f7a82
...
@@ -2,5 +2,4 @@ package a;
...
@@ -2,5 +2,4 @@ package a;
import
com.topjohnwu.magisk.dummy.DummyReceiver
;
import
com.topjohnwu.magisk.dummy.DummyReceiver
;
public
class
h
extends
DummyReceiver
{
public
class
r
extends
DummyReceiver
{}
}
stub/src/main/java/a/
c
.java
→
stub/src/main/java/a/
u7
.java
View file @
2e0f7a82
...
@@ -2,5 +2,4 @@ package a;
...
@@ -2,5 +2,4 @@ package a;
import
com.topjohnwu.magisk.DownloadActivity
;
import
com.topjohnwu.magisk.DownloadActivity
;
public
class
c
extends
DownloadActivity
{
public
class
u7
extends
DownloadActivity
{}
}
stub/src/main/java/a/z.java
0 → 100644
View file @
2e0f7a82
package
a
;
import
com.topjohnwu.magisk.DelegateComponentFactory
;
public
class
z
extends
DelegateComponentFactory
{}
stub/src/main/java/com/topjohnwu/magisk/DelegateComponentFactory.java
View file @
2e0f7a82
...
@@ -37,7 +37,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
...
@@ -37,7 +37,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
public
Activity
instantiateActivity
(
ClassLoader
cl
,
String
className
,
Intent
intent
)
public
Activity
instantiateActivity
(
ClassLoader
cl
,
String
className
,
Intent
intent
)
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
if
(
delegate
!=
null
)
if
(
delegate
!=
null
)
return
delegate
.
instantiateActivity
(
loader
,
className
,
intent
);
return
delegate
.
instantiateActivity
(
loader
,
Mapping
.
get
(
className
)
,
intent
);
return
create
(
className
,
DownloadActivity:
:
new
);
return
create
(
className
,
DownloadActivity:
:
new
);
}
}
...
@@ -45,7 +45,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
...
@@ -45,7 +45,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
public
BroadcastReceiver
instantiateReceiver
(
ClassLoader
cl
,
String
className
,
Intent
intent
)
public
BroadcastReceiver
instantiateReceiver
(
ClassLoader
cl
,
String
className
,
Intent
intent
)
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
if
(
delegate
!=
null
)
if
(
delegate
!=
null
)
return
delegate
.
instantiateReceiver
(
loader
,
className
,
intent
);
return
delegate
.
instantiateReceiver
(
loader
,
Mapping
.
get
(
className
)
,
intent
);
return
create
(
className
,
DummyReceiver:
:
new
);
return
create
(
className
,
DummyReceiver:
:
new
);
}
}
...
@@ -53,7 +53,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
...
@@ -53,7 +53,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
public
Service
instantiateService
(
ClassLoader
cl
,
String
className
,
Intent
intent
)
public
Service
instantiateService
(
ClassLoader
cl
,
String
className
,
Intent
intent
)
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
if
(
delegate
!=
null
)
if
(
delegate
!=
null
)
return
delegate
.
instantiateService
(
loader
,
className
,
intent
);
return
delegate
.
instantiateService
(
loader
,
Mapping
.
get
(
className
)
,
intent
);
return
create
(
className
,
DummyService:
:
new
);
return
create
(
className
,
DummyService:
:
new
);
}
}
...
@@ -62,7 +62,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
...
@@ -62,7 +62,7 @@ public class DelegateComponentFactory extends AppComponentFactory {
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
throws
ClassNotFoundException
,
IllegalAccessException
,
InstantiationException
{
if
(
loader
==
null
)
loader
=
cl
;
if
(
loader
==
null
)
loader
=
cl
;
if
(
delegate
!=
null
)
if
(
delegate
!=
null
)
return
delegate
.
instantiateProvider
(
loader
,
className
);
return
delegate
.
instantiateProvider
(
loader
,
Mapping
.
get
(
className
)
);
return
create
(
className
,
DummyProvider:
:
new
);
return
create
(
className
,
DummyProvider:
:
new
);
}
}
...
@@ -76,4 +76,5 @@ public class DelegateComponentFactory extends AppComponentFactory {
...
@@ -76,4 +76,5 @@ public class DelegateComponentFactory extends AppComponentFactory {
return
factory
.
create
();
return
factory
.
create
();
}
}
}
}
}
}
stub/src/main/java/com/topjohnwu/magisk/InjectAPK.java
View file @
2e0f7a82
...
@@ -11,10 +11,8 @@ import com.topjohnwu.magisk.utils.DynamicClassLoader;
...
@@ -11,10 +11,8 @@ import com.topjohnwu.magisk.utils.DynamicClassLoader;
import
java.io.File
;
import
java.io.File
;
import
java.io.FileOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.util.HashMap
;
public
class
InjectAPK
{
public
class
InjectAPK
{
...
@@ -70,8 +68,7 @@ public class InjectAPK {
...
@@ -70,8 +68,7 @@ public class InjectAPK {
private
static
DynAPK
.
Data
dynData
()
{
private
static
DynAPK
.
Data
dynData
()
{
DynAPK
.
Data
data
=
new
DynAPK
.
Data
();
DynAPK
.
Data
data
=
new
DynAPK
.
Data
();
data
.
version
=
BuildConfig
.
STUB_VERSION
;
data
.
version
=
BuildConfig
.
STUB_VERSION
;
// Public source code does not do component name obfuscation
data
.
classToComponent
=
Mapping
.
inverseMap
;
data
.
classToComponent
=
new
HashMap
<>();
return
data
;
return
data
;
}
}
...
...
stub/src/main/java/com/topjohnwu/magisk/Mapping.java
0 → 100644
View file @
2e0f7a82
package
com
.
topjohnwu
.
magisk
;
import
java.util.HashMap
;
import
java.util.Map
;
public
class
Mapping
{
private
static
Map
<
String
,
String
>
map
=
new
HashMap
<>();
public
static
Map
<
String
,
String
>
inverseMap
;
static
{
map
.
put
(
"a.Qzw"
,
"a.e"
);
map
.
put
(
"a.u7"
,
"a.c"
);
map
.
put
(
"a.ii"
,
"a.p"
);
map
.
put
(
"a.r"
,
"a.h"
);
map
.
put
(
"xt.R"
,
"a.b"
);
map
.
put
(
"lt5.a"
,
"a.m"
);
map
.
put
(
"d.s"
,
"a.j"
);
map
.
put
(
"w.d"
,
"androidx.work.impl.background.systemjob.SystemJobService"
);
inverseMap
=
new
HashMap
<>(
map
.
size
());
for
(
Map
.
Entry
<
String
,
String
>
e
:
map
.
entrySet
())
{
inverseMap
.
put
(
e
.
getValue
(),
e
.
getKey
());
}
}
public
static
String
get
(
String
name
)
{
String
n
=
map
.
get
(
name
);
return
n
!=
null
?
n
:
name
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment