Commit aefda1dd authored by swift_gan's avatar swift_gan Committed by swift_gan

fix classloader

parent 65d98939
...@@ -6,6 +6,7 @@ import com.swift.sandhook.SandHook; ...@@ -6,6 +6,7 @@ import com.swift.sandhook.SandHook;
import com.swift.sandhook.blacklist.HookBlackList; import com.swift.sandhook.blacklist.HookBlackList;
import com.swift.sandhook.wrapper.HookWrapper; import com.swift.sandhook.wrapper.HookWrapper;
import com.swift.sandhook.xposedcompat.XposedCompat; import com.swift.sandhook.xposedcompat.XposedCompat;
import com.swift.sandhook.xposedcompat.classloaders.ComposeClassLoader;
import com.swift.sandhook.xposedcompat.hookstub.HookMethodEntity; import com.swift.sandhook.xposedcompat.hookstub.HookMethodEntity;
import com.swift.sandhook.xposedcompat.hookstub.HookStubManager; import com.swift.sandhook.xposedcompat.hookstub.HookStubManager;
import com.swift.sandhook.xposedcompat.utils.DexLog; import com.swift.sandhook.xposedcompat.utils.DexLog;
...@@ -72,7 +73,7 @@ public final class DynamicBridge { ...@@ -72,7 +73,7 @@ public final class DynamicBridge {
hookMaker = defaultHookMaker; hookMaker = defaultHookMaker;
} }
hookMaker.start(hookMethod, additionalHookInfo, hookMaker.start(hookMethod, additionalHookInfo,
XposedCompat.classLoader, dexDir == null ? null : dexDir.getAbsolutePath()); new ComposeClassLoader(DynamicBridge.class.getClassLoader(), hookMethod.getDeclaringClass().getClassLoader()), dexDir == null ? null : dexDir.getAbsolutePath());
hookedInfo.put(hookMethod, hookMaker.getCallBackupMethod()); hookedInfo.put(hookMethod, hookMaker.getCallBackupMethod());
} }
DexLog.d("hook method <" + hookMethod.toString() + "> cost " + (System.currentTimeMillis() - timeStart) + " ms, by " + (stub != null ? "internal stub" : "dex maker")); DexLog.d("hook method <" + hookMethod.toString() + "> cost " + (System.currentTimeMillis() - timeStart) + " ms, by " + (stub != null ? "internal stub" : "dex maker"));
......
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