Skip to content

Commit

Permalink
Merge pull request #344 from ThexXTURBOXx/dex2jar
Browse files Browse the repository at this point in the history
Dex2jar fixes
  • Loading branch information
Konloch authored Aug 12, 2021
2 parents 0bc6d4a + ea8c756 commit e4543ea
Show file tree
Hide file tree
Showing 46 changed files with 75 additions and 68 deletions.
6 changes: 3 additions & 3 deletions libs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Some dependencies may have been modified or could be released by their author in

#### Modifications

- `JD-GUI`: Removed ASM and RSyntaxTextArea
- `JD-GUI`: Removed ASM, RSyntaxTextArea, ANTLR, and TreeLayout
- `APKTool`: Recompiled with the newest dependency versions, removed prebuilt folder
- `DX`: Just taken from build-tools without modifications
- `D2Jar`: Compiled from scratch
- `dx`: Just taken from build-tools without modifications
- `Dex2Jar`: Compiled from scratch ([This fork](https://github.com/ThexXTURBOXx/dex2jar)); download the `all` artifact from [GitHub actions](https://github.com/ThexXTURBOXx/dex2jar/actions)
Binary file removed libs/com/android/dx/30.0.3/dx-30.0.3.jar
Binary file not shown.
1 change: 0 additions & 1 deletion libs/com/android/dx/30.0.3/dx-30.0.3.jar.md5

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/android/dx/30.0.3/dx-30.0.3.jar.sha1

This file was deleted.

8 changes: 0 additions & 8 deletions libs/com/android/dx/30.0.3/dx-30.0.3.pom

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/android/dx/30.0.3/dx-30.0.3.pom.md5

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/android/dx/30.0.3/dx-30.0.3.pom.sha1

This file was deleted.

12 changes: 0 additions & 12 deletions libs/com/android/dx/maven-metadata.xml

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/android/dx/maven-metadata.xml.md5

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/android/dx/maven-metadata.xml.sha1

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
470df084337b7ef8e5fd9ada8359973d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8c993a8b2dd652532c11b57d917e49c8d33efa45
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.googlecode</groupId>
<artifactId>D2Jar-obf</artifactId>
<version>1.0bcv</version>
<version>2.1v19</version>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a738eb686cce7603fda0d7225d911bbb
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d65e7ca6e8c1db7e923e9520f08a2c88b654ff11
6 changes: 3 additions & 3 deletions libs/com/googlecode/D2Jar-obf/maven-metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<groupId>com.googlecode</groupId>
<artifactId>D2Jar-obf</artifactId>
<versioning>
<release>1.0bcv</release>
<release>2.1v19</release>
<versions>
<version>1.0bcv</version>
<version>2.1v19</version>
</versions>
<lastUpdated>20210809231039</lastUpdated>
<lastUpdated>20210812114713</lastUpdated>
</versioning>
</metadata>
2 changes: 1 addition & 1 deletion libs/com/googlecode/D2Jar-obf/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -1 +1 @@
d54ac62e2043b2db34f2fcaad089de7c
5e0be1e48a1190b21b4514f83a1a2167
2 changes: 1 addition & 1 deletion libs/com/googlecode/D2Jar-obf/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -1 +1 @@
51083035146a191d5a37266136f5a19a3b2d78c9
4c3d40803e18e8b752368e2140a4e61a570b09f6
1 change: 0 additions & 1 deletion libs/com/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.jar.md5

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.jar.sha1

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.pom.md5

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.pom.sha1

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/jd/jd-gui/maven-metadata.xml.md5

This file was deleted.

1 change: 0 additions & 1 deletion libs/com/jd/jd-gui/maven-metadata.xml.sha1

This file was deleted.

Binary file not shown.
1 change: 1 addition & 0 deletions libs/org/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.jar.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
27038a07a27a96680c00ce9bc2e7ecf9
1 change: 1 addition & 0 deletions libs/org/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d2e0687046e7e343b1150f23976c718b8f05d017
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.jd</groupId>
<groupId>org.jd</groupId>
<artifactId>jd-gui</artifactId>
<version>1.6.6bcv</version>
</project>
1 change: 1 addition & 0 deletions libs/org/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.pom.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
746c99600f2e54d10b6edadf901583ae
1 change: 1 addition & 0 deletions libs/org/jd/jd-gui/1.6.6bcv/jd-gui-1.6.6bcv.pom.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a66b8df4397ea3f2985e811de4f1a6b06d2899b6
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<metadata>
<groupId>com.jd</groupId>
<groupId>org.jd</groupId>
<artifactId>jd-gui</artifactId>
<versioning>
<release>1.6.6bcv</release>
<versions>
<version>1.6.6bcv</version>
</versions>
<lastUpdated>20210622184950</lastUpdated>
<lastUpdated>20210810090109</lastUpdated>
</versioning>
</metadata>
1 change: 1 addition & 0 deletions libs/org/jd/jd-gui/maven-metadata.xml.md5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3bacc3a2d75ec55b4a342685c525a242
1 change: 1 addition & 0 deletions libs/org/jd/jd-gui/maven-metadata.xml.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7ccb5c6496569cac765190873996c27dc28361f0
29 changes: 20 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<dependency>
<groupId>org.jboss.windup.decompiler</groupId>
<artifactId>decompiler-fernflower</artifactId>
<version>5.1.4.Final</version>
<version>5.2.0.Final</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
Expand All @@ -130,7 +130,7 @@
<version>3.1.6</version>
</dependency>
<dependency>
<groupId>com.jd</groupId>
<groupId>org.jd</groupId>
<artifactId>jd-gui</artifactId>
<version>1.6.6bcv</version>
</dependency>
Expand Down Expand Up @@ -209,15 +209,10 @@
<artifactId>JADX-Android</artifactId>
<version>5.1bcv</version>
</dependency>
<dependency>
<groupId>com.android</groupId>
<artifactId>dx</artifactId>
<version>30.0.3</version>
</dependency>
<dependency>
<groupId>com.googlecode</groupId>
<artifactId>D2Jar-obf</artifactId>
<version>1.0bcv</version>
<version>2.1v19</version>
</dependency>
<dependency>
<groupId>com.github.weisj</groupId>
Expand All @@ -239,6 +234,22 @@
<artifactId>semantic-version</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>org.abego.treelayout</groupId>
<artifactId>org.abego.treelayout.core</artifactId>
<version>1.0.3</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4</artifactId>
<version>4.9.2</version>
<exclusions>
<exclusion>
<groupId>com.ibm.icu</groupId>
<artifactId>icu4j</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- TODO Re-add for Graal.JS support -->
<!--<dependency>
Expand Down Expand Up @@ -312,4 +323,4 @@
</plugins>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public static synchronized void saveSettings()
save("deprecated");
save("deprecated");
save("deprecated");
save(BytecodeViewer.viewer.fontSpinner.getValue());
save(BytecodeViewer.viewer.getFontSize());
save(Configuration.deleteForeignLibraries);

if (BytecodeViewer.viewer.apkConversionGroup.isSelected(BytecodeViewer.viewer.apkConversionDex.getModel()))
Expand Down Expand Up @@ -200,6 +200,7 @@ else if (BytecodeViewer.viewer.apkConversionGroup.isSelected(BytecodeViewer.view
save(Configuration.lastPluginDirectory);
save(Configuration.python2Extra);
save(Configuration.python3Extra);
save(BytecodeViewer.viewer.getMinSdkVersion());
} catch (Exception e) {
BytecodeViewer.handleException(e);
}
Expand Down Expand Up @@ -396,6 +397,7 @@ public static void loadSettings()
Configuration.lastPluginDirectory = asString(138);
Configuration.python2Extra = asBoolean(139);
Configuration.python3Extra = asBoolean(140);
BytecodeViewer.viewer.minSdkVersionSpinner.setValue(asInt(141));
}
catch (IndexOutOfBoundsException e)
{
Expand Down Expand Up @@ -426,4 +428,4 @@ public static int asInt(int lineNumber) throws Exception
{
return Integer.parseInt(DiskReader.loadString(settingsName, lineNumber, false));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ public class MainViewerGUI extends JFrame
public final JCheckBoxMenuItem recoveryTypehInts = new TranslatedJCheckBoxMenuItem("Recover Type Hints", TranslatedComponents.RECOVER_TYPE__HINTS);
public final JCheckBoxMenuItem forceTurningIFs = new TranslatedJCheckBoxMenuItem("Force Returning IFs", TranslatedComponents.FORCE_RETURNING_IFS);
public final JCheckBoxMenuItem forLoopAGGCapture = new TranslatedJCheckBoxMenuItem("For Loop AGG Capture", TranslatedComponents.FOR_LOOP_AGG_CAPTURE);


//Smali/D2Jar
public final JMenu minSdkVersionMenu = new TranslatedJMenu("Minimum SDK version", TranslatedComponents.MIN_SDK_VERSION);
public final JSpinner minSdkVersionSpinner = new JSpinner();

//obfuscation
public final JMenu obfuscate = new JMenu("Obfuscate");
public final JMenuItem renameFields = new JMenuItem("Rename Fields");
Expand Down Expand Up @@ -611,6 +615,13 @@ public void buildSettingsMenu()
bytecodeDecompilerSettingsSecondaryMenu.add(appendBracketsToLabels);
bytecodeDecompilerSettingsDialog = new SettingsDialog(bytecodeDecompilerSettingsSecondaryMenu, new JPanel());
bytecodeDecompilerSettings.addActionListener((e)-> bytecodeDecompilerSettingsDialog.showDialog());

//Smali minSdkVersion
minSdkVersionSpinner.setPreferredSize(new Dimension(60, 24));
minSdkVersionSpinner.setMinimumSize(new Dimension(60, 24));
minSdkVersionSpinner.setModel(new SpinnerNumberModel(26, 1, null, 1));
minSdkVersionMenu.add(minSdkVersionSpinner);
settingsMainMenu.add(minSdkVersionMenu);

deleteForeignOutdatedLibs.addActionListener(arg0 -> showForeignLibraryWarning());
forcePureAsciiAsText.addActionListener(arg0 -> SettingsSerializer.saveSettingsAsync());
Expand Down Expand Up @@ -798,6 +809,11 @@ public int getFontSize()
{
return (int) fontSpinner.getValue();
}

public int getMinSdkVersion()
{
return (int) minSdkVersionSpinner.getValue();
}

public synchronized void clearBusyStatus()
{
Expand Down Expand Up @@ -968,4 +984,4 @@ public void updateTabTheme()
}

public static final long serialVersionUID = 1851409230530948543L;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ public enum TranslatedComponents
DESC,
RESULTS,
REFRESH,
MIN_SDK_VERSION,

;

Expand All @@ -265,4 +266,4 @@ public TranslatedComponentReference getTranslatedComponentReference()
{
return componentReference;
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package the.bytecode.club.bytecodeviewer.util;

import com.googlecode.d2j.dex.Dex2jar;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;

import java.io.File;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;

/***************************************************************************
* Bytecode Viewer (BCV) - Java & Android Reverse Engineering Suite *
Expand Down Expand Up @@ -60,7 +59,9 @@ public static synchronized void saveAsDex(File input, File output) {

public static synchronized void saveAsDex(File input, File output, boolean delete) {
try {
com.googlecode.dex2jar.tools.Jar2Dex.main(input.getAbsolutePath(), "-o", output.getAbsolutePath());
com.googlecode.dex2jar.tools.Jar2Dex.main(input.getAbsolutePath(),
"-o", output.getAbsolutePath(),
"-s", BytecodeViewer.viewer.getMinSdkVersion() + "");
if (delete)
input.delete();
} catch (Exception e) {
Expand Down
5 changes: 3 additions & 2 deletions src/main/resources/translations/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,5 +279,6 @@
"SAVE": "Save...",
"SAVE_AS": "Save As...",
"RESULTS": "Results",
"REFRESH": "Refresh"
}
"REFRESH": "Refresh",
"MIN_SDK_VERSION": "Minimum SDK version"
}
3 changes: 2 additions & 1 deletion src/main/resources/translations/german.json
Original file line number Diff line number Diff line change
Expand Up @@ -254,5 +254,6 @@
"CLOSE_ALL_BUT_THIS": "Alle außer diesen schließen",
"CLOSE_TAB": "Tab schließen",
"PLEASE_SEND_THIS_ERROR_LOG_TO": "Bitte senden Sie dieses Fehlerprotokoll an",
"PLEASE_SEND_RESOURCES": "Wenn Sie entsprechende gesetzliche Rechte an der jeweiligen Klasse besitzen"
"PLEASE_SEND_RESOURCES": "Wenn Sie entsprechende gesetzliche Rechte an der jeweiligen Klasse besitzen",
"MIN_SDK_VERSION": "Minimale SDK-Version"
}

0 comments on commit e4543ea

Please sign in to comment.