Skip to content

Commit

Permalink
Fix delay hook of sandhook
Browse files Browse the repository at this point in the history
Truly fix #728
  • Loading branch information
LoveSy authored and kotori2 committed Dec 20, 2020
1 parent f93af7c commit d92b051
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

import de.robv.android.xposed.XposedBridge;

import static com.elderdrivers.riru.edxp.util.ClassUtils.shouldDelayHook;

public class SandHookProvider extends BaseHookProvider {
@Override
public void hookMethod(Member method, XposedBridge.AdditionalHookInfo additionalInfo) {
Expand Down Expand Up @@ -50,7 +52,7 @@ public Object invokeOriginalMethod(Member method, long methodId, Object thisObje

@Override
public Member findMethodNative(Member hookMethod) {
return hookMethod;
return shouldDelayHook(hookMethod) ? null : hookMethod;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ public static synchronized void hook(HookWrapper.HookEntity entity) throws HookE
if (SandHookConfig.delayHook && PendingHookHandler.canWork() && ClassStatusUtils.isStaticAndNoInited(entity.target)) {
PendingHookHandler.addPendingHook(entity);
return;
} else if (entity.initClass) {
resolveStaticMethod(target);
}

resolveStaticMethod(backup);
Expand Down

0 comments on commit d92b051

Please sign in to comment.