mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 07:05:40 -04:00
Fix crash
This commit is contained in:
parent
ec6a13ca39
commit
4c61db11ac
@ -18,8 +18,18 @@ public class JREUtils
|
|||||||
|
|
||||||
private static String nativeLibDir;
|
private static String nativeLibDir;
|
||||||
|
|
||||||
|
private static String findInLdLibPath(String libName) {
|
||||||
|
for (String libPath : Os.getenv("LD_LIBRARY_PATH").split(":")) {
|
||||||
|
File f = new File(libPath, libName);
|
||||||
|
if (f.exists() && f.isFile()) {
|
||||||
|
return f.getAbsolutePath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return libName;
|
||||||
|
}
|
||||||
|
|
||||||
public static void initJavaRuntime() {
|
public static void initJavaRuntime() {
|
||||||
dlopen("libjli.so");
|
dlopen(findInLdLibPath("libjli.so"));
|
||||||
|
|
||||||
// As we set LD_LIBRARY_PATH, so it's not required to preload them
|
// As we set LD_LIBRARY_PATH, so it's not required to preload them
|
||||||
/*
|
/*
|
||||||
@ -156,9 +166,8 @@ public class JREUtils
|
|||||||
private static void setEnvironment(int launchType, String name, String value) throws Throwable {
|
private static void setEnvironment(int launchType, String name, String value) throws Throwable {
|
||||||
if (launchType == Tools.LTYPE_PROCESS) {
|
if (launchType == Tools.LTYPE_PROCESS) {
|
||||||
Tools.mLaunchShell.writeToProcess("export " + name + "=" + value);
|
Tools.mLaunchShell.writeToProcess("export " + name + "=" + value);
|
||||||
} else {
|
|
||||||
Os.setenv(name, value, true);
|
|
||||||
}
|
}
|
||||||
|
Os.setenv(name, value, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static native int chdir(String path);
|
public static native int chdir(String path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user