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

Try other filenames if apk can't be found #250

Open
wants to merge 1 commit into
base: art
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions app/src/main/java/de/robv/android/xposed/XposedInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -475,9 +475,16 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
private static void loadModule(String apk, ClassLoader topClassLoader) {
Log.i(TAG, "Loading modules from " + apk);

if (!new File(apk).exists()) {
char i = '1';
while (!new File(apk).exists()) {
Log.e(TAG, " File does not exist");
return;
String replacement = apk.replaceFirst("-[1-3]/base\\.apk", "-" + i + "/base.apk");
if (replacement.equals(apk) || i >= '3') {
return;
}
apk = replacement;
Log.e(TAG, " Retrying " + apk);
i++;
}

DexFile dexFile;
Expand Down