Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: skylot/jadx
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.3.5
Choose a base ref
...
head repository: skylot/jadx
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.4.0
Choose a head ref
  • 16 commits
  • 199 files changed
  • 4 contributors

Commits on Apr 21, 2022

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    1832f2a View commit details

Commits on Apr 24, 2022

  1. fix(gui): resolve NPE on project save (#1463)(PR #1464)

    * fix(gui): NullPointerException on project save
    
    * chore(gui): ensure MainWindow.project is never null
    * ensure `files` in `ProjectData` in not null
    
    Co-authored-by: Skylot <[email protected]>
    jpstotz and skylot authored Apr 24, 2022
    Copy the full SHA
    4586015 View commit details

Commits on Apr 25, 2022

  1. Copy the full SHA
    e02434d View commit details

Commits on Apr 26, 2022

  1. feat: allow to include/exclude dependencies when saving with class fi…

    …lter (#1466)(PR #1467)
    
    * feat: Add option to include/exclude dependencies when saving
    * fix save skip for class depencencies
    
    Co-authored-by: Skylot <[email protected]>
    NASGregorio and skylot authored Apr 26, 2022
    Copy the full SHA
    357706b View commit details
  2. Copy the full SHA
    a505534 View commit details
  3. chore: update dependencies

    skylot committed Apr 26, 2022
    Copy the full SHA
    3366bf3 View commit details
  4. Copy the full SHA
    a71b3a7 View commit details

Commits on Apr 29, 2022

  1. Copy the full SHA
    a717392 View commit details

Commits on May 8, 2022

  1. fix(gui): editor theme loading and error/fallback handling improved (#…

    …1476)(PR #1478)
    
    * fix(gui): editor theme loading and error/fallback handling improved
    * Update jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
    
    Co-authored-by: skylot <[email protected]>
    jpstotz and skylot authored May 8, 2022
    Copy the full SHA
    e784c7f View commit details
  2. Copy the full SHA
    a06df18 View commit details

Commits on May 10, 2022

  1. Copy the full SHA
    65ade37 View commit details

Commits on May 18, 2022

  1. feat(gui): disk code cache and search rewrite (PR #1483)

    * feat: implement disk code cache
    * feat: rewrite code metadata handling, remove code index
    * feat: rewrite search
    * fix: code cleanup and fixes for previous commits
    * feat: run code search in parallel
    * fix: reset code strings cache on low memory, code cleanup
    * fix: include input files timestamp into code hash
    skylot authored May 18, 2022
    Copy the full SHA
    0606c90 View commit details

Commits on May 19, 2022

  1. fix(cli): don't ignore critical errors (#1150)

    Thrown java.lang.Error was ignored and not logged.
    skylot committed May 19, 2022
    Copy the full SHA
    49137c9 View commit details

Commits on May 20, 2022

  1. Copy the full SHA
    e4b19ab View commit details
  2. Copy the full SHA
    7b1c7b9 View commit details
  3. Copy the full SHA
    21e94d8 View commit details
Showing with 5,706 additions and 3,224 deletions.
  1. +2 −1 .gitignore
  2. +2 −2 build.gradle
  3. +1 −1 jadx-cli/src/main/java/jadx/cli/JadxCLI.java
  4. +1 −1 jadx-core/build.gradle
  5. +0 −65 jadx-core/src/main/java/jadx/api/CodePosition.java
  6. +10 −2 jadx-core/src/main/java/jadx/api/ICodeCache.java
  7. +3 −4 jadx-core/src/main/java/jadx/api/ICodeInfo.java
  8. +17 −5 jadx-core/src/main/java/jadx/api/ICodeWriter.java
  9. +33 −0 jadx-core/src/main/java/jadx/api/JadxArgs.java
  10. +17 −13 jadx-core/src/main/java/jadx/api/JadxArgsValidator.java
  11. +96 −67 jadx-core/src/main/java/jadx/api/JadxDecompiler.java
  12. +61 −67 jadx-core/src/main/java/jadx/api/JavaClass.java
  13. +0 −5 jadx-core/src/main/java/jadx/api/JavaField.java
  14. +1 −6 jadx-core/src/main/java/jadx/api/JavaMethod.java
  15. +0 −2 jadx-core/src/main/java/jadx/api/JavaNode.java
  16. +0 −5 jadx-core/src/main/java/jadx/api/JavaPackage.java
  17. +13 −25 jadx-core/src/main/java/jadx/api/JavaVariable.java
  18. +0 −5 jadx-core/src/main/java/jadx/api/data/annotations/ICodeRawOffset.java
  19. +0 −57 jadx-core/src/main/java/jadx/api/data/annotations/VarDeclareRef.java
  20. +0 −98 jadx-core/src/main/java/jadx/api/data/annotations/VarRef.java
  21. +3 −3 jadx-core/src/main/java/jadx/api/data/impl/JadxCodeRef.java
  22. +10 −14 jadx-core/src/main/java/jadx/api/impl/AnnotatedCodeInfo.java
  23. +40 −38 jadx-core/src/main/java/jadx/api/impl/AnnotatedCodeWriter.java
  24. +49 −0 jadx-core/src/main/java/jadx/api/impl/DelegateCodeCache.java
  25. +28 −2 jadx-core/src/main/java/jadx/api/impl/InMemoryCodeCache.java
  26. +20 −1 jadx-core/src/main/java/jadx/api/impl/NoOpCodeCache.java
  27. +5 −8 jadx-core/src/main/java/jadx/api/impl/SimpleCodeInfo.java
  28. +11 −6 jadx-core/src/main/java/jadx/api/impl/SimpleCodeWriter.java
  29. +16 −0 jadx-core/src/main/java/jadx/api/metadata/ICodeAnnotation.java
  30. +59 −0 jadx-core/src/main/java/jadx/api/metadata/ICodeMetadata.java
  31. +7 −0 jadx-core/src/main/java/jadx/api/metadata/ICodeNodeRef.java
  32. +8 −3 jadx-core/src/main/java/jadx/api/{data → metadata}/annotations/InsnCodeOffset.java
  33. +39 −0 jadx-core/src/main/java/jadx/api/metadata/annotations/NodeDeclareRef.java
  34. +147 −0 jadx-core/src/main/java/jadx/api/metadata/annotations/VarNode.java
  35. +68 −0 jadx-core/src/main/java/jadx/api/metadata/annotations/VarRef.java
  36. +141 −0 jadx-core/src/main/java/jadx/api/metadata/impl/CodeMetadataStorage.java
  37. +38 −0 jadx-core/src/main/java/jadx/api/utils/CodeUtils.java
  38. +4 −0 jadx-core/src/main/java/jadx/core/ProcessClass.java
  39. +14 −7 jadx-core/src/main/java/jadx/core/codegen/InsnGen.java
  40. +3 −3 jadx-core/src/main/java/jadx/core/codegen/MethodGen.java
  41. +35 −24 jadx-core/src/main/java/jadx/core/codegen/NameGen.java
  42. +6 −5 jadx-core/src/main/java/jadx/core/codegen/RegionGen.java
  43. +8 −5 jadx-core/src/main/java/jadx/core/codegen/json/JsonCodeGen.java
  44. +1 −0 jadx-core/src/main/java/jadx/core/dex/attributes/AFlag.java
  45. +0 −4 jadx-core/src/main/java/jadx/core/dex/attributes/ILineAttributeNode.java
  46. +8 −18 jadx-core/src/main/java/jadx/core/dex/attributes/nodes/LineAttrNode.java
  47. +26 −17 jadx-core/src/main/java/jadx/core/dex/instructions/args/ArgType.java
  48. +6 −6 jadx-core/src/main/java/jadx/core/dex/instructions/args/CodeVar.java
  49. +6 −1 jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
  50. +5 −0 jadx-core/src/main/java/jadx/core/dex/nodes/FieldNode.java
  51. +2 −1 jadx-core/src/main/java/jadx/core/dex/nodes/ICodeNode.java
  52. +5 −0 jadx-core/src/main/java/jadx/core/dex/nodes/MethodNode.java
  53. +9 −0 jadx-core/src/main/java/jadx/core/dex/nodes/utils/MethodUtils.java
  54. +10 −0 jadx-core/src/main/java/jadx/core/dex/regions/conditions/IfCondition.java
  55. +3 −1 jadx-core/src/main/java/jadx/core/dex/visitors/MoveInlineVisitor.java
  56. +18 −1 jadx-core/src/main/java/jadx/core/dex/visitors/debuginfo/DebugInfoAttachVisitor.java
  57. +71 −51 jadx-core/src/main/java/jadx/core/dex/visitors/regions/IfRegionVisitor.java
  58. +4 −1 jadx-core/src/main/java/jadx/core/dex/visitors/regions/TernaryMod.java
  59. +24 −3 jadx-core/src/main/java/jadx/core/utils/BlockUtils.java
  60. +3 −3 jadx-core/src/main/java/jadx/core/utils/CodeGenUtils.java
  61. +79 −11 jadx-core/src/main/java/jadx/core/utils/RegionUtils.java
  62. +44 −8 jadx-core/src/main/java/jadx/core/utils/files/FileUtils.java
  63. +1 −1 jadx-core/src/test/java/jadx/api/JadxArgsValidatorOutDirsTest.java
  64. +18 −0 jadx-core/src/test/java/jadx/api/JadxDecompilerTest.java
  65. +12 −12 jadx-core/src/test/java/jadx/tests/api/IntegrationTest.java
  66. +3 −3 jadx-core/src/test/java/jadx/tests/api/utils/assertj/JadxClassNodeAssertions.java
  67. +4 −4 jadx-core/src/test/java/jadx/tests/api/utils/assertj/JadxCodeInfoAssertions.java
  68. +33 −41 jadx-core/src/test/java/jadx/tests/external/BaseExternalTest.java
  69. +1 −0 jadx-core/src/test/java/jadx/tests/integration/conditions/TestBitwiseAnd.java
  70. +1 −0 jadx-core/src/test/java/jadx/tests/integration/conditions/TestConditions14.java
  71. +160 −0 jadx-core/src/test/java/jadx/tests/integration/conditions/TestIfCodeStyle.java
  72. +11 −12 jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestLineNumbers.java
  73. +6 −7 jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestLineNumbers2.java
  74. +1 −1 jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestLineNumbers3.java
  75. +4 −2 jadx-core/src/test/java/jadx/tests/integration/debuginfo/TestReturnSourceLine.java
  76. +39 −0 jadx-core/src/test/java/jadx/tests/integration/java8/TestLambdaExtVar.java
  77. +6 −14 jadx-core/src/test/java/jadx/tests/integration/loops/TestSequentialLoops.java
  78. +66 −0 jadx-core/src/test/java/jadx/tests/integration/others/TestCodeMetadata.java
  79. +37 −0 jadx-core/src/test/java/jadx/tests/integration/others/TestMoveInline.java
  80. +4 −2 jadx-core/src/test/java/jadx/tests/integration/trycatch/TestLoopInTryCatch.java
  81. +27 −11 jadx-core/src/test/java/jadx/tests/integration/variables/TestVariablesDeclAnnotation.java
  82. BIN jadx-core/src/test/resources/test-samples/hello.dex
  83. +354 −0 jadx-core/src/test/smali/conditions/TestIfCodeStyle.smali
  84. +44 −0 jadx-core/src/test/smali/others/TestMoveInline.smali
  85. +1 −1 jadx-core/src/test/smali/trycatch/TestLoopInTryCatch.smali
  86. +6 −4 jadx-gui/build.gradle
  87. +83 −12 jadx-gui/src/main/java/jadx/gui/JadxWrapper.java
  88. +2 −20 jadx-gui/src/main/java/jadx/gui/device/debugger/smali/SmaliWriter.java
  89. +67 −59 jadx-gui/src/main/java/jadx/gui/jobs/BackgroundExecutor.java
  90. +7 −0 jadx-gui/src/main/java/jadx/gui/jobs/Cancelable.java
  91. +27 −0 jadx-gui/src/main/java/jadx/gui/jobs/CancelableBackgroundTask.java
  92. +11 −10 jadx-gui/src/main/java/jadx/gui/jobs/DecompileTask.java
  93. +2 −2 jadx-gui/src/main/java/jadx/gui/jobs/ExportTask.java
  94. +22 −2 jadx-gui/src/main/java/jadx/gui/jobs/IBackgroundTask.java
  95. +8 −0 jadx-gui/src/main/java/jadx/gui/jobs/ITaskProgress.java
  96. +0 −110 jadx-gui/src/main/java/jadx/gui/jobs/IndexService.java
  97. +0 −94 jadx-gui/src/main/java/jadx/gui/jobs/IndexTask.java
  98. +61 −0 jadx-gui/src/main/java/jadx/gui/jobs/SimpleTask.java
  99. +39 −0 jadx-gui/src/main/java/jadx/gui/jobs/TaskProgress.java
  100. +1 −1 jadx-gui/src/main/java/jadx/gui/jobs/TaskStatus.java
  101. +6 −4 jadx-gui/src/main/java/jadx/gui/plugins/quark/QuarkReportNode.java
  102. +1 −6 jadx-gui/src/main/java/jadx/gui/plugins/quark/QuarkReportPanel.java
  103. +27 −0 jadx-gui/src/main/java/jadx/gui/search/ISearchMethod.java
  104. +16 −0 jadx-gui/src/main/java/jadx/gui/search/ISearchProvider.java
  105. +40 −0 jadx-gui/src/main/java/jadx/gui/search/SearchJob.java
  106. +70 −0 jadx-gui/src/main/java/jadx/gui/search/SearchSettings.java
  107. +132 −0 jadx-gui/src/main/java/jadx/gui/search/SearchTask.java
  108. +44 −0 jadx-gui/src/main/java/jadx/gui/search/providers/BaseSearchProvider.java
  109. +46 −0 jadx-gui/src/main/java/jadx/gui/search/providers/ClassSearchProvider.java
  110. +106 −0 jadx-gui/src/main/java/jadx/gui/search/providers/CodeSearchProvider.java
  111. +73 −52 ...ain/java/jadx/gui/{utils/search/CommentsIndex.java → search/providers/CommentSearchProvider.java}
  112. +56 −0 jadx-gui/src/main/java/jadx/gui/search/providers/FieldSearchProvider.java
  113. +58 −0 jadx-gui/src/main/java/jadx/gui/search/providers/MergedSearchProvider.java
  114. +57 −0 jadx-gui/src/main/java/jadx/gui/search/providers/MethodSearchProvider.java
  115. +84 −94 ...in/java/jadx/gui/{utils/search/ResourceIndex.java → search/providers/ResourceSearchProvider.java}
  116. +36 −3 jadx-gui/src/main/java/jadx/gui/settings/JadxSettings.java
  117. +20 −2 jadx-gui/src/main/java/jadx/gui/settings/JadxSettingsWindow.java
  118. +3 −2 jadx-gui/src/main/java/jadx/gui/settings/data/ProjectData.java
  119. +6 −4 jadx-gui/src/main/java/jadx/gui/treemodel/ApkSignature.java
  120. +10 −27 jadx-gui/src/main/java/jadx/gui/treemodel/CodeNode.java
  121. +21 −20 jadx-gui/src/main/java/jadx/gui/treemodel/JClass.java
  122. +21 −6 jadx-gui/src/main/java/jadx/gui/treemodel/JField.java
  123. +38 −6 jadx-gui/src/main/java/jadx/gui/treemodel/JMethod.java
  124. +16 −30 jadx-gui/src/main/java/jadx/gui/treemodel/JNode.java
  125. +1 −13 jadx-gui/src/main/java/jadx/gui/treemodel/JPackage.java
  126. +1 −8 jadx-gui/src/main/java/jadx/gui/treemodel/JResSearchNode.java
  127. +22 −28 jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java
  128. +0 −5 jadx-gui/src/main/java/jadx/gui/treemodel/JRoot.java
  129. +5 −0 jadx-gui/src/main/java/jadx/gui/treemodel/JVariable.java
  130. +0 −5 jadx-gui/src/main/java/jadx/gui/treemodel/TextNode.java
  131. +2 −2 jadx-gui/src/main/java/jadx/gui/ui/MainDropTarget.java
  132. +93 −170 jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java
  133. +63 −80 jadx-gui/src/main/java/jadx/gui/ui/TabbedPane.java
  134. +18 −28 jadx-gui/src/main/java/jadx/gui/ui/codearea/AbstractCodeArea.java
  135. +52 −16 jadx-gui/src/main/java/jadx/gui/ui/codearea/CodeArea.java
  136. +10 −28 jadx-gui/src/main/java/jadx/gui/ui/codearea/CodeLinkGenerator.java
  137. +3 −3 jadx-gui/src/main/java/jadx/gui/ui/codearea/CodePanel.java
  138. +51 −50 jadx-gui/src/main/java/jadx/gui/ui/codearea/CommentAction.java
  139. +36 −15 jadx-gui/src/main/java/jadx/gui/ui/codearea/FridaAction.java
  140. +1 −23 jadx-gui/src/main/java/jadx/gui/ui/codearea/GoToDeclarationAction.java
  141. +11 −10 jadx-gui/src/main/java/jadx/gui/ui/codearea/JadxTokenMaker.java
  142. +6 −4 jadx-gui/src/main/java/jadx/gui/ui/codearea/LineNumbers.java
  143. +2 −2 jadx-gui/src/main/java/jadx/gui/ui/codearea/MouseHoverHighlighter.java
  144. +6 −0 jadx-gui/src/main/java/jadx/gui/ui/codearea/SmaliArea.java
  145. +1 −7 jadx-gui/src/main/java/jadx/gui/ui/codearea/mode/JCodeMode.java
  146. +112 −200 jadx-gui/src/main/java/jadx/gui/ui/dialog/CommonSearchDialog.java
  147. +155 −0 jadx-gui/src/main/java/jadx/gui/ui/dialog/FileDialog.java
  148. +0 −1 jadx-gui/src/main/java/jadx/gui/ui/dialog/RenameDialog.java
  149. +215 −73 jadx-gui/src/main/java/jadx/gui/ui/dialog/SearchDialog.java
  150. +52 −67 jadx-gui/src/main/java/jadx/gui/ui/dialog/UsageDialog.java
  151. +1 −1 jadx-gui/src/main/java/jadx/gui/ui/panel/HtmlPanel.java
  152. +22 −5 jadx-gui/src/main/java/jadx/gui/ui/panel/ProgressPanel.java
  153. +4 −2 jadx-gui/src/main/java/jadx/gui/ui/treenodes/SummaryNode.java
  154. +0 −33 jadx-gui/src/main/java/jadx/gui/utils/CacheObject.java
  155. +45 −38 jadx-gui/src/main/java/jadx/gui/utils/CaretPositionFix.java
  156. +0 −58 jadx-gui/src/main/java/jadx/gui/utils/CodeLinesInfo.java
  157. +0 −26 jadx-gui/src/main/java/jadx/gui/utils/FileUtils.java
  158. +0 −33 jadx-gui/src/main/java/jadx/gui/utils/FixedCodeCache.java
  159. +2 −0 jadx-gui/src/main/java/jadx/gui/utils/JNodeCache.java
  160. +1 −17 jadx-gui/src/main/java/jadx/gui/utils/JumpManager.java
  161. +9 −21 jadx-gui/src/main/java/jadx/gui/utils/JumpPosition.java
  162. +57 −7 jadx-gui/src/main/java/jadx/gui/utils/UiUtils.java
  163. +27 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/CodeCacheMode.java
  164. +92 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/CodeStringCache.java
  165. +25 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/FixedCodeCache.java
  166. +84 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/BufferCodeCache.java
  167. +113 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/CodeMetadataAdapter.java
  168. +258 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/DiskCodeCache.java
  169. +39 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/ArgTypeAdapter.java
  170. +26 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/BaseDataAdapter.java
  171. +26 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/ClassNodeAdapter.java
  172. +90 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/CodeAnnotationAdapter.java
  173. +12 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/DataAdapter.java
  174. +40 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/FieldNodeAdapter.java
  175. +22 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/InsnCodeOffsetAdapter.java
  176. +40 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/MethodNodeAdapter.java
  177. +37 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/NodeDeclareRefAdapter.java
  178. +36 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/VarNodeAdapter.java
  179. +26 −0 jadx-gui/src/main/java/jadx/gui/utils/codecache/disk/adapters/VarRefAdapter.java
  180. +0 −59 jadx-gui/src/main/java/jadx/gui/utils/search/CodeIndex.java
  181. +0 −12 jadx-gui/src/main/java/jadx/gui/utils/search/SearchIndex.java
  182. +0 −114 jadx-gui/src/main/java/jadx/gui/utils/search/SearchSettings.java
  183. +0 −54 jadx-gui/src/main/java/jadx/gui/utils/search/SimpleIndex.java
  184. +0 −208 jadx-gui/src/main/java/jadx/gui/utils/search/StringRef.java
  185. +0 −211 jadx-gui/src/main/java/jadx/gui/utils/search/TextSearchIndex.java
  186. +10 −5 jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
  187. +11 −6 jadx-gui/src/main/resources/i18n/Messages_en_US.properties
  188. +10 −5 jadx-gui/src/main/resources/i18n/Messages_es_ES.properties
  189. +10 −5 jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties
  190. +10 −5 jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties
  191. +10 −5 jadx-gui/src/main/resources/i18n/Messages_zh_TW.properties
  192. +1 −1 jadx-gui/src/test/java/jadx/gui/utils/JumpManagerTest.java
  193. +47 −0 jadx-gui/src/test/java/jadx/gui/utils/codecache/DiskCodeCacheTest.java
  194. +0 −71 jadx-gui/src/test/java/jadx/gui/utils/search/StringRefTest.java
  195. +13 −0 jadx-gui/src/test/resources/logback-test.xml
  196. +8 −4 jadx-plugins/jadx-dex-input/src/main/java/jadx/plugins/input/dex/DexFileLoader.java
  197. +17 −0 jadx-plugins/jadx-dex-input/src/main/java/jadx/plugins/input/dex/DexInputPlugin.java
  198. +0 −1 jadx-plugins/jadx-dex-input/src/main/java/jadx/plugins/input/dex/DexLoadResult.java
  199. +11 −22 ...ugins/jadx-dex-input/src/main/java/jadx/plugins/input/dex/sections/debuginfo/DebugInfoParser.java
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -35,4 +35,5 @@ jadx-output/
*.orig
quark.json

cliff.toml
cliff.toml
jadx-gui/src/main/resources/logback.xml
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'com.github.ben-manes.versions' version '0.42.0'
id 'com.diffplug.spotless' version '6.4.2'
id 'com.diffplug.spotless' version '6.5.0'
}

ext.jadxVersion = System.getenv('JADX_VERSION') ?: "dev"
@@ -32,7 +32,7 @@ allprojects {

testImplementation 'ch.qos.logback:logback-classic:1.2.11'
testImplementation 'org.hamcrest:hamcrest-library:2.2'
testImplementation 'org.mockito:mockito-core:4.4.0'
testImplementation 'org.mockito:mockito-core:4.5.1'
testImplementation 'org.assertj:assertj-core:3.22.0'

testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2'
2 changes: 1 addition & 1 deletion jadx-cli/src/main/java/jadx/cli/JadxCLI.java
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ public static void main(String[] args) {
} catch (JadxArgsValidateException e) {
LOG.error("Incorrect arguments: {}", e.getMessage());
result = 1;
} catch (Exception e) {
} catch (Throwable e) {
LOG.error("Process error:", e);
result = 1;
} finally {
2 changes: 1 addition & 1 deletion jadx-core/build.gradle
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ dependencies {

testImplementation 'org.apache.commons:commons-lang3:3.12.0'

testRuntimeOnly(project(':jadx-plugins:jadx-dex-input'))
testImplementation(project(':jadx-plugins:jadx-dex-input'))
testRuntimeOnly(project(':jadx-plugins:jadx-smali-input'))
testRuntimeOnly(project(':jadx-plugins:jadx-java-convert'))
testRuntimeOnly(project(':jadx-plugins:jadx-java-input'))
65 changes: 0 additions & 65 deletions jadx-core/src/main/java/jadx/api/CodePosition.java

This file was deleted.

12 changes: 10 additions & 2 deletions jadx-core/src/main/java/jadx/api/ICodeCache.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
package jadx.api;

import java.io.Closeable;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

public interface ICodeCache {
public interface ICodeCache extends Closeable {

void add(String clsFullName, ICodeInfo codeInfo);

void remove(String clsFullName);

@Nullable
@NotNull
ICodeInfo get(String clsFullName);

@Nullable
String getCode(String clsFullName);

boolean contains(String clsFullName);
}
7 changes: 3 additions & 4 deletions jadx-core/src/main/java/jadx/api/ICodeInfo.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package jadx.api;

import java.util.Map;

import jadx.api.impl.SimpleCodeInfo;
import jadx.api.metadata.ICodeMetadata;

public interface ICodeInfo {

ICodeInfo EMPTY = new SimpleCodeInfo("");

String getCodeStr();

Map<Integer, Integer> getLineMapping();
ICodeMetadata getCodeMetadata();

Map<CodePosition, Object> getAnnotations();
boolean hasMetadata();
}
22 changes: 17 additions & 5 deletions jadx-core/src/main/java/jadx/api/ICodeWriter.java
Original file line number Diff line number Diff line change
@@ -2,7 +2,10 @@

import java.util.Map;

import jadx.core.dex.attributes.ILineAttributeNode;
import org.jetbrains.annotations.ApiStatus;

import jadx.api.metadata.ICodeAnnotation;
import jadx.api.metadata.ICodeNodeRef;

public interface ICodeWriter {
String NL = System.getProperty("line.separator");
@@ -38,13 +41,21 @@ public interface ICodeWriter {

void setIndent(int indent);

/**
* Return current line (only if metadata is supported)
*/
int getLine();

void attachDefinition(ILineAttributeNode obj);
/**
* Return start line position (only if metadata is supported)
*/
int getLineStartPos();

void attachDefinition(ICodeNodeRef obj);

void attachAnnotation(Object obj);
void attachAnnotation(ICodeAnnotation obj);

void attachLineAnnotation(Object obj);
void attachLineAnnotation(ICodeAnnotation obj);

void attachSourceLine(int sourceLine);

@@ -56,5 +67,6 @@ public interface ICodeWriter {

StringBuilder getRawBuf();

Map<CodePosition, Object> getRawAnnotations();
@ApiStatus.Internal
Map<Integer, ICodeAnnotation> getRawAnnotations();
}
33 changes: 33 additions & 0 deletions jadx-core/src/main/java/jadx/api/JadxArgs.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package jadx.api;

import java.io.File;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumSet;
@@ -15,6 +16,7 @@
import jadx.api.data.ICodeData;
import jadx.api.impl.AnnotatedCodeWriter;
import jadx.api.impl.InMemoryCodeCache;
import jadx.core.utils.files.FileUtils;

public class JadxArgs {

@@ -55,6 +57,11 @@ public class JadxArgs {
*/
private Predicate<String> classFilter = null;

/**
* Save dependencies for classes accepted by {@code classFilter}
*/
private boolean includeDependencies = false;

private boolean deobfuscationOn = false;
private boolean useSourceNameAsClassAlias = false;
private boolean parseKotlinMetadata = false;
@@ -261,6 +268,14 @@ public void setSkipSources(boolean skipSources) {
this.skipSources = skipSources;
}

public void setIncludeDependencies(boolean includeDependencies) {
this.includeDependencies = includeDependencies;
}

public boolean isIncludeDependencies() {
return includeDependencies;
}

public Predicate<String> getClassFilter() {
return classFilter;
}
@@ -501,6 +516,21 @@ public void setPluginOptions(Map<String, String> pluginOptions) {
this.pluginOptions = pluginOptions;
}

/**
* Hash of all options that can change result code
*/
public String makeCodeArgsHash() {
String argStr = "args:" + decompilationMode + useImports + showInconsistentCode
+ inlineAnonymousClasses + inlineMethods
+ deobfuscationOn + deobfuscationMinLength + deobfuscationMaxLength
+ parseKotlinMetadata + useKotlinMethodsForVarNames
+ insertDebugLines + extractFinally
+ debugInfo + useSourceNameAsClassAlias + escapeUnicode + replaceConsts
+ respectBytecodeAccModifiers + fsCaseSensitive + renameFlags
+ commentsLevel + useDxInput + pluginOptions;
return FileUtils.md5Sum(argStr.getBytes(StandardCharsets.US_ASCII));
}

@Override
public String toString() {
return "JadxArgs{" + "inputFiles=" + inputFiles
@@ -513,12 +543,15 @@ public String toString() {
+ ", useImports=" + useImports
+ ", skipResources=" + skipResources
+ ", skipSources=" + skipSources
+ ", includeDependencies=" + includeDependencies
+ ", deobfuscationOn=" + deobfuscationOn
+ ", deobfuscationMapFile=" + deobfuscationMapFile
+ ", deobfuscationMapFileMode=" + deobfuscationMapFileMode
+ ", useSourceNameAsClassAlias=" + useSourceNameAsClassAlias
+ ", parseKotlinMetadata=" + parseKotlinMetadata
+ ", useKotlinMethodsForVarNames=" + useKotlinMethodsForVarNames
+ ", insertDebugLines=" + insertDebugLines
+ ", extractFinally=" + extractFinally
+ ", deobfuscationMinLength=" + deobfuscationMinLength
+ ", deobfuscationMaxLength=" + deobfuscationMaxLength
+ ", escapeUnicode=" + escapeUnicode
30 changes: 17 additions & 13 deletions jadx-core/src/main/java/jadx/api/JadxArgsValidator.java
Original file line number Diff line number Diff line change
@@ -13,18 +13,19 @@ public class JadxArgsValidator {

private static final Logger LOG = LoggerFactory.getLogger(JadxArgsValidator.class);

public static void validate(JadxArgs args) {
checkInputFiles(args);
public static void validate(JadxDecompiler jadx) {
JadxArgs args = jadx.getArgs();
checkInputFiles(jadx, args);
validateOutDirs(args);

if (LOG.isDebugEnabled()) {
LOG.debug("Effective jadx args: {}", args);
}
}

private static void checkInputFiles(JadxArgs args) {
private static void checkInputFiles(JadxDecompiler jadx, JadxArgs args) {
List<File> inputFiles = args.getInputFiles();
if (inputFiles.isEmpty()) {
if (inputFiles.isEmpty() && jadx.getCustomLoads().isEmpty()) {
throw new JadxArgsValidateException("Please specify input file");
}
for (File inputFile : inputFiles) {
@@ -66,19 +67,22 @@ private static void validateOutDirs(JadxArgs args) {

@NotNull
private static File makeDirFromInput(JadxArgs args) {
File outDir;
String outDirName;
File file = args.getInputFiles().get(0);
String name = file.getName();
int pos = name.lastIndexOf('.');
if (pos != -1) {
outDirName = name.substring(0, pos);
List<File> inputFiles = args.getInputFiles();
if (inputFiles.isEmpty()) {
outDirName = JadxArgs.DEFAULT_OUT_DIR;
} else {
outDirName = name + '-' + JadxArgs.DEFAULT_OUT_DIR;
File file = inputFiles.get(0);
String name = file.getName();
int pos = name.lastIndexOf('.');
if (pos != -1) {
outDirName = name.substring(0, pos);
} else {
outDirName = name + '-' + JadxArgs.DEFAULT_OUT_DIR;
}
}
LOG.info("output directory: {}", outDirName);
outDir = new File(outDirName);
return outDir;
return new File(outDirName);
}

private static void checkFile(File file) {
Loading