Skip to content

Commit 7e8570b

Browse files
committed
Update 1.2.43 (Fix #15)
1 parent b20d628 commit 7e8570b

File tree

6 files changed

+28
-37
lines changed

6 files changed

+28
-37
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ Either by double-clicking on it, or running `java -jar FoxLoader.jar`
1717

1818
To run FoxLoader as a server just run `java -jar FoxLoader.jar --server`
1919

20+
Note: For PojavLauncher, click on "Install .jar" and the rest should be automatic,
21+
only the Android version of PojavLauncher is supported.
22+
2023
## Documentation
2124

2225
For mixins usage check here: https://github.com/2xsaiko/mixin-cheatsheet

dev/src/main/groovy/com/fox2code/foxloader/dev/GradlePlugin.groovy

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -425,27 +425,6 @@ class GradlePlugin implements Plugin<Project> {
425425
try {
426426
System.out.println("Decompiling patched ReIndev " + logSideName)
427427
decompilerHelper.decompile(unpickedJarFox, sourcesJarFox, client)
428-
} catch (OutOfMemoryError oom) {
429-
boolean deleteFailed = false
430-
try {
431-
closeJarFileSystem(unpickedJarFox)
432-
closeJarFileSystem(sourcesJarFox)
433-
} finally {
434-
if (!sourcesJarFox.delete()) {
435-
sourcesJarFox.deleteOnExit()
436-
deleteFailed = true
437-
}
438-
}
439-
Throwable root = oom
440-
while (root.getCause() != null)
441-
root = root.getCause()
442-
443-
root.initCause(deleteFailed ? // If delete failed, restart
444-
UserMessage.UNRECOVERABLE_STATE_DECOMPILE :
445-
client ? UserMessage.FAIL_DECOMPILE_CLIENT :
446-
UserMessage.FAIL_DECOMPILE_SERVER)
447-
if (deleteFailed) throw oom // If delete failed, we can't recover
448-
oom.printStackTrace()
449428
} catch (Throwable throwable) {
450429
boolean deleteFailed = false
451430
try {
@@ -470,10 +449,14 @@ class GradlePlugin implements Plugin<Project> {
470449
UserMessage.FAIL_DECOMPILE_SERVER)
471450
if (deleteFailed) {
472451
terminateProcess()
452+
throw throwable
473453
}
474-
throw throwable
454+
if (throwable instanceof OutOfMemoryError ||
455+
throwable instanceof RuntimeException) {
456+
throwable.printStackTrace()
457+
} else throw throwable
475458
}
476-
// Close not critical there, as if close fails, it's still not a big issue
459+
// Close not critical there, as if close fails here, it's still not a big issue
477460
closeJarFileSystem(unpickedJarFox, false)
478461
closeJarFileSystem(sourcesJarFox, false)
479462
}

dev11/src/main/java/com/fox2code/foxloader/dev11/FoxLoaderDecompiler.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ public class FoxLoaderDecompiler extends SingleFileSaver implements IResultSaver
1818
options.put("asc", "1");
1919
options.put("bsm", "1");
2020
options.put("sef", "1");
21-
if (System.getProperty("java.version").startsWith("1.8.")) {
22-
options.put("jrt", System.getProperty("java.home"));
21+
String javaHome = System.getProperty("java.home");
22+
if (System.getProperty("java.version").startsWith("1.8.") && javaHome != null) {
23+
if (javaHome.endsWith("\\jre") || javaHome.endsWith("/jre")) {
24+
javaHome = javaHome.substring(0, javaHome.length() - 4);
25+
}
26+
options.put("jrt", javaHome);
2327
} else {
2428
options.put("jrt", "current");
2529
}

final/src/main/java/com/fox2code/foxloader/installer/InstallerGUI.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public void show() {
211211
}
212212
}
213213

214-
private boolean checkInstaller() {
214+
private boolean checkInstaller(boolean checkExtStrict) {
215215
if (this.reIndevSource != null &&
216216
!this.reIndevSource.exists()) {
217217
if (this.jFrame == null) return true;
@@ -226,7 +226,7 @@ private boolean checkInstaller() {
226226
showMessage(TranslateEngine.getTranslation("installer.error.run-from-ide"), true);
227227
return true;
228228
}
229-
if (!Main.currentInstallerFile.getName()
229+
if (checkExtStrict && !Main.currentInstallerFile.getName()
230230
.toLowerCase(Locale.ROOT).endsWith(".jar") &&
231231
!this.installerPlatform.specialLauncher) {
232232
if (this.jFrame == null) return true;
@@ -239,7 +239,7 @@ private boolean checkInstaller() {
239239
}
240240

241241
public void installMineCraft() {
242-
if (this.checkInstaller()) {
242+
if (this.checkInstaller(false)) {
243243
return;
244244
}
245245
if (this.installerPlatform.specialLauncher) {
@@ -296,7 +296,7 @@ public void installBetaCraft() {
296296
}
297297

298298
public void installBetaCraftEx(File betaCraft) {
299-
if (this.checkInstaller()) {
299+
if (this.checkInstaller(false)) {
300300
return;
301301
}
302302
File versions = new File(betaCraft, "versions");
@@ -370,7 +370,7 @@ public void installBetaCraftEx(File betaCraft) {
370370
}
371371

372372
public void extractMMCInstance() {
373-
if (this.checkInstaller()) {
373+
if (this.checkInstaller(true)) {
374374
return;
375375
}
376376

@@ -407,7 +407,7 @@ public void extractMMCInstance() {
407407
}
408408

409409
public void extractServer() {
410-
if (this.checkInstaller()) {
410+
if (this.checkInstaller(true)) {
411411
return;
412412
}
413413

@@ -445,7 +445,7 @@ public void extractServer() {
445445
}
446446

447447
public void doSilentInstall(String arg) throws IOException {
448-
if (this.checkInstaller()) {
448+
if (this.checkInstaller(false)) {
449449
return;
450450
}
451451
switch (this.launcherType) {

final/src/main/java/com/fox2code/foxloader/installer/Main.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,10 @@ public static void main(String[] args) throws ReflectiveOperationException, Malf
110110
}
111111

112112
public static boolean isPojavLauncherHome(String userHome) {
113-
int index;
114-
return (userHome.startsWith("/storage/emulated/") && (index = userHome.indexOf('/', 18)) != -1 &&
115-
userHome.substring(index).startsWith("/Android/data/") || userHome.startsWith("/sdcard/Android/data/"));
113+
int index; String ext;
114+
return ((userHome.startsWith("/storage/emulated/") && (index = userHome.indexOf('/', 18)) != -1 &&
115+
((ext = userHome.substring(index)).startsWith("/Android/data/") || ext.startsWith("/games/"))) ||
116+
userHome.startsWith("/sdcard/Android/data/") || userHome.startsWith("/sdcard/games/"));
116117
}
117118

118119
static {

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ org.gradle.parallel=true
33
org.gradle.jvmargs=-Xmx1024m -XX:-UseGCOverheadLimit -Dfile.encoding=UTF-8
44

55
# FoxLoader properties
6-
foxloader.version=1.2.42
6+
foxloader.version=1.2.43
77
foxloader.lastReIndevTransformerChanges=1.2.39
88
# https://www.jitpack.io/#com.fox2code/FoxLoader
99

@@ -22,4 +22,4 @@ spark.dependency=maven.modrinth:spark:1.10.58-fabric
2222
spark.version=1.10.58
2323

2424
#VineFlower properties
25-
vineflower.dependency=org.vineflower:vineflower:1.9.3
25+
vineflower.dependency=org.vineflower:vineflower:1.10.0

0 commit comments

Comments
 (0)