From e785c50456ce901368b1116197c5ee91e55c66d5 Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Wed, 5 Jun 2013 10:03:18 +0800 Subject: [PATCH 01/51] start work 0.0.9.16 --HG-- branch : 0.0.9.x --- dex-tools/pom.xml | 2 +- dex-translator/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dex-tools/pom.xml b/dex-tools/pom.xml index 177ac44ab..6fd5b0d6c 100755 --- a/dex-tools/pom.xml +++ b/dex-tools/pom.xml @@ -7,7 +7,7 @@ 1.1 dex-tools - 0.0.9.15-SNAPSHOT + 0.0.9.16-SNAPSHOT Dex Tools Tools to work with dex and class files diff --git a/dex-translator/pom.xml b/dex-translator/pom.xml index adc6a7b85..878137986 100755 --- a/dex-translator/pom.xml +++ b/dex-translator/pom.xml @@ -9,7 +9,7 @@ dex-translator - 0.0.9.15-SNAPSHOT + 0.0.9.16-SNAPSHOT Dex Translator Tools to work with android .dex and java .class files http://code.google.como/p/dex2jar/ From d3312344fbdc3a9c2a7ebb1c99a08e2d179e704e Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Wed, 5 Jun 2013 19:10:04 +0800 Subject: [PATCH 02/51] clean exec mode from file --HG-- branch : 0.0.9.x --- .hgignore | 0 .hgtags | 0 commons-lite/pom.xml | 0 .../java/org/apache/commons/codec/binary/Hex.java | 0 .../org/apache/commons/collections/Transformer.java | 0 .../org/apache/commons/collections/map/LazyMap.java | 0 .../main/java/org/apache/commons/io/FileUtils.java | 0 .../java/org/apache/commons/io/FilenameUtils.java | 0 .../main/java/org/apache/commons/io/IOUtils.java | 0 .../image/codec/util/MemoryCacheSeekableStream.java | 0 .../image/codec/util/SeekableStream.java | 0 dex-ir/pom.xml | 0 .../java/com/googlecode/dex2jar/ir/Constant.java | 0 .../src/main/java/com/googlecode/dex2jar/ir/ET.java | 0 .../java/com/googlecode/dex2jar/ir/IrMethod.java | 0 .../main/java/com/googlecode/dex2jar/ir/Local.java | 0 .../java/com/googlecode/dex2jar/ir/LocalVar.java | 0 .../com/googlecode/dex2jar/ir/ToStringUtil.java | 0 .../main/java/com/googlecode/dex2jar/ir/Trap.java | 0 .../main/java/com/googlecode/dex2jar/ir/Value.java | 0 .../java/com/googlecode/dex2jar/ir/ValueBox.java | 0 .../com/googlecode/dex2jar/ir/expr/ArrayExpr.java | 0 .../com/googlecode/dex2jar/ir/expr/BinopExpr.java | 0 .../com/googlecode/dex2jar/ir/expr/CastExpr.java | 0 .../java/com/googlecode/dex2jar/ir/expr/Exprs.java | 0 .../com/googlecode/dex2jar/ir/expr/FieldExpr.java | 0 .../googlecode/dex2jar/ir/expr/FilledArrayExpr.java | 0 .../com/googlecode/dex2jar/ir/expr/InvokeExpr.java | 0 .../com/googlecode/dex2jar/ir/expr/NewExpr.java | 0 .../dex2jar/ir/expr/NewMutiArrayExpr.java | 0 .../com/googlecode/dex2jar/ir/expr/RefExpr.java | 0 .../com/googlecode/dex2jar/ir/expr/TypeExpr.java | 0 .../com/googlecode/dex2jar/ir/expr/UnopExpr.java | 0 .../com/googlecode/dex2jar/ir/stmt/AssignStmt.java | 0 .../com/googlecode/dex2jar/ir/stmt/JumpStmt.java | 0 .../com/googlecode/dex2jar/ir/stmt/LabelStmt.java | 0 .../dex2jar/ir/stmt/LookupSwitchStmt.java | 0 .../com/googlecode/dex2jar/ir/stmt/NopStmt.java | 0 .../googlecode/dex2jar/ir/stmt/ReturnVoidStmt.java | 0 .../java/com/googlecode/dex2jar/ir/stmt/Stmt.java | 0 .../com/googlecode/dex2jar/ir/stmt/StmtList.java | 0 .../java/com/googlecode/dex2jar/ir/stmt/Stmts.java | 0 .../googlecode/dex2jar/ir/stmt/TableSwitchStmt.java | 0 .../com/googlecode/dex2jar/ir/stmt/UnopStmt.java | 0 .../dex2jar/ir/ts/ArrayNullPointerTransformer.java | 0 .../googlecode/dex2jar/ir/ts/BaseLiveAnalyze.java | 0 .../main/java/com/googlecode/dex2jar/ir/ts/Cfg.java | 0 .../com/googlecode/dex2jar/ir/ts/EndRemover.java | 0 .../ir/ts/ExceptionHandlerCurrectTransformer.java | 0 .../java/com/googlecode/dex2jar/ir/ts/FixVar.java | 0 .../com/googlecode/dex2jar/ir/ts/LiveAnalyze.java | 0 .../com/googlecode/dex2jar/ir/ts/LocalRemove.java | 0 .../com/googlecode/dex2jar/ir/ts/LocalSplit.java | 0 .../com/googlecode/dex2jar/ir/ts/LocalType.java | 0 .../googlecode/dex2jar/ir/ts/TopologicalSort.java | 0 .../com/googlecode/dex2jar/ir/ts/Transformer.java | 0 .../com/googlecode/dex2jar/ir/ts/TypeAnalyze.java | 0 .../googlecode/dex2jar/ir/ts/ZeroTransformer.java | 0 dex-ir/src/main/resources/META-INF/LICENSE.txt | 0 dex-ir/src/main/resources/META-INF/NOTICE.txt | 0 .../dex2jar/ir/test/ConstantStringTest.java | 0 .../dex2jar/ir/test/LocalRemoverTest.java | 0 .../googlecode/dex2jar/ir/test/LocalSplitTest.java | 0 .../googlecode/dex2jar/ir/test/StmtListTest.java | 0 .../dex2jar/ir/test/TopologicalSortTest.java | 0 .../dex2jar/ir/test/TyepAnalyzeTypeRefTest.java | 0 .../com/googlecode/dex2jar/ir/test/ZeroTest.java | 0 dex-reader/pom.xml | 0 .../java/com/googlecode/dex2jar/DexException.java | 0 .../main/java/com/googlecode/dex2jar/DexLabel.java | 0 .../java/com/googlecode/dex2jar/DexOpcodes.java | 0 .../main/java/com/googlecode/dex2jar/DexType.java | 0 .../src/main/java/com/googlecode/dex2jar/Field.java | 0 .../main/java/com/googlecode/dex2jar/Method.java | 0 .../java/com/googlecode/dex2jar/OdexOpcodes.java | 0 .../com/googlecode/dex2jar/reader/Annotation.java | 0 .../com/googlecode/dex2jar/reader/Constant.java | 0 .../dex2jar/reader/DexAnnotationReader.java | 0 .../googlecode/dex2jar/reader/DexCodeReader.java | 0 .../dex2jar/reader/DexDebugInfoReader.java | 0 .../googlecode/dex2jar/reader/DexFileReader.java | 0 .../dex2jar/reader/DexInternalOpcode.java | 0 .../googlecode/dex2jar/reader/DexOpcodeAdapter.java | 0 .../java/com/googlecode/dex2jar/reader/Mutf8.java | 0 .../com/googlecode/dex2jar/reader/OpcodeFormat.java | 0 .../googlecode/dex2jar/reader/io/ArrayDataIn.java | 0 .../com/googlecode/dex2jar/reader/io/DataIn.java | 0 .../googlecode/dex2jar/reader/io/DataInWrapper.java | 0 .../dex2jar/reader/io/DataInputDataIn.java | 0 .../dex2jar/reader/io/InputStreamDataIn.java | 0 .../dex2jar/reader/io/OffsetedDataIn.java | 0 .../dex2jar/reader/io/RandomAccessFileInput.java | 0 .../dex2jar/util/ASMifierAnnotationV.java | 0 .../com/googlecode/dex2jar/util/ASMifierClassV.java | 0 .../com/googlecode/dex2jar/util/ASMifierCodeV.java | 0 .../com/googlecode/dex2jar/util/ASMifierFileV.java | 0 .../dex2jar/util/AbstractDumpDexCodeAdapter.java | 0 .../java/com/googlecode/dex2jar/util/ArrayOut.java | 0 .../com/googlecode/dex2jar/util/DexOpcodeDump.java | 0 .../main/java/com/googlecode/dex2jar/util/Dump.java | 0 .../googlecode/dex2jar/util/DumpDexCodeAdapter.java | 0 .../java/com/googlecode/dex2jar/util/Escape.java | 0 .../main/java/com/googlecode/dex2jar/util/Out.java | 0 .../java/com/googlecode/dex2jar/util/Utf8Utils.java | 0 .../dex2jar/visitors/DexAnnotationAble.java | 0 .../dex2jar/visitors/DexAnnotationVisitor.java | 0 .../dex2jar/visitors/DexClassAdapter.java | 0 .../dex2jar/visitors/DexClassVisitor.java | 0 .../googlecode/dex2jar/visitors/DexCodeAdapter.java | 0 .../googlecode/dex2jar/visitors/DexCodeVisitor.java | 0 .../dex2jar/visitors/DexFieldVisitor.java | 0 .../googlecode/dex2jar/visitors/DexFileAdapter.java | 0 .../googlecode/dex2jar/visitors/DexFileVisitor.java | 0 .../dex2jar/visitors/DexMethodAdapter.java | 0 .../dex2jar/visitors/DexMethodVisitor.java | 0 .../googlecode/dex2jar/visitors/EmptyVisitor.java | 0 .../dex2jar/visitors/OdexCodeVisitor.java | 0 .../dex2jar/visitors/OdexFileVisitor.java | 0 dex-reader/src/main/resources/META-INF/LICENSE.txt | 0 dex-reader/src/main/resources/META-INF/NOTICE.txt | 0 dex-tools/pom.xml | 0 dex-tools/src/main/assemble/package.xml | 0 dex-tools/src/main/bin/d2j-apk-sign.bat | 0 dex-tools/src/main/bin/d2j-apk-sign.sh | 0 dex-tools/src/main/bin/d2j-asm-verify.bat | 0 dex-tools/src/main/bin/d2j-asm-verify.sh | 0 dex-tools/src/main/bin/d2j-decrpyt-string.bat | 0 dex-tools/src/main/bin/d2j-decrpyt-string.sh | 0 dex-tools/src/main/bin/d2j-dex-asmifier.bat | 0 dex-tools/src/main/bin/d2j-dex-asmifier.sh | 0 dex-tools/src/main/bin/d2j-dex-dump.bat | 0 dex-tools/src/main/bin/d2j-dex-dump.sh | 0 dex-tools/src/main/bin/d2j-dex2jar.bat | 0 dex-tools/src/main/bin/d2j-dex2jar.sh | 0 dex-tools/src/main/bin/d2j-init-deobf.bat | 0 dex-tools/src/main/bin/d2j-init-deobf.sh | 0 dex-tools/src/main/bin/d2j-jar-access.bat | 0 dex-tools/src/main/bin/d2j-jar-access.sh | 0 dex-tools/src/main/bin/d2j-jar-remap.bat | 0 dex-tools/src/main/bin/d2j-jar-remap.sh | 0 dex-tools/src/main/bin/d2j-jar2dex.bat | 0 dex-tools/src/main/bin/d2j-jar2dex.sh | 0 dex-tools/src/main/bin/d2j-jar2jasmin.bat | 0 dex-tools/src/main/bin/d2j-jar2jasmin.sh | 0 dex-tools/src/main/bin/d2j-jasmin2jar.bat | 0 dex-tools/src/main/bin/d2j-jasmin2jar.sh | 0 dex-tools/src/main/bin/dex-dump.bat | 0 dex-tools/src/main/bin/dex-dump.sh | 0 dex-tools/src/main/bin/dex2jar.bat | 0 dex-tools/src/main/bin/dex2jar.sh | 0 dex-tools/src/main/bin/setclasspath.bat | 0 dex-tools/src/main/jars/asm-LICENSE.txt | 0 dex-tools/src/main/jars/commons-io-LICENSE.txt | 0 dex-tools/src/main/jars/commons-io-NOTICE.txt | 0 dex-tools/src/main/jars/dx-NOTICE | 0 dex-tools/src/main/jars/dx.jar | Bin dex-tools/src/main/jars/license-jasmin.txt | 0 .../src/main/java/com/android/signapk/SignApk.java | 0 .../java/com/googlecode/dex2jar/bin_gen/BinGen.java | 0 .../java/com/googlecode/dex2jar/tools/ApkSign.java | 0 .../com/googlecode/dex2jar/tools/AsmVerify.java | 0 .../java/com/googlecode/dex2jar/tools/BaseCmd.java | 0 .../com/googlecode/dex2jar/tools/DeObfInitCmd.java | 0 .../googlecode/dex2jar/tools/DecryptStringCmd.java | 0 .../com/googlecode/dex2jar/tools/Dex2jarCmd.java | 0 .../java/com/googlecode/dex2jar/tools/Jar2Dex.java | 0 .../com/googlecode/dex2jar/tools/Jar2Jasmin.java | 0 .../com/googlecode/dex2jar/tools/JarAccessCmd.java | 0 .../java/com/googlecode/dex2jar/tools/JarRemap.java | 0 .../com/googlecode/dex2jar/tools/Jasmin2Jar.java | 0 .../dex2jar/tools/JasminifierClassAdapter.java | 0 .../java/com/googlecode/dex2jar/tools/to/Do.java | 0 dex-tools/src/main/resources/META-INF/LICENSE.txt | 0 dex-tools/src/main/resources/META-INF/NOTICE.txt | 0 .../com/googlecode/dex2jar/bin_gen/bat_template | 0 .../com/googlecode/dex2jar/bin_gen/class.cfg | 0 .../com/googlecode/dex2jar/bin_gen/setclasspath.bat | 0 .../com/googlecode/dex2jar/bin_gen/sh_template | 0 .../com/googlecode/dex2jar/tools/ApkSign.cer | Bin .../com/googlecode/dex2jar/tools/ApkSign.private | Bin dex-translator/pom.xml | 0 .../com/googlecode/dex2jar/asm/FieldAdapter.java | 0 .../googlecode/dex2jar/asm/LdcOptimizeAdapter.java | 0 .../asm/OrderInnerOutterInsnNodeClassAdapter.java | 0 .../googlecode/dex2jar/v3/ClassVisitorFactory.java | 0 .../dex2jar/v3/Dex2AsmAnnotationAdapter.java | 0 .../java/com/googlecode/dex2jar/v3/Dex2jar.java | 0 .../googlecode/dex2jar/v3/DexExceptionHandler.java | 0 .../dex2jar/v3/DexExceptionHandlerImpl.java | 0 .../googlecode/dex2jar/v3/IrMethod2AsmMethod.java | 0 .../main/java/com/googlecode/dex2jar/v3/Main.java | 0 .../src/main/java/com/googlecode/dex2jar/v3/V3.java | 0 .../com/googlecode/dex2jar/v3/V3CodeAdapter.java | 0 .../com/googlecode/dex2jar/v3/V3MethodAdapter.java | 0 .../src/main/resources/META-INF/LICENSE.txt | 0 .../src/main/resources/META-INF/NOTICE.txt | 0 .../com/googlecode/dex2jar/test/ASMifierTest.java | 0 .../com/googlecode/dex2jar/test/ArrayTypeTest.java | 0 .../com/googlecode/dex2jar/test/AutoCastTest.java | 0 .../java/com/googlecode/dex2jar/test/DumpTest.java | 0 .../com/googlecode/dex2jar/test/EmptyTrapTest.java | 0 .../java/com/googlecode/dex2jar/test/I101Test.java | 0 .../java/com/googlecode/dex2jar/test/I121Test.java | 0 .../java/com/googlecode/dex2jar/test/I63Test.java | 0 .../com/googlecode/dex2jar/test/Issue71Test.java | 0 .../com/googlecode/dex2jar/test/OptSyncTest.java | 0 .../java/com/googlecode/dex2jar/test/ResTest.java | 0 .../com/googlecode/dex2jar/test/TestDexClassV.java | 0 .../java/com/googlecode/dex2jar/test/TestUtils.java | 0 .../java/com/googlecode/dex2jar/test/V3Test.java | 0 .../java/com/googlecode/dex2jar/test/ZeroTest.java | 0 .../gen/FTPClient__parsePassiveModeReply.java | 0 dex-translator/src/test/java/res/ArrayRes.java | 0 dex-translator/src/test/java/res/ChineseRes.java | 0 dex-translator/src/test/java/res/ConstValues.java | 0 dex-translator/src/test/java/res/ExceptionRes.java | 0 .../src/test/java/res/I56_AccessFlag.java | 0 dex-translator/src/test/java/res/I71.java | 0 dex-translator/src/test/java/res/I73.java | 0 dex-translator/src/test/java/res/I88.java | 0 dex-translator/src/test/java/res/LongDoubleRes.java | 0 dex-translator/src/test/java/res/NoEndRes.java | 0 dex-translator/src/test/java/res/NullZero.java | 0 .../src/test/java/res/OptimizeSynchronized.java | 0 dex-translator/src/test/java/res/PopRes.java | 0 dex-translator/src/test/java/res/ResChild.java | 0 dex-translator/src/test/java/res/ResParent.java | 0 dex-translator/src/test/java/res/SwitchRes.java | 0 dex-translator/src/test/java/res/U0000String.java | 0 dex-translator/src/test/java/res/WideRes.java | 0 .../src/test/java/res/i55/AAbstractClass.java | 0 dex-translator/src/test/java/res/i55/AClass.java | 0 .../src/test/java/res/i55/AInterface.java | 0 dex-translator/src/test/resources/dexes/i_jetty.dex | Bin dex-translator/src/test/resources/dx-NOTICE | 0 dex-translator/src/test/resources/dx.jar | Bin pom.xml | 0 237 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 .hgignore mode change 100755 => 100644 .hgtags mode change 100755 => 100644 commons-lite/pom.xml mode change 100755 => 100644 commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java mode change 100755 => 100644 commons-lite/src/main/java/org/apache/commons/collections/Transformer.java mode change 100755 => 100644 commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java mode change 100755 => 100644 commons-lite/src/main/java/org/apache/commons/io/FileUtils.java mode change 100755 => 100644 commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java mode change 100755 => 100644 commons-lite/src/main/java/org/apache/commons/io/IOUtils.java mode change 100755 => 100644 commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java mode change 100755 => 100644 commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java mode change 100755 => 100644 dex-ir/pom.xml mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/Constant.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ET.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/IrMethod.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/Local.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/LocalVar.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ToStringUtil.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/Trap.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/Value.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ValueBox.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/ArrayExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/BinopExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/CastExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/Exprs.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FieldExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FilledArrayExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/InvokeExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewMutiArrayExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/RefExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/TypeExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/UnopExpr.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/AssignStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/JumpStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/LabelStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/LookupSwitchStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/NopStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/ReturnVoidStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/StmtList.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmts.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/TableSwitchStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/UnopStmt.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ArrayNullPointerTransformer.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/BaseLiveAnalyze.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Cfg.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/EndRemover.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ExceptionHandlerCurrectTransformer.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/FixVar.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LiveAnalyze.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalRemove.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalSplit.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TopologicalSort.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Transformer.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TypeAnalyze.java mode change 100755 => 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ZeroTransformer.java mode change 100755 => 100644 dex-ir/src/main/resources/META-INF/LICENSE.txt mode change 100755 => 100644 dex-ir/src/main/resources/META-INF/NOTICE.txt mode change 100755 => 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ConstantStringTest.java mode change 100755 => 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalRemoverTest.java mode change 100755 => 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalSplitTest.java mode change 100755 => 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/StmtListTest.java mode change 100755 => 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TopologicalSortTest.java mode change 100755 => 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TyepAnalyzeTypeRefTest.java mode change 100755 => 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ZeroTest.java mode change 100755 => 100644 dex-reader/pom.xml mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/DexException.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/DexLabel.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/DexOpcodes.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/DexType.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/Field.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/Method.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/OdexOpcodes.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/Annotation.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/Constant.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexAnnotationReader.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexDebugInfoReader.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexInternalOpcode.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexOpcodeAdapter.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/Mutf8.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/ArrayDataIn.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataIn.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInWrapper.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInputDataIn.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/InputStreamDataIn.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/OffsetedDataIn.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/RandomAccessFileInput.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierAnnotationV.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierClassV.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierCodeV.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierFileV.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/AbstractDumpDexCodeAdapter.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/ArrayOut.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/DexOpcodeDump.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/Dump.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/DumpDexCodeAdapter.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/Escape.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/Out.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/Utf8Utils.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexAnnotationAble.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexAnnotationVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassAdapter.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeAdapter.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFieldVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileAdapter.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodAdapter.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/EmptyVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexCodeVisitor.java mode change 100755 => 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexFileVisitor.java mode change 100755 => 100644 dex-reader/src/main/resources/META-INF/LICENSE.txt mode change 100755 => 100644 dex-reader/src/main/resources/META-INF/NOTICE.txt mode change 100755 => 100644 dex-tools/pom.xml mode change 100755 => 100644 dex-tools/src/main/assemble/package.xml mode change 100755 => 100644 dex-tools/src/main/bin/d2j-apk-sign.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-apk-sign.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-asm-verify.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-asm-verify.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-decrpyt-string.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-decrpyt-string.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-dex-asmifier.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-dex-asmifier.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-dex-dump.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-dex-dump.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-dex2jar.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-dex2jar.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-init-deobf.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-init-deobf.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar-access.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar-access.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar-remap.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar-remap.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar2dex.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar2dex.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar2jasmin.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jar2jasmin.sh mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jasmin2jar.bat mode change 100755 => 100644 dex-tools/src/main/bin/d2j-jasmin2jar.sh mode change 100755 => 100644 dex-tools/src/main/bin/dex-dump.bat mode change 100755 => 100644 dex-tools/src/main/bin/dex-dump.sh mode change 100755 => 100644 dex-tools/src/main/bin/dex2jar.bat mode change 100755 => 100644 dex-tools/src/main/bin/dex2jar.sh mode change 100755 => 100644 dex-tools/src/main/bin/setclasspath.bat mode change 100755 => 100644 dex-tools/src/main/jars/asm-LICENSE.txt mode change 100755 => 100644 dex-tools/src/main/jars/commons-io-LICENSE.txt mode change 100755 => 100644 dex-tools/src/main/jars/commons-io-NOTICE.txt mode change 100755 => 100644 dex-tools/src/main/jars/dx-NOTICE mode change 100755 => 100644 dex-tools/src/main/jars/dx.jar mode change 100755 => 100644 dex-tools/src/main/jars/license-jasmin.txt mode change 100755 => 100644 dex-tools/src/main/java/com/android/signapk/SignApk.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/ApkSign.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/AsmVerify.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/DeObfInitCmd.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jar2Dex.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jar2Jasmin.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarAccessCmd.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarRemap.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jasmin2Jar.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/JasminifierClassAdapter.java mode change 100755 => 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/to/Do.java mode change 100755 => 100644 dex-tools/src/main/resources/META-INF/LICENSE.txt mode change 100755 => 100644 dex-tools/src/main/resources/META-INF/NOTICE.txt mode change 100755 => 100644 dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/bat_template mode change 100755 => 100644 dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/class.cfg mode change 100755 => 100644 dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat mode change 100755 => 100644 dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/sh_template mode change 100755 => 100644 dex-tools/src/main/resources/com/googlecode/dex2jar/tools/ApkSign.cer mode change 100755 => 100644 dex-tools/src/main/resources/com/googlecode/dex2jar/tools/ApkSign.private mode change 100755 => 100644 dex-translator/pom.xml mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/asm/FieldAdapter.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/asm/LdcOptimizeAdapter.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/asm/OrderInnerOutterInsnNodeClassAdapter.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/ClassVisitorFactory.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2AsmAnnotationAdapter.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/DexExceptionHandler.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/DexExceptionHandlerImpl.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/IrMethod2AsmMethod.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/Main.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java mode change 100755 => 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3MethodAdapter.java mode change 100755 => 100644 dex-translator/src/main/resources/META-INF/LICENSE.txt mode change 100755 => 100644 dex-translator/src/main/resources/META-INF/NOTICE.txt mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/ASMifierTest.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/ArrayTypeTest.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/AutoCastTest.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/DumpTest.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/EmptyTrapTest.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/I101Test.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/I121Test.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/I63Test.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/Issue71Test.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/OptSyncTest.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/ResTest.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/TestDexClassV.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/TestUtils.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/V3Test.java mode change 100755 => 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/ZeroTest.java mode change 100755 => 100644 dex-translator/src/test/java/dex2jar/gen/FTPClient__parsePassiveModeReply.java mode change 100755 => 100644 dex-translator/src/test/java/res/ArrayRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/ChineseRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/ConstValues.java mode change 100755 => 100644 dex-translator/src/test/java/res/ExceptionRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/I56_AccessFlag.java mode change 100755 => 100644 dex-translator/src/test/java/res/I71.java mode change 100755 => 100644 dex-translator/src/test/java/res/I73.java mode change 100755 => 100644 dex-translator/src/test/java/res/I88.java mode change 100755 => 100644 dex-translator/src/test/java/res/LongDoubleRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/NoEndRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/NullZero.java mode change 100755 => 100644 dex-translator/src/test/java/res/OptimizeSynchronized.java mode change 100755 => 100644 dex-translator/src/test/java/res/PopRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/ResChild.java mode change 100755 => 100644 dex-translator/src/test/java/res/ResParent.java mode change 100755 => 100644 dex-translator/src/test/java/res/SwitchRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/U0000String.java mode change 100755 => 100644 dex-translator/src/test/java/res/WideRes.java mode change 100755 => 100644 dex-translator/src/test/java/res/i55/AAbstractClass.java mode change 100755 => 100644 dex-translator/src/test/java/res/i55/AClass.java mode change 100755 => 100644 dex-translator/src/test/java/res/i55/AInterface.java mode change 100755 => 100644 dex-translator/src/test/resources/dexes/i_jetty.dex mode change 100755 => 100644 dex-translator/src/test/resources/dx-NOTICE mode change 100755 => 100644 dex-translator/src/test/resources/dx.jar mode change 100755 => 100644 pom.xml diff --git a/.hgignore b/.hgignore old mode 100755 new mode 100644 diff --git a/.hgtags b/.hgtags old mode 100755 new mode 100644 diff --git a/commons-lite/pom.xml b/commons-lite/pom.xml old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java b/commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/commons/collections/Transformer.java b/commons-lite/src/main/java/org/apache/commons/collections/Transformer.java old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java b/commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/commons/io/FileUtils.java b/commons-lite/src/main/java/org/apache/commons/io/FileUtils.java old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java b/commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/commons/io/IOUtils.java b/commons-lite/src/main/java/org/apache/commons/io/IOUtils.java old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java b/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java old mode 100755 new mode 100644 diff --git a/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java b/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java old mode 100755 new mode 100644 diff --git a/dex-ir/pom.xml b/dex-ir/pom.xml old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Constant.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Constant.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ET.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ET.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/IrMethod.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/IrMethod.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Local.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Local.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/LocalVar.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/LocalVar.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ToStringUtil.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ToStringUtil.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Trap.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Trap.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Value.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/Value.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ValueBox.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ValueBox.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/ArrayExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/ArrayExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/BinopExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/BinopExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/CastExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/CastExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/Exprs.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/Exprs.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FieldExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FieldExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FilledArrayExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/FilledArrayExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/InvokeExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/InvokeExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewMutiArrayExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/NewMutiArrayExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/RefExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/RefExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/TypeExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/TypeExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/UnopExpr.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/UnopExpr.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/AssignStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/AssignStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/JumpStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/JumpStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/LabelStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/LabelStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/LookupSwitchStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/LookupSwitchStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/NopStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/NopStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/ReturnVoidStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/ReturnVoidStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/StmtList.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/StmtList.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmts.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmts.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/TableSwitchStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/TableSwitchStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/UnopStmt.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/UnopStmt.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ArrayNullPointerTransformer.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ArrayNullPointerTransformer.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/BaseLiveAnalyze.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/BaseLiveAnalyze.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Cfg.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Cfg.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/EndRemover.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/EndRemover.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ExceptionHandlerCurrectTransformer.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ExceptionHandlerCurrectTransformer.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/FixVar.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/FixVar.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LiveAnalyze.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LiveAnalyze.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalRemove.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalRemove.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalSplit.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalSplit.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TopologicalSort.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TopologicalSort.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Transformer.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Transformer.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TypeAnalyze.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TypeAnalyze.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ZeroTransformer.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ZeroTransformer.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/resources/META-INF/LICENSE.txt b/dex-ir/src/main/resources/META-INF/LICENSE.txt old mode 100755 new mode 100644 diff --git a/dex-ir/src/main/resources/META-INF/NOTICE.txt b/dex-ir/src/main/resources/META-INF/NOTICE.txt old mode 100755 new mode 100644 diff --git a/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ConstantStringTest.java b/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ConstantStringTest.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalRemoverTest.java b/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalRemoverTest.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalSplitTest.java b/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalSplitTest.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/StmtListTest.java b/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/StmtListTest.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TopologicalSortTest.java b/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TopologicalSortTest.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TyepAnalyzeTypeRefTest.java b/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TyepAnalyzeTypeRefTest.java old mode 100755 new mode 100644 diff --git a/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ZeroTest.java b/dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ZeroTest.java old mode 100755 new mode 100644 diff --git a/dex-reader/pom.xml b/dex-reader/pom.xml old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/DexException.java b/dex-reader/src/main/java/com/googlecode/dex2jar/DexException.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/DexLabel.java b/dex-reader/src/main/java/com/googlecode/dex2jar/DexLabel.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/DexOpcodes.java b/dex-reader/src/main/java/com/googlecode/dex2jar/DexOpcodes.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/DexType.java b/dex-reader/src/main/java/com/googlecode/dex2jar/DexType.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/Field.java b/dex-reader/src/main/java/com/googlecode/dex2jar/Field.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/Method.java b/dex-reader/src/main/java/com/googlecode/dex2jar/Method.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/OdexOpcodes.java b/dex-reader/src/main/java/com/googlecode/dex2jar/OdexOpcodes.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/Annotation.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/Annotation.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/Constant.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/Constant.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexAnnotationReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexAnnotationReader.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexDebugInfoReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexDebugInfoReader.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexInternalOpcode.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexInternalOpcode.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexOpcodeAdapter.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexOpcodeAdapter.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/Mutf8.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/Mutf8.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/ArrayDataIn.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/ArrayDataIn.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataIn.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataIn.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInWrapper.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInWrapper.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInputDataIn.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInputDataIn.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/InputStreamDataIn.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/InputStreamDataIn.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/OffsetedDataIn.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/OffsetedDataIn.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/RandomAccessFileInput.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/RandomAccessFileInput.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierAnnotationV.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierAnnotationV.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierClassV.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierClassV.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierCodeV.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierCodeV.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierFileV.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierFileV.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/AbstractDumpDexCodeAdapter.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/AbstractDumpDexCodeAdapter.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/ArrayOut.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/ArrayOut.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/DexOpcodeDump.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/DexOpcodeDump.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/Dump.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/Dump.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/DumpDexCodeAdapter.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/DumpDexCodeAdapter.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/Escape.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/Escape.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/Out.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/Out.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/util/Utf8Utils.java b/dex-reader/src/main/java/com/googlecode/dex2jar/util/Utf8Utils.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexAnnotationAble.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexAnnotationAble.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexAnnotationVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexAnnotationVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassAdapter.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassAdapter.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeAdapter.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeAdapter.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFieldVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFieldVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileAdapter.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileAdapter.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodAdapter.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodAdapter.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/EmptyVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/EmptyVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexCodeVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexCodeVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexFileVisitor.java b/dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexFileVisitor.java old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/resources/META-INF/LICENSE.txt b/dex-reader/src/main/resources/META-INF/LICENSE.txt old mode 100755 new mode 100644 diff --git a/dex-reader/src/main/resources/META-INF/NOTICE.txt b/dex-reader/src/main/resources/META-INF/NOTICE.txt old mode 100755 new mode 100644 diff --git a/dex-tools/pom.xml b/dex-tools/pom.xml old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/assemble/package.xml b/dex-tools/src/main/assemble/package.xml old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-apk-sign.bat b/dex-tools/src/main/bin/d2j-apk-sign.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-apk-sign.sh b/dex-tools/src/main/bin/d2j-apk-sign.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-asm-verify.bat b/dex-tools/src/main/bin/d2j-asm-verify.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-asm-verify.sh b/dex-tools/src/main/bin/d2j-asm-verify.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-decrpyt-string.bat b/dex-tools/src/main/bin/d2j-decrpyt-string.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-decrpyt-string.sh b/dex-tools/src/main/bin/d2j-decrpyt-string.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-dex-asmifier.bat b/dex-tools/src/main/bin/d2j-dex-asmifier.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-dex-asmifier.sh b/dex-tools/src/main/bin/d2j-dex-asmifier.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-dex-dump.bat b/dex-tools/src/main/bin/d2j-dex-dump.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-dex-dump.sh b/dex-tools/src/main/bin/d2j-dex-dump.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-dex2jar.bat b/dex-tools/src/main/bin/d2j-dex2jar.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-dex2jar.sh b/dex-tools/src/main/bin/d2j-dex2jar.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-init-deobf.bat b/dex-tools/src/main/bin/d2j-init-deobf.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-init-deobf.sh b/dex-tools/src/main/bin/d2j-init-deobf.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar-access.bat b/dex-tools/src/main/bin/d2j-jar-access.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar-access.sh b/dex-tools/src/main/bin/d2j-jar-access.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar-remap.bat b/dex-tools/src/main/bin/d2j-jar-remap.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar-remap.sh b/dex-tools/src/main/bin/d2j-jar-remap.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar2dex.bat b/dex-tools/src/main/bin/d2j-jar2dex.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar2dex.sh b/dex-tools/src/main/bin/d2j-jar2dex.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar2jasmin.bat b/dex-tools/src/main/bin/d2j-jar2jasmin.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jar2jasmin.sh b/dex-tools/src/main/bin/d2j-jar2jasmin.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jasmin2jar.bat b/dex-tools/src/main/bin/d2j-jasmin2jar.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/d2j-jasmin2jar.sh b/dex-tools/src/main/bin/d2j-jasmin2jar.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/dex-dump.bat b/dex-tools/src/main/bin/dex-dump.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/dex-dump.sh b/dex-tools/src/main/bin/dex-dump.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/dex2jar.bat b/dex-tools/src/main/bin/dex2jar.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/dex2jar.sh b/dex-tools/src/main/bin/dex2jar.sh old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/bin/setclasspath.bat b/dex-tools/src/main/bin/setclasspath.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/jars/asm-LICENSE.txt b/dex-tools/src/main/jars/asm-LICENSE.txt old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/jars/commons-io-LICENSE.txt b/dex-tools/src/main/jars/commons-io-LICENSE.txt old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/jars/commons-io-NOTICE.txt b/dex-tools/src/main/jars/commons-io-NOTICE.txt old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/jars/dx-NOTICE b/dex-tools/src/main/jars/dx-NOTICE old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/jars/dx.jar b/dex-tools/src/main/jars/dx.jar old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/jars/license-jasmin.txt b/dex-tools/src/main/jars/license-jasmin.txt old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/android/signapk/SignApk.java b/dex-tools/src/main/java/com/android/signapk/SignApk.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java b/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/ApkSign.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/ApkSign.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/AsmVerify.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/AsmVerify.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DeObfInitCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DeObfInitCmd.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jar2Dex.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jar2Dex.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jar2Jasmin.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jar2Jasmin.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarAccessCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarAccessCmd.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarRemap.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarRemap.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jasmin2Jar.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jasmin2Jar.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JasminifierClassAdapter.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JasminifierClassAdapter.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/to/Do.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/to/Do.java old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/META-INF/LICENSE.txt b/dex-tools/src/main/resources/META-INF/LICENSE.txt old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/META-INF/NOTICE.txt b/dex-tools/src/main/resources/META-INF/NOTICE.txt old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/bat_template b/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/bat_template old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/class.cfg b/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/class.cfg old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat b/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/sh_template b/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/sh_template old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/tools/ApkSign.cer b/dex-tools/src/main/resources/com/googlecode/dex2jar/tools/ApkSign.cer old mode 100755 new mode 100644 diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/tools/ApkSign.private b/dex-tools/src/main/resources/com/googlecode/dex2jar/tools/ApkSign.private old mode 100755 new mode 100644 diff --git a/dex-translator/pom.xml b/dex-translator/pom.xml old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/asm/FieldAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/asm/FieldAdapter.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/asm/LdcOptimizeAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/asm/LdcOptimizeAdapter.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/asm/OrderInnerOutterInsnNodeClassAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/asm/OrderInnerOutterInsnNodeClassAdapter.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/ClassVisitorFactory.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/ClassVisitorFactory.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2AsmAnnotationAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2AsmAnnotationAdapter.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/DexExceptionHandler.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/DexExceptionHandler.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/DexExceptionHandlerImpl.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/DexExceptionHandlerImpl.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/IrMethod2AsmMethod.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/IrMethod2AsmMethod.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Main.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Main.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3MethodAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3MethodAdapter.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/resources/META-INF/LICENSE.txt b/dex-translator/src/main/resources/META-INF/LICENSE.txt old mode 100755 new mode 100644 diff --git a/dex-translator/src/main/resources/META-INF/NOTICE.txt b/dex-translator/src/main/resources/META-INF/NOTICE.txt old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/ASMifierTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/ASMifierTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/ArrayTypeTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/ArrayTypeTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/AutoCastTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/AutoCastTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/DumpTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/DumpTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/EmptyTrapTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/EmptyTrapTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/I101Test.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/I101Test.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/I121Test.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/I121Test.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/I63Test.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/I63Test.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/Issue71Test.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/Issue71Test.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/OptSyncTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/OptSyncTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/ResTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/ResTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/TestDexClassV.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/TestDexClassV.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/TestUtils.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/TestUtils.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/V3Test.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/V3Test.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/ZeroTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/ZeroTest.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/dex2jar/gen/FTPClient__parsePassiveModeReply.java b/dex-translator/src/test/java/dex2jar/gen/FTPClient__parsePassiveModeReply.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/ArrayRes.java b/dex-translator/src/test/java/res/ArrayRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/ChineseRes.java b/dex-translator/src/test/java/res/ChineseRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/ConstValues.java b/dex-translator/src/test/java/res/ConstValues.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/ExceptionRes.java b/dex-translator/src/test/java/res/ExceptionRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/I56_AccessFlag.java b/dex-translator/src/test/java/res/I56_AccessFlag.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/I71.java b/dex-translator/src/test/java/res/I71.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/I73.java b/dex-translator/src/test/java/res/I73.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/I88.java b/dex-translator/src/test/java/res/I88.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/LongDoubleRes.java b/dex-translator/src/test/java/res/LongDoubleRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/NoEndRes.java b/dex-translator/src/test/java/res/NoEndRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/NullZero.java b/dex-translator/src/test/java/res/NullZero.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/OptimizeSynchronized.java b/dex-translator/src/test/java/res/OptimizeSynchronized.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/PopRes.java b/dex-translator/src/test/java/res/PopRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/ResChild.java b/dex-translator/src/test/java/res/ResChild.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/ResParent.java b/dex-translator/src/test/java/res/ResParent.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/SwitchRes.java b/dex-translator/src/test/java/res/SwitchRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/U0000String.java b/dex-translator/src/test/java/res/U0000String.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/WideRes.java b/dex-translator/src/test/java/res/WideRes.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/i55/AAbstractClass.java b/dex-translator/src/test/java/res/i55/AAbstractClass.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/i55/AClass.java b/dex-translator/src/test/java/res/i55/AClass.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/java/res/i55/AInterface.java b/dex-translator/src/test/java/res/i55/AInterface.java old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/resources/dexes/i_jetty.dex b/dex-translator/src/test/resources/dexes/i_jetty.dex old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/resources/dx-NOTICE b/dex-translator/src/test/resources/dx-NOTICE old mode 100755 new mode 100644 diff --git a/dex-translator/src/test/resources/dx.jar b/dex-translator/src/test/resources/dx.jar old mode 100755 new mode 100644 diff --git a/pom.xml b/pom.xml old mode 100755 new mode 100644 From 4513d263322df978480492e323383968da59ee34 Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Wed, 5 Jun 2013 19:20:54 +0800 Subject: [PATCH 03/51] generate .bat and .sh at build time --HG-- branch : 0.0.9.x --- dex-tools/pom.xml | 21 +++++ dex-tools/src/main/assemble/package.xml | 94 ++++++++++--------- dex-tools/src/main/bin/d2j-apk-sign.bat | 23 ----- dex-tools/src/main/bin/d2j-apk-sign.sh | 40 -------- dex-tools/src/main/bin/d2j-asm-verify.bat | 23 ----- dex-tools/src/main/bin/d2j-asm-verify.sh | 40 -------- dex-tools/src/main/bin/d2j-decrpyt-string.bat | 23 ----- dex-tools/src/main/bin/d2j-decrpyt-string.sh | 40 -------- dex-tools/src/main/bin/d2j-dex-asmifier.bat | 23 ----- dex-tools/src/main/bin/d2j-dex-asmifier.sh | 40 -------- dex-tools/src/main/bin/d2j-dex-dump.bat | 23 ----- dex-tools/src/main/bin/d2j-dex-dump.sh | 40 -------- dex-tools/src/main/bin/d2j-dex2jar.bat | 23 ----- dex-tools/src/main/bin/d2j-dex2jar.sh | 40 -------- dex-tools/src/main/bin/d2j-init-deobf.bat | 23 ----- dex-tools/src/main/bin/d2j-init-deobf.sh | 40 -------- dex-tools/src/main/bin/d2j-jar-access.bat | 23 ----- dex-tools/src/main/bin/d2j-jar-access.sh | 40 -------- dex-tools/src/main/bin/d2j-jar-remap.bat | 23 ----- dex-tools/src/main/bin/d2j-jar-remap.sh | 40 -------- dex-tools/src/main/bin/d2j-jar2dex.bat | 23 ----- dex-tools/src/main/bin/d2j-jar2dex.sh | 40 -------- dex-tools/src/main/bin/d2j-jar2jasmin.bat | 23 ----- dex-tools/src/main/bin/d2j-jar2jasmin.sh | 40 -------- dex-tools/src/main/bin/d2j-jasmin2jar.bat | 23 ----- dex-tools/src/main/bin/d2j-jasmin2jar.sh | 40 -------- dex-tools/src/main/bin/dex-dump.bat | 6 -- dex-tools/src/main/bin/dex-dump.sh | 23 ----- dex-tools/src/main/bin/dex2jar.bat | 23 ----- dex-tools/src/main/bin/dex2jar.sh | 40 -------- .../dex2jar => }/bin_gen/bat_template | 0 .../googlecode/dex2jar => }/bin_gen/class.cfg | 0 .../main/{bin => bin_gen}/setclasspath.bat | 0 .../dex2jar => }/bin_gen/sh_template | 0 .../googlecode/dex2jar/bin_gen/BinGen.java | 26 ++--- .../dex2jar/bin_gen/setclasspath.bat | 1 - 36 files changed, 86 insertions(+), 904 deletions(-) delete mode 100644 dex-tools/src/main/bin/d2j-apk-sign.bat delete mode 100644 dex-tools/src/main/bin/d2j-apk-sign.sh delete mode 100644 dex-tools/src/main/bin/d2j-asm-verify.bat delete mode 100644 dex-tools/src/main/bin/d2j-asm-verify.sh delete mode 100644 dex-tools/src/main/bin/d2j-decrpyt-string.bat delete mode 100644 dex-tools/src/main/bin/d2j-decrpyt-string.sh delete mode 100644 dex-tools/src/main/bin/d2j-dex-asmifier.bat delete mode 100644 dex-tools/src/main/bin/d2j-dex-asmifier.sh delete mode 100644 dex-tools/src/main/bin/d2j-dex-dump.bat delete mode 100644 dex-tools/src/main/bin/d2j-dex-dump.sh delete mode 100644 dex-tools/src/main/bin/d2j-dex2jar.bat delete mode 100644 dex-tools/src/main/bin/d2j-dex2jar.sh delete mode 100644 dex-tools/src/main/bin/d2j-init-deobf.bat delete mode 100644 dex-tools/src/main/bin/d2j-init-deobf.sh delete mode 100644 dex-tools/src/main/bin/d2j-jar-access.bat delete mode 100644 dex-tools/src/main/bin/d2j-jar-access.sh delete mode 100644 dex-tools/src/main/bin/d2j-jar-remap.bat delete mode 100644 dex-tools/src/main/bin/d2j-jar-remap.sh delete mode 100644 dex-tools/src/main/bin/d2j-jar2dex.bat delete mode 100644 dex-tools/src/main/bin/d2j-jar2dex.sh delete mode 100644 dex-tools/src/main/bin/d2j-jar2jasmin.bat delete mode 100644 dex-tools/src/main/bin/d2j-jar2jasmin.sh delete mode 100644 dex-tools/src/main/bin/d2j-jasmin2jar.bat delete mode 100644 dex-tools/src/main/bin/d2j-jasmin2jar.sh delete mode 100644 dex-tools/src/main/bin/dex-dump.bat delete mode 100644 dex-tools/src/main/bin/dex-dump.sh delete mode 100644 dex-tools/src/main/bin/dex2jar.bat delete mode 100644 dex-tools/src/main/bin/dex2jar.sh rename dex-tools/src/main/{resources/com/googlecode/dex2jar => }/bin_gen/bat_template (100%) rename dex-tools/src/main/{resources/com/googlecode/dex2jar => }/bin_gen/class.cfg (100%) rename dex-tools/src/main/{bin => bin_gen}/setclasspath.bat (100%) rename dex-tools/src/main/{resources/com/googlecode/dex2jar => }/bin_gen/sh_template (100%) delete mode 100644 dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat diff --git a/dex-tools/pom.xml b/dex-tools/pom.xml index 6fd5b0d6c..07261673c 100644 --- a/dex-tools/pom.xml +++ b/dex-tools/pom.xml @@ -75,6 +75,27 @@ + + org.codehaus.mojo + exec-maven-plugin + 1.2.1 + + + prepare-package + + java + + + test + com.googlecode.dex2jar.bin_gen.BinGen + + src/main/bin_gen + target/bin + + + + + diff --git a/dex-tools/src/main/assemble/package.xml b/dex-tools/src/main/assemble/package.xml index abea54616..e2bb5f6e5 100644 --- a/dex-tools/src/main/assemble/package.xml +++ b/dex-tools/src/main/assemble/package.xml @@ -1,46 +1,54 @@ - distribution - - zip - + xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + distribution + + zip + - - - src/main/bin/ - - *.sh - - / - - - src/main/bin/ - - *.sh - - / - - - src/main/jars - /lib - - - - - src/main/resources/META-INF/LICENSE.txt - / - - - src/main/resources/META-INF/NOTICE.txt - / - - - - - /lib - runtime - - + + + target/bin/ + + *.sh + + 775 + / + + + target/bin/ + + *.bat + + 664 + / + + + src/main/jars + /lib + 664 + 775 + + + + + src/main/resources/META-INF/LICENSE.txt + 664 + / + + + src/main/resources/META-INF/NOTICE.txt + 664 + / + + + + + /lib + runtime + 664 + 775 + + \ No newline at end of file diff --git a/dex-tools/src/main/bin/d2j-apk-sign.bat b/dex-tools/src/main/bin/d2j-apk-sign.bat deleted file mode 100644 index 37c230fd2..000000000 --- a/dex-tools/src/main/bin/d2j-apk-sign.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.ApkSign" %* diff --git a/dex-tools/src/main/bin/d2j-apk-sign.sh b/dex-tools/src/main/bin/d2j-apk-sign.sh deleted file mode 100644 index ec0c21b90..000000000 --- a/dex-tools/src/main/bin/d2j-apk-sign.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.ApkSign" "$@" diff --git a/dex-tools/src/main/bin/d2j-asm-verify.bat b/dex-tools/src/main/bin/d2j-asm-verify.bat deleted file mode 100644 index 849d28892..000000000 --- a/dex-tools/src/main/bin/d2j-asm-verify.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.AsmVerify" %* diff --git a/dex-tools/src/main/bin/d2j-asm-verify.sh b/dex-tools/src/main/bin/d2j-asm-verify.sh deleted file mode 100644 index ae52a4675..000000000 --- a/dex-tools/src/main/bin/d2j-asm-verify.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.AsmVerify" "$@" diff --git a/dex-tools/src/main/bin/d2j-decrpyt-string.bat b/dex-tools/src/main/bin/d2j-decrpyt-string.bat deleted file mode 100644 index 019b95603..000000000 --- a/dex-tools/src/main/bin/d2j-decrpyt-string.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.DecryptStringCmd" %* diff --git a/dex-tools/src/main/bin/d2j-decrpyt-string.sh b/dex-tools/src/main/bin/d2j-decrpyt-string.sh deleted file mode 100644 index 1ec8561af..000000000 --- a/dex-tools/src/main/bin/d2j-decrpyt-string.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.DecryptStringCmd" "$@" diff --git a/dex-tools/src/main/bin/d2j-dex-asmifier.bat b/dex-tools/src/main/bin/d2j-dex-asmifier.bat deleted file mode 100644 index 97a82ee84..000000000 --- a/dex-tools/src/main/bin/d2j-dex-asmifier.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.util.ASMifierFileV" %* diff --git a/dex-tools/src/main/bin/d2j-dex-asmifier.sh b/dex-tools/src/main/bin/d2j-dex-asmifier.sh deleted file mode 100644 index 9a576e552..000000000 --- a/dex-tools/src/main/bin/d2j-dex-asmifier.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.util.ASMifierFileV" "$@" diff --git a/dex-tools/src/main/bin/d2j-dex-dump.bat b/dex-tools/src/main/bin/d2j-dex-dump.bat deleted file mode 100644 index 6d709dc64..000000000 --- a/dex-tools/src/main/bin/d2j-dex-dump.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.util.Dump" %* diff --git a/dex-tools/src/main/bin/d2j-dex-dump.sh b/dex-tools/src/main/bin/d2j-dex-dump.sh deleted file mode 100644 index 4deb8ac5e..000000000 --- a/dex-tools/src/main/bin/d2j-dex-dump.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.util.Dump" "$@" diff --git a/dex-tools/src/main/bin/d2j-dex2jar.bat b/dex-tools/src/main/bin/d2j-dex2jar.bat deleted file mode 100644 index 1ca8b62d9..000000000 --- a/dex-tools/src/main/bin/d2j-dex2jar.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.Dex2jarCmd" %* diff --git a/dex-tools/src/main/bin/d2j-dex2jar.sh b/dex-tools/src/main/bin/d2j-dex2jar.sh deleted file mode 100644 index 6cab1fa7a..000000000 --- a/dex-tools/src/main/bin/d2j-dex2jar.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Dex2jarCmd" "$@" diff --git a/dex-tools/src/main/bin/d2j-init-deobf.bat b/dex-tools/src/main/bin/d2j-init-deobf.bat deleted file mode 100644 index b4d06fc87..000000000 --- a/dex-tools/src/main/bin/d2j-init-deobf.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.DeObfInitCmd" %* diff --git a/dex-tools/src/main/bin/d2j-init-deobf.sh b/dex-tools/src/main/bin/d2j-init-deobf.sh deleted file mode 100644 index ad2f95b72..000000000 --- a/dex-tools/src/main/bin/d2j-init-deobf.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.DeObfInitCmd" "$@" diff --git a/dex-tools/src/main/bin/d2j-jar-access.bat b/dex-tools/src/main/bin/d2j-jar-access.bat deleted file mode 100644 index 1d612a0aa..000000000 --- a/dex-tools/src/main/bin/d2j-jar-access.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.JarAccessCmd" %* diff --git a/dex-tools/src/main/bin/d2j-jar-access.sh b/dex-tools/src/main/bin/d2j-jar-access.sh deleted file mode 100644 index e902b0c9d..000000000 --- a/dex-tools/src/main/bin/d2j-jar-access.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.JarAccessCmd" "$@" diff --git a/dex-tools/src/main/bin/d2j-jar-remap.bat b/dex-tools/src/main/bin/d2j-jar-remap.bat deleted file mode 100644 index 1ad717ce6..000000000 --- a/dex-tools/src/main/bin/d2j-jar-remap.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.JarRemap" %* diff --git a/dex-tools/src/main/bin/d2j-jar-remap.sh b/dex-tools/src/main/bin/d2j-jar-remap.sh deleted file mode 100644 index 1e6b0d731..000000000 --- a/dex-tools/src/main/bin/d2j-jar-remap.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.JarRemap" "$@" diff --git a/dex-tools/src/main/bin/d2j-jar2dex.bat b/dex-tools/src/main/bin/d2j-jar2dex.bat deleted file mode 100644 index a6540ae79..000000000 --- a/dex-tools/src/main/bin/d2j-jar2dex.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.Jar2Dex" %* diff --git a/dex-tools/src/main/bin/d2j-jar2dex.sh b/dex-tools/src/main/bin/d2j-jar2dex.sh deleted file mode 100644 index e96509f5a..000000000 --- a/dex-tools/src/main/bin/d2j-jar2dex.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Jar2Dex" "$@" diff --git a/dex-tools/src/main/bin/d2j-jar2jasmin.bat b/dex-tools/src/main/bin/d2j-jar2jasmin.bat deleted file mode 100644 index 16bdf91d5..000000000 --- a/dex-tools/src/main/bin/d2j-jar2jasmin.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.Jar2Jasmin" %* diff --git a/dex-tools/src/main/bin/d2j-jar2jasmin.sh b/dex-tools/src/main/bin/d2j-jar2jasmin.sh deleted file mode 100644 index 6c44ecc54..000000000 --- a/dex-tools/src/main/bin/d2j-jar2jasmin.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Jar2Jasmin" "$@" diff --git a/dex-tools/src/main/bin/d2j-jasmin2jar.bat b/dex-tools/src/main/bin/d2j-jasmin2jar.bat deleted file mode 100644 index 980c64559..000000000 --- a/dex-tools/src/main/bin/d2j-jasmin2jar.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.tools.Jasmin2Jar" %* diff --git a/dex-tools/src/main/bin/d2j-jasmin2jar.sh b/dex-tools/src/main/bin/d2j-jasmin2jar.sh deleted file mode 100644 index 7cb4b23d2..000000000 --- a/dex-tools/src/main/bin/d2j-jasmin2jar.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.tools.Jasmin2Jar" "$@" diff --git a/dex-tools/src/main/bin/dex-dump.bat b/dex-tools/src/main/bin/dex-dump.bat deleted file mode 100644 index 1abb8563d..000000000 --- a/dex-tools/src/main/bin/dex-dump.bat +++ /dev/null @@ -1,6 +0,0 @@ -@echo off -set CLASSPATH= - -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" %%i - -java -Xms512m -Xmx1024m -cp "%CLASSPATH%" com.googlecode.dex2jar.util.Dump %* diff --git a/dex-tools/src/main/bin/dex-dump.sh b/dex-tools/src/main/bin/dex-dump.sh deleted file mode 100644 index 648b640a2..000000000 --- a/dex-tools/src/main/bin/dex-dump.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.util.Dump" $1 $2 $3 $4 $5 $6 diff --git a/dex-tools/src/main/bin/dex2jar.bat b/dex-tools/src/main/bin/dex2jar.bat deleted file mode 100644 index 48218f5b7..000000000 --- a/dex-tools/src/main/bin/dex2jar.bat +++ /dev/null @@ -1,23 +0,0 @@ -@echo off - -REM -REM dex2jar - Tools to work with android .dex and java .class files -REM Copyright (c) 2009-2012 Panxiaobo -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "com.googlecode.dex2jar.v3.Main" %* diff --git a/dex-tools/src/main/bin/dex2jar.sh b/dex-tools/src/main/bin/dex2jar.sh deleted file mode 100644 index ac5aaadff..000000000 --- a/dex-tools/src/main/bin/dex2jar.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh - -# -# dex2jar - Tools to work with android .dex and java .class files -# Copyright (c) 2009-2012 Panxiaobo -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -# copy from $Tomcat/bin/startup.sh -# resolve links - $0 may be a softlink -PRG="$0" -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`/"$link" - fi -done -PRGDIR=`dirname "$PRG"` -# - -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "com.googlecode.dex2jar.v3.Main" "$@" diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/bat_template b/dex-tools/src/main/bin_gen/bat_template similarity index 100% rename from dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/bat_template rename to dex-tools/src/main/bin_gen/bat_template diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/class.cfg b/dex-tools/src/main/bin_gen/class.cfg similarity index 100% rename from dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/class.cfg rename to dex-tools/src/main/bin_gen/class.cfg diff --git a/dex-tools/src/main/bin/setclasspath.bat b/dex-tools/src/main/bin_gen/setclasspath.bat similarity index 100% rename from dex-tools/src/main/bin/setclasspath.bat rename to dex-tools/src/main/bin_gen/setclasspath.bat diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/sh_template b/dex-tools/src/main/bin_gen/sh_template similarity index 100% rename from dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/sh_template rename to dex-tools/src/main/bin_gen/sh_template diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java b/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java index 6cf153732..de532a6a5 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java @@ -1,6 +1,6 @@ /* * dex2jar - Tools to work with android .dex and java .class files - * Copyright (c) 2009-2012 Panxiaobo + * Copyright (c) 2009-2013 Panxiaobo * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,23 +29,25 @@ public class BinGen { * @throws IOException */ public static void main(String[] args) throws IOException { + if (args.length < 2) { + System.err.println("bin-gen cfg-dir out-dir"); + return; + } + File cfg = new File(args[0]); + File out = new File(args[1]); Properties p = new Properties(); - p.load(BinGen.class.getResourceAsStream("class.cfg")); + p.load(FileUtils.openInputStream(new File(cfg, "class.cfg"))); - String bat = FileUtils.readFileToString(new File( - "src/main/resources/com/googlecode/dex2jar/bin_gen/bat_template"), "UTF-8"); - String sh = FileUtils.readFileToString( - new File("src/main/resources/com/googlecode/dex2jar/bin_gen/sh_template"), "UTF-8"); + String bat = FileUtils.readFileToString(new File(cfg, "bat_template"), "UTF-8"); + String sh = FileUtils.readFileToString(new File(cfg, "sh_template"), "UTF-8"); - File binDir = new File("src/main/bin"); - String setclasspath = FileUtils.readFileToString(new File( - "src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat"), "UTF-8"); - FileUtils.writeStringToFile(new File(binDir, "setclasspath.bat"), setclasspath, "UTF-8"); + String setclasspath = FileUtils.readFileToString(new File(cfg, "setclasspath.bat"), "UTF-8"); + FileUtils.writeStringToFile(new File(out, "setclasspath.bat"), setclasspath, "UTF-8"); for (Object key : p.keySet()) { String name = key.toString(); - FileUtils.writeStringToFile(new File(binDir, key.toString() + ".sh"), + FileUtils.writeStringToFile(new File(out, key.toString() + ".sh"), sh.replaceAll("__@class_name@__", p.getProperty(name)), "UTF-8"); - FileUtils.writeStringToFile(new File(binDir, key.toString() + ".bat"), + FileUtils.writeStringToFile(new File(out, key.toString() + ".bat"), bat.replaceAll("__@class_name@__", p.getProperty(name)), "UTF-8"); } } diff --git a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat b/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat deleted file mode 100644 index 186b167e9..000000000 --- a/dex-tools/src/main/resources/com/googlecode/dex2jar/bin_gen/setclasspath.bat +++ /dev/null @@ -1 +0,0 @@ -SET CLASSPATH=%1;%CLASSPATH% From 5e539960face505565b9703dba2ff32360eba113 Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Fri, 7 Jun 2013 17:31:51 +0800 Subject: [PATCH 04/51] fix maven build error while generate .bat and .sh --HG-- branch : 0.0.9.x --- dex-tools/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dex-tools/pom.xml b/dex-tools/pom.xml index 07261673c..2474d1d49 100644 --- a/dex-tools/pom.xml +++ b/dex-tools/pom.xml @@ -89,8 +89,8 @@ test com.googlecode.dex2jar.bin_gen.BinGen - src/main/bin_gen - target/bin + ${project.basedir}/src/main/bin_gen + ${project.basedir}/target/bin From c3795eb9f87e746364383f5e66a36f46da432d6a Mon Sep 17 00:00:00 2001 From: Panxiaobo Date: Mon, 17 Jun 2013 13:49:39 +0800 Subject: [PATCH 05/51] ignore method annotation value and null annotation value --HG-- branch : 0.0.9.x --- .../java/com/googlecode/dex2jar/v3/AnnotationNode.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java index 9810575bb..cd6933708 100644 --- a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java +++ b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java @@ -77,11 +77,16 @@ public static void accept(String name, Object v, AnnotationVisitor av) { // av1.visit("name", method.getName()); // av1.visit("desc", method.getType().getDesc()); // av1.visitEnd(); - av.visit(name, v); + // av.visit(name, v); + System.err.println("WARN: ignored method annotation value"); } else if (v instanceof DexType) { av.visit(name, ((DexType) v).desc); } else { - av.visit(name, v); + if (v == null) { + System.err.println("WARN: ignored null annotation value"); + } else { + av.visit(name, v); + } } } From a6ac417b8ae852b5a41f55fe7efd22f48b8bc67b Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Sat, 29 Jun 2013 16:58:26 +0800 Subject: [PATCH 06/51] clean up help message --HG-- branch : 0.0.9.x --- .../com/googlecode/dex2jar/tools/BaseCmd.java | 22 ++++++++++++++++--- .../dex2jar/tools/DecryptStringCmd.java | 16 +++++--------- .../googlecode/dex2jar/tools/Dex2jarCmd.java | 20 ++++++++--------- 3 files changed, 34 insertions(+), 24 deletions(-) diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java index 05dd16c22..f30b0893c 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java @@ -34,6 +34,15 @@ public abstract class BaseCmd { @SuppressWarnings("serial") protected static class HelpException extends RuntimeException { + + public HelpException() { + super(); + } + + public HelpException(String message) { + super(message); + } + } @Retention(value = RetentionPolicy.RUNTIME) @@ -89,6 +98,7 @@ public String getOptAndLongOpt() { String syntax() default ""; } + private String cmdLineSyntax; private String cmdName; @@ -173,6 +183,10 @@ public void doMain(String... args) { parseSetArgs(args); doCommandLine(); } catch (HelpException e) { + String msg = e.getMessage(); + if (msg != null && msg.length() > 0) { + System.err.println("ERROR: " + msg); + } usage(); } catch (Exception e) { e.printStackTrace(System.err); @@ -358,12 +372,14 @@ protected void usage() { nextStart = desc.length(); sb.setLength(0); } else { - sb.append(desc.substring(nextStart, pblength)); + sb.append(desc.substring(nextStart, nextStart + pblength)); out.println(sb); nextStart += pblength; sb.setLength(0); - for (int i = 0; i < palength; i++) { - sb.append(' '); + if (nextStart < desc.length()) { + for (int i = 0; i < palength; i++) { + sb.append(' '); + } } } } diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java index 7f1d41cda..99c84c4f3 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java @@ -59,9 +59,9 @@ public static void main(String[] args) { @Opt(opt = "o", longOpt = "output", description = "output of .jar files, default is $current_dir/[jar-name]-decrypted.jar", argName = "out") private File output; - @Opt(opt = "mo", longOpt = "decrypt-method-owner", description = "the owner of the mothed which can decrypt the stings, example: java.lang.String", argName = "owner") + @Opt(opt = "mo", required = true, longOpt = "decrypt-method-owner", description = "the owner of the method which can decrypt the stings, example: java.lang.String", argName = "owner") private String methodOwner; - @Opt(opt = "mn", longOpt = "decrypt-method-name", description = "the owner of the mothed which can decrypt the stings, the method's signature must be static (type)Ljava/lang/String;", argName = "name") + @Opt(opt = "mn", required = true, longOpt = "decrypt-method-name", description = "the owner of the method which can decrypt the stings, the method's signature must be static (type)Ljava/lang/String;. Please use -t,--arg-type to set the argument type.", argName = "name") private String methodName; @Opt(opt = "cp", longOpt = "classpath", description = "add extra lib to classpath", argName = "cp") private String classpath; @@ -70,9 +70,10 @@ public static void main(String[] args) { @Override protected void doCommandLine() throws Exception { - if (remainingArgs.length != 1) { - usage(); - return; + if (remainingArgs.length == 0) { + throw new HelpException("One file is required"); + } else if (remainingArgs.length > 1) { + throw new HelpException("Only one file is required, But we found " + remainingArgs.length); } File jar = new File(remainingArgs[0]); @@ -80,11 +81,6 @@ protected void doCommandLine() throws Exception { System.err.println(jar + " is not exists"); return; } - if (methodName == null || methodOwner == null) { - System.err.println("Please set --decrypt-method-owner and --decrypt-method-name"); - return; - } - if (output == null) { if (jar.isDirectory()) { output = new File(jar.getName() + "-decrypted.jar"); diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java index 89e481f10..8717d9aad 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java @@ -56,7 +56,7 @@ public static void main(String[] args) { @Opt(opt = "d", longOpt = "debug-info", hasArg = false, description = "translate debug info") private boolean debugInfo = false; - @Opt(opt = "p", longOpt = "print-ir", hasArg = false, description = "print ir to Syste.out") + @Opt(opt = "p", longOpt = "print-ir", hasArg = false, description = "print ir to System.out") private boolean printIR = false; @Opt(opt = "os", longOpt = "optmize-synchronized", hasArg = false, description = "optmize-synchronized") @@ -69,30 +69,28 @@ public Dex2jarCmd() { @Override protected void doCommandLine() throws Exception { if (remainingArgs.length == 0) { - usage(); - return; + throw new HelpException("At least one fileN is required"); } if ((exceptionFile != null || output != null) && remainingArgs.length != 1) { - System.err.println("-e/-o can only used with one file"); - return; + throw new HelpException("-e/-o can only used with one file"); } if (debugInfo && reuseReg) { - System.err.println("-d/-r can not use together"); - return; + throw new HelpException("-d/-r can not use together"); } if (output != null) { if (output.exists() && !forceOverwrite) { - System.err.println(output + " exists, use --force to overwrite"); - return; + throw new HelpException(output + " exists, use --force to overwrite"); } } else { for (String fileName : remainingArgs) { + if (!new File(fileName).exists()) { + throw new HelpException(fileName + " not exists"); + } File file = new File(FilenameUtils.getBaseName(fileName) + "-dex2jar.jar"); if (file.exists() && !forceOverwrite) { - System.err.println(file + " exists, use --force to overwrite"); - return; + throw new HelpException(file + " exists, use --force to overwrite"); } } } From 6ad1e44d599f3e450ada9815acc34f6c9572335f Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Fri, 5 Jul 2013 18:56:59 +0800 Subject: [PATCH 07/51] fix issue in ExceptionHandlerCurrectTransformer, add ExceptionRef if possible --HG-- branch : 0.0.9.x --- .../com/googlecode/dex2jar/ir/ts/Cfg.java | 36 ++--- .../ExceptionHandlerCurrectTransformer.java | 133 ++++++++++++++---- 2 files changed, 124 insertions(+), 45 deletions(-) diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Cfg.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Cfg.java index 8fc90666f..5e4912acf 100644 --- a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Cfg.java +++ b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Cfg.java @@ -180,6 +180,10 @@ public static void createCfgForLiveAnalyze(IrMethod jm) { } public static void createCFG(IrMethod jm) { + createCFG(jm, true); + } + + public static void createCFG(IrMethod jm, boolean linkTrap) { for (Stmt st : jm.stmts) { st._ls_forward_frame = null; @@ -194,26 +198,26 @@ public static void createCFG(IrMethod jm) { st._cfg_tos.clear(); } } - - for (Trap t : jm.traps) { - for (Stmt s = t.start.getNext(); s != t.end; s = s.getNext()) { - if (!notThrow(s)) { - // 为什么连接其上一个节点? - // 对一条会抛出异常的语句来说,如果执行失败,handler的frame应该和其父节点相同 - // 比方说 - // 0 - // 1 b=(Boolean)b - // 2 c=@Ex - // 3 c=(string)b - // 0 - 2 > 2 - // 如果1语句出错,则或使用0的frame到2去执行 - for (LabelStmt handler : t.handlers) { - link(s.getPre(), handler); + if (linkTrap) { + for (Trap t : jm.traps) { + for (Stmt s = t.start.getNext(); s != t.end; s = s.getNext()) { + if (!notThrow(s)) { + // 为什么连接其上一个节点? + // 对一条会抛出异常的语句来说,如果执行失败,handler的frame应该和其父节点相同 + // 比方说 + // 0 + // 1 b=(Boolean)b + // 2 c=@Ex + // 3 c=(string)b + // 0 - 2 > 2 + // 如果1语句出错,则或使用0的frame到2去执行 + for (LabelStmt handler : t.handlers) { + link(s.getPre(), handler); + } } } } } - for (Stmt st : jm.stmts) { switch (st.st) { case GOTO: diff --git a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ExceptionHandlerCurrectTransformer.java b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ExceptionHandlerCurrectTransformer.java index 4d56bf5eb..6dc00ad84 100644 --- a/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ExceptionHandlerCurrectTransformer.java +++ b/dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ExceptionHandlerCurrectTransformer.java @@ -15,6 +15,10 @@ */ package com.googlecode.dex2jar.ir.ts; +import java.util.HashSet; +import java.util.Set; +import java.util.TreeSet; + import org.objectweb.asm.Type; import com.googlecode.dex2jar.ir.IrMethod; @@ -23,6 +27,7 @@ import com.googlecode.dex2jar.ir.Value.VT; import com.googlecode.dex2jar.ir.expr.Exprs; import com.googlecode.dex2jar.ir.stmt.AssignStmt; +import com.googlecode.dex2jar.ir.stmt.BaseSwitchStmt; import com.googlecode.dex2jar.ir.stmt.JumpStmt; import com.googlecode.dex2jar.ir.stmt.LabelStmt; import com.googlecode.dex2jar.ir.stmt.Stmt; @@ -60,50 +65,120 @@ public class ExceptionHandlerCurrectTransformer implements Transformer { @Override public void transform(IrMethod irMethod) { - Local ex = null; + + Set hanlders = new HashSet(); for (Trap t : irMethod.traps) { for (int i = 0; i < t.handlers.length; i++) { - LabelStmt handler = t.handlers[i]; - Type type = t.types[i]; - Stmt st = handler.getNext(); - Stmt pre = handler.getPre(); - while (st.st == ST.LABEL) { - st = st.getNext(); - } - while (pre.st == ST.LABEL) { - pre = pre.getPre(); + hanlders.add(t.handlers[i]); + } + } + Local ex = null; + for (LabelStmt handler : hanlders) { + Stmt st = handler.getNext(); + while (st.st == ST.LABEL && !hanlders.contains(st)) { + st = st.getNext(); + } + if (needInsertMoveExceptionRef(st)) { + if (ex == null) { + ex = Exprs.nLocal("unRefEx"); + irMethod.locals.add(ex); } - if (needInsertMoveExceptionRef(st) && needInsertGoto(pre)) { + Stmt stmt = Stmts.nIdentity(ex, Exprs.nExceptionRef(Type.getType(Throwable.class))); + + irMethod.stmts.insertBefore(st, stmt); + } + } + Cfg.createCFG(irMethod, false); - LabelStmt lbl = Stmts.nLabel(); - JumpStmt g = Stmts.nGoto(lbl); - irMethod.stmts.insertAfter(pre, g); + for (LabelStmt handler : hanlders) { + Stmt st = handler.getNext(); + while (st.st == ST.LABEL) { + st = st.getNext(); + } + if (handler._cfg_froms.size() > 0) { + LabelStmt lbl = Stmts.nLabel(); + lbl._cfg_froms = new TreeSet(irMethod.stmts); + lbl._cfg_tos = new TreeSet(irMethod.stmts); + if (isExHandler(st)) { + Stmt after = st.getNext(); + irMethod.stmts.insertAfter(st, lbl); + cfgInsert(st, after, lbl); + } else { + Stmt pre = st.getPre(); irMethod.stmts.insertBefore(st, lbl); - if (ex == null) { - ex = Exprs.nLocal("unRefEx"); + cfgInsert(pre, st, lbl); + } + for (Stmt stmt : new HashSet(handler._cfg_froms)) { + + switch (stmt.st) { + case GOTO: { + JumpStmt jumpStmt = (JumpStmt) stmt; + jumpStmt.target = lbl; + cfgReplace(stmt, handler, lbl); + } + break; + case LOOKUP_SWITCH: + case TABLE_SWITCH: + BaseSwitchStmt bss = (BaseSwitchStmt) stmt; + if (bss.defaultTarget.equals(handler)) { + bss.defaultTarget = lbl; + } + LabelStmt[] targets = bss.targets; + for (int i = 0; i < targets.length; i++) { + if (targets[i].equals(handler)) { + targets[i] = lbl; + } + } + cfgReplace(stmt, handler, lbl); + break; + case IF: { + JumpStmt jumpStmt = (JumpStmt) stmt; + if (jumpStmt.target.equals(handler)) { + jumpStmt.target = lbl; + cfgReplace(stmt, handler, lbl); + } + } + // go thought + default: + Stmt next = stmt.getNext(); + if (handler.equals(next)) { + Stmt g = Stmts.nGoto(lbl); + g._cfg_froms = new TreeSet(irMethod.stmts); + g._cfg_tos = new TreeSet(irMethod.stmts); + g._cfg_tos.add(lbl); + irMethod.stmts.insertAfter(stmt, g); + cfgReplace(stmt, handler, g); + } } - irMethod.stmts.insertBefore(lbl, Stmts.nAssign(ex, Exprs.nExceptionRef(type))); } } } - if (ex != null) { - irMethod.locals.add(ex); - } } - private boolean needInsertGoto(Stmt pre) { - switch (pre.st) { - case RETURN: - case GOTO: - case RETURN_VOID: - case THROW: - return false; + void cfgInsert(Stmt pre, Stmt next, Stmt p) { + if (pre._cfg_tos.contains(next)) { + pre._cfg_tos.remove(next); + pre._cfg_tos.add(p); + next._cfg_froms.remove(pre); + next._cfg_froms.add(p); + p._cfg_froms.add(pre); + p._cfg_tos.add(next); } - return true; + } + + void cfgReplace(Stmt pre, Stmt next, Stmt p) { + pre._cfg_tos.remove(next); + pre._cfg_tos.add(p); + next._cfg_froms.remove(pre); + p._cfg_froms.add(pre); + } + + private boolean isExHandler(Stmt st) { + return (st.st == ST.ASSIGN || st.st == ST.IDENTITY) && ((AssignStmt) st).op2.value.vt == VT.EXCEPTION_REF; } private boolean needInsertMoveExceptionRef(Stmt st) { - return st.st != ST.ASSIGN || ((AssignStmt) st).op2.value.vt != VT.EXCEPTION_REF; + return !isExHandler(st); } } From 2a6eca13ff2432815a2c3b7c386f76fc24925f80 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Sat, 6 Jul 2013 00:13:05 +0800 Subject: [PATCH 08/51] decrypt multi method at once --HG-- branch : 0.0.9.x --- .../dex2jar/tools/DecryptStringCmd.java | 306 ++++++++++++++---- 1 file changed, 249 insertions(+), 57 deletions(-) diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java index 99c84c4f3..bcf96f3b1 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java @@ -23,8 +23,11 @@ import java.net.URLClassLoader; import java.util.ArrayList; import java.util.Arrays; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import org.apache.commons.io.FileUtils; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import org.objectweb.asm.ClassReader; @@ -58,15 +61,99 @@ public static void main(String[] args) { private boolean forceOverwrite = false; @Opt(opt = "o", longOpt = "output", description = "output of .jar files, default is $current_dir/[jar-name]-decrypted.jar", argName = "out") private File output; - - @Opt(opt = "mo", required = true, longOpt = "decrypt-method-owner", description = "the owner of the method which can decrypt the stings, example: java.lang.String", argName = "owner") + @Opt(opt = "m", longOpt = "methods", description = "a file contain a list of methods, each line like: La/b;->decrypt(III)Ljava/lang/String;", argName = "cfg") + private File method; + @Opt(opt = "mo", longOpt = "decrypt-method-owner", description = "the owner of the method which can decrypt the stings, example: java.lang.String", argName = "owner") private String methodOwner; - @Opt(opt = "mn", required = true, longOpt = "decrypt-method-name", description = "the owner of the method which can decrypt the stings, the method's signature must be static (type)Ljava/lang/String;. Please use -t,--arg-type to set the argument type.", argName = "name") + @Opt(opt = "mn", longOpt = "decrypt-method-name", description = "the owner of the method which can decrypt the stings, the method's signature must be static (parameter-type)Ljava/lang/String;. Please use -pt,--parameter-type to set the argument descrypt.", argName = "name") private String methodName; @Opt(opt = "cp", longOpt = "classpath", description = "add extra lib to classpath", argName = "cp") private String classpath; - @Opt(opt = "t", longOpt = "arg-type", description = "the type of the method's argument, int,string. default is string", argName = "type") - private String type = "string"; + @Opt(opt = "t", longOpt = "arg-type", description = "ignored") + private String type = null; + + @Opt(opt = "pt", longOpt = "parameter-type", description = "the descript for the method which can decrypt the stings, example1: Ljava/lang/String; example2:III, default is Ljava/lang/String;", argName = "type") + private String parameterType = "Ljava/lang/String;"; + @Opt(opt = "d", longOpt = "delete", hasArg = false, description = "delete the method which can decrypt the stings") + private boolean deleteMethod = false; + + static class MethodConfig { + Method jmethod; + /** + * in java/lang/String format + */ + String owner; + String name; + String desc; + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((desc == null) ? 0 : desc.hashCode()); + result = prime * result + ((name == null) ? 0 : name.hashCode()); + result = prime * result + ((owner == null) ? 0 : owner.hashCode()); + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + if (getClass() != obj.getClass()) + return false; + MethodConfig other = (MethodConfig) obj; + if (desc == null) { + if (other.desc != null) + return false; + } else if (!desc.equals(other.desc)) + return false; + if (name == null) { + if (other.name != null) + return false; + } else if (!name.equals(other.name)) + return false; + if (owner == null) { + if (other.owner != null) + return false; + } else if (!owner.equals(other.owner)) + return false; + return true; + } + } + + MethodConfig build(String line) { + int idx = line.indexOf("->"); + if (idx < 0) { + throw new RuntimeException("Can't read line:" + line); + } + String owner = line.substring(0, idx); + + if (owner.startsWith("L") && owner.endsWith(";")) { + owner = owner.substring(1, owner.length() - 1); + } + + int idx2 = line.indexOf('(', idx); + if (idx2 < 0) { + throw new RuntimeException("Can't read line:" + line); + } + + String name = line.substring(idx + 2, idx2); + + String desc = line.substring(idx2); + if (desc.endsWith(")")) { + desc = desc + "Ljava/lang/String;"; + } + + MethodConfig config = new MethodConfig(); + config.owner = owner; + config.desc = desc; + config.name = name; + return config; + + } @Override protected void doCommandLine() throws Exception { @@ -96,29 +183,55 @@ protected void doCommandLine() throws Exception { System.err.println(jar + " -> " + output); - List list = new ArrayList(); - if (classpath != null) { - list.addAll(Arrays.asList(classpath.split(";|:"))); - } - list.add(jar.getAbsolutePath()); - URL[] urls = new URL[list.size()]; - for (int i = 0; i < list.size(); i++) { - urls[i] = new File(list.get(i)).toURI().toURL(); + List methodConfigs = new ArrayList(); + if (this.method != null) { + for (String line : FileUtils.readLines(this.method, "UTF-8")) { + if (line.length() == 0 || line.startsWith("#")) { + continue; + } + methodConfigs.add(this.build(line)); + } + } else { + if (methodOwner == null || methodName == null) { + System.err.println("-mo/--decrypt-method-owner or -mn/decrypt-method-name is null"); + return; + } + methodConfigs.add(this.build("L" + methodOwner.replace('.', '/') + ";->" + methodName + "(" + + this.parameterType + ")Ljava/lang/String;")); } - final Method jmethod; - final String targetMethodDesc; - try { - Class argType = "string".equals(type) ? String.class : int.class; + + final Map map = new HashMap(); + { + List list = new ArrayList(); + if (classpath != null) { + list.addAll(Arrays.asList(classpath.split(";|:"))); + } + list.add(jar.getAbsolutePath()); + URL[] urls = new URL[list.size()]; + for (int i = 0; i < list.size(); i++) { + urls[i] = new File(list.get(i)).toURI().toURL(); + } + URLClassLoader cl = new URLClassLoader(urls); - jmethod = cl.loadClass(methodOwner).getDeclaredMethod(methodName, argType); - jmethod.setAccessible(true); - targetMethodDesc = Type.getMethodDescriptor(jmethod); - } catch (Exception ex) { - System.err.println("can't load method: String " + methodOwner + "." + methodName + "(" + type + ")"); - ex.printStackTrace(); - return; + for (MethodConfig config : methodConfigs) { + try { + Class clz = cl.loadClass(config.owner.replace('/', '.')); + if (clz == null) { + System.err.println("clz is null:" + config.owner); + } + Method jmethod = clz.getDeclaredMethod(config.name, + this.toJavaType(Type.getArgumentTypes(config.desc))); + jmethod.setAccessible(true); + config.jmethod = jmethod; + map.put(config, config); + } catch (Exception ex) { + System.err.println("can't load method: L" + config.owner + ";->" + config.name + config.desc); + ex.printStackTrace(); + return; + } + } } - final String methodOwnerInternalType = this.methodOwner.replace('.', '/'); + final OutHandler fo = FileOut.create(output, true); try { new FileWalker().withStreamHandler(new StreamHandler() { @@ -130,46 +243,56 @@ public void handle(boolean isDir, String name, StreamOpener current, Object name fo.write(isDir, name, current == null ? null : current.get(), nameObject); return; } - + MethodConfig key = new MethodConfig(); ClassReader cr = new ClassReader(current.get()); ClassNode cn = new ClassNode(); cr.accept(cn, ClassReader.EXPAND_FRAMES); - for (Object m0 : cn.methods) { + for (Object m0 : new ArrayList(cn.methods)) { MethodNode m = (MethodNode) m0; if (m.instructions == null) { continue; } + key.owner = cn.name; + key.name = m.name; + key.desc = m.desc; + if (map.containsKey(key)) { + if (deleteMethod) { + cn.methods.remove(m); + } + continue; + } AbstractInsnNode p = m.instructions.getFirst(); while (p != null) { if (p.getOpcode() == Opcodes.INVOKESTATIC) { MethodInsnNode mn = (MethodInsnNode) p; - if (mn.name.equals(methodName) && mn.desc.equals(targetMethodDesc) - && mn.owner.equals(methodOwnerInternalType)) { - AbstractInsnNode q = p.getPrevious(); - AbstractInsnNode next = p.getNext(); - if (q.getOpcode() == Opcodes.LDC) { - LdcInsnNode ldc = (LdcInsnNode) q; - tryReplace(m.instructions, p, q, jmethod, ldc.cst); - } else if (q.getType() == AbstractInsnNode.INT_INSN) { - IntInsnNode in = (IntInsnNode) q; - tryReplace(m.instructions, p, q, jmethod, in.operand); - } else { - switch (q.getOpcode()) { - case Opcodes.ICONST_M1: - case Opcodes.ICONST_0: - case Opcodes.ICONST_1: - case Opcodes.ICONST_2: - case Opcodes.ICONST_3: - case Opcodes.ICONST_4: - case Opcodes.ICONST_5: - int x = ((InsnNode) q).getOpcode() - Opcodes.ICONST_0; - tryReplace(m.instructions, p, q, jmethod, x); - break; + key.owner = mn.owner; + key.name = mn.name; + key.desc = mn.desc; + MethodConfig config = map.get(key); + if (config != null) { + Method jmethod = config.jmethod; + try { + AbstractInsnNode q = p; + int pSize = jmethod.getParameterTypes().length; + Object[] as = new Object[pSize]; + for (int i = pSize - 1; i >= 0; i--) { + q = q.getPrevious(); + Object object = readCst(q); + as[i] = convert(object, jmethod.getParameterTypes()[i]); + } + String newValue = (String) jmethod.invoke(null, as); + LdcInsnNode nLdc = new LdcInsnNode(newValue); + m.instructions.insert(p, nLdc); + q = p; + for (int i = 0; i <= pSize; i++) { + AbstractInsnNode z = q.getPrevious(); + m.instructions.remove(q); + q = z; } + p = nLdc; + } catch (Exception ex) { } - p = next; - continue; } } p = p.getNext(); @@ -180,21 +303,90 @@ public void handle(boolean isDir, String name, StreamOpener current, Object name cn.accept(cw); fo.write(false, cr.getClassName() + ".class", cw.toByteArray(), null); } + + private Object convert(Object object, Class type) { + if (int.class.equals(type)) { + return ((Number) object).intValue(); + } + if (byte.class.equals(type)) { + return ((Number) object).byteValue(); + } + if (short.class.equals(type)) { + return ((Number) object).shortValue(); + } + if (char.class.equals(type)) { + return (char) ((Number) object).intValue(); + } + return object; + } }).walk(jar); } finally { IOUtils.closeQuietly(fo); } } + Object readCst(AbstractInsnNode q) { + if (q.getOpcode() == Opcodes.LDC) { + LdcInsnNode ldc = (LdcInsnNode) q; + return ldc.cst; + } else if (q.getType() == AbstractInsnNode.INT_INSN) { + IntInsnNode in = (IntInsnNode) q; + return in.operand; + } else { + switch (q.getOpcode()) { + case Opcodes.ICONST_M1: + case Opcodes.ICONST_0: + case Opcodes.ICONST_1: + case Opcodes.ICONST_2: + case Opcodes.ICONST_3: + case Opcodes.ICONST_4: + case Opcodes.ICONST_5: + int x = ((InsnNode) q).getOpcode() - Opcodes.ICONST_0; + return x; + } + } + throw new RuntimeException(); + } + + private Class[] toJavaType(Type[] pt) throws ClassNotFoundException { + Class jt[] = new Class[pt.length]; + for (int i = 0; i < pt.length; i++) { + jt[i] = toJavaType(pt[i]); + } + return jt; + } + + private Class toJavaType(Type t) throws ClassNotFoundException { + switch (t.getSort()) { + case Type.BOOLEAN: + return boolean.class; + case Type.BYTE: + return byte.class; + case Type.SHORT: + return short.class; + case Type.CHAR: + return char.class; + case Type.INT: + return int.class; + case Type.FLOAT: + return float.class; + case Type.LONG: + return long.class; + case Type.DOUBLE: + return double.class; + case Type.OBJECT: + case Type.ARRAY: + return Class.forName(t.getClassName()); + case Type.VOID: + return void.class; + } + throw new RuntimeException(); + } + public static AbstractInsnNode tryReplace(InsnList instructions, AbstractInsnNode p, AbstractInsnNode q, Method jmethod, Object arg) { try { - String newValue = (String) jmethod.invoke(null, arg); - LdcInsnNode nLdc = new LdcInsnNode(newValue); - instructions.insertBefore(p, nLdc); - instructions.remove(p); - instructions.remove(q); - return nLdc.getNext(); + } catch (Exception e) { // ignore } From 7a0fd419a2b453e7f97bc3dd1f6037af813f8682 Mon Sep 17 00:00:00 2001 From: "bob@bob-pc" Date: Wed, 31 Jul 2013 06:33:03 +0800 Subject: [PATCH 09/51] add support to skip translate code --HG-- branch : 0.0.9.x --- .../java/com/googlecode/dex2jar/tools/Dex2jarCmd.java | 5 ++++- .../src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java index 8717d9aad..30b6c0713 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarCmd.java @@ -45,6 +45,8 @@ public static void main(String[] args) { @Opt(opt = "r", longOpt = "reuse-reg", hasArg = false, description = "reuse regiter while generate java .class file") private boolean reuseReg = false; + @Opt(opt = "nc", longOpt = "no-code", hasArg = false, description = "skip code") + private boolean noCode = false; @Opt(opt = "s", hasArg = false, description = "same with --topological-sort/-ts") private boolean topologicalSort1 = false; @@ -105,7 +107,8 @@ protected void doCommandLine() throws Exception { Dex2jar.from(reader).withExceptionHandler(handler).reUseReg(reuseReg) .topoLogicalSort(topologicalSort || topologicalSort1).skipDebug(!debugInfo) - .optimizeSynchronized(this.optmizeSynchronized).printIR(printIR).verbose(verbose).to(file); + .optimizeSynchronized(this.optmizeSynchronized).printIR(printIR).verbose(verbose).noCode(noCode) + .to(file); if (!notHandleException) { Map exceptions = handler.getExceptions(); diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java index e9c2b2a51..959790c06 100644 --- a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java +++ b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java @@ -155,6 +155,15 @@ public Dex2jar verbose(boolean b) { return this; } + public Dex2jar noCode(boolean b) { + if (b) { + this.readerConfig |= DexFileReader.SKIP_CODE; + } else { + this.v3Config &= ~DexFileReader.SKIP_CODE; + } + return this; + } + public Dex2jar optimizeSynchronized(boolean b) { if (b) { this.v3Config |= V3.OPTIMIZE_SYNCHRONIZED; From f2336482d1f02bdbbd8de4d47160a4e5d3696b0b Mon Sep 17 00:00:00 2001 From: "bob@bob-pc" Date: Fri, 2 Aug 2013 15:44:07 +0800 Subject: [PATCH 10/51] add option IGNORE_READ_EXCEPTION --HG-- branch : 0.0.9.x --- .../dex2jar/reader/DexFileReader.java | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java index 2c8a2e791..d26ec1a52 100644 --- a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java +++ b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java @@ -98,7 +98,10 @@ public class DexFileReader { * skip field constant in dex file. */ public static final int SKIP_FIELD_CONSTANT = 1 << 4; - + /** + * ingore read exception + */ + public static final int IGNORE_READ_EXCEPTION = 1 << 5; private final boolean odex; private DataIn odex_in; private int odex_depsOffset; @@ -322,13 +325,38 @@ public void accept(DexFileVisitor dv, int config) { { acceptClass(dv, dcv, className, config); } + } catch (Exception ex) { + DexException dexException = new DexException(ex, "Error process class: [%d]%s", cid, className); + if (0 != (config & IGNORE_READ_EXCEPTION)) { + niceExceptionMessage(dexException, 0); + } else { + throw dexException; + } } finally { in.pop(); } } dv.visitEnd(); } - + static void niceExceptionMessage(Throwable t, int deep) { + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < deep + 1; i++) { + sb.append("."); + } + sb.append(' '); + if (t instanceof DexException) { + sb.append(t.getMessage()); + System.err.println(sb.toString()); + if (t.getCause() != null) { + niceExceptionMessage(t.getCause(), deep + 1); + } + } else { + if (t != null) { + System.err.println(sb.append("ROOT cause:").toString()); + t.printStackTrace(System.err); + } + } + } private void acceptClass(DexFileVisitor dv, DexClassVisitor dcv, String className, int config) { DataIn in = this.in; int source_file_idx = in.readUIntx(); From e2bf13f9be655aaed858a8168e24010cac3d5820 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Thu, 15 Aug 2013 15:32:24 +0800 Subject: [PATCH 11/51] hide process mesage --HG-- branch : 0.0.9.x --- .../com/googlecode/dex2jar/tools/JarAccessCmd.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarAccessCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarAccessCmd.java index 8ab7bf8f0..84a2bf09d 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarAccessCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/JarAccessCmd.java @@ -47,6 +47,10 @@ public JarAccessCmd() { @Opt(opt = "f", longOpt = "force", hasArg = false, description = "force overwrite") private boolean forceOverwrite = false; + + @Opt(opt = "v", longOpt = "verbose", hasArg = false, description = "verbose") + private boolean verbose = false; + @Opt(opt = "o", longOpt = "output", description = "output dir of .j files, default is $current_dir/[jar-name]-access.jar", argName = "out-dir") private File output; @@ -160,6 +164,8 @@ protected void doCommandLine() throws Exception { return; } + System.err.println("jar-access " + jar + " -> " + output); + final int rf = ~str2acc(removeFieldAccess); final int rm = ~str2acc(removeMethodAccess); final int rc = ~str2acc(removeClassAccess); @@ -192,7 +198,7 @@ public void handle(boolean isDir, String name, StreamOpener current, Object name public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { int na = (access & rc) | ac; - if (access != na) { + if (verbose && access != na) { System.out.println("c " + name); } super.visit(version, na, name, signature, superName, interfaces); @@ -202,7 +208,7 @@ public void visit(int version, int access, String name, String signature, String public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) { int na = (access & rf) | af; - if (na != access) { + if (verbose && na != access) { System.out.println("f " + r.getClassName() + "." + name); } return super.visitField(na, name, desc, signature, value); @@ -212,7 +218,7 @@ public FieldVisitor visitField(int access, String name, String desc, String sign public MethodVisitor visitMethod(int access, String name, String desc, String signature, String[] exceptions) { int na = (access & rm) | am; - if (na != access) { + if (verbose && na != access) { System.out.println("m " + r.getClassName() + "." + name + desc); } return super.visitMethod(na, name, desc, signature, exceptions); From 04ab6344e1510c203c6ff0e1ea3fe93b96e2ab2a Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Sun, 22 Sep 2013 19:19:16 +0800 Subject: [PATCH 12/51] use a better invocation scripts for windows from lanchon Update issue 192 Status: Fixed merge to 0.0.9.x --HG-- branch : 0.0.9.x --- dex-tools/src/main/bin_gen/bat_template | 6 +-- dex-tools/src/main/bin_gen/class.cfg | 1 + dex-tools/src/main/bin_gen/d2j_invoke.bat | 14 +++++++ dex-tools/src/main/bin_gen/d2j_invoke.sh | 40 +++++++++++++++++++ dex-tools/src/main/bin_gen/setclasspath.bat | 1 - dex-tools/src/main/bin_gen/sh_template | 8 +--- .../googlecode/dex2jar/bin_gen/BinGen.java | 7 +++- 7 files changed, 64 insertions(+), 13 deletions(-) create mode 100644 dex-tools/src/main/bin_gen/d2j_invoke.bat create mode 100644 dex-tools/src/main/bin_gen/d2j_invoke.sh delete mode 100644 dex-tools/src/main/bin_gen/setclasspath.bat diff --git a/dex-tools/src/main/bin_gen/bat_template b/dex-tools/src/main/bin_gen/bat_template index 6d8b5bd17..6aea7ebf1 100644 --- a/dex-tools/src/main/bin_gen/bat_template +++ b/dex-tools/src/main/bin_gen/bat_template @@ -17,7 +17,5 @@ REM See the License for the specific language governing permissions and REM limitations under the License. REM -set CLASSPATH= -FOR %%i IN ("%~dp0lib\*.jar") DO CALL "%~dp0setclasspath.bat" "%%i" - -java -Xms512m -Xmx1024m -cp %CLASSPATH% "__@class_name@__" %* +REM call d2j_invoke.bat to setup java environment +@"%~dp0d2j_invoke.bat" __@class_name@__ %* diff --git a/dex-tools/src/main/bin_gen/class.cfg b/dex-tools/src/main/bin_gen/class.cfg index bcd798c01..36564e780 100644 --- a/dex-tools/src/main/bin_gen/class.cfg +++ b/dex-tools/src/main/bin_gen/class.cfg @@ -19,4 +19,5 @@ d2j-init-deobf=com.googlecode.dex2jar.tools.DeObfInitCmd d2j-jar-remap=com.googlecode.dex2jar.tools.JarRemap d2j-jar-access=com.googlecode.dex2jar.tools.JarAccessCmd d2j-decrpyt-string=com.googlecode.dex2jar.tools.DecryptStringCmd +d2j-decrypt-string=com.googlecode.dex2jar.tools.DecryptStringCmd #EOF diff --git a/dex-tools/src/main/bin_gen/d2j_invoke.bat b/dex-tools/src/main/bin_gen/d2j_invoke.bat new file mode 100644 index 000000000..2072f10b1 --- /dev/null +++ b/dex-tools/src/main/bin_gen/d2j_invoke.bat @@ -0,0 +1,14 @@ +@echo off +REM better invocation scripts for windows from lanchon, release in public domain. thanks! +REM https://code.google.com/p/dex2jar/issues/detail?id=192 + +setlocal enabledelayedexpansion + +set LIB=%~dp0lib + +set CP= +for %%X in ("%LIB%"\*.jar) do ( + set CP=!CP!%%X; +) + +java -Xms512m -Xmx1024m -cp "%CP%" %* diff --git a/dex-tools/src/main/bin_gen/d2j_invoke.sh b/dex-tools/src/main/bin_gen/d2j_invoke.sh new file mode 100644 index 000000000..67ff24c0e --- /dev/null +++ b/dex-tools/src/main/bin_gen/d2j_invoke.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# +# dex2jar - Tools to work with android .dex and java .class files +# Copyright (c) 2009-2012 Panxiaobo +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# copy from $Tomcat/bin/startup.sh +# resolve links - $0 may be a softlink +PRG="$0" +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`/"$link" + fi +done +PRGDIR=`dirname "$PRG"` +# + +_classpath="." +for k in "$PRGDIR"/lib/*.jar +do + _classpath="${_classpath}:${k}" +done +java -Xms512m -Xmx1024m -classpath "${_classpath}" "$@" diff --git a/dex-tools/src/main/bin_gen/setclasspath.bat b/dex-tools/src/main/bin_gen/setclasspath.bat deleted file mode 100644 index 186b167e9..000000000 --- a/dex-tools/src/main/bin_gen/setclasspath.bat +++ /dev/null @@ -1 +0,0 @@ -SET CLASSPATH=%1;%CLASSPATH% diff --git a/dex-tools/src/main/bin_gen/sh_template b/dex-tools/src/main/bin_gen/sh_template index f8d657027..5ee22eb40 100644 --- a/dex-tools/src/main/bin_gen/sh_template +++ b/dex-tools/src/main/bin_gen/sh_template @@ -32,9 +32,5 @@ done PRGDIR=`dirname "$PRG"` # -_classpath="." -for k in "$PRGDIR"/lib/*.jar -do - _classpath="${_classpath}:${k}" -done -java -Xms512m -Xmx1024m -classpath "${_classpath}" "__@class_name@__" "$@" +# call d2j_invoke.sh to setup java environment +"$PRGDIR/d2j_invoke.sh" "__@class_name@__" "$@" diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java b/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java index de532a6a5..bbf9636f1 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/bin_gen/BinGen.java @@ -41,8 +41,11 @@ public static void main(String[] args) throws IOException { String bat = FileUtils.readFileToString(new File(cfg, "bat_template"), "UTF-8"); String sh = FileUtils.readFileToString(new File(cfg, "sh_template"), "UTF-8"); - String setclasspath = FileUtils.readFileToString(new File(cfg, "setclasspath.bat"), "UTF-8"); - FileUtils.writeStringToFile(new File(out, "setclasspath.bat"), setclasspath, "UTF-8"); + for (File file2copy : FileUtils.listFiles(cfg, new String[]{"sh", "bat"}, false)) { + String content = FileUtils.readFileToString(file2copy, "UTF-8"); + FileUtils.writeStringToFile(new File(out, file2copy.getName()), content, "UTF-8"); + } + for (Object key : p.keySet()) { String name = key.toString(); FileUtils.writeStringToFile(new File(out, key.toString() + ".sh"), From 87efa5fe2374e7cd0253c3f10914c32454445ab3 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Fri, 27 Sep 2013 18:47:38 +0800 Subject: [PATCH 13/51] handle opcode GLITCH Fixes issue 194 --HG-- branch : 0.0.9.x --- .../dex2jar/reader/DexCodeReader.java | 111 +++++++++++++----- .../dex2jar/reader/OpcodeFormat.java | 8 +- 2 files changed, 90 insertions(+), 29 deletions(-) diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java index 2cb1982cd..32ddd4f7a 100644 --- a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java +++ b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java @@ -34,7 +34,15 @@ * @version $Rev$ */ /* default */class DexCodeReader implements DexOpcodes { + private static class OpcodeFormatNotFoundException extends Exception { + private static final long serialVersionUID = 1L; + public final int offset, opcode; + private OpcodeFormatNotFoundException(int offset, int opcode) { + this.offset = offset; + this.opcode = opcode; + } + } /** * dex文件 */ @@ -71,7 +79,7 @@ this.isStatic = isStatic; } - private void findLabels(DataIn in, int instruction_size) { + private void findLabels(DataIn in, int instruction_size) throws OpcodeFormatNotFoundException { int baseOffset = in.getCurrentPosition(); fixIssue130(in, instruction_size); for (int currentOffset = (in.getCurrentPosition() - baseOffset) / 2; currentOffset < instruction_size; currentOffset = (in @@ -86,6 +94,11 @@ private void findLabels(DataIn in, int instruction_size) { } OpcodeFormat format = OpcodeFormat.get(opcode, dex.apiLevel); + + if (format == null) { + throw new OpcodeFormatNotFoundException(currentOffset * 2, opcode); + } + try { switch (opcode) { case OP_GOTO:// 10t @@ -301,41 +314,78 @@ public void accept(DexCodeVisitor dcv, int config) { i++; } } - dcv.visitArguments(total_registers_size, args); } - // 处理异常处理 - if (tries_size > 0) { - in.push(); - try { - in.skip(instruction_size * 2); - if ((instruction_size & 0x01) != 0) {// skip padding - in.skip(2); - } - findTryCatch(in, dcv, tries_size, instruction_size); - } finally { - in.pop(); - } - } - // 处理debug信息 - if (debug_off != 0 && (0 == (config & DexFileReader.SKIP_DEBUG))) { - in.pushMove(debug_off); - try { - new DexDebugInfoReader(in, dex, instruction_size, this, localVariables, args).accept(dcv); - } finally { - in.pop(); - } - } - // 查找标签 + // issue 194, handle opcode GLITCH + boolean codeReadSuccess = true; + // first of all, travel the instructions to find labels in.push(); try { findLabels(in, instruction_size); + } catch (OpcodeFormatNotFoundException e) { + System.err.println(String.format("GLITCH: zero-width instruction at %s, @0x%04x, op=0x%02x", + this.method.toString(), e.offset, e.opcode)); + codeReadSuccess = false; } finally { in.pop(); } - DexOpcodeAdapter n = new DexOpcodeAdapter(this.dex, this.labels, dcv); - acceptInsn(in, instruction_size, n); - dcv.visitEnd(); + + if (codeReadSuccess) { + dcv.visitArguments(total_registers_size, args); + // 处理异常处理 + if (tries_size > 0) { + in.push(); + try { + in.skip(instruction_size * 2); + if ((instruction_size & 0x01) != 0) {// skip padding + in.skip(2); + } + findTryCatch(in, dcv, tries_size, instruction_size); + } finally { + in.pop(); + } + } + // 处理debug信息 + if (debug_off != 0 && (0 == (config & DexFileReader.SKIP_DEBUG))) { + in.pushMove(debug_off); + try { + new DexDebugInfoReader(in, dex, instruction_size, this, + localVariables, args).accept(dcv); + } finally { + in.pop(); + } + } + + DexOpcodeAdapter n = new DexOpcodeAdapter(this.dex, this.labels, + dcv); + acceptInsn(in, instruction_size, n); + dcv.visitEnd(); + } else { + // fail to read instructions, replace the instructions + + System.err.println("WARN: Replace insn of " + method + + " to D2JSTUB"); + + // make sure there is a reg for the exception + if (total_registers_size - in_register_size < 1) { + total_registers_size++; + for (int i = 0; i < args.length; i++) { + args[i] = args[i] + 1; + } + } + + // reg 0: the exception object + int R0ex = 0; + + dcv.visitArguments(total_registers_size, args); + dcv.visitClassStmt(OP_NEW_INSTANCE, R0ex, + "LD2JSTUB_FAIL_READ_INSN_HERE;"); + dcv.visitMethodStmt(OP_INVOKE_DIRECT, new int[] { R0ex }, + new Method("LD2JSTUB_FAIL_READ_INSN_HERE;", "", + new String[0], "V")); + dcv.visitReturnStmt(OP_THROW, 0, TYPE_OBJECT); + dcv.visitEnd(); + } } // 处理指令 @@ -377,6 +427,11 @@ private void acceptInsn(DataIn in, int instruction_size, DexOpcodeAdapter n) { OpcodeFormat format = OpcodeFormat.get(opcode, dex.apiLevel); + // format is already checked in findLabels +// if (format == null) { +// throw new OpcodeFormatNotFoundException(currentOffset * 2, opcode); +// } + switch (format) { case F10t: n.x0t(opcode, (byte) (uOpcodeH)); diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java index ec16264f7..b140caf1a 100644 --- a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java +++ b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java @@ -21,6 +21,12 @@ public int getSize() { return size; } + /** + * + * @param opcode + * @param apiLevel + * @return null if the opcode not exists + */ public static OpcodeFormat get(int opcode, int apiLevel) { switch (opcode) { case 0x00F0:// OP_INVOKE_DIRECT_EMPTY,OP_INVOKE_OBJECT_INIT_RANGE @@ -359,6 +365,6 @@ public static OpcodeFormat get(int opcode, int apiLevel) { case OP_INVOKE_OBJECT_INIT_JUMBO: return F5rc; } - throw new RuntimeException("opcode format for " + opcode + " not found!"); + return null; } } From d3c357493bf6b1377ca1875c1c9e2fe40ed777cb Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Sat, 28 Sep 2013 00:46:52 +0800 Subject: [PATCH 14/51] handle <*init> method name GLITCH Fixes issue 195 --HG-- branch : 0.0.9.x --- .../com/googlecode/dex2jar/reader/DexFileReader.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java index d26ec1a52..f8e4f9fc9 100644 --- a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java +++ b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java @@ -659,6 +659,18 @@ public final void setApiLevel(int apiLevel) { int code_off = (int) in.readULeb128(); int method_id = lastIndex + diff; Method method = getMethod(method_id); + + // issue 195, a or but not marked as ACC_CONSTRUCTOR, + // skip the method + if (0 == (method_access_flags & DexOpcodes.ACC_CONSTRUCTOR) + && (method.getName().equals("") || method.getName() + .equals(""))) { + System.err.println("GLITCH: method " + method.toString() + + " not marked as ACC_CONSTRUCTOR"); + System.err.println("WARN: skip method " + method.toString()); + return method_id; + } + try { DexMethodVisitor dmv = cv.visitMethod(method_access_flags, method); if (dmv != null) { From 1a6bfd92015baf8d14782af8cc5e242bbae385c4 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Wed, 6 Nov 2013 14:27:58 +0800 Subject: [PATCH 15/51] add support to detect dup methods Fixes issue 200 --HG-- branch : 0.0.9.x --- .../dex2jar/reader/DexFileReader.java | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java index f8e4f9fc9..5a5a74885 100644 --- a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java +++ b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java @@ -102,6 +102,13 @@ public class DexFileReader { * ingore read exception */ public static final int IGNORE_READ_EXCEPTION = 1 << 5; + + /** + * read all methods, even if they are glitch + */ + public static final int KEEP_ALL_METHODS = 1 << 6; + + private final boolean odex; private DataIn odex_in; private int odex_depsOffset; @@ -459,15 +466,19 @@ private void acceptClass(DexFileVisitor dv, DexClassVisitor dcv, String classNam for (int i = 0; i < instance_fields; i++) { lastIndex = acceptField(lastIndex, dcv, fieldAnnotationPositions, null, config); } + boolean firstMethod = true; lastIndex = 0; for (int i = 0; i < direct_methods; i++) { lastIndex = acceptMethod(lastIndex, dcv, methodAnnotationPositions, paramAnnotationPositions, - config); + config, firstMethod); + firstMethod = false; } + firstMethod = true; lastIndex = 0; for (int i = 0; i < virtual_methods; i++) { lastIndex = acceptMethod(lastIndex, dcv, methodAnnotationPositions, paramAnnotationPositions, - config); + config, firstMethod); + firstMethod = false; } } } finally { @@ -645,14 +656,16 @@ public final void setApiLevel(int apiLevel) { /** * 访问方法 * + * * @param lastIndex * @param cv * @param methodAnnos * @param parameterAnnos + * @param firstMethod * @return */ /* default */int acceptMethod(int lastIndex, DexClassVisitor cv, Map methodAnnos, - Map parameterAnnos, int config) { + Map parameterAnnos, int config, boolean firstMethod) { DataIn in = this.in; int diff = (int) in.readULeb128(); int method_access_flags = (int) in.readULeb128(); @@ -660,6 +673,15 @@ public final void setApiLevel(int apiLevel) { int method_id = lastIndex + diff; Method method = getMethod(method_id); + // issue 200, methods may have same signature, we only need to keep the first one + if (!firstMethod && diff == 0) { // detect a duplicated method + System.out.printf("GLITCH: duplicated method %s\n", method.toString()); + if ((config & KEEP_ALL_METHODS) == 0) { + System.out.printf("WARN: skip method %s\n", method.toString()); + return method_id; + } + } + // issue 195, a or but not marked as ACC_CONSTRUCTOR, // skip the method if (0 == (method_access_flags & DexOpcodes.ACC_CONSTRUCTOR) @@ -667,8 +689,10 @@ public final void setApiLevel(int apiLevel) { .equals(""))) { System.err.println("GLITCH: method " + method.toString() + " not marked as ACC_CONSTRUCTOR"); - System.err.println("WARN: skip method " + method.toString()); - return method_id; + if ((config & KEEP_ALL_METHODS) == 0) { + System.out.printf("WARN: skip method %s\n", method.toString()); + return method_id; + } } try { From a8d40e4eac634e4dd95bf4c98cd2401e32ecfe6b Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Thu, 21 Nov 2013 21:09:13 +0800 Subject: [PATCH 16/51] fix annotation read bug --HG-- branch : 0.0.9.x --- .../main/java/com/googlecode/dex2jar/reader/DexFileReader.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java index 5a5a74885..eab0552f4 100644 --- a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java +++ b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java @@ -717,6 +717,9 @@ public final void setApiLevel(int apiLevel) { int sizeJ = in.readUIntx(); for (int j = 0; j < sizeJ; j++) { int field_annotation_offset = in.readUIntx(); + if(field_annotation_offset == 0){ + continue; + } in.pushMove(field_annotation_offset); try { DexAnnotationAble dpav = dmv.visitParameterAnnotation(j); From a1ebf804aee6d8030783858d671bf7e08dc2476d Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Mon, 17 Feb 2014 19:17:13 +0800 Subject: [PATCH 17/51] not skip bad <*init> update issue 195 keep bad <*init> --HG-- branch : 0.0.9.x --- .../java/com/googlecode/dex2jar/reader/DexFileReader.java | 5 ----- 1 file changed, 5 deletions(-) diff --git a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java index eab0552f4..5008e54e8 100644 --- a/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java +++ b/dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java @@ -683,16 +683,11 @@ public final void setApiLevel(int apiLevel) { } // issue 195, a or but not marked as ACC_CONSTRUCTOR, - // skip the method if (0 == (method_access_flags & DexOpcodes.ACC_CONSTRUCTOR) && (method.getName().equals("") || method.getName() .equals(""))) { System.err.println("GLITCH: method " + method.toString() + " not marked as ACC_CONSTRUCTOR"); - if ((config & KEEP_ALL_METHODS) == 0) { - System.out.printf("WARN: skip method %s\n", method.toString()); - return method_id; - } } try { From b80161fc560b42fc4b9e46259b41341dbeb92bc1 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Mon, 17 Feb 2014 19:27:45 +0800 Subject: [PATCH 18/51] travel all parent to find method in decrypt-string Fixes issue 216 --HG-- branch : 0.0.9.x --- .../dex2jar/tools/DecryptStringCmd.java | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java index bcf96f3b1..76794deb8 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java +++ b/dex-tools/src/main/java/com/googlecode/dex2jar/tools/DecryptStringCmd.java @@ -219,8 +219,8 @@ protected void doCommandLine() throws Exception { if (clz == null) { System.err.println("clz is null:" + config.owner); } - Method jmethod = clz.getDeclaredMethod(config.name, - this.toJavaType(Type.getArgumentTypes(config.desc))); + Method jmethod = findAnyMethodMatch(clz, config.name, + toJavaType(Type.getArgumentTypes(config.desc))); jmethod.setAccessible(true); config.jmethod = jmethod; map.put(config, config); @@ -325,6 +325,37 @@ private Object convert(Object object, Class type) { } } + /** + * fix for issue 216, travel all the parent of class and use getDeclaredMethod to find methods + */ + private Method findAnyMethodMatch(Class clz, String name, Class[] classes) { + try { + Method m = clz.getDeclaredMethod(name, classes); + if (m != null) { + return m; + } + } catch (NoSuchMethodException e) { + e.printStackTrace(); + } + Class sup = clz.getSuperclass(); + if (sup != null) { + Method m = findAnyMethodMatch(sup, name, classes); + if (m != null) { + return m; + } + } + Class[] itfs = clz.getInterfaces(); + if (itfs != null && itfs.length > 0) { + for (Class itf : itfs) { + Method m = findAnyMethodMatch(itf, name, classes); + if (m != null) { + return m; + } + } + } + return null; + } + Object readCst(AbstractInsnNode q) { if (q.getOpcode() == Opcodes.LDC) { LdcInsnNode ldc = (LdcInsnNode) q; From 4cf69a2ef2e7d2b60d3abde5b61c6229e45679c5 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Mon, 17 Feb 2014 19:53:50 +0800 Subject: [PATCH 19/51] init all reg to 0 at top of a method. Update issue 219 a simple and tricky fix for this issue by init all reg to 0 at top of a method. --HG-- branch : 0.0.9.x --- .../googlecode/dex2jar/v3/V3CodeAdapter.java | 6 ++- .../dex2jar/test/UnInitRegisterTest.java | 51 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/UnInitRegisterTest.java diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java index cf05a065b..b82355f6b 100644 --- a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java +++ b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java @@ -75,6 +75,7 @@ import java.util.Arrays; +import com.googlecode.dex2jar.ir.stmt.Stmts; import org.objectweb.asm.Label; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; @@ -148,7 +149,10 @@ public void visitArguments(int total, int[] args) { } for (int i = 0; i < locals.length; i++) { if (locals[i] == null) { - locals[i] = nLocal("a" + i); + Local local = nLocal("a" + i); + locals[i] = local; + // simple fix for issue 219, init all tmp register to 0 at the start of insn. + list.add(Stmts.nAssign(local, nInt(0))); } } } diff --git a/dex-translator/src/test/java/com/googlecode/dex2jar/test/UnInitRegisterTest.java b/dex-translator/src/test/java/com/googlecode/dex2jar/test/UnInitRegisterTest.java new file mode 100644 index 000000000..e530f057b --- /dev/null +++ b/dex-translator/src/test/java/com/googlecode/dex2jar/test/UnInitRegisterTest.java @@ -0,0 +1,51 @@ +package com.googlecode.dex2jar.test; + +import com.googlecode.dex2jar.DexLabel; +import com.googlecode.dex2jar.Method; +import com.googlecode.dex2jar.visitors.DexClassVisitor; +import com.googlecode.dex2jar.visitors.DexCodeVisitor; +import com.googlecode.dex2jar.visitors.DexMethodVisitor; +import org.junit.Test; + +import static com.googlecode.dex2jar.DexOpcodes.*; + +public class UnInitRegisterTest { + public static void i219(DexClassVisitor cv) { + DexMethodVisitor mv = cv.visitMethod(ACC_PUBLIC | ACC_STATIC, new Method("La;", "a", + new String[] { "Ljava/lang/String;" }, "I")); + DexCodeVisitor code = mv.visitCode(); + + int v0 = 0; + int v1 = 1; + + code.visitArguments(2, new int[] { v1 }); + code.visitReturnStmt(OP_RETURN, v0, TYPE_INT); + code.visitEnd(); + mv.visitEnd(); + } + + public static void i220(DexClassVisitor cv) { + DexMethodVisitor mv = cv.visitMethod(ACC_PUBLIC, new Method("La;", "a", new String[] {}, "Ljava/lang/String;")); + DexCodeVisitor code = mv.visitCode(); + + int v0 = 0; + int v1 = 1; + int v2 = 2; + int v6 = 6; + + DexLabel L6 = new DexLabel(); + code.visitArguments(7, new int[] { v6 }); + code.visitJumpStmt(OP_IF_EQZ, v1, L6); + code.visitMoveStmt(OP_MOVE, v0, v6); + code.visitLabel(L6); + code.visitReturnStmt(OP_RETURN, v2, TYPE_OBJECT); + code.visitEnd(); + mv.visitEnd(); + } + + @Test + public void test() throws Exception { + TestUtils.testDexASMifier(getClass(), "i219"); + TestUtils.testDexASMifier(getClass(), "i220"); + } +} From 676afea0f335c7d425d13236d8909cdbf7197354 Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Thu, 20 Mar 2014 11:32:32 +0800 Subject: [PATCH 20/51] Fixes issue 222 --HG-- branch : 0.0.9.x --- .../java/com/googlecode/dex2jar/v3/AnnotationNode.java | 4 +++- .../src/test/java/res/i222AnnotationType.java | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 dex-translator/src/test/java/res/i222AnnotationType.java diff --git a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java index cd6933708..6fda67816 100644 --- a/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java +++ b/dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java @@ -21,6 +21,7 @@ import org.objectweb.asm.AnnotationVisitor; import org.objectweb.asm.ClassVisitor; import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Type; import com.googlecode.dex2jar.DexType; import com.googlecode.dex2jar.Field; @@ -80,7 +81,8 @@ public static void accept(String name, Object v, AnnotationVisitor av) { // av.visit(name, v); System.err.println("WARN: ignored method annotation value"); } else if (v instanceof DexType) { - av.visit(name, ((DexType) v).desc); + // fix issue 222 the type is translated to string in annotation + av.visit(name, Type.getType(((DexType) v).desc)); } else { if (v == null) { System.err.println("WARN: ignored null annotation value"); diff --git a/dex-translator/src/test/java/res/i222AnnotationType.java b/dex-translator/src/test/java/res/i222AnnotationType.java new file mode 100644 index 000000000..df82c6e2a --- /dev/null +++ b/dex-translator/src/test/java/res/i222AnnotationType.java @@ -0,0 +1,10 @@ +package res; + +@i222AnnotationType.B(name = "123", value = Object.class) +public class i222AnnotationType { + public @interface B { + String name(); + + Class value(); + } +} From 092b7b48ba4a15e987756d3aaa698161e79d4bbf Mon Sep 17 00:00:00 2001 From: Bob Pan Date: Mon, 21 Jul 2014 22:11:55 +0800 Subject: [PATCH 21/51] merge code 2.x --HG-- branch : 2.x --- build.gradle | 58 + commons-lite/pom.xml | 13 - .../org/apache/commons/codec/binary/Hex.java | 121 -- .../commons/collections/Transformer.java | 51 - .../commons/collections/map/LazyMap.java | 40 - .../java/org/apache/commons/io/FileUtils.java | 164 -- .../org/apache/commons/io/FilenameUtils.java | 16 - .../java/org/apache/commons/io/IOUtils.java | 62 - .../codec/util/MemoryCacheSeekableStream.java | 255 --- .../image/codec/util/SeekableStream.java | 943 ---------- d2j-base-cmd/build.gradle | 4 + d2j-base-cmd/pom.xml | 12 + .../com/googlecode/dex2jar/tools/BaseCmd.java | 96 +- d2j-jasmin/build.gradle | 28 + d2j-jasmin/pom.xml | 51 + .../antlr3/com/googlecode/d2j/jasmin/Jasmin.g | 1192 ++++++++++++ .../googlecode/d2j/jasmin/Jar2JasminCmd.java | 123 ++ .../googlecode/d2j/jasmin/Jasmin2JarCmd.java | 152 ++ .../googlecode/d2j/jasmin/JasminDumper.java | 223 +-- .../com/googlecode/d2j/jasmin/Jasmins.java | 44 + d2j-smali/build.gradle | 33 + d2j-smali/pom.xml | 57 + .../antlr3/com/googlecode/d2j/smali/Smali.g | 513 ++++++ .../com/googlecode/d2j/smali/Baksmali.java | 114 ++ .../com/googlecode/d2j/smali/BaksmaliCmd.java | 62 + .../d2j/smali/BaksmaliCodeDumper.java | 450 +++++ .../d2j/smali/BaksmaliDexFileVisitor.java | 69 + .../googlecode/d2j/smali/BaksmaliDumpOut.java | 68 + .../googlecode/d2j/smali/BaksmaliDumper.java | 518 ++++++ .../java/com/googlecode/d2j/smali/Smali.java | 95 + .../com/googlecode/d2j/smali/SmaliCmd.java | 76 + .../d2j/smali/SmaliCodeVisitor.java | 228 +++ .../java/com/googlecode/d2j/smali/Utils.java | 404 ++++ d2j-smali/src/test/java/a/SmaliTest.java | 27 + d2j-smali/src/test/resources/a.smali | 54 + dex-ir/pom.xml | 32 +- .../com/googlecode/dex2jar/ir/Constant.java | 124 -- .../java/com/googlecode/dex2jar/ir/ET.java | 1 + .../com/googlecode/dex2jar/ir/IrMethod.java | 54 +- .../dex2jar/ir/LabelAndLocalMapper.java | 31 + .../com/googlecode/dex2jar/ir/LocalVar.java | 9 +- .../googlecode/dex2jar/ir/StmtTraveler.java | 63 + .../googlecode/dex2jar/ir/ToStringUtil.java | 89 - .../dex2jar/ir/TransformerException.java | 26 + .../java/com/googlecode/dex2jar/ir/Trap.java | 14 +- .../com/googlecode/dex2jar/ir/TypeClass.java | 183 ++ .../java/com/googlecode/dex2jar/ir/Util.java | 154 ++ .../java/com/googlecode/dex2jar/ir/Value.java | 144 -- .../googlecode/dex2jar/ir/expr/ArrayExpr.java | 21 +- .../googlecode/dex2jar/ir/expr/BinopExpr.java | 28 +- .../googlecode/dex2jar/ir/expr/CastExpr.java | 35 +- .../googlecode/dex2jar/ir/expr/Constant.java | 101 + .../com/googlecode/dex2jar/ir/expr/Exprs.java | 217 ++- .../googlecode/dex2jar/ir/expr/FieldExpr.java | 48 +- .../dex2jar/ir/expr/FilledArrayExpr.java | 35 +- .../dex2jar/ir/expr/InvokeExpr.java | 72 +- .../com/googlecode/dex2jar/ir/expr/Local.java | 74 + .../googlecode/dex2jar/ir/expr/NewExpr.java | 46 +- .../dex2jar/ir/expr/NewMutiArrayExpr.java | 34 +- .../googlecode/dex2jar/ir/expr/PhiExpr.java | 52 + .../googlecode/dex2jar/ir/expr/RefExpr.java | 24 +- .../dex2jar/ir/expr/StaticFieldExpr.java | 74 + .../googlecode/dex2jar/ir/expr/TypeExpr.java | 51 +- .../googlecode/dex2jar/ir/expr/UnopExpr.java | 28 +- .../com/googlecode/dex2jar/ir/expr/Value.java | 284 +++ .../dex2jar/ir/stmt/AssignStmt.java | 18 +- .../dex2jar/ir/stmt/BaseSwitchStmt.java | 4 +- .../googlecode/dex2jar/ir/stmt/GotoStmt.java | 56 + .../googlecode/dex2jar/ir/stmt/IfStmt.java | 64 + .../googlecode/dex2jar/ir/stmt/JumpStmt.java | 102 +- .../googlecode/dex2jar/ir/stmt/LabelStmt.java | 138 +- .../dex2jar/ir/stmt/LookupSwitchStmt.java | 14 +- .../googlecode/dex2jar/ir/stmt/NopStmt.java | 6 +- .../dex2jar/ir/stmt/ReturnVoidStmt.java | 5 +- .../com/googlecode/dex2jar/ir/stmt/Stmt.java | 136 +- .../googlecode/dex2jar/ir/stmt/StmtList.java | 19 +- .../com/googlecode/dex2jar/ir/stmt/Stmts.java | 47 +- .../dex2jar/ir/stmt/TableSwitchStmt.java | 19 +- .../googlecode/dex2jar/ir/stmt/UnopStmt.java | 15 +- .../{Local.java => stmt/VoidInvokeStmt.java} | 33 +- .../dex2jar/ir/ts/AggTransformer.java | 340 ++++ .../dex2jar/ir/ts/BaseLiveAnalyze.java | 264 --- .../com/googlecode/dex2jar/ir/ts/Cfg.java | 746 +++++--- .../googlecode/dex2jar/ir/ts/CleanLabel.java | 8 +- .../dex2jar/ir/ts/ConstTransformer.java | 216 +++ .../dex2jar/ir/ts/DeadCodeTransformer.java | 135 ++ .../googlecode/dex2jar/ir/ts/EndRemover.java | 133 +- .../ExceptionHandlerCurrectTransformer.java | 177 +- .../dex2jar/ir/ts/ExceptionHandlerTrim.java | 8 +- .../com/googlecode/dex2jar/ir/ts/FixVar.java | 19 +- .../ir/ts/Ir2JRegAssignTransformer.java | 311 ++++ .../dex2jar/ir/ts/JimpleTransformer.java | 160 ++ .../googlecode/dex2jar/ir/ts/LiveAnalyze.java | 151 -- .../googlecode/dex2jar/ir/ts/LocalRemove.java | 458 ----- .../googlecode/dex2jar/ir/ts/LocalSplit.java | 329 ---- .../googlecode/dex2jar/ir/ts/LocalType.java | 113 -- .../dex2jar/ir/ts/NewTransformer.java | 112 ++ .../dex2jar/ir/ts/NpeTransformer.java | 200 ++ .../dex2jar/ir/ts/RemoveConstantFromSSA.java | 156 ++ .../dex2jar/ir/ts/RemoveLocalFromSSA.java | 281 +++ .../dex2jar/ir/ts/SSATransformer.java | 462 +++++ .../dex2jar/ir/ts/StatedTransformer.java | 12 + .../dex2jar/ir/ts/TopologicalSort.java | 382 ---- .../googlecode/dex2jar/ir/ts/Transformer.java | 2 +- .../googlecode/dex2jar/ir/ts/TypeAnalyze.java | 630 ------- .../dex2jar/ir/ts/TypeTransformer.java | 863 +++++++++ .../dex2jar/ir/ts/UnSSATransformer.java | 598 ++++++ .../googlecode/dex2jar/ir/ts/UniqueQueue.java | 46 + .../dex2jar/ir/ts/VoidInvokeTransformer.java | 78 + .../dex2jar/ir/ts/ZeroTransformer.java | 322 +--- .../dex2jar/ir/ts/an/AnalyzeValue.java | 47 +- .../dex2jar/ir/ts/an/BaseAnalyze.java | 192 ++ .../dex2jar/ir/ts/an/SimpleLiveAnalyze.java | 131 ++ .../an/SimpleLiveValue.java} | 66 +- .../ir/ts/array/ArrayElementTransformer.java | 401 ++++ .../ArrayNullPointerTransformer.java | 89 +- .../ir/ts/array/FillArrayTransformer.java | 589 ++++++ .../src/main/resources/META-INF/LICENSE.txt | 203 -- dex-ir/src/main/resources/META-INF/NOTICE.txt | 7 - .../dex2jar/ir/test/AggTransformerTest.java | 90 + .../dex2jar/ir/test/BaseTransformerTest.java | 106 ++ .../dex2jar/ir/test/ConstTransformerTest.java | 121 ++ .../dex2jar/ir/test/ConstantStringTest.java | 7 +- .../ir/test/DeadCodeTrnasformerTest.java | 19 + .../ir/test/JimpleTransformerTest.java | 49 + .../dex2jar/ir/test/LocalRemoverTest.java | 305 --- .../dex2jar/ir/test/LocalSplitTest.java | 339 ---- .../ir/test/RemoveConstantFromSSATest.java | 114 ++ .../ir/test/RemoveLocalFromSSATest.java | 35 + .../dex2jar/ir/test/SSATransformerTest.java | 317 ++++ .../dex2jar/ir/test/StmtListTest.java | 70 +- .../dex2jar/ir/test/TopologicalSortTest.java | 143 -- .../ir/test/TyepAnalyzeTypeRefTest.java | 35 - .../dex2jar/ir/test/TypeTransformerTest.java | 132 ++ .../test/UnSSATransformerTransformerTest.java | 184 ++ .../googlecode/dex2jar/ir/test/ZeroTest.java | 71 - .../dex2jar/ir/test/ZeroTransformerTest.java | 38 + dex-reader-api/build.gradle | 1 + dex-reader-api/pom.xml | 15 + .../java/com/googlecode/d2j/DexConstants.java | 54 + .../com/googlecode/d2j}/DexException.java | 2 +- .../java/com/googlecode/d2j}/DexLabel.java | 11 +- .../java/com/googlecode/d2j}/DexType.java | 2 +- .../main/java/com/googlecode/d2j}/Field.java | 2 +- .../main/java/com/googlecode/d2j}/Method.java | 2 +- .../java/com/googlecode/d2j/Visibility.java | 68 +- .../d2j/node/DexAnnotationNode.java | 161 ++ .../com/googlecode/d2j/node/DexClassNode.java | 125 ++ .../com/googlecode/d2j/node/DexCodeNode.java | 303 +++ .../com/googlecode/d2j/node/DexDebugNode.java | 194 ++ .../com/googlecode/d2j/node/DexFieldNode.java | 77 + .../com/googlecode/d2j/node/DexFileNode.java | 40 + .../googlecode/d2j/node/DexMethodNode.java | 123 ++ .../java/com/googlecode/d2j/reader/CFG.java | 11 + .../d2j/reader/InstructionFormat.java | 42 + .../d2j/reader/InstructionIndexType.java | 14 + .../java/com/googlecode/d2j/reader/Op.java | 294 +++ .../d2j}/visitors/DexAnnotationAble.java | 8 +- .../d2j}/visitors/DexAnnotationVisitor.java | 67 +- .../d2j/visitors/DexClassVisitor.java | 75 + .../d2j/visitors/DexCodeVisitor.java | 298 +++ .../d2j/visitors/DexDebugVisitor.java | 90 + .../d2j/visitors/DexFieldVisitor.java | 97 +- .../d2j/visitors/DexFileVisitor.java | 38 +- .../d2j/visitors/DexMethodVisitor.java | 67 + dex-reader/build.gradle | 8 + dex-reader/pom.xml | 46 +- .../googlecode/d2j/reader/DexFileReader.java | 1637 +++++++++++++++++ .../googlecode/d2j/reader/zip/ZipUtil.java | 89 + .../util/ASMifierAnnotationV.java | 17 +- .../{dex2jar => d2j}/util/ASMifierClassV.java | 46 +- .../googlecode/d2j/util/ASMifierCodeV.java | 230 +++ .../{dex2jar => d2j}/util/ASMifierFileV.java | 58 +- .../{dex2jar => d2j}/util/ArrayOut.java | 106 +- .../{dex2jar => d2j}/util/Escape.java | 70 +- .../{dex2jar/reader => d2j/util}/Mutf8.java | 18 +- .../googlecode/{dex2jar => d2j}/util/Out.java | 22 +- .../{dex2jar => d2j}/util/Utf8Utils.java | 2 +- .../util/zip/AutoSTOREDZipOutputStream.java | 107 ++ .../googlecode/d2j/util/zip/ZipConstants.java | 32 + .../com/googlecode/d2j/util/zip/ZipEntry.java | 238 +++ .../com/googlecode/d2j/util/zip/ZipFile.java | 340 ++++ .../com/googlecode/dex2jar/DexOpcodes.java | 132 -- .../googlecode/dex2jar/reader/Annotation.java | 58 - .../dex2jar/reader/CCZipExtractor.java | 53 - .../googlecode/dex2jar/reader/Constant.java | 160 -- .../dex2jar/reader/DexAnnotationReader.java | 96 - .../dex2jar/reader/DexCodeReader.java | 760 -------- .../dex2jar/reader/DexDebugInfoReader.java | 210 --- .../dex2jar/reader/DexFileReader.java | 779 -------- .../dex2jar/reader/DexInternalOpcode.java | 272 --- .../dex2jar/reader/DexOpcodeAdapter.java | 981 ---------- .../dex2jar/reader/OpcodeFormat.java | 370 ---- .../dex2jar/reader/ZipExtractor.java | 43 - .../dex2jar/reader/ZipInputStreamHack.java | 104 -- .../dex2jar/reader/io/ArrayDataIn.java | 172 -- .../googlecode/dex2jar/reader/io/DataIn.java | 82 - .../dex2jar/reader/io/DataInWrapper.java | 87 - .../dex2jar/reader/io/DataInputDataIn.java | 152 -- .../dex2jar/reader/io/InputStreamDataIn.java | 65 - .../reader/io/RandomAccessFileInput.java | 53 - .../dex2jar/util/ASMifierCodeV.java | 269 --- .../util/AbstractDumpDexCodeAdapter.java | 556 ------ .../dex2jar/util/DexOpcodeDump.java | 61 - .../com/googlecode/dex2jar/util/Dump.java | 295 --- .../dex2jar/util/DumpDexCodeAdapter.java | 175 -- .../dex2jar/visitors/DexClassAdapter.java | 87 - .../dex2jar/visitors/DexClassVisitor.java | 43 - .../dex2jar/visitors/DexCodeAdapter.java | 188 -- .../dex2jar/visitors/DexCodeVisitor.java | 322 ---- .../dex2jar/visitors/DexMethodAdapter.java | 74 - .../dex2jar/visitors/EmptyVisitor.java | 263 --- .../dex2jar/visitors/OdexCodeVisitor.java | 54 - .../src/main/resources/META-INF/LICENSE.txt | 203 -- .../src/main/resources/META-INF/NOTICE.txt | 7 - .../d2j/reader/test/AsmfierTest.java | 60 + .../d2j/reader/test/BadZipEntryFlagTest.java | 57 + .../d2j/reader/test/SkipDupMethod.java | 25 + .../reader/test/BadZipEntryFlagTest.java | 58 - .../zip/ZipArchiveOutputStreamHack.java | 1497 --------------- dex-reader/src/test/resources/i200.dex | Bin 0 -> 658 bytes dex-tools/build.gradle | 36 + dex-tools/open-source-license.txt | 67 + dex-tools/pom.xml | 73 +- dex-tools/src/main/assemble/package.xml | 30 +- dex-tools/src/main/bin_gen/bat_template | 2 +- dex-tools/src/main/bin_gen/class.cfg | 28 +- dex-tools/src/main/bin_gen/d2j_invoke.sh | 18 +- dex-tools/src/main/bin_gen/sh_template | 2 +- dex-tools/src/main/jars/asm-LICENSE.txt | 28 - .../src/main/jars/commons-io-LICENSE.txt | 203 -- dex-tools/src/main/jars/commons-io-NOTICE.txt | 6 - dex-tools/src/main/jars/dx-NOTICE | 190 -- dex-tools/src/main/jars/dx.jar | Bin 989738 -> 0 bytes dex-tools/src/main/jars/license-jasmin.txt | 30 - .../java/com/googlecode/d2j/map/AntiObf.java | 103 ++ .../d2j/map/AsmInheritanceClassVisitor.java | 60 + .../d2j/map/AutoDetectSourceProcess.java | 98 + .../d2j/map/DexInheritanceFileVisitor.java | 60 + .../googlecode/d2j/map/DexMappingAdapter.java | 514 ++++++ .../googlecode/d2j/map/InheritanceTree.java | 476 +++++ .../d2j/map/ProguardMappingParser.java | 111 ++ .../d2j/signapk/AbstractJarSign.java} | 707 ++++--- .../d2j/signapk/SunJarSignImpl.java | 46 + .../googlecode/d2j/signapk/TinySignImpl.java | 53 + .../googlecode/d2j/tools/jar}/ClassInfo.java | 72 +- .../com/googlecode/d2j/tools/jar/InitOut.java | 414 +++++ .../d2j/tools/jar/InvocationWeaver.java | 768 ++++++++ .../d2j/tools/jar}/ScanBridgeAdapter.java | 126 +- .../com/googlecode/d2j/tools/jar/WebApp.java | 89 + .../com/googlecode/d2j}/util/AccUtils.java | 76 +- .../java/com/googlecode/d2j/util/Mapper.java | 21 + .../googlecode/dex2jar/bin_gen/BinGen.java | 65 +- .../com/googlecode/dex2jar/tools/ApkSign.java | 106 +- .../googlecode/dex2jar/tools/AsmVerify.java | 301 +-- .../BaksmaliBaseDexExceptionHandler.java | 142 ++ .../dex2jar/tools/DeObfInitCmd.java | 19 +- .../dex2jar/tools/DecryptStringCmd.java | 427 +---- .../googlecode/dex2jar/tools/Dex2jarCmd.java | 88 +- .../dex2jar/tools/Dex2jarMultiThreadCmd.java | 173 ++ .../googlecode/dex2jar/tools/DexRemapCmd.java | 132 ++ .../dex2jar/tools/FixApkCompressMethod.java | 81 + .../tools/GenerateCompileStubFromOdex.java | 120 ++ .../com/googlecode/dex2jar/tools/Jar2Dex.java | 87 +- .../googlecode/dex2jar/tools/Jar2Jasmin.java | 116 -- .../dex2jar/tools/JarAccessCmd.java | 93 +- .../googlecode/dex2jar/tools/JarRemap.java | 15 +- .../googlecode/dex2jar/tools/Jasmin2Jar.java | 121 -- .../src/main/resources/META-INF/LICENSE.txt | 203 -- .../src/main/resources/META-INF/NOTICE.txt | 7 - .../d2j/tools/jar/MethodInvocation.java | 16 + .../d2j/tools/jar/test/WaveTest.java | 81 + dex-tools/src/test/resources/wave.config | 8 + dex-tools/src/test/resources/wave.jar | Bin 0 -> 623 bytes dex-translator/build.gradle | 16 + dex-translator/pom.xml | 38 +- .../asm/LdcOptimizeAdapter.java | 38 +- .../d2j/converter/IR2JConverter.java | 939 ++++++++++ .../d2j/converter/J2IRConverter.java | 680 +++++++ .../d2j/dex/BaseDexExceptionHandler.java | 52 + .../d2j/dex/ClassVisitorFactory.java | 15 + .../java/com/googlecode/d2j/dex/Dex2Asm.java | 672 +++++++ .../com/googlecode/d2j/dex/Dex2IrAdapter.java | 934 ++++++++++ .../java/com/googlecode/d2j/dex/Dex2jar.java | 286 +++ .../v3 => d2j/dex}/DexExceptionHandler.java | 8 +- .../java/com/googlecode/d2j/dex/DexFix.java | 137 ++ .../com/googlecode/d2j/dex/ExDex2Asm.java | 63 + .../main/java/com/googlecode/d2j/dex/V3.java | 59 +- .../java/com/googlecode/d2j/util/Types.java | 131 ++ .../googlecode/dex2jar/asm/FieldAdapter.java | 67 - .../OrderInnerOutterInsnNodeClassAdapter.java | 62 - .../googlecode/dex2jar/v3/AnnotationNode.java | 263 --- .../dex2jar/v3/ClassVisitorFactory.java | 9 - .../dex2jar/v3/Dex2AsmAnnotationAdapter.java | 53 - .../com/googlecode/dex2jar/v3/Dex2jar.java | 282 --- .../dex2jar/v3/DexExceptionHandlerImpl.java | 193 -- .../dex2jar/v3/IrMethod2AsmMethod.java | 1183 ------------ .../java/com/googlecode/dex2jar/v3/Main.java | 116 -- .../java/com/googlecode/dex2jar/v3/V3.java | 74 - .../googlecode/dex2jar/v3/V3ClassAdapter.java | 341 ---- .../googlecode/dex2jar/v3/V3CodeAdapter.java | 697 ------- .../googlecode/dex2jar/v3/V3FieldAdapter.java | 100 - .../dex2jar/v3/V3InnerClzGather.java | 194 -- .../dex2jar/v3/V3MethodAdapter.java | 257 --- .../java/org/objectweb/asm/AsmBridge.java | 62 + .../src/main/resources/META-INF/LICENSE.txt | 203 -- .../src/main/resources/META-INF/NOTICE.txt | 7 - .../googlecode/dex2jar/test/ASMifierTest.java | 28 +- .../dex2jar/test/ArrayTypeTest.java | 101 +- .../googlecode/dex2jar/test/AutoCastTest.java | 72 +- .../googlecode/dex2jar/test/BaksmaliTest.java | 37 + .../com/googlecode/dex2jar/test/D2jTest.java | 118 ++ .../dex2jar/test/DexTranslatorRunner.java | 44 + .../com/googlecode/dex2jar/test/DumpTest.java | 45 - .../dex2jar/test/EmptyTrapTest.java | 236 +-- .../com/googlecode/dex2jar/test/I101Test.java | 36 +- .../com/googlecode/dex2jar/test/I121Test.java | 59 +- .../com/googlecode/dex2jar/test/I160Test.java | 89 - .../com/googlecode/dex2jar/test/I168Test.java | 36 +- .../com/googlecode/dex2jar/test/I63Test.java | 32 +- .../googlecode/dex2jar/test/Issue71Test.java | 33 +- .../googlecode/dex2jar/test/OptSyncTest.java | 86 +- .../com/googlecode/dex2jar/test/ResTest.java | 124 +- .../googlecode/dex2jar/test/Smali2jTest.java | 139 ++ .../dex2jar/test/TestDexClassV.java | 15 +- .../googlecode/dex2jar/test/TestUtils.java | 253 ++- .../dex2jar/test/UnInitRegisterTest.java | 51 - .../com/googlecode/dex2jar/test/V3Test.java | 116 -- .../com/googlecode/dex2jar/test/ZeroTest.java | 48 +- .../gen/FTPClient__parsePassiveModeReply.java | 213 +-- .../src/test/java/res/ArithmeticRes.java | 47 - .../src/test/java/res/ArrayRes.java | 116 +- .../src/test/java/res/ConstValues.java | 104 +- .../src/test/java/res/ExceptionRes.java | 62 +- .../java/res/I142_annotation_default.java | 2 - .../src/test/java/res/I56_AccessFlag.java | 210 +-- dex-translator/src/test/java/res/I71.java | 36 +- dex-translator/src/test/java/res/I73.java | 24 +- dex-translator/src/test/java/res/I88.java | 78 +- .../src/test/java/res/LongDoubleRes.java | 56 +- .../src/test/java/res/NoEndRes.java | 36 +- .../src/test/java/res/NullZero.java | 74 +- .../test/java/res/OptimizeSynchronized.java | 64 +- dex-translator/src/test/java/res/PopRes.java | 62 +- .../src/test/java/res/ResChild.java | 30 +- .../src/test/java/res/ResParent.java | 18 +- .../src/test/java/res/SwitchRes.java | 128 +- dex-translator/src/test/java/res/WideRes.java | 130 +- .../src/test/java/res/i222AnnotationType.java | 10 - .../src/test/java/res/i55/AAbstractClass.java | 48 +- .../src/test/java/res/i55/AClass.java | 48 +- .../src/test/java/res/i55/AInterface.java | 48 +- .../dexes/i197_badEnclosingClassAnn.dex | Bin 452 -> 0 bytes dex-translator/src/test/resources/dx-NOTICE | 190 -- dex-translator/src/test/resources/dx.jar | Bin 989738 -> 0 bytes .../src/test/resources/smalis/0zs.smali | 38 + .../resources/smalis/goto-first-label.smali | 16 + .../resources/smalis/int-or-boolean.smali | 11 + .../smalis/issue-220-219-uninit-reg.smali | 22 + .../smalis/npe-cause-trap-fail.smali | 179 ++ .../src/test/resources/smalis/opt-lock.smali | 18 + .../test/resources/smalis/useless-new.smali | 113 ++ .../test/resources/smalis/writeString.smali | 84 + dex-writer/build.gradle | 7 + dex-writer/pom.xml | 30 + .../d2j/dex/writer/AnnotationWriter.java | 130 ++ .../writer/CantNotFixContentException.java | 33 + .../d2j/dex/writer/ClassWriter.java | 101 + .../googlecode/d2j/dex/writer/CodeWriter.java | 865 +++++++++ .../d2j/dex/writer/DexFileWriter.java | 284 +++ .../d2j/dex/writer/DexWriteException.java | 49 + .../d2j/dex/writer/FieldWriter.java | 49 + .../d2j/dex/writer/MethodWriter.java | 86 + .../d2j/dex/writer/ann/Alignment.java | 28 + .../googlecode/d2j/dex/writer/ann/Idx.java | 28 + .../googlecode/d2j/dex/writer/ann/Off.java | 28 + .../d2j/dex/writer/ev/EncodedAnnotation.java | 96 + .../d2j/dex/writer/ev/EncodedArray.java | 60 + .../d2j/dex/writer/ev/EncodedValue.java | 366 ++++ .../googlecode/d2j/dex/writer/insn/Insn.java | 78 +- .../d2j/dex/writer/insn/JumpOp.java | 59 + .../googlecode/d2j/dex/writer/insn/Label.java | 52 +- .../d2j/dex/writer/insn/OpInsn.java | 37 + .../d2j/dex/writer/insn/PreBuildInsn.java | 40 + .../d2j/dex/writer/io/ByteBufferOut.java | 131 ++ .../googlecode/d2j/dex/writer/io/DataOut.java | 52 + .../d2j/dex/writer/item/AnnotationItem.java | 63 + .../dex/writer/item/AnnotationSetItem.java | 63 + .../writer/item/AnnotationSetRefListItem.java | 42 + .../writer/item/AnnotationsDirectoryItem.java | 72 + .../d2j/dex/writer/item/BaseItem.java | 83 + .../d2j/dex/writer/item/ClassDataItem.java | 159 ++ .../d2j/dex/writer/item/ClassDefItem.java | 156 ++ .../d2j/dex/writer/item/CodeItem.java | 295 +++ .../d2j/dex/writer/item/ConstPool.java | 344 ++++ .../d2j/dex/writer/item/DebugInfoItem.java | 336 ++++ .../d2j/dex/writer/item/EncodedArrayItem.java | 34 + .../d2j/dex/writer/item/FieldIdItem.java | 106 ++ .../d2j/dex/writer/item/HeadItem.java | 71 + .../d2j/dex/writer/item/MapListItem.java | 64 + .../d2j/dex/writer/item/MethodIdItem.java | 102 + .../d2j/dex/writer/item/ProtoIdItem.java | 97 + .../d2j/dex/writer/item/SectionItem.java | 134 ++ .../d2j/dex/writer/item/StringDataItem.java | 98 + .../d2j/dex/writer/item/StringIdItem.java | 51 + .../d2j/dex/writer/item/TypeIdItem.java | 52 + .../d2j/dex/writer/item/TypeListItem.java | 84 + dex-writer/src/test/java/a/AppWriterTest.java | 70 + dex-writer/src/test/java/a/CpStringTest.java | 16 + jar-rename/pom.xml | 94 - jar-rename/src/main/java/p/rn/Scann.java | 46 - .../main/java/p/rn/asm/ScanLibVisitor.java | 79 - .../src/main/java/p/rn/name/InitOut.java | 194 -- .../src/main/java/p/rn/name/Renamer.java | 355 ---- .../src/main/java/p/rn/name/RenamerMain.java | 39 - .../src/main/java/p/rn/owner/ReOwner.java | 190 -- .../src/main/java/p/rn/owner/WebApp.java | 68 - .../src/main/java/p/rn/util/FileOut.java | 161 -- .../src/main/java/p/rn/util/FileWalker.java | 108 -- .../src/test/java/p/rn/InitOutTest.java | 22 - .../src/test/java/p/rn/RenamerTest.java | 23 - jar-rename/src/test/java/p/rn/ScannTest.java | 25 - jar-rename/src/test/java/p/rn/ZipOutTest.java | 21 - jar-rename/src/test/java/p/rn/res/As.java | 7 - jar-rename/src/test/java/p/rn/res/Em.java | 5 - pom.xml | 68 +- settings.gradle | 2 + 427 files changed, 35112 insertions(+), 26050 deletions(-) create mode 100644 build.gradle delete mode 100644 commons-lite/pom.xml delete mode 100644 commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java delete mode 100644 commons-lite/src/main/java/org/apache/commons/collections/Transformer.java delete mode 100644 commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java delete mode 100644 commons-lite/src/main/java/org/apache/commons/io/FileUtils.java delete mode 100644 commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java delete mode 100644 commons-lite/src/main/java/org/apache/commons/io/IOUtils.java delete mode 100644 commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java delete mode 100644 commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java create mode 100644 d2j-base-cmd/build.gradle create mode 100644 d2j-base-cmd/pom.xml rename {dex-tools => d2j-base-cmd}/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java (80%) create mode 100644 d2j-jasmin/build.gradle create mode 100644 d2j-jasmin/pom.xml create mode 100644 d2j-jasmin/src/main/antlr3/com/googlecode/d2j/jasmin/Jasmin.g create mode 100644 d2j-jasmin/src/main/java/com/googlecode/d2j/jasmin/Jar2JasminCmd.java create mode 100644 d2j-jasmin/src/main/java/com/googlecode/d2j/jasmin/Jasmin2JarCmd.java rename dex-tools/src/main/java/com/googlecode/dex2jar/tools/JasminifierClassAdapter.java => d2j-jasmin/src/main/java/com/googlecode/d2j/jasmin/JasminDumper.java (79%) create mode 100644 d2j-jasmin/src/main/java/com/googlecode/d2j/jasmin/Jasmins.java create mode 100644 d2j-smali/build.gradle create mode 100644 d2j-smali/pom.xml create mode 100644 d2j-smali/src/main/antlr3/com/googlecode/d2j/smali/Smali.g create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/Baksmali.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/BaksmaliCmd.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/BaksmaliCodeDumper.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/BaksmaliDexFileVisitor.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/BaksmaliDumpOut.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/BaksmaliDumper.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/Smali.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/SmaliCmd.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/SmaliCodeVisitor.java create mode 100644 d2j-smali/src/main/java/com/googlecode/d2j/smali/Utils.java create mode 100644 d2j-smali/src/test/java/a/SmaliTest.java create mode 100644 d2j-smali/src/test/resources/a.smali delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/Constant.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/LabelAndLocalMapper.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/StmtTraveler.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ToStringUtil.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/TransformerException.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/TypeClass.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/Util.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/Value.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/Constant.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/Local.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/PhiExpr.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/StaticFieldExpr.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/expr/Value.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/GotoStmt.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/IfStmt.java mode change 100644 => 100755 dex-ir/src/main/java/com/googlecode/dex2jar/ir/stmt/Stmt.java rename dex-ir/src/main/java/com/googlecode/dex2jar/ir/{Local.java => stmt/VoidInvokeStmt.java} (53%) create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/AggTransformer.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/BaseLiveAnalyze.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/ConstTransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/DeadCodeTransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/Ir2JRegAssignTransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/JimpleTransformer.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LiveAnalyze.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalRemove.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalSplit.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/LocalType.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/NewTransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/NpeTransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/RemoveConstantFromSSA.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/RemoveLocalFromSSA.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/SSATransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/StatedTransformer.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TopologicalSort.java delete mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TypeAnalyze.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/TypeTransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/UnSSATransformer.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/UniqueQueue.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/VoidInvokeTransformer.java rename dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexFileVisitor.java => dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/an/AnalyzeValue.java (73%) create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/an/BaseAnalyze.java create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/an/SimpleLiveAnalyze.java rename dex-ir/src/main/java/com/googlecode/dex2jar/ir/{ValueBox.java => ts/an/SimpleLiveValue.java} (58%) create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/array/ArrayElementTransformer.java rename dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/{ => array}/ArrayNullPointerTransformer.java (65%) create mode 100644 dex-ir/src/main/java/com/googlecode/dex2jar/ir/ts/array/FillArrayTransformer.java delete mode 100644 dex-ir/src/main/resources/META-INF/LICENSE.txt delete mode 100644 dex-ir/src/main/resources/META-INF/NOTICE.txt create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/AggTransformerTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/BaseTransformerTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ConstTransformerTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/DeadCodeTrnasformerTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/JimpleTransformerTest.java delete mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalRemoverTest.java delete mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/LocalSplitTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/RemoveConstantFromSSATest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/RemoveLocalFromSSATest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/SSATransformerTest.java delete mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TopologicalSortTest.java delete mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TyepAnalyzeTypeRefTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/TypeTransformerTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/UnSSATransformerTransformerTest.java delete mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ZeroTest.java create mode 100644 dex-ir/src/test/java/com/googlecode/dex2jar/ir/test/ZeroTransformerTest.java create mode 100644 dex-reader-api/build.gradle create mode 100644 dex-reader-api/pom.xml create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/DexConstants.java rename {dex-reader/src/main/java/com/googlecode/dex2jar => dex-reader-api/src/main/java/com/googlecode/d2j}/DexException.java (98%) rename {dex-reader/src/main/java/com/googlecode/dex2jar => dex-reader-api/src/main/java/com/googlecode/d2j}/DexLabel.java (83%) rename {dex-reader/src/main/java/com/googlecode/dex2jar => dex-reader-api/src/main/java/com/googlecode/d2j}/DexType.java (93%) rename {dex-reader/src/main/java/com/googlecode/dex2jar => dex-reader-api/src/main/java/com/googlecode/d2j}/Field.java (94%) rename {dex-reader/src/main/java/com/googlecode/dex2jar => dex-reader-api/src/main/java/com/googlecode/d2j}/Method.java (95%) rename dex-reader/src/main/java/com/googlecode/dex2jar/OdexOpcodes.java => dex-reader-api/src/main/java/com/googlecode/d2j/Visibility.java (55%) create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/node/DexAnnotationNode.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/node/DexClassNode.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/node/DexCodeNode.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/node/DexDebugNode.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/node/DexFieldNode.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/node/DexFileNode.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/node/DexMethodNode.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/reader/CFG.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/reader/InstructionFormat.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/reader/InstructionIndexType.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/reader/Op.java rename {dex-reader/src/main/java/com/googlecode/dex2jar => dex-reader-api/src/main/java/com/googlecode/d2j}/visitors/DexAnnotationAble.java (80%) rename {dex-reader/src/main/java/com/googlecode/dex2jar => dex-reader-api/src/main/java/com/googlecode/d2j}/visitors/DexAnnotationVisitor.java (65%) create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/visitors/DexClassVisitor.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/visitors/DexCodeVisitor.java create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/visitors/DexDebugVisitor.java rename dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/OffsetedDataIn.java => dex-reader-api/src/main/java/com/googlecode/d2j/visitors/DexFieldVisitor.java (50%) rename dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileAdapter.java => dex-reader-api/src/main/java/com/googlecode/d2j/visitors/DexFileVisitor.java (58%) create mode 100644 dex-reader-api/src/main/java/com/googlecode/d2j/visitors/DexMethodVisitor.java create mode 100644 dex-reader/build.gradle create mode 100644 dex-reader/src/main/java/com/googlecode/d2j/reader/DexFileReader.java create mode 100644 dex-reader/src/main/java/com/googlecode/d2j/reader/zip/ZipUtil.java rename dex-reader/src/main/java/com/googlecode/{dex2jar => d2j}/util/ASMifierAnnotationV.java (81%) rename dex-reader/src/main/java/com/googlecode/{dex2jar => d2j}/util/ASMifierClassV.java (82%) create mode 100644 dex-reader/src/main/java/com/googlecode/d2j/util/ASMifierCodeV.java rename dex-reader/src/main/java/com/googlecode/{dex2jar => d2j}/util/ASMifierFileV.java (63%) rename dex-reader/src/main/java/com/googlecode/{dex2jar => d2j}/util/ArrayOut.java (93%) rename dex-reader/src/main/java/com/googlecode/{dex2jar => d2j}/util/Escape.java (76%) rename dex-reader/src/main/java/com/googlecode/{dex2jar/reader => d2j/util}/Mutf8.java (90%) rename dex-reader/src/main/java/com/googlecode/{dex2jar => d2j}/util/Out.java (72%) rename dex-reader/src/main/java/com/googlecode/{dex2jar => d2j}/util/Utf8Utils.java (99%) create mode 100644 dex-reader/src/main/java/com/googlecode/d2j/util/zip/AutoSTOREDZipOutputStream.java create mode 100644 dex-reader/src/main/java/com/googlecode/d2j/util/zip/ZipConstants.java create mode 100644 dex-reader/src/main/java/com/googlecode/d2j/util/zip/ZipEntry.java create mode 100644 dex-reader/src/main/java/com/googlecode/d2j/util/zip/ZipFile.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/DexOpcodes.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/Annotation.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/CCZipExtractor.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/Constant.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexAnnotationReader.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexCodeReader.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexDebugInfoReader.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexFileReader.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexInternalOpcode.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/DexOpcodeAdapter.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/OpcodeFormat.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/ZipExtractor.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/ZipInputStreamHack.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/ArrayDataIn.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataIn.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInWrapper.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/DataInputDataIn.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/InputStreamDataIn.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/reader/io/RandomAccessFileInput.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/ASMifierCodeV.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/AbstractDumpDexCodeAdapter.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/DexOpcodeDump.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/Dump.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/util/DumpDexCodeAdapter.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassAdapter.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexClassVisitor.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeAdapter.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexCodeVisitor.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodAdapter.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/EmptyVisitor.java delete mode 100644 dex-reader/src/main/java/com/googlecode/dex2jar/visitors/OdexCodeVisitor.java delete mode 100644 dex-reader/src/main/resources/META-INF/LICENSE.txt delete mode 100644 dex-reader/src/main/resources/META-INF/NOTICE.txt create mode 100644 dex-reader/src/test/java/com/googlecode/d2j/reader/test/AsmfierTest.java create mode 100644 dex-reader/src/test/java/com/googlecode/d2j/reader/test/BadZipEntryFlagTest.java create mode 100644 dex-reader/src/test/java/com/googlecode/d2j/reader/test/SkipDupMethod.java delete mode 100644 dex-reader/src/test/java/com/googlecode/dex2jar/reader/test/BadZipEntryFlagTest.java delete mode 100644 dex-reader/src/test/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStreamHack.java create mode 100644 dex-reader/src/test/resources/i200.dex create mode 100644 dex-tools/build.gradle create mode 100644 dex-tools/open-source-license.txt delete mode 100644 dex-tools/src/main/jars/asm-LICENSE.txt delete mode 100644 dex-tools/src/main/jars/commons-io-LICENSE.txt delete mode 100644 dex-tools/src/main/jars/commons-io-NOTICE.txt delete mode 100644 dex-tools/src/main/jars/dx-NOTICE delete mode 100644 dex-tools/src/main/jars/dx.jar delete mode 100644 dex-tools/src/main/jars/license-jasmin.txt create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/map/AntiObf.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/map/AsmInheritanceClassVisitor.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/map/AutoDetectSourceProcess.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/map/DexInheritanceFileVisitor.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/map/DexMappingAdapter.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/map/InheritanceTree.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/map/ProguardMappingParser.java rename dex-tools/src/main/java/com/{android/signapk/SignApk.java => googlecode/d2j/signapk/AbstractJarSign.java} (56%) create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/signapk/SunJarSignImpl.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/signapk/TinySignImpl.java rename {jar-rename/src/main/java/p/rn => dex-tools/src/main/java/com/googlecode/d2j/tools/jar}/ClassInfo.java (65%) create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/tools/jar/InitOut.java create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/tools/jar/InvocationWeaver.java rename {jar-rename/src/main/java/p/rn/asm => dex-tools/src/main/java/com/googlecode/d2j/tools/jar}/ScanBridgeAdapter.java (77%) create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/tools/jar/WebApp.java rename {jar-rename/src/main/java/p/rn => dex-tools/src/main/java/com/googlecode/d2j}/util/AccUtils.java (93%) create mode 100644 dex-tools/src/main/java/com/googlecode/d2j/util/Mapper.java create mode 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaksmaliBaseDexExceptionHandler.java create mode 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/Dex2jarMultiThreadCmd.java create mode 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/DexRemapCmd.java create mode 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/FixApkCompressMethod.java create mode 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/GenerateCompileStubFromOdex.java delete mode 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jar2Jasmin.java delete mode 100644 dex-tools/src/main/java/com/googlecode/dex2jar/tools/Jasmin2Jar.java delete mode 100644 dex-tools/src/main/resources/META-INF/LICENSE.txt delete mode 100644 dex-tools/src/main/resources/META-INF/NOTICE.txt create mode 100644 dex-tools/src/test/java/com/googlecode/d2j/tools/jar/MethodInvocation.java create mode 100644 dex-tools/src/test/java/com/googlecode/d2j/tools/jar/test/WaveTest.java create mode 100644 dex-tools/src/test/resources/wave.config create mode 100644 dex-tools/src/test/resources/wave.jar create mode 100644 dex-translator/build.gradle rename dex-translator/src/main/java/com/googlecode/{dex2jar => d2j}/asm/LdcOptimizeAdapter.java (60%) create mode 100755 dex-translator/src/main/java/com/googlecode/d2j/converter/IR2JConverter.java create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/converter/J2IRConverter.java create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/dex/BaseDexExceptionHandler.java create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/dex/ClassVisitorFactory.java create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2Asm.java create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2IrAdapter.java create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/dex/Dex2jar.java rename dex-translator/src/main/java/com/googlecode/{dex2jar/v3 => d2j/dex}/DexExceptionHandler.java (75%) create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/dex/DexFix.java create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/dex/ExDex2Asm.java rename dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexMethodVisitor.java => dex-translator/src/main/java/com/googlecode/d2j/dex/V3.java (72%) create mode 100644 dex-translator/src/main/java/com/googlecode/d2j/util/Types.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/asm/FieldAdapter.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/asm/OrderInnerOutterInsnNodeClassAdapter.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/AnnotationNode.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/ClassVisitorFactory.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2AsmAnnotationAdapter.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/Dex2jar.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/DexExceptionHandlerImpl.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/IrMethod2AsmMethod.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/Main.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3ClassAdapter.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3CodeAdapter.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3FieldAdapter.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3InnerClzGather.java delete mode 100644 dex-translator/src/main/java/com/googlecode/dex2jar/v3/V3MethodAdapter.java create mode 100644 dex-translator/src/main/java/org/objectweb/asm/AsmBridge.java delete mode 100644 dex-translator/src/main/resources/META-INF/LICENSE.txt delete mode 100644 dex-translator/src/main/resources/META-INF/NOTICE.txt create mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/BaksmaliTest.java create mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/D2jTest.java create mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/DexTranslatorRunner.java delete mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/DumpTest.java delete mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/I160Test.java create mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/Smali2jTest.java delete mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/UnInitRegisterTest.java delete mode 100644 dex-translator/src/test/java/com/googlecode/dex2jar/test/V3Test.java delete mode 100644 dex-translator/src/test/java/res/ArithmeticRes.java mode change 100644 => 100755 dex-translator/src/test/java/res/OptimizeSynchronized.java delete mode 100644 dex-translator/src/test/java/res/i222AnnotationType.java delete mode 100644 dex-translator/src/test/resources/dexes/i197_badEnclosingClassAnn.dex delete mode 100644 dex-translator/src/test/resources/dx-NOTICE delete mode 100644 dex-translator/src/test/resources/dx.jar create mode 100644 dex-translator/src/test/resources/smalis/0zs.smali create mode 100644 dex-translator/src/test/resources/smalis/goto-first-label.smali create mode 100644 dex-translator/src/test/resources/smalis/int-or-boolean.smali create mode 100644 dex-translator/src/test/resources/smalis/issue-220-219-uninit-reg.smali create mode 100644 dex-translator/src/test/resources/smalis/npe-cause-trap-fail.smali create mode 100644 dex-translator/src/test/resources/smalis/opt-lock.smali create mode 100644 dex-translator/src/test/resources/smalis/useless-new.smali create mode 100644 dex-translator/src/test/resources/smalis/writeString.smali create mode 100644 dex-writer/build.gradle create mode 100644 dex-writer/pom.xml create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/AnnotationWriter.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/CantNotFixContentException.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ClassWriter.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/CodeWriter.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/DexFileWriter.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/DexWriteException.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/FieldWriter.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/MethodWriter.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ann/Alignment.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ann/Idx.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ann/Off.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ev/EncodedAnnotation.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ev/EncodedArray.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/ev/EncodedValue.java rename dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFileVisitor.java => dex-writer/src/main/java/com/googlecode/d2j/dex/writer/insn/Insn.java (51%) create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/insn/JumpOp.java rename dex-reader/src/main/java/com/googlecode/dex2jar/visitors/DexFieldVisitor.java => dex-writer/src/main/java/com/googlecode/d2j/dex/writer/insn/Label.java (66%) create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/insn/OpInsn.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/insn/PreBuildInsn.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/io/ByteBufferOut.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/io/DataOut.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/AnnotationItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/AnnotationSetItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/AnnotationSetRefListItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/AnnotationsDirectoryItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/BaseItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/ClassDataItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/ClassDefItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/CodeItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/ConstPool.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/DebugInfoItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/EncodedArrayItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/FieldIdItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/HeadItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/MapListItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/MethodIdItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/ProtoIdItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/SectionItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/StringDataItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/StringIdItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/TypeIdItem.java create mode 100644 dex-writer/src/main/java/com/googlecode/d2j/dex/writer/item/TypeListItem.java create mode 100644 dex-writer/src/test/java/a/AppWriterTest.java create mode 100644 dex-writer/src/test/java/a/CpStringTest.java delete mode 100644 jar-rename/pom.xml delete mode 100644 jar-rename/src/main/java/p/rn/Scann.java delete mode 100644 jar-rename/src/main/java/p/rn/asm/ScanLibVisitor.java delete mode 100644 jar-rename/src/main/java/p/rn/name/InitOut.java delete mode 100644 jar-rename/src/main/java/p/rn/name/Renamer.java delete mode 100644 jar-rename/src/main/java/p/rn/name/RenamerMain.java delete mode 100644 jar-rename/src/main/java/p/rn/owner/ReOwner.java delete mode 100644 jar-rename/src/main/java/p/rn/owner/WebApp.java delete mode 100644 jar-rename/src/main/java/p/rn/util/FileOut.java delete mode 100644 jar-rename/src/main/java/p/rn/util/FileWalker.java delete mode 100644 jar-rename/src/test/java/p/rn/InitOutTest.java delete mode 100644 jar-rename/src/test/java/p/rn/RenamerTest.java delete mode 100644 jar-rename/src/test/java/p/rn/ScannTest.java delete mode 100644 jar-rename/src/test/java/p/rn/ZipOutTest.java delete mode 100644 jar-rename/src/test/java/p/rn/res/As.java delete mode 100644 jar-rename/src/test/java/p/rn/res/Em.java create mode 100644 settings.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 000000000..3d0a3e58a --- /dev/null +++ b/build.gradle @@ -0,0 +1,58 @@ +allprojects { + apply plugin: 'maven' + apply plugin: 'idea' + apply plugin: 'eclipse' + group = 'com.googlecode.d2j' + version = '2.0' +} + +subprojects { + apply plugin: 'java' + apply plugin: 'maven' + sourceCompatibility = 1.7 + targetCompatibility = 1.7 + + task packageSources(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource + } + artifacts.archives packageSources + repositories { + mavenCentral() + } + +// == support provided scope + configurations { + provided + } + sourceSets { + main { compileClasspath += configurations.provided } + test { compileClasspath += configurations.provided } + } + + test.classpath += configurations.provided +// == end + + tasks.withType(Compile) { + options.encoding = 'UTF-8' + } + dependencies { + testCompile group: 'junit', name: 'junit', version:'4.11' + } + + jar { + manifest { + attributes("Implementation-Title": project.name, + "Implementation-Version": project.version, + "Build-Time": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"), + "Revision": System.env.BUILD_REVISION?System.env.BUILD_REVISION:System.env.MERCURIAL_REVISION?System.env.MERCURIAL_REVISION:"HEAD", + "Build-Number": System.env.BUILD_NUMBER?System.env.BUILD_NUMBER:"-1", + ) + } + from (project.parent.projectDir) { + include 'NOTICE.txt' + include 'LICENSE.txt' + into('META-INF') + } + } +} diff --git a/commons-lite/pom.xml b/commons-lite/pom.xml deleted file mode 100644 index 0877147ae..000000000 --- a/commons-lite/pom.xml +++ /dev/null @@ -1,13 +0,0 @@ - - 4.0.0 - - dex2jar - com.googlecode.dex2jar - 1.1 - - commons-lite - 1.15-SNAPSHOT - Dex Commons Lite - A lightweight implementation of commons-io and commons-codec - diff --git a/commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java b/commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java deleted file mode 100644 index 0ea0772d7..000000000 --- a/commons-lite/src/main/java/org/apache/commons/codec/binary/Hex.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.commons.codec.binary; - -/** - * Get from commons-codec-1.1, Converts hexadecimal Strings. - * - * @since 1.1 - * @author Apache Software Foundation - * @version $Id: Hex.java 1157192 2011-08-12 17:27:38Z ggregory $ - */ -public class Hex { - /** - * Used to build output as Hex - */ - private static final char[] DIGITS_LOWER = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', - 'e', 'f' }; - - /** - * Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order. - * The returned array will be double the length of the passed array, as it takes two characters to represent any - * given byte. - * - * @param data - * a byte[] to convert to Hex characters - * @return A char[] containing hexadecimal characters - */ - public static char[] encodeHex(byte[] data) { - return encodeHex(data, DIGITS_LOWER); - } - - /** - * Converts an array of bytes into an array of characters representing the hexadecimal values of each byte in order. - * The returned array will be double the length of the passed array, as it takes two characters to represent any - * given byte. - * - * @param data - * a byte[] to convert to Hex characters - * @param toDigits - * the output alphabet - * @return A char[] containing hexadecimal characters - * @since 1.4 - */ - protected static char[] encodeHex(byte[] data, char[] toDigits) { - int l = data.length; - char[] out = new char[l << 1]; - // two characters form the hex value. - for (int i = 0, j = 0; i < l; i++) { - out[j++] = toDigits[(0xF0 & data[i]) >>> 4]; - out[j++] = toDigits[0x0F & data[i]]; - } - return out; - } - - /** - * Converts an array of characters representing hexadecimal values into an array of bytes of those same values. The - * returned array will be half the length of the passed array, as it takes two characters to represent any given - * byte. An exception is thrown if the passed char array has an odd number of elements. - * - * @param data - * An array of characters containing hexadecimal digits - * @return A byte array containing binary data decoded from the supplied char array. - * @throws RuntimeException - * Thrown if an odd number or illegal of characters is supplied - */ - public static byte[] decodeHex(char[] data) { - - int len = data.length; - - if ((len & 0x01) != 0) { - throw new RuntimeException("Odd number of characters."); - } - - byte[] out = new byte[len >> 1]; - - // two characters form the hex value. - for (int i = 0, j = 0; j < len; i++) { - int f = toDigit(data[j], j) << 4; - j++; - f = f | toDigit(data[j], j); - j++; - out[i] = (byte) (f & 0xFF); - } - - return out; - } - - /** - * Converts a hexadecimal character to an integer. - * - * @param ch - * A character to convert to an integer digit - * @param index - * The index of the character in the source - * @return An integer - * @throws RuntimeException - * Thrown if ch is an illegal hex character - */ - protected static int toDigit(char ch, int index) { - int digit = Character.digit(ch, 16); - if (digit == -1) { - throw new RuntimeException("Illegal hexadecimal character " + ch + " at index " + index); - } - return digit; - } -} diff --git a/commons-lite/src/main/java/org/apache/commons/collections/Transformer.java b/commons-lite/src/main/java/org/apache/commons/collections/Transformer.java deleted file mode 100644 index 37f98cf38..000000000 --- a/commons-lite/src/main/java/org/apache/commons/collections/Transformer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.commons.collections; - -/** - * Defines a functor interface implemented by classes that transform one - * object into another. - *

