From a6dab4966e547c6da69f0d7c0763f4b7b4519449 Mon Sep 17 00:00:00 2001
From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com>
Date: Wed, 19 Jan 2022 05:28:09 +0700
Subject: [PATCH 1/8] Update strings.xml
Application/Game exited with code %d**, check latestlog.txt for more details.**
---
app_pojavlauncher/src/main/res/values/strings.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app_pojavlauncher/src/main/res/values/strings.xml b/app_pojavlauncher/src/main/res/values/strings.xml
index 35db18ff60..79949acaa4 100644
--- a/app_pojavlauncher/src/main/res/values/strings.xml
+++ b/app_pojavlauncher/src/main/res/values/strings.xml
@@ -127,7 +127,7 @@
Wait
- Application/Game exited with code %d
+ Application/Game exited with code %d, check latestlog.txt for more details.
Exit
Are you sure want to force close?
LWJGL3 was not installed!
From 8ede547b1a73823b3f47883c436ec8c2cbc19c99 Mon Sep 17 00:00:00 2001
From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com>
Date: Wed, 19 Jan 2022 05:41:40 +0700
Subject: [PATCH 2/8] Update bug_report.yml
Mark "The log file and images/videos" as required
---
.github/ISSUE_TEMPLATE/bug_report.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 7aeb60f57f..9ce4cda62a 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -22,7 +22,7 @@ body:
Tip: You can attach files by clicking this area to highlight it and then dragging files in or select them on 🖼 option at the toolbar.
validations:
- required: false
+ required: true
- type: textarea
attributes:
From 7f238a1890a0b9ee186f91e0a7eeb33d1f540924 Mon Sep 17 00:00:00 2001
From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com>
Date: Wed, 19 Jan 2022 05:44:10 +0700
Subject: [PATCH 3/8] gl4es update: skip if fails
---
.github/workflows/android.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml
index 364b659434..804c1475c2 100644
--- a/.github/workflows/android.yml
+++ b/.github/workflows/android.yml
@@ -60,6 +60,7 @@ jobs:
- name: Install gl4es
if: github.ref == 'refs/heads/v3_openjdk' && steps.gl4es-cache.outputs.cache-hit != 'true'
+ continue-on-error: true
run: |
cp -R gl4es/libs/* app_pojavlauncher/src/main/jniLibs/
mv gl4es ..
From 658c937d73a50ff7b7292832d4573fc7b7a72437 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Tue, 18 Jan 2022 22:47:48 +0000
Subject: [PATCH 4/8] CI: Update vgpu
---
.../src/main/jniLibs/arm64-v8a/libvgpu.so | Bin 1483824 -> 1483824 bytes
.../src/main/jniLibs/armeabi-v7a/libvgpu.so | Bin 1155432 -> 1155432 bytes
.../src/main/jniLibs/x86/libvgpu.so | Bin 1474856 -> 1474856 bytes
.../src/main/jniLibs/x86_64/libvgpu.so | Bin 1623432 -> 1623432 bytes
gl4es | 1 +
5 files changed, 1 insertion(+)
create mode 160000 gl4es
diff --git a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/libvgpu.so b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/libvgpu.so
index 79a1535403a1ba34d3f0922286969b60f0a01c6e..b2b56ce5aa9128bbfe3ac4099c519c81442be8aa 100644
GIT binary patch
delta 150
zcmdmRB5DH=2{4I7+q&rfcYo^V91z2NZqMhdM*Yi$npK$ERhSro7(_DzF$)m00x=s9
zvjZ^)5OV@C7Z7s;F%J;)0x=&D^8>K}5DNma&~_Cj;gx+NUWs`Mh87A&21Z5rFA(zqF+UIs0I?tt3vE|n5?Gy!fS47C
z*?^cGh&h0m6NtHhm>Y`m(F9o@|z7~4NEf-n;hGXpUT5VHa?
z8xXStF$WNH0x=g5a|1CC5c2{t9}x2cu>cSYZvVh2wDP5hS7M%mp@o8xfsqk|k&%^&
YnU#ro``Xt+Kr9TzBHP!#7OkEN0OdkE(f|Me
delta 146
zcmZ3{6t$u$YQr5y5v2w(%|-Q`TUmvDwxw<_f6c6Mma+K*WBUh25M}~mW*}w(Vpbq#
z17da{<^W<&Am##MZXo6XVqPHT17dz4764+w?H?G0R=yPR%P&(fG*vJ%FfwE?GPE)_
XvobJkU;A1Jh=qYzWc%9JqSaFYM1(l4
diff --git a/app_pojavlauncher/src/main/jniLibs/x86_64/libvgpu.so b/app_pojavlauncher/src/main/jniLibs/x86_64/libvgpu.so
index 36fbf6a31152c5a3cd925034f7c8da1f1a80bdf5..d4e0888495d8c19f513190abce5f6e1e0c4e7d7c 100644
GIT binary patch
delta 162
zcmeC^PVVSV-mrp6hy47#u6o>PY*Bij!c>rwJ#VrilT7msruG|5j6e*cnSq!E
zh*^P{4T#x+m;;D8ftU-3xq+Amhm!N|zU#N5irxV>?@2oQ?`u^14GZ*QC~!LA1YL
Date: Sun, 30 Jan 2022 16:44:49 +0700
Subject: [PATCH 5/8] Changes - Java architecture check is now performed in the
Runtime Manager dialog. - Required Java version is now stated when launching
1.17+ without it installed. - [Mod installer] Java version is now checked
before displaying the file picker. Java 8 is now automatically selected. -
[Mod installer] Brought back "Launch with custom arguments", can be accessed
by long-pressing the "Install .jar" button.
---
.../kdt/pojavlaunch/BaseLauncherActivity.java | 9 ++++++++
.../net/kdt/pojavlaunch/BaseMainActivity.java | 2 +-
.../pojavlaunch/JavaGUILauncherActivity.java | 17 +++++++--------
.../kdt/pojavlaunch/multirt/MultiRTUtils.java | 9 ++++++++
.../multirt/RTRecyclerViewAdapter.java | 9 ++++++--
.../tasks/MinecraftDownloaderTask.java | 2 +-
.../net/kdt/pojavlaunch/utils/JREUtils.java | 21 +++++++------------
.../src/main/res/values/strings.xml | 5 +++--
8 files changed, 45 insertions(+), 29 deletions(-)
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseLauncherActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseLauncherActivity.java
index 668050da2e..b891d72276 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseLauncherActivity.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseLauncherActivity.java
@@ -65,6 +65,10 @@ public void installJarFile(View view){
public static final int RUN_MOD_INSTALLER = 2050;
private void installMod(boolean customJavaArgs) {
+ if (MultiRTUtils.getExactJREName(8) == null) {
+ Toast.makeText(this, R.string.multirt_nojava8rt, Toast.LENGTH_LONG).show();
+ return;
+ }
if (customJavaArgs) {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.alerttitle_installmod);
@@ -149,6 +153,11 @@ protected void onResumeFragments() {
mRuntimeConfigDialog = new MultiRTConfigDialog();
mRuntimeConfigDialog.prepare(this);
+ ((Button)findViewById(R.id.installJarButton)).setOnLongClickListener(view -> {
+ installMod(true);
+ return true;
+ });
+
//TODO ADD CRASH CHECK AND FOCUS
System.out.println("call to onResumeFragments; E");
}
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java
index 030089eb10..ea46a30bb2 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/BaseMainActivity.java
@@ -183,7 +183,7 @@ private void runCraft() throws Throwable {
checkLWJGL3Installed();
JREUtils.jreReleaseList = JREUtils.readJREReleaseProperties();
- JREUtils.checkJavaArchitecture(this, JREUtils.jreReleaseList.get("OS_ARCH"));
+ Logger.getInstance().appendToLog("Architecture: " + Architecture.archAsString(Tools.DEVICE_ARCHITECTURE));
checkJavaArgsIsLaunchable(JREUtils.jreReleaseList.get("JAVA_VERSION"));
// appendlnToLog("Info: Custom Java arguments: \"" + LauncherPreferences.PREF_CUSTOM_JAVA_ARGS + "\"");
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/JavaGUILauncherActivity.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/JavaGUILauncherActivity.java
index fdeefa8828..ca77a0e0f5 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/JavaGUILauncherActivity.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/JavaGUILauncherActivity.java
@@ -67,8 +67,15 @@ protected void onCreate(Bundle savedInstanceState) {
Logger.getInstance().reset();
try {
+ JREUtils.jreReleaseList = JREUtils.readJREReleaseProperties(LauncherPreferences.PREF_DEFAULT_RUNTIME);
+ if (JREUtils.jreReleaseList.get("JAVA_VERSION").equals("1.8.0")) {
+ MultiRTUtils.setRuntimeNamed(this,LauncherPreferences.PREF_DEFAULT_RUNTIME);
+ } else {
+ MultiRTUtils.setRuntimeNamed(this,MultiRTUtils.getExactJREName(8));
+ JREUtils.jreReleaseList = JREUtils.readJREReleaseProperties();
+ }
+
loggerView = findViewById(R.id.launcherLoggerView);
- MultiRTUtils.setRuntimeNamed(this,LauncherPreferences.PREF_DEFAULT_RUNTIME);
gestureDetector = new GestureDetector(this, new SingleTapConfirm());
findViewById(R.id.installmod_mouse_pri).setOnTouchListener(this);
@@ -278,14 +285,6 @@ private int doCustomInstall(File modFile, String javaArgs) throws IOException {
public int launchJavaRuntime(File modFile, String javaArgs) {
JREUtils.redirectAndPrintJRELog(this);
try {
- JREUtils.jreReleaseList = JREUtils.readJREReleaseProperties();
-
- // Fail immediately when Java 8 is not selected
- // TODO: auto override Java 8 if installed
- if (!JREUtils.jreReleaseList.get("JAVA_VERSION").equals("1.8.0")) {
- throw new RuntimeException("Cannot use the mod installer. In order to use the mod installer, you need to install Java 8 and specify it in the Preferences menu.");
- }
-
List javaArgList = new ArrayList();
// Enable Caciocavallo
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/MultiRTUtils.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/MultiRTUtils.java
index a5f717ca58..3cf4ab32cf 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/MultiRTUtils.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/MultiRTUtils.java
@@ -63,6 +63,15 @@ public static List getRuntimes() {
return ret;
}
+ public static String getExactJREName(int majorVersion) {
+ List runtimes = getRuntimes();
+ for(Runtime r : runtimes) {
+ if(r.javaVersion == majorVersion) {
+ return r.name;
+ }
+ }
+ return null;
+ }
public static String getNearestJREName(int majorVersion) {
List runtimes = getRuntimes();
int diff_factor = Integer.MAX_VALUE;
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java
index e268f773a9..db65ee55c3 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java
@@ -14,6 +14,7 @@
import androidx.appcompat.app.AlertDialog;
import androidx.recyclerview.widget.RecyclerView;
+import net.kdt.pojavlaunch.Architecture;
import net.kdt.pojavlaunch.R;
import net.kdt.pojavlaunch.Tools;
import net.kdt.pojavlaunch.prefs.LauncherPreferences;
@@ -71,7 +72,7 @@ public RTViewHolder(View itemView) {
public void bindRuntime(MultiRTUtils.Runtime rt, int pos) {
currentRuntime = rt;
currentPosition = pos;
- if(rt.versionString != null) {
+ if(rt.versionString != null && Tools.DEVICE_ARCHITECTURE == Architecture.archAsInt(rt.arch)) {
javaVersionView.setText(ctx.getString(R.string.multirt_java_ver, rt.name, rt.javaVersion));
fullJavaVersionView.setText(rt.versionString);
fullJavaVersionView.setTextColor(defaultColors);
@@ -80,8 +81,12 @@ public void bindRuntime(MultiRTUtils.Runtime rt, int pos) {
setDefaultButton.setEnabled(!default_);
setDefaultButton.setText(default_?R.string.multirt_config_setdefault_already:R.string.multirt_config_setdefault);
}else{
+ if(rt.versionString == null){
+ fullJavaVersionView.setText(R.string.multirt_runtime_corrupt);
+ }else{
+ fullJavaVersionView.setText(ctx.getString(R.string.multirt_runtime_incompatiblearch, rt.arch));
+ }
javaVersionView.setText(rt.name);
- fullJavaVersionView.setText(R.string.multirt_runtime_corrupt);
fullJavaVersionView.setTextColor(Color.RED);
setDefaultButton.setVisibility(View.GONE);
}
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/tasks/MinecraftDownloaderTask.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/tasks/MinecraftDownloaderTask.java
index 3fdd296fdc..b560a505a7 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/tasks/MinecraftDownloaderTask.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/tasks/MinecraftDownloaderTask.java
@@ -107,7 +107,7 @@ public void updateProgress(int curr, int max) {
mActivity.runOnUiThread(()->{
AlertDialog.Builder bldr = new AlertDialog.Builder(mActivity);
bldr.setTitle(R.string.global_error);
- bldr.setMessage(R.string.multirt_nocompartiblert);
+ bldr.setMessage(mActivity.getString(R.string.multirt_nocompartiblert, verInfo.javaVersion.majorVersion));
bldr.setPositiveButton(android.R.string.ok,(dialog, which)->{
dialog.dismiss();
});
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java
index 1e1dfcf7cc..285d76c5d1 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java
@@ -35,19 +35,6 @@ private JREUtils() {}
private static String nativeLibDir;
public static Map jreReleaseList;
- /**
- * Checks if the java architecture is correct for the device architecture.
- * @param activity Some context to load resources from
- * @param jreArch The java architecture to compare as a String.
- */
- public static void checkJavaArchitecture(Activity activity, String jreArch) {
- Logger.getInstance().appendToLog("Architecture: " + archAsString(Tools.DEVICE_ARCHITECTURE));
- if(Tools.DEVICE_ARCHITECTURE == Architecture.archAsInt(jreArch)) return;
-
- Logger.getInstance().appendToLog("Architecture " + archAsString(Tools.DEVICE_ARCHITECTURE) + " is incompatible with Java Runtime " + jreArch);
- Tools.dialogOnUiThread(activity, "", activity.getString(R.string.mcn_check_fail_incompatiblearch, archAsString(Tools.DEVICE_ARCHITECTURE), jreArch));
- }
-
public static String findInLdLibPath(String libName) {
if(Os.getenv("LD_LIBRARY_PATH")==null) {
try {
@@ -104,8 +91,14 @@ public static void initJavaRuntime() {
}
public static Map readJREReleaseProperties() throws IOException {
+ return readJREReleaseProperties(Tools.DIR_HOME_JRE);
+ }
+ public static Map readJREReleaseProperties(String name) throws IOException {
Map jreReleaseMap = new ArrayMap<>();
- BufferedReader jreReleaseReader = new BufferedReader(new FileReader(Tools.DIR_HOME_JRE + "/release"));
+ if (!name.contains("/")) {
+ name = Tools.MULTIRT_HOME + "/" + name;
+ }
+ BufferedReader jreReleaseReader = new BufferedReader(new FileReader(name + "/release"));
String currLine;
while ((currLine = jreReleaseReader.readLine()) != null) {
if (!currLine.isEmpty() || currLine.contains("=")) {
diff --git a/app_pojavlauncher/src/main/res/values/strings.xml b/app_pojavlauncher/src/main/res/values/strings.xml
index 79949acaa4..7d548bb950 100644
--- a/app_pojavlauncher/src/main/res/values/strings.xml
+++ b/app_pojavlauncher/src/main/res/values/strings.xml
@@ -131,7 +131,6 @@
Exit
Are you sure want to force close?
LWJGL3 was not installed!
- Architecture %1$s is incompatible with Java Runtime %2$s.
Vulkan Zink renderer is not supported on this device!
@@ -238,6 +237,7 @@
Controls how much memory is given to Minecraft
%s (Java %d)
Corrupted Java Runtime
+ Incompatible architecture: %s
Java VMs
Add new
Import new Java VM
@@ -247,7 +247,8 @@
Set default
Default
You must have at least one Java Runtime installed
- Can\'t find any compartible Java Runtime
+ Can\'t find any compartible Java Runtime. This version requires Java %d or newer.
+ Can\'t find Java 8. In order to use this option, you need to install Java 8.
Minecraft 21w10a+ requires the OpenGL 3.2 core profile. Sadly, GL4ES wrapper doesn\'t fully support it at the moment, but there are some additional resources you can install to run these versions. Press OK to confirm installation, and press Cancel to abort launch.
Play anyway
From cb4167c7611b53f7d9779c0990974780d4499e44 Mon Sep 17 00:00:00 2001
From: github-actions
Date: Sun, 30 Jan 2022 09:49:29 +0000
Subject: [PATCH 6/8] CI: Update vgpu
---
.../src/main/jniLibs/arm64-v8a/libvgpu.so | Bin 1483824 -> 1483824 bytes
.../src/main/jniLibs/armeabi-v7a/libvgpu.so | Bin 1155432 -> 1155432 bytes
.../src/main/jniLibs/x86/libvgpu.so | Bin 1474856 -> 1474856 bytes
.../src/main/jniLibs/x86_64/libvgpu.so | Bin 1623432 -> 1623432 bytes
4 files changed, 0 insertions(+), 0 deletions(-)
diff --git a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/libvgpu.so b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/libvgpu.so
index b2b56ce5aa9128bbfe3ac4099c519c81442be8aa..b9eead908e19fc685e4575a96bb381ab7be4440f 100644
GIT binary patch
delta 146
zcmdmRB5DH=2{4IxeA>sl=HgqMAfZmB{ZW_7m&-qy+N{FVuEN9!#2}g(h*^M`6^Pk@
zm>q~YfS41Axqz4(h-A*fLIWSg|@3O39s!FFg8#yGB7e?FtD^TF}E@{
UZ+|#J7>GrHSakct31a@j0M8&QMgRZ+
delta 146
zcmdmRB5DH=2{4I7+q&rfcYo^V91z2NZqMhdM*Yi$npK$ERhSro7(_DzF$)m00x=s9
zvjZ^)5OV@C7Z7s;F%J;)0x=&D^8>K}5DNma&~_Cj;kA7Nh87A&21Z5p0-E>{2m
delta 126
zcmaEH$nC`;w+(j~MIP;utks^)pCNmxo~x&H!{?ZmkZa8!7~4NEf-n;hGXpUT5VHa?
z8xXStF$WNH0x=g5a|1CC5c2{t9}x3z|G+5V%P3%Ipc}Fty7XBebzO9U~K=u2*ON2%nZaVK+Fon
zY(UHo#2i4(3B+7L%nigmK+Frod_c?(!~#Gpxcvj8(At**#s&&T21Z5<29{PP7FH$(
U?Q35P0kJR;i)>%}TC{p906u3sAOHXW
delta 142
zcmZ3{6t$u$YQr5yk+yGVFEIaFWMr$e@yo`I>`m(F9o@|z7~4NEf-n;hGXpUT5VHa?
z8xXStF$WNH0x=g5a|1CC5c2{t9}x2cu>cSYZvVh2wDzTdp@o8xfsqk|k&%^&nU#ro
U``Xt+Kr9TzBHP!#7OkEN00JdCnE(I)
diff --git a/app_pojavlauncher/src/main/jniLibs/x86_64/libvgpu.so b/app_pojavlauncher/src/main/jniLibs/x86_64/libvgpu.so
index d4e0888495d8c19f513190abce5f6e1e0c4e7d7c..68ed10f0321d3821ca44b389875040fc339e35fe 100644
GIT binary patch
delta 158
zcmeC^PVVSV-mrp6#PwUZ8c*cm8xz7+ZNgbw11~-}w|lZ8lT7msruG|5j6e*cnSq!E
zh*^P{4T#x+m;;D8ftU-3xq+Amhm
f!NAhW#L~*ZqP=mt2oQ?`u^14GZ*QC~!LA1Y`6D^z
delta 158
zcmeC^PVVSV-mrp6hy47#u6o>PY*Bij!c>rwJ#VrilT7msruG|5j6e*cnSq!E
zh*^P{4T#x+m;;D8ftU-3xq+Amhm
f!N|zU#N5irxV>?@2oQ?`u^14GZ*QC~!LA1YSP?pM
From fb7a4b2407145295ed52819911138b23095ecd2e Mon Sep 17 00:00:00 2001
From: Duy Tran Khanh <40482367+khanhduytran0@users.noreply.github.com>
Date: Sun, 30 Jan 2022 17:20:18 +0700
Subject: [PATCH 7/8] Allow remove the only runtime left if corrupt or
incompatible
---
.../java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java
index db65ee55c3..54bb5a4f81 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/multirt/RTRecyclerViewAdapter.java
@@ -96,7 +96,7 @@ public void bindRuntime(MultiRTUtils.Runtime rt, int pos) {
public void onClick(View v) {
if(v.getId() == R.id.multirt_view_removebtn) {
if (currentRuntime != null) {
- if(MultiRTUtils.getRuntimes().size() < 2) {
+ if(MultiRTUtils.getRuntimes().size() < 2 && setDefaultButton.isShown()) {
AlertDialog.Builder bldr = new AlertDialog.Builder(ctx);
bldr.setTitle(R.string.global_error);
bldr.setMessage(R.string.multirt_config_removeerror_last);
From 97dace30c53cb462736e4efba45a1f0b9d7c4b38 Mon Sep 17 00:00:00 2001
From: artDev
Date: Fri, 4 Feb 2022 17:18:42 +0300
Subject: [PATCH 8/8] - Prepend java as argv[0] - Fix override mechanism
---
.../net/kdt/pojavlaunch/utils/JREUtils.java | 28 +++++++++++--------
.../src/main/res/values/strings.xml | 3 +-
2 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java
index 285d76c5d1..f62ce4dfac 100644
--- a/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java
+++ b/app_pojavlauncher/src/main/java/net/kdt/pojavlaunch/utils/JREUtils.java
@@ -317,6 +317,7 @@ public static int launchJavaVM(final Activity activity,final List JVMArg
initJavaRuntime();
setupExitTrap(activity.getApplication());
chdir(Tools.DIR_GAME_NEW);
+ userArgs.add(0,"java"); //argv[0] is the program name according to C standard.
final int exitCode = VMLauncher.launchJVM(userArgs.toArray(new String[0]));
Logger.getInstance().appendToLog("Java Exit code: " + exitCode);
@@ -340,6 +341,8 @@ public static int launchJavaVM(final Activity activity,final List JVMArg
*/
public static List getJavaArgs(Context ctx) {
List userArguments = parseJavaArguments(LauncherPreferences.PREF_CUSTOM_JAVA_ARGS);
+ String resolvFile;
+ resolvFile = new File(Tools.DIR_DATA,"resolv.conf").getAbsolutePath();
String[] overridableArguments = new String[]{
"-Djava.home=" + Tools.DIR_HOME_JRE,
"-Djava.io.tmpdir=" + ctx.getCacheDir().getAbsolutePath(),
@@ -358,29 +361,30 @@ public static List getJavaArgs(Context ctx) {
"-Dglfwstub.windowWidth=" + CallbackBridge.windowWidth,
"-Dglfwstub.windowHeight=" + CallbackBridge.windowHeight,
"-Dglfwstub.initEgl=false",
-
- "-Dext.net.resolvPath=" +new File(Tools.DIR_DATA,"resolv.conf").getAbsolutePath(),
-
+ "-Dext.net.resolvPath=" +resolvFile,
"-Dlog4j2.formatMsgNoLookups=true", //Log4j RCE mitigation
"-Dnet.minecraft.clientmodname=" + Tools.APP_NAME,
"-Dfml.earlyprogresswindow=false" //Forge 1.14+ workaround
};
-
-
- for (String userArgument : userArguments) {
- for(int i=0; i < overridableArguments.length; ++i){
- String overridableArgument = overridableArguments[i];
- //Only java properties are considered overridable for now
- if(userArgument.startsWith("-D") && userArgument.startsWith(overridableArgument.substring(0, overridableArgument.indexOf("=")))){
- overridableArguments[i] = ""; //Remove the argument since it is overridden
+ List additionalArguments = new ArrayList<>();
+ for(String arg : overridableArguments) {
+ String strippedArg = arg.substring(0,arg.indexOf('='));
+ boolean add = true;
+ for(String uarg : userArguments) {
+ if(uarg.startsWith(strippedArg)) {
+ add = false;
break;
}
}
+ if(add)
+ additionalArguments.add(arg);
+ else
+ Log.i("ArgProcessor","Arg skipped: "+arg);
}
//Add all the arguments
- userArguments.addAll(Arrays.asList(overridableArguments));
+ userArguments.addAll(additionalArguments);
return userArguments;
}
diff --git a/app_pojavlauncher/src/main/res/values/strings.xml b/app_pojavlauncher/src/main/res/values/strings.xml
index 7d548bb950..1bd9ab9f7b 100644
--- a/app_pojavlauncher/src/main/res/values/strings.xml
+++ b/app_pojavlauncher/src/main/res/values/strings.xml
@@ -291,5 +291,6 @@
Help with compatibility on some old versions
Force openGL 1
Help with compatibility on some old versions
-
+ Arc Capes
+ Enables capes from Arc. For more information please visit https://arccapes.com