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
1024e68e
Commit
1024e68e
authored
Jan 26, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove class mapping in full APK
parent
6ae2c938
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
67 deletions
+17
-67
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+7
-7
stubs.kt
app/src/main/java/a/stubs.kt
+0
-32
Hacks.kt
app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt
+6
-26
SignBoot.java
app/src/main/java/com/topjohnwu/signing/SignBoot.java
+2
-0
gradle.properties
gradle.properties
+1
-1
util_functions.sh
scripts/util_functions.sh
+1
-1
No files found.
app/src/main/AndroidManifest.xml
View file @
1024e68e
...
...
@@ -4,7 +4,7 @@
package=
"com.topjohnwu.magisk"
>
<application
android:name=
"
a.e
"
android:name=
"
.core.App
"
android:extractNativeLibs=
"true"
android:icon=
"@drawable/ic_launcher"
android:multiArch=
"true"
...
...
@@ -12,7 +12,7 @@
<!-- Splash -->
<activity
android:name=
"
a.c
"
android:name=
"
.core.SplashActivity
"
android:theme=
"@style/SplashTheme"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
...
...
@@ -25,11 +25,11 @@
</activity>
<!-- Main -->
<activity
android:name=
"
a.b
"
/>
<activity
android:name=
"
.ui.MainActivity
"
/>
<!-- Superuser -->
<activity
android:name=
"
a.m
"
android:name=
"
.ui.surequest.SuRequestActivity
"
android:directBootAware=
"true"
android:excludeFromRecents=
"true"
android:exported=
"false"
...
...
@@ -42,7 +42,7 @@
<!-- Receiver -->
<receiver
android:name=
"
a.h
"
android:name=
"
.core.Receiver
"
android:directBootAware=
"true"
android:exported=
"false"
>
<intent-filter>
...
...
@@ -57,11 +57,11 @@
</receiver>
<!-- DownloadService -->
<service
android:name=
"
a.j
"
/>
<service
android:name=
"
.core.download.DownloadService
"
/>
<!-- FileProvider -->
<provider
android:name=
"
a.p
"
android:name=
"
.core.Provider
"
android:authorities=
"${applicationId}.provider"
android:directBootAware=
"true"
android:exported=
"false"
...
...
app/src/main/java/a/stubs.kt
deleted
100644 → 0
View file @
6ae2c938
@file
:
JvmName
(
"a"
)
package
a
import
com.topjohnwu.magisk.core.App
import
com.topjohnwu.magisk.core.Provider
import
com.topjohnwu.magisk.core.Receiver
import
com.topjohnwu.magisk.core.SplashActivity
import
com.topjohnwu.magisk.core.download.DownloadService
import
com.topjohnwu.magisk.ui.MainActivity
import
com.topjohnwu.magisk.ui.surequest.SuRequestActivity
import
com.topjohnwu.signing.SignBoot
fun
main
(
args
:
Array
<
String
>)
{
SignBoot
.
main
(
args
)
}
class
b
:
MainActivity
()
class
c
:
SplashActivity
()
class
e
:
App
{
constructor
()
:
super
()
constructor
(
o
:
Any
)
:
super
(
o
)
}
class
h
:
Receiver
()
class
j
:
DownloadService
()
class
m
:
SuRequestActivity
()
class
p
:
Provider
()
app/src/main/java/com/topjohnwu/magisk/core/Hacks.kt
View file @
1024e68e
...
...
@@ -18,11 +18,8 @@ import android.util.DisplayMetrics
import
androidx.annotation.RequiresApi
import
com.topjohnwu.magisk.DynAPK
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.core.download.DownloadService
import
com.topjohnwu.magisk.core.utils.refreshLocale
import
com.topjohnwu.magisk.core.utils.updateConfig
import
com.topjohnwu.magisk.ui.MainActivity
import
com.topjohnwu.magisk.ui.surequest.SuRequestActivity
fun
AssetManager
.
addAssetPath
(
path
:
String
)
{
DynAPK
.
addAssetPath
(
this
,
path
)
...
...
@@ -47,10 +44,8 @@ fun Context.wrapJob(): Context = object : InjectedContext(this) {
}
}
fun
Class
<*>.
cmp
(
pkg
:
String
):
ComponentName
{
val
name
=
ClassMap
[
this
].
name
return
ComponentName
(
pkg
,
Info
.
stub
?.
classToComponent
?.
get
(
name
)
?:
name
)
}
fun
Class
<*>.
cmp
(
pkg
:
String
)
=
ComponentName
(
pkg
,
Info
.
stub
?.
classToComponent
?.
get
(
name
)
?:
name
)
inline
fun
<
reified
T
>
Activity
.
redirect
()
=
Intent
(
intent
)
.
setComponent
(
T
::
class
.
java
.
cmp
(
packageName
))
...
...
@@ -114,11 +109,10 @@ private class JobSchedulerWrapper(private val base: JobScheduler) : JobScheduler
override
fun
getPendingJob
(
jobId
:
Int
)
=
base
.
getPendingJob
(
jobId
)
private
fun
JobInfo
.
patch
():
JobInfo
{
// Swap out the service of JobInfo
val
name
=
service
.
className
val
component
=
ComponentName
(
service
.
packageName
,
Info
.
stub
!!
.
classToComponent
[
name
]
?:
name
)
val
component
=
service
.
run
{
ComponentName
(
packageName
,
Info
.
stub
?.
classToComponent
?.
get
(
className
)
?:
className
)
}
javaClass
.
getDeclaredField
(
"service"
).
apply
{
isAccessible
=
true
}.
set
(
this
,
component
)
...
...
@@ -127,20 +121,6 @@ private class JobSchedulerWrapper(private val base: JobScheduler) : JobScheduler
}
}
private
object
ClassMap
{
private
val
map
=
mapOf
(
App
::
class
.
java
to
a
.
e
::
class
.
java
,
MainActivity
::
class
.
java
to
a
.
b
::
class
.
java
,
SplashActivity
::
class
.
java
to
a
.
c
::
class
.
java
,
Receiver
::
class
.
java
to
a
.
h
::
class
.
java
,
DownloadService
::
class
.
java
to
a
.
j
::
class
.
java
,
SuRequestActivity
::
class
.
java
to
a
.
m
::
class
.
java
)
operator
fun
get
(
c
:
Class
<
*
>)
=
map
.
getOrElse
(
c
)
{
c
}
}
// Keep a reference to these resources to prevent it from
// being removed when running "remove unused resources"
val
shouldKeepResources
=
listOf
(
...
...
app/src/main/java/com/topjohnwu/signing/SignBoot.java
View file @
1024e68e
package
com
.
topjohnwu
.
signing
;
import
androidx.annotation.Keep
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
...
...
@@ -32,6 +33,7 @@ import java.security.cert.CertificateFactory;
import
java.security.cert.X509Certificate
;
import
java.util.Arrays
;
@Keep
public
class
SignBoot
{
private
static
final
int
BOOT_IMAGE_HEADER_V1_RECOVERY_DTBO_SIZE_OFFSET
=
1632
;
...
...
gradle.properties
View file @
1024e68e
...
...
@@ -27,7 +27,7 @@ android.injected.testOnly=false
kapt.incremental.apt
=
true
# Magisk
magisk.stubVersion
=
1
6
magisk.stubVersion
=
1
7
magisk.versionCode
=
21405
magisk.ndkVersion
=
21d
magisk.fullNdkVersion
=
21.3.6528147
scripts/util_functions.sh
View file @
1024e68e
...
...
@@ -779,7 +779,7 @@ NVBASE=/data/adb
TMPDIR
=
/dev/tmp
# Bootsigner related stuff
BOOTSIGNERCLASS
=
a.a
BOOTSIGNERCLASS
=
com.topjohnwu.signing.SignBoot
BOOTSIGNER
=
'/system/bin/dalvikvm -Xnoimage-dex2oat -cp $APK $BOOTSIGNERCLASS'
BOOTSIGNED
=
false
...
...
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