- * A Transformer converts the input object to the output object. - * The input object should be left unchanged. - * Transformers are typically used for type conversions, or extracting data - * from an object. - *

- * Standard implementations of common transformers are provided by - * {@link TransformerUtils}. These include method invokation, returning a constant, - * cloning and returning the string value. - * - * @since Commons Collections 1.0 - * @version $Revision: 646777 $ $Date: 2008-04-10 13:33:15 +0100 (Thu, 10 Apr 2008) $ - * - * @author James Strachan - * @author Stephen Colebourne - */ -public interface Transformer { - - /** - * Transforms the input object (leaving it unchanged) into some output object. - * - * @param input the object to be transformed, should be left unchanged - * @return a transformed object - * @throws ClassCastException (runtime) if the input is the wrong class - * @throws IllegalArgumentException (runtime) if the input is invalid - * @throws FunctorException (runtime) if the transform cannot be completed - */ - public Object transform(Object input); - -} diff --git a/commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java b/commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java deleted file mode 100644 index ea6e70b29..000000000 --- a/commons-lite/src/main/java/org/apache/commons/collections/map/LazyMap.java +++ /dev/null @@ -1,40 +0,0 @@ -package org.apache.commons.collections.map; - -import java.util.AbstractMap; -import java.util.Map; -import java.util.Set; - -import org.apache.commons.collections.Transformer; - -public class LazyMap extends AbstractMap { - private Map map; - private Transformer factory; - - public LazyMap(Map map, Transformer factor) { - super(); - this.map = map; - this.factory = factor; - } - - public static Map decorate(Map map, Transformer factory) { - return new LazyMap(map, factory); - } - - @Override - public Set> entrySet() { - throw new UnsupportedOperationException(); - } - - @SuppressWarnings("unchecked") - @Override - public V get(Object key) { - // create value for key if key is not currently in the map - if (map.containsKey(key) == false) { - V value = (V) factory.transform(key); - map.put((K) key, value); - return value; - } - return map.get(key); - } - -} diff --git a/commons-lite/src/main/java/org/apache/commons/io/FileUtils.java b/commons-lite/src/main/java/org/apache/commons/io/FileUtils.java deleted file mode 100644 index 5f35de599..000000000 --- a/commons-lite/src/main/java/org/apache/commons/io/FileUtils.java +++ /dev/null @@ -1,164 +0,0 @@ -package org.apache.commons.io; - -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Set; - -/** - * part of FileUtils from commons-io - * - */ -public class FileUtils { - - public static final String LINE_SEPARATOR; - static { - // avoid security issues - StringWriter buf = new StringWriter(4); - PrintWriter out = new PrintWriter(buf); - out.println(); - LINE_SEPARATOR = buf.toString(); - out.close(); - } - - public static byte[] readFileToByteArray(File file) throws IOException { - InputStream in = null; - try { - in = openInputStream(file); - return IOUtils.toByteArray(in); - } finally { - IOUtils.closeQuietly(in); - } - } - - public static FileInputStream openInputStream(File file) throws IOException { - if (file.exists()) { - if (file.isDirectory()) { - throw new IOException("File '" + file + "' exists but is a directory"); - } - if (file.canRead() == false) { - throw new IOException("File '" + file + "' cannot be read"); - } - } else { - throw new FileNotFoundException("File '" + file + "' does not exist"); - } - return new FileInputStream(file); - } - - public static FileOutputStream openOutputStream(File file) throws IOException { - if (file.exists()) { - if (file.isDirectory()) { - throw new IOException("File '" + file + "' exists but is a directory"); - } - if (file.canWrite() == false) { - throw new IOException("File '" + file + "' cannot be written to"); - } - } else { - File parent = file.getParentFile(); - if (parent != null && parent.exists() == false) { - if (parent.mkdirs() == false) { - throw new IOException("File '" + file + "' could not be created"); - } - } - } - return new FileOutputStream(file); - } - - public static void writeLines(File file, String encoding, Collection lines) throws IOException { - if (lines == null) { - return; - } - OutputStream output = null; - try { - output = openOutputStream(file); - for (Object line : lines) { - if (line != null) { - output.write(line.toString().getBytes(encoding)); - } - output.write(LINE_SEPARATOR.getBytes(encoding)); - } - } finally { - IOUtils.closeQuietly(output); - } - } - - @SuppressWarnings("unchecked") - public static Collection listFiles(File dir, String[] exts, boolean r) { - if (exts.length == 0) { - return Collections.EMPTY_LIST; - } - Set set = new HashSet(exts.length); - for (String ext : exts) { - set.add("." + ext); - } - List list = new ArrayList(); - doFind(dir, set, list, r); - return list; - } - - private static void doFind(File dir, Set exts, List list, boolean r) { - File[] fs = dir.listFiles(); - if (fs == null) { - return; - } - for (File f : fs) { - if (f.isFile()) { - String name = f.getName(); - for (String ext : exts) { - if (name.endsWith(ext)) { - list.add(f); - break; - } - } - } else if (r) { - doFind(f, exts, list, r); - } - } - } - - public static void writeByteArrayToFile(File file, byte[] data) throws IOException { - OutputStream out = null; - try { - out = openOutputStream(file); - out.write(data); - } finally { - IOUtils.closeQuietly(out); - } - } - - public static void writeStringToFile(File file, String str, String encoding) throws IOException { - writeByteArrayToFile(file, str.getBytes(encoding)); - } - - public static String readFileToString(File file, String charset) throws IOException { - return new String(readFileToByteArray(file), charset); - } - - public static List readLines(File file, String encoding) throws IOException { - BufferedReader reader = new BufferedReader(new InputStreamReader(openInputStream(file), encoding)); - try { - List list = new ArrayList(); - String line = reader.readLine(); - while (line != null) { - list.add(line); - line = reader.readLine(); - } - return list; - } finally { - IOUtils.closeQuietly(reader); - } - } -} diff --git a/commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java b/commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java deleted file mode 100644 index 43e4a1d9d..000000000 --- a/commons-lite/src/main/java/org/apache/commons/io/FilenameUtils.java +++ /dev/null @@ -1,16 +0,0 @@ -package org.apache.commons.io; - -public class FilenameUtils { - public static String getBaseName(String n) { - n = n.replace('\\', '/'); - int i = n.lastIndexOf('/'); - if (i >= 0) { - n = n.substring(i + 1); - } - i = n.lastIndexOf('.'); - if (i >= 0) { - n = n.substring(0, i); - } - return n; - } -} diff --git a/commons-lite/src/main/java/org/apache/commons/io/IOUtils.java b/commons-lite/src/main/java/org/apache/commons/io/IOUtils.java deleted file mode 100644 index 77a96b53e..000000000 --- a/commons-lite/src/main/java/org/apache/commons/io/IOUtils.java +++ /dev/null @@ -1,62 +0,0 @@ -package org.apache.commons.io; - -import java.io.ByteArrayOutputStream; -import java.io.Closeable; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -public class IOUtils { - private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; - - public static long copyLarge(InputStream input, OutputStream output) throws IOException { - byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; - long count = 0; - int n = 0; - while (-1 != (n = input.read(buffer))) { - output.write(buffer, 0, n); - count += n; - } - return count; - } - - public static int copy(InputStream input, OutputStream output) throws IOException { - return (int) copyLarge(input, output); - } - - public static byte[] toByteArray(InputStream input) throws IOException { - ByteArrayOutputStream output = new ByteArrayOutputStream(50 * 1024); - copyLarge(input, output); - return output.toByteArray(); - } - - public static void closeQuietly(Closeable closeable) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (IOException ioe) { - // ignore - } - } - - public static void closeQuietly(OutputStream closeable) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (IOException ioe) { - // ignore - } - } - - public static void closeQuietly(InputStream closeable) { - try { - if (closeable != null) { - closeable.close(); - } - } catch (IOException ioe) { - // ignore - } - } -} diff --git a/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java b/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java deleted file mode 100644 index 0f8d38498..000000000 --- a/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/MemoryCacheSeekableStream.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.xmlgraphics.image.codec.util; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * A subclass of SeekableStream that may be used to wrap - * a regular InputStream. Seeking backwards is supported - * by means of an in-memory cache. For greater efficiency, - * FileCacheSeekableStream should be used in - * circumstances that allow the creation of a temporary file. - * - *

The mark() and reset() methods are - * supported. - * - *

This class is not a committed part of the JAI API. It may - * be removed or changed in future releases of JAI. - */ -public final class MemoryCacheSeekableStream extends SeekableStream { - - /** The source input stream. */ - private InputStream src; - - /** Position of first unread byte. */ - private long pointer = 0; - - /** Log_2 of the sector size. */ - private static final int SECTOR_SHIFT = 9; - - /** The sector size. */ - private static final int SECTOR_SIZE = 1 << SECTOR_SHIFT; - - /** A mask to determine the offset within a sector. */ - private static final int SECTOR_MASK = SECTOR_SIZE - 1; - - /** A Vector of source sectors. */ - private List data = new ArrayList(); - - /** Number of sectors stored. */ - int sectors = 0; - - /** Number of bytes read. */ - int length = 0; - - /** True if we've previously reached the end of the source stream */ - boolean foundEOS = false; - - /** - * Constructs a MemoryCacheSeekableStream that takes - * its source data from a regular InputStream. - * Seeking backwards is supported by means of an in-memory cache. - */ - public MemoryCacheSeekableStream(InputStream src) { - this.src = src; - } - - /** - * Ensures that at least pos bytes are cached, - * or the end of the source is reached. The return value - * is equal to the smaller of pos and the - * length of the source stream. - */ - private long readUntil(long pos) throws IOException { - // We've already got enough data cached - if (pos < length) { - return pos; - } - // pos >= length but length isn't getting any bigger, so return it - if (foundEOS) { - return length; - } - - int sector = (int)(pos >> SECTOR_SHIFT); - - // First unread sector - int startSector = length >> SECTOR_SHIFT; - - // Read sectors until the desired sector - for (int i = startSector; i <= sector; i++) { - byte[] buf = new byte[SECTOR_SIZE]; - data.add(buf); - - // Read up to SECTOR_SIZE bytes - int len = SECTOR_SIZE; - int off = 0; - while (len > 0) { - int nbytes = src.read(buf, off, len); - // Found the end-of-stream - if (nbytes == -1) { - foundEOS = true; - return length; - } - off += nbytes; - len -= nbytes; - - // Record new data length - length += nbytes; - } - } - - return length; - } - - /** - * Returns true since all - * MemoryCacheSeekableStream instances support seeking - * backwards. - */ - public boolean canSeekBackwards() { - return true; - } - - /** - * Returns the current offset in this file. - * - * @return the offset from the beginning of the file, in bytes, - * at which the next read occurs. - */ - public long getFilePointer() { - return pointer; - } - - /** - * Sets the file-pointer offset, measured from the beginning of this - * file, at which the next read occurs. - * - * @param pos the offset position, measured in bytes from the - * beginning of the file, at which to set the file - * pointer. - * @exception IOException if pos is less than - * 0 or if an I/O error occurs. - */ - public void seek(long pos) throws IOException { - if (pos < 0) { - throw new IOException("MemoryCacheSeekableStream0"); - } - pointer = pos; - } - - /** - * Reads the next byte of data from the input stream. The value byte is - * returned as an int in the range 0 to - * 255. If no byte is available because the end of the stream - * has been reached, the value -1 is returned. This method - * blocks until input data is available, the end of the stream is detected, - * or an exception is thrown. - * - * @return the next byte of data, or -1 if the end of the - * stream is reached. - */ - public int read() throws IOException { - long next = pointer + 1; - long pos = readUntil(next); - if (pos >= next) { - byte[] buf = - (byte[])data.get((int)(pointer >> SECTOR_SHIFT)); - return buf[(int)(pointer++ & SECTOR_MASK)] & 0xff; - } else { - return -1; - } - } - - /** - * Reads up to len bytes of data from the input stream into - * an array of bytes. An attempt is made to read as many as - * len bytes, but a smaller number may be read, possibly - * zero. The number of bytes actually read is returned as an integer. - * - *

This method blocks until input data is available, end of file is - * detected, or an exception is thrown. - * - *

If b is null, a - * NullPointerException is thrown. - * - *

If off is negative, or len is negative, or - * off+len is greater than the length of the array - * b, then an IndexOutOfBoundsException is - * thrown. - * - *

If len is zero, then no bytes are read and - * 0 is returned; otherwise, there is an attempt to read at - * least one byte. If no byte is available because the stream is at end of - * file, the value -1 is returned; otherwise, at least one - * byte is read and stored into b. - * - *

The first byte read is stored into element b[off], the - * next one into b[off+1], and so on. The number of bytes read - * is, at most, equal to len. Let k be the number of - * bytes actually read; these bytes will be stored in elements - * b[off] through b[off+k-1], - * leaving elements b[off+k] through - * b[off+len-1] unaffected. - * - *

In every case, elements b[0] through - * b[off] and elements b[off+len] through - * b[b.length-1] are unaffected. - * - *

If the first byte cannot be read for any reason other than end of - * file, then an IOException is thrown. In particular, an - * IOException is thrown if the input stream has been closed. - * - * @param b the buffer into which the data is read. - * @param off the start offset in array b - * at which the data is written. - * @param len the maximum number of bytes to read. - * @return the total number of bytes read into the buffer, or - * -1 if there is no more data because the end of - * the stream has been reached. - */ - public int read(byte[] b, int off, int len) throws IOException { - if (b == null) { - throw new NullPointerException(); - } - if ((off < 0) || (len < 0) || (off + len > b.length)) { - throw new IndexOutOfBoundsException(); - } - if (len == 0) { - return 0; - } - - long pos = readUntil(pointer + len); - // End-of-stream - if (pos <= pointer) { - return -1; - } - - byte[] buf = (byte[])data.get((int)(pointer >> SECTOR_SHIFT)); - int nbytes = Math.min(len, SECTOR_SIZE - (int)(pointer & SECTOR_MASK)); - System.arraycopy(buf, (int)(pointer & SECTOR_MASK), - b, off, nbytes); - pointer += nbytes; - return nbytes; - } -} diff --git a/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java b/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java deleted file mode 100644 index 0bac5d12d..000000000 --- a/commons-lite/src/main/java/org/apache/xmlgraphics/image/codec/util/SeekableStream.java +++ /dev/null @@ -1,943 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -/* $Id$ */ - -package org.apache.xmlgraphics.image.codec.util; - -import java.io.DataInput; -import java.io.DataInputStream; -import java.io.EOFException; -import java.io.IOException; -import java.io.InputStream; - -/** - * An abstract subclass of java.io.InputStream that allows seeking - * within the input, similar to the RandomAccessFile class. - * Additionally, the DataInput interface is supported and extended - * to include support for little-endian representations of fundamental data - * types. - * - *

In addition to the familiar methods from InputStream, the - * methods getFilePointer(), seek(), are defined as in - * the RandomAccessFile class. The canSeekBackwards() - * method will return true if it is permissible to seek to a - * position earlier in the stream than the current value of - * getFilePointer(). Some subclasses of - * SeekableStream guarantee the ability to seek backwards while - * others may not offer this feature in the interest of providing greater - * efficiency for those users who do not require it. - * - *

The DataInput interface is supported as well. This included - * the skipBytes() and readFully() methods and a - * variety of read methods for various data types. - * - *

Three classes are provided for the purpose of adapting a standard - * InputStream to the SeekableStream interface. - * ForwardSeekableStream does not allows seeking backwards, but is - * inexpensive to use. FileCacheSeekableStream maintains a copy of - * all of the data read from the input in a temporary file; this file will be - * discarded automatically when the FileSeekableStream is - * finalized, or when the JVM exits normally. - * FileCacheSeekableStream is intended to be reasonably efficient - * apart from the unavoidable use of disk space. In circumstances where the - * creation of a temporary file is not possible, - * MemoryCacheSeekableStream may be used. - * MemoryCacheSeekableStream creates a potentially large in-memory - * buffer to store the stream data and so should be avoided when possible. - * - *

The FileSeekableStream class wraps a File or - * RandomAccessFile. It forwards requests to the real underlying - * file. It performs a limited amount of caching in order to avoid excessive - * I/O costs. - * - *

The SegmentedSeekableStream class performs a different sort - * of function. It creates a SeekableStream from another - * SeekableStream by selecting a series of portions or "segments". - * Each segment starts at a specified location within the source - * SeekableStream and extends for a specified number of bytes. The - * StreamSegmentMapper interface and StreamSegment - * class may be used to compute the segment positions dynamically. - * - *

A convenience methods, wrapInputStream is provided to - * construct a suitable SeekableStream instance whose data is - * supplied by a given InputStream. The caller, by means of the - * canSeekBackwards parameter, determines whether support for - * seeking backwards is required. - * - */ -public abstract class SeekableStream extends InputStream implements DataInput { - -// /** -// * Returns a SeekableStream that will read from a -// * given InputStream, optionally including support -// * for seeking backwards. This is a convenience method that -// * avoids the need to instantiate specific subclasses of -// * SeekableStream depending on the current security -// * model. -// * -// * @param is An InputStream. -// * @param canSeekBackwards true if the ability to seek -// * backwards in the output is required. -// * @return An instance of SeekableStream. -// */ -// public static SeekableStream wrapInputStream(InputStream is, -// boolean canSeekBackwards) { -// SeekableStream stream = null; -// -// if (canSeekBackwards) { -// try { -// stream = new FileCacheSeekableStream(is); -// } catch (Exception e) { -// stream = new MemoryCacheSeekableStream(is); -// } -// } else { -// stream = new ForwardSeekableStream(is); -// } -// return stream; -// } - - // Methods from InputStream - - /** - * Reads the next byte of data from the input stream. The value byte is - * returned as an int in the range 0 to - * 255. If no byte is available because the end of the stream - * has been reached, the value -1 is returned. This method - * blocks until input data is available, the end of the stream is detected, - * or an exception is thrown. - * - *

A subclass must provide an implementation of this method. - * - * @return the next byte of data, or -1 if the end of the - * stream is reached. - * @exception IOException if an I/O error occurs. - */ - public abstract int read() throws IOException; - - /** - * Reads up to len bytes of data from the input stream into - * an array of bytes. An attempt is made to read as many as - * len bytes, but a smaller number may be read, possibly - * zero. The number of bytes actually read is returned as an integer. - * - *

This method blocks until input data is available, end of stream is - * detected, or an exception is thrown. - * - *

If b is null, a - * NullPointerException is thrown. - * - *

If off is negative, or len is negative, or - * off+len is greater than the length of the array - * b, then an IndexOutOfBoundsException is - * thrown. - * - *

If len is zero, then no bytes are read and - * 0 is returned; otherwise, there is an attempt to read at - * least one byte. If no byte is available because the stream is at end of - * stream, the value -1 is returned; otherwise, at least one - * byte is read and stored into b. - * - *

The first byte read is stored into element b[off], the - * next one into b[off+1], and so on. The number of bytes read - * is, at most, equal to len. Let k be the number of - * bytes actually read; these bytes will be stored in elements - * b[off] through b[off+k-1], - * leaving elements b[off+k] through - * b[off+len-1] unaffected. - * - *

In every case, elements b[0] through - * b[off] and elements b[off+len] through - * b[b.length-1] are unaffected. - * - *

If the first byte cannot be read for any reason other than end of - * stream, then an IOException is thrown. In particular, an - * IOException is thrown if the input stream has been closed. - * - *

A subclass must provide an implementation of this method. - * - * @param b the buffer into which the data is read. - * @param off the start offset in array b - * at which the data is written. - * @param len the maximum number of bytes to read. - * @return the total number of bytes read into the buffer, or - * -1 if there is no more data because the end of - * the stream has been reached. - * @exception IOException if an I/O error occurs. - */ - public abstract int read(byte[] b, int off, int len) throws IOException; - - // Implemented in InputStream: - // - // public int read(byte[] b) throws IOException { - // public long skip(long n) throws IOException - // public int available) throws IOException - // public void close() throws IOException; - - /** Marked position, shared by {@link ForwardSeekableStream} */ - protected long markPos = -1L; - - /** - * Marks the current file position for later return using - * the reset() method. - */ - public synchronized void mark(int readLimit) { - try { - markPos = getFilePointer(); - } catch (IOException e) { - markPos = -1L; - } - } - - /** - * Returns the file position to its position at the time of - * the immediately previous call to the mark() - * method. - */ - public synchronized void reset() throws IOException { - if (markPos != -1) { - seek(markPos); - } - } - - /** - * Returns true if marking is supported. - * Marking is automatically supported for SeekableStream - * subclasses that support seeking backeards. Subclasses that do - * not support seeking backwards but do support marking must override - * this method. - */ - public boolean markSupported() { - return canSeekBackwards(); - } - - /** - * Returns true if this object supports calls to - * seek(pos) with an offset pos smaller - * than the current offset, as returned by getFilePointer. - */ - public boolean canSeekBackwards() { - return false; - } - - /** - * Returns the current offset in this stream. - * - * @return the offset from the beginning of the stream, in bytes, - * at which the next read occurs. - * @exception IOException if an I/O error occurs. - */ - public abstract long getFilePointer() throws IOException; - - /** - * Sets the offset, measured from the beginning of this - * stream, at which the next read occurs. - * - *

If canSeekBackwards() returns false, - * then setting pos to an offset smaller than - * the current value of getFilePointer() will have - * no effect. - * - * @param pos the offset position, measured in bytes from the - * beginning of the stream, at which to set the stream - * pointer. - * @exception IOException if pos is less than - * 0 or if an I/O error occurs. - */ - public abstract void seek(long pos) throws IOException; - - // Methods from RandomAccessFile - - /** - * Reads b.length bytes from this stream into the byte - * array, starting at the current stream pointer. This method reads - * repeatedly from the stream until the requested number of bytes are - * read. This method blocks until the requested number of bytes are - * read, the end of the stream is detected, or an exception is thrown. - * - * @param b the buffer into which the data is read. - * @exception EOFException if this stream reaches the end before reading - * all the bytes. - * @exception IOException if an I/O error occurs. - */ - public final void readFully(byte[] b) throws IOException { - readFully(b, 0, b.length); - } - - /** - * Reads exactly len bytes from this stream into the byte - * array, starting at the current stream pointer. This method reads - * repeatedly from the stream until the requested number of bytes are - * read. This method blocks until the requested number of bytes are - * read, the end of the stream is detected, or an exception is thrown. - * - * @param b the buffer into which the data is read. - * @param off the start offset of the data. - * @param len the number of bytes to read. - * @exception EOFException if this stream reaches the end before reading - * all the bytes. - * @exception IOException if an I/O error occurs. - */ - public final void readFully(byte[] b, int off, int len) - throws IOException { - int n = 0; - do { - int count = this.read(b, off + n, len - n); - if (count < 0) { - throw new EOFException(); - } - n += count; - } while (n < len); - } - - // Methods from DataInput, plus little-endian versions - - /** - * Attempts to skip over n bytes of input discarding the - * skipped bytes. - *

- * - * This method may skip over some smaller number of bytes, possibly zero. - * This may result from any of a number of conditions; reaching end of - * stream before n bytes have been skipped is only one - * possibility. This method never throws an EOFException. - * The actual number of bytes skipped is returned. If n - * is negative, no bytes are skipped. - * - * @param n the number of bytes to be skipped. - * @return the actual number of bytes skipped. - * @exception IOException if an I/O error occurs. - */ - public int skipBytes(int n) throws IOException { - if (n <= 0) { - return 0; - } - return (int)skip(n); - } - - /** - * Reads a boolean from this stream. This method reads a - * single byte from the stream, starting at the current stream pointer. - * A value of 0 represents - * false. Any other value represents true. - * This method blocks until the byte is read, the end of the stream - * is detected, or an exception is thrown. - * - * @return the boolean value read. - * @exception EOFException if this stream has reached the end. - * @exception IOException if an I/O error occurs. - */ - public final boolean readBoolean() throws IOException { - int ch = this.read(); - if (ch < 0) { - throw new EOFException(); - } - return (ch != 0); - } - - /** - * Reads a signed eight-bit value from this stream. This method reads a - * byte from the stream, starting from the current stream pointer. - * If the byte read is b, where - * 0 <= b <= 255, - * then the result is: - *

-     *     (byte)(b)
-     * 
- *

- * This method blocks until the byte is read, the end of the stream - * is detected, or an exception is thrown. - * - * @return the next byte of this stream as a signed eight-bit - * byte. - * @exception EOFException if this stream has reached the end. - * @exception IOException if an I/O error occurs. - */ - public final byte readByte() throws IOException { - int ch = this.read(); - if (ch < 0) { - throw new EOFException(); - } - return (byte)(ch); - } - - /** - * Reads an unsigned eight-bit number from this stream. This method reads - * a byte from this stream, starting at the current stream pointer, - * and returns that byte. - *

- * This method blocks until the byte is read, the end of the stream - * is detected, or an exception is thrown. - * - * @return the next byte of this stream, interpreted as an unsigned - * eight-bit number. - * @exception EOFException if this stream has reached the end. - * @exception IOException if an I/O error occurs. - */ - public final int readUnsignedByte() throws IOException { - int ch = this.read(); - if (ch < 0) { - throw new EOFException(); - } - return ch; - } - - /** - * Reads a signed 16-bit number from this stream. - * The method reads two - * bytes from this stream, starting at the current stream pointer. - * If the two bytes read, in order, are - * b1 and b2, where each of the two values is - * between 0 and 255, inclusive, then the - * result is equal to: - *

-     *     (short)((b1 << 8) | b2)
-     * 
- *

- * This method blocks until the two bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next two bytes of this stream, interpreted as a signed - * 16-bit number. - * @exception EOFException if this stream reaches the end before reading - * two bytes. - * @exception IOException if an I/O error occurs. - */ - public final short readShort() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - return (short)((ch1 << 8) + (ch2 << 0)); - } - - /** - * Reads a signed 16-bit number from this stream in little-endian order. - * The method reads two - * bytes from this stream, starting at the current stream pointer. - * If the two bytes read, in order, are - * b1 and b2, where each of the two values is - * between 0 and 255, inclusive, then the - * result is equal to: - *

-     *     (short)((b2 << 8) | b1)
-     * 
- *

- * This method blocks until the two bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next two bytes of this stream, interpreted as a signed - * 16-bit number. - * @exception EOFException if this stream reaches the end before reading - * two bytes. - * @exception IOException if an I/O error occurs. - */ - public final short readShortLE() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - return (short)((ch2 << 8) + (ch1 << 0)); - } - - /** - * Reads an unsigned 16-bit number from this stream. This method reads - * two bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are - * b1 and b2, where - * 0 <= b1, b2 <= 255, - * then the result is equal to: - *

-     *     (b1 << 8) | b2
-     * 
- *

- * This method blocks until the two bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next two bytes of this stream, interpreted as an - * unsigned 16-bit integer. - * @exception EOFException if this stream reaches the end before reading - * two bytes. - * @exception IOException if an I/O error occurs. - */ - public final int readUnsignedShort() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - return (ch1 << 8) + (ch2 << 0); - } - - /** - * Reads an unsigned 16-bit number from this stream in little-endian order. - * This method reads - * two bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are - * b1 and b2, where - * 0 <= b1, b2 <= 255, - * then the result is equal to: - *

-     *     (b2 << 8) | b1
-     * 
- *

- * This method blocks until the two bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next two bytes of this stream, interpreted as an - * unsigned 16-bit integer. - * @exception EOFException if this stream reaches the end before reading - * two bytes. - * @exception IOException if an I/O error occurs. - */ - public final int readUnsignedShortLE() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - return (ch2 << 8) + (ch1 << 0); - } - - /** - * Reads a Unicode character from this stream. This method reads two - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are - * b1 and b2, where - * 0 <= b1, b2 <= 255, - * then the result is equal to: - *

-     *     (char)((b1 << 8) | b2)
-     * 
- *

- * This method blocks until the two bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next two bytes of this stream as a Unicode character. - * @exception EOFException if this stream reaches the end before reading - * two bytes. - * @exception IOException if an I/O error occurs. - */ - public final char readChar() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - return (char)((ch1 << 8) + (ch2 << 0)); - } - - /** - * Reads a Unicode character from this stream in little-endian order. - * This method reads two - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are - * b1 and b2, where - * 0 <= b1, b2 <= 255, - * then the result is equal to: - *

-     *     (char)((b2 << 8) | b1)
-     * 
- *

- * This method blocks until the two bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next two bytes of this stream as a Unicode character. - * @exception EOFException if this stream reaches the end before reading - * two bytes. - * @exception IOException if an I/O error occurs. - */ - public final char readCharLE() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - if ((ch1 | ch2) < 0) { - throw new EOFException(); - } - return (char)((ch2 << 8) + (ch1 << 0)); - } - - /** - * Reads a signed 32-bit integer from this stream. This method reads 4 - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are b1, - * b2, b3, and b4, where - * 0 <= b1, b2, b3, b4 <= 255, - * then the result is equal to: - *

-     *     (b1 << 24) | (b2 << 16) + (b3 << 8) + b4
-     * 
- *

- * This method blocks until the four bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next four bytes of this stream, interpreted as an - * int. - * @exception EOFException if this stream reaches the end before reading - * four bytes. - * @exception IOException if an I/O error occurs. - */ - public final int readInt() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - int ch3 = this.read(); - int ch4 = this.read(); - if ((ch1 | ch2 | ch3 | ch4) < 0) { - throw new EOFException(); - } - return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); - } - - /** - * Reads a signed 32-bit integer from this stream in little-endian order. - * This method reads 4 - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are b1, - * b2, b3, and b4, where - * 0 <= b1, b2, b3, b4 <= 255, - * then the result is equal to: - *

-     *     (b4 << 24) | (b3 << 16) + (b2 << 8) + b1
-     * 
- *

- * This method blocks until the four bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next four bytes of this stream, interpreted as an - * int. - * @exception EOFException if this stream reaches the end before reading - * four bytes. - * @exception IOException if an I/O error occurs. - */ - public final int readIntLE() throws IOException { - int ch1 = this.read(); - int ch2 = this.read(); - int ch3 = this.read(); - int ch4 = this.read(); - if ((ch1 | ch2 | ch3 | ch4) < 0) { - throw new EOFException(); - } - return ((ch4 << 24) + (ch3 << 16) + (ch2 << 8) + (ch1 << 0)); - } - - /** - * Reads an unsigned 32-bit integer from this stream. This method reads 4 - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are b1, - * b2, b3, and b4, where - * 0 <= b1, b2, b3, b4 <= 255, - * then the result is equal to: - *

-     *     (b1 << 24) | (b2 << 16) + (b3 << 8) + b4
-     * 
- *

- * This method blocks until the four bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next four bytes of this stream, interpreted as a - * long. - * @exception EOFException if this stream reaches the end before reading - * four bytes. - * @exception IOException if an I/O error occurs. - */ - public final long readUnsignedInt() throws IOException { - long ch1 = this.read(); - long ch2 = this.read(); - long ch3 = this.read(); - long ch4 = this.read(); - if ((ch1 | ch2 | ch3 | ch4) < 0) { - throw new EOFException(); - } - return ((ch1 << 24) + (ch2 << 16) + (ch3 << 8) + (ch4 << 0)); - } - - private byte[] ruileBuf = new byte[4]; - - /** - * Reads an unsigned 32-bit integer from this stream in little-endian - * order. This method reads 4 - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are b1, - * b2, b3, and b4, where - * 0 <= b1, b2, b3, b4 <= 255, - * then the result is equal to: - *

-     *     (b4 << 24) | (b3 << 16) + (b2 << 8) + b1
-     * 
- *

- * This method blocks until the four bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next four bytes of this stream, interpreted as a - * long. - * @exception EOFException if this stream reaches the end before reading - * four bytes. - * @exception IOException if an I/O error occurs. - */ - public final long readUnsignedIntLE() throws IOException { - this.readFully(ruileBuf); - long ch1 = (ruileBuf[0] & 0xff); - long ch2 = (ruileBuf[1] & 0xff); - long ch3 = (ruileBuf[2] & 0xff); - long ch4 = (ruileBuf[3] & 0xff); - - return ((ch4 << 24) + (ch3 << 16) + (ch2 << 8) + (ch1 << 0)); - } - - /** - * Reads a signed 64-bit integer from this stream. This method reads eight - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are - * b1, b2, b3, - * b4, b5, b6, - * b7, and b8, where: - *

-     *     0 <= b1, b2, b3, b4, b5, b6, b7, b8 <=255,
-     * 
- *

- * then the result is equal to: - *

-     *     ((long)b1 << 56) + ((long)b2 << 48)
-     *     + ((long)b3 << 40) + ((long)b4 << 32)
-     *     + ((long)b5 << 24) + ((long)b6 << 16)
-     *     + ((long)b7 << 8) + b8
-     * 
- *

- * This method blocks until the eight bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next eight bytes of this stream, interpreted as a - * long. - * @exception EOFException if this stream reaches the end before reading - * eight bytes. - * @exception IOException if an I/O error occurs. - */ - public final long readLong() throws IOException { - return ((long)(readInt()) << 32) + (readInt() & 0xFFFFFFFFL); - } - - /** - * Reads a signed 64-bit integer from this stream in little-endian - * order. This method reads eight - * bytes from the stream, starting at the current stream pointer. - * If the bytes read, in order, are - * b1, b2, b3, - * b4, b5, b6, - * b7, and b8, where: - *

-     *     0 <= b1, b2, b3, b4, b5, b6, b7, b8 <=255,
-     * 
- *

- * then the result is equal to: - *

-     *     ((long)b1 << 56) + ((long)b2 << 48)
-     *     + ((long)b3 << 40) + ((long)b4 << 32)
-     *     + ((long)b5 << 24) + ((long)b6 << 16)
-     *     + ((long)b7 << 8) + b8
-     * 
- *

- * This method blocks until the eight bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next eight bytes of this stream, interpreted as a - * long. - * @exception EOFException if this stream reaches the end before reading - * eight bytes. - * @exception IOException if an I/O error occurs. - */ - public final long readLongLE() throws IOException { - int i1 = readIntLE(); - int i2 = readIntLE(); - return ((long)i2 << 32) + (i1 & 0xFFFFFFFFL); - } - - /** - * Reads a float from this stream. This method reads an - * int value, starting at the current stream pointer, - * as if by the readInt method - * and then converts that int to a float - * using the intBitsToFloat method in class - * Float. - *

- * This method blocks until the four bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next four bytes of this stream, interpreted as a - * float. - * @exception EOFException if this stream reaches the end before reading - * four bytes. - * @exception IOException if an I/O error occurs. - */ - public final float readFloat() throws IOException { - return Float.intBitsToFloat(readInt()); - } - - /** - * Reads a float from this stream in little-endian order. - * This method reads an - * int value, starting at the current stream pointer, - * as if by the readInt method - * and then converts that int to a float - * using the intBitsToFloat method in class - * Float. - *

- * This method blocks until the four bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next four bytes of this stream, interpreted as a - * float. - * @exception EOFException if this stream reaches the end before reading - * four bytes. - * @exception IOException if an I/O error occurs. - */ - public final float readFloatLE() throws IOException { - return Float.intBitsToFloat(readIntLE()); - } - - /** - * Reads a double from this stream. This method reads a - * long value, starting at the current stream pointer, - * as if by the readLong method - * and then converts that long to a double - * using the longBitsToDouble method in - * class Double. - *

- * This method blocks until the eight bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next eight bytes of this stream, interpreted as a - * double. - * @exception EOFException if this stream reaches the end before reading - * eight bytes. - * @exception IOException if an I/O error occurs. - */ - public final double readDouble() throws IOException { - return Double.longBitsToDouble(readLong()); - } - - /** - * Reads a double from this stream in little-endian order. - * This method reads a - * long value, starting at the current stream pointer, - * as if by the readLong method - * and then converts that long to a double - * using the longBitsToDouble method in - * class Double. - *

- * This method blocks until the eight bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return the next eight bytes of this stream, interpreted as a - * double. - * @exception EOFException if this stream reaches the end before reading - * eight bytes. - * @exception IOException if an I/O error occurs. - */ - public final double readDoubleLE() throws IOException { - return Double.longBitsToDouble(readLongLE()); - } - - /** - * Reads the next line of text from this stream. This method successively - * reads bytes from the stream, starting at the current stream pointer, - * until it reaches a line terminator or the end - * of the stream. Each byte is converted into a character by taking the - * byte's value for the lower eight bits of the character and setting the - * high eight bits of the character to zero. This method does not, - * therefore, support the full Unicode character set. - * - *

A line of text is terminated by a carriage-return character - * ('\r'), a newline character ('\n'), a - * carriage-return character immediately followed by a newline character, - * or the end of the stream. Line-terminating characters are discarded and - * are not included as part of the string returned. - * - *

This method blocks until a newline character is read, a carriage - * return and the byte following it are read (to see if it is a newline), - * the end of the stream is reached, or an exception is thrown. - * - * @return the next line of text from this stream, or null if end - * of stream is encountered before even one byte is read. - * @exception IOException if an I/O error occurs. - */ - public final String readLine() throws IOException { - StringBuffer input = new StringBuffer(); - int c = -1; - boolean eol = false; - - while (!eol) { - c = read(); - switch (c) { - case -1: - case '\n': - eol = true; - break; - case '\r': - eol = true; - long cur = getFilePointer(); - if ((read()) != '\n') { - seek(cur); - } - break; - default: - input.append((char)c); - break; - } - } - - if ((c == -1) && (input.length() == 0)) { - return null; - } - return input.toString(); - } - - /** - * Reads in a string from this stream. The string has been encoded - * using a modified UTF-8 format. - *

- * The first two bytes are read, starting from the current stream - * pointer, as if by - * readUnsignedShort. This value gives the number of - * following bytes that are in the encoded string, not - * the length of the resulting string. The following bytes are then - * interpreted as bytes encoding characters in the UTF-8 format - * and are converted into characters. - *

- * This method blocks until all the bytes are read, the end of the - * stream is detected, or an exception is thrown. - * - * @return a Unicode string. - * @exception EOFException if this stream reaches the end before - * reading all the bytes. - * @exception IOException if an I/O error occurs. - * @exception java.io.UTFDataFormatException if the bytes do not represent - * valid UTF-8 encoding of a Unicode string. - */ - public final String readUTF() throws IOException { - return DataInputStream.readUTF(this); - } - - /** - * Releases any system resources associated with this stream - * by calling the close() method. - */ - protected void finalize() throws Throwable { - super.finalize(); - close(); - } -} diff --git a/d2j-base-cmd/build.gradle b/d2j-base-cmd/build.gradle new file mode 100644 index 000000000..85b5ae840 --- /dev/null +++ b/d2j-base-cmd/build.gradle @@ -0,0 +1,4 @@ +description = 'a simple cmd parser' + +dependencies { +} diff --git a/d2j-base-cmd/pom.xml b/d2j-base-cmd/pom.xml new file mode 100644 index 000000000..2d3cd1bce --- /dev/null +++ b/d2j-base-cmd/pom.xml @@ -0,0 +1,12 @@ + + 4.0.0 + + + com.googlecode.d2j + dex2jar + 2.0 + + d2j-base-cmd + 2.0-SNAPSHOT + diff --git a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java b/d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java similarity index 80% rename from dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java rename to d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java index f30b0893c..3a82eac53 100644 --- a/dex-tools/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java +++ b/d2j-base-cmd/src/main/java/com/googlecode/dex2jar/tools/BaseCmd.java @@ -17,21 +17,79 @@ package com.googlecode.dex2jar.tools; import java.io.File; +import java.io.IOException; import java.io.PrintWriter; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; +import java.net.URI; +import java.net.URISyntaxException; +import java.nio.file.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.spi.FileSystemProvider; +import java.util.*; public abstract class BaseCmd { + public static String getBaseName(String fn) { + int x = fn.lastIndexOf('.'); + return x >= 0 ? fn.substring(0, x) : fn; + } + public static String getBaseName(Path fn) { + return getBaseName(fn.getFileName().toString()); + } + + public interface FileVisitorX { + void visitFile(Path file, Path relative) throws IOException; + } + + public static void walkFileTreeX(final Path base, final FileVisitorX fv) throws IOException { + Files.walkFileTree(base, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { + fv.visitFile(file, base.relativize(file)); + return super.visitFile(file, attrs); + } + }); + } + + public static void walkJarOrDir(final Path in, final FileVisitorX fv) throws IOException { + if (Files.isDirectory(in)) { + walkFileTreeX(in, fv); + } else { + try (FileSystem inputFileSystem = openZip(in)) { + walkFileTreeX(inputFileSystem.getPath("/"), fv); + } + } + } + + public static FileSystem createZip(Path output) throws IOException { + Map env = new HashMap<>(); + env.put("create", "true"); + Files.deleteIfExists(output); + if (output.getParent() != null) { + Files.createDirectories(output.getParent()); + } + for (FileSystemProvider p : FileSystemProvider.installedProviders()) { + String s = p.getScheme(); + if ("jar".equals(s) || "zip".equalsIgnoreCase(s)) { + return p.newFileSystem(output, env); + } + } + throw new IOException("cant find zipfs support"); + } + + public static FileSystem openZip(Path in) throws IOException { + for (FileSystemProvider p : FileSystemProvider.installedProviders()) { + String s = p.getScheme(); + if ("jar".equals(s) || "zip".equalsIgnoreCase(s)) { + return p.newFileSystem(in, new HashMap()); + } + } + throw new IOException("cant find zipfs support"); + } + @SuppressWarnings("serial") protected static class HelpException extends RuntimeException { @@ -47,7 +105,7 @@ public HelpException(String message) { @Retention(value = RetentionPolicy.RUNTIME) @Target(value = { ElementType.FIELD }) - static protected @interface Opt { + static public @interface Opt { String argName() default ""; String description(); @@ -88,7 +146,7 @@ public String getOptAndLongOpt() { @Retention(value = RetentionPolicy.RUNTIME) @Target(value = { ElementType.TYPE }) - static protected @interface Syntax { + static public @interface Syntax { String cmd(); @@ -111,6 +169,7 @@ public String getOptAndLongOpt() { private boolean printHelp = false; protected String remainingArgs[]; + protected String orginalArgs[]; public BaseCmd() { } @@ -166,6 +225,9 @@ protected Object convert(String value, Class type) { if (type.equals(File.class)) { return new File(value); } + if (type.equals(Path.class)) { + return new File(value).getPath(); + } try { type.asSubclass(Enum.class); return Enum.valueOf(type, value); @@ -255,7 +317,21 @@ protected void initOptions() { initOptionFromClass(this.getClass()); } + public static void main(String... args) throws ClassNotFoundException, IllegalAccessException, + InstantiationException { + if (args.length < 1) { + System.err.println("d2j-run [args]"); + return; + } + Class clz = Class.forName(args[0]); + BaseCmd baseCmd = (BaseCmd) clz.newInstance(); + String newArgs[] = new String[args.length - 1]; + System.arraycopy(args, 1, newArgs, 0, newArgs.length); + baseCmd.doMain(newArgs); + } + protected void parseSetArgs(String... args) throws IllegalArgumentException, IllegalAccessException { + this.orginalArgs = args; List remainsOptions = new ArrayList(); Set