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

Commit

Permalink
Further fix for Android 13
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr-TSNG committed Oct 23, 2022
1 parent f6c09a0 commit 0bc6407
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions meta-loader/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ androidComponents.onVariants { variant ->
dependencies {
compileOnly(projects.hiddenapi.stubs)
implementation(projects.share.java)
implementation("org.lsposed.hiddenapibypass:hiddenapibypass:4.3")
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import android.util.JsonReader;
import android.util.Log;

import org.lsposed.hiddenapibypass.HiddenApiBypass;
import org.lsposed.lspatch.share.Constants;

import java.io.ByteArrayOutputStream;
Expand Down Expand Up @@ -68,7 +69,7 @@ public class LSPAppComponentFactoryStub extends AppComponentFactory {
var ipm = IPackageManager.Stub.asInterface(ServiceManager.getService("package"));
ApplicationInfo manager;
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
manager = ipm.getApplicationInfo(Constants.MANAGER_PACKAGE_NAME, 0L, 0);
manager = (ApplicationInfo) HiddenApiBypass.invoke(IPackageManager.class, ipm, "getApplicationInfo", Constants.MANAGER_PACKAGE_NAME, 0L, 0);
} else {
manager = ipm.getApplicationInfo(Constants.MANAGER_PACKAGE_NAME, 0, 0);
}
Expand Down

0 comments on commit 0bc6407

Please sign in to comment.