Commit dbf10a1d authored by swift_gan's avatar swift_gan

check hooked in java

parent 97828311
......@@ -59,8 +59,10 @@ public class SandHook {
HookWrapper.addHookClass(classLoader, hookWrapperClass);
}
public static void hook(HookWrapper.HookEntity entity) throws HookErrorException {
public static synchronized void hook(HookWrapper.HookEntity entity) throws HookErrorException {
if (entity.target != null && entity.hook != null) {
if (globalHookEntityMap.containsKey(entity.target))
throw new HookErrorException("method <" + entity.target.getName() + "> has been hooked!");
if (!SandHook.hook(entity.target, entity.hook, entity.backup)) {
throw new HookErrorException("hook method <" + entity.target.getName() + "> error in native!");
}
......
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