Skip to content

Commit 03ee62a

Browse files
authored
Merge pull request #14 from rhunk/master
Android 14+ support
2 parents 41cd086 + 408daf1 commit 03ee62a

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

app/src/main/java/tw/idv/palatis/xappdebug/xposed/HookMain.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,19 +78,18 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
7878
try {
7979
ApplicationInfo appInfo = (ApplicationInfo) param.getResult();
8080
if (appInfo != null)
81-
checkAndMakeDebuggable(appInfo, ((ApplicationInfo) param.getResult()).packageName, (int) param.args[2]);
81+
checkAndMakeDebuggable(appInfo, appInfo.packageName, (int) param.args[2]);
8282
} catch (Exception e) {
8383
XposedBridge.log(LOG_TAG + ": " + getStackTraceString(e));
8484
}
8585
}
8686
}
8787
);
8888

89-
findAndHookMethod(
90-
PM_CLASS,
91-
lpparam.classLoader,
89+
try {
90+
hookAllMethods(
91+
lpparam.classLoader.loadClass(PM_CLASS),
9292
"getInstalledApplications",
93-
long.class, int.class, int.class, /* flags, userId, callingUid */
9493
new XC_MethodHook() {
9594
@Override
9695
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
@@ -106,7 +105,10 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
106105
}
107106
}
108107
}
109-
);
108+
);
109+
} catch (Exception e) {
110+
XposedBridge.log(LOG_TAG + ": " + getStackTraceString(e));
111+
}
110112

111113
hookAllMethods(
112114
Process.class,

0 commit comments

Comments
 (0)