From 41fea8fb8de1eaa5812dca822eee3d461871fa07 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Tue, 9 Apr 2024 11:58:51 +0200 Subject: [PATCH 1/6] Add AUTO_OPEN to I18n --- src/main/resources/translations/english.json | 3 ++- src/main/resources/translations/german.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/resources/translations/english.json b/src/main/resources/translations/english.json index 9c781150e..a29360bdc 100644 --- a/src/main/resources/translations/english.json +++ b/src/main/resources/translations/english.json @@ -286,5 +286,6 @@ "MATCH_CASE": "Match Case", "EXACT_PATH": "Exact Path", "MIN_SDK_VERSION": "Minimum SDK version", - "PRINT_LINE_NUMBERS": "Print Line Numbers" + "PRINT_LINE_NUMBERS": "Print Line Numbers", + "AUTO_OPEN": "Open automatically" } diff --git a/src/main/resources/translations/german.json b/src/main/resources/translations/german.json index fcabd266d..c30a780b6 100644 --- a/src/main/resources/translations/german.json +++ b/src/main/resources/translations/german.json @@ -286,5 +286,6 @@ "MATCH_CASE": "Groß-/Kleinschreibung beachten", "EXACT_PATH": "Genauer Pfad", "MIN_SDK_VERSION": "Minimale SDK-Version", - "PRINT_LINE_NUMBERS": "Zeilennummern einschließen" + "PRINT_LINE_NUMBERS": "Zeilennummern einschließen", + "AUTO_OPEN": "Automatisch öffnen" } From c5240e718e148f491a165342038ad7238ac73897 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Tue, 9 Apr 2024 11:59:14 +0200 Subject: [PATCH 2/6] Use computeFrames option in dex2jar This yields more accurate outputs and circumvents bugs --- .../club/bytecodeviewer/util/Dex2Jar.java | 32 +++++++++++-------- 1 file changed, 19 insertions(+), 13 deletions(-) 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 7632b088f..a6f6b9ff3 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/util/Dex2Jar.java @@ -1,11 +1,13 @@ package the.bytecode.club.bytecodeviewer.util; +import com.googlecode.d2j.DexException; +import com.googlecode.d2j.Method; import com.googlecode.d2j.dex.Dex2jar; import com.googlecode.d2j.dex.DexExceptionHandler; -import com.googlecode.d2j.Method; import com.googlecode.d2j.node.DexMethodNode; -import org.objectweb.asm.MethodVisitor; +import com.googlecode.dex2jar.tools.Jar2Dex; import java.io.File; +import org.objectweb.asm.MethodVisitor; import the.bytecode.club.bytecodeviewer.BytecodeViewer; /*************************************************************************** @@ -43,17 +45,19 @@ public class Dex2Jar { public static synchronized void dex2Jar(File input, File output) { try { Dex2jar d2Jar = Dex2jar.from(input) - .withExceptionHandler(new DexExceptionHandler() { - public void handleFileException(Exception e) { - e.printStackTrace(); - } - - public void handleMethodTranslateException(Method method, DexMethodNode methodNode, MethodVisitor mv, Exception e) { - e.printStackTrace(); - } - }); + .computeFrames(true) + .withExceptionHandler(new DexExceptionHandler() { + public void handleFileException(Exception e) { + e.printStackTrace(); + } + + public void handleMethodTranslateException(Method method, DexMethodNode methodNode, + MethodVisitor mv, Exception e) { + e.printStackTrace(); + } + }); d2Jar.to(output.toPath()); - } catch (com.googlecode.d2j.DexException e) { + } catch (DexException e) { e.printStackTrace(); } catch (Exception e) { BytecodeViewer.handleException(e); @@ -72,7 +76,8 @@ 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(), + Jar2Dex.main(input.getAbsolutePath(), + "-f", "-o", output.getAbsolutePath(), "-s", BytecodeViewer.viewer.getMinSdkVersion() + ""); if (delete) @@ -81,4 +86,5 @@ public static synchronized void saveAsDex(File input, File output, boolean delet BytecodeViewer.handleException(e); } } + } From 6908d7e1b122b8d2e44c95e0ca2a4c11202754cc Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Tue, 9 Apr 2024 11:59:39 +0200 Subject: [PATCH 3/6] Update actions to Node.JS 20 --- .github/workflows/maven.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 56cecb02d..3f794d727 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -17,9 +17,9 @@ jobs: java: [ '8', '11', '17', '21' ] # LTS versions steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: 'temurin' @@ -30,7 +30,7 @@ jobs: run: echo "bcv_version=$(mvn -q -Dexec.executable=echo -Dexec.args='${project.version}' --non-recursive exec:exec)" >> $GITHUB_ENV id: project - name: 'Upload Artifact' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 if: ${{ matrix.java == '8' }} with: name: Bytecode-Viewer-${{ env.bcv_version }}-SNAPSHOT From d0a139d83f4fb0f0bb1f097fbda0f2b7c2f4b66c Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Tue, 9 Apr 2024 12:03:02 +0200 Subject: [PATCH 4/6] Update dependencies --- pom.xml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pom.xml b/pom.xml index c689e7f03..40a9e4e2d 100644 --- a/pom.xml +++ b/pom.xml @@ -15,25 +15,25 @@ 24.1.0 2.9.3 - 9.6 + 9.7 0.2.1 1.0bcv 0.152 1.9.12 1.6.0 - 1.16.0 - 3.1.11 - 1.25.0 - 2.15.1 + 1.16.1 + 3.1.12 + 1.26.1 + 2.16.1 3.14.0 1.11.0 3.0.2 0.4.1 - 6.3.6.Final - 2.4.11 + 6.3.7.Final + 2.4.16 e0d44f4 2.10.1 - 33.0.0-jre + 33.1.0-jre 2.2.0 4.2 1.4.7 @@ -43,13 +43,13 @@ 3.3 0.2.1 0.6.0 - 3.3.4 + 3.4.0 2.1.1 - 2.0.11 - 3.0.3 + 2.0.12 + 3.0.5 1.34.1 1.0.3 - 0.7.0 + a8f700b 1.1.4c @@ -358,7 +358,7 @@ ${darklaf-extensions-rsta.version} - com.github.usefulness + com.github.ThexXTURBOXx webp-imageio ${webp-imageio.version} From f7fa5b4e3801d880fe3c45412aafdaa555ab1fb3 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Tue, 9 Apr 2024 12:10:47 +0200 Subject: [PATCH 5/6] Fix overlapping resources --- pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pom.xml b/pom.xml index 40a9e4e2d..657f49f91 100644 --- a/pom.xml +++ b/pom.xml @@ -431,6 +431,8 @@ META-INF/*NOTICE* META-INF/MANIFEST.MF LICENSE + license.txt + NOTICE From 6d77715ab5d31610e926032d81150a9b6325a56c Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Tue, 9 Apr 2024 12:12:02 +0200 Subject: [PATCH 6/6] Update dex2jar again Forgot to do so in my previous commit - oops --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 657f49f91..0a2add242 100644 --- a/pom.xml +++ b/pom.xml @@ -30,7 +30,7 @@ 3.0.2 0.4.1 6.3.7.Final - 2.4.16 + 2.4.17 e0d44f4 2.10.1 33.1.0-jre