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
dc9f69ba
Commit
dc9f69ba
authored
Oct 30, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes
parent
fdf04f77
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
34 deletions
+30
-34
proguard-rules.pro
shared/proguard-rules.pro
+1
-1
DynAPK.java
shared/src/main/java/com/topjohnwu/magisk/DynAPK.java
+2
-2
AndroidManifest.xml
stub/src/main/AndroidManifest.xml
+9
-9
a.java
stub/src/main/java/a/a.java
+1
-1
c.java
stub/src/main/java/a/c.java
+1
-1
e.java
stub/src/main/java/a/e.java
+1
-1
h.java
stub/src/main/java/a/h.java
+1
-1
DelegateApplication.java
...c/main/java/com/topjohnwu/magisk/DelegateApplication.java
+3
-3
Mapping.java
...src/main/java/com/topjohnwu/magisk/obfuscate/Mapping.java
+11
-15
No files found.
shared/proguard-rules.pro
View file @
dc9f69ba
...
@@ -20,6 +20,6 @@
...
@@ -20,6 +20,6 @@
# hide the original source file name.
# hide the original source file name.
#-renamesourcefileattribute SourceFile
#-renamesourcefileattribute SourceFile
-
keepclassmembers
class
*
implement
s
javax
.
net
.
ssl
.
SSLSocketFactory
{
-
keepclassmembers
class
*
extend
s
javax
.
net
.
ssl
.
SSLSocketFactory
{
**
delegate
;
**
delegate
;
}
}
shared/src/main/java/com/topjohnwu/magisk/DynAPK.java
View file @
dc9f69ba
...
@@ -50,7 +50,7 @@ public class DynAPK {
...
@@ -50,7 +50,7 @@ public class DynAPK {
public
static
Object
pack
(
Data
data
)
{
public
static
Object
pack
(
Data
data
)
{
Object
[]
arr
=
new
Object
[
2
];
Object
[]
arr
=
new
Object
[
2
];
arr
[
STUB_VERSION_ENTRY
]
=
STUB_VERSION
;
arr
[
STUB_VERSION_ENTRY
]
=
data
.
version
;
arr
[
COMPONENT_MAP
]
=
data
.
componentMap
;
arr
[
COMPONENT_MAP
]
=
data
.
componentMap
;
return
arr
;
return
arr
;
}
}
...
@@ -64,7 +64,7 @@ public class DynAPK {
...
@@ -64,7 +64,7 @@ public class DynAPK {
}
}
public
static
class
Data
{
public
static
class
Data
{
public
int
version
;
public
int
version
=
STUB_VERSION
;
public
Map
<
String
,
String
>
componentMap
;
public
Map
<
String
,
String
>
componentMap
;
}
}
}
}
stub/src/main/AndroidManifest.xml
View file @
dc9f69ba
...
@@ -16,8 +16,8 @@
...
@@ -16,8 +16,8 @@
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<application
<application
android:name=
"a.
y
"
android:name=
"a.
e
"
android:appComponentFactory=
"a.
x
"
android:appComponentFactory=
"a.
a
"
android:allowBackup=
"true"
android:allowBackup=
"true"
android:usesCleartextTraffic=
"true"
android:usesCleartextTraffic=
"true"
tools:ignore=
"UnusedAttribute,GoogleAppIndexingWarning"
>
tools:ignore=
"UnusedAttribute,GoogleAppIndexingWarning"
>
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
<!-- Download Activity -->
<!-- Download Activity -->
<activity
<activity
android:name=
"a.
z
"
android:name=
"a.
c
"
android:configChanges=
"orientation|screenSize"
android:configChanges=
"orientation|screenSize"
android:theme=
"@style/SplashTheme"
>
android:theme=
"@style/SplashTheme"
>
<intent-filter>
<intent-filter>
...
@@ -37,24 +37,24 @@
...
@@ -37,24 +37,24 @@
<!-- Magisk Manager Components -->
<!-- Magisk Manager Components -->
<activity
<activity
android:name=
"a.
o
"
android:name=
"a.
b
"
android:configChanges=
"orientation|screenSize"
android:configChanges=
"orientation|screenSize"
android:exported=
"true"
/>
android:exported=
"true"
/>
<activity
<activity
android:name=
"a.
x
"
android:name=
"a.
f
"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:configChanges=
"keyboardHidden|orientation|screenSize"
android:screenOrientation=
"nosensor"
/>
android:screenOrientation=
"nosensor"
/>
<activity
<activity
android:name=
"a.
g
"
android:name=
"a.
m
"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
android:directBootAware=
"true"
android:directBootAware=
"true"
android:excludeFromRecents=
"true"
android:excludeFromRecents=
"true"
android:exported=
"false"
/>
android:exported=
"false"
/>
<receiver
<receiver
android:name=
"a.
w
"
android:name=
"a.
h
"
android:directBootAware=
"true"
>
android:directBootAware=
"true"
>
<intent-filter>
<intent-filter>
<action
android:name=
"android.intent.action.REBOOT"
/>
<action
android:name=
"android.intent.action.REBOOT"
/>
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
</receiver>
</receiver>
<service
<service
android:name=
"a.
v
"
android:name=
"a.
j
"
android:exported=
"false"
/>
android:exported=
"false"
/>
<meta-data
<meta-data
...
@@ -80,7 +80,7 @@
...
@@ -80,7 +80,7 @@
<!-- WorkManager SystemJobService -->
<!-- WorkManager SystemJobService -->
<service
<service
android:name=
"a.
j
"
android:name=
"a.
x
"
android:directBootAware=
"false"
android:directBootAware=
"false"
android:enabled=
"true"
android:enabled=
"true"
android:exported=
"true"
android:exported=
"true"
...
...
stub/src/main/java/a/
x
.java
→
stub/src/main/java/a/
a
.java
View file @
dc9f69ba
...
@@ -2,5 +2,5 @@ package a;
...
@@ -2,5 +2,5 @@ package a;
import
com.topjohnwu.magisk.DelegateComponentFactory
;
import
com.topjohnwu.magisk.DelegateComponentFactory
;
public
class
x
extends
DelegateComponentFactory
{
public
class
a
extends
DelegateComponentFactory
{
}
}
stub/src/main/java/a/
z
.java
→
stub/src/main/java/a/
c
.java
View file @
dc9f69ba
...
@@ -2,5 +2,5 @@ package a;
...
@@ -2,5 +2,5 @@ package a;
import
com.topjohnwu.magisk.DownloadActivity
;
import
com.topjohnwu.magisk.DownloadActivity
;
public
class
z
extends
DownloadActivity
{
public
class
c
extends
DownloadActivity
{
}
}
stub/src/main/java/a/
y
.java
→
stub/src/main/java/a/
e
.java
View file @
dc9f69ba
...
@@ -2,5 +2,5 @@ package a;
...
@@ -2,5 +2,5 @@ package a;
import
com.topjohnwu.magisk.DelegateApplication
;
import
com.topjohnwu.magisk.DelegateApplication
;
public
class
y
extends
DelegateApplication
{
public
class
e
extends
DelegateApplication
{
}
}
stub/src/main/java/a/
w
.java
→
stub/src/main/java/a/
h
.java
View file @
dc9f69ba
...
@@ -2,5 +2,5 @@ package a;
...
@@ -2,5 +2,5 @@ package a;
import
com.topjohnwu.magisk.dummy.DummyReceiver
;
import
com.topjohnwu.magisk.dummy.DummyReceiver
;
public
class
w
extends
DummyReceiver
{
public
class
h
extends
DummyReceiver
{
}
}
stub/src/main/java/com/topjohnwu/magisk/DelegateApplication.java
View file @
dc9f69ba
...
@@ -55,11 +55,11 @@ public class DelegateApplication extends Application {
...
@@ -55,11 +55,11 @@ public class DelegateApplication extends Application {
ClassLoader
cl
=
new
DynamicClassLoader
(
MANAGER_APK
,
factory
.
loader
);
ClassLoader
cl
=
new
DynamicClassLoader
(
MANAGER_APK
,
factory
.
loader
);
try
{
try
{
// Create the delegate AppComponentFactory
// Create the delegate AppComponentFactory
Object
df
=
cl
.
loadClass
(
"a.a"
).
newInstance
();
AppComponentFactory
df
=
(
AppComponentFactory
)
cl
.
loadClass
(
"a.a"
).
newInstance
();
// Create the delegate Application
// Create the delegate Application
delegate
=
(
Application
)
cl
.
loadClass
(
"a.e"
).
getConstructor
(
Object
.
class
)
delegate
=
(
Application
)
cl
.
loadClass
(
"a.e"
).
getConstructor
(
Object
.
class
)
.
newInstance
(
DynAPK
.
pack
(
Mapping
.
data
));
.
newInstance
(
DynAPK
.
pack
(
Mapping
.
data
()
));
// Call attachBaseContext without ContextImpl to show it is being wrapped
// Call attachBaseContext without ContextImpl to show it is being wrapped
Method
m
=
ContextWrapper
.
class
.
getDeclaredMethod
(
"attachBaseContext"
,
Context
.
class
);
Method
m
=
ContextWrapper
.
class
.
getDeclaredMethod
(
"attachBaseContext"
,
Context
.
class
);
...
@@ -67,7 +67,7 @@ public class DelegateApplication extends Application {
...
@@ -67,7 +67,7 @@ public class DelegateApplication extends Application {
m
.
invoke
(
delegate
,
this
);
m
.
invoke
(
delegate
,
this
);
// If everything went well, set our loader and delegate
// If everything went well, set our loader and delegate
factory
.
delegate
=
(
AppComponentFactory
)
df
;
factory
.
delegate
=
df
;
factory
.
loader
=
cl
;
factory
.
loader
=
cl
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
Log
.
e
(
getClass
().
getSimpleName
(),
""
,
e
);
Log
.
e
(
getClass
().
getSimpleName
(),
""
,
e
);
...
...
stub/src/main/java/com/topjohnwu/magisk/obfuscate/Mapping.java
View file @
dc9f69ba
...
@@ -8,22 +8,8 @@ import static com.topjohnwu.magisk.DynAPK.Data;
...
@@ -8,22 +8,8 @@ import static com.topjohnwu.magisk.DynAPK.Data;
public
class
Mapping
{
public
class
Mapping
{
private
static
Map
<
String
,
String
>
map
=
new
HashMap
<>();
private
static
Map
<
String
,
String
>
map
=
new
HashMap
<>();
// This mapping will be sent into the guest app
public
static
Data
data
=
new
Data
();
static
{
static
{
map
.
put
(
a
.
z
.
class
.
getName
(),
"a.c"
);
map
.
put
(
"a.x"
,
"androidx.work.impl.background.systemjob.SystemJobService"
);
map
.
put
(
"a.x"
,
"a.f"
);
map
.
put
(
"a.o"
,
"a.b"
);
map
.
put
(
"a.g"
,
"a.m"
);
map
.
put
(
a
.
w
.
class
.
getName
(),
"a.h"
);
map
.
put
(
"a.v"
,
"a.j"
);
map
.
put
(
"a.j"
,
"androidx.work.impl.background.systemjob.SystemJobService"
);
data
.
componentMap
=
new
HashMap
<>(
map
.
size
());
for
(
Map
.
Entry
<
String
,
String
>
e
:
map
.
entrySet
())
{
data
.
componentMap
.
put
(
e
.
getValue
(),
e
.
getKey
());
}
}
}
public
static
String
get
(
String
name
)
{
public
static
String
get
(
String
name
)
{
...
@@ -31,4 +17,14 @@ public class Mapping {
...
@@ -31,4 +17,14 @@ public class Mapping {
return
n
!=
null
?
n
:
name
;
return
n
!=
null
?
n
:
name
;
}
}
public
static
Data
data
()
{
Map
<
String
,
String
>
componentMap
=
new
HashMap
<>(
map
.
size
());
for
(
Map
.
Entry
<
String
,
String
>
e
:
map
.
entrySet
())
{
componentMap
.
put
(
e
.
getValue
(),
e
.
getKey
());
}
Data
data
=
new
Data
();
data
.
componentMap
=
componentMap
;
return
data
;
}
}
}
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