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
7e01f9c9
Commit
7e01f9c9
authored
Apr 18, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes
parent
8b28baab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
10 deletions
+10
-10
DynamicClassLoader.java
...n/java/com/topjohnwu/magisk/utils/DynamicClassLoader.java
+6
-2
XAndroid.kt
app/src/main/java/com/topjohnwu/magisk/ktx/XAndroid.kt
+1
-2
CheckSafetyNetEvent.kt
.../com/topjohnwu/magisk/ui/safetynet/CheckSafetyNetEvent.kt
+2
-2
ClassLoaders.java
stub/src/main/java/com/topjohnwu/magisk/ClassLoaders.java
+1
-4
No files found.
app/shared/src/main/java/com/topjohnwu/magisk/utils/DynamicClassLoader.java
View file @
7e01f9c9
...
@@ -9,7 +9,11 @@ import dalvik.system.DexClassLoader;
...
@@ -9,7 +9,11 @@ import dalvik.system.DexClassLoader;
public
class
DynamicClassLoader
extends
DexClassLoader
{
public
class
DynamicClassLoader
extends
DexClassLoader
{
private
ClassLoader
base
=
Object
.
class
.
getClassLoader
();
private
static
final
ClassLoader
base
=
Object
.
class
.
getClassLoader
();
public
DynamicClassLoader
(
File
apk
)
{
super
(
apk
.
getPath
(),
apk
.
getParent
(),
null
,
base
);
}
public
DynamicClassLoader
(
File
apk
,
ClassLoader
parent
)
{
public
DynamicClassLoader
(
File
apk
,
ClassLoader
parent
)
{
super
(
apk
.
getPath
(),
apk
.
getParent
(),
null
,
parent
);
super
(
apk
.
getPath
(),
apk
.
getParent
(),
null
,
parent
);
...
@@ -18,7 +22,7 @@ public class DynamicClassLoader extends DexClassLoader {
...
@@ -18,7 +22,7 @@ public class DynamicClassLoader extends DexClassLoader {
@Override
@Override
protected
Class
<?>
loadClass
(
String
name
,
boolean
resolve
)
throws
ClassNotFoundException
{
protected
Class
<?>
loadClass
(
String
name
,
boolean
resolve
)
throws
ClassNotFoundException
{
// First check if already loaded
// First check if already loaded
Class
cls
=
findLoadedClass
(
name
);
Class
<?>
cls
=
findLoadedClass
(
name
);
if
(
cls
!=
null
)
if
(
cls
!=
null
)
return
cls
;
return
cls
;
...
...
app/src/main/java/com/topjohnwu/magisk/ktx/XAndroid.kt
View file @
7e01f9c9
...
@@ -264,8 +264,7 @@ fun Context.startEndToLeftRight(start: Int, end: Int): Pair<Int, Int> {
...
@@ -264,8 +264,7 @@ fun Context.startEndToLeftRight(start: Int, end: Int): Pair<Int, Int> {
fun
Context
.
openUrl
(
url
:
String
)
=
Utils
.
openLink
(
this
,
url
.
toUri
())
fun
Context
.
openUrl
(
url
:
String
)
=
Utils
.
openLink
(
this
,
url
.
toUri
())
@Suppress
(
"FunctionName"
)
inline
fun
<
reified
T
>
T
.
createClassLoader
(
apk
:
File
)
=
inline
fun
<
reified
T
>
T
.
DynamicClassLoader
(
apk
:
File
)
=
DynamicClassLoader
(
apk
,
T
::
class
.
java
.
classLoader
)
DynamicClassLoader
(
apk
,
T
::
class
.
java
.
classLoader
)
fun
Context
.
unwrap
():
Context
{
fun
Context
.
unwrap
():
Context
{
...
...
app/src/main/java/com/topjohnwu/magisk/ui/safetynet/CheckSafetyNetEvent.kt
View file @
7e01f9c9
...
@@ -12,7 +12,7 @@ import com.topjohnwu.magisk.arch.ContextExecutor
...
@@ -12,7 +12,7 @@ import com.topjohnwu.magisk.arch.ContextExecutor
import
com.topjohnwu.magisk.arch.ViewEventWithScope
import
com.topjohnwu.magisk.arch.ViewEventWithScope
import
com.topjohnwu.magisk.core.Const
import
com.topjohnwu.magisk.core.Const
import
com.topjohnwu.magisk.data.repository.NetworkService
import
com.topjohnwu.magisk.data.repository.NetworkService
import
com.topjohnwu.magisk.ktx.
Dynamic
ClassLoader
import
com.topjohnwu.magisk.ktx.
create
ClassLoader
import
com.topjohnwu.magisk.ktx.writeTo
import
com.topjohnwu.magisk.ktx.writeTo
import
com.topjohnwu.magisk.view.MagiskDialog
import
com.topjohnwu.magisk.view.MagiskDialog
import
com.topjohnwu.signing.CryptoUtils
import
com.topjohnwu.signing.CryptoUtils
...
@@ -67,7 +67,7 @@ class CheckSafetyNetEvent(
...
@@ -67,7 +67,7 @@ class CheckSafetyNetEvent(
private
suspend
fun
attest
(
context
:
Context
,
onError
:
suspend
(
Exception
)
->
Unit
)
{
private
suspend
fun
attest
(
context
:
Context
,
onError
:
suspend
(
Exception
)
->
Unit
)
{
val
helper
:
SafetyNetHelper
val
helper
:
SafetyNetHelper
try
{
try
{
val
loader
=
Dynamic
ClassLoader
(
apk
)
val
loader
=
create
ClassLoader
(
apk
)
// Scan through the dex and find our helper class
// Scan through the dex and find our helper class
var
clazz
:
Class
<*>?
=
null
var
clazz
:
Class
<*>?
=
null
...
...
stub/src/main/java/com/topjohnwu/magisk/ClassLoaders.java
View file @
7e01f9c9
...
@@ -7,10 +7,7 @@ import java.io.File;
...
@@ -7,10 +7,7 @@ import java.io.File;
class
InjectedClassLoader
extends
DynamicClassLoader
{
class
InjectedClassLoader
extends
DynamicClassLoader
{
InjectedClassLoader
(
File
apk
)
{
InjectedClassLoader
(
File
apk
)
{
super
(
apk
,
super
(
apk
);
/* Use the base classloader as we do not want stub
* APK classes accessible from the main app */
Object
.
class
.
getClassLoader
());
}
}
@Override
@Override
...
...
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