Commit 64575661 authored by swift_gan's avatar swift_gan

add classloader for loading system class

parent 45dfd0aa
......@@ -255,7 +255,11 @@ public class SandHook {
if (artMethodClass != null)
return true;
try {
artMethodClass = Class.forName("java.lang.reflect.ArtMethod");
if (SandHookConfig.initClassLoader == null) {
artMethodClass = Class.forName("java.lang.reflect.ArtMethod");
} else {
artMethodClass = Class.forName("java.lang.reflect.ArtMethod", true, SandHookConfig.initClassLoader);
}
return true;
} catch (ClassNotFoundException e) {
return false;
......
......@@ -10,6 +10,7 @@ public class SandHookConfig {
public volatile static int SDK_INT = Build.VERSION.SDK_INT;
public volatile static boolean DEBUG = BuildConfig.DEBUG;
public volatile static boolean compiler = true;
public volatile static ClassLoader initClassLoader;
public volatile static String libSandHookPath;
public volatile static LibLoader libLoader = new LibLoader() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment