diff --git a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar b/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar deleted file mode 100644 index 86e83c60..00000000 Binary files a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar and /dev/null differ diff --git a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.md5 b/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.md5 deleted file mode 100644 index 079c07f7..00000000 --- a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -f917a330ef6379f8976ce3761e30e0fc \ No newline at end of file diff --git a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.sha1 b/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.sha1 deleted file mode 100644 index 95872648..00000000 --- a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -f5fbd039a4c3161b2a3db817786b39366e2cd796 \ No newline at end of file diff --git a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.md5 b/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.md5 deleted file mode 100644 index ffee64c5..00000000 --- a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -08b71893e812afc9c2670a92acdded46 \ No newline at end of file diff --git a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.sha1 b/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.sha1 deleted file mode 100644 index 4cef2b5b..00000000 --- a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -d0eb90a0d8eb49d0a9573224000c859358610783 \ No newline at end of file diff --git a/libs/com/android/D2Jar-obf/maven-metadata.xml.md5 b/libs/com/android/D2Jar-obf/maven-metadata.xml.md5 deleted file mode 100644 index cdc87bc9..00000000 --- a/libs/com/android/D2Jar-obf/maven-metadata.xml.md5 +++ /dev/null @@ -1 +0,0 @@ -0591d48d90ee4e7bcf92f9995686d3cb \ No newline at end of file diff --git a/libs/com/android/D2Jar-obf/maven-metadata.xml.sha1 b/libs/com/android/D2Jar-obf/maven-metadata.xml.sha1 deleted file mode 100644 index 4854df3b..00000000 --- a/libs/com/android/D2Jar-obf/maven-metadata.xml.sha1 +++ /dev/null @@ -1 +0,0 @@ -24a479a29c3fe9293a6ccf69d975e0f3a3b09546 \ No newline at end of file diff --git a/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar.md5 b/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar.md5 deleted file mode 100644 index 64fd0641..00000000 --- a/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar.md5 +++ /dev/null @@ -1 +0,0 @@ -cab2e66e5444aaab6a440f7afa4f7829 \ No newline at end of file diff --git a/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar.sha1 b/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar.sha1 deleted file mode 100644 index 5cf917b7..00000000 --- a/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar.sha1 +++ /dev/null @@ -1 +0,0 @@ -9aee7f4031c7717c9dd18a61410d81cdbc4c7fb9 \ No newline at end of file diff --git a/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom.md5 b/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom.md5 deleted file mode 100644 index c33798fe..00000000 --- a/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom.md5 +++ /dev/null @@ -1 +0,0 @@ -5d95e64f137ec77ddf401d25771b671c \ No newline at end of file diff --git a/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom.sha1 b/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom.sha1 deleted file mode 100644 index 6c27de8c..00000000 --- a/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom.sha1 +++ /dev/null @@ -1 +0,0 @@ -926db5c7f9b2abf84fa1b17063e6676af73b9fcf \ No newline at end of file diff --git a/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar b/libs/com/android/DX/30.0.3/dx-30.0.3.jar similarity index 90% rename from libs/com/android/DX/1.16bcv/DX-1.16bcv.jar rename to libs/com/android/DX/30.0.3/dx-30.0.3.jar index 6e468ce7..ef90a14d 100644 Binary files a/libs/com/android/DX/1.16bcv/DX-1.16bcv.jar and b/libs/com/android/DX/30.0.3/dx-30.0.3.jar differ diff --git a/libs/com/android/DX/30.0.3/dx-30.0.3.jar.md5 b/libs/com/android/DX/30.0.3/dx-30.0.3.jar.md5 new file mode 100644 index 00000000..b5a8c910 --- /dev/null +++ b/libs/com/android/DX/30.0.3/dx-30.0.3.jar.md5 @@ -0,0 +1 @@ +27ccd6872887a6fa467c9f773f9fd218 \ No newline at end of file diff --git a/libs/com/android/DX/30.0.3/dx-30.0.3.jar.sha1 b/libs/com/android/DX/30.0.3/dx-30.0.3.jar.sha1 new file mode 100644 index 00000000..3f24a99c --- /dev/null +++ b/libs/com/android/DX/30.0.3/dx-30.0.3.jar.sha1 @@ -0,0 +1 @@ +ee70c208b9469e07dff48294d37ca4dfd009216c \ No newline at end of file diff --git a/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom b/libs/com/android/DX/30.0.3/dx-30.0.3.pom similarity index 84% rename from libs/com/android/DX/1.16bcv/DX-1.16bcv.pom rename to libs/com/android/DX/30.0.3/dx-30.0.3.pom index 350e7502..331acd49 100644 --- a/libs/com/android/DX/1.16bcv/DX-1.16bcv.pom +++ b/libs/com/android/DX/30.0.3/dx-30.0.3.pom @@ -3,6 +3,6 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 4.0.0 com.android - DX - 1.16bcv + dx + 30.0.3 diff --git a/libs/com/android/DX/30.0.3/dx-30.0.3.pom.md5 b/libs/com/android/DX/30.0.3/dx-30.0.3.pom.md5 new file mode 100644 index 00000000..f3b91523 --- /dev/null +++ b/libs/com/android/DX/30.0.3/dx-30.0.3.pom.md5 @@ -0,0 +1 @@ +1c8d965abdb64d5e7869fe7abd0f8f16 \ No newline at end of file diff --git a/libs/com/android/DX/30.0.3/dx-30.0.3.pom.sha1 b/libs/com/android/DX/30.0.3/dx-30.0.3.pom.sha1 new file mode 100644 index 00000000..07b23735 --- /dev/null +++ b/libs/com/android/DX/30.0.3/dx-30.0.3.pom.sha1 @@ -0,0 +1 @@ +e0c4f44b6eff749939e1cd6f2d2aa5ba2d9281d7 \ No newline at end of file diff --git a/libs/com/android/DX/maven-metadata.xml b/libs/com/android/DX/maven-metadata.xml index d923d38f..062de9e0 100644 --- a/libs/com/android/DX/maven-metadata.xml +++ b/libs/com/android/DX/maven-metadata.xml @@ -1,12 +1,12 @@ com.android - DX + dx - 1.16bcv + 30.0.3 - 1.16bcv + 30.0.3 - 20210622185015 + 20210809171340 diff --git a/libs/com/android/DX/maven-metadata.xml.md5 b/libs/com/android/DX/maven-metadata.xml.md5 index 353b2c8c..efc9ffc1 100644 --- a/libs/com/android/DX/maven-metadata.xml.md5 +++ b/libs/com/android/DX/maven-metadata.xml.md5 @@ -1 +1 @@ -00c4e169d820da2b52ecff592c462a5c \ No newline at end of file +9fc6457b2aaaca1869f9e0f1aab372d4 \ No newline at end of file diff --git a/libs/com/android/DX/maven-metadata.xml.sha1 b/libs/com/android/DX/maven-metadata.xml.sha1 index 797df270..d100da0a 100644 --- a/libs/com/android/DX/maven-metadata.xml.sha1 +++ b/libs/com/android/DX/maven-metadata.xml.sha1 @@ -1 +1 @@ -3aa3ae5b23afd0e8e497860be45d2babcbdd03de \ No newline at end of file +5e542c95e397f2b4c3f2b150360e39aa519f0863 \ No newline at end of file diff --git a/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar new file mode 100644 index 00000000..3bcdc8c7 Binary files /dev/null and b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar differ diff --git a/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.md5 b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.md5 new file mode 100644 index 00000000..956d7eb0 --- /dev/null +++ b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.md5 @@ -0,0 +1 @@ +1d977900a2f9afd1200abdd1bd660553 \ No newline at end of file diff --git a/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.sha1 b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.sha1 new file mode 100644 index 00000000..8b333e7f --- /dev/null +++ b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.jar.sha1 @@ -0,0 +1 @@ +ce73cbb58e13fc2449d43483f650d671bc63cba8 \ No newline at end of file diff --git a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom similarity index 90% rename from libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom rename to libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom index d6d1d59a..0778eebe 100644 --- a/libs/com/android/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom +++ b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom @@ -2,7 +2,7 @@ 4.0.0 - com.android + com.googlecode D2Jar-obf 1.0bcv diff --git a/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.md5 b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.md5 new file mode 100644 index 00000000..fd986869 --- /dev/null +++ b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.md5 @@ -0,0 +1 @@ +c2145a55e8a96475489adebd58ea4968 \ No newline at end of file diff --git a/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.sha1 b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.sha1 new file mode 100644 index 00000000..8f383bcb --- /dev/null +++ b/libs/com/googlecode/D2Jar-obf/1.0bcv/D2Jar-obf-1.0bcv.pom.sha1 @@ -0,0 +1 @@ +e45f03179f6fc5a3becb4eda787c34fae28f93e5 \ No newline at end of file diff --git a/libs/com/android/D2Jar-obf/maven-metadata.xml b/libs/com/googlecode/D2Jar-obf/maven-metadata.xml similarity index 73% rename from libs/com/android/D2Jar-obf/maven-metadata.xml rename to libs/com/googlecode/D2Jar-obf/maven-metadata.xml index 49a5143c..1c566249 100644 --- a/libs/com/android/D2Jar-obf/maven-metadata.xml +++ b/libs/com/googlecode/D2Jar-obf/maven-metadata.xml @@ -1,12 +1,12 @@ - com.android + com.googlecode D2Jar-obf 1.0bcv 1.0bcv - 20210622185021 + 20210809170725 diff --git a/libs/com/googlecode/D2Jar-obf/maven-metadata.xml.md5 b/libs/com/googlecode/D2Jar-obf/maven-metadata.xml.md5 new file mode 100644 index 00000000..a641d01d --- /dev/null +++ b/libs/com/googlecode/D2Jar-obf/maven-metadata.xml.md5 @@ -0,0 +1 @@ +d7504c5ccd9fdb6ed4cdbea4a743c8b1 \ No newline at end of file diff --git a/libs/com/googlecode/D2Jar-obf/maven-metadata.xml.sha1 b/libs/com/googlecode/D2Jar-obf/maven-metadata.xml.sha1 new file mode 100644 index 00000000..97b63c01 --- /dev/null +++ b/libs/com/googlecode/D2Jar-obf/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +daff1db4b2d9ba351c2d17362618d012d94fcbc6 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 9483479e..af6e22d5 100644 --- a/pom.xml +++ b/pom.xml @@ -211,11 +211,11 @@ com.android - DX - 1.16bcv + dx + 30.0.3 - com.android + com.googlecode D2Jar-obf 1.0bcv diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java index 914fa915..b058d4c9 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/compilers/impl/SmaliAssembler.java @@ -61,10 +61,8 @@ public class SmaliAssembler extends InternalCompiler } try { - com.googlecode.d2j.smali.SmaliCmd.main(new String[]{ - tempSmaliFolder.getAbsolutePath(), - //"-o", tempDex.getAbsolutePath() - }); + com.googlecode.d2j.smali.SmaliCmd.main(tempSmaliFolder.getAbsolutePath(), + "-o", tempDex.getAbsolutePath()); } catch (Exception e) { e.printStackTrace(); //BytecodeViewer.handleException(e); diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java index 517992fb..f1f78739 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/impl/SmaliDisassembler.java @@ -10,6 +10,7 @@ import me.konloch.kontainer.io.DiskReader; import org.apache.commons.io.FileUtils; import org.objectweb.asm.tree.ClassNode; import the.bytecode.club.bytecodeviewer.BytecodeViewer; +import the.bytecode.club.bytecodeviewer.Constants; import the.bytecode.club.bytecodeviewer.api.ExceptionUI; import the.bytecode.club.bytecodeviewer.decompilers.InternalDecompiler; import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings; @@ -55,6 +56,7 @@ public class SmaliDisassembler extends InternalDecompiler final File tempClass = new File(start + ".class"); final File tempDex = new File(start + ".dex"); + final File tempDexOut = new File(start + "-out"); final File tempSmali = new File(start + "-smali"); //output directory try (FileOutputStream fos = new FileOutputStream(tempClass)) { @@ -68,7 +70,8 @@ public class SmaliDisassembler extends InternalDecompiler Dex2Jar.saveAsDex(tempClass, tempDex, true); try { - com.googlecode.d2j.smali.BaksmaliCmd.main(new String[]{tempDex.getAbsolutePath()}); + com.googlecode.d2j.smali.BaksmaliCmd.main(tempDex.getAbsolutePath(), + "-o", tempDexOut.getAbsolutePath()); } catch (Exception e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); @@ -77,10 +80,8 @@ public class SmaliDisassembler extends InternalDecompiler exception += ExceptionUI.SEND_STACKTRACE_TO_NL + sw; } - File rename = new File(tempDex.getName().replaceFirst("\\.dex", "-out")); - try { - FileUtils.moveDirectory(rename, tempSmali); + FileUtils.moveDirectory(tempDexOut, tempSmali); } catch (IOException e) { StringWriter sw = new StringWriter(); e.printStackTrace(new PrintWriter(sw)); 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 ee753226..9e4ffd53 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java @@ -4,8 +4,6 @@ import com.googlecode.d2j.dex.Dex2jar; import the.bytecode.club.bytecodeviewer.BytecodeViewer; import java.io.File; -import java.io.IOException; -import java.lang.reflect.Field; /*************************************************************************** * Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite * @@ -50,16 +48,6 @@ public class Dex2Jar { } } - // TODO fix this properly - private static void applyErrorFix(com.googlecode.dex2jar.tools.Dex2jarCmd cmd) { - try { - Field f = com.googlecode.dex2jar.tools.Dex2jarCmd.class.getDeclaredField("notHandleException"); - f.setAccessible(true); - f.set(cmd, true); - } catch (Throwable ignored) { - } - } - /** * Converts a .jar to .dex * @@ -72,28 +60,7 @@ public class Dex2Jar { public static synchronized void saveAsDex(File input, File output, boolean delete) { try { - com.googlecode.dex2jar.tools.Jar2Dex.main(input.getAbsolutePath()); - File currentDexLocation = new File("./" + input.getName()); - - if (currentDexLocation.getAbsolutePath().toLowerCase().endsWith(".jar")) { - currentDexLocation = new File(currentDexLocation.getAbsolutePath().replaceFirst("\\.jar", "-jar2dex" - + ".dex")); - } else if (currentDexLocation.getAbsolutePath().toLowerCase().endsWith(".apk")) { - currentDexLocation = new File(currentDexLocation.getAbsolutePath().replaceFirst("\\.apk", "-jar2dex" - + ".dex")); - } else if (currentDexLocation.getAbsolutePath().toLowerCase().endsWith(".dex")) { - currentDexLocation = new File(currentDexLocation.getAbsolutePath().replaceFirst("\\.dex", "-jar2dex" - + ".dex")); - } else if (currentDexLocation.getAbsolutePath().toLowerCase().endsWith(".zip")) { - currentDexLocation = new File(currentDexLocation.getAbsolutePath().replaceFirst("\\.zip", "-jar2dex" - + ".dex")); - } else if (currentDexLocation.getAbsolutePath().toLowerCase().endsWith(".class")) { - currentDexLocation = new File(currentDexLocation.getAbsolutePath().replaceFirst("\\.class", "-jar2dex" - + ".dex")); - } - - currentDexLocation.renameTo(output); - + com.googlecode.dex2jar.tools.Jar2Dex.main(input.getAbsolutePath(), "-o", output.getAbsolutePath()); if (delete) input.delete(); } catch (Exception e) { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java index e23654aa..44c76941 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/SecurityMan.java @@ -256,8 +256,7 @@ public class SecurityMan extends SecurityManager @SuppressWarnings("deprecation") public void checkMulticast(InetAddress maddr, byte ttl) { } - - @SuppressWarnings("deprecation") + public void checkPackageAccess(String pkg) { if(printingPackage) System.out.println("Accessing: " + pkg); @@ -335,9 +334,7 @@ public class SecurityMan extends SecurityManager { throw new SecurityException(e); } - - //TODO temporarily removed to fix #339 - // a proper fix is to edit the smali disassembler - //throw new SecurityException("BCV is awesome, blocking write(" + file + ");"); + + throw new SecurityException("BCV is awesome, blocking write(" + file + ");"); } }