Skip to content

Commit

Permalink
Merge pull request #5 from whew-inc/compatibility
Browse files Browse the repository at this point in the history
Compatibility
  • Loading branch information
whew-inc authored Jun 23, 2022
2 parents e4c315d + 74d327f commit b5827ed
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "com.thermatk.android.xf.fakegapps"
minSdkVersion 15
targetSdkVersion 32
versionCode 7
versionName "3.3"
versionCode 8
versionName "4"
}
signingConfigs {
release {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.pm.PackageInfo;
import android.content.pm.Signature;
import android.os.Build;

import de.robv.android.xposed.IXposedHookLoadPackage;
import de.robv.android.xposed.XC_MethodHook;
Expand Down Expand Up @@ -31,14 +32,9 @@ protected void afterHookedMethod(MethodHookParam param) {
}
};

Class<?> PackageManagerServiceComputer = null;
try {
PackageManagerServiceComputer = XposedHelpers.findClass("com.android.server.pm.PackageManagerService.ComputerEngine", loadedPackage.classLoader);
} catch (Exception ignored) {}
if (PackageManagerServiceComputer != null) {
XposedBridge.hookAllMethods(PackageManagerServiceComputer, "generatePackageInfo", hook);
}
final Class<?> PackageManagerService = XposedHelpers.findClass("com.android.server.pm.PackageManagerService", loadedPackage.classLoader);
XposedBridge.hookAllMethods(PackageManagerService, "generatePackageInfo", hook);
String classToHook = Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ?
"com.android.server.pm.PackageManagerService.ComputerEngine" : "com.android.server.pm.PackageManagerService";
final Class<?> hookedClass = XposedHelpers.findClass(classToHook, loadedPackage.classLoader);
XposedBridge.hookAllMethods(hookedClass, "generatePackageInfo", hook);
}
}

0 comments on commit b5827ed

Please sign in to comment.