mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -04:00
JRE lib path improvement
This commit is contained in:
parent
96491e143f
commit
9b4d43d72d
@ -18,7 +18,7 @@ public class JREUtils
|
|||||||
|
|
||||||
private static String nativeLibDir;
|
private static String nativeLibDir;
|
||||||
|
|
||||||
private static String findInLdLibPath(String libName) {
|
public static String findInLdLibPath(String libName) {
|
||||||
for (String libPath : Os.getenv("LD_LIBRARY_PATH").split(":")) {
|
for (String libPath : Os.getenv("LD_LIBRARY_PATH").split(":")) {
|
||||||
File f = new File(libPath, libName);
|
File f = new File(libPath, libName);
|
||||||
if (f.exists() && f.isFile()) {
|
if (f.exists() && f.isFile()) {
|
||||||
@ -121,10 +121,10 @@ public class JREUtils
|
|||||||
|
|
||||||
public static void setJavaEnvironment(Context ctx, int launchType) throws Throwable {
|
public static void setJavaEnvironment(Context ctx, int launchType) throws Throwable {
|
||||||
nativeLibDir = ctx.getApplicationInfo().nativeLibraryDir;
|
nativeLibDir = ctx.getApplicationInfo().nativeLibraryDir;
|
||||||
String libName = System.getProperty("os.arch").contains("64") ? "lib64" : "lib";
|
String libName = Tools.currentArch.contains("64") ? "lib64" : "lib";
|
||||||
|
|
||||||
StringBuilder ldLibraryPath = new StringBuilder();
|
StringBuilder ldLibraryPath = new StringBuilder();
|
||||||
|
/*
|
||||||
for (String arch : Tools.currentArch.split("/")) {
|
for (String arch : Tools.currentArch.split("/")) {
|
||||||
File f = new File(Tools.homeJreDir + "/lib/" + arch);
|
File f = new File(Tools.homeJreDir + "/lib/" + arch);
|
||||||
if (f.exists() && f.isDirectory()) {
|
if (f.exists() && f.isDirectory()) {
|
||||||
@ -133,15 +133,14 @@ public class JREUtils
|
|||||||
ldLibraryPath.append(Tools.homeJreDir + "/lib/" + arch + ":");
|
ldLibraryPath.append(Tools.homeJreDir + "/lib/" + arch + ":");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
if (ldLibraryPath.length() == 0) {
|
|
||||||
ldLibraryPath.append(
|
ldLibraryPath.append(
|
||||||
// To make libjli.so ignore re-execute
|
// To make libjli.so ignore re-execute
|
||||||
Tools.homeJreDir + "/lib/server:" +
|
Tools.homeJreDir + "/" + Tools.homeJreLib + "/server:" +
|
||||||
Tools.homeJreDir + "/lib/jli:" +
|
Tools.homeJreDir + "/" + Tools.homeJreLib + "/lib/jli:" +
|
||||||
Tools.homeJreDir + "/lib:"
|
Tools.homeJreDir + "/" + Tools.homeJreLib + ":"
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
ldLibraryPath.append(
|
ldLibraryPath.append(
|
||||||
"/system/" + libName + ":" +
|
"/system/" + libName + ":" +
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -38,6 +38,7 @@ public final class Tools
|
|||||||
|
|
||||||
// New since 3.0.0
|
// New since 3.0.0
|
||||||
public static String homeJreDir = datapath + "/jre_runtime";
|
public static String homeJreDir = datapath + "/jre_runtime";
|
||||||
|
public static String homeJreLib = "lib";
|
||||||
|
|
||||||
// New since 2.4.2
|
// New since 2.4.2
|
||||||
public static String versnDir = MAIN_PATH + "/versions";
|
public static String versnDir = MAIN_PATH + "/versions";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user