Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
fix version
Browse files Browse the repository at this point in the history
  • Loading branch information
david committed Jun 6, 2022
1 parent 89674cf commit 3c12b1d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionName="2.3"
package="cn.myflv.android.noanr">

<application
Expand Down
9 changes: 6 additions & 3 deletions app/src/main/java/cn/myflv/android/noanr/Hook.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
);
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
XposedBridge.log(NO_ANR + " Auto keep process");
XposedHelpers.findAndHookMethod(ClassEnum.AnrHelper, classLoader, MethodEnum.appNotResponding,
ClassEnum.ProcessRecord,
String.class,
Expand Down Expand Up @@ -100,8 +101,9 @@ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
return null;
}
});
} else if (Build.VERSION.SDK_INT==Build.VERSION_CODES.Q){
XposedBridge.log("NoANR -> Android Q");
} else if (Build.VERSION.SDK_INT == Build.VERSION_CODES.Q) {
XposedBridge.log(NO_ANR + " -> Android Q");
XposedBridge.log(NO_ANR + " Force keep process");
XposedHelpers.findAndHookMethod(ClassEnum.ProcessRecord, loadPackageParam.classLoader, MethodEnum.appNotResponding,
String.class, ClassEnum.ApplicationInfo, String.class, ClassEnum.WindowProcessController, boolean.class, String.class, new XC_MethodReplacement() {
@Override
Expand All @@ -110,8 +112,9 @@ protected Object replaceHookedMethod(MethodHookParam param) throws Throwable {
}
});

}else {
} else {
XposedBridge.log("NoANR -> Android N-P");
XposedBridge.log(NO_ANR + " Force keep process");
XposedHelpers.findAndHookMethod(ClassEnum.AppErrors, loadPackageParam.classLoader, MethodEnum.appNotResponding,
ClassEnum.ProcessRecord, ClassEnum.ActivityRecord, ClassEnum.ActivityRecord, boolean.class, String.class,
new XC_MethodReplacement() {
Expand Down

0 comments on commit 3c12b1d

Please sign in to comment.