mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-12 06:05:10 -04:00
Replace execute binary with 'JNI_CreateJavaVM'
This commit is contained in:
parent
4918d8d8c4
commit
c55cddf6f1
@ -5,7 +5,7 @@ A Minecraft: Java Edition launcher for Android based from Boardwalk. Support up-
|
||||
- Attempt to run Minecraft in OpenJDK, different a bit with Boardwalk 2.
|
||||
|
||||
## Current status
|
||||
- [x] **Deprecated** ~~BinaryExecutor: execute `java` binary, no `JNIInvocation`.~~
|
||||
- [x] **Removed** ~~BinaryExecutor: execute `java` binary, no `JNIInvocation`.~~
|
||||
- [x] JVDroid OpenJDK 11 (32 and 64-bit ARM and x86). Partial, no error `can't lock mutex`, but now exit with none output.
|
||||
- [ ] AWT/Swing for mod installer. Will use `Caciocavallo` project.
|
||||
- [ ] OpenGL in OpenJDK environment. Use Boardwalk 2 method or other.
|
||||
|
@ -4,4 +4,6 @@ public final class VMLauncher {
|
||||
private VMLauncher() {
|
||||
}
|
||||
public static native int launchJVM(String[] args);
|
||||
|
||||
public static native int createLaunchMainJVM(String[] vmArgs, String mainClass, String[] mainArgs);
|
||||
}
|
||||
|
@ -124,8 +124,8 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
|
||||
private static final int LTYPE_PROCESS = 0;
|
||||
private static final int LTYPE_INVOCATION = 1;
|
||||
private static final int LTYPE_BINARYEXEC = 2;
|
||||
private final int LAUNCH_TYPE = LTYPE_INVOCATION;
|
||||
private static final int LTYPE_CREATEJAVAVM = 2;
|
||||
private final int LAUNCH_TYPE = LTYPE_CREATEJAVAVM;
|
||||
// LTYPE_INVOCATION;
|
||||
|
||||
// private static Collection<? extends Provider.Service> rsaPkcs1List;
|
||||
@ -1053,11 +1053,16 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
javaArgList.add("-Dminecraft.launcher.version=" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||
}
|
||||
|
||||
javaArgList.add("-cp");
|
||||
javaArgList.add(Tools.generateLaunchClassPath(mProfile.getVersion()));
|
||||
javaArgList.add(mVersionInfo.mainClass);
|
||||
javaArgList.addAll(Arrays.asList(launchArgs));
|
||||
|
||||
String launchClassPath = Tools.generateLaunchClassPath(mProfile.getVersion());
|
||||
if (LAUNCH_TYPE == LTYPE_CREATEJAVAVM) {
|
||||
javaArgList.add("-Djava.library.path=" + launchClassPath);
|
||||
} else {
|
||||
javaArgList.add("-cp");
|
||||
javaArgList.add(launchClassPath);
|
||||
javaArgList.add(mVersionInfo.mainClass);
|
||||
javaArgList.addAll(Arrays.asList(launchArgs));
|
||||
}
|
||||
|
||||
if (LAUNCH_TYPE == LTYPE_PROCESS) {
|
||||
mLaunchShell = new ShellProcessOperation(new ShellProcessOperation.OnPrintListener(){
|
||||
|
||||
@ -1128,8 +1133,8 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
||||
startStrace(android.os.Process.myTid());
|
||||
}
|
||||
|
||||
if (LAUNCH_TYPE == LTYPE_BINARYEXEC) {
|
||||
BinaryExecutor.executeBinary(javaArgList.toArray(new String[0]));
|
||||
if (LAUNCH_TYPE == LTYPE_CREATEJAVAVM) {
|
||||
VMLauncher.createLaunchMainJVM(javaArgList.toArray(new String[0]), mVersionInfo.mainClass, launchArgs);
|
||||
} else {
|
||||
// Test
|
||||
/*
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user