From a3f93f5e2c1e04be6b33521e5941819b1ed75797 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Mon, 9 Aug 2021 22:51:44 +0200 Subject: [PATCH] Apply miscellaneous fixes Most of these are from some fork # Conflicts: # build.gradle # d2j-j6/build.gradle # d2j-jasmin/build.gradle # d2j-smali/build.gradle # d2j-smali/src/test/java/a/SmaliTest.java # dex-reader-api/src/main/java/com/googlecode/d2j/DexConstants.java # dex-reader/build.gradle # dex-reader/src/main/java/com/googlecode/d2j/reader/DexFileReader.java # dex-tools/build.gradle # dex-tools/src/main/java/com/googlecode/d2j/tools/jar/InitOut.java # dex-tools/src/main/java/com/googlecode/d2j/tools/jar/InvocationWeaver.java # dex-translator/build.gradle # dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2Asm.java # dex-translator/src/main/java/org/objectweb/asm/AsmBridge.java # gradle/wrapper/gradle-wrapper.properties --- .../com/googlecode/dex2jar/tools/BaseCmd.java | 36 +++-- .../googlecode/d2j/jasmin/Jar2JasminCmd.java | 3 +- .../googlecode/d2j/jasmin/Jasmin2JarCmd.java | 18 +-- .../googlecode/d2j/jasmin/JasminDumper.java | 26 ++-- .../com/googlecode/d2j/jasmin/Jasmins.java | 2 +- d2j-smali/build.gradle | 4 +- .../com/googlecode/d2j/smali/antlr4/Smali.g4 | 4 +- .../googlecode/d2j/smali/AntlrSmaliUtil.java | 18 +-- .../d2j/smali/BaksmaliCodeDumper.java | 31 ++--- .../d2j/smali/BaksmaliDexFileVisitor.java | 8 +- .../googlecode/d2j/smali/BaksmaliDumper.java | 22 ++-- .../java/com/googlecode/d2j/smali/Smali.java | 26 ++-- .../com/googlecode/d2j/smali/SmaliCmd.java | 9 +- .../d2j/smali/SmaliCodeVisitor.java | 10 +- .../java/com/googlecode/d2j/smali/Utils.java | 58 ++++----- d2j-smali/src/test/java/a/SmaliTest.java | 4 + .../com/googlecode/dex2jar/ir/ts/Cfg.java | 18 ++- .../dex2jar/ir/ts/RemoveConstantFromSSA.java | 7 +- .../dex2jar/ir/ts/RemoveLocalFromSSA.java | 16 +-- .../googlecode/dex2jar/ir/ts/Transformer.java | 2 +- .../dex2jar/ir/ts/TypeTransformer.java | 41 +++--- .../java/com/googlecode/d2j/DexConstants.java | 2 +- .../googlecode/d2j/reader/DexFileReader.java | 123 +++++++++--------- .../com/googlecode/d2j/tools/jar/InitOut.java | 16 +-- .../d2j/tools/jar/InvocationWeaver.java | 112 +++++++--------- .../googlecode/dex2jar/tools/Dex2jarCmd.java | 2 +- .../dex2jar/tools/Dex2jarMultiThreadCmd.java | 5 +- .../com/googlecode/dex2jar/tools/Jar2Dex.java | 6 +- .../java/com/googlecode/d2j/dex/Dex2Asm.java | 22 ++-- .../java/com/googlecode/d2j/dex/Dex2jar.java | 4 +- 30 files changed, 306 insertions(+), 349 deletions(-) diff --git a/d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java b/d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java index 303d6b02..b9c13eb8 100644 --- a/d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java +++ b/d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java @@ -25,7 +25,6 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.nio.charset.StandardCharsets; import java.nio.file.*; @@ -103,7 +102,6 @@ public abstract class BaseCmd { throw new IOException("cant find zipfs support"); } - @SuppressWarnings("serial") protected static class HelpException extends RuntimeException { private static final long serialVersionUID = 5538069795297477488L; @@ -120,7 +118,7 @@ public abstract class BaseCmd { @Retention(value = RetentionPolicy.RUNTIME) @Target(value = { ElementType.FIELD }) - static public @interface Opt { + public @interface Opt { String argName() default ""; String description() default ""; @@ -190,7 +188,7 @@ public abstract class BaseCmd { @Retention(value = RetentionPolicy.RUNTIME) @Target(value = { ElementType.TYPE }) - static public @interface Syntax { + public @interface Syntax { String cmd(); @@ -212,8 +210,8 @@ public abstract class BaseCmd { @Opt(opt = "h", longOpt = "help", hasArg = false, description = "Print this help message") private boolean printHelp = false; - protected String remainingArgs[]; - protected String orginalArgs[]; + protected String[] remainingArgs; + protected String[] originalArgs; public BaseCmd() { } @@ -235,8 +233,8 @@ public abstract class BaseCmd { this.desc = header; } - private Set