Skip to content

Commit

Permalink
Revert "Suspend all threads when doing hook stuffs to prevent crashes…
Browse files Browse the repository at this point in the history
… caused by GC"

This reverts commit 2ac5eb1
  • Loading branch information
solohsu committed Mar 5, 2019
1 parent 2820493 commit 4b38f4a
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.elderdrivers.riru.xposed.core;

import com.elderdrivers.riru.xposed.Main;
import com.elderdrivers.riru.xposed.entry.hooker.OnePlusWorkAroundHooker;
import com.elderdrivers.riru.xposed.util.Utils;

Expand Down Expand Up @@ -112,13 +111,8 @@ public static void backupAndHook(Object target, Method hook, Method backup) {
if (backup != null) {
HookMethodResolver.resolveMethod(hook, backup);
}
long obj = Main.suspendAllThreads();
try {
if (!backupAndHookNative(target, hook, backup)) {
throw new RuntimeException("Failed to hook " + target + " with " + hook);
}
} finally {
Main.resumeAllThreads(obj);
if (!backupAndHookNative(target, hook, backup)) {
throw new RuntimeException("Failed to hook " + target + " with " + hook);
}
}

Expand Down

0 comments on commit 4b38f4a

Please sign in to comment.