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

add callOriginByBackup

parent fd058608
...@@ -138,6 +138,13 @@ public class SandHook { ...@@ -138,6 +138,13 @@ public class SandHook {
return callOriginMethod(originMethod, hookEntity.backup, thiz, args); return callOriginMethod(originMethod, hookEntity.backup, thiz, args);
} }
public static Object callOriginByBackup(Method backupMethod, Object thiz, Object... args) throws Throwable {
HookWrapper.HookEntity hookEntity = globalBackupMap.get(backupMethod);
if (hookEntity == null)
return null;
return callOriginMethod(hookEntity.target, backupMethod, thiz, args);
}
public static Object callOriginMethod(Member originMethod, Method backupMethod, Object thiz, Object[] args) throws Throwable { public static Object callOriginMethod(Member originMethod, Method backupMethod, Object thiz, Object[] args) throws Throwable {
backupMethod.setAccessible(true); backupMethod.setAccessible(true);
if (Modifier.isStatic(originMethod.getModifiers())) { if (Modifier.isStatic(originMethod.getModifiers())) {
......
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