From 26e3b23e385ba252bfb58a42421d8443f5b0e9ec Mon Sep 17 00:00:00 2001 From: Konloch Date: Mon, 21 Jun 2021 10:43:49 -0700 Subject: [PATCH] Bandaid fix for Dex2jar The real fix is resolving the error that Dex2Jar spits out every APK decompilation, but until that happens this bandaid should work --- .../the/bytecode/club/bytecodeviewer/util/Dex2Jar.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java index 60569995..578f1e98 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java @@ -44,6 +44,15 @@ public class Dex2Jar { File realOutputF2 = new File(realOutput); while (realOutputF2.exists()) realOutputF2.delete(); + + //TODO fix this properly + // WARNING: this could probably delete important error files but until a proper dex2jar fix is added this is needed + // or else after each APK decompile the file directory will be flooded with -error.zip + for(File localFile : new File(".").listFiles()) + { + if(localFile.getName().length() == 42 && localFile.getName().endsWith("-error.zip")) + localFile.delete(); + } } catch (Exception e) { new the.bytecode.club.bytecodeviewer.api.ExceptionUI(e); }