mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-13 14:51:51 -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.
|
- Attempt to run Minecraft in OpenJDK, different a bit with Boardwalk 2.
|
||||||
|
|
||||||
## Current status
|
## 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.
|
- [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.
|
- [ ] AWT/Swing for mod installer. Will use `Caciocavallo` project.
|
||||||
- [ ] OpenGL in OpenJDK environment. Use Boardwalk 2 method or other.
|
- [ ] OpenGL in OpenJDK environment. Use Boardwalk 2 method or other.
|
||||||
|
@ -4,4 +4,6 @@ public final class VMLauncher {
|
|||||||
private VMLauncher() {
|
private VMLauncher() {
|
||||||
}
|
}
|
||||||
public static native int launchJVM(String[] args);
|
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_PROCESS = 0;
|
||||||
private static final int LTYPE_INVOCATION = 1;
|
private static final int LTYPE_INVOCATION = 1;
|
||||||
private static final int LTYPE_BINARYEXEC = 2;
|
private static final int LTYPE_CREATEJAVAVM = 2;
|
||||||
private final int LAUNCH_TYPE = LTYPE_INVOCATION;
|
private final int LAUNCH_TYPE = LTYPE_CREATEJAVAVM;
|
||||||
// LTYPE_INVOCATION;
|
// LTYPE_INVOCATION;
|
||||||
|
|
||||||
// private static Collection<? extends Provider.Service> rsaPkcs1List;
|
// private static Collection<? extends Provider.Service> rsaPkcs1List;
|
||||||
@ -1053,10 +1053,15 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
|||||||
javaArgList.add("-Dminecraft.launcher.version=" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
javaArgList.add("-Dminecraft.launcher.version=" + getPackageManager().getPackageInfo(getPackageName(), 0).versionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
javaArgList.add("-cp");
|
String launchClassPath = Tools.generateLaunchClassPath(mProfile.getVersion());
|
||||||
javaArgList.add(Tools.generateLaunchClassPath(mProfile.getVersion()));
|
if (LAUNCH_TYPE == LTYPE_CREATEJAVAVM) {
|
||||||
javaArgList.add(mVersionInfo.mainClass);
|
javaArgList.add("-Djava.library.path=" + launchClassPath);
|
||||||
javaArgList.addAll(Arrays.asList(launchArgs));
|
} else {
|
||||||
|
javaArgList.add("-cp");
|
||||||
|
javaArgList.add(launchClassPath);
|
||||||
|
javaArgList.add(mVersionInfo.mainClass);
|
||||||
|
javaArgList.addAll(Arrays.asList(launchArgs));
|
||||||
|
}
|
||||||
|
|
||||||
if (LAUNCH_TYPE == LTYPE_PROCESS) {
|
if (LAUNCH_TYPE == LTYPE_PROCESS) {
|
||||||
mLaunchShell = new ShellProcessOperation(new ShellProcessOperation.OnPrintListener(){
|
mLaunchShell = new ShellProcessOperation(new ShellProcessOperation.OnPrintListener(){
|
||||||
@ -1128,8 +1133,8 @@ public class MainActivity extends AppCompatActivity implements OnTouchListener,
|
|||||||
startStrace(android.os.Process.myTid());
|
startStrace(android.os.Process.myTid());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LAUNCH_TYPE == LTYPE_BINARYEXEC) {
|
if (LAUNCH_TYPE == LTYPE_CREATEJAVAVM) {
|
||||||
BinaryExecutor.executeBinary(javaArgList.toArray(new String[0]));
|
VMLauncher.createLaunchMainJVM(javaArgList.toArray(new String[0]), mVersionInfo.mainClass, launchArgs);
|
||||||
} else {
|
} else {
|
||||||
// Test
|
// 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