From a9dc390a1763595b7f97f3f98caa0e38fe23a348 Mon Sep 17 00:00:00 2001 From: Konloch Date: Wed, 2 Oct 2024 18:21:31 -0600 Subject: [PATCH] FernFlower Zip Decompiler Fallback --- .../decompilers/impl/FernFlowerDecompiler.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java index 96254a45..d72a1d90 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/FernFlowerDecompiler.java @@ -121,6 +121,7 @@ public class FernFlowerDecompiler extends AbstractDecompiler @Override public void decompileToZip(String sourceJar, String zipName) { + final File destination = new File(zipName); File tempInputJarFile = new File(sourceJar); File tempOutputJar = new File(TEMP_DIRECTORY + FS + "temp" + FS + tempInputJarFile.getName()); @@ -133,7 +134,9 @@ public class FernFlowerDecompiler extends AbstractDecompiler } if (tempOutputJar.exists()) - tempOutputJar.renameTo(new File(zipName)); + tempOutputJar.renameTo(destination); + else //attempt to decompile using fallback + decompileToZipFallBack(tempInputJarFile.getAbsolutePath(), destination.getAbsolutePath()); }