Skip to content

Commit

Permalink
Android 13 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
M66B committed Sep 12, 2022
1 parent bfcc22a commit 3215170
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
9 changes: 0 additions & 9 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

7 changes: 5 additions & 2 deletions app/src/main/java/eu/faircode/xlua/XLua.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import android.content.pm.PackageInfo;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Process;
Expand Down Expand Up @@ -240,8 +241,10 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {

private void hookApplication(final XC_LoadPackage.LoadPackageParam lpparam) throws Throwable {
final int uid = Process.myUid();
Class<?> at = Class.forName("android.app.LoadedApk", false, lpparam.classLoader);
XposedBridge.hookAllMethods(at, "makeApplication", new XC_MethodHook() {
final boolean tiramisu = (Build.VERSION.SDK_INT >= 33);
// https://android.googlesource.com/platform/frameworks/base/+/169aeafb2d97b810ae123ad036d0c58336961c55%5E%21/#F1
Class<?> at = Class.forName(tiramisu ? "android.app.Instrumentation" : "android.app.LoadedApk", false, lpparam.classLoader);
XposedBridge.hookAllMethods(at, tiramisu ? "newApplication" : "makeApplication", new XC_MethodHook() {
private boolean made = false;

@Override
Expand Down

0 comments on commit 3215170

Please sign in to comment.