Skip to content

Commit a5207fa

Browse files
committed
Avoid hardcoding core-oj.jar path
1 parent a5b596b commit a5207fa

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

gradle/libs.versions.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ test-ext-junit = { module = "androidx.test.ext:junit", version = "1.2.1" }
55
test-rules = { module = "androidx.test:rules", version = "1.6.1" }
66

77
[plugins]
8-
agp-lib = { id = "com.android.library", version = "8.2.2" }
8+
agp-lib = { id = "com.android.library", version = "8.8.0" }
99
lsplugin-jgit = { id = "org.lsposed.lsplugin.jgit", version = "1.1" }
1010
lsplugin-publish = { id = "org.lsposed.lsplugin.publish", version = "1.1" }
11-

library/src/main/java/org/lsposed/hiddenapibypass/HiddenApiBypass.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import org.lsposed.hiddenapibypass.library.BuildConfig;
2828

29-
import java.io.File;
3029
import java.lang.invoke.MethodHandle;
3130
import java.lang.invoke.MethodHandles;
3231
import java.lang.reflect.Constructor;
@@ -49,12 +48,11 @@
4948
@RequiresApi(Build.VERSION_CODES.P)
5049
class CoreOjClassLoader extends PathClassLoader {
5150
static String getCoreOjPath() {
52-
if (new File("/apex/com.android.art/javalib/core-oj.jar").exists()) {
53-
return "/apex/com.android.art/javalib/core-oj.jar";
54-
} else if (new File("/apex/com.android.runtime/javalib/core-oj.jar").exists()) {
55-
return "/apex/com.android.runtime/javalib/core-oj.jar";
51+
String bootClassPath = System.getenv("BOOTCLASSPATH");
52+
if (bootClassPath == null) {
53+
return "";
5654
}
57-
return "";
55+
return bootClassPath.split(":", 2)[0];
5856
}
5957

6058
public CoreOjClassLoader() {

0 commit comments

Comments
 (0)