Commit 93372c42 authored by swift_gan's avatar swift_gan

add useInternalStub switcher

parent 3235b9da
...@@ -25,6 +25,8 @@ public class XposedCompat { ...@@ -25,6 +25,8 @@ public class XposedCompat {
public static String processName; public static String processName;
public static boolean isFirstApplication; public static boolean isFirstApplication;
//try to use internal stub hooker & backup method to speed up hook
public static volatile boolean useInternalStub = true;
public static volatile boolean retryWhenCallOriginError = false; public static volatile boolean retryWhenCallOriginError = false;
private static ClassLoader sandHookXposedClassLoader; private static ClassLoader sandHookXposedClassLoader;
......
...@@ -58,7 +58,10 @@ public final class DynamicBridge { ...@@ -58,7 +58,10 @@ public final class DynamicBridge {
} }
Trace.beginSection("SandHook-Xposed"); Trace.beginSection("SandHook-Xposed");
long timeStart = System.currentTimeMillis(); long timeStart = System.currentTimeMillis();
HookMethodEntity stub = HookStubManager.getHookMethodEntity(hookMethod); HookMethodEntity stub = null;
if (XposedCompat.useInternalStub) {
stub = HookStubManager.getHookMethodEntity(hookMethod);
}
if (stub != null) { if (stub != null) {
SandHook.hook(new HookWrapper.HookEntity(hookMethod, stub.hook, stub.backup)); SandHook.hook(new HookWrapper.HookEntity(hookMethod, stub.hook, stub.backup));
entityMap.put(hookMethod, stub); entityMap.put(hookMethod, stub);
......
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