diff --git a/README.md b/README.md index 602d07985..420124d20 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/app/src/main/java/com/oracle/dalvik/VMLauncher.java b/app/src/main/java/com/oracle/dalvik/VMLauncher.java index 9586e15fc..70d7aefdc 100644 --- a/app/src/main/java/com/oracle/dalvik/VMLauncher.java +++ b/app/src/main/java/com/oracle/dalvik/VMLauncher.java @@ -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); } diff --git a/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java b/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java index a38d5292d..7b3c9c670 100644 --- a/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java +++ b/app/src/main/java/net/kdt/pojavlaunch/MainActivity.java @@ -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 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 /* diff --git a/app/src/main/jniLibs/arm64-v8a/libRegal.so b/app/src/main/jniLibs/arm64-v8a/libRegal.so deleted file mode 100644 index 6f6a83074..000000000 Binary files a/app/src/main/jniLibs/arm64-v8a/libRegal.so and /dev/null differ diff --git a/app/src/main/jniLibs/arm64-v8a/libbinexecutor.so b/app/src/main/jniLibs/arm64-v8a/libbinexecutor.so index b715a1716..17afd5af6 100644 Binary files a/app/src/main/jniLibs/arm64-v8a/libbinexecutor.so and b/app/src/main/jniLibs/arm64-v8a/libbinexecutor.so differ diff --git a/app/src/main/jniLibs/armeabi-v7a/libbinexecutor.so b/app/src/main/jniLibs/armeabi-v7a/libbinexecutor.so index 882af9568..a7c4104f6 100644 Binary files a/app/src/main/jniLibs/armeabi-v7a/libbinexecutor.so and b/app/src/main/jniLibs/armeabi-v7a/libbinexecutor.so differ diff --git a/app/src/main/jniLibs/x86/libbinexecutor.so b/app/src/main/jniLibs/x86/libbinexecutor.so index 55e22df2e..44dedb9ca 100644 Binary files a/app/src/main/jniLibs/x86/libbinexecutor.so and b/app/src/main/jniLibs/x86/libbinexecutor.so differ diff --git a/app/src/main/jniLibs/x86_64/libbinexecutor.so b/app/src/main/jniLibs/x86_64/libbinexecutor.so index 7e9f51b81..35b7d35ae 100644 Binary files a/app/src/main/jniLibs/x86_64/libbinexecutor.so and b/app/src/main/jniLibs/x86_64/libbinexecutor.so differ