Revert "Suspend all threads when doing hook stuffs to prevent crashes caused by GC"

This reverts commit 2ac5eb1
This commit is contained in:
solohsu 2019-03-05 22:59:30 +08:00
parent 28204939d1
commit 4b38f4af5a
1 changed files with 2 additions and 8 deletions

View File

@ -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;
@ -112,13 +111,8 @@ public class HookMain {
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);
}
}