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