diff --git a/libs/android-5.1.jar b/libs/jadx/android-5.1.jar
similarity index 100%
rename from libs/android-5.1.jar
rename to libs/jadx/android-5.1.jar
diff --git a/libs/jadx/annotations-17.0.0.jar b/libs/jadx/annotations-17.0.0.jar
new file mode 100644
index 00000000..477f7d02
Binary files /dev/null and b/libs/jadx/annotations-17.0.0.jar differ
diff --git a/libs/jadx/cloning-1.9.12.jar b/libs/jadx/cloning-1.9.12.jar
new file mode 100644
index 00000000..162bf38b
Binary files /dev/null and b/libs/jadx/cloning-1.9.12.jar differ
diff --git a/libs/d2jar-lib-obf.jar b/libs/jadx/d2jar-lib-obf.jar
similarity index 100%
rename from libs/d2jar-lib-obf.jar
rename to libs/jadx/d2jar-lib-obf.jar
diff --git a/libs/jadx/dx-1.16.jar b/libs/jadx/dx-1.16.jar
new file mode 100644
index 00000000..6e468ce7
Binary files /dev/null and b/libs/jadx/dx-1.16.jar differ
diff --git a/libs/jadx/jadx-core.jar b/libs/jadx/jadx-core.jar
new file mode 100644
index 00000000..b50c56c8
Binary files /dev/null and b/libs/jadx/jadx-core.jar differ
diff --git a/libs/jadx/objenesis-3.0.1.jar b/libs/jadx/objenesis-3.0.1.jar
new file mode 100644
index 00000000..8521c847
Binary files /dev/null and b/libs/jadx/objenesis-3.0.1.jar differ
diff --git a/libs/jadx/slf4j-api-1.7.26.jar b/libs/jadx/slf4j-api-1.7.26.jar
new file mode 100644
index 00000000..d2f27ace
Binary files /dev/null and b/libs/jadx/slf4j-api-1.7.26.jar differ
diff --git a/pom.xml b/pom.xml
index adb528d0..2e20f83e 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,13 +20,6 @@
-
- com.android
- android-lib
- 5.1
- system
- ${project.basedir}/libs/android-5.1.jar
-
org.jetbrains
annotations
@@ -109,18 +102,6 @@
commons-text
1.9
-
- com.pxb1988
- d2jar-lib-obf
- 1.0
- system
- ${project.basedir}/libs/d2jar-lib-obf.jar
-
-
- com.rover12421.android
- dx
- 1.16
-
org.jboss.windup.decompiler
decompiler-fernflower
@@ -141,11 +122,6 @@
imgscalr-lib
4.2
-
- com.github.skylot.jadx
- jadx-core
- 1.2.0
-
org.codehaus.janino
janino
@@ -220,6 +196,62 @@
xpp3
1.1.4c
+
+ com.github.skylot
+ JADX-Core
+ 1.0.0
+ system
+ ${project.basedir}/libs/jadx/jadx-core.jar
+
+
+ com.github.skylot
+ JADX-Android
+ 1.0.0
+ system
+ ${project.basedir}/libs/jadx/android-5.1.jar
+
+
+ com.android
+ DX
+ 1.16
+ system
+ ${project.basedir}/libs/jadx/dx-1.16.jar
+
+
+ com.android
+ D2Jar-obf
+ 1.0.0
+ system
+ ${project.basedir}/libs/jadx/d2jar-lib-obf.jar
+
+
+ org.intellij
+ Annotations
+ 17.0.0
+ system
+ ${project.basedir}/libs/jadx/annotations-17.0.0.jar
+
+
+ com.rits
+ Cloning
+ 1.9.12
+ system
+ ${project.basedir}/libs/jadx/cloning-1.9.12.jar
+
+
+ org.objenesis
+ Objenesis
+ 3.0.1
+ system
+ ${project.basedir}/libs/jadx/objenesis-3.0.1.jar
+
+
+ org.slf4j
+ slf4j
+ 1.7.26
+ system
+ ${project.basedir}/libs/jadx/slf4j-api-1.7.26.jar
+
diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/JADXDecompiler.java b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/JADXDecompiler.java
index fd4e59ee..9fdbe977 100644
--- a/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/JADXDecompiler.java
+++ b/src/main/java/the/bytecode/club/bytecodeviewer/decompilers/JADXDecompiler.java
@@ -11,7 +11,6 @@ import java.util.Objects;
import java.util.Random;
import me.konloch.kontainer.io.DiskReader;
import org.objectweb.asm.tree.ClassNode;
-import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.util.MiscUtils;
import static the.bytecode.club.bytecodeviewer.Constants.*;
@@ -56,14 +55,18 @@ public class JADXDecompiler extends Decompiler {
}
File fuckery = new File(fuckery(fileStart));
+
try {
JadxArgs args = new JadxArgs();
args.getInputFiles().add(tempClass);
args.setOutDir(fuckery);
+ args.setOutDirSrc(fuckery);
+ args.setOutDirRes(fuckery);
JadxDecompiler jadx = new JadxDecompiler(args);
jadx.load();
- jadx.save();
+ jadx.saveSources();
+ //jadx.close();
} catch (StackOverflowError | Exception e) {
StringWriter sw = new StringWriter();
e.printStackTrace(new PrintWriter(sw));
@@ -75,6 +78,9 @@ public class JADXDecompiler extends Decompiler {
if (fuckery.exists())
return findFile(Objects.requireNonNull(fuckery.listFiles()));
+
+ if(exception.isEmpty())
+ exception = "Decompiled source file not found!";
return "JADX error! Send the stacktrace to Konloch at https://the.bytecode.club or konloch@gmail.com"
+ nl + nl + "Suggested Fix: Click refresh class, if it fails again try another decompiler."
@@ -113,7 +119,7 @@ public class JADXDecompiler extends Decompiler {
return s;
}
}
- return "CFR error!" + nl + nl + "Suggested Fix: Click refresh class, if it "
+ return "JADX error!" + nl + nl + "Suggested Fix: Click refresh class, if it "
+ "fails again try another decompiler.";
}
diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/FileNavigationPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/FileNavigationPane.java
index b6e08465..dfebbceb 100644
--- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/FileNavigationPane.java
+++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/FileNavigationPane.java
@@ -1,7 +1,7 @@
package the.bytecode.club.bytecodeviewer.gui;
-//TODO re-add
-//import com.sun.java.swing.plaf.windows.WindowsTreeUI;
+//TODO fix for Java 9+
+import com.sun.java.swing.plaf.windows.WindowsTreeUI;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
@@ -220,8 +220,8 @@ public class FileNavigationPane extends VisibleComponent implements
}
});
- //TODO re-add
- /*pop.add(new AbstractAction("Expand", WindowsTreeUI.ExpandedIcon.createExpandedIcon()) {
+ //TODO fix for Java 9+
+ pop.add(new AbstractAction("Expand", WindowsTreeUI.ExpandedIcon.createExpandedIcon()) {
@Override
public void actionPerformed(ActionEvent e) {
TreePath selPath = FileNavigationPane.this.tree.getPathForLocation(x, y);
@@ -235,7 +235,7 @@ public class FileNavigationPane extends VisibleComponent implements
TreePath selPath = FileNavigationPane.this.tree.getPathForLocation(x, y);
expandAll(tree, Objects.requireNonNull(selPath), false);
}
- });*/
+ });
pop.show(this.tree, x, y);
}
@@ -315,7 +315,6 @@ public class FileNavigationPane extends VisibleComponent implements
@Override
public void keyPressed(KeyEvent e) {
- System.out.println((int) e.getKeyChar());
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
if (e.getSource() instanceof MyTree) {
MyTree tree = (MyTree) e.getSource();
diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/ViewPane.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/ViewPane.java
index 76aa94db..c9252c53 100644
--- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/ViewPane.java
+++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/ViewPane.java
@@ -79,13 +79,15 @@ public class ViewPane
return 7;
else if (group.isSelected(krakatau.getBytecode().getModel()))
return 8;
- else if (group.isSelected(JD.getBytecode().getModel()))
+ else if (group.isSelected(JD.getJava().getModel()))
return 9;
- else if (group.isSelected(JADX.getBytecode().getModel()))
+ else if (group.isSelected(JADX.getJava().getModel()))
return 10;
else if (group.isSelected(asmTextify.getModel()))
return 11;
+ System.out.println("DEFAULTING TO NULL");
+
//default to none
return 0;
}