mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-14 15:17:02 -04:00
[Bug fix] JRE exit code -1 in non-first time launch
This commit is contained in:
parent
00300a6755
commit
c4e56b045c
@ -110,8 +110,9 @@ public class InstallModActivity extends LoggableActivity
|
||||
|
||||
private void launchJavaRuntime(File modFile, String javaArgs) {
|
||||
try {
|
||||
List<String> javaArgList = new ArrayList<String>();
|
||||
JREUtils.relocateLibPath();
|
||||
|
||||
List<String> javaArgList = new ArrayList<String>();
|
||||
javaArgList.add(Tools.homeJreDir + "/bin/java");
|
||||
|
||||
Tools.getJavaArgs(this, javaArgList);
|
||||
|
@ -119,6 +119,16 @@ public class JREUtils
|
||||
Log.i("jrelog-logcat","Logcat thread started");
|
||||
}
|
||||
|
||||
public static void relocateLibPath() {
|
||||
for (String arch : Tools.currentArch.split("/")) {
|
||||
File f = new File(Tools.homeJreDir, "lib/" + arch);
|
||||
if (f.exists() && f.isDirectory()) {
|
||||
Tools.homeJreLib = "lib/" + arch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void setJavaEnvironment(Context ctx, int launchType) throws Throwable {
|
||||
nativeLibDir = ctx.getApplicationInfo().nativeLibraryDir;
|
||||
String libName = Tools.currentArch.contains("64") ? "lib64" : "lib";
|
||||
|
@ -289,13 +289,7 @@ public class PojavLoginActivity extends AppCompatActivity
|
||||
setPref(PREF_IS_INSTALLED_JAVARUNTIME, true);
|
||||
}
|
||||
|
||||
for (String arch : Tools.currentArch.split("/")) {
|
||||
File f = new File(Tools.homeJreDir, "lib/" + arch);
|
||||
if (f.exists() && f.isDirectory()) {
|
||||
Tools.homeJreLib = "lib/" + arch;
|
||||
break;
|
||||
}
|
||||
}
|
||||
JREUtils.relocateLibPath();
|
||||
|
||||
File ftIn = new File(Tools.homeJreDir, Tools.homeJreLib + "/libfreetype.so.6");
|
||||
File ftOut = new File(Tools.homeJreDir, Tools.homeJreLib + "/libfreetype.so");
|
||||
|
@ -75,6 +75,7 @@ public final class Tools
|
||||
public static ShellProcessOperation mLaunchShell;
|
||||
private static int exitCode = 0;
|
||||
public static void launchMinecraft(final LoggableActivity ctx, MCProfile.Builder profile, JMinecraftVersionList.Version versionInfo) throws Throwable {
|
||||
JREUtils.relocateLibPath();
|
||||
String[] launchArgs = getMinecraftArgs(profile, versionInfo);
|
||||
|
||||
List<String> javaArgList = new ArrayList<String>();
|
||||
|
Loading…
x
Reference in New Issue
Block a user