Compare commits

..

1623 Commits

Author SHA1 Message Date
Skylot 03009b5159 chore: update dependencies 2026-06-17 22:32:00 +01:00
Skylot d25eda4839 feat: new module/library for work with call graphs (#2890) 2026-06-17 22:32:00 +01:00
Skylot 59003bdb1f refactor: use MethodInfo for unresolved methods usage, improve related code 2026-06-17 22:31:57 +01:00
Ananya 9d4babcdce fix: keep all dimensions for anewarray of an array element type (PR #2887) 2026-06-14 20:50:06 +00:00
Skylot 8c28a8530e fix(gui): improve dot graph viewer, CFG generation simplified 2026-06-02 22:00:16 +01:00
Skylot 6775cc5a93 fix(gui): improve code tabs, sync and related code 2026-05-30 21:20:14 +01:00
Muhammad Mufti Ismail e648e60af9 fix(quark): change from 'virtualenv' to 'venv' (PR #2879)
Refactor virtual environment creation command

moving from virtualenv to venv
2026-05-23 20:44:12 +00:00
mbv06 e6b7db35c1 feat(gui): handle pasted file lists in file chooser (PR #2876) 2026-05-15 19:28:46 +00:00
Skylot c3f7027bdd fix: resolve duplicated error attr in fallback codegen, allow to set whole attr list at once (#2842) 2026-05-11 17:09:23 +01:00
Skylot 2fe95da570 fix: workaround for duplicated variables names index increment (#2868) 2026-05-09 20:51:02 +01:00
Ruffalo Lavoisier 62fa2735dc feat(gui): collapse single-child directory chains in resource tree (PR #2866) 2026-05-09 16:39:22 +00:00
xxr0ss bce6611aaf feat(gui): add "copy reference" to context menu (PR #2863)
Co-authored-by: xxr0ss <xxr0ss@users.noreply.github.com>
2026-05-01 21:30:27 +01:00
ewt45 21aa90c5d1 fix: cover more situations for SwitchOverString (PR #2860) 2026-04-27 18:36:06 +00:00
Skylot 55e79fb70f fix(res): use safe number parsing for android manifest, refactor params object (#2857) 2026-04-25 20:06:02 +01:00
Skylot 044c75ab9f fix(gui): ensure all fonts are 'composite' (#2856) 2026-04-25 19:26:27 +01:00
Skylot 97fa8ff210 fix: build correct file path for class from default package (#2854) 2026-04-20 19:32:57 +01:00
Skylot 27c283fb11 fix: limit 'if' region out block to current scope (#2791) 2026-04-19 21:32:58 +01:00
Skylot bd1c3fffde fix: improve handler path check for regions 2026-04-19 20:32:14 +01:00
Skylot 169ad2901f feat: add partial region visitor with result return 2026-04-14 20:59:02 +01:00
Skylot 869422b424 refactor: replace recursion with loop for region traversal 2026-04-14 20:57:41 +01:00
Ruffalo Lavoisier ccc4164d54 fix: harden XML parser in FileTypeDetector against XML bomb DoS (PR #2851) 2026-04-14 18:15:34 +00:00
dependabot[bot] b61642a646 build(deps): bump actions/github-script from 8 to 9 (#2849)
Bumps [actions/github-script](https://github.com/actions/github-script) from 8 to 9.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v8...v9)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '9'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-13 18:41:27 +00:00
dependabot[bot] 189e4181de build(deps): bump softprops/action-gh-release from 2 to 3 (#2848)
Bumps [softprops/action-gh-release](https://github.com/softprops/action-gh-release) from 2 to 3.
- [Release notes](https://github.com/softprops/action-gh-release/releases)
- [Changelog](https://github.com/softprops/action-gh-release/blob/master/CHANGELOG.md)
- [Commits](https://github.com/softprops/action-gh-release/compare/v2...v3)

---
updated-dependencies:
- dependency-name: softprops/action-gh-release
  dependency-version: '3'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-04-13 18:41:16 +00:00
Skylot 5b960db77e feat(gui): open single loaded class after load 2026-04-10 22:17:15 +01:00
Skylot 3119e8c893 fix: disable ternary mod for duplicated blocks (#2844) 2026-04-10 21:56:11 +01:00
Skylot f95c5e8f39 fix: limit ternary wrap to one level (#2844) 2026-04-09 20:50:40 +01:00
Skylot 1e908f7af3 refactor: add ErrorProne and NullAway checks, fix some issues 2026-04-06 21:13:08 +01:00
Jan S. 7ce40baacb fix(gui): NullPointerException when changing line wrap mode (PR #2843) 2026-04-05 18:48:49 +01:00
Skylot 7d689a85ea fix: remove result in wrapped insntructions (#2835) 2026-04-02 22:29:30 +01:00
Skylot c7a162d827 fix: resolve minor decompilation issues (#2835) 2026-04-02 21:22:35 +01:00
Skylot 325b3ac991 fix: use correct args copy/replace in wrapped insns (#2835) 2026-04-01 20:19:56 +01:00
Skylot 9a8a11619b chore: fix build warnings in java doc comments 2026-04-01 20:18:06 +01:00
Jan S. 7ae6bd737c fix(build): set *nix executable permissions on start scripts (PR #2838) 2026-03-30 19:03:04 +01:00
ewt45 57fd9b5bdb fix(gui): add file end line feed for exported code (PR #2836)
chore: add file end line feed for export code
2026-03-29 20:07:04 +01:00
Skylot cdd5bf536d fix(xapk): support files in sub-dirs in xapk (#2834) 2026-03-27 21:50:37 +00:00
Skylot dcce3aaa39 fix: use correct property for OS arch checks (#2830) 2026-03-24 20:17:35 +00:00
John b3d86ae908 fix: resolve class/package name conflicts on case-insensitive filesystems (PR #2828)
* Fix: resolve class/package name conflicts on case-insensitive filesystems

**RenameVisitor**
- Added package-level conflict detection for case-insensitive filesystems:
  when two packages differ only by case (e.g. com.Example vs com.example),
  rename the conflicting one and loop until the new name is also unique
- Added class-level conflict detection (same pattern): when two classes in
  the same package differ only by case (e.g. Sink vs sink), rename the
  conflicting one to prevent file overwrite on Windows export

**Tests**
- Added TestCaseSensitivePkgChecks: verifies package rename when packages
  differ only by case; fixed smali data (2.smali changed Bar→Foo to create
  a genuine path conflict under case-insensitive FS)
- Added TestCaseSensitiveClassInPkgChecks + smali fixtures: verifies class
  rename when two classes in a named package differ only by case
  (com.example.User vs com.example.user)

* Apply suggestions from code review

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>

---------

Co-authored-by: john <johnwsa@qq.com>
Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2026-03-23 20:42:25 +00:00
dependabot[bot] 8b7d3f497e build(deps): bump gradle/actions from 5 to 6 (PR #2829)
Bumps [gradle/actions](https://github.com/gradle/actions) from 5 to 6.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v5...v6)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-23 20:32:02 +00:00
Skylot 462e582bb8 chore: update gradle and dependencies 2026-03-22 21:15:36 +00:00
Skylot 14a7b63707 chore: apply common code style 2026-03-22 20:48:27 +00:00
Skylot 4051a50146 fix: stop type inference on exception (prevent endless loop) 2026-03-22 19:41:26 +00:00
Skylot b3db337abd feat: use queue instead of recursion for type updates 2026-03-22 19:10:42 +00:00
eason 15ea9a56b9 fix: handle null bounds in WindowLocation to prevent NPE on dialog dispose (PR #2826)
* fix: handle null bounds in WindowLocation to prevent NPE on dialog dispose

The equals(), hashCode(), and toString() methods in WindowLocation
could throw NullPointerException when bounds is null. This happens
when a dialog window is disposed before its bounds are fully
initialized (e.g., on macOS when closing the search dialog).

Use Objects.equals()/Objects.hashCode() for null-safe comparisons
and add a null guard in toString().

Fixes #2571

* additional null checks and null annotations

---------

Co-authored-by: easonysliu <easonysliu@tencent.com>
Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2026-03-18 19:05:49 +00:00
Skylot 165ae24722 fix: support enum restore for constructor without args (#2821) 2026-03-16 22:25:26 +00:00
Skylot 11b38ffed2 fix(gui): use localized label for code cache preferences 2026-03-16 19:49:02 +00:00
Hd 81dfac6d83 fix(gui): localize code cache mode labels (PR #2825)
* fix(gui): localize code cache mode labels

* chore: fix spotless apply
2026-03-16 19:42:24 +00:00
peasoft a3bd3b09fd feat(gui): add mimetype for desktop file 2026-03-14 18:31:04 +00:00
peasoft 13d306024a fix(gui): resolve "launchScriptPath" is null 2026-03-14 18:31:04 +00:00
Skylot ff64da705c fix: remove useless PHI for duplicate moves (#2813) 2026-03-13 19:11:16 +00:00
Skylot 00196e412b fix(gui): move scripts leftover code, save tree state on script run 2026-03-07 19:54:32 +00:00
Skylot 06c4fea4d2 fix(api): allow to create input category node even if no matching files found (#2806) 2026-03-07 19:54:32 +00:00
小明 69fd88d883 fix(gui): update zh_tw translation (PR #2818) 2026-03-07 19:54:14 +00:00
Ananya Sharma f2f145019d fix: handle Kotlin 1.9+ $ENTRIES pattern in enum restoration (PR #2814)
* fix: handle Kotlin 1.9+ $ENTRIES pattern in enum restoration

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* keep $ENTRIES field, it still used in getEntries() method

---------

Co-authored-by: clawdbot-silly-waddle <clawdbot-silly-waddle@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2026-03-07 19:37:12 +00:00
dependabot[bot] 7b3563fb62 build(deps): bump actions/upload-artifact from 6 to 7 (PR #2816)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-04 20:07:59 +00:00
dependabot[bot] 22ee9a216c build(deps): bump actions/download-artifact from 7 to 8 (PR #2815)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 7 to 8.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-04 20:07:43 +00:00
Hd 06b4467fdc fix(gui): update zh_CN translation (PR #2812) 2026-03-04 20:07:19 +00:00
Jan S. ff778ab372 fix(gui): use UI thread for adding logcat messages (#2811)
* fix(gui): use UI thread for adding logcat messages
other minor/logging improvements for debugger and adb connection

* checkstyle
2026-03-04 20:06:30 +00:00
Jan S. ff4dde62ae fix(gui): use UI thread for refreshStackFrameList in debugger view (PR #2807)
* fix(gui): use UI thread for refreshStackFrameList in debugger view

* call `resetAllDebuggingInfo` also from UI thread

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2026-02-27 16:49:04 +00:00
Skylot 468b52342d fix(cli): in 'progress' log mode show issues from input plugins (#2803) 2026-02-25 19:44:50 +00:00
Jan S. 09d39de604 fix(gui): make the Split view checkbox correctly toggle between both modes (PR #2801) 2026-02-24 19:58:40 +00:00
Skylot eb079bd435 fix(gui): use UI thread for scroll in code (#2798) 2026-02-23 21:04:41 +00:00
Skylot d1b1fc0ab6 fix(gui): stop token process on NULL token in JadxTokenMaker (#2798) 2026-02-23 20:05:56 +00:00
Skylot 859d479569 chore: remove 'jadx-script-kotlin' 2026-02-22 15:53:02 +00:00
Skylot b0954e9620 fix(gui): resolve possible NPE during project data loading (#2794) 2026-02-18 22:28:36 +00:00
Skylot dfe1d0477d fix(script): update imports in example scripts (#2795) 2026-02-18 22:28:04 +00:00
Skylot a1aa6d7ecd fix: insert generic casts for variable assigned from fields with known types (#2776) 2026-02-17 20:55:23 +00:00
Skylot 6f01e9f76b fix(gui): update usage file data version (was changed in PR #2784) 2026-02-15 18:02:26 +00:00
gordon-f0 be8b96280e feat: graph views, code pane sync, and more (PR #2784)
* snapshot 219

* revert non-working string searcher

* fix(gui): fix illegal ':' character in path when exporting resources.arsc/res

* fix(gui): use resource short name when exporting a folder via context menu

* fix(gui): use new resource class for files in arsc (#2771)

* fix(gui): limit tabs title length, fix tooltips (#2771)

* resolve issues with script code area after merge

---------

Co-authored-by: Jan S. <jpstotz@users.noreply.github.com>
Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2026-02-13 19:02:36 +00:00
Skylot 2a2806ebd7 feat(plugins): allow to use .zip as plugin artifact (with jars inside) 2026-02-12 19:38:34 +00:00
Skylot c7a0f7a092 feat: make jadx-script-kotlin plugin external 2026-02-12 19:38:33 +00:00
Jan S. 9710ebe09a fix(res): back to the old correct resource ID calculation (PR #2788)
fix: back to the old correct resourceID calculation
2026-02-12 17:27:53 +00:00
Jan S. f0da486703 fix(gui): go to main activity and application class when class name was renamed by deobfuscator (PR #2779)
fix(gui): go to main activity and application class when class name was renamed by deobfuscator
2026-02-08 18:21:50 +00:00
Jan S. 925503ba04 fix(res): prevent problems arising by parsing duplicate resource entries from resources.arsc (#2775)(PR #2777)
* fix(core): prevent resource name collisions by reading the same resource multiple times

* fix(core): prevent resource names getting longer by every rename operation

* initialize HashSet size properly

* formatting
2026-02-07 17:54:50 +00:00
Ruffalo Lavoisier 039900a278 fix(zip): check uncompressed size exceeds the maximum value of an integer (PR #2773)
* check whether it exceeds the maximum value of an integer
---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2026-02-04 20:29:16 +00:00
Skylot d73455c689 build(github): remove CodeQL action 2026-02-02 21:57:46 +00:00
Skylot 07b3e5a7c0 fix(gui): limit tabs title length, fix tooltips (#2771) 2026-02-02 21:09:15 +00:00
Skylot c1fc73a524 fix(gui): use new resource class for files in arsc (#2771) 2026-02-01 20:01:17 +00:00
Jan S. 0d982e9709 fix(gui): use resource short name when exporting a folder via context menu 2026-02-01 18:21:19 +00:00
Jan S. e6b38e172a fix(gui): fix illegal ':' character in path when exporting resources.arsc/res 2026-02-01 18:21:19 +00:00
Skylot 331c4aaa5e fix(gui): load class code before resolving jump position to get corrent value 2026-01-26 20:13:38 +00:00
Skylot 4e82233cbc fix(java-input): fix dup2_x1 stack to regs conversion for wide types (#2755) 2026-01-26 20:13:38 +00:00
Skylot ad267e1618 fix: improve switch over string restore (#2359) 2026-01-21 20:07:58 +00:00
ewt45 54265e34e5 fix: avoid more false positive throws (PR #2752)
Update MethodThrowsVisitor.java
2026-01-21 18:43:00 +00:00
ewt45 c677901aa5 fix(gui): use FontUtils.getCompositeFont() that supports CJK (PR #2751)
fix: use FontUtils.getCompositeFont() that supports CJK
2026-01-20 17:58:08 +00:00
ewt45 220a2198a1 fix: add more checks to better find handler's end (PR #2749) 2026-01-19 17:39:03 +00:00
Skylot b725dd18b6 fix: terminate type inference on first stack overflow (#2744) 2026-01-18 17:53:07 +00:00
Jan S. a0466d4494 fix: speed up file path security checks (PR #2745)
chore: Speed up path traversal check by using java.nio.file
2026-01-16 18:36:48 +00:00
Skylot ae1a5e9277 fix: improve codegen methods for custom decompilation mode 2026-01-12 19:47:52 +00:00
Skylot 018c20187d fix: keep wide upcast for arith instructions (#2730) 2026-01-12 18:40:01 +00:00
Skylot add11dff1d fix: add missing level info for jadx code comments (#2737) 2026-01-11 18:44:05 +00:00
Jan S. 005a59668c fix(res): as workaround use INVALID_STRING_PLACEHOLDER when string offset is is negative (#2729)(PR #2739)
core: as workaround use INVALID_STRING_PLACEHOLDER when string offset is negative
2026-01-07 16:22:18 +00:00
Deleted user 8f727325d6 fix(cli): distinguish JadxCLI error code (PR #2734) 2026-01-04 16:28:31 +00:00
Skylot 7bbb58863b fix(gui): don't init already loaded plugins while collecting options (#2727) 2025-12-24 20:28:21 +00:00
Skylot 8629e4cf22 tests(cli): use provided plugin loader to not use global plugins in tests 2025-12-23 21:40:35 +00:00
Skylot bd5c6b6516 fix(plugins): use class with correct fields for plugins list entry 2025-12-23 21:27:40 +00:00
Skylot 85a7aaa9fb fix(gui): do not enforce new nodes method for backward compatibility 2025-12-23 20:48:40 +00:00
Skylot a3df83e60f feat(gui): report plugin exceptions to plugin github project 2025-12-23 20:41:44 +00:00
Skylot b3be2794a0 fix(plugins): reduce plugins-list update checks 2025-12-22 21:53:54 +00:00
Skylot 02ea3be8f2 fix(plugins): improve errors handling and reporting (#2597) 2025-12-22 21:53:54 +00:00
Skylot b78745a87b fix(gui): reset selected tab on last tabs closed 2025-12-22 21:53:37 +00:00
Skylot 01af6481f6 fix(gui): handle config save error, don't write partial config 2025-12-21 19:33:21 +00:00
Skylot 0c3e6e77cd feat(gui): change fonts size with UI zoom, use FlatLaf fonts bundle 2025-12-20 20:18:31 +00:00
Skylot 8b48219dc3 chore: update dependencies 2025-12-19 18:57:41 +00:00
dependabot[bot] 80187c7e29 build(deps): bump actions/upload-artifact from 5 to 6 (#2724)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 21:59:33 +00:00
dependabot[bot] 22f7b40151 build(deps): bump actions/download-artifact from 6 to 7 (#2725)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 6 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-15 21:59:16 +00:00
Skylot 3e709d6693 feat(cli): implement config file load and save (#1731) 2025-12-15 21:07:10 +00:00
Skylot 1aa16c4664 feat(gui): add option for UI zoom factor (#2720) 2025-12-10 18:43:54 +00:00
Skylot 9fba709687 chore: update some dependencies 2025-12-08 20:11:16 +00:00
RedArms 6b61599114 fix(xapk): use stream copy to prevent OOM on large files (#2619) (PR #2719) 2025-12-08 19:00:57 +00:00
Skylot 2829e284f3 fix: prevent endless loop in region maker on dead code with loops (#2715) 2025-12-04 20:45:02 +00:00
RedArms 27b15aeb1c fix(gui): resolve NPE with smali breakpoint (#2717) (PR #2718)
* fix(gui): resolve exception in search dialog on project reload (#2714)

* Revert "fix(gui): resolve exception in search dialog on project reload (#2714)"

This reverts commit 74c52a8884.

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-12-04 19:25:45 +00:00
Skylot 74c52a8884 fix(gui): resolve exception in search dialog on project reload (#2714) 2025-12-03 19:38:27 +00:00
Skylot 39e7b82353 fix(gui): in comment dialog insert new line at current caret position (#2706) 2025-12-03 19:32:52 +00:00
Skylot 365e258180 fix: resolve edge cases for select best classes from duplicates (#2701) 2025-12-03 19:21:19 +00:00
Midori Kochiya ea68024851 fix(dex-input): use length in header for checksum, fix error in Dex v41 (PR #2711)
* Use length in header for checksum, fix error in Dex v41

* check if length can be read, use utils method to read int values

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-12-02 19:14:51 +00:00
Skylot 56ae4a6048 fix: refactor and improve class duplicates removal (#2701) 2025-11-29 22:51:27 +03:00
Histausse 1d831d82d4 feat: select better class from duplicates (#2701)(PR #2702)
* select the right class in in case of duplicate

* select correct class in gui in case of duplication

* fix code format

---------

Co-authored-by: Jean-Marie 'Histausse' Mineau <histausse@protonmail.com>
2025-11-29 19:50:49 +00:00
dependabot[bot] 4c760f1029 build(deps): bump actions/checkout from 5 to 6 (#2703)
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-29 16:26:03 +00:00
Skylot cf0101f13d fix: support 'break' extract for nested 'if' (#2697) 2025-11-22 22:20:32 +00:00
Skylot 748f45b386 chore: update dependencies 2025-11-21 20:29:20 +00:00
Skylot 9e278efc5c chore: update gradle 2025-11-21 20:23:54 +00:00
Skylot cc1beab0b5 fix(gui): use correct threads for code from close and reload actions (#2684) 2025-11-21 20:16:16 +00:00
Skylot 2fba204b33 fix: correctly handle variable in ternary transform 2025-11-20 20:30:10 +00:00
Skylot 9bf079aad4 fix: improve common 'break' extract checks (#2697) 2025-11-20 19:21:58 +00:00
Skylot 6aeaf6aca9 fix: extract common switch break, remove unreachable (#2697) 2025-11-13 20:48:51 +00:00
nitram84 7ea478e18a fix: respect arg offset for type var mapping on invoke (PR #2698)
fix: respect arg offset for type var apping on invoke
2025-11-11 22:01:27 +00:00
Skylot ef99412de1 fix: keep generics while applying debug info (#2687) 2025-11-07 20:27:29 +00:00
Jan S. cda1b1ad2c fix(gui): prevent unlimited recursion in text search (#2685) (PR #2694) 2025-11-06 20:34:42 +00:00
nitram84 05863881f8 fix: detect more for-each loops (also prevent issues with missing generics types) (PR #2689) 2025-11-05 21:04:22 +00:00
Skylot 3e208509e0 fix(gui): rework background executor to reduce delay for short tasks 2025-11-05 19:19:38 +00:00
Skylot bd75baef56 fix(gui): split loading and UI update for code area (#2682) 2025-11-04 20:53:02 +00:00
Skylot d191f62b8d fix: handle OutOfMemoryError to correctly halt processing (#2676) 2025-10-29 21:03:58 +00:00
Skylot f17c46224d fix: improve decoding errors handling (#2676) 2025-10-29 19:08:18 +00:00
Jan S. e008e818b0 fix: enhancements for abnormal situations (PR #2679)
* Allow to disable log panel (OFF)

* Limit the maximum number of garbage collector threads
2025-10-29 19:06:32 +00:00
JustFor 560b1a9ca7 fix(gui): update Chinese localization for various menu items (PR #2673)
translate new texts and update some old texts.
2025-10-27 18:23:55 +00:00
dependabot[bot] 06f113f0a6 build(deps): bump actions/download-artifact from 5 to 6 (#2675)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-27 18:16:57 +00:00
dependabot[bot] 48a0073002 build(deps): bump actions/upload-artifact from 4 to 5 (#2674)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-27 18:15:23 +00:00
Jan S. 88e90722ae fix: more file extensions added for file type detection (PR #2670) 2025-10-24 19:49:47 +01:00
Skylot 1becfa9977 fix(gui): use simple token maker as default to avoid parsing error (#2669) 2025-10-23 22:21:30 +01:00
Skylot 20ed13936a build(github): use latest LTS Java 25 2025-10-21 22:46:47 +01:00
Skylot 421de675a2 chore: update dependencies 2025-10-21 22:04:07 +01:00
Skylot 06a118c104 fix(gui): handle syntax parsing errors during search (#2669) 2025-10-21 22:02:41 +01:00
Skylot 2e93656007 fix: catch all exceptions in type update (#2668) 2025-10-21 20:37:43 +01:00
dependabot[bot] c8c4adb60c build(deps): bump github/codeql-action from 3 to 4 (PR #2666)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3 to 4.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-20 22:34:53 +01:00
Skylot f2e78fe800 fix(tests): use correct file separator to load resources 2025-10-14 23:31:34 +01:00
Skylot 7172f8df2d chore: update dependencies 2025-10-14 22:56:59 +01:00
Skylot d7c6be5664 fix: resolve rename of inner class using full name (#1997) 2025-10-14 22:56:59 +01:00
Skylot 654cf5e4fb fix(smali-input): use synced list for threaded processing, improve inner classes handling 2025-10-14 22:56:59 +01:00
wech71 bf2d5b5e2e fix(kotlin-metadata): upgrade to kotlin 2.2 metadata library (PR #2655)
* fix Metadata Bytes String reading and upgrade to kotlin 2.2 metadata library which is now finalized and has therefore renamed from kotlinx.metadata to kotlin.metadata

* add test with sample java class

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-10-12 00:16:57 +01:00
wech71 0f495afc99 fix(java-input): support Java modified UTF-8 strings (PR #2654)
* [core] fix jadx.plugins.input.java.data.ConstPoolReader.parseString() error with Kotlin Annotation of byte array as a String to follow jvms-4.4.7 rules for encoding annotation strings in class files

* move decode method into utility class, add test, fix code style

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-10-11 23:57:00 +01:00
dependabot[bot] 5f1985f281 build(deps): bump gradle/actions from 4 to 5 (PR #2649)
Bumps [gradle/actions](https://github.com/gradle/actions) from 4 to 5.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v4...v5)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-10-06 22:29:23 +01:00
o0kam1 2a574d45d5 feat: support '.apks' files (PR #2647) 2025-09-29 18:26:17 +01:00
Skylot 3ee476c6b6 build: update 'beryx.runtime' gradle plugin to fix 'win with jre' build 2025-09-28 17:00:52 +01:00
huqiuser fd3d488016 fix(aab-input): correct check for '.aab' file (PR #2646)
fix: Error decode xml (manifest) when parsing an APK file containing '.aab' in the file path

Co-authored-by: licheng <licheng@cmcm.com>
2025-09-28 16:18:09 +01:00
Skylot 9898cbb4a1 fix: add missing field code annotation for enum fields in switch-case 2025-09-22 22:12:29 +01:00
Skylot 104a0f0636 fix: resolve race condition in task executor 2025-09-22 22:12:29 +01:00
Skylot e58b77267e build: fix distribution artifacts sharing between projects 2025-09-22 22:12:29 +01:00
Skylot 73913651b4 chore: update gradle and dependencies 2025-09-21 19:55:11 +01:00
pubiqq f01e6aa505 chore: update android attrs (platform-36_r02) (PR #2638) 2025-09-17 19:19:15 +01:00
nitram84 d9da6a7f89 fix: avoid false positive throws (PR #2636)(#2475) 2025-09-15 00:08:06 +01:00
Skylot 5726a52ab6 fix: minor fixes for type update limit option (#2629) 2025-09-09 21:16:54 +01:00
Away f61d90ec2f feat: allow to change limit for type inference updates (PR #2629)
* Fix Type inference error: updates count limit reached

* Fix for the "Type inference error: updates count limit reached"
* Users will be able to choose the limit and possibly avoid this error
* Adding options on decompilation settings

* Updating README.md with new type update limit parameter

Updating README.md with new type update limit parameter
2025-09-09 20:50:04 +01:00
dependabot[bot] 2cd112cd3d build(deps): bump actions/github-script from 7 to 8 (#2628)
Bumps [actions/github-script](https://github.com/actions/github-script) from 7 to 8.
- [Release notes](https://github.com/actions/github-script/releases)
- [Commits](https://github.com/actions/github-script/compare/v7...v8)

---
updated-dependencies:
- dependency-name: actions/github-script
  dependency-version: '8'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-08 19:20:27 +01:00
dependabot[bot] 43358643be build(deps): bump actions/setup-java from 4 to 5 (PR #2614)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 4 to 5.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-29 20:41:47 +01:00
dependabot[bot] 1f0d3dac0f build(deps): bump actions/download-artifact from 4 to 5 (#2602)
Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 09:52:54 +01:00
dependabot[bot] da95a8ae17 build(deps): bump actions/checkout from 4 to 5 (#2603)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 09:51:04 +01:00
Andrei Kudryavtsev da3ac6bff0 fix(gui): various tabs related fixes (PR #2595)
* 1. Fix tab rendering when preview state changed

* 2. Fix selected tab after closing currently active tab

* 3. Fix tab selection when pinning currently active tab

* 4. Make current preview tab permanent on double click

* 5. Fix preview tab font not reloading on settings change
2025-08-04 18:09:22 +01:00
beaverxsheet bdbeaff8f0 fix: use proper newlines when generating CFG (PR #2592)
fixing new lines in the cfg
2025-08-04 18:03:11 +01:00
Jan S. b1f48f1db1 fix(gui): fix NullPointerException in copyAllSearchResults (#2580) (PR #2581) 2025-07-24 18:37:47 +01:00
Skylot 5b09378614 fix: use 'dev.dirs' JNI implementation only on x86-64 (#2578) 2025-07-23 19:26:14 +01:00
Skylot b64c93160b refactor: move system info class to common app lib 2025-07-23 19:24:26 +01:00
Skylot 58c4f56a71 feat(gui): allow view and edit input smali files 2025-07-19 22:16:19 +01:00
Skylot 3d11d1fa87 fix(gui): resolve NPE on code area close 2025-07-19 22:14:30 +01:00
Skylot 0d158592e4 chore: update gradle 2025-07-19 19:14:24 +01:00
Skylot 0c253f9a1f chore: update dependencies 2025-07-19 19:08:18 +01:00
Loyie King f565178c8c feat(aab): enhance AAB parsing (PR #2557)
* fix(aab): resources.pb always NPE

* fix(aab): resources.pb shows wrong resources id

* feat(aab): add parser for native.pb, assets.pb, dependencies.pb

* apply code formating

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-07-07 21:08:12 +01:00
Skylot f6d13f1860 fix(cli): add missing '-XX:+IgnoreUnrecognizedVMOptions' JVM flag (#2554) 2025-07-06 17:30:50 +01:00
TinyServal d58c9ac926 fix(gui): minor UI fixes (PR #2549)
* fix(gui): use system menu bar on macOS

* fix(gui): font consistency in AboutDialog

* fix(gui): fix horizontal scrolling speed in CommonSearchDialog

* fix(gui): slightly increase debounce timer to reduce UI flickering

* fix(gui): disable tab scroll wrap-around behavior
2025-07-02 20:37:16 +01:00
Skylot 7f9d51b9b1 fix(zip): allow to load zip with duplicate names in entries 2025-06-29 20:44:17 +01:00
Skylot 432e49df03 fix(gui): disable debugger action if project not loaded (#2547) 2025-06-29 19:48:10 +01:00
Skylot b530c234f3 chore: update gradle 2025-06-29 19:48:10 +01:00
Skylot 181dcf7b4f chore: update dependencies 2025-06-29 19:48:10 +01:00
xiaojye dc4dcb2bd0 refactor(gui): improve menu icon, such as 'Select in Tree' and 'Go to AndroidManifest.xml' buttons (PR #2543) 2025-06-26 20:48:23 +01:00
Jan S. 74c396448e fix(gui): prevent IndexOutOfBoundsException in MethodSearchProvider (PR #2542) 2025-06-20 22:37:27 +01:00
Skylot cb9693a9d1 fix: correct hex format for negative numbers (#2531) 2025-06-19 22:49:59 +01:00
Mart Lintz 5d13acc6f3 chore(export): add missing ExpiringTargetSdkVersion in #2533 (PR #2538) 2025-06-17 22:38:02 +01:00
Skylot c04dddfa81 fix(cli): improve memory usage in jadx-cli (#2524) 2025-06-16 21:00:01 +01:00
Jan S. 1bb645d676 fix: correct loading for plain text XML files (PR #2537) 2025-06-16 19:26:35 +01:00
Jan S. ecb597a461 chore(export): disable targetSDKVersion checks in AndroidStudio (PR #2533)
chore: disable targetSDKVersion warnings when opening exported project in AndroidStudio
2025-06-11 23:13:02 +03:00
Akexorcist 46cd3b5597 feat(export): use compileSdkVersion from manifest, update AGP to 8.10.1, other improvements (PR #2528)
* chore(core): export to android project with AGP 8.10.1

* fix code format

* fix export template test

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-06-07 20:09:29 +01:00
Jeroen Beckers d523f1b15e fix(gui): use var instead let for class variable in Frida script (PR #2527)
Co-authored-by: Jeroen Beckers <dauntless@dauntless.be>
2025-06-07 19:53:19 +01:00
skylot 8030c2f84e feat(gui): new search options to search in text or binary resources (PR #2526)
* search in text or binary resources

* load matching tab for scroll to pos in binary panel, treat unknown files as binary in search
2025-06-07 19:23:08 +01:00
Ruffalo Lavoisier 47224dc599 fix(gui): remove duplicate class of Frida snippet (PR #2525)
fix duplicate class of frida snippet
2025-06-03 17:52:06 +01:00
Yaroslav d492628bfe fix(gui): workaround for wrap layout repaint issue in search dialog (PR #2521)
* fix(gui): fixed incorrectly handles full window repaint in search dialog

* fix: fix spotless check
2025-06-02 21:45:46 +01:00
Skylot 13e934ce4d build: update java to 24 for release workflow 2025-06-02 19:54:06 +01:00
Skylot 7b54c3ae70 fix(gui): prevent UI thread freeze on plugin install/uninstall 2025-06-01 20:25:18 +01:00
Skylot b82791706a fix(gui): redirect plugins menu action to show plugins settings page 2025-06-01 18:55:11 +01:00
Skylot e51a7fe417 fix(gui): lazy load hex viewer content 2025-06-01 17:01:10 +01:00
Skylot cf96fdec59 fix: add arsc file name prefix only in jadx-gui (#2373) 2025-05-31 20:12:54 +01:00
Skylot 3374f9b64a fix: use resource table file name as prefix in sub files (#2373) 2025-05-29 23:18:32 +01:00
Skylot 6b54cde89c fix: use wrap layout for options in search dialog, add size limit option 2025-05-29 22:44:21 +01:00
Skylot 59b560b553 fix: lazily create dirs in default file getter implementation 2025-05-29 17:59:26 +01:00
Skylot 8b08ac3806 fix: wrap MethodThrowsVisitor insns processing in try/catch (#2441) 2025-05-27 20:01:45 +01:00
Skylot d9d4180581 feat: use parallel jobs to delete files in directory (#2436) 2025-05-27 20:01:45 +01:00
Skylot 33f93ddc8a feat: move variable name apply from codegen to new pass (#2422) 2025-05-26 23:20:45 +01:00
Yaroslav bcd0c949dc feat(gui): use list component for recent projects on start page (PR #2513)
* feat(gui): use list component witch recent projects on start page

* fix: spotless check

* move classes into one package and some minor changes

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-05-25 20:35:35 +01:00
Yaroslav fc0f1f9a1c fix(gui): validate extensions list in file dialog (PR #2515)
* fix(gui): fixed export file without extensions (close #2514)

* don't add null extensions

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-05-25 20:23:36 +01:00
Yaroslav abd64007e2 fix(gui): validate hex address in GotoAddressDialog (PR #2512)
chore: use check if entered valid hex address from GotoAddressDialog & make error style search field if hex search value not valid in hex viewer
2025-05-24 23:00:18 +01:00
Skylot fb02e32a6a chore: don't use nullable annotations from RxJava 2025-05-24 22:16:10 +01:00
Skylot f33a2e4768 fix: for static synchronized methods remove top synchronized block (#2493) 2025-05-24 22:04:32 +01:00
Yaroslav 3d8e5e5851 chore: migrate from old unsupported rxjava2 to rxjava3 (PR #2511) 2025-05-24 21:56:23 +01:00
Yaroslav 646ee2d963 fix(gui): minor improved search dialog & small refactor for search fields (PR #2510)
* fix(gui): minor improved search dialog & small refactor for search fields

* fix: removed unused key string

* fix(gui): added icon for active tab in SearchDialog
2025-05-24 21:04:59 +01:00
Jan S. b6f27d8a1a feat(zip): provide direct InputStream of ZIP entries (PR #2509)
* chore: provide direct InputStream of ZIP entries

* use limited stream, return bytes without using stream

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-05-24 20:36:10 +01:00
Skylot 97d04edb01 fix(xapk): new implementation to reduce zip unpack and fix NPE (#2501) 2025-05-24 00:09:29 +01:00
Yaroslav 2486c981a8 fix(gui): improve colors in usage tree, some UI fixes (PR #2506)
* fix(gui): refactor code in UsageDialogPlus

* fix(gui): added padding between buttons in package exclusion dialog & fixed crash

* fix(gui): added padding between buttons in settings dialog

* fix: fix javadoc

* fix: fix javadoc

* fix: fix javadoc
2025-05-23 23:15:16 +01:00
MewtR b7a8a2879e feat(gui): add option to disable the tooltip that pops up on hover (PR #2505)
feat(gui): add option to disable the tooltip that pops up on hover
2025-05-23 22:08:06 +01:00
Yaroslav 092e897104 fix(gui): fix rename package behaviors (PR #2500)
* fix(gui): fix rename package behaviors

* disable rename for default and synthetic packages

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-05-22 23:26:39 +01:00
Yaroslav a0a9f7fd41 feat(gui): notify user if code has non-displayable character with current font (PR #2490)
* feat(gui): notify user, if code has non-displayable character in current font (fix #621)

* fix(gui): improve check showing undisplayed chars on current font

* fix code style

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-05-22 23:05:05 +01:00
Little Hour Y 00f0f5547b fix(gui): using actual tree in usage tree dialog (PR #2503)
* A tree - shaped usage rendering scheme has been added

* A tree - shaped usage rendering scheme has been added - i18n update

* A tree - shaped usage rendering scheme has been added - Enhance the interactive experience

* A tree - shaped usage rendering scheme has been added - Jtree Render

---------

Co-authored-by: y <y@a.com>
2025-05-22 22:02:31 +01:00
Yaroslav 00608f8e51 feat(res): use file headers to detect extension for obfuscated resources (PR #2495)
* feat(res): add feature to use headers for detect resource extensions if resource obfuscated

* fix(res): read first 4kb data, for detect headers & use utf8 charset for decode bytes to string
2025-05-20 21:07:41 +01:00
Little Hour Y d0351a88ba feat(gui): a tree structure usage search (PR #2498)
* A tree - shaped usage rendering scheme has been added

* A tree - shaped usage rendering scheme has been added - i18n update

---------

Co-authored-by: y <y@a.com>
2025-05-20 20:46:07 +01:00
Yaroslav bee476895c feat(tools): improve tool for sync and update I18N lines (PR #2494)
* feat(tools): add to NLSAddNewLines tool remove lines if it not found on default reference & update commented untranslated line from reference

* fix: sync i18n translation from english reference file

* rename class and task, adjust code style

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-05-19 19:17:07 +01:00
Yaroslav 580f25faae fix(res): fix decode xml attributes value (PR #2492)
* fix(res): now when decoding attributes used namespace (fix #1675)

* fix: code formatted

* fix: some code improved on ManifestAttributes class
2025-05-19 18:31:31 +01:00
Skylot 1d1ca7d0c0 fix: process synthetic resource inner classes using common method (#2482) 2025-05-18 22:58:37 +01:00
Skylot dbf4527ce6 chore: update dependencies 2025-05-17 23:29:38 +01:00
Yaroslav ec726d6ca1 fix(gui): update resource.arsc nodes after opened tab with resource ids (PR #2489)
* fix(gui): update resource.arsc nodes after opened tab with resource ids list by double click (fix #2488)

* Update jadx-gui/src/main/java/jadx/gui/treemodel/JResource.java

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2025-05-17 22:51:55 +01:00
Yaroslav be1c02455f feat(gui): added dialog for select methods for generate frida class snippet (PR #2487)
feat(gui): add dialog for select methods for generate frida snippet
2025-05-16 18:14:33 +01:00
Yaroslav aee1e86398 fix(gui): restore tree state after renaming (PR #2486)
fix(gui): restore tree state after renaming
2025-05-15 20:54:50 +01:00
Yaroslav c0d721bea1 feat(gui): added feature to close all left tabs (#1390) (PR #2484)
feat(gui): added feature to close all left tabs (fix #1390)
2025-05-15 20:32:05 +01:00
Yaroslav e19a456642 feat(gui): added support view and open more resource files (PR #2483)
* feat(gui): added support view and open more resource files

* fix(gui): remove svg extension from resource types

* fix(gui): use error dialog from common utils

* fix: reformat code
2025-05-15 18:50:19 +01:00
Yaroslav acd57930cc fix(gui): improve apk signature loading speed (PR #2481)
fix(gui): improve spk signature loading speed (fix #1827)
2025-05-14 19:35:24 +01:00
Yaroslav 73348e5183 feat(gui): new HexViewer (PR #2469)
* feat(gui): rewrite hex viewer (#2415)

* fix: resolved merge conflict

* fix: resolved spotless checks

* fix: try fix CodeQL checks

* fix: fixed checkstyle checks

* fix: always reset selection on hex viewer by left mouse button

* fix: always reset selection on hex viewer by left mouse button

* chore(gui): changed hex viewer to bined lib

* fix: fixed checkstyle checks

* fix: fixed goto address dialog

* chore(gui): added search on hex viewer & updated bined library

* fix: remove commented code

* fix: removed useless code

* fix: removed useless code

* fix: try fix CodeQL scanning

* fix: try fix CodeQL scanning

* fix: try fix CodeQL scanning

* fix(gui): fixed search bar on hex viewer

* fix(gui): fixed is hex string checker

* fix(gui): fixed typo
2025-05-14 19:34:33 +01:00
Little Hour Y 32c92dd9a8 feat(gui): add "Copy All" button to Search dialog (PR #2480)
* add copy all button in CommonSearchDialog

* fix i18n test error

---------

Co-authored-by: ymoon <ymoon@ymoon.com>
2025-05-10 19:05:03 +01:00
nitram84 8bbdbfc563 feat: generate missing throws declarations, validate exceptions (#2441) (PR #2475)
* fix: generate missing throws declarations, validate exceptions (#2441)

* use ClspGraph.isImplements to check base classes, some code improvements

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-05-09 21:08:41 +01:00
Yaroslav fd6cb2451b fix(gui): improved preview tab behaviors (PR #2477)
* fix(gui): improved preview tab behaviors

* Update jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2025-05-08 21:53:15 +01:00
Yaroslav 47647bbb9a feat(gui): add Preview Tab Feature (PR #2474)
* feat(gui): created simple preview mode (#756)

* feat(gui): fixed opening code preview tab, if open from available tabs

* fix(gui): rollback mouse events for tree
2025-05-04 20:17:00 +01:00
Skylot e31d697cd9 fix: check and report invalid magic in '.dex' files (#2473) 2025-05-03 21:55:53 +01:00
Skylot a796d15289 fix(gui): add missing annotations color for dynamic theme (#2471) 2025-05-03 21:15:06 +01:00
Skylot f56eb271a1 feat(gui): allow to set code area theme with custom code (#2471) 2025-05-03 20:24:49 +01:00
Yaroslav fbebcb9845 feat(gui): add dynamic code editor theme from UI theme (PR #2471)
fix(gui): created dynamic theme for code editor (#1763)
2025-05-02 17:10:27 +01:00
Skylot 79c91634ad build: set Java 24 for windows bundle 2025-05-01 20:13:51 +01:00
Skylot f6e12d71a0 chore: update gradle and dependencies 2025-05-01 19:22:16 +01:00
JustFor 62835fbade fix(gui): update Messages_zh_CN.properties (PR #2470)
sync new text
2025-04-30 18:59:20 +01:00
Skylot 07c66b5c3c fix(tests): fix paths check on Windows 2025-04-29 22:31:29 +01:00
Skylot e3aa49aaa9 feat: add gradle export templates, support android app/lib and simple java 2025-04-29 21:54:40 +01:00
Skylot 9981949a2b feat(api): add 'unload' method to JadxPlugin (#2463) 2025-04-20 21:44:47 +01:00
Skylot ea6492e5ba fix(gui): properly handle excluded classes in code search (#2432) 2025-04-18 22:30:00 +01:00
Skylot 03d4cb134f build: downgrade java to version 21 for windows bundle 2025-04-15 22:42:39 +01:00
Skylot 37b0b09f25 chore: update dependencies 2025-04-15 21:50:27 +01:00
Skylot 1e75544636 refactor: deprecate temp methods which uses global temp dir 2025-04-15 21:47:52 +01:00
Skylot d4ce969fb7 fix(test): don't use global configs for cli integration tests 2025-04-15 21:47:51 +01:00
Skylot 9a692d6be4 fix: collect usage info in generic types 2025-04-14 21:43:26 +01:00
Adrian d3a8a43c74 fix: ignore external and invalid class names in signature (#2459)(PR #2460)
* fix: erroneous SignatureProcessor resolution of standard non-generic types with Annotation Signatures

* ignore external and invalid class names in signature

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-04-14 21:36:54 +01:00
Jan S. 518da3d8b5 fix(gui): Xposed snippet argument types corrected (PR #2454) (#2458) 2025-04-13 18:50:43 +01:00
Josh Ryan 61f5386fe5 feat(gui): support APK Signature Scheme v3.1 signers (PR #2452) 2025-04-02 22:22:21 +01:00
Jan S. 20cb9c6a3b fix(gui): flatten packages view: non-leaf packages with classes were not visible in the sources tree (PR #2450)
fix(gui): Flatten packages view: non-leaf packages with classes were not visible in the sources tree
2025-03-28 14:21:56 +03:00
5idereal 4a6784dc68 fix(gui): update zh_TW translation (PR #2448) 2025-03-27 13:48:23 +03:00
Skylot bb6db25c9d fix(gui): apply log level as early as possible 2025-03-25 22:00:21 +00:00
Skylot d0c496858e build: improve launch4j parameters 2025-03-25 20:48:10 +00:00
Skylot b0ab702f9e build: add accessibility module for win bundle (#2446) 2025-03-25 20:46:32 +00:00
Skylot 5846e6d22e fix: scan annotations in usage collector visitor (#2435) 2025-03-22 22:04:15 +00:00
Skylot 4daad2fc79 chore: update gradle and dependencies 2025-03-19 22:25:33 +00:00
Skylot cca6ca25d1 fix: deduplicate blocks to help 'complex if' restructure (#2445) 2025-03-19 22:04:45 +00:00
Skylot dfa6a83f7c fix: improve BlockSet class, use it in more places 2025-03-19 22:01:47 +00:00
Skylot d1a3935c9e fix(res): improve resource table and config decoding (#2420) 2025-03-17 22:14:26 +00:00
Skylot b4f1021885 fix(gui): improve accessibility of preferences dialog (#2445) 2025-03-17 21:25:59 +00:00
Sencaid a163e5a1de fix(gui): update Messages_de_DE.properties (PR #2410)
* Deutsch aktualisiert

* Add files via upload

* Update jadx-gui/src/main/resources/i18n/Messages_de_DE.properties

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>

* Add files via upload

* Apply suggestions from code review

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2025-03-14 19:13:32 +03:00
Jan S. 6eeb303d73 fix(res): chunk parsing was aborted too early for unordered entries (PR #2444) 2025-03-14 18:48:37 +03:00
Skylot 3209dbb7a4 fix: do not reopen zip file on every resource decode 2025-03-13 20:22:26 +00:00
Skylot d84f0389ec feat: custom zip reader implementation to fight tampering
fix(zip): use size info from CD if LFH entry is incorrect

refactor: move custom zip implementation into new module

feat: move ZipSecurity into jadx-zip module
2025-03-13 20:22:26 +00:00
Skylot 5d720dd29c fix(gui): allow file and directory have same name in tree (#2420) 2025-03-13 17:29:33 +00:00
Skylot c9d650d186 fix: unload attributes map if empty (#2433) 2025-03-06 19:36:46 +00:00
Skylot ce60aa8635 fix(gui): minor action names and icons adjustments (#2419) 2025-02-22 20:47:11 +00:00
yyyair 4a9276e904 feat(gui): tabs UI improvements (PR #2419)
* Adds "Reveal In Explorer" tab, to focus on on the current class's tree node

* Adds separators between tab categories, similar to how tabs look in VSCode/IntelliJ

* Rename from reveal_in_explorer to reveal_in_tree

* Minor fixes

* Handle mouse presses on tabs better

* use exist action name instead new one

---------

Co-authored-by: glu0n <glu0n@gmail.com>
Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2025-02-22 18:46:00 +00:00
Skylot b78d3aa2f7 fix: do not replace constant fields which still used in code (#2414) 2025-02-19 23:05:35 +00:00
Skylot 4644d1d8ac fix(gui): correct class init method actions and highlight (#2412) 2025-02-17 20:38:21 +00:00
Skylot 7b8fc01319 feat(plugins): new API method to add popup menu entry for tree nodes (#2412) 2025-02-17 19:52:49 +00:00
Skylot ff66f95a8a fix(smali-input): improve error report for smali assemble (#2411) 2025-02-15 21:36:00 +00:00
Skylot 4ef1f3b12b feat(dex-input): initial support for DEX v41 (#2128) 2025-02-12 22:25:34 +00:00
Skylot 8873038b57 fix(gui): save current caret position and add it to tab code jump event (#2409) 2025-02-12 19:56:48 +00:00
Skylot bf58f03405 fix(gui): don't ask to save blank project 2025-02-09 19:23:50 +00:00
Skylot acf1c8187e refactor(gui): extract common dialog code into new parent class 2025-02-06 19:47:53 +00:00
Skylot 7bd1b14728 fix(gui): skip window pos saving if not changed 2025-02-06 18:46:56 +00:00
Skylot 61f04d6b07 fix(gui): set minimum size for comment dialog (#2405) 2025-02-06 18:46:55 +00:00
Skylot 5d5bf325fe fix: use fork of directories library with JNI implemetation for Windows (#2401) 2025-02-04 17:53:45 +00:00
Hidoni afdd2d8b39 feat(gui): add button to install desktop file directly from jadx-gui (PR #2404)
* fix: missing/incorrect .desktop file values

- correct comment
- Add StartupWMClass

* feat: add button to install desktop file from jadx-gui (#1392)

* fix: use POSIX compliant realpath instead of readlink

* fix: get XDG executable from PATH
2025-02-01 23:03:42 +00:00
Skylot b18604071a fix(gui): new implementation for tree state save/load (#2399) 2025-02-01 19:33:39 +00:00
Skylot 801890f0a8 fix(gui): improve JNode caching (#2400) 2025-02-01 17:36:53 +00:00
Jan S. 3d36c93beb fix(res): ignore reserved value in type chunk (PR #2403)
fix: ignore reserved value in type chunk (fixes #2402)
2025-01-29 17:12:28 +00:00
Skylot 54fbbd9524 fix(gui): workaround to force class decompilation in loading task (#2400) 2025-01-25 20:38:56 +00:00
Skylot 306547d499 fix(gui): improve expand tree (speed up and duplicate entries removal) (#2399) 2025-01-24 18:49:36 +00:00
Skylot a43b475be7 fix: improve rename using source class name (#2397) 2025-01-20 21:55:46 +00:00
Skylot bc4bb0dc41 fix(cli): concat new lines in plugin description 2025-01-20 19:35:54 +00:00
Skylot ea5916452d doc: add plugins usage section 2025-01-20 19:21:49 +00:00
Skylot 19f3cdf501 feat(plugins): add method to open usage dialog 2025-01-20 19:05:06 +00:00
Skylot 45d320a596 feat(plugins): add method to get jadx-gui icons by name 2025-01-20 17:13:23 +00:00
Skylot 6860a8be7e fix(res): handle null values in android manifest parsing (#2392) 2025-01-13 19:55:06 +00:00
Skylot 94915db739 chore: update gradle and dependencies 2025-01-13 19:55:06 +00:00
Yaroslav 29d114402d feat: parse and use Kotlin SourceDebugExtension with SMAP for rename classes and packages (PR #2389)
* feat: parse and use Kotlin SourceDebugExtension for rename classes and package

* fix: fixed typo

* fix: fixed spotless checks

* fix: fixed spotless checks
2025-01-06 20:16:26 +00:00
Bnyro 6889670b11 chore: add .desktop file for jadx-gui (PR #2388) 2025-01-01 20:47:29 +03:00
JustFor fe7d527fcc fix(gui): update Messages_zh_CN.properties (PR #2387)
sync new text
2024-12-31 18:53:01 +03:00
ewt45 84e211b809 fix: IfRegionMaker find the wrong outBlock (PR #2385)
* IfRegionMaker find wrong out block

* fix: test codes fail because of the previous commit
2024-12-30 16:42:03 +03:00
Skylot f4849d67cf build: reduce gitlab test stages due to new compute limit 2024-12-23 21:31:14 +00:00
Skylot 60a8d8b9fd fix: show all methods for 'simple' and 'fallback' decompilation modes 2024-12-23 21:18:04 +00:00
Skylot 1449354c54 fix: allow to inline methods with ternary instructions (#2380) 2024-12-23 20:59:42 +00:00
Skylot 0df474f35a fix: resolve incorrect var ref validation and remove (#2381) 2024-12-23 19:57:08 +00:00
Skylot de629544a3 fix: force type var short form as a key in generic resolve mapping (#2370) 2024-12-22 21:11:34 +00:00
Iscle 7a2dad8ef2 feat: add APKM support (PR #2379)
* feat: Add APKM support

* fix: Removed unused imports

With spotlessApply :P
2024-12-22 16:58:44 +00:00
Yaroslav a46e35c15c feat(gui): add export dialog with options (PR #2378)
fix(gui):add export dialog with options (#1983)
2024-12-21 20:34:54 +00:00
Skylot 73966fda89 fix(gui): add missing sync in clean task at search dialog close (#2363) 2024-12-21 19:44:15 +00:00
Skylot fe0ab5ebf8 fix(gui): improve detection of multi line method comments for update 2024-12-20 20:51:21 +00:00
Yaroslav 8345edf76b fix(gui): text on popup action change if need update comment & fixes default size on comment diallog (PR #2376)
* fix(gui):text on popup action change if need update comment & fixed default comment dialog size (#2155)

* don't add new action, just rename labels

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-12-20 20:21:57 +00:00
Yaroslav ff0fbba720 feat(gui): added confirm dialog when removing script (PR #2375)
feat(gui): added confirm dialog when removing script (#2353)
2024-12-19 19:11:18 +00:00
Yaroslav fe41d6ed3d feat(gui): add script rename feature (PR #2374)
* feat(gui): add script rename feature (#2354)

* fix: resolve spotless check
2024-12-19 18:13:08 +00:00
nitram84 ff95b9e999 fix: better package-info support (PR #2369)
* fix: better package-info support

* fix: adjust checks for package-info
2024-12-18 22:33:48 +00:00
Skylot 87844d2193 fix: remove wrapped flag for inlined instruction (#2363) 2024-12-18 21:41:26 +00:00
Skylot 2ac0cc62e6 chore: update dependencies 2024-12-18 21:41:26 +00:00
Yaroslav 2924bb259c feat(gui): add webp image preview support (PR #2372)
* feat(gui): add webp image preview support (#2190)

* fix: resolve spotless check

* remove explicit webp provider register

* Update jadx-gui/src/main/java/jadx/gui/ui/panel/ImagePanel.java

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-12-18 19:28:44 +00:00
ewt45 17695babf4 fix: inline anonymous class wrongly handles field as Classname.this (PR #2367)
* fix: inline anonymous class wrongly handle Classname.this

* add test case

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-12-12 18:54:05 +00:00
ewt45 0d105a5095 fix: inner class parent is wrong when name formatted as Class$method$xxx (PR #2364) 2024-12-11 19:25:23 +00:00
nitram84 7eab3c8534 feat(gradle): handle non-final res ids for AGP >8.0.0 (PR #2362) 2024-12-11 17:56:28 +00:00
Skylot 47f2e516e5 fix(gui): resolve ignored mouse actions (#2360) 2024-12-09 17:44:32 +00:00
Skylot fdad829c49 chore: update dependencies 2024-12-09 17:41:26 +00:00
ewt45 2fa7f84251 fix: check respectBytecodeAccModifiers in MarkMethodsForInline (PR #2361)
Update MarkMethodsForInline.java
2024-12-09 16:17:22 +00:00
nitram84 828cad3287 feat: replace constants in annotations of method arguments (PR #2358) 2024-12-04 17:06:13 +00:00
Skylot cc0cb6a3d3 chore: update gradle and dependencies 2024-11-24 19:00:09 +00:00
Skylot a67dfcb7e1 fix(plugins): use release from asset if differ from release name with GitHub resolver 2024-11-24 18:52:32 +00:00
Skylot baa93bad63 fix: additional checks for default switch case exit (#2351) 2024-11-24 18:19:33 +00:00
Skylot 45df80f036 build: enable gradle configuration caching 2024-11-17 00:07:10 +03:00
Skylot 792e0d6f3a chore: update gradle and dependencies 2024-11-17 00:07:10 +03:00
Jan S. fe9d3bcab7 fix(res): allow jumping backwards to an already processed position (PR #2344)
Use buffered stream to allow going backwards in stream in case the type chunk entries are not ordered properly (see #2343).
2024-11-15 15:12:47 +00:00
Skylot 1e1036c049 fix: disable usage of JDK Unsafe class in GSON (#2341) 2024-11-13 18:28:04 +00:00
Skylot 60dcdc7096 build: add missing modules for runtime JRE 2024-11-12 18:54:01 +00:00
Skylot c4c3d42d16 build: fix release workflow 2024-11-11 22:46:31 +00:00
Skylot 58c36de8c2 build: add release github workflow 2024-11-10 20:15:34 +00:00
Skylot b4ca566a19 build: exclude shadow jar from publishing to maven 2024-11-10 20:15:34 +00:00
Skylot e644bad758 chore: update dependencies 2024-11-10 20:15:34 +00:00
Skylot dd86abcc5e chore: remove LGTM config 2024-11-10 17:26:24 +00:00
Skylot f0513a1a55 fix: insert new filled array insn before first usage (#2340) 2024-11-07 20:02:41 +00:00
Skylot be6cb573b1 feat(plugins): allow to set minimum required jadx version in plugin info (#2314) 2024-11-06 16:30:22 +00:00
pubiqq 5d064d3e50 feat(res): improve resource names (PR #2316) 2024-11-06 18:08:35 +03:00
pubiqq 15b6309e2c fix: support "fall-through to default" case in switch-over-string (PR #2338) 2024-11-05 21:41:03 +00:00
Skylot 417bb7a7e9 feat: add method to update all blocks related info in method (#2335) 2024-11-02 22:08:26 +00:00
Ahmet Bilal Can 4c74e8e300 feat: give ability to plugins to edit blocks before locking (PR #2336)
Plugins can use `.before('BlockFinisher')` to edit blocks before they are locked.
2024-11-02 21:38:57 +00:00
Skylot 57238de6ff feat(cli): add option to disable plugins (#2277) 2024-11-01 20:13:34 +00:00
Skylot 313c4a121a fix: improve negation condition checks for switch over string (#2333) 2024-11-01 16:33:28 +00:00
pubiqq 39912398fc fix: unwrap consts in switch-over-string (PR #2332) 2024-10-31 21:24:19 +00:00
Skylot 7544d1a113 fix: prevent endless loop in pre header insertion mod (#2300) 2024-10-31 20:00:06 +00:00
pubiqq cfbe5ab672 fix: fix default branch position in switch-over-string (PR #2331) 2024-10-31 19:58:35 +00:00
Ruffalo Lavoisier 2661b91a6f feat(gui): create Frida hooking snippet for all methods in the class (PR #2328) 2024-10-30 17:59:29 +00:00
Skylot 61578e8793 fix(gui): correct tabs filter in "Close others" tab action (#2330) 2024-10-30 17:20:16 +00:00
Skylot cc6a893402 feat: allow to disable installed plugins (#2277) 2024-10-28 23:35:28 +03:00
pubiqq 4d8a5d6671 fix(core): fix primitive-to-primitive conversions (PR #2326) 2024-10-28 20:33:10 +00:00
Skylot 982307b1ac fix(gui): use correct section filter in plugins list 2024-10-25 19:01:43 +01:00
Skylot 37054dc84e fix(gui): load plugins settings in temp context without UI (#2206) 2024-10-25 18:51:38 +01:00
Skylot 343e2c531a chore: expand input dirs in ConvertArscFile 2024-10-25 18:12:48 +01:00
pubiqq 6fa5d247f0 fix(res): update Android attrs to API 35 (PR #2318) 2024-10-25 18:08:36 +01:00
pubiqq 688dea0c50 fix(deobf): update TLDs (PR#2320) 2024-10-25 16:44:07 +01:00
Skylot c0815b12bc chore(gui): add missing ref text in untranslated messages (#2319)
fix
2024-10-24 20:33:52 +03:00
JustFor 233f8692b2 fix(gui): update Messages_zh_CN.properties (PR #2319)
1. New text is translated simultaneously, two untranslated texts remain (no English text)
2. Adjusted and unified part of the symbol, into the full Angle symbol.
2024-10-24 18:31:14 +01:00
Skylot e5be41b9cc fix(gui): use another implementation for font dialog (#2310) 2024-10-22 21:32:14 +01:00
Skylot 3788e4ef3a fix(gui): in settings row reduce space between description and value 2024-10-22 18:52:42 +01:00
Skylot 32855f4511 fix(gui): improve plugins preferences group 2024-10-22 18:51:19 +01:00
Skylot 3d5e225274 fix: clear temp root dir instead delete (#2312) 2024-10-22 18:01:52 +01:00
nitram84 8a34d973ff build: use jadx-gui as a library in plugins (PR #2310)
* fix(gui): fix javadoc issues

* feat(gui): export jadx-gui as a library

* fix(gui): fix javadoc issues

* fix(gui): remove invalid characters for javadoc

* add jadx-library also for jadx-cli and jadx-script-ide modules

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-10-22 17:24:57 +01:00
Skylot a43b3282ef fix(gui): update check fixed to match current artifact naming 2024-10-17 21:57:20 +01:00
Skylot 249801880c feat(api): allow to get method code (#2305) 2024-10-17 19:20:07 +01:00
Skylot 742d30d770 chore: resolve warnings in SmaliArea class 2024-10-16 17:29:36 +01:00
Skylot 267413332a chore: resolve KtLint deprecation warning 2024-10-16 17:23:09 +01:00
Skylot f9c94f27f1 chore: update dependencies 2024-10-16 17:01:03 +01:00
Skylot d2131d9640 build: gradle wrapper validation not needed, check done in setup-java action 2024-10-16 17:00:43 +01:00
Skylot 548821c4df build: allow to change java toolchain for build and tests 2024-10-16 16:54:28 +01:00
pubiqq 958ab245ae fix(res): don't rename resource entries when useRawResName = true (PR #2306) 2024-10-14 20:32:12 +01:00
Skylot 8f3cc3e8c1 fix: add missing null check in codegen for classes generated by jadx 2024-10-14 19:19:31 +01:00
Skylot b872ffd1b9 fix: replace patched zip early in input files (#2302) 2024-10-12 20:53:09 +01:00
Skylot c5263f92fe fix(gui): send select tab event before code jump (#2292) 2024-10-12 21:23:53 +03:00
pubiqq 1475e887c8 fix: update reserved keywords (PR #2301) 2024-10-11 20:47:34 +01:00
Skylot c21cabcba7 fix: use temp dir env var only in apps 2024-10-10 22:57:40 +03:00
Skylot 063af8cd62 feat(api): add JadxArgs property to adjust xml security checks (#2291) 2024-10-10 22:57:40 +03:00
Skylot 2d10537050 chore: update dependencies 2024-10-10 22:57:40 +03:00
pubiqq 3814951408 feat: improve better name algorithm (PR #2299) 2024-10-10 20:01:57 +01:00
qfalconer 964bd62d35 feat: adding automatic patching for semi-corrupted APKs (PR #2298)
* feat: patching semi-corrupted APKs

* fix: using secure temp file creation

* fix: using TWR when handling the files
2024-10-10 17:53:26 +01:00
xiaojye 3ed2df828f feat(gui): add button to go to Android Manifest (PR #2296)
* feat: Add button to go to Android Manifest

* fix: Change the text from 'Go to Manifest' to 'Go to AndroidManifest.xml' and replace icon source
2024-10-10 17:11:08 +01:00
Skylot b26abdc851 feat(plugins): get config and cache dirs for plugins 2024-09-29 21:55:05 +01:00
Skylot 90185fd947 feat(plugins): get a main window reference as JFrame 2024-09-29 21:54:24 +01:00
Skylot 681f8a98b5 fix: improve checks for restore new filled array (#2289) 2024-09-28 16:52:08 +01:00
Skylot 0b225238fb feat: support restore of switch over string (basic case)(#2288) 2024-09-27 21:11:38 +01:00
Skylot a7649dda7a chore: update gradle and dependencies 2024-09-27 21:08:38 +01:00
pubiqq b5e3dcf70f feat: add the option to always use source file name as class name alias (PR #2287) 2024-09-23 22:47:08 +01:00
Skylot 7abbc81886 fix: improve switch out block search if all method exits are inside (#2264) 2024-09-22 21:35:40 +01:00
Skylot 9c30aeacdb refactor: split region maker 2024-09-22 20:23:03 +01:00
Skylot 8f27de4d0e chore: update dependencies 2024-09-21 22:00:03 +01:00
Skylot 02b69d2d29 fix(gui): prevent old refs leak in shortcuts controller 2024-09-21 21:53:31 +01:00
Skylot e6fde48b69 fix: don't add same 'loaded from:' comment for inner classes 2024-09-21 20:28:18 +01:00
Skylot 109dea0857 feat: support inner class contruction with outer instance (#2253) 2024-09-21 20:27:16 +01:00
Skylot 1d34328dd3 fix(build): disable cache for core tests to allow reruns (#2283) 2024-09-20 21:44:55 +01:00
Skylot ef4f1d3ed4 fix: ignore debug lines hints if numbers was adjusted for method 2024-09-20 21:36:13 +01:00
Skylot 23696d3971 fix: use type from new-instance if differ from constructor call (#2285) 2024-09-20 21:34:21 +01:00
Andy Smith efa2f5d172 feat(gui): limit search to a package (PR #2284)
* Add isDescendantOf and getJavaPackage helper functions

* Add i18n strings for search package

* Added search package to options in SearchSettings

* Add package limiting to each search provider

* Add package search to dialog and logic to get package by string.

* Added search option to package context menu

* Fix spotlessJavaCheck complaints

* Revert changes to individual search providers and add filter to base provider
2024-09-20 12:31:20 +03:00
Skylot 699ceb197e fix: improve condition branch checks in loops (#2274) 2024-09-16 20:37:34 +01:00
Skylot 5c83c22501 feat(java-input): support StackMapTable to get stack info for unvisited jumps (#2271) 2024-09-14 22:45:31 +01:00
Skylot 7bb5c0a859 fix: protect class deps from loading in different decompilation mode 2024-09-13 21:25:11 +01:00
Skylot 603863403f fix: do not add custom passes for fallback and simple modes (#2276) 2024-09-13 21:01:19 +01:00
Skylot 889a945cf1 fix: additional checks for class signature (#2272) 2024-09-12 20:29:05 +01:00
Skylot fd80e03809 fix: check if debug info offset is invalid (#1653) 2024-09-11 19:54:49 +01:00
Skylot b5807082d9 chore: update gradle and dependencies 2024-09-11 19:54:49 +01:00
Skylot 5d1f0b8cae feat(res): support grammar inflection flag in res config (#2270) 2024-09-08 21:49:13 +01:00
Skylot 3f9aa34057 fix(gui): resolve old objects reference leak in TabsController 2024-09-07 01:21:46 +03:00
Skylot e2c860f260 refactor(res): use list instead map to store entries offsets 2024-09-07 01:21:46 +03:00
Skylot 0938351d97 feat(res): support compact resource entries (#2268) 2024-09-07 01:21:42 +03:00
pubiqq 937dd20794 feat(res): support 16-bit entry offsets (PR #2269) 2024-09-06 23:21:21 +01:00
pubiqq ea5e87560a feat(res): improve error message for unsupported ResTable flags (PR #2266) 2024-09-05 19:13:26 +01:00
Skylot 5fbbf2150e fix(res): prevent duplication of ARSC entries (#2263) 2024-09-04 21:31:37 +01:00
Skylot 0e11bffe82 chore: update dependencies 2024-09-04 20:02:56 +01:00
Skylot ba9af5c288 fix(gui): minor fixes for code jumps 2024-09-04 19:59:57 +01:00
Skylot cca706c94f fix: improve 'continue' insertion for switch in loop (#2249) 2024-09-01 23:02:22 +01:00
Skylot 2df69bbfb4 fix(gui): prevent UI stuck on class load (#2259) 2024-08-31 22:30:18 +01:00
Skylot f5307636ef fix(gui): merge full class name tokens for constructors (#2261) 2024-08-30 22:39:43 +03:00
Mino 9a39b70a46 fix(gui): Quick Tabs Optimization (PR #2242)
* optimize tabs reorder

* restructure based on quick tabs architecture

* code formatting

* log all exceptions from background executor

* various improvements

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-08-30 20:33:05 +01:00
pubiqq e63808bc4b fix: improve checking of access modifiers (PR #2255) 2024-08-20 16:45:28 +03:00
Skylot 847225a6a9 fix: improve try/catch temp edges injection (#2247) 2024-08-17 21:09:31 +01:00
Skylot eee354a3ab chore: update gradle and dependencies 2024-08-17 21:01:27 +01:00
Skylot 1cc00a54f3 fix(gui): use correct translation in rename dialog (#2254) 2024-08-17 21:58:39 +03:00
pubiqq ffdad1b652 fix: improve checking of access modifiers for methods (PR #2252) 2024-08-15 23:20:07 +01:00
pubiqq 9a8ec76989 fix: improve checking of access modifiers for classes (PR #2251) 2024-08-15 19:59:44 +01:00
Skylot 0be5b2cea9 refactor(tests): add debug checks switch to jadx args 2024-08-13 22:39:48 +01:00
Skylot c94201be4a fix: improve switch out search in loop (#2246) 2024-08-12 22:06:03 +01:00
Skylot 1051dacb1e refactor(tests): migrate from Hamcrest to AssertJ 2024-08-11 21:55:56 +01:00
Skylot a2bfe9bbe8 chore: add openrewrite gradle plugin to improve code quality 2024-08-11 21:10:01 +01:00
Skylot 8c6ec3bccc fix(gui): trim also leading spaces in paths from file dialog (#2244) 2024-08-10 19:24:05 +01:00
Skylot 015876b790 fix(gui): trim trailing spaces in input files (#2244) 2024-08-10 00:31:25 +01:00
Skylot 280f3870a9 fix: handle quick return on branched constructor (#2240) 2024-08-09 22:54:13 +01:00
Skylot e9d770ae9e fix: use correct approach to get prev block on path (#2239) 2024-08-09 22:51:37 +01:00
Skylot 5f1bd1d9ba chore: migrate gradle shadow plugin 2024-08-08 20:44:34 +01:00
pubiqq 60fb458024 fix: improve inlining synthetic accessors (PR #2243)
* fix: fix inlining synthetic accessors

* add test, undo changes in InsnNode

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-08-08 20:27:08 +01:00
Skylot 1b08779536 chore: update dependencies 2024-08-07 19:06:58 +01:00
Skylot c37e39a819 chore: code improvements by cleanthat 2024-08-07 00:34:22 +01:00
Skylot 2d58fbd4b1 chore: forbid use ArrayList as a variable type 2024-08-07 00:28:39 +01:00
Mino ffbf800404 feat(gui): Quick Tabs Overhaul (PR #2241)
* restructure quick tabs code

* code formatting

* display open tabs

* added bookmark tabs feature

* fix tabs pin and bookmark not saved

* fix NPE treeModel not initialized

* Fix hardcoded strings

* remove unused statement

* fix NPE again

* added bookmark overlay

* preserve tabs order

* fix context menu actions

* remove unnecessary public modifier

* save tabs in tabbedpane order

* remove unreferenced tabs

* Update jadx-gui/src/main/java/jadx/gui/ui/tab/TabComponent.java

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2024-08-06 23:47:25 +01:00
dependabot[bot] 500aa8a68d build(deps): bump gradle/actions from 3 to 4 (PR #2238)
Bumps [gradle/actions](https://github.com/gradle/actions) from 3 to 4.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](https://github.com/gradle/actions/compare/v3...v4)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 18:35:39 +01:00
Skylot 58e8268126 fix: workaround to make method inline deterministic (#1089) 2024-08-04 22:46:46 +01:00
Skylot f9da6e00ed fix(gui): add VM flags to fix UI ghosting (#2225) 2024-08-04 19:40:14 +01:00
Skylot 821cc668c7 fix: don't rerun SSA transform in ConstructorVisitor (#2236) 2024-08-02 21:26:25 +01:00
Skylot 287ba49008 fix(gui): show folding actions in code popup menu (#2234) 2024-08-02 17:13:16 +01:00
pubiqq 115e563a2b fix: improve checking if methods are inline for FixAccessModifiers (PR #2235) 2024-08-01 21:45:52 +01:00
Mino 1669200e62 feat(gui): smali code folding (PR #2233)
* added smali code folding

* remove unnecessary public modifiers

* improve code

* undo method extract

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-08-01 19:33:37 +01:00
Mino 6ab224ea0d feat(gui): pin tabs (PR #2230)
* add ability to pin tabs

* save pinned tabs with Save Project action

* further prevent closing pinned tabs

* add translation entries

* prevent pinning start page

* add pinned tabs tree view

* properly dispose of quickTabsTree

* restructure code

* more unpin context menu items
2024-08-01 18:06:45 +01:00
pubiqq 61855a7ea1 fix: make detailed var info deterministic (PR #2231) 2024-07-31 22:16:07 +01:00
Mino bda3119e86 fix(gui): horizontal scrolling in Linux (PR #2229)
* fix horizontal scrolling in linux

* improve code

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-07-31 17:02:00 +01:00
Mino b26abed686 feat(gui): export resource/class/package (PR #2228)
* feat: export resource

* feat: export class

* restructure code: introduce enum for exporting classes

* feat: export package

* feat: export resource folder

* check directory exists before creation

* apply code formatting

* fix code formatting

* Apply suggestions from code review

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2024-07-31 17:00:54 +01:00
Skylot c179beee95 chore: update dependencies 2024-07-28 20:57:37 +01:00
Skylot 04a454094b fix: improve exception handlers checks (#2086) 2024-07-27 22:09:14 +01:00
Skylot 33bcbfec41 chore(docs): minor fixes 2024-07-27 22:09:13 +01:00
Skylot ec645d80b1 fix(mappings): try to prevent mapping file reset on export exception, refactor and fix code to avoid NPE (#2220)(#2226) 2024-07-25 17:44:23 +01:00
Jan S. a8d889de3d fix(launch4j): do not overwrite Java heap configuration from applicationDefaultJvmArgs (PR #2218) 2024-07-20 20:46:45 +01:00
Skylot ec0bf701c8 fix(build): fix hiding console in Windows (#2196)
Regression after migration to shadow jar in #1868,
instead CreateStartScripts task from 'application' plugin
'startShadowScripts' task should be modified.
2024-07-19 00:19:47 +03:00
Skylot ad4dd116be chore: update gradle and dependencies 2024-07-19 00:19:47 +03:00
Skylot ef79f266c8 fix(build): fix gitlab build 2024-07-19 00:19:43 +03:00
Jan S 366225f9be fix(quark): fix automated installation and check exit code of executed external commands (#2119)(PR #2216) 2024-07-12 18:39:17 +01:00
Skylot 730db0d24f fix(build): do not wrap jar in launch4j (#2186) 2024-07-08 22:17:06 +01:00
Iscle 05fb77e9bd feat(gui): add button to go to Application class (#2208)(PR #2213)
* feat: Add button to go to Application class

Icons from: https://intellij-icons.jetbrains.design/

* fix: Rename "goto" to "go_to" to keep things consistent
2024-07-08 18:36:45 +01:00
Iscle bbabfa0354 fix(gui): fix Xposed args code generation (PR #2212)
* Rename .java to .kt

* fix: Fix wrong function arguments when generating kotlin xposed code
2024-07-08 18:34:28 +01:00
Jan S 96bd9f0f17 fix(xml): AXML/Manifest parsing improvements (PR #2211)
* log and ignore decodeValue errors

* skip extra data in package header

* ResourceTypes.h
2024-07-06 19:27:47 +03:00
qfalconer fd5b397b40 fix(xml): allow for non-standard attributes sizes and avoid index exceptions when decoding some strings (PR #2210)
More lenient AXML parsing: allow for non-standard attributes sizes and avoid index exceptions when decoding some strings

* The attributes size of an XML element is now accounted for. This size must be at least 20 (0x14) bytes but can be greater. Extra bytes are just skipped. When decoding a string, if such decoding is impossible a placeholder string is returned instead of throwing an exception. This is necessary because some malware purposely add android:tag attributes with invalid string index to throw parsers off. They also employ non-standard attribute sizes.

* Minor code restyling

---------

Co-authored-by: qfalconer <knm241@gmail.com>
2024-07-03 18:50:15 +01:00
Artem Zhiganov f5e3a261b4 fix(gui): update russian translation (PR #2209)
Co-authored-by: SVolf <dev@thunderdog.ru>
2024-06-28 18:39:23 +01:00
JustFor 52a884608a fix(gui): update Messages_zh_CN.properties (PR #2203)
sync new texts.
2024-06-14 18:52:31 +01:00
Iscle 74ddfde950 feat(gui): allow to check for unstable releases (PR #2200)
* feat: gui: convert JadxUpdate to Kotlin

* feat: gui: allow updater to check for latest unstable artifacts

* fix: remove nullable operator from onUpdate() interface
2024-06-11 22:49:44 +01:00
Skylot 9aacb4f312 fix: config dir was used instead cache dir 2024-06-11 20:55:49 +01:00
Jiaxin Peng 82e2104f3c fix(gui): support filtering files with multiple extensions in file dialog (PR #2185)
* fix(gui): support filtering files with multiple extensions in file dialog

* lint
2024-05-19 17:47:35 +01:00
Skylot 09fa35f144 feat: allow to change config and cache dirs with env vars (#2159) 2024-04-27 21:48:42 +01:00
Skylot f2a6a1e942 build: update JDK to 21 for windows artifacts 2024-04-27 17:40:06 +01:00
Andrei Kudryavtsev b85900aa3d feat: move AAB support to separate plugin (PR #2165)
* wip: finished with factories

* wip: bundleconfig.pb

* wip: jadx-aab-input, separate BundleConfig parser

* wip: removed test apks

* wip: proto xml pretty print

* wip: fixed getNamedValues NPE

* minor fixes

* spotless

* enabled zip64 for gui shadow jar

* spotless

* spotless

* reverted manifest identification since signature parsing not working at the moment

* replace static methods with new API methods

---------

Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-04-26 21:54:54 +01:00
Jan S 37a42d1418 fix(gui): show correct content of binary resources in hex view (#2160) (PR #2166) 2024-04-24 19:29:52 +01:00
Jan S 07dde05337 fix(build): configure launch4j to not change current directory (#2162) (PR #2163) 2024-04-24 18:52:08 +01:00
Nick 8618214c7f docs: improve installation section (PR #2161)
* Update README.md

* Update README.md
2024-04-24 18:43:05 +01:00
Skylot b80f32a36f fix(smali-input): compile one smali file at a time to avoid 64k limit (#2158) 2024-04-23 22:14:59 +01:00
Skylot ce527ed753 fix(build): add missing files in bundle 2024-04-20 21:04:17 +01:00
Skylot f2ea6415c9 fix(cli): don't print stacktrace for incorrect options (#2140) 2024-04-20 18:06:30 +01:00
Skylot bc70f8eabb fix: use correct new line string for simple code writer 2024-04-20 17:37:45 +01:00
Skylot be25cbf8c2 fix: use common parser for manifest, verify app package 2024-04-20 17:37:45 +01:00
Skylot f9c0cad146 chore: update dependencies 2024-04-19 20:14:25 +01:00
Skylot b356ff76e1 fix: improve StringBuilder elimination (#2148) 2024-04-19 20:14:25 +01:00
Skylot ec9244a635 fix(gui): use common code for manifest parsing in debugger 2024-04-19 20:14:25 +01:00
omerfarukkykc a5bd64461d fix(gui): remember selected device in debugger (PR #2153)
* ADBDialog->launchApp() if multiple devices presented should let user select the one they desire.

* compare objects directly instead parsing

---------

Co-authored-by: Ömer Faruk KAYIKCI <omer.kayikci@tubitak.gov.tr>
Co-authored-by: Skylot <118523+skylot@users.noreply.github.com>
2024-04-19 19:02:12 +01:00
dependabot[bot] 54bf79ccc5 build(deps): bump gradle/wrapper-validation-action from 2 to 3 (#2149) 2024-04-15 18:17:48 +00:00
Skylot 6182332eef fix: avoid self-loop for exception handlers (#2147) 2024-04-11 23:07:45 +03:00
Skylot 37b57096ec fix: allow use FieldInfo as switch key (#2147) 2024-04-11 23:07:44 +03:00
Skylot 6aab8fabc9 chore: update dependencies 2024-04-11 23:07:41 +03:00
JustFor 665c1e57d2 fix(gui): update Messages_zh_CN.properties (PR #2146)
Sync new Jadx text.
2024-04-09 22:11:24 +01:00
Skylot 6e8affcbdc feat: add options to JadxArgs to change code new line and indent (#1945, #1948) 2024-04-08 21:51:24 +01:00
Skylot 41d6b0018e fix: add missing " * " on new line for block comments, flip addCodeComment args (#2145) 2024-04-08 21:34:34 +01:00
Skylot dbadbb01fc refactor: rename method collectArgsWithoutLoading into collectArgNodes in MethodNode (#2142) 2024-04-07 23:09:02 +01:00
Skylot 0f52077c5c feat: allow to set style for code comments (#2145) 2024-04-07 23:06:32 +01:00
Skylot ea861829c7 fix: support end block entry for mutli-entry loops (#889) 2024-04-06 22:49:32 +01:00
Skylot c1de235289 fix: in anonymous class checks ignore instance fields not used outside 2024-04-06 22:45:30 +01:00
Skylot 8f969d4e89 chore: update gradle and dependencies 2024-04-03 21:03:48 +01:00
Skylot 0c1f830f94 fix: lambda decoding and code generation (#2139) 2024-04-03 21:03:48 +01:00
Skylot 43c082e4da feat: replace Android resource ids with android.R fields (#2119) 2024-03-31 20:37:33 +01:00
Skylot ecdc4e6757 refactor: move constant collection into separate pass (#2119) 2024-03-30 21:51:02 +00:00
Skylot b865c9c687 refactor: allow store unresolved fields in ConstStorage (#2119) 2024-03-30 20:52:31 +00:00
xnumad 6b4976c593 fix(gui): handle paths where file name is null (#2136)(PR #2137)
* fix: Ignore invalid files

Avoid NullPointerException when using "Open files" or drag-n-drop

* refactor: Replace Stream API chain with loop

IntelliJ

* fix: Ignore invalid files

Avoid NullPointerException when using "Add files"

* fix: Fall back to complete path string

Instead of empty project name

* fix: Render tree

Project tree (sidebar) didn’t load
Toggling "View > Show flatten packages" threw a NPE here

* fix code formatting

---------

Co-authored-by: Skylot <skylot@gmail.com>
2024-03-29 22:30:01 +00:00
Skylot 2807dc5090 fix(script): add example script for resources rename (#2126) 2024-03-20 18:46:44 +00:00
Skylot 463d2b90fa fix: don't apply node positions and prevent eager loading for custom decompile modes (#2116) 2024-03-19 20:23:04 +00:00
Skylot bff00d101f fix(script): add option flags, fix missing script options in help 2024-03-19 20:22:50 +00:00
Skylot 1290ef63a2 fix(build): enable publish to maven for rename-mappings plugin 2024-03-16 21:58:03 +03:00
Skylot 49d2b34d84 chore: update dependencies 2024-03-16 21:58:00 +03:00
CKCat eecdfae73f fix(res): resolve some manifest decode errors (PR #2122)
* The elementSize may be larger than the actual size of the element chunk.

* end namespace chunk size can be any value.

* keep at least a warning.
2024-03-16 18:57:10 +00:00
JustFor 8760b4ddde fix(gui): copy strings without quotes (PR #2121)
* Update AbstractCodeArea.java

In general, we need data, not text in code. But now every time you copy the highlighted text, you copy the highlighted quotes as well. This often results in an extra need to delete the quotation marks around the sides, which is confusing.
Now when copying selected highlighted text, quotes are not copied in.

* Update AbstractCodeArea.java

fix code format

* additional checks, move to common method

---------

Co-authored-by: Skylot <skylot@gmail.com>
2024-03-16 18:55:57 +00:00
Andrei Kudryavtsev 3599b248a4 feat(gui): dragging tab appearance settings (#2120)(PR #2118) 2024-03-08 23:11:58 +03:00
bagipro 2fdd496518 fix(res): add indents for namespace declarations (PR #2114)
Co-authored-by: bagipro <bugi@bugi>
2024-03-01 16:32:47 +00:00
bagipro 278e3c2d47 fix(res): avoid duplicated XML attributes (PR #2112)
Co-authored-by: bagipro <bugi@bugi>
2024-02-27 18:49:09 +00:00
bagipro 881a716b8e fix(res): fixed XML proto parsing for removed debug data (PR #2111)
* Fixed XML proto parsing for removed debug data

* Fixed codestyle check

---------

Co-authored-by: bagipro <bugi@bugi>
2024-02-27 17:34:37 +00:00
Skylot a73c9e90fc fix(dex-input): improve error report message for invalid dex checksum 2024-02-26 19:36:28 +00:00
Skylot 56749b2afb chore: update dependencies 2024-02-25 22:38:00 +03:00
Andrei Kudryavtsev d7ec35791b feat(gui): tabs drag and drop reorder support (#1212) (PR #2109) 2024-02-25 19:36:46 +00:00
Skylot d51362ed50 fix: don't remove exception handlers (#2104) 2024-02-19 20:18:44 +00:00
Skylot 5c0c1daa71 fix(gui): use new RSTA line number formatter API to show source lines 2024-02-16 18:38:56 +00:00
Skylot 603ea3989a chore: update dependencies 2024-02-16 17:41:37 +00:00
Emiel Matthys 018ff98df7 feat(gui): remember save preference decision (PR #2103)
* First version

* Use dropdown

* Spotless

* Language strings and tests

* Comment out translated versions

* Remove more translations

---------

Co-authored-by: Emiel Matthys <emiel.matthys@guardsquare.com>
2024-02-15 18:00:37 +00:00
nitram84 5fbabdefca fix: NPE in unused EcxHandler block removal code (#2086) (PR #2104) 2024-02-15 17:57:30 +00:00
nitram84 13607fc8b6 fix(res): add missing namespace declarations (PR #2102)
* fix(res): add missing namespace declarations

* remove `writer.getIndent() == 0`

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2024-02-15 17:56:39 +00:00
DanielFi 0c33d723c8 fix: optimize switch fallthrough (PR #2054)
* cache post dom map between switch cases
* cache post dom map of whole methods
* calculate full post dom tree, fix switch out block detection

---------

Co-authored-by: Skylot <skylot@gmail.com>
2024-02-14 18:31:38 +00:00
Skylot 0143423dc9 fix: use empty line before field in correct place (#2101) 2024-02-12 15:39:41 +00:00
Skylot 21b1452485 chore: update gradle and dependencies 2024-02-12 15:39:40 +00:00
Skylot ecb8abb98e fix: correct rollback if type update failed (#2090) 2024-02-10 16:08:51 +00:00
Skylot a3a4fabd5a fix: store classes access flags in class set 2024-02-07 22:10:31 +03:00
Skylot edf6ce273c fix: clear node flags for custom decompilation mode 2024-02-06 21:54:41 +03:00
dependabot[bot] 1bb956a8b0 build(deps): bump gradle/wrapper-validation-action from 1 to 2 (PR #2099)
Bumps [gradle/wrapper-validation-action](https://github.com/gradle/wrapper-validation-action) from 1 to 2.
- [Release notes](https://github.com/gradle/wrapper-validation-action/releases)
- [Commits](https://github.com/gradle/wrapper-validation-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: gradle/wrapper-validation-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-05 18:38:02 +00:00
Away 276ee537e1 fix: remove unused ExcHandlers blocks (PR #2086)
* Removing unused ExcHandlers blocks

* Improving removing unused ExcHandlers blocks

* Removing gradlew of the commit

* Adding test 2 for UnreachableCatch

* Update jadx-core/src/test/java/jadx/tests/integration/trycatch/TestUnreachableCatch2.java

---------

Co-authored-by: Away-pp <vladimir@DESKTOP-KESF23K>
Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2024-02-04 18:02:34 +00:00
Andrei Kudryavtsev 7e628ad1a1 fix(gui): detecting tab click with mousePressed instead of mouseClicked (PR #2097) 2024-02-04 17:36:02 +00:00
Sebastian Gallese 0a40b53412 docs: update Build Status shield in README (PR #2095) 2024-02-01 17:20:02 +00:00
dependabot[bot] 682f90de2f build(deps): bump gradle/gradle-build-action from 2 to 3 (PR #2094)
* build(deps): bump gradle/gradle-build-action from 2 to 3

Bumps [gradle/gradle-build-action](https://github.com/gradle/gradle-build-action) from 2 to 3.
- [Release notes](https://github.com/gradle/gradle-build-action/releases)
- [Commits](https://github.com/gradle/gradle-build-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: gradle/gradle-build-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* migrate to gradle/actions/setup-gradle@v3

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2024-01-29 20:00:31 +00:00
Skylot 1a07ab8ab1 chore: update dependencies 2024-01-25 20:10:39 +00:00
Skylot d86449a8ea fix(res): ignore resource table entries with '../' in name 2024-01-25 20:09:21 +00:00
Skylot 75d2e540aa refactor: add new task executor, remove task barrier (#1879) 2024-01-25 19:45:23 +00:00
bagipro e73612b4d2 feat(res): disable XML pretty print (PR #2087)
Co-authored-by: bagipro <bugi@bugi>
2024-01-22 15:01:38 +00:00
Away a19aec9d9f fix: use correct order in removeUnreachableBlocks (PR #2085)
* Fixing wrong order in removeUnreachableBlocks
* Removing dead code in TestTernary4 test
* Do not clear instructions in detach blocks method
2024-01-21 16:05:02 +00:00
Skylot 61be1d8b0a fix(gui): allow to reset variable name, fix renames for inner classes 2024-01-18 20:36:51 +00:00
Skylot 4483533417 fix(gui): highlight word even if cursor at the end of that word (#2083) 2024-01-18 19:40:53 +00:00
Skylot fb703cd856 fix(gui): scroll to first error on jadx script check/run 2024-01-18 18:17:53 +00:00
Skylot c0ff7572ac fix(gui): round file size to block size for cache usage calculation 2024-01-17 18:25:35 +00:00
Skylot 8e7ffc8ddb fix: support switch over enum by ordinal 2024-01-16 20:40:51 +00:00
Skylot f994abee21 build: add Java 21 to Gitlab CI 2024-01-15 19:34:29 +00:00
Skylot 6f1dfb6848 chore: update dependencies 2024-01-15 22:18:45 +03:00
Skylot 306bc7abc3 feat(java-input): support jsr/ret opcodes (#2039) 2024-01-15 22:18:44 +03:00
Skylot 8ed48183c7 feat(plugins): add API for search/use other plugins 2024-01-15 22:18:44 +03:00
Skylot fdc3fe1a8d fix(java-input): use correct registers for dup2_x* opcodes 2024-01-15 22:18:44 +03:00
Away 2805770510 fix: removeUnreachable not searching in all blocks (PR #2082)
Co-authored-by: Away-pp <vladimir@DESKTOP-KESF23K>
2024-01-14 17:07:39 +00:00
Skylot 03052baabe chore: update dependencies 2024-01-11 19:10:44 +00:00
Iscle 23e643c686 fix(gui): attempt to resolve field rename issues with shortcut (#1440)(PR#2075)
This is an attempt to fix the issues that sometimes arise when renaming functions or variables using the "n" shortcut as stated in issue #1440.

The reasoning behind the change: The instance creation of the RenameDialog was somehow affecting the UI thread and not allowing for the key release event to be dispatched. By running everything inside the invokeLater block, this might get fixed as it will execute after all previous tasks are finished.
We now also only show the dialog after EVERYTHING is set up, not before.
2024-01-05 21:42:06 +03:00
Iscle faeae086d1 feat(gui): improve search bar behavior when using key bindings (PR #2074)
Before, the search bar would toggle, which was quite annoying. Now, it replicates IntelliJ's search bar behaviour.

1.1. If the user has selected text, use that as the search text
1.2. Otherwise, use the previous search text (or empty if none)
2. Select all text in the search bar and give it focus
2024-01-05 21:31:34 +03:00
Iscle 38e64fafbd feat: add an option to generate kotlin code for xposed (PR #2070)
* feat: add an option to generate kotlin code for xposed

A new setting was added, bumping the settings version to 19.

* refactor: applied spotless

* refactor: fixed formatting

* refactor: fixed formatting once again
2024-01-05 21:24:08 +03:00
Skylot e723c245ee fix: use correct type printer in json output mode (#2053) 2023-12-23 18:46:39 +00:00
Skylot 3e57dacfd3 chore: update dependencies 2023-12-21 19:00:33 +00:00
Iscle f5accc8464 feat: add support for xapk files (#1597)(PR #2064)
* feat: annotate JadxPlugin with NotNull

Allows for better Kotlin support

* feat: add support for custom resources loader

* feat: add support for xapk resources loading

* fix: rename "decode" to "load"

* refactor: annotate JadxCodeInput with NotNull

* feat: add support for xapk code loading

* feat: add xapk support to file filter

* fix code formatting

* revert NotNull annotation

* several improvements

* refactor: fix typo

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-12-21 18:46:40 +00:00
Skylot 238fe17df0 fix(gui): add hint for class renaming (#1590) 2023-12-18 18:14:56 +00:00
Skylot 295befbaaa fix: check class alias for Kotlin Intrinsics search (#1590) 2023-12-18 18:14:56 +00:00
dependabot[bot] 5f20033f18 build(deps): bump actions/upload-artifact from 3 to 4 (#2060)
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-18 17:59:11 +00:00
dependabot[bot] 5f376c6e21 build(deps): bump github/codeql-action from 2 to 3 (#2061)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 2 to 3.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-18 17:57:37 +00:00
Skylot 68a99c5410 chore: update dependencies 2023-12-16 19:20:45 +03:00
Skylot 8db70ee7a5 fix(gui): resolve reset and commit issues for disk code cache 2023-12-16 19:20:43 +03:00
LanBaiCode b6155afd32 fix(gui): use correct type for generic params in Xposed snippet (PR #2057)
* Fix: Resolved an issue with incorrectly generated xposedMethodSnippet when the parameter type is generic.
Add: Introduced xposedGenerateFieldSnippet.

* fix code format

* Fixed: Resolved the issue where Xposed code generation was incorrect when dealing with generic parameters and alias fields.

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2023-12-11 17:14:10 +00:00
Away-pp d5bf9f20a6 fix: IndexOutOfBoundsException with negative register index (PR #2056)
Co-authored-by: Away-pp <awaytesting1@gmail.com>
2023-12-10 18:51:25 +00:00
Skylot 2d5c0fda4a fix: prefer early return for 'if-else-if' block (#2052) 2023-12-05 21:08:22 +00:00
Skylot 5d56001826 build(deps): migrate to Google fork of Smali 2023-12-04 20:42:09 +00:00
Skylot 2de91f9a3a chore: update gradle and dependencies 2023-12-04 23:18:51 +03:00
dependabot[bot] e06e6bd483 build(deps): bump actions/setup-java from 3 to 4 (#2051)
Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4.
- [Release notes](https://github.com/actions/setup-java/releases)
- [Commits](https://github.com/actions/setup-java/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-java
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-04 19:55:32 +00:00
nitram84 1e57e85382 fix: gradle export for APKs without strings.xml (PR #2050) 2023-12-03 17:38:46 +00:00
LanBaiCode ca03406a3d fix: correct type for generic params in Xposed snippet, add fields support (PR #2047)
* Fix: Resolved an issue with incorrectly generated xposedMethodSnippet when the parameter type is generic.
Add: Introduced xposedGenerateFieldSnippet.

* fix code format

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2023-11-25 17:55:53 +00:00
Skylot 2d28da9b0e feat: allow to set zip max entries count using env var (#1751) 2023-11-16 20:48:08 +03:00
Skylot edb1717969 fix: support variables reuse for enum restore (#2042) 2023-11-16 20:48:07 +03:00
Skylot 1b51234edc chore: update dependencies 2023-11-16 20:48:07 +03:00
nitram84 e6d896d91e fix(plugin): check for valid identifiers from Kotlin metadata (PR #2041) 2023-11-10 22:29:54 +00:00
Skylot a989fa7e64 refactor(deobf): split deobfuscation conditions (#2040) 2023-11-05 20:22:15 +00:00
nitram84 f7002c7fad feat(deobf): implement a whitelist for deobfuscation (PR #2040) 2023-11-05 20:21:41 +00:00
Skylot 41d986bdca feat(script): use cache for compiled scripts 2023-10-27 23:35:03 +03:00
Skylot 192a8116f1 chore: update FlatLaf 2023-10-27 23:35:01 +03:00
Markslin 173d85bf84 fix(res): resolve resourceIds reuse issue (PR #2037)
Co-authored-by: mingyinsun <mingyinsun@tencent.com>
2023-10-24 18:47:17 +01:00
Skylot b310e92d7a fix: inline CMP instructions to help conditions merge (#2033) 2023-10-21 23:08:00 +01:00
Skylot 4a92ee07cc fix(gui): hide not needed popup action for not editable code 2023-10-21 23:08:00 +01:00
Skylot fdffe20c46 fix(gui): another try to fix code search 2023-10-21 23:08:00 +01:00
Skylot 15d464d620 fix(gui): improve code and method search (#2033) 2023-10-18 21:53:40 +01:00
Skylot 1bd4526e4c fix: improve restructure of nested try/catch/finally blocks (#2033) 2023-10-15 20:06:35 +01:00
Skylot 816308e3ca chore: update dependencies 2023-10-15 20:06:35 +01:00
rawer886 cfd851a980 fix: use correct imports for classes from default package (PR #2031)
* fix: use fully qualified package names for classes of defpackage

* fix: use correct imports for classes from default package (#2027)
---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-10-11 20:04:03 +01:00
Julian Burner d129be7e86 fix: update to Mapping-IO 0.5 (PR #2029)
* Update to Mapping-IO 0.5

* Fix Spotless error

* Fix Spotless error (2)

* Sort mappings by name when exporting
2023-10-09 18:46:51 +01:00
Skylot 6433fcef72 chore: update gradle and dependencies 2023-10-07 18:08:44 +01:00
Jan S d120556772 fix(res): add resource entry offset check (PR #2024) 2023-10-06 17:25:36 +00:00
Skylot 19f40b8549 feat(cli): add option to show available plugins list 2023-09-27 19:44:58 +01:00
Skylot 89acf73010 feat(plugins): cache available plugin list 2023-09-27 19:44:53 +01:00
Goooler b70276d896 fix(gui): update zh_CN translation (PR #2022) 2023-09-27 16:19:11 +01:00
5idereal 76b370e249 update zh_TW translation (#2021) 2023-09-26 17:15:09 +01:00
Skylot b73f2ef0b9 fix(res): place xml attributes on new line (#2012) 2023-09-24 20:40:33 +01:00
Skylot 762c2d70bd chore: fix typos 2023-09-24 18:53:39 +01:00
Skylot 4e81bdd76f chore: update dependencies 2023-09-22 20:32:40 +01:00
Skylot 4d87b447a6 chore: remove unused code in ClsSet class (#2020) 2023-09-22 20:31:56 +01:00
Roni Ragil Iman Khoirul 8f0d0e4f4d feat: add Indonesian translation (PR #2018)
* Add Indonesian translation

* fix load i18n resources with deprecated language codes

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-09-20 19:26:59 +01:00
Skylot c39a696977 feat(script): add methods for apply renames and reload tabs (#2008) 2023-09-15 21:50:47 +01:00
Cesaryuan b78a0257b4 fix(gui): improve highlight in UsageDialog (#2006)(PR #2007) 2023-09-15 16:19:13 +01:00
xnumad cdede7eca4 docs: update Arch Linux version badge (PR #2005) 2023-09-14 18:33:31 +01:00
Skylot 72180164d8 chore(script): add example for rename method param from annotation (#2004) 2023-09-12 20:22:14 +01:00
Skylot 2dc0db230c chore(script): adjust scripts format 2023-09-12 20:21:02 +01:00
Skylot 24657f6b3c fix(plugins): add a better way to init plugins options 2023-09-11 21:50:48 +01:00
Skylot e358476c71 fix: attempt to improve package rename checks (#1997) 2023-09-09 20:16:57 +01:00
Skylot 45a637f33b feat: allow to disable zip security checks (#1579, #980) 2023-09-09 16:10:59 +01:00
Skylot 76cf9596e2 build: fix win bundle script 2023-09-07 20:06:40 +01:00
Skylot 95c07a4e76 fix: synchronize attributes map writes (#2001) 2023-09-07 16:59:20 +01:00
Skylot 2d1d5a419c chore: update dependencies, resolve gradle warnings 2023-09-07 16:15:05 +01:00
dependabot[bot] f45547e2c1 build(deps): bump actions/checkout from 3 to 4 (PR #2000)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-04 18:57:40 +01:00
Jan S 1f463c7152 fix: exclude ZIP entries of less than 25MB uncompressed size from ZIP bomb check (#1570)(PR #1998) 2023-09-02 17:58:09 +01:00
Skylot 2c92c6b0a6 chore(script): add example deobf from toString script (#1996) 2023-09-01 21:18:58 +01:00
Skylot f83ee45ac8 chore: update gradle and dependencies 2023-08-31 21:31:56 +01:00
Jan S f695fafe74 chore(debugger): improve code and add details to error messages (PR #1982)
* chore: created list entry getter getRegListEntry for problematic code;
use specific containers/fields instead of SimpleEntry;
* chore: include details on the used ArtAdapter in error message
* add device info to registers exception

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-08-30 22:58:59 +01:00
Skylot f6ab105ef7 chore: use github issue forms for templates 2023-08-11 20:28:35 +01:00
Skylot f81a2c4ebb chore: update dependencies 2023-08-11 17:36:14 +01:00
Skylot c602b3d967 feat: add support for 'package-info' (#1967) 2023-08-07 18:46:49 +01:00
Skylot f213082da5 feat(gui): load available plugins from jadx-plugins-list 2023-08-05 22:41:51 +01:00
Skylot 8d26fa2a89 build: don't publish to maven rename-mappings plugin 2023-08-05 19:27:15 +01:00
Skylot a06231d007 fix(plugins): do not parse kotlin metadata if all options disabled 2023-08-05 19:26:28 +01:00
Mino 68b84ea786 feat(gui): allow user to set custom shortcuts (#1479)(PR #1980)
* feat(gui): allow user to customize shortcuts

* internal: fixed other constructor for jadx action

* make code area actions customizable

* show warning dialog when mouse button is commonly used

* applied code formatting

* code formatting and and moved string to resources

* moved action related classes to their own package

* added fix for actions with modifiers in macos

* ignore left click in shortcut edit

* applied code formatting

* warn user when a duplicate shortcut is entered

* save shortcut when key is pressed (instead of typed)

* fix node under mouse being ignored

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>

* add missing import

* applied code formatting

* added custom shortcuts support to script content panel

* save shortcut when key is released (instead of pressed)

* enable custom shortcut in script autocomplete

* fix duplicate shortcut warning when the shortcut is set again at the same action

* fixed mouse buttons shortcut not working for code area

* fix exception with mouse button shortcuts

* fix action getting fired twice

* added variants for forward and back nav actions

* fix exception when shortcut is not saved

* fix mouse button shortcut for auto complete action

* consume mouse event if bound to an action

* workaround not being able to extend HashMap

* fix exception in script code area when using mouse button shortcut

* minor pref serialiazation improvement

* fix action buttons not working (like run action)

* fix exception with plugin actinos

* fixed nullptr when adding an action with null actionmodel to jadxmenu

* fix plugin action name not showing

---------

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2023-08-03 20:05:25 +01:00
Skylot 868e99e0b5 build: add windows host for build tests 2023-08-01 18:44:53 +01:00
Mino 95db98e574 fix: resolve exception when androidmanifest.xml is not found (PR #1978) 2023-07-31 22:27:52 +01:00
Mino 63fc7e05b6 refactor: reuse the same parser in main activity action and gradle export feature (PR #1971)
* internal: reuse the same parser in Main Activity action and export gradle project

* removed unnecessary logs

* fixed code formatting issues

* removed no longer used methods

* optimize imports

* fix exception when app name isn't found

* use EnumSet instead of int for parse flags

* moved ApplicationParams class under android utils package

* moved attributes parsing to a seperate method

* fallback to any strings.xml if default one is not found
2023-07-31 18:50:47 +01:00
Jan S 2c2bb64c09 fix(tests): ResXmlGenTest fails on Windows (PR #1972)
* fix(core): fix ResXmlGenTest fails on Windows
* code style
2023-07-31 17:51:59 +01:00
Mino 0f5d07c6b1 feat(gui): hex-viewer for binary asset files (#198)(PR #1969)
* implemented hex-viewer feature

* added support for opening lib (.so) files

* removed unused class

* fix formatting

* fixed error when opening an empty file

* fixed a slight inaccuracy in synchronizing highlights

* defaulted little endian to false

* synchronize hex editor with theme and use smali font

* fixed wrong displayed values

* applied code formatting

* fixed selection color in preview panel

* Changed Smali Editor font entry in settings less confusing
2023-07-31 00:02:39 +01:00
Ohad Shai fbb6aa580e chore: upgrade to kotlin-logging 5 (PR #1966)
* upgrade to kotlin-logging 5
* apply code autoformatting
* resolve deprecation warnings

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-07-30 19:02:56 +01:00
Mino d9692a4f5f feat(gui): add 'go to main activity' action (#1423)(PR #1965)
* implemented feature: 'go to main activity'
* fix code formatting (added braces to if statements)
* search main activity by original class name, handle exceptions

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-07-29 21:03:25 +01:00
Mino ef0c09ca5b feat(gui): show number of search results in search bar (#1819)(PR #1964)
* gui: show number of search results in search bar, closes #1819
* optimized imports
* use string from resources
* applied code formatting
2023-07-28 22:17:04 +01:00
Skylot 752c61ae71 fix: disable zip file checks for new JVM versions (#1962) 2023-07-28 20:09:54 +01:00
Skylot 8f635076ea fix(gui): allow html for empty package name (#1961) 2023-07-26 21:03:55 +01:00
Skylot 8d5130a329 chore: update gradle and dependencies 2023-07-26 21:03:54 +01:00
Skylot 09a5e0893b fix: handle classes 'super' loop (#1942) 2023-07-24 21:59:27 +01:00
Jan S de8c315a7a fix(gui): display Quark stderr output in Jadx log (#1955)(PR #1957)
* Quark: also display error stream in Jadx log

* use info log level, open log viewer to track progress

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-07-24 18:03:37 +01:00
JustFor 3abdd40498 fix(gui): update Messages_zh_CN.properties (PR #1951) 2023-07-17 18:45:47 +01:00
Skylot 5b7ebec7e3 feat(gui): add option to set cache location, view/delete exists caches (#1941) 2023-07-17 00:49:40 +03:00
Yoav Sternberg de603ef909 fix(gui): support inline node for jump to code (#1905)(PR #1950) 2023-07-15 18:58:16 +01:00
JustFor a0a6779097 fix(gui): update Messages_zh_CN.properties (PR #1949)
1. Fill in the missing information
2. Sync new texts.
2023-07-12 16:36:43 +01:00
nitram84 ce9645864d fix(res): support formatted=false for strings (PR #1947) 2023-07-09 20:05:29 +01:00
Skylot d076c4e73d build: migrate to kotlin dsl in gradle scripts, update gradle and deps 2023-07-08 20:13:37 +01:00
Skylot 3e4c6a9c51 refactor(gui): don't use map for store open tabs order (#1940) 2023-07-06 17:14:31 +01:00
Skylot 74a2d7d5e7 doc: update contributing guide 2023-07-05 23:21:02 +01:00
bytemarx 219f9ebede feat(gui): close all tabs to the right (#1939)(PR #1940)
* feat(gui): close all tabs to the right (#1939)

* remove usage of LinkedHashMap as variable type

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-07-05 22:54:19 +01:00
Skylot ba0e918fef chore: update dependencies 2023-07-05 20:20:01 +01:00
Skylot 9b75a4f199 fix: update raung to fix stack frame issue (#1932) 2023-07-05 19:43:24 +01:00
Skylot 2d65594383 fix: additional checks for class alias string (#1937) 2023-07-04 21:25:38 +03:00
nitram84 36f439a82b fix(res): resolve all custom attributes (PR #1933) 2023-07-04 19:21:32 +01:00
5idereal 0efc99e43e fix(lang): update zh_TW translation (PR #1938) 2023-07-04 19:20:37 +01:00
nitram84 c0c35f32a8 fix(gradle): avoid BuildConfig conflict (#1847) (PR #1931) 2023-07-01 16:41:57 +01:00
Skylot 53e51c76a5 fix(plugins): use default args hash supplier in kotlin metadata plugin (#1929) 2023-06-30 16:33:22 +01:00
Midori Kochiya 14265a7b70 fix(res): parse strings only when they are referenced (#1926)(PR #1928)
* Parse strings only when they are referenced

* Fix style
2023-06-28 21:29:46 +01:00
nitram84 4467f9118f fix: update class set to Android 34, add apache http client support for api level 28+ (PR #1927)
* fix(cli): fix jcst converter

* extend jcst format, update class set to Android 34, add optional android libs

* fix(gradle): add apache http client support for api level 28+

* don't require existing core.jcst file for convert cls set, improve performance

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-06-28 20:54:28 +01:00
Julian Burner 240a903438 fix: don't override passed mappings path (#1891)(PR #1925)
* Don't override passed mappings path

* Fix spotless error
2023-06-28 18:20:34 +01:00
chaos afa331e8fc feat(gui): register macOS specific open file handler (#1922)(PR #1923)
* feature:支持双击文件后直接打开jadx-gui

* additional checks

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-06-20 18:36:37 +01:00
Skylot 6620e650ef fix: check args of inlined insns on reorder (#1919) 2023-06-19 15:05:06 +01:00
Skylot 2aa7438346 fix: check source file name alias uniqueness before rename (#1913) 2023-06-17 16:41:50 +01:00
Skylot 26fb7f33fb fix(script): use script log for show stages exceptions (#1912) 2023-06-15 21:12:01 +01:00
Skylot 6f4451364b fix(script): use compile instead analyze for scripts with deps (#1912) 2023-06-15 21:10:11 +01:00
Skylot 1a642108ef fix(script): temp workaround to disable script checks before run (#1912) 2023-06-14 09:43:51 +01:00
Skylot dddb7b2878 fix: don't inline consts into anonymous class constructor (#1901) 2023-06-13 21:35:15 +01:00
nitram84 82cafe6e94 fix(res): support min attr for attrs (PR #1909) 2023-06-12 14:50:10 +01:00
Skylot b578479270 fix(res): remove first empty line in public.xml (#1907) 2023-06-11 13:43:55 +01:00
Skylot 85b77cd3c0 chore: update dependencies 2023-06-11 13:42:47 +01:00
Skylot 38c3f8bf9a fix: additional insns reorder checks (#1904) 2023-06-10 23:36:14 +01:00
Yoav Sternberg f558203a9d feat(api): access node under caret/mouse and jump (PR #1903)
* Access node under caret/mouse and jump
* Apply lint
2023-06-09 15:50:57 +01:00
Skylot 347d6e2c2e refactor: improve github plugin resolver 2023-06-07 22:09:06 +01:00
Skylot eb4d540b04 chore: update dependencies 2023-06-07 21:20:05 +01:00
cskwrd 83b6ffbba9 fix(gui): fix spelling (PR #1897) 2023-06-07 16:47:39 +01:00
Skylot 50c5f0874f feat(gui): manage plugins in preferences window 2023-06-06 22:29:31 +01:00
Skylot a72e6aeafe feat(plugins): allow to set custom settings page in jadx-gui 2023-06-06 21:58:30 +01:00
Skylot 683cd76cc5 feat: add events support (#1832) 2023-06-06 21:58:29 +01:00
Goooler df313dbfec fix: replace jcenter with mavenCentral in export gradle files (PR #1896)
jcenter is deprecated, we can use mavenCentral as one of the default maven repo.
2023-06-06 13:26:01 +01:00
Skylot 2e3579a8fd fix(gui): disable rename action in tree popup if not allowed (#1890) 2023-06-03 14:38:33 +01:00
Skylot 99c8ceae9a fix(gui): don't reset package alias on class rename (#1732) 2023-06-03 16:20:44 +03:00
Julian Burner fa67f4fef7 fix: preserve renames on mapping export (#1732)(PR #1893) 2023-06-03 14:20:06 +01:00
Skylot e9a7ccd00c fix: don't change annotated code on finish (#1732)
Remove first empty line break annotation positions, can occur for classes in default package
2023-06-02 21:41:38 +01:00
Skylot 76e5824d99 feat(test): add util methods for renames in test (#1885) 2023-05-27 19:55:28 +01:00
Skylot 3bf101d7ac feat(gui): split settings into pages 2023-05-27 15:40:38 +01:00
myzhan c28320e1b2 feat(gui): add an action to prettify json file in resources (PR #1880)
* feat(gui): add an action to prettify json file in resources

* fix build

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-05-25 21:56:06 +01:00
nitram84 ea5b66d463 fix(gradle): add legacy support for vector drawables (PR #1879) 2023-05-25 20:19:26 +01:00
Skylot 8a67c39279 feat(cli): install and manage plugins from command line 2023-05-23 17:53:48 +01:00
Skylot 67054bda3d fix: add rename reason for method merged with bridge (#1876) 2023-05-20 14:06:31 +01:00
Skylot ed4c5a3a17 fix: use shadow jar in app bundle to reduce jars count (#1868) 2023-05-18 20:40:39 +01:00
Skylot ae1b1ce99e fix(build): use Kotlin with explicit project dependency 2023-05-17 21:26:55 +01:00
Skylot 5d3c96ead2 chore: update dependencies 2023-05-17 15:12:51 +01:00
Krzysztof Iwaniuk 63ad7fb128 feat: add option for hexadecimal integer format globally (PR #1869)
* option for hexadecimal integer format globally

* fix i18n strings, update readme

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-05-15 13:58:13 +01:00
Krzysztof Iwaniuk ccdbb1d62c feat: parse and use Kotlin metadata for renames (#1861)(PR #1860)
* initial setup for data class and metadata parsing
* bug fix & comments
* better version using plugin system
* added tests
* ignore getters test fix
* logs & imports
* reverted accidental changes
* moved util classes to plugin, spotless apply
* move test and some other minor fixes

---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-05-14 21:34:40 +01:00
Skylot 3474f0da04 fix: split loop exit at loop end (#1866)
Loop exit (like condition) in loop end block can confuse loop restructure.
To resolve this try to split back edge and make loop end a simple path.
2023-05-13 22:10:21 +01:00
Skylot 0fd9a9df29 fix: check for annotations before remove empty default constructor (#1863) 2023-05-11 18:11:02 +01:00
bagipro e29011eb95 fix(res): update Android resources to API 34 (PR #1864)
* update android resources to API 34
* fix format issues

---------

Co-authored-by: bagipro <bugi@bugi>
Co-authored-by: Skylot <skylot@gmail.com>
2023-05-11 17:26:02 +01:00
Skylot f52d2814df fix(gui): queue UI settings update (#1859) 2023-05-08 17:01:26 +01:00
Skylot 6e507f0cdc fix(script): don't use modules to build script classpath (#1858) 2023-05-07 20:19:38 +01:00
Skylot f825901849 chore: update dependencies 2023-05-07 20:17:46 +01:00
Skylot 5aaceee978 fix: cache finally extract checks on multiple paths (#1853) 2023-05-06 18:41:29 +01:00
Skylot f53dbbfebf feat: option to disable inner classes move to parent (#1817) 2023-05-06 20:39:50 +03:00
nitram84 d29263ef57 fix(res): fix escaping for string arrays 2023-05-06 20:38:13 +03:00
nitram84 d8c8fb4e18 test(res): add unit tests for ResXmlGen 2023-05-06 20:38:13 +03:00
Skylot 835f9fb5e0 chore(build): use official gradle build action 2023-05-01 21:31:36 +03:00
JustFor ecbcbbe8d4 fix(gui): update CN translation (PR #1852)
Fixed the problem of indistinguishable after English translation.
2023-04-28 22:25:15 +01:00
Skylot 37b1bff8f2 fix(gui): adjust node by offset search in code area (#1845) 2023-04-25 21:28:27 +01:00
Skylot 5e8f9b900f fix: remove class filtering on export (#1847) 2023-04-25 17:12:42 +01:00
Skylot ddefead764 chore(build): check java version (#1846) 2023-04-25 14:23:11 +01:00
Skylot 54f83cee1c fix: run code schrink after insn args simplify (#1838) 2023-04-24 22:25:09 +01:00
Skylot 7f3bd8c668 fix: additional checks for primitive deboxing (#1838) 2023-04-24 22:25:09 +01:00
Skylot ea10f2af47 fix(build): set jvm target version for all kotlin tasks 2023-04-24 22:21:20 +01:00
Skylot 2d810a2864 chore(build): update gradle 2023-04-24 22:21:20 +01:00
George Hopkins bac2386a1a fix: add parentheses around multiple lambda arguments (PR #1840)
* fix: add parentheses around multiple lambda arguments
* add simple test case
---------

Co-authored-by: Skylot <skylot@gmail.com>
2023-04-24 19:59:59 +01:00
Skylot 06ec12ba17 fix(script): use default script compiler args 2023-04-21 15:50:06 +01:00
JustFor 7f713e5592 fix(gui): update Messages_zh_CN.properties (PR #1831) 2023-04-21 14:42:02 +01:00
Skylot ee2556ecb6 fix(gui): update mappings node instead full reload on 'save as' (#1732) 2023-04-20 22:00:06 +01:00
Skylot e57787393e chore(build): fix gradle tasks dependencies 2023-04-20 19:46:59 +01:00
Skylot b7634024d6 chore: update gradle and dependencies 2023-04-20 17:22:16 +01:00
Skylot 9417671606 refactor: extract input-api into library (#1821) 2023-04-20 17:22:16 +01:00
Skylot 2e652b4219 fix(plugins): use loaded mapping tree on export (#1732) 2023-04-20 17:22:16 +01:00
Skylot 1d6ebed7e5 chore: fix spotless apply 2023-04-20 17:22:16 +01:00
Skylot 19cf22b9e3 chore: update Eclipse formatter config 2023-04-20 17:22:16 +01:00
Skylot 75fbdd3ac4 chore(build): set required Java version to 11, update dependencies 2023-04-20 17:22:16 +01:00
Skylot 13e317d927 fix(gui): resolve active tab restore issue 2023-04-20 17:22:15 +01:00
Skylot 7a309ca367 fix: improve plugins data handling 2023-04-20 17:22:15 +01:00
Skylot a992c93198 fix(plugins): improve custom passes merge ordering 2023-04-20 17:22:15 +01:00
Skylot ee3a653c1b fix(gui): show options from all plugins 2023-04-20 17:22:15 +01:00
Skylot e8e7028792 perf: improve usage data apply 2023-04-20 17:22:15 +01:00
Skylot 2403d32ae4 feat(gui): use plain json config instead java preferences 2023-04-20 17:22:15 +01:00
Skylot 1c89c7290c fix(gui): discard old settings migrations 2023-04-20 17:22:15 +01:00
Skylot 1891f6fd7e fix: ignore source name if current alias is better (#1795) 2023-04-20 17:22:14 +01:00
Skylot e933b41236 script: replace method call with calculated result (#1251) 2023-04-20 17:22:14 +01:00
Skylot 9f7432134c feat(gui): show loaded mapping file in input nodes 2023-04-20 17:22:14 +01:00
Skylot 7d69e5aaab feat(gui): add script log open button 2023-04-20 17:22:14 +01:00
Skylot 780b1a0d53 fix(gui): resolve ktlint deprecation warnings 2023-04-20 17:22:14 +01:00
Skylot ea37f3e9f7 fix: don't inline constants into lambdas 2023-04-20 17:22:14 +01:00
Skylot c6ed117df6 fix: improve internal state checks 2023-04-20 17:22:14 +01:00
Skylot cedcc29e01 chore(gui): add missing keys for new i18n file 2023-04-20 17:22:13 +01:00
Skylot d5219e7f0c feat: allow to move class to another package 2023-04-20 17:22:13 +01:00
Skylot 9a6dec0dbd fix: scripts runtime code and docs clean up 2023-04-20 17:22:13 +01:00
Skylot 17574ee554 chore: update dependencies 2023-04-20 17:22:13 +01:00
Skylot 926f4e497a feat(gui): allow to dock log viewer, new filter modes 2023-04-20 17:22:13 +01:00
Skylot acbe94df27 feat(script): add code area popup menu action 2023-04-20 17:22:13 +01:00
Skylot a2f018a00b feat(gui): add run, check and format script actions 2023-04-20 17:22:12 +01:00
Skylot 98cc1b1022 script: add sample deobf by code script (#1706) 2023-04-20 17:22:06 +01:00
Skylot 745f46f81f build: configure spotless for kotlin, apply code style fixes 2023-04-20 19:01:41 +03:00
Skylot 6912ed40b4 feat(gui): save usage data into disk cache 2023-04-20 19:01:41 +03:00
Skylot a89dbc1152 refactor: make input plugin api similar to pass plugins 2023-04-20 19:01:40 +03:00
Skylot 0c4d46ead5 refactor: move plugins-api module into jadx-core 2023-04-20 19:01:39 +03:00
Skylot eae9bac938 refactor: move mappings feature to separate plugin module 2023-04-20 19:01:39 +03:00
Julian Burner cb91c8c41c feat: mapping-io import support (#1531)(PR #1532)
* Add new CLI args for mapping files and deprecate args regarding jobf files (will be moved to the cache dir in the future)

* Add support for importing method arg mappings

Also change `mapping-file` to `mappings-path`, since folders are supported, too

* Add GUI for importing mappings

* Also show save file dialog when exporting mappings

* Fix crash on startup when `--mappings-path` parameter is set

* Include imported renames when exporting mappings

* Add "close mappings" menu entry

* Don't instantiate MappingTree unless actually needed

* Terminology: `import` → `open`; `export` → `save`

* Save location of open mapping file into project data

* Correctly reset cache when loading new mappings

* Remove unused import

* Save opened mappings' last modified date to reset cache when changed

* Fix if statement

* Correctly handle absence of mappings path in project data

* Show overwrite warning for folders only if not empty

* Prevent crash when imported mappings don't have any namespaces

* Handle wrong mappings namespace count error

* Replace unneeded public with private

* Add option for saving open mappings directly to disk

* Correctly propagate and throw exceptions during decompiler init

* Respect opened mappings' existing namespaces; fix related crash

* Deduplicate code, add `DalvikToJavaBytecodeUtils` class

* Small cleanup; move more functionality to utility class

* Support for importing class, field and method mappings

* Handle mappings in RenameDialog

* Fix checkstyle

* Fix wrong naming order

* Use modified mapping-io JAR from https://github.com/skylot/jadx/commit/18070eb7a649db0b0daef38d456316d5b4650072

That commit got rid of redundant embedded libraries

* Add null checks

* Check if mapping tree is null before running MappingsVisitor

* Use working mapping-io build

* Handle cache invalidation directly in DiskCodeCache class

* Don't reset UserRenamesMappingsMode if project is just reloaded

* Fix checkstyle

Co-authored-by: Skylot <skylot@gmail.com>
2023-04-20 19:01:38 +03:00
Skylot cb1f3e9843 refactor: use package nodes in api and ui 2023-04-20 19:01:38 +03:00
Skylot d4927db52b refactor: split and simplify deobfuscator 2023-04-20 19:01:37 +03:00
Skylot bc7300bd01 feat: add package node, allow to rename packages 2023-04-20 19:01:36 +03:00
Skylot 278d7fa3f9 feat(script): add options support 2023-04-20 19:01:35 +03:00
Skylot d9af91bc4d feat(gui): add auto complete for jadx scripts 2023-04-20 19:01:35 +03:00
Skylot 18fe9f305c feat(gui): support scripts in UI 2023-04-20 19:01:34 +03:00
Skylot e5e64365fc feat: add base scripting support 2023-04-20 19:01:29 +03:00
Skylot fdf170529f fix: use strict patterns for synthetic methods inline (#1829) 2023-04-19 17:52:37 +01:00
Skylot 50283ab543 fix: additional checks to forbid inline of null consts (#1828) 2023-04-19 15:49:06 +01:00
Skylot 3fa3e5acec fix: correct args shift for instance invoke-custom (#1816) 2023-04-16 20:10:57 +01:00
Skylot 4230cd5b5a feat(plugins): allow to load classes using input stream or byte array in jadx-input plugin (#1457) 2023-04-10 21:28:53 +01:00
nitram84 1ad6527de5 fix(xml): use parent attibute only for styles (PR #1815) 2023-04-10 18:34:17 +01:00
nitram84 0421ad80c1 fix: filter invalid chars in app name for gradle export (PR #1813) 2023-04-08 18:16:14 +01:00
nitram84 35e0201f06 fix(gradle): fix gradle build with version 7.4.2 - 7.6 2023-04-08 19:49:15 +03:00
nitram84 118eea5e77 fix(res): set empty parent for styles without a parent, remove duplicated code 2023-04-08 19:49:15 +03:00
nitram84 7f317be325 fix(res): resolve declare-styleable atrributes 2023-04-08 19:49:15 +03:00
nitram84 e1aa9f6de4 fix(res): resolve custom attributes 2023-04-08 19:49:15 +03:00
nitram84 058a5e3bb2 fix(res): resolve int hex attributes 2023-04-08 19:49:15 +03:00
JustFor 92b49ec2b5 fix(gui): update Messages_zh_CN.properties (PR #1811)
sync new text, and Some symbols are translated
2023-04-07 19:20:15 +01:00
Skylot 583a04b092 fix(gui): show skipped resources count during search (#1808) 2023-03-24 22:00:07 +00:00
Skylot 444a04e2f7 fix(gui): redirect jump from search for inlined classes 2023-03-24 15:34:46 +00:00
Skylot 157e702ffd feat: inline lambdas by instance field (#1800) 2023-03-24 15:34:45 +00:00
Jan S 77892f41ec fix(res): parsing of sparse RES_TABLE_TYPE_TYPE and RES_TABLE_TYPE_STAGED_ALIAS chunks (#1806 #1803)(PR #1807) 2023-03-23 17:30:29 +00:00
Jan S 6ba0e1dbf6 fix(res): handle RES_TABLE_TYPE_OVERLAY (#1748) (PR #1804) 2023-03-18 14:23:49 +00:00
Skylot 950fbbaa83 fix: restore missing type parameter declarations (#1800) 2023-03-17 20:28:42 +00:00
Skylot 912c431511 fix(debugger): process UI updates in correct thread (#1796) 2023-03-17 14:23:36 +00:00
Skylot 5d6b82724a fix(gui): search constant fields usage in all classes (#1801) 2023-03-16 17:41:23 +00:00
Jan S 78c976ad4f fix(res): resolve manifest decoding error Expected strings start (#1797)(PR #1798) 2023-03-10 18:46:31 +03:00
Skylot fbdfd135da fix(cli): use common enum args parser (#1787) 2023-02-27 19:35:49 +00:00
Jacob Davis-Hansson dd51783d9e fix(cli): make enum CLI arguments match documented format (PR #1787)
Currently if you do `jadx --help`, it says the `--deobf-cfg-file-mode` option accepts the value `read-or-save`. 

However, if you give it that option, it instead prints the following error message:

```
java.lang.IllegalArgumentException: 'read-or-save' is unknown, possible values are: read, read-or-save, overwrite, ignore
	at jadx.cli.JadxCLIArgs$DeobfuscationMapFileModeConverter.convert(JadxCLIArgs.java:524)
	at jadx.cli.JadxCLIArgs$DeobfuscationMapFileModeConverter.convert(JadxCLIArgs.java:516)
	at com.beust.jcommander.JCommander.convertValue(JCommander.java:1340)
	at com.beust.jcommander.ParameterDescription.addValue(ParameterDescription.java:249)
	at com.beust.jcommander.JCommander.processFixedArity(JCommander.java:920)
	at com.beust.jcommander.JCommander.processFixedArity(JCommander.java:901)
	at com.beust.jcommander.JCommander.parseValues(JCommander.java:731)
	at com.beust.jcommander.JCommander.parse(JCommander.java:363)
	at com.beust.jcommander.JCommander.parse(JCommander.java:342)
	at jadx.cli.JCommanderWrapper.parse(JCommanderWrapper.java:37)
	at jadx.cli.JadxCLIArgs.processArgs(JadxCLIArgs.java:211)
	at jadx.cli.JadxCLI.execute(JadxCLI.java:35)
	at jadx.cli.JadxCLI.main(JadxCLI.java:20)
```

This commit changes all the enum parsers to do the inverse string of `enumValuesString`, so the documented behavior works.
2023-02-27 19:08:07 +00:00
Skylot 158fc2fca3 chore: update raung version 2023-02-18 15:46:08 +00:00
Skylot 24284a6f3a fix: process manifest before other resources (#1740) 2023-02-17 17:54:07 +00:00
Skylot 85c2c63aa3 fix: output unknown invoke-custom as polymorphic call (#1760) 2023-02-11 16:06:30 +00:00
Skylot f354f7de63 fix(gui): split tabs loading to prevent ui dead lock 2023-02-11 14:01:31 +00:00
Skylot 540c0a8100 feat: support polymorphic invoke (#384)(#1777) 2023-02-03 16:28:24 +00:00
Skylot 4d00fede56 fix: resolve JavaNode caching issues (#1775) 2023-02-02 19:39:42 +00:00
Skylot b1bc5c08ff chore: update dependencies 2023-02-02 15:23:54 +00:00
Ran Naor 305d4f4fe5 fix(gui): print the renamed function name in a frida snippet log (#1772)(PR #1773)
* frida snippet log now prints the correct method name if the method was renamed
* fixed spotless check in frida snippet
* get the renamed method name from the alias proprety and changed to format string to fit frida-trace style
* fixed import order to fix gradle spotless warning
2023-01-28 17:59:42 +00:00
Ran Naor 2d149e9a5d fix(gui): allow html in JVariable to render renaming of variables correctly (#1769)(PR #1770) 2023-01-27 17:03:43 +00:00
Ran Naor 87b9ff3c35 feat(gui): added keyboard shortcut ctrl+w to close tab (#1765)(PR #1766) 2023-01-21 17:22:36 +00:00
Zach Snell 1c36b3c74c fix(gui): quick fix for duplicate/overlapping logcat windows (#1752)(PR #1761)
* Simple fix to duplicate/overlapping logcat windows. Could be improved by not re-creating UI every time
* Apply suggestions from code review
* Another try to fix trailing spaces using GitHub suggestions

Co-authored-by: Zach Snell <zach.snell@bivalogic.com>
Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2023-01-21 17:07:27 +00:00
Skylot 068e4b8e3d fix: allow altMetafactory method in lambda call site (#1760) 2023-01-15 16:08:34 +00:00
Skylot df38a6424f fix(gui): make bytecode output closer to smali (#1739) 2022-12-25 18:53:25 +00:00
Skylot 5d186e56a5 chore: update dependencies 2022-12-25 18:53:25 +00:00
Skylot 0fafcfa006 fix(gui): improve smali disasm method param write (#1739) 2022-12-13 17:40:00 +00:00
jmlitfi e3fdbafd86 fix(gui): resolve exception in smali method writer (#1739)(PR #1745)
Co-authored-by: jmlitfi <jeffmlitfi@gmail.com>
2022-12-13 17:39:20 +00:00
bagipro 07c2b14479 fix: escape special characters in AAB resources (PR #1747)
Co-authored-by: bagipro <bugi@macbook-pro-3.local>
2022-12-13 17:34:16 +00:00
Artem Zhiganov cdc844aaf3 feat(gui): add Russian Translation (PR #1744) 2022-12-10 13:11:34 +00:00
Skylot e1b7d361b9 fix: check full signature for search method override (#1743) 2022-12-09 17:13:01 +00:00
Skylot 12ef29bebc chore: update gradle and dependencies 2022-12-09 17:13:01 +00:00
Skylot 22ed241d50 fix(gui): correct html render in comments search results 2022-11-15 13:53:48 +00:00
Shatyuka 28e5a3c5be fix(gui): hi-dpi main window initial size (#1728)(PR #1729) 2022-11-14 18:19:09 +00:00
Skylot bb4d88cc68 fix(gui): add template for constructor and void methods to Frida snippet (#1714) 2022-11-07 19:13:11 +00:00
Mathis Hesse 4aaea2b93f fix(gui): change callMethodName of constructors in Frida action (#1714)(PR #1715)
* Change callMethodName of constructors in Frida action

* Fix format violation in FridaAction

* Fix format violation in FridaAction
2022-11-07 19:11:22 +00:00
Skylot bc8d7c4fc3 feat(gui): add native libs info to summary (#1717) 2022-11-03 19:15:33 +00:00
Skylot 5ea6c46778 fix(gui): show all code sources in summary (remove dex filter) (#1716) 2022-11-03 18:25:22 +00:00
Skylot b28f8ba85b fix(gui): try to handle exception in RSTA.getPreferredSize() (#1712) 2022-10-29 21:17:17 +01:00
Skylot 4db50fb749 fix(gui): correct html disabling in search results 2022-10-27 10:29:50 +01:00
Skylot 1dd0c90a04 build: switch java version to fix jdk install issue 2022-10-26 20:34:22 +01:00
Skylot 2bace2bde2 fix(gui): disable shell folders in file open dialog (#1709) 2022-10-26 20:08:57 +01:00
Skylot 1a9cb832ab feat(gui): add alternative file open dialog (#1709) 2022-10-26 19:58:58 +01:00
Skylot 6844a46c93 fix: disable HTML rendering in labels if not needed 2022-10-20 15:58:23 +01:00
Skylot e9e45707da chore: update dependencies 2022-10-20 14:54:31 +01:00
Skylot b9d02ff4c4 refactor: remove all LinkedList usage 2022-10-12 17:05:08 +01:00
Jan S 29b64300bc fix(gui): multi-threading issue in DebugController fixed (#1701) (PR #1702) 2022-10-11 19:21:06 +01:00
zhongqingsong 777355e86e fix(gui): update Messages_zh_CN.properties (PR #1700)
Add new text about logcat.
2022-10-10 18:57:58 +01:00
Skylot 620a177ce8 fix: restore enum class with custom code in static init (#1699) 2022-10-08 21:54:06 +01:00
Skylot 683c2dfbeb fix: improve ternary inline, resolve more enum cases (#1686) 2022-10-07 15:51:11 +01:00
Skylot 266cbcc6f4 fix(gui): migrate to fixed jdwp library fork (#1471) 2022-10-06 19:47:15 +01:00
Jan S 8a45602ae6 fix: improve logging messages for zip security errors (#750)(PR #1698)
Logging error messages on invalid file-names or path traversal attacks improved
2022-10-06 19:31:42 +01:00
Skylot 711419a797 fix: correct fix for all use places of incompatible primitives (#1688) 2022-10-03 00:11:04 +03:00
Skylot 603f3057eb chore: update dependencies 2022-10-03 00:11:01 +03:00
5idereal fa6fc1f871 fix(gui): update zh-TW translations (PR #1694) 2022-10-02 15:50:11 +01:00
Skylot 49fa320989 fix: handle possible concurrent exception in method codegen (#1685) 2022-09-29 20:28:01 +01:00
Skylot 2f301bf150 fix: don't mark constructor for inline if anonymous class inline is disabled (#1680) 2022-09-25 17:47:53 +01:00
Skylot b4892ce17f build: use fixed java version to build win artifacts 2022-09-23 21:08:16 +01:00
Skylot 151c171616 fix: handle empty block at end of else-if chain (#1674) 2022-09-23 20:40:56 +01:00
Skylot 79477a2de3 fix: don't rename bridged overridden methods (#1672) 2022-09-23 19:16:34 +01:00
dependabot[bot] 78aadda931 build(deps): bump actions/checkout from 2 to 3 (PR #1669)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 18:30:35 +01:00
Jan S b50706505f fix(res): implemented parsing RES_TABLE_TYPE_LIBRARY chunks (#1663)(PR #1664)
* core: Implemented parsing RES_TABLE_TYPE_LIBRARY chunks

* skip unknown data at the end of type chunk
2022-09-10 16:58:26 +01:00
The Cobra Chicken 9114821fb1 feat(debugger): add logcat output (#1411)(PR #1666)
* Adding logcatController class and writing adb / debugger panel information to the controller.

* Finished parsing logcat binary output and writing an arraylist containing all events.

* added highlighting of logcat output based on type.  Added timestamp parsing.

* Updated code to only get new log messages.

* Added additional code for select all

* Completed Check and uncheckall options.

* Changed log highlighting to log color.  Changed from JTextArea to JTextPane. Logcat pane will now autoscroll only if it is already scrolled to the bottom.  Debugger exit will now stop logcat as well.

* Moved labels into NLS rather than using hardcoded strings.

* Implemented the ability to autoselect attached process.  Changed the formatting of logcat messages.

* Moved labels into NLS rather than using hardcoded strings.

* updating to use info getter methods rather than directly accessing variable

* Added Logcat Pause Button

* Added Clear button

* Updated clear icon

* Cleaning warnings

* cleaning

* Changed behavior to only show logcat for debugged process to start with.

* cleaning

* cleaning

* cleaning

* applying spotless

* Fixing bug with switch

* fixed formatting issue

* add missing localization strings

Co-authored-by: green9317 <38409554+green9317@users.noreply.github.com>
Co-authored-by: TheCobraChicken <jeffmlitfi@gmail.com>
Co-authored-by: Skylot <skylot@gmail.com>
2022-09-08 15:18:55 +01:00
Skylot 1195582da8 feat(gui): option for search results count per page (#1652) 2022-09-05 20:07:02 +01:00
Skylot 258987b0ff chore: update dependencies 2022-09-05 20:07:01 +01:00
Guilherme a6a734c70d fix(gui): update pt-BR translation (PR #1655) 2022-09-01 15:51:12 +01:00
Choiman1559 d6c23a2a9b fix(gui): update Korean translation (PR #1650)
* update korean
* Update Messages_ko_KR.properties
* Restore missing empty line

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2022-08-20 17:59:37 +01:00
Skylot db028904d7 fix(gui): set legacy sort flag also for launch4j (#1628) 2022-08-20 17:37:26 +01:00
Skylot 63a571306c refactor: load resource table nodes in one change (#1648) 2022-08-19 22:15:04 +01:00
Skylot bc4db61e25 fix(gui): improve resources search (#1648) 2022-08-19 15:52:14 +01:00
Jan S c7e6e28830 fix(gui): improve log viewer dialog (#1311)(PR #1649)
* [gui]: improve log viewer dialog

* use method from UiUtils to set window icons

Co-authored-by: Skylot <skylot@gmail.com>
2022-08-18 19:55:41 +01:00
Skylot 1d7b6fdb2c fix(gui): additional checks on open search result (#1647) 2022-08-18 15:59:45 +01:00
Skylot ce5d8eeff8 fix: don't inline anonymous in self inner class (#1645) 2022-08-18 15:48:17 +01:00
Jan S 894e0e6132 fix: UnsupportedOperationException on adding a field (#1645)(PR #1646)
* fix: UnsupportedOperationException on adding a field

* changed list check and creation similar to safeAdd
2022-08-18 15:33:18 +01:00
Skylot 127f0ecf3f fix(gui): disable actions if files not loaded (#1644) 2022-08-16 21:28:57 +01:00
Skylot cf7767e702 fix(gui): handle null value in TableCellRenderer (#1642) 2022-08-16 20:48:23 +01:00
Skylot e0aedc7949 fix: improve top block search for try/catch (#1633) 2022-08-15 21:31:26 +01:00
Skylot bad78de74c perf: improve directory delete 2022-08-14 13:38:12 +01:00
Skylot 12df8a169f chore: update gradle and dependencies 2022-08-13 18:25:08 +01:00
Skylot 15c9d33339 fix(gui): handle possible classes overlap in disk cache (#1633) 2022-08-13 13:13:13 +00:00
Jiaxin Peng 7e0fafbaf1 fix(gui): fix broken FileDialog by using legacy sort (#1628)(PR #1630)
#1628 #1606 #1213 #1574 #1552
2022-08-11 13:59:46 +01:00
zhongqingsong 57b9c1dd7a fix(gui): update Messages_zh_CN.properties (PR #1627) 2022-08-11 13:29:15 +01:00
Skylot 8ba0c17259 fix: handle empty endless loop (#1611) 2022-08-10 22:07:52 +01:00
Areizen cd32151083 fix(gui): correct Frida snippet for constructor (PR #1605)
When hooking a constructor with Frida, call `$new` instead of `$init`. `$init` cannot be used to instantiate an object and is reserved for hooking.

Co-authored-by: Your Name <you@example.com>
2022-08-06 20:16:37 +01:00
Skylot 75b52d672e feat(gui): save project search history 2022-08-05 20:43:05 +01:00
Skylot 11d04508f7 feat(gui): add manual search, stop and sort actions to search dialog (#1600) 2022-08-05 20:09:33 +01:00
Skylot e641b773b5 fix(gui): improve search dialog performance 2022-08-05 14:53:48 +01:00
Skylot 6e5899c654 fix: checks for field init reorder (#1599) 2022-08-04 17:38:46 +01:00
Skylot c66ffaa7f9 feat(gui): show start page on jadx open 2022-08-03 16:44:55 +01:00
Skylot 5193c6a5d8 chore: add tool for automatically insert new i18n lines 2022-08-03 16:44:40 +01:00
Skylot e7212af547 chore: upgrade gradle wrapper to 7.5 2022-08-03 18:44:10 +03:00
FixTheBug 3ca1357af4 fix(gui): sort resources by deobfuscated name (#1595)(PR #1598)
Co-authored-by: /paul-nguyen-goldenowl <paul.nguyen.goldenowl@gmail.com>
2022-08-01 14:54:22 +01:00
Guilherme 90e95213e4 feat(gui): add Brazilian Portuguese translation (PR #1596)
* feat(translation): add pt-br
* fix: `adb_dialog` prefix deleted
2022-08-01 12:15:35 +01:00
Jan S ae2d4da585 fix(res): XML "@null" decoding (#1583)(PR #1594)
minor improvements
2022-07-31 13:50:32 +01:00
Skylot 691d5cd1e6 fix: hide unused label before exception handler in simple mode 2022-07-30 17:33:23 +01:00
Skylot 58a46c6417 fix(gui): add constructors usage into class usage (#1591) 2022-07-30 17:22:32 +01:00
Skylot d3f6160e62 feat: add option to disable finally block extraction (#1592) 2022-07-30 14:07:43 +01:00
Skylot 03e4afb12f fix: check variables before merge in finally block (#1592) 2022-07-30 13:48:53 +01:00
Hen_Ry 6802f6028e fix(gui): update german translation (PR #1554)
* german update
* Fix
* applied the latest changes as discussed

Co-authored-by: Jan Peter Stotz <jpstotz@users.noreply.github.com>
2022-07-27 17:45:36 +01:00
SiderealArt 5ca61cfe18 fix(gui): update zh-tw translation (PR #1589) 2022-07-27 11:16:11 +01:00
Julian Burner 32d55b48f2 fix(gui): replace mixed-up quotation marks with period (PR #1588) 2022-07-26 10:16:34 +01:00
Skylot ab4b6f9e54 feat: select better resource name (#1581) 2022-07-25 19:53:03 +01:00
Jan S 9100ad1220 fix(debugger): resolve NPE in adb device viewer (#1585) (PR #1586) 2022-07-25 17:44:55 +01:00
Skylot 8b4f8fb572 fix: resolve inherited method to use correct alias (#1582) 2022-07-24 19:15:52 +03:00
Skylot 87e0e5bf16 fix: correct inline/merge with overriden bridge method (#1580) 2022-07-20 14:49:37 +01:00
Skylot e4c2d6cf6e fix(gui): use editor font for usage label 2022-07-20 14:36:51 +01:00
Skylot fb0bdb5112 fix(gui): allow to use empty name to reset rename 2022-07-20 14:35:53 +01:00
Skylot f4b3645435 fix: ignore anonymous classes in enclosing node search (#1580) 2022-07-19 19:25:17 +01:00
Skylot c27f2badf7 fix(gui): resolve payload offset for switch insns in debug smali code (#1575) 2022-07-18 18:50:48 +01:00
Skylot 1a877d6535 fix: resolve possible decompilation double execution 2022-07-16 22:29:59 +03:00
Skylot 5ada9331b6 chore: update dependencies 2022-07-14 14:33:04 +01:00
Skylot a0f4ccb7a4 fix: update deps and fix proto resource loading (AAB) (#1129) 2022-07-14 14:33:04 +01:00
Skylot 5b5524a7dd fix: handle parent of inlined/moved classes (#1578) 2022-07-14 14:40:13 +03:00
Jan S 3cc464c9c9 fix: IndexOutOfBoundsException in JumpManager (#1576) (PR #1577) 2022-07-13 17:24:20 +01:00
Skylot 51555667cf fix: add more checks before remove or rename enum methods (#1572) 2022-07-07 16:55:32 +01:00
Skylot e01ea7010f fix: save classes with code generation error into cache (#1568) 2022-07-03 19:32:41 +01:00
Skylot 77732c83c9 fix(gui): ignore/limit waiting of canceled search task (#1568) 2022-07-01 17:57:59 +01:00
Skylot a67fc83949 fix: better dominators algorithms 2022-07-01 17:26:54 +01:00
Skylot 3d920725aa fix: check synthetic methods before remove/inline (#1560) 2022-06-29 19:19:54 +01:00
Skylot 2f2fbea558 fix(gui): check user renames (#1557) 2022-06-29 16:21:49 +01:00
Skylot e7a86a2960 fix(gui): forbid rename method args in fallback mode (#1558) 2022-06-29 15:25:23 +01:00
Skylot b282d97ffe fix(gui): set current dir directly in file chooser constructor (#1553) 2022-06-28 16:57:57 +01:00
Skylot e4ca52a95f chore: update dependencies 2022-06-28 16:23:31 +01:00
Skylot d972d9ec74 fix(gui): ignore errors on code area dispose (#1545) 2022-06-28 16:20:31 +01:00
Jan S 0721a6b050 fix(gui): QuarkReport data validation added and other minor improvements (PR #1556)
* QuarkReport: data validation added and other minor improvements
* checkStyle
2022-06-25 22:24:53 +03:00
zhongqingsong 762ee6550e fix(gui):complete Chinese translation (PR #1549)
1、Complete Chinese translation
2、Previous word polish
2022-06-25 22:15:22 +03:00
Skylot 18070eb7a6 fix(gui): allow to select file on mapping export 2022-06-20 14:19:59 +01:00
Skylot 8486891728 fix(gui): resolve various minor issues 2022-06-20 13:17:50 +01:00
Skylot 4679172d4f fix(gui): correct set highlighted text in search (#1507) 2022-06-20 13:16:42 +01:00
Skylot 92a6c333d8 fix(gui): force jadx new version check by default 2022-06-20 12:55:15 +01:00
Skylot 358adbdd65 feat(gui): allow to disable jump on double click (#1540) 2022-06-19 17:19:08 +01:00
Skylot 65f7c80222 feat(gui): add reload and live reload actions (#1537) 2022-06-18 20:20:11 +01:00
Skylot d2e6bb236e fix: use wide move for long/double store/load java opcodes 2022-06-16 16:26:14 +01:00
Skylot eaeb114258 fix: check class name collisions (#1526) 2022-06-15 18:43:33 +01:00
Skylot 1533b7fe6e fix: keep types on duplicate cast remove (#1527) 2022-06-12 21:55:12 +01:00
Julian Burner a2cd8e1ead feat(gui): support export to deobfuscation mapping file formats (#1491)(PR #1505)
* Add option to export mappings as Tiny v2 file

* Comply with JADX's import order conventions

* Only use Java 8 features

* Only use Java 8 features (2)

* Export comments to mappings file

* Method args test (doesn't work)

* Make method arg mapping exports work now

* Use `getTopParentClass()` instead of `getParentClass()`

See https://github.com/skylot/jadx/pull/1505#issuecomment-1145064865

* Remove unneeded method load call

* Small code cleanup; initial (broken) support for method vars

* Fixes regarding inner classes

* Add option to export mappings as Enigma directory

* Add option to export mappings as Enigma file/directory

Temporarily move to my mapping-io fork until this PR gets merged: https://github.com/FabricMC/mapping-io/pull/19

* Fix method vars' lv-indices

* Use correct offset value for method var mappings

* Also supply lvt-index for method var mappings

* Clarify why we're using local mapping-io fork; comment out Fabric Maven for now

* Remove unnecessary `public` modifier

* Make an `if` condition less complicated

* Move mapping export code into jadx-gui (for now)

* Make mapping export async; make export menu only clickable when everything is loaded

* Fix export mappings menu field declaration position
2022-06-11 20:19:08 +01:00
Christian Jones 4edb512121 fix(cli): allow decoding resource-only APKs (#1517)(PR #1530)
* Process resource-only inputs
* Fix error, add testing
2022-06-11 15:40:39 +01:00
Skylot 702b88228c fix(gui): resolve popup menu action run (#1514, #1529) 2022-06-11 15:08:28 +01:00
Skylot 14fd88b2f8 fix(gui): add volatile and update sync for decompiler field in wrapper (#1518) 2022-06-08 21:06:57 +01:00
Skylot 20657e8bb5 doc(cli): improve plugins section formatting 2022-06-06 19:55:58 +01:00
Skylot 93d3194e3b doc: remove incorrect tokei badge 2022-06-06 19:54:15 +01:00
Skylot 39331d9120 fix: remove deprecated --deobf-rewrite-cfg (#1513) 2022-06-06 19:53:47 +01:00
Skylot b4fa6644bc doc: add more badges 2022-06-05 16:06:19 +01:00
Skylot 0b2e2ed034 fix: improve class search for super call (#1512) 2022-06-05 14:49:34 +01:00
Skylot 81231206f3 fix(gui): reset disk cache on new jadx version 2022-06-04 23:26:25 +01:00
Skylot 49d0e76272 fix: support all-catch in multi-catch (#1510) 2022-06-04 23:25:52 +01:00
CmP-lt 0809993b37 fix(gui): improve restoration of windows saved state (PR #1511)
* Fix restoration of windows saved state
* Don't skip restoration of window saved bounds when they intersect with screen bounds.
* Restore saved bounds of main window regardless of it's saved extended state (fixes divider location of main split pane being restored incorrectly when saved state of main window is maximized).
* Add handling for out-of-screen(s) window bounds
2022-06-04 17:41:00 +01:00
Skylot 0c3afcc24c fix(gui): try to prevent jadx node leaks in UI objects 2022-06-03 16:15:14 +01:00
Skylot d6c851eed4 test: fix method code extract 2022-06-02 19:33:16 +01:00
Skylot dcf4a7c4e3 fix(gui): try to resolve some causes of memory leak 2022-06-01 19:48:51 +01:00
Skylot 9ba07b986b fix(gui): reduce usage of nullable decompiler field in jadx wrapper (#1506) 2022-06-01 16:36:30 +01:00
Skylot e6b6b93cbb fix: improve blocks tree compare for finally extract (#1501) 2022-05-31 20:57:34 +01:00
Skylot fcd58ae76f fix: remap class names for store in disk cache (#1503) 2022-05-30 18:16:05 +01:00
Skylot df380dea27 chore: update dependencies 2022-05-30 20:06:23 +03:00
CKCat 9d88592391 fix(res): ignore version in AndroidManifest.xml (#1502)(PR #1504) 2022-05-30 14:10:10 +01:00
dependabot[bot] c906c11b0f build(deps): bump github/codeql-action from 1 to 2 (PR #1500)
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 1 to 2.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/v1...v2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-28 18:04:08 +01:00
Skylot 4fbc56cdb0 build: add unstable win-with-jre bundle 2022-05-28 17:46:48 +01:00
Skylot 98c0416b20 fix(gui): correct close and reopen for decompiler and cache 2022-05-28 16:41:37 +03:00
ZachQin fa41874e30 feat(gui): add parameters logging in Frida code snippet (#1497)(PR #1498) 2022-05-28 14:39:02 +01:00
Skylot 2aa6c99c90 fix: skip dex files with parsing errors (#1495) 2022-05-28 13:27:29 +01:00
Skylot 5f60c0f1bb build: fix google-java-format for all java versions 2022-05-27 22:51:52 +01:00
Skylot cb741db623 fix: improve usage search, refactor java nodes creation (#1489) 2022-05-27 17:56:08 +01:00
Skylot 1df217c4a0 fix: save cache dir for reuse on project save/reopen 2022-05-27 16:50:13 +01:00
Skylot 81f209ba9e fix: check if directory exists before delete (#1493) 2022-05-26 19:23:59 +03:00
zhongqingsong 34a31aa7df fix(gui): complete Chinese Translation (PR #1492)
1. Complete translation of Chinese
2. Polish up part of the translation
3. Restore all text for subsequent translation
2022-05-24 19:09:11 +01:00
Skylot 5099e02c9b fix(gui): correct merge for plugin options from command line (#1490) 2022-05-23 19:44:49 +01:00
Skylot f364b39b29 fix(gui): save full type info in metadata (#1487) 2022-05-22 16:18:38 +01:00
Skylot 4cd4746f9a fix(gui): save variable name to show in tooltip (#1487) 2022-05-22 15:34:09 +01:00
Skylot 6448f0e32b fix: use variable length encoding instead short for offsets (can overflow) (#1489) 2022-05-22 14:23:15 +01:00
Skylot e07332d49a fix(gui): resolve cast exception for variable reference (#1489) 2022-05-21 21:33:58 +01:00
Skylot bd8a44c4c9 fix(gui): correct handle of selected file in save dialog 2022-05-21 21:31:47 +01:00
Skylot 21e94d8d5c fix(gui): use alias for types in tooltips (#1487) 2022-05-20 22:09:39 +01:00
Skylot 7b1c7b967a fix: use alias for variable names (#1487) 2022-05-20 22:09:39 +01:00
Skylot e4b19ab560 fix(gui): add missing Use debug info option 2022-05-20 22:09:39 +01:00
Skylot 49137c9751 fix(cli): don't ignore critical errors (#1150)
Thrown java.lang.Error was ignored and not logged.
2022-05-19 23:12:19 +01:00
skylot 0606c90f22 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
2022-05-18 15:19:31 +01:00
Jan S 65ade379a6 fix(gui): escape class- method and field names in frida code snippet (PR #1480) 2022-05-10 19:43:15 +01:00
Skylot a06df187c9 fix(gui): ask for project file path on exit (#1474) 2022-05-08 14:55:25 +03:00
Jan S e784c7f7df 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 <118523+skylot@users.noreply.github.com>
2022-05-08 12:53:48 +01:00
Skylot a717392379 fix: workaround to prevent incorrect order after move inline (#1472) 2022-04-29 15:37:07 +01:00
Skylot a71b3a71d8 fix: better code styling for if-else blocks (#1455) 2022-04-26 20:18:06 +01:00
Skylot 3366bf3dec chore: update dependencies 2022-04-26 20:48:18 +03:00
Jan S a505534197 fix(gui): fix IndexOutOfBoundsException when switching between tabs via mouse wheel (#1456)(PR #1469) 2022-04-26 17:27:39 +01:00
Nelson Gregório 357706b070 feat: allow to include/exclude dependencies when saving with class filter (#1466)(PR #1467)
* feat: Add option to include/exclude dependencies when saving
* fix save skip for class depencencies

Co-authored-by: Skylot <skylot@gmail.com>
2022-04-26 17:18:51 +01:00
Skylot e02434d135 fix(gui): confirm directory loading on file open (#1462) 2022-04-25 14:32:00 +03:00
Jan S 4586015fc0 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 <skylot@gmail.com>
2022-04-24 10:32:25 +01:00
Skylot 1832f2aee3 feat: allow to load custom input (#1457) 2022-04-21 13:21:13 +01:00
SiderealArt 1ec127c3cb fix(gui): update Traditional Chinese translation (PR #1452) 2022-04-19 14:05:55 +01:00
Skylot 7a3b7c55c9 build: run tests in parallel 2022-04-18 16:31:25 +01:00
Skylot b66293a2f7 fix: handle wildcard in invoke type resolver (#1238) 2022-04-18 16:27:35 +01:00
Skylot abcaafa89a chore: update gradle and dependencies 2022-04-17 19:28:18 +01:00
Skylot cf25cc4faa fix: prevent null type in code variables 2022-04-17 19:18:33 +01:00
Skylot b57001d4a7 fix: use correct reference for replaced bridge constructor (#1441) 2022-04-10 15:48:36 +01:00
Skylot 83decc2473 fix(gui): rename class while rename constructor (#1441) 2022-04-08 13:45:27 +01:00
root-intruder 92faa569be build: allow unsigned local lib builds (#1438)(PR #1439) 2022-04-06 13:41:33 +01:00
Skylot c5b731169d build: disable jitpack 2022-04-06 13:34:08 +01:00
Skylot f0a8ef81d3 fix: replace fixed memory limit with -XX:MaxRAMPercentage=70.0 (#1437) 2022-04-05 20:08:39 +01:00
Skylot 994973ac01 fix(gui): check free memory after GC attempt 2022-04-05 19:46:10 +01:00
Skylot c9622c0771 chore: update class set to Android 32 2022-04-05 20:21:41 +03:00
Jan S 8551c6c903 fix(res): ignore resource chunk entries that are located after the resource chunk end (#751)(PR #1436) 2022-04-04 18:05:07 +01:00
Bruno Oberle 9a9ac4308e fix(cli): use correct converter for "--decompilation-mode" option (#1434)(PR #1435) 2022-04-04 13:47:30 +01:00
Matt e784cbdd09 fix(deobf): fix writing method mappings as fields entries (#1432)(PR #1433) 2022-04-02 12:30:25 +01:00
Elias 2744c4bfb6 build: fix appdata.xml (#1427)(PR #1430) 2022-03-31 17:30:06 +01:00
Skylot e4f4c1b84a fix(gui): don't highlight whitespaces and special symbols (#1429) 2022-03-28 19:21:05 +01:00
Elias e5fa818b5c build: remove unsupported tags from appdata.xml (#1427)(PR #1428)
* remove <code> tags from appdata.xml because flatpak doesn't like it
* appdata.xml: remove <a> tag because flatpak doesn't like it
2022-03-27 17:28:01 +01:00
Elias b22b554a69 build: add appdata.xml for flatpak package (PR #1426) 2022-03-27 14:06:18 +01:00
Skylot e9b8060889 refactor(gui): improve node action in code area 2022-03-26 15:31:29 +00:00
Skylot 1c2b2c072c fix(gui): restore open tabs on project load (regression fix) 2022-03-25 13:40:00 +00:00
Skylot 3d451912ee fix: handle inlined classes while collecting override related methods (#1422) 2022-03-25 12:56:18 +00:00
Skylot fe91d774fa feat(gui): add split view for different decompilation modes 2022-03-23 18:16:57 +03:00
Skylot d8306cb1c0 feat: add 'simple' decompilation mode 2022-03-23 18:16:54 +03:00
Jan S 909cf0a576 fix: various minor improvements (PR #1418)
* chore: better variable naming for getInstance calls
* chore: rebalance preferences window and fix empty plugins section directly after jadx-gui start
* chore: do not ask for project save if nothing had been changed
* use parallel mode for gradle
* minor improvements for app debugging
* apply CodeQL suggestion to prevent log injection
* handle IntelliJ Idea warnings
* replace not-ASCII chars in LogUtils.escape

Co-authored-by: Skylot <skylot@gmail.com>
2022-03-23 15:13:53 +00:00
Jan S 8fe1ee11e4 fix(debugger): resolve IO read problems, proper socket closing (PR #1414)
* fix(debugger): several IO read problems fixed
* merged latest changes
* fixed read loop
* Update jadx-gui/src/main/java/jadx/gui/device/protocol/ADB.java

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2022-03-20 17:01:01 +00:00
Skylot d2bef108f5 chore: update dependencies 2022-03-19 18:52:44 +00:00
Skylot ba8ba504b1 fix(debugger): small improve for jdwp handshake (#1412) 2022-03-19 18:43:34 +00:00
Skylot 481b5abf85 fix(debugger): handle stream end and partial reads (#1412) 2022-03-18 14:19:08 +00:00
Skylot c4e1d9445a fix(gui): reduce threads count on low memory, other tweaks (#1410) 2022-03-17 17:50:28 +00:00
Skylot cb03532b76 fix: allow implicit type cast for array operations (#1407) 2022-03-14 18:47:55 +00:00
Skylot c93e9eea14 fix: improve class names collision detection (#1406) 2022-03-13 12:08:03 +00:00
Skylot 9a67b19973 feat(gui): add zoom in/out actions (#1403) 2022-03-11 13:59:00 +00:00
Skylot 95c75bed1e chore: update gradle and dependencies 2022-03-11 11:34:51 +00:00
Skylot b008568a5c doc: add missing options to readme 2022-03-05 17:15:08 +00:00
Skylot 94fb91cec6 feat: add options for java-convert plugin 2022-03-02 15:40:32 +00:00
Skylot c54dd77f35 fix(gui): resolve NPE and fix code style in BreakpointManager 2022-03-02 12:10:14 +00:00
Jan S 17fbc99f29 feat(gui): dialog for showing exception details and creating an GitHub issue (PR #1399)
* chore(gui): Dialog for showing exception details and creating an GitHub issue
* directly throw test exception
* checkstyle
* minor
* log exception before the dialog is shown
2022-03-01 15:00:22 +00:00
Skylot 21dd17290b fix(gui): download only latest version info for jadx update (#1397) 2022-02-28 18:51:13 +00:00
Skylot dc73fc92be fix(gui): don't use hardcoded color for link component (#1398) 2022-02-28 18:39:51 +00:00
Skylot 592215db66 fix(gui): handle package version in update check (#1397) 2022-02-28 18:39:51 +00:00
Skylot fb318e3bd9 fix(gui): revert contextual keywords to identifiers (#1394) 2022-02-27 15:22:41 +00:00
Skylot 5f3c8816a3 fix: allow zero skips for restore new filled array 2022-02-26 17:29:00 +00:00
Skylot 6016b902c7 test: fix usage of Eclipse compiler 2022-02-26 17:29:00 +00:00
Skylot 5852da1e3d feat: support MethodParameters attribute (#1260) 2022-02-26 10:28:21 +00:00
Skylot 502fd069be test: for source auto check use compiled classes instead runtime 2022-02-26 10:28:20 +00:00
Jan S fad9e7b827 fix(gui): initialize project name with loaded files (shown in Jadx title) (#1386)(PR #1393) 2022-02-26 09:20:58 +00:00
Skylot 35116d0b1a fix: load files also by extension (#1391) 2022-02-25 11:38:44 +00:00
Skylot 3b781e41ad test: allow to pass additional compiler options 2022-02-24 20:52:34 +00:00
Skylot a3e9744364 chore(cli): additional debug messages for java-convert plugin 2022-02-24 20:51:31 +00:00
Skylot 7030daeccd fix(cli): resolve regression in applying '-v' and '-q' options 2022-02-24 19:52:58 +00:00
Jan S e7151ad7b2 fix(gui): IllegalArgumentException when saving project to a different directory than the APK file (#1387)(PR #1388) 2022-02-23 09:27:04 +00:00
Skylot ed2a3c8458 fix: prevent NPE on 'ignore' deobf map file mode 2022-02-22 18:06:01 +00:00
Skylot 779f75cd52 fix(gui): prevent NPE on open preferences without loaded files (#1385) 2022-02-22 18:05:51 +00:00
Skylot 54683e3198 feat: plugin options, add verify checksum option for dex input (#1385) 2022-02-21 19:44:00 +00:00
Skylot 09335395f5 doc: update option description 2022-02-20 16:51:36 +00:00
Skylot 57e3dd8f15 feat(cli): improve single file mode (#1344)(#1384) 2022-02-20 15:04:59 +00:00
Skylot a9bbadd602 feat: add option for deobfuscation map file handle mode (#1351) 2022-02-19 21:20:11 +03:00
skylot 2c570681f7 doc: add link to jadx-gui key bindings in readme 2022-02-18 20:26:39 +00:00
Skylot 25166970cc feat(gui): ctrl+c copy node string in search window (#293) 2022-02-18 19:10:56 +00:00
Skylot d3a0a56b8b feat(gui): ctrl+c copy highlighted word in code view (#1292) 2022-02-18 19:10:34 +00:00
YenKoc 3c2c198a0e feat(gui): add Xposed snippet copy action (PR #1383)
* add xposedscript
* fix code style and minor issues
* some code style changes for Xposed snippets
* some code style changes for Frida snippets + a fix for multidimensional arrays in overload params
* hide frida and xposed when right-clicking on a null node
* small style fix
* fixed formatting violations
* fix minor issues

Co-authored-by: Skylot <skylot@gmail.com>
Co-authored-by: Orip <oriori1703@gmail.com>
2022-02-18 12:54:41 +00:00
Skylot 4d4d67f0b4 fix: remove shadowed catch handlers (#1377) 2022-02-16 19:31:19 +00:00
Skylot 97e8a34906 fix: prevent some NPE in try/catch/finally processing (#1379) 2022-02-15 12:29:30 +00:00
Skylot 82f3b57e83 perf: improve ternary mod on big methods (#1379) 2022-02-15 12:03:06 +00:00
Skylot af2f14f807 fix: prevent endless loop in anonymous class analysis (#1382) 2022-02-14 23:23:02 +00:00
Skylot fe248d7098 fix: check values in inner class annotation (#1382) 2022-02-14 18:25:54 +00:00
Skylot 1a2e702b25 fix: inline nested anonymous classes (#1379) 2022-02-14 17:30:22 +00:00
Skylot 1da20b8e7d doc: update readme 2022-02-14 16:41:31 +00:00
Skylot 01f74ff706 chore: update gradle and dependencies 2022-02-13 19:08:49 +00:00
Skylot 89e95eb9ee fix: correct code reload after rename (#1378) 2022-02-12 19:15:18 +00:00
Skylot a61ebaaa00 fix: sum only sub dependencies in batches build (#1376) 2022-02-11 19:53:12 +00:00
xxjy 7a5a2fcd84 fix: nested try catches with overlap try blocks (#1374)(PR #1375)
* fix: nested try catch decompilation failed (#1374)
* add tests and sort handlers

Co-authored-by: Skylot <skylot@gmail.com>
2022-02-09 20:55:15 +00:00
Jan S 8d5554f1b5 fix(gui): frida context menu entry does nothing (#1365)(PR #1372) 2022-02-08 12:47:49 +00:00
Ori Perry 873aabb471 fix: use raw class names in Frida action (#1365)(PR #1366)
* Use raw_name instead of full_name for the names of class in generated frida snippet.
Also cleaned the code a bit

* Fixed getting method parameters from inlined methods

* fixed generating code for constructor overloads, more cleaning

* Fixed getting method parameters from inlined methods for real this time

* made the option for a frida snippet only appear if clicked on a relevant node

* added support for generating a frida snippet for fields

* apply spotless

* Update jadx-gui/src/main/java/jadx/gui/ui/codearea/FridaAction.java

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>

* moved the overload check from NodeMethod to FridaAction

* added semicolons in the end of lines of the generated frida snippet

* fix code formatting
2022-02-07 21:50:01 +00:00
cyqw 4bed9dc358 fix(gui): results in usage search should be sorted by name (PR #1363) 2022-02-07 15:39:57 +00:00
nitram84 e229874195 fix: check if targetSdkVersion is missing in gradle export (#1367)(PR #1370) 2022-02-07 10:39:09 +00:00
Skylot 473b6e31e9 fix: support multi-entry loops (simple case) (#1320) 2022-02-06 18:36:33 +00:00
Jan S b5ce460618 feat(deobf): do not deobfuscate known top level domains with 2 or 3 characters (PR #1369) 2022-02-06 12:56:59 +00:00
Skylot 3c05b05196 fix: check names from Kotlin metadata before use (#1364) 2022-02-05 21:49:36 +00:00
Skylot bdb2efdb6b fix(res): remove static caching map for xml renames (#1364) 2022-02-05 20:23:44 +00:00
Skylot a27ba3ff4b fix(res): skip '.9.png' decode if patch data not found (#1112) 2022-02-05 17:45:08 +00:00
Skylot 4684207b54 fix: remove duplicate classes from decompilation batches (#1361) 2022-02-05 17:45:07 +00:00
Skylot dd1be3039b fix(gui): split decompile and index tasks for correct time counting (#1361) 2022-02-05 17:45:07 +00:00
Skylot 8b30b770cd fix(gui): missing icons and html decorations in usage dialog 2022-02-05 13:36:26 +00:00
Yotam 47caa91e85 fix(cli): fix and add debug log messages in initialization phase (PR #1362)
* Fix log level settings in the CLI
* Add log messages in initialization phase
2022-02-02 19:04:19 +00:00
Skylot d71f3e09df fix: prevent endless loop in path cross search (#1360) 2022-02-01 14:32:44 +00:00
Jan S 06c7415827 fix(res): improved decoding of flag attributes in binary XML files (#1156)(PR #1359) 2022-01-31 18:00:50 +00:00
Skylot bd3e62617e fix: correct inline for enums in j$.time.temporal 2022-01-31 11:49:59 +00:00
Skylot 00b48473a0 test: add internal option to disable file save 2022-01-31 10:27:20 +00:00
Skylot 84facb13d0 fix: don't inline named variables (#1338) 2022-01-28 18:33:38 +00:00
Skylot 96f90e18e8 fix: improve exception handlers attach 2022-01-26 15:43:40 +00:00
Skylot 8ff18e63ee chore: update dependencies 2022-01-25 18:51:43 +00:00
Skylot 381405ea99 fix: always use deep resolve for fields and methods (#1357) 2022-01-25 11:37:36 +00:00
Ahmet Bilal Can ae5c00397a feat(gui): add frida action to copy methods/classes as frida snippets (#1355)(PR #1356)
* add frida action to copy methods/classes as frida snippets
* bug: call toString before comparing
2022-01-24 21:37:12 +00:00
Skylot bd4509f1a7 fix: update field usage on const replace (#1348) 2022-01-24 18:22:43 +00:00
Skylot b8c84886a8 fix: correct use of class names for inner types (#1340) 2022-01-24 14:11:40 +00:00
Skylot 45021389bc fix: correct method arg name if unused 2022-01-24 13:38:49 +00:00
Yotam f674a29a64 fix(deobf): rename classes as anonymous only if they are a number (PR #1354) 2022-01-23 21:16:05 +00:00
Yotam 0c9e3227d0 fix(deobf): collect missing renames for .jobf file (#1350)(PR #1353) 2022-01-23 16:08:54 +00:00
cyqw be7e1479a1 fix(gui): find usage for overridden methods (#1349)(PR #1352) 2022-01-23 16:06:13 +00:00
Skylot 19827fca20 fix: support full class name in inner generic types (#1340) 2022-01-22 18:49:31 +00:00
Skylot 5eb7cc40ed feat: check dex checksum before parsing (#1343) 2022-01-20 19:24:49 +00:00
Skylot d22db30166 fix: use secure xml parser for process manifest 2022-01-20 11:17:12 +00:00
Skylot 6db61e7a59 chore: update dependencies 2022-01-20 10:23:49 +00:00
Skylot 86582de521 feat: use kotlin intrinsic methods for variables rename (#1207) 2022-01-19 17:30:04 +00:00
Skylot a7c63c2eb3 fix: handle method override with several bases (#1234) 2022-01-18 18:27:09 +00:00
Skylot 081a0e21ee fix: precalculate class deps for inline methods (#1339) 2022-01-17 14:38:38 +00:00
Skylot 9ac9c05265 fix: simplify cascading casts (#1336) 2022-01-15 16:31:18 +00:00
Skylot b7daf79b26 fix: add explicit type for non-int constants (#1336) 2022-01-15 14:11:44 +00:00
Skylot b67a3561a4 build: add CodeQL analysis 2022-01-13 22:37:36 +03:00
Skylot 52ac6dbbaf docs: add security.md 2022-01-13 16:45:32 +00:00
Skylot 72381ad8f3 fix: correct literal negate for double and float (#1334) 2022-01-13 14:00:53 +00:00
Skylot 6a065c46f4 chore: update dependencies 2022-01-13 12:12:15 +00:00
Skylot 092d0d7e67 fix(gui): reduce tree focus switching 2022-01-12 19:57:38 +03:00
Skylot 5ca7285558 fix(gui): correct handling for tree row click (#1324) 2022-01-12 16:57:25 +00:00
Skylot 7576f9cd5e fix: wrap negative literals before cast (#1327) 2022-01-12 17:31:40 +03:00
Skylot 46b5725d98 refactor(test): replace inputs with test profiles 2022-01-12 17:31:37 +03:00
Jan S 72542fa6f9 fix(gui): processing threads spinner initialization (#1331)(PR #1332)
* fix: processing threads spinner initialization (#1331)
* fix: processing threads spinner initialization (#1331)
2022-01-12 14:23:07 +00:00
demonlol a250d0461b fix(dbg): support multiple main <action> and <activity-alias> tags (#1322)(PR #1323)
* fix(dgb): support multiple main <action> and <activity-alias> tags in manifest
* Update jadx-gui/src/main/java/jadx/gui/device/debugger/DbgUtils.java
2022-01-02 20:09:24 +03:00
Skylot c7795bfc48 fix: improve anonymous class inline (#523) 2021-12-26 13:06:49 +00:00
Skylot 5de46b7e40 chore: update gradle and dependencies 2021-12-24 12:53:30 +00:00
Skylot 99c70872c1 fix: use debug line numbers only at fixed offsets (#1315) 2021-12-22 22:55:14 +03:00
Skylot 3566669303 chore: update lgtm config 2021-12-22 12:24:01 +00:00
Skylot 4557d05256 fix: use correct type for anonymous class instance (#597) 2021-12-21 17:47:52 +00:00
Skylot fa421d165e build: disable missing warnings from javadoc 2021-12-21 12:52:52 +00:00
Skylot ecf20020d7 chore: cache current working dir in static field, other minor changes 2021-12-20 19:25:07 +00:00
Skylot ae85af61c7 fix: skip input file name checks by zip name validator (#1310) 2021-12-20 18:55:28 +00:00
Skylot 659bbbf4fb fix: correct usage of Path.getParent() 2021-12-20 16:48:50 +00:00
Jan S 427e2dddc4 fix: use relative file paths in .jadx project file (#1312) (PR #1313)
* chore: use relative file paths in .jadx project file (#1312)
* code beautified
* requested changes
2021-12-20 13:52:51 +00:00
skylot d47483f957 docs: use jadx as a library 2021-12-19 20:36:58 +00:00
Skylot 4bd8e26ae7 build: add maven publish 2021-12-19 16:24:09 +00:00
Skylot 01f47282ed fix: forbid 'printStackTrace()' usage 2021-12-18 19:24:36 +00:00
Skylot afdd37cd97 fix: add comments with option references to improve usability 2021-12-15 12:24:37 +00:00
Skylot addaffcd1d chore: update dependencies 2021-12-15 11:56:01 +00:00
Skylot 63f7ce20a4 fix: add merged condition blocks for loop region (#1307) 2021-12-14 14:25:59 +00:00
Skylot f37c23db7a fix: use correct top block for try blocks with same start (#1304) 2021-12-13 18:14:27 +00:00
Skylot d2bde0be21 fix: invoke in nested anonymous classes (#1305) 2021-12-13 00:12:30 +03:00
SiderealArt 9c446ebbd6 feat(gui): add Traditional Chinese translation (PR #1306) 2021-12-12 16:05:10 +00:00
Skylot 0f00fb9a27 fix: handle move-result after invoke-custom with string concat 2021-12-11 16:22:27 +00:00
Skylot 2d6f819c86 chore: update gradle and dependencies 2021-12-11 16:22:27 +00:00
Skylot 56683ac409 fix: improve try/catch bounds detection (#1303) 2021-12-09 17:34:53 +00:00
skylot a72523c7df docs: add link to decompilation troubleshooting 2021-12-08 13:11:31 +00:00
Surendrajat 46eeb0bc22 fix(gui): forward navigation shortcut on macOS (#1297)(PR #1301)
* fix: forward navigation shortcut on macOS
* apply suggestion
2021-12-06 16:45:29 +03:00
Skylot 6e8baef9b2 feat(gui): allow to minimize/maximize search windows (#1298) 2021-12-04 11:04:17 +00:00
Skylot 947b621733 feat: add option to use dx/d8 for convert java bytecode (#1299) 2021-12-03 15:05:28 +00:00
Skylot 4cc00bdaf2 fix: handle super case for invokespecial opcode (#1300) 2021-12-02 18:13:19 +00:00
Moredistant 59ef569a63 fix(gui): update chinese translation (PR #1296) 2021-11-30 11:57:16 +03:00
Choiman1559 abae225915 Update Korean translation (#1294)
* Update Messages_ko_KR.properties

* Update Messages_ko_KR.properties

Add missing translations
2021-11-29 19:56:01 +03:00
Jan S 05bdf9daae perf(res): XML decoding speed enhancement (PR #1293)
* chore: XML decoding speed improved for large APKs (finding class references)
* skip attach class node to xml for SimpleCodeWriter (used in jadx-cli)

Co-authored-by: Skylot <skylot@gmail.com>
2021-11-29 15:08:54 +03:00
Haeter 0a8192168a fix(gui): update Quark report parsing (#1289) (PR #1291) 2021-11-28 19:31:28 +03:00
Hen Ry 88fd5a517e fix(gui): update German translation (PR #1290)
* Updated German translation
2021-11-28 19:15:07 +03:00
zhongqingsong 74c5b616a4 fix(gui): update Chinese translation (PR #1287)
1. According to the English version of the document, complete the left texts.
2. Fix some inaccurate word, such as field, old CN is variable(变量),  inadequacy. signer, old CN is somebody(人), now it's something(者)。
3. Fix improper use of symbols, Lack of symbols in some place, some EN symbol translate to CN symbol.
4. Other change
2021-11-26 18:40:01 +03:00
Skylot 22a61d715b build: sometimes build failing without running gradle daemon 2021-11-25 14:47:17 +03:00
Skylot a90ec7c64a fix: include inlined classes in usage search (#1285) 2021-11-25 14:47:13 +03:00
Jan Peter Stotz b22812b43a fix: APK signature description for unprotected entries only applies to v1 signatures 2021-11-24 16:46:38 +03:00
Jan Peter Stotz 4c0da8c3d5 fix: binary xml hexadecimal int value decoding 2021-11-24 16:46:38 +03:00
Moredistant 9aa30f77b7 fix(gui): update chinese translation (PR #1284) 2021-11-23 15:54:53 +03:00
Martin Kay 2dbef83fa6 feat(gui): smali code highlighting (PR #1283)
* smali code highlighting is basically perfect
* Optimize smali highlight color matching, and provide original jflex generation

* reformat code
* disable checkstyle
* update shell to be more environment independent

Co-authored-by: Skylot <skylot@gmail.com>
2021-11-23 15:53:37 +03:00
Skylot 6ec7f789ef fix: restore usage data after class reload (#1281) 2021-11-22 13:56:15 +00:00
Skylot 31c0afe29e fix: don't unload field init values (#1277) 2021-11-21 18:54:32 +00:00
Skylot 46b07863c1 build: fix bundle build 2021-11-20 20:49:57 +00:00
skylot 445e91e6b5 docs: update readme 2021-11-20 18:04:08 +03:00
Skylot 9daf386d66 build: bundle JRE with jadx-gui 2021-11-20 14:17:05 +00:00
Skylot 49b4079cd8 chore: update dependencies 2021-11-20 16:35:23 +03:00
Jan Peter Stotz 0ffa1838a2 chore: Updated German translation 2021-11-20 16:02:39 +03:00
Jan S 0efca29e95 fix: configured resource indexing size limit is now correctly considered (PR #1278) 2021-11-18 18:58:20 +03:00
Skylot 0ab933efff perf: cache 'implements' list (heavily used in type inference) 2021-11-15 21:03:54 +00:00
Skylot 4ee4a34323 fix: check if inner classes for missing R class already exist (#1269) 2021-11-15 16:17:38 +00:00
Yotam 985ccd6bba feat: save jobf when decompiling to Java (#1274) (PR #1275)
* Save jobf when decompiling to Java through the cli
* Skip jobf saving if it's empty
* Update jadx-core/src/main/java/jadx/core/deobf/DeobfPresets.java

Co-authored-by: Yotam Nachum <me@yotam.net>
Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2021-11-14 23:49:27 +03:00
Skylot 570e7528a7 fix(gui): use correct definition position on jump after code reload (#1273) 2021-11-14 13:05:22 +00:00
Skylot 918585968d perf(gui): on rename unload dependent classes instead recompile 2021-11-13 14:53:51 +00:00
Skylot cf918a897f fix(gui): collect FlatLaf themes without reflection 2021-11-12 18:01:52 +00:00
Skylot 5fc27c1136 perf(gui): improve decompilation speed (#1269)
- use index only in one thread to reduce synchronization locks
- collect usage info on request, remove global collection
- adjust decompilation order to reduce locks, improve memory usage
- prefill cache of super types in clsp graph to remove locks
2021-11-12 13:54:56 +00:00
Skylot 6bcc48c462 chore: update gradle and dependencies 2021-11-11 11:12:21 +00:00
Skylot 4dc368c7d0 fix: save resources before decompilation (#1270) 2021-11-11 10:54:17 +00:00
Skylot 17f99ed928 fix: adjust class processing order for correct methods inline (#1264) 2021-11-10 15:27:25 +00:00
Skylot 954d239b52 fix: resolve methods collisions after type fix (#1263) 2021-11-08 16:59:41 +00:00
Skylot ea167cbefc fix(gui): resolve NPE in resource index for single dex, other minor issues 2021-11-08 15:18:30 +00:00
Skylot 90a436236d fix(gui): wrap long array data (workaround for RSTA hang) (#1266) 2021-11-06 17:35:26 +00:00
Skylot 4479a3fbd5 fix(gui): restore resource tabs on project open 2021-10-29 15:23:22 +01:00
Skylot f5216b77f8 fix(gui): resolve some minor rename issues
- correct variable definition in method arguments
- refresh current class if rename interface method
2021-10-28 18:38:53 +01:00
Skylot 39dc288978 feat(gui): save open tabs in project file 2021-10-27 21:28:18 +01:00
Skylot f37005958f fix(gui): sort results in usage dialog (#1104) 2021-10-27 15:22:33 +01:00
Skylot dfdc14ea86 feat: rename without deobfuscation, save renames in project (#1076 #1022) 2021-10-26 20:23:21 +01:00
Skylot 82712776cc feat(gui): add issues panel and summary report (#986) 2021-10-23 16:03:06 +01:00
Skylot 439446816c fix: update Quark report format parsing 2021-10-22 17:07:45 +01:00
Jan S 940108661c fix(gui): "Always Select Opened File/Class" was not syncing upon activation (PR #1261) 2021-10-22 15:17:27 +03:00
Skylot 0423f33e93 fix: use correct iteration over code points in string 2021-10-21 18:24:57 +01:00
Jan Peter Stotz c2a4a7a6c2 fix: "rename to make printable" option was renaming fully printable class names 2021-10-21 15:51:22 +03:00
Skylot ff4e3dd976 fix: show cause exception if class codegen failed (#1258) 2021-10-20 19:21:49 +01:00
Skylot 94b00b4e7a feat(gui): add option to change line numbers mode (#1223) 2021-10-20 18:42:15 +01:00
Skylot 48252c3c3d feat: add option for code comments levels (#998) 2021-10-19 16:47:20 +01:00
Skylot 37adce2efb chore: update dependencies 2021-10-17 19:53:01 +01:00
Skylot 358cddd9a7 fix: support dynamic strings concat (#1250) 2021-10-17 19:43:51 +01:00
Skylot 418df2fd93 tests: allow to set target java version, use D8 as fallback converter 2021-10-17 19:43:51 +01:00
Skylot cd153c76f2 feat: add raung input plugin, use raung in tests 2021-10-12 19:17:04 +01:00
Skylot f30c14b277 feat(gui): don't run full decompilation for usage search
New approach will run partial decompilation for classes
from usage info collected on file load (pre-decompilation stage).
2021-09-30 16:23:09 +01:00
Skylot 3a29812241 fix(gui): resolve NPE during index (#1254) 2021-09-30 14:07:19 +01:00
Muntashir Al-Islam 67e6b647a2 fix(build): force protobuf version to prevent Java-7 issue (PR #1255)
Signed-off-by: Muntashir Al-Islam <muntashirakon@riseup.net>
2021-09-30 15:53:28 +03:00
Skylot ea0795c8a9 fix: restore fields order if init use other fields (#1235) 2021-09-15 22:27:25 +01:00
Skylot 099acfca1d fix: don't add parenthesis for field init code 2021-09-15 21:55:24 +01:00
Skylot 8969d11a22 fix: restore fields order on init code move (#678) 2021-09-15 21:55:24 +01:00
Skylot eedf32d197 fix: support nested try/finally blocks (#1249) 2021-09-09 18:44:24 +01:00
Skylot 9c8642593c fix: don't visit inner classes twice in pre-processing 2021-09-08 19:07:25 +01:00
MrIkso 8e89a2ef1b feat(gui): added option to always select opened file/class 2021-09-03 19:12:29 +03:00
MrIkso 316c2fdd4d fix(gui): updated SearchBar in code viewer 2021-09-03 19:12:29 +03:00
Skylot 6bbf1d0996 build: update gradle wrapper to 7.2 (#1244) 2021-09-03 16:38:37 +01:00
Skylot e854ba3c44 build: upgrade gradle to 7.2 (#1244) 2021-08-31 17:20:04 +01:00
Nico Mexis f681c8963d fix: use maven-publish for JitPack and other fixes (PR #1242)
* Update dependencies
* Fix spaces in file paths
* Update Gradle for LGTM
* Update spotless
* Fix Jitpack

Co-authored-by: Skylot <skylot@gmail.com>
2021-08-27 19:05:52 +03:00
green9317 8d5f22e43d fix(xml): handle incorrect android manifest namespace chunks (#1232) (PR #1243)
* allow for handling of incorrect android manifest namespace chunks
* Update BinaryXMLParser.java
2021-08-27 17:40:08 +03:00
Skylot a62de839be fix: handle unbound type variables in type inference (#1237) 2021-08-24 13:54:32 +01:00
Skylot 5af60b2ff4 fix(gui): improve constructors and classes usage list 2021-08-23 17:10:43 +01:00
Skylot c8d7fce938 fix(gui): use correct type formatter in class tree 2021-08-22 18:53:12 +01:00
Skylot 90fbc790d9 fix(gui): exclude declaration from usage list (#1110) 2021-08-22 18:03:15 +01:00
Skylot 1ce3fc972a fix: improve disassemble view for java-input 2021-08-22 16:53:54 +01:00
Skylot 9ea3f0f240 fix: support 'swap' and 'wide' opcodes, other fixes for java-input 2021-08-20 20:59:30 +03:00
Skylot 868fa90097 feat: allow to load directories 2021-08-15 14:44:55 +01:00
Skylot 55bb20cf29 fix: prevent collisions in method ids for java-input 2021-08-13 23:07:33 +03:00
Skylot 7c0671c81b feat: rewrite try-catch processing 2021-08-13 23:07:33 +03:00
Skylot 12a66bd83e refactor: remove samples module 2021-08-13 23:07:33 +03:00
Skylot 1efdcd7b10 feat: input plugin for java bytecode 2021-08-13 23:07:29 +03:00
Hen Ry 2d9bcdb87a fix(gui): update Messages_de_DE.properties (PR #1230)
* fix(gui): update Messages_de_DE.properties

* #-fix(gui): update Messages_de_DE.properties
2021-08-12 18:25:36 +03:00
Hen Ry ac9cace8f6 fix(gui): update Messages_de_DE.properties (PR #1228)
* Update Messages_de_DE.properties
* Update Messages_de_DE.properties

Fix
* uncomment translated lines

Co-authored-by: Skylot <skylot@gmail.com>
2021-08-12 17:12:31 +03:00
Yaroslav f9bf27579e fix: additional checks for export to gradle (#1222) (PR #1224) 2021-08-05 15:16:05 +03:00
Skylot 667cae2e62 chore: use SVG icon for Quark (thanks @MrIkso) 2021-08-04 19:18:03 +01:00
Skylot e8e0491cb5 chore: fix code formatting and resolve PR issues 2021-08-04 20:41:17 +03:00
Yaroslav ee12f0bd18 feat(gui): use SVG icons, xml resources impovements (PR #1221)
* fix(xml): add more file based resources type to skip
* fix(res): fix #1060, styles might contain dots in name
* fix(res): use lowercase name on deobfuscated\renamed resources names and id in hex format
* feat(gui): update gui under FlatLaf
* fix(gui): use FlatSVGIcon to fix icons brightness difference
* fix(gui): use source lines only decompiled java code
Co-authored-by: MrIkso <mrkso821@gmail.com>
2021-08-04 20:40:49 +03:00
Skylot 5f24193c49 chore: update dependencies 2021-08-02 18:44:21 +03:00
Skylot dd29d37154 feat(gui): use FlatLaf for themes support 2021-08-02 18:32:35 +03:00
Jan S b63e3aca00 feat: add origin file info (code comment for classes, tooltip in tree) (PR #1219)
* chore: make escapeHtml also replace close angle brackets
* chore: if multiple files are loaded, show their path as tooltip
* feat: add comment on classes that contains the dex file name it has been loaded from
* fix: expected line numbers in unit test fixed
* fix: delete comments from generated code as it may contain a colon
* chore: comment removing wasn't able to handle Linux paths with slash
2021-08-01 18:15:05 +03:00
Skylot 859674ce7e fix: keep lambda classes if static field used outside (#1215) 2021-07-25 15:10:34 +01:00
Jan S ea8b9ce462 fix(xml): reversed XML attribute name decoding priority (#1208)(PR #1214) 2021-07-24 17:13:27 +03:00
Skylot b5720bd14e fix(gui): improve Quark tasks scheduling and report viewer (#1119) 2021-07-02 21:32:57 +01:00
Shaun Dang cc99409a7e feat(gui): improvements of Quark integration (#1119) (PR #1199)
* Add quark installation
* add error/warning dialog
* change Quark task to background task
* fix missing the last line of input stream
2021-06-30 18:04:50 +03:00
Skylot fef3e21c70 fix: resolve type vars from outer class (#1192) 2021-06-19 13:44:15 +01:00
Skylot f3d76c433a fix: prevent StackOverflowError in MarkFinallyVisitor (#1191) 2021-06-18 17:34:21 +01:00
nitram84 31d5715723 fix: prevent duplicated override annotations and minor optimization (#1188)(PR #1190)
* Handle explicit override annotations
* Skip override checks for private methods
2021-06-18 00:40:31 +03:00
Skylot 592eef3cda fix: resolve NPE in enum processing 2021-06-04 20:21:38 +01:00
Skylot 0541748e5f fix: resolve type variables from super types (#870) 2021-06-04 19:31:47 +01:00
Skylot cf1d9e8372 fix: allow to reuse enum fields in static fields (#1019) 2021-06-01 20:57:48 +01:00
Skylot b096d8869e fix: support branched object construction (#1019) 2021-06-01 15:58:08 +01:00
Skylot 2acc14b04a fix: resolve generic type vars for instance field get instruction (#918) 2021-05-30 10:18:35 +01:00
Skylot 1f1efb0e17 fix: allow local variables have name same as instance fields (#1183) 2021-05-29 20:18:49 +01:00
Skylot 1c08d854fb fix(gui): add memory limit checks to export and load tasks (#1181) 2021-05-29 17:11:42 +01:00
Skylot 9c252fb226 fix(gui): add memory and time limits for decompile task (#1181) 2021-05-28 17:52:52 +01:00
Skylot 4bda3b9e9b build: exclude exe build on not Windows (#1180) 2021-05-27 15:41:34 +01:00
Skylot 21da3c8602 fix: reword rename flags in cli and gui (#1178) 2021-05-25 10:10:16 +01:00
Skylot 7ec43776ae chore: update gradle and dependencies 2021-05-21 19:06:30 +01:00
Skylot 07d7e68dc2 fix: format Android resources ids as hex (#1171) 2021-05-20 18:41:46 +01:00
Skylot 8785c33d06 feat: add option to disable methods inline (#1170) 2021-05-18 10:39:30 +01:00
Skylot 661ebe439d fix: inline class as anonymous if it used only once (#1168) 2021-05-11 15:33:13 +01:00
Skylot 4732fa36a6 fix(gui): improve code area performance and line numbers repaint (#1167) 2021-05-07 17:36:06 +01:00
LBJ-the-GOAT 8dad158ae6 fix: resolve LGTM alerts (PR #1162)
* fix LGTM alerts
* Update jadx-gui/src/main/java/jadx/gui/device/debugger/BreakpointManager.java
* Update Smali.java

Co-authored-by: tobias <tobias.hotmail.com>
Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2021-04-25 23:55:47 +03:00
LBJ-the-GOAT bfc343d1ee fix(gui): correct port retry in smali debugger (#1136) (PR #1160)
Co-authored-by: tobias <tobias.hotmail.com>
2021-04-25 20:26:46 +03:00
bagipro ca723c3b47 fix(res): fix invalid XML NS names (PR #1158)
* Fix issue in invalid XML NS names
* fix: replace methods not available in Java 8

Co-authored-by: bagipro <bugi@MacBook-Pro-2.local>
Co-authored-by: Skylot <skylot@gmail.com>
2021-04-24 13:21:09 +03:00
Jan S b6657351fc fix(res): fix XML attribute decoding (#1156) (PR #1157) 2021-04-23 12:48:52 +03:00
Jan S f26032ed7d fix(gui): small search dialog optimizations (PR #1143)
* avoid extra vertical space below search options when dialog is wide
* make sure the search dialog has the correct size and the options are aligned properly
* regex search: make searchField background red in case of invalid regex entered
2021-04-23 12:33:52 +03:00
Skylot 012f7665aa chore: update gradle to 7.0, update dependencies, fix some build warnings 2021-04-22 19:42:01 +01:00
Skylot c28e8142f4 chore: fix warnings reported by snyk 2021-04-21 11:29:46 +01:00
Skylot 1462acbb92 chore: remove not needed file 2021-04-18 22:22:27 +01:00
Skylot c52c659b94 fix: correct inline flag for variables used in anonymous classes (#1154) 2021-04-18 19:10:59 +01:00
LBJ-the-GOAT 6bf358fc66 feat(gui): improve exclude package feature (#1151) (PR #1152)
* include & exclude multiple packages at the same time
* use to tree instead of list to display packages.

Co-authored-by: tobias <tobias.hotmail.com>
2021-04-16 13:37:11 +03:00
Skylot e8f57d3ace fix: prevent infinite loop in block tree mod for loops (#1147) 2021-04-08 19:01:18 +01:00
Skylot 766e7193b9 fix(gui): use correct offset for code line (#1141) 2021-04-01 21:15:17 +03:00
Choiman1559 6fe762aa7b fix(gui): update Korean translation (PR #1140)
* Update Messages_ko_KR.properties
* remove empty line insertion

Co-authored-by: skylot <118523+skylot@users.noreply.github.com>
2021-03-31 18:00:04 +03:00
Skylot 7065b1b3ba fix: remove method with more than 255 args (#1026) 2021-03-29 20:46:18 +01:00
Skylot 72b812acad fix: don't unload annotation attributes (#1089) 2021-03-29 21:35:50 +03:00
Skylot d7ffa21fbe chore: forbid use DebugUtils class with checkstyle 2021-03-29 19:35:43 +01:00
Skylot c95d64909a feat(cli): add decompilation progress 2021-03-29 14:56:40 +03:00
skylot a5b2b04317 docs: add smali debugger to readme 2021-03-28 13:54:38 +03:00
LBJ-the-GOAT 4705194a1d feat(gui): add a smali debugger (#1136) (PR #1137)
* add a smali debugger
* debugger: support android 11, support 9(may be) & 10 if debug_info available, add rerun.
* debugger: support get/set fields of this, change icons, fix bugs.
* debugger: add timeout to attach

Co-authored-by: tobias <tobias.hotmail.com>
2021-03-28 13:23:07 +03:00
Skylot 19572a674e fix: improve deobfuscation performance for overridden methods (#1133) 2021-03-20 15:48:56 +00:00
Skylot a1247f4d96 chore: update dependencies 2021-03-17 13:51:30 +00:00
Skylot 52412dfe31 fix(gui): resolve potential command injection, fix other code style issues (#1119) 2021-03-12 14:54:15 +00:00
Shaun Dang ab02e6e7c3 feat(gui): add Quark-Engine integration (#1119) (PR #1135) 2021-03-12 16:44:42 +03:00
bagipro 9ef99a2b92 feat: implement Android App Bundle support (#1129) (PR #1131)
* Implement proto parse
* fix code formatting
* fix tests with empty input
* revert not needed code style changes
* Implement parse of resources.pb for AAB

Co-authored-by: bagipro <bugi@MacBook-Pro-2.local>
Co-authored-by: Skylot <skylot@gmail.com>
2021-03-08 21:34:52 +03:00
skylot 4e5fac4b88 feat(gui): add code comments (#359) (PR #1127)
* feat(gui): add code comments (#359)
* refactor: replace instanceof search with method dispatch in RegionGen
* fix: various bug fixes and improvements for code comments
* fix(gui): support multiline code comments
* fix: resolve code differences after class reload
* fix(gui): add search for comments, allow search in active tab only
* fix: correct search for inner classes
* fix(gui): run full index on search dialog open
2021-03-04 17:45:48 +03:00
Skylot 7a14aaa17e fix: resolve variable name shadowing in anonymous classes (#1124) 2021-03-02 18:43:52 +00:00
LBJ-the-GOAT 650863836c feat(gui): improve smali printer to show bytecode (#1114) (PR #1126)
* improve smali printer to show bytecode
* set insnStart position before start decoding
* swithed line 62 and line 63, to get the proper bytes, insnStart must to be set before start to decode.

Co-authored-by: tobias <tobias.hotmail.com>
2021-03-02 16:02:56 +03:00
Skylot 3a69ac23c0 fix: restore enums with removed fields (#926) 2021-02-23 16:59:33 +00:00
Skylot b873c6ae4d refactor: use interface for CodeWriter
Details:
- add simple and annotated code writers to allow
   skip code annotations processing in jadx-cli and other places
- add annotated code info to use only than needed
- allow to set provider for codewriter in JadxArgs
- add JadxArgs argument to constructor to allow change output
- add cli option to insert debug line numbers as code comments
   (example for previous change)
2021-02-21 17:34:33 +03:00
Surendrajat 4835b1b897 fix(gui): compact TabComponent labels and TabToolTip (#1120) (PR #1121)
* Compact CodePanel labels and TabToolTip
* Remove top padding from tab title
2021-02-21 15:01:10 +03:00
Skylot 67def6319e feat(cli): add option to change deobfuscation map file (#1117)
Signed-off-by: Skylot <skylot@gmail.com>
2021-02-13 14:22:22 +00:00
Choiman1559 c56d9ac7ce fix(gui): updated korean translation (PR #1118) 2021-02-13 15:49:42 +03:00
Skylot e6588c4307 fix(gui): correct font save with '-' in name (#1116) 2021-02-12 17:17:41 +00:00
Skylot 712389ab24 build: add windows artifact, use nightly.link for download unstable build (#1113) 2021-02-06 12:43:49 +00:00
Skylot 5f1be38490 build: upload unstable binaries as build artifact (#1113) 2021-02-05 21:33:04 +00:00
Skylot 7982592c6e build: remove Travis and Bintray, disable codecov and sonarqube (#1113) 2021-02-04 12:14:39 +00:00
Skylot 69574918b5 fix: allow constructor invoke as lambda 2021-02-02 18:27:36 +00:00
Skylot f6783e8f5e fix: implement 'copy' and 'isSame' methods in InvokeCustomNode 2021-02-02 16:27:45 +00:00
Skylot 913b00a4d4 build: setup simple test build using Github Actions 2021-02-01 19:37:19 +00:00
Skylot 22fa132110 fix: support instance invoke for 'invoke-custom' instruction (#384) 2021-02-01 19:02:31 +00:00
Skylot 5a30fc0300 fix: improve const inlining in finally blocks (#917) 2021-01-30 19:44:38 +03:00
LBJ-the-GOAT c774ffc979 feat(gui): search in resource files (#347) (#1032) (PR #1108)
Co-authored-by: tobias <tobias.hotmail.com>
2021-01-30 19:34:20 +03:00
Skylot c93e7fb9cd fix: detect loaded class duplication (#1107) 2021-01-29 11:31:00 +00:00
Surendrajat 3437888964 fix(gui): use common keyboard shortcuts for navigation (#1085) (PR #1106) 2021-01-27 21:37:13 +03:00
Surendrajat b314e0bdda fix(gui): improve color schemes (#1101) (PR #1105)
* do not use hardcoded color for highlighting
* add a new theme: druid
2021-01-27 21:02:16 +03:00
LBJ-the-GOAT 2bdde6a528 fix(gui): fix variable usage & caret position after rename (#1099) (PR #1103)
Co-authored-by: tobias <tobias.hotmail.com>
2021-01-27 19:23:07 +03:00
LBJ-the-GOAT c61cb80a8b feat(gui): rename local variables (#1023) (#1084) (PR #1098)
Co-authored-by: tobias <tobias.hotmail.com>
2021-01-27 14:58:57 +03:00
Fi5t 4217aab933 fix: new gradle export (#1095) (PR #1097)
* Update export of gradle project

* Fix hardcoded index

* Add versionCode and versionName to the export template
2021-01-26 21:31:12 +03:00
LBJ-the-GOAT ffb2956d90 fix(gui): fix caret positions of search/usage/goto decl, add search to popup menu (#1093) (PR #1094)
* fix caret positions of search/usage/goto decl to matched place & add menu items for search

* Remove static field for main window

Co-authored-by: tobias <tobias.hotmail.com>
2021-01-25 14:49:21 +03:00
Skylot 9744547fab fix(gui): correct line numbers with enabled line wrap (#1092) 2021-01-24 16:10:37 +00:00
Choiman1559 b580d1cf5b fix(gui): update korean translation (PR #1091) 2021-01-23 20:24:09 +03:00
LBJ-the-GOAT 855c7b608e feat(gui): add shortcuts to TabbedPanel and enhance JumpPosition (#1085) (PR #1090)
* Add shortcuts to TabbedPanel & enhance JumpPosition

* Update jadx-gui/src/main/java/jadx/gui/ui/codearea/RenameAction.java

Co-authored-by: tobias <tobias.hotmail.com>
2021-01-23 14:20:08 +03:00
Shatyuka 707ed9a828 fix(gui): codearea popup menu always disabled in macos (#1052) (PR #1086) 2021-01-18 19:03:32 +03:00
alienhe a3ea514521 fix: elemSize=0 fill_array_data_payload insn obfuscation (PR #1082)
Co-authored-by: hexun <hexun@fenbi.com>
2021-01-15 12:10:33 +03:00
Skylot 3dfaec5033 feat: initial support for 'invoke-custom' instruction (#384) 2021-01-14 20:15:23 +00:00
Skylot 778106c41b chore: update gradle and java dependencies 2021-01-14 19:58:01 +00:00
Skylot c47e9cdde4 fix: allow to load Spring Boot jar (#1066) 2021-01-04 20:31:17 +03:00
Skylot 8dd76420c8 fix(deobf): complete disable rename if all rename options unchecked (#1076) 2021-01-02 22:22:45 +03:00
Skylot dfe026ac2d test(gui): fix localization test 2021-01-01 18:04:42 +03:00
Choiman1559 f0849d0ed1 feat(gui): added Korean translation (PR #1074)
* Added korean translation properties

* Added korean translation

* Update Messages_ko_KR.properties

* Update NLS.java
2021-01-01 18:00:10 +03:00
Skylot b7ca898b77 perf: improve processing of override related methods (#1072) 2020-12-31 13:33:18 +03:00
green9317 1b8b377f90 feat(gui): allow use regex in the search dialog (PR #1069)
* Implements the option to use Regex on the Search Dialog

* Updated the way search works to pass a search settings class with options set rather than method arguments

* Fixing style issues

* Updating Style Fix

* Cleaning code

* Updating code to combine SearchSettings and Search Impl as well as efficiency improvements.

* Fixing bug caused from moving code in the searchImpl class

* Fixing a minor bug

* adding style fixes
2020-12-29 22:12:20 +03:00
Skylot 7227f1ac78 fix: don't skip method instructions in fallback mode (#1063) 2020-12-24 12:58:15 +00:00
Jan S 23f088105e fix(gui): synchronized conditional usageList remove method added (PR #1065) 2020-12-24 15:42:52 +03:00
Skylot 3bbb6b1058 fix: rename all related overridden methods in deobf map file (#1058) 2020-12-21 14:47:57 +00:00
Skylot 3a4895b21c test: check code after reload 2020-12-21 17:38:29 +03:00
Jan S 4e6afe9b64 fix(gui): do not show empty rename dialog if user chooses not to change DeobfuscationForceSave settings (PR #1061) 2020-12-21 16:23:37 +03:00
Alisson Lauffer dd4c20249f fix(gui): increase settings vertical scroll increment (PR #1059) 2020-12-21 15:14:19 +03:00
AdamN b54b2d47e9 fix(res): use lowercase for resource filename and only use underscore for compatibility with newer android studio (#1043, PR #1057) 2020-12-20 19:14:09 +03:00
Skylot 64fb587d0f fix(gui): improve rename for overridden methods 2020-12-19 18:07:51 +03:00
Skylot 2ca3c65300 fix(deobf): don't rename unresolved or classpath overridden methods
Change details:
- use common code for process override methods in deobfuscator (move OverrideMethodVisitor to pre-decompile stage)
- add all public methods to jadx class set to allow search of override base method
- add don't rename flag if override hierarchy have unresolved methods
2020-12-19 18:07:51 +03:00
Jan S 549f346d5e fix: prevent NullPointerException and ConcurrentModificationException when renaming something (PR #1055) 2020-12-18 17:12:32 +03:00
Jonas Konrad 80a879bddf fix: properly transform array creation with constant field length to filled-array (PR #1054) 2020-12-16 19:12:11 +03:00
Skylot 13c17a000a fix: force code inline after new array creation resugar (#1048) 2020-12-12 20:12:42 +00:00
Jonas Konrad 96dea75bc8 fix: preserve original method details in inlined invocation (PR #1049) 2020-12-12 22:08:50 +03:00
Skylot 035fce6191 fix: improve error reporting for instruction decode failure (#1046) 2020-12-11 22:06:08 +03:00
Jonas Konrad 2f5dd171d0 fix: do not remove method start block when it is referenced from dead code (PR #1044) 2020-12-09 23:19:21 +03:00
Skylot e7598d4340 fix: don't add region on exit block (#1040) 2020-12-03 21:45:21 +03:00
Skylot 76d0a39a0f fix: handle empty loop body (#1040) 2020-12-03 21:45:21 +03:00
Jonas Konrad 3f25f072c6 fix: properly traverse methods with synchronize blocks that have no clear exit (PR #1041) 2020-12-03 17:15:49 +03:00
Jonas Konrad 5c75f249c7 fix: do not count nop instructions when considering methods for fallback mode printing (#1038) (PR #1039) 2020-12-01 13:39:48 +03:00
Skylot 02bfe63245 fix: support AAR files as input (#1034) 2020-11-30 17:00:25 +03:00
Jonas Konrad faa205a486 fix: process exception handler when handler block is start of a new try block (PR #1036) 2020-11-30 15:46:18 +03:00
Jan S 3a6d645ea3 fix(res): do not rename resources names for building res-map.txt (PR #1035)
fix: do not rename resources names for building res-map.txt
allow loading of resources.arsc from android.jar files
res-map.txt bases on resources.arsc from API 3, 4, 7-30 (taken from https://github.com/Sable/android-platforms)
2020-11-30 14:00:58 +03:00
Skylot e65468b97a fix(gui): proper reference highlighter remove (#1031) 2020-11-24 12:24:15 +00:00
Skylot edbe6015f6 fix(res): unescape new line symbol in string resources (#1030) 2020-11-23 16:35:05 +00:00
bagipro f642e11a7a fix(res): fixes ns value (PR #1029)
* Fixes ns value
* fix formatting

Co-authored-by: bagipro <bugi@MacBook-Pro.local>
Co-authored-by: Skylot <skylot@gmail.com>
2020-11-23 00:54:03 +03:00
Skylot fdc87fe296 fix: update class set data to Android API 30 2020-11-22 18:43:49 +00:00
Skylot 7396c7595f fix: resolve type variables in invoke from arg types 2020-11-22 18:41:38 +00:00
Skylot d39849ad00 fix(res): update android resources to API 30 2020-11-21 23:24:18 +03:00
Skylot d65ee902f7 fix: load android res map in getter 2020-11-21 20:24:11 +00:00
Skylot eada4b0fc3 fix: don't add 'default' for static methods in interfaces 2020-11-21 23:04:55 +03:00
bagipro 6f9619126a fix(res): rename invalid res keys (PR #1027)
* Renames invalid res keys
* perf: store compiled resource name pattern for better performance

Co-authored-by: bagipro <bugi@MacBook-Pro.local>
Co-authored-by: Skylot <skylot@gmail.com>
2020-11-21 23:02:47 +03:00
Skylot 4bc6007a4d fix: error loading resource map file from bundled jar (#1020) 2020-11-19 16:09:12 +03:00
Skylot d3f5154c19 fix: use text file for store android resource mapping (#1020)
Signed-off-by: Skylot <skylot@gmail.com>
2020-11-19 10:23:53 +00:00
Skylot 71aa29cc71 docs: remove pyjadx link (#1024) 2020-11-18 19:30:18 +00:00
Skylot 98d8015015 refactor: split field init attribute 2020-11-16 21:09:38 +00:00
Skylot 42a44f210d feat: concat constant strings (#1014) 2020-11-16 19:29:08 +03:00
Skylot 29ff86b74f fix: don't unload attributes added to class at initial load (#1010) 2020-11-15 17:54:42 +00:00
Skylot 381afa2741 chore: fix release config 2020-11-14 16:14:13 +00:00
Skylot 82d4099541 fix(res): skip unused bytes in xml attributes parsing (#1013) 2020-11-11 16:46:26 +00:00
Skylot 5f659c8de7 fix: don't apply again already resolved types (#1012) 2020-11-10 13:31:49 +00:00
Skylot e054ea6683 fix: adjust limits to skip processing of large methods (#1012) 2020-11-10 13:23:41 +00:00
Skylot 0deafb768b fix: correct merge code variables across PHI instructions (#930) 2020-11-09 20:46:44 +00:00
Skylot cd612b452c chore: resolve some warnings reported by IntelliJ Idea 2020-11-07 15:44:57 +00:00
Skylot 009939f866 fix: prevent endless loop in method signature parsing (#1007)
Signed-off-by: Skylot <skylot@gmail.com>
2020-11-05 17:23:37 +00:00
Skylot cd006ce78e fix: improve resource type detection and remove deprecated method 2020-11-04 21:09:57 +00:00
Skylot 71bf2aa59f fix: don't apply const split if not needed 2020-11-04 20:21:24 +00:00
Skylot 714b935474 fix: improve checks for boolean to int conversion (#921) 2020-11-04 19:23:57 +00:00
Skylot 2a2b83a695 fix: do not copy input files as resources to output folder 2020-11-03 18:08:57 +00:00
Skylot acdaa95854 test(cli): add multiple input test (#936) 2020-11-03 17:27:15 +00:00
Skylot 278c5f6142 feat(gui): allow to load multiple files, button for add files (#936) 2020-11-02 18:40:55 +00:00
Skylot 8ca3cd3155 fix: don't use static vars of mutable LiteralArg class (#1005) 2020-11-01 15:56:29 +00:00
Skylot 2b7d7ce2cf fix: additional casts at use place to help type inference (#1002) 2020-10-31 16:00:57 +00:00
Skylot a22efc2eb6 fix: don't add cast for PHI insn (#1002) 2020-10-30 23:04:57 +03:00
bagipro 804c8eff91 fix(res): fixes deobfuscated resource text files saving (PR #1004)
Co-authored-by: sergey-wowwow <bugi@MacBook-Pro.local>
2020-10-30 20:28:46 +03:00
Skylot aec8ebe237 fix: reload request for correct class in method inline visitor (#999) 2020-10-29 21:41:35 +03:00
Alisson Lauffer 7353790ed1 fix(gui): only show renaming option for JClass, JField and JMethod (PR #1001) 2020-10-29 20:23:36 +03:00
Skylot e09e8e5823 chore: resolve some issues reported by sonar and lgtm 2020-10-28 14:16:50 +00:00
Skylot 92773417b3 perf(gui): reduce updates count for memory usage bar (#1000)
- disabled by default
- update only if label changed
- skip updates if app window becomes inactive
2020-10-27 12:15:04 +00:00
Skylot 12dc4fde8a fix(gui): clear jumps history on file close 2020-10-27 11:54:11 +03:00
Skylot d1e5186d4a perf(res): speed up rename of deobfuscated resources 2020-10-26 12:28:41 +00:00
Skylot d06ba95374 chore: remove unused static strings array 2020-10-26 11:15:25 +00:00
sergey-wowwow f0e6c8ea8e fix(res): put deobfuscated files to res/ folder (PR #995) 2020-10-25 20:28:06 +00:00
Skylot c94c204da2 chore: fix travis badge link 2020-10-25 22:37:46 +03:00
sergey-wowwow 71617a1c70 feat(res): fix duplicate entries and deobfuscate file names in XML resources (PR #995)
* Fixes dublicates entries in XML resources
* can't use binary search on this list
* add entry config to name comparator, preserve renames by id, improve performance
* Deobf resource files
* Add break
* Changes ResourceFile

Co-authored-by: sergey-wowwow <bugi@MacBook-Pro.local>
Co-authored-by: Skylot <skylot@gmail.com>
2020-10-25 22:18:41 +03:00
Alisson Lauffer 9f684937c6 feat(gui): rename classes and fields by popup menu in tree panel (PR #993) 2020-10-20 12:26:15 +03:00
Coin ff6665c716 fix(gui): use correct charset when writing mapping file (PR #992) 2020-10-17 18:51:08 +03:00
Skylot aa8fd3c861 fix: added another enum restore pattern (#926) 2020-10-02 18:38:08 +01:00
Skylot e2b42804d5 fix: resolve several issues with package rename and class reload (#987) 2020-10-02 16:34:38 +01:00
Skylot 0f6e942c5b build: remove check stage in gitlab build 2020-10-01 21:55:51 +01:00
Skylot c0a81978bf fix(gui): allow to rename packages (#987) 2020-10-01 21:39:23 +01:00
Skylot b76c882210 fix(gui): fix rename dialog pack (#972) 2020-09-28 19:27:48 +01:00
Skylot 14cbfbc5a4 fix: rerun signature parser on class reload (#981) 2020-09-28 16:19:52 +01:00
skylot 9b1761f71f fix: prevent zipbomb forged headers attacks (#980, PR #982) 2020-09-27 21:10:30 +03:00
Skylot 73ca2e0fa4 fix: move class unload to synchronized block (#977)
Signed-off-by: Skylot <skylot@gmail.com>
2020-09-27 18:23:23 +01:00
Skylot 4e4c7f7d7b fix: more visibility checks for @Override (#984)
Signed-off-by: Skylot <skylot@gmail.com>
2020-09-24 17:44:29 +01:00
Skylot 33f2c3f220 fix: transform loop to for with branching at end
Signed-off-by: Skylot <skylot@gmail.com>
2020-09-23 19:20:37 +01:00
Skylot dcca0133fb chore: update gradle and dependencies 2020-09-17 21:03:17 +03:00
Skylot 408201b69b fix: restore enum for java 15 2020-09-17 20:13:36 +03:00
Skylot e024628d46 chore: fix directory search for smali tests 2020-09-17 19:53:18 +03:00
Skylot 6428f29373 fix: don't add @Override for static methods (#976) 2020-09-17 16:47:44 +03:00
Skylot cfaa6ab6df fix: don't add @Override if super method is private (#976) 2020-09-17 16:39:55 +03:00
Skylot 91ee7565ac fix: resolved regression in Kotlin metadata parser 2020-09-14 19:09:54 +01:00
Skylot 1bbcac2ab3 fix: handle xor on boolean (#921) 2020-09-13 22:06:04 +01:00
Skylot 60b2353afe fix: adjust types for arithmetic instructions (#921) 2020-09-11 21:31:10 +03:00
Skylot 50cfa4c971 chore: improve error reporting in tests 2020-09-11 21:31:10 +03:00
Skylot 691bf8faca fix: checks for casts in field access, move method inline to visitor (#962)
Signed-off-by: Skylot <skylot@gmail.com>
2020-09-07 17:29:39 +01:00
Skylot 89b4ae6a6f fix: correct type and data merge for filled-array instruction 2020-08-23 15:31:46 +01:00
Skylot 605a67932f chore: remove unused array allocation 2020-08-22 15:33:43 +01:00
Jan S 1774dc74e3 feat(deobf): improve deobfuscated class names by including class properties and info about super class respectively implemented interfaces (PR #969) 2020-08-21 19:18:41 +03:00
Skylot 2d641bf049 fix: don't trust type info in signature, check before apply (#858) 2020-08-17 22:05:13 +01:00
Skylot 94a06d9b6f feat(gui): on mouse hover highlight identifiers with enabled actions (like 'find usage' or 'rename') 2020-08-17 17:38:48 +01:00
Skylot a485942731 docs: add jadx logo to readme 2020-08-16 13:24:09 +01:00
Skylot 2c1b3b2480 Merge branch 'jpstotz-copyprefs' into master 2020-08-16 15:14:10 +03:00
Skylot f1f7c70aee chore(gui): fix locales test 2020-08-16 13:13:50 +01:00
Jan Peter Stotz 718caf8cb1 chore (gui): Add button in preferences dialog to copy the preference values in text form (json) to clipboard 2020-08-16 13:05:49 +02:00
Skylot 545cd4ec12 fix: don't inline 'null' object to make code compilable (#964) 2020-08-10 20:42:11 +01:00
Skylot 444ea9ec7e fix: load .class files 2020-08-10 12:20:42 +01:00
Skylot 13609a5c44 fix: allow to inline variables around 'monitor-exit' in synchronized block 2020-08-09 15:19:54 +01:00
Skylot d6ad21f6f9 fix: correct detection of exits in synchronized block (#942) 2020-08-09 17:04:54 +03:00
Skylot 593a32a689 refactor: use same instance for empty type vars annotation 2020-08-09 17:04:54 +03:00
Skylot 7fed5534eb refactor: add method info caching to speed up initial loading 2020-08-07 19:22:01 +01:00
Skylot 1560284831 refactor: fix zip security in dex plugin, remove smali deps from jadx-core 2020-08-06 13:39:40 +01:00
Skylot 558a86739f fix: bring back smali files support (#961) 2020-08-05 19:58:43 +01:00
Skylot bfd60b733a fix: handle method arguments in primitive types conversion (#956) 2020-08-04 12:26:31 +01:00
Skylot ae26512601 fix: use internal usage info for rename, fix index refresh (#791) 2020-08-03 11:55:19 +01:00
Skylot 498c2f5256 Merge branch 'rename' into master 2020-08-02 13:25:15 +03:00
Skylot 459f12d61f fix: several improvements for generics and type inference
- support 'extends' for generic type variables
- insert cast instructions to help type inference (#956)
- correct move instructions insertion (to resolve types in PHI)

Signed-off-by: Skylot <skylot@gmail.com>
2020-07-31 18:47:32 +01:00
Skylot bcd6e537e0 fix: correct parsing for array-data-payload 2020-07-30 19:25:15 +01:00
Skylot 867c3413e9 test: replace const values 2020-07-20 13:56:02 +01:00
Skylot 0f808d5c60 fix: resolve char literal incorrect print as string (#856) 2020-07-20 10:33:10 +01:00
Skylot f5767dd865 fix: use recursive objects for nested inner generic classes (#869) 2020-07-16 14:14:06 +01:00
Skylot 631a855bac chore: resolve deprecations in tests 2020-07-13 09:26:55 +01:00
Skylot c616b5b03b build: resolve gradle deprecation warnings 2020-07-11 12:51:38 +01:00
Skylot 3e9f4a5060 fix: improve limit calculation for type updates in type inference (#854) 2020-07-10 18:36:17 +01:00
Skylot 31434186ab fix: improve boolean type handling in type inference 2020-07-08 12:34:21 +01:00
Skylot e81ba1c431 build: fix latest java version for gitlab build 2020-07-06 14:16:57 +01:00
Skylot b219ab607f fix: exclude directories from dex convertion results 2020-07-05 19:02:14 +03:00
Skylot cd8307f432 chore: remove unused d8 from convert plugin 2020-07-05 19:02:14 +03:00
Skylot a720105208 chore: update dependencies 2020-07-05 19:02:14 +03:00
Skylot 34692c41f2 Merge branch 'master' into rename
# Conflicts:
#	jadx-core/src/main/java/jadx/core/dex/nodes/ClassNode.java
#	jadx-gui/src/main/java/jadx/gui/ui/RenameDialog.java
2020-07-03 16:39:02 +01:00
Bet4 8a8b945eb8 fix(gui): run indexJob before rename (PR #910) 2020-07-03 17:26:24 +03:00
M.Yasoob Ullah Khalid ☺ 99569c52ac docs: fixed grammar slightly (PR #957) 2020-07-03 17:22:00 +03:00
Snowhite f696dc715b fix(gui): update Messages_zh_CN.properties (PR #959)
modifying error of positional argument in Chinese search result text
2020-07-03 17:19:18 +03:00
Jan S 21b8552386 fix (gui): launch4j exe startup wrapper does not apply maximum heap configuration correctly (#951) 2020-06-11 17:06:43 +03:00
Skylot 4b1886700d fix(gui): merge plugins service files (#949)
Signed-off-by: Skylot <skylot@gmail.com>
2020-06-11 14:26:23 +01:00
Skylot a83ca1f85b fix: don't use FileChannel on ZipFs to avoid creation of temp files (#950) 2020-06-10 22:39:56 +01:00
Skylot 65553c156c fix: restore android R class (#947) (regression) 2020-06-06 19:19:55 +01:00
Skylot 440357d2e8 fix: allow cross-block move inline (#946)
Signed-off-by: Skylot <skylot@gmail.com>
2020-06-01 22:24:42 +01:00
Skylot 5e62b9077a fix: resolve ClassCastException on encoded value access (#946) 2020-06-01 23:39:18 +03:00
Skylot 6192ced214 fix: improve type inference of type variables in method invoke (#913) 2020-06-01 23:39:12 +03:00
Skylot ae31fee8dd fix: add cast to exact type on field access (#729) 2020-05-29 17:53:39 +01:00
Skylot e7b00cc76e fix: add methods and fields types into usage info (#729) 2020-05-27 20:55:32 +01:00
Skylot 7d29c5d766 fix: correct skip size for sparse switch payload 2020-05-27 20:54:28 +01:00
Skylot 15776c4ce3 fix: make class public if some method going to be inlined (#729) 2020-05-26 21:23:27 +01:00
Skylot d720179deb fix: collect class usage and fix class access modifiers (#729) 2020-05-22 12:29:34 +01:00
Skylot 0d69e0ac97 refactor: use own dex parser instead deprecated dx lib 2020-05-21 22:02:20 +01:00
Skylot 09e267f8bc fix: resolve generic types in method arguments (#913) 2020-05-17 14:58:34 +01:00
Soul Trace 705ceca42a fix(gui): RenameDialog: Warn user if deobfuscation settings are invalid (PR #935)
The rename functionality relies on deobfuscation for now - so let the user know
this and ask the user to enable deobfuscation to get rename working.

The "Force rewrite deobfuscation map file" option effectively disables
renaming, because renaming relies on deobfuscation map modification for now,
but Force rewrite rewrites the map on each file reload, destroying changes.
So. let the user know this issue instead of silent failure.
2020-05-14 22:56:35 +03:00
Skylot 58722d372e fix: don't generate string concatenation without assign to variable 2020-05-14 12:25:42 +03:00
Skylot f482b8b95c fix: restart comment to escape strings in insn fallback dump 2020-05-14 12:25:42 +03:00
Jan S 21e4dee0e2 chore: exclude project build directories from code style checking (PR #934) 2020-05-13 20:46:58 +03:00
Jan S c7a12ad75b fix(res): resource XML generation for parent attribute added (PR #933, #931) 2020-05-13 20:25:45 +03:00
Skylot 7cd77ae379 fix: try raw types to help type inference (#913) 2020-05-12 19:23:49 +01:00
Skylot d59c99ddfe fix: attach method details before OverrideMethodVisitor 2020-05-12 19:23:27 +01:00
Skylot 85760cc844 fix: replace type variables in arrays (#913) 2020-05-12 19:16:52 +01:00
Skylot 0692464b85 fix: mark override methods and fix return type (#913) 2020-05-11 21:35:00 +01:00
Skylot 3968222744 style: fix incorrect import 2020-05-10 15:46:24 +01:00
Skylot c05368d92e style: prefer use Stream.of method 2020-05-10 15:46:06 +01:00
Skylot 404136cd72 fix: improve type inference for generics in invoke insn (#927) 2020-05-10 14:20:27 +01:00
Skylot b1d5ed0066 fix: don't modify method argument types in MethodInvokeVisitor (#927 #836) 2020-05-09 21:10:37 +01:00
Skylot e22474e0a7 fix: inline move instructions to help process constructors (#927) 2020-05-09 15:38:18 +01:00
Skylot 45b7304630 fix: workaround for link clicks in RSyntaxTextArea (#929) 2020-05-08 20:01:20 +01:00
Skylot 692536c584 chore: ignore tests in tmp package 2020-05-04 15:47:30 +01:00
Skylot 4e3d85887c fix: correctly process extended enums if class is not inner (#924) 2020-05-04 15:19:17 +01:00
Skylot 87852328da fix: resolve error in SkipMethodArgsAttr if method not yet loaded (#924) 2020-05-04 11:50:31 +01:00
Skylot 2207cd7b52 fix: inline class constants to fix enum transform (#916) 2020-05-03 22:32:32 +03:00
Skylot f3cd4e38d7 fix: check enum constructor content before removing (#922) 2020-05-03 22:32:32 +03:00
Skylot 2dce1c0ad9 build: update gradle and dependencies 2020-05-03 22:32:27 +03:00
Jan S 258ecad277 fix(res): XML parsing: handling of TYPE_DYNAMIC_REFERENCE entries (#919, PR #923) 2020-04-29 21:47:20 +03:00
Skylot 7f5092c0d5 fix: redone shadowed fields handling (#897) 2020-04-27 22:29:34 +01:00
Skylot a7f315f596 fix: split CONST used in PHI to help type inference (#900) 2020-04-26 20:37:34 +01:00
Skylot 4dc4aa122b fix: don't duplicate result arg with instruction copy (breaks SSA variable assign) 2020-04-26 18:44:43 +01:00
Skylot e3f388af11 fix(deobf): resolve NPE when package is empty (if rename is disabled) 2020-04-26 20:40:20 +03:00
Skylot 83196628c9 docs: fix issue and PR templates 2020-04-26 20:40:20 +03:00
skylot 315c07d4f6 feat(res): rename resources keys if contains unprintable chars or duplicates (#844) (PR #909) 2020-04-21 22:33:35 +03:00
Skylot 47dadf0a43 fix: use correct class for Throwable, insert catch arg name if not defined (#896) 2020-04-18 21:28:29 +03:00
yunlong17568 c62039f327 fix(gui): use env %JAVA_HOME% as the JRE path (PR #895)
Co-authored-by: yunlong.yang <yunlong.yang@inveno.com>
2020-04-11 20:41:27 +03:00
Skylot a5ea560edc fix: preserve code semantics on array-for-each transform (#893) 2020-03-31 21:41:36 +01:00
Skylot e09e933f9c fix: additional checks for class signature 2020-03-22 12:12:47 +00:00
Skylot dbd00d5a8b refactor: use instance methods for error and warning notifications 2020-03-22 12:01:42 +00:00
Skylot 2da772df8e fix: resolve some cases of switch in loop (#876) 2020-03-21 18:42:27 +00:00
Skylot 4cdad0e83e fix: correct method exit blocks collection (#876) 2020-03-17 19:38:45 +00:00
Skylot 2f780da305 fix: remove enum methods after instructions check (#884) 2020-03-16 20:31:47 +00:00
Skylot 9d8066f4b8 fix: don't remove synthetic methods from enum (#884) 2020-03-16 19:06:52 +00:00
Jan S 2cc49256a9 chore(gui): optimized the text search for classes, methods and fields (PR #887) 2020-03-15 18:55:32 +03:00
Jan S 79ab2e11f8 chore(gui): preferences dialog changed to two-column mode (PR #888) 2020-03-15 18:21:08 +03:00
Jan S c1f4302e62 feat(gui): allow to search for full method/field signature, not only the name (PR #880) 2020-03-10 12:11:44 +03:00
Skylot f66ec9168c test: update test TestAnonymousInline 2020-03-09 22:44:30 +03:00
Skylot 37aecf72cb Merge branch 'master' into rename 2020-03-09 19:43:40 +00:00
Bendegúz Ács 3c7be5e9be fix: use super instead this when super member is shadowed (PR #878)
* Added failing test for super member shadowing.
* Fixed new test containing incorrect variable names.
* Implemented marking super fields used in a subclass with super keyword.
* Renamed member variable in the example to reflect smali and test.
* Fixed formatting and imports.
2020-03-07 19:52:21 +03:00
Skylot 89dbae8f8e fix: resolve NPE while compare outer generic types 2020-02-29 19:55:16 +00:00
Skylot 5eec8f754d fix: class resolving issues (#867) 2020-02-29 19:24:01 +00:00
Skylot 49a82c8388 fix: method info cache error (#868) 2020-02-29 19:22:18 +00:00
Skylot 26bad4a1cd fix: replace constants for arrays in annotations (#831) 2020-02-29 18:55:30 +00:00
Skylot fa0a38d3aa fix: don't use OS specific new line chars (#861) 2020-02-23 15:37:07 +00:00
Jan S b56fd4d29a chore: add inlined class name as comment (PR #865)
* chore: add inlined class name as comment
* chore: adapt unit test for inlined class name as comment
2020-02-23 17:06:10 +03:00
Jan S 4520747167 fix: concurrent access may cause an java.lang.ClassCastException in JNodeCache (PR #864) 2020-02-23 16:22:49 +03:00
Skylot e444ecb2c7 fix: improve wildcard types compare (#857) 2020-02-17 19:31:13 +00:00
Skylot 1336c47d18 fix: speed up switch processing by skip not relevant exits (#846) 2020-02-16 15:50:02 +00:00
Skylot 519a74e8d2 fix: improve type inference for arrays (#837) 2020-02-16 17:12:31 +03:00
Skylot dea7714ef3 feat: add methods information from standard library, improve generics and varargs restore (#836) 2020-02-16 17:12:31 +03:00
Skylot 74b88b407e chore: add config for lgtm.com analysis 2020-02-14 19:29:24 +00:00
Skylot 57c28c61e0 fix: restore enum for several blocks in class init method 2020-02-14 18:08:37 +00:00
Skylot 87320348dd chore: update all dependencies and gradle 2020-02-12 20:43:27 +00:00
Skylot fcb70e69c1 fix: don't print commented case value if it is an instruction (#850) 2020-02-11 22:08:14 +03:00
Jan S 4859629850 fix: record inlined classes and generate Smali code for them (PR #851, #848)
* fix: additionally show smali code of all inlined classes (recursively)
* variable name corrected
2020-02-11 22:06:07 +03:00
Jan S bd0d248fd0 fix: additionally show smali code of all inner classes (recursively) (PR #849, #848) 2020-02-10 22:00:32 +03:00
Skylot c24a3edb44 fix: inline assignment instruction from same block (#820) 2020-02-09 14:40:27 +00:00
Skylot d0f197ea3d fix: shrink code if region maker add FORCE_ASSIGN_INLINE to insn (#845) 2020-02-09 14:36:59 +00:00
Skylot 5502d93cd5 fix: additional checks before insert move to help type inference (#843) 2020-02-04 18:45:27 +00:00
Skylot 073fd76aa2 chore: update actions/checkout in gradle wrapper validation (#832) 2020-02-04 17:19:16 +00:00
Yaroslav Yadrov 492a3f6928 feat(deobf): add classname parsing for Kotlin metadata (PR #842, #758) 2020-02-02 17:08:29 +03:00
Skylot 1ce8fa8bdd fix: don't apply types if search failed (#840) 2020-01-28 20:07:58 +00:00
Skylot 1bb90233b9 test: NYI tests for #836 and #837 2020-01-27 19:23:35 +00:00
Skylot 49ce92f540 fix: remove move instructions with unused result (#835) 2020-01-24 17:37:53 +00:00
Skylot 2107da2e1a fix: improve 'out' block detection in switch (#826) 2020-01-23 18:58:17 +00:00
S-trace d98321026d gui: RenameDialog: Unload classes in refreshTabs() before refreshing
This should fix possible problems with incorrect refresh for open classes.
2020-01-20 10:13:20 +03:00
S-trace 0b6fabbc71 gui: Perform classes unload in the background UnloadJob
This should improve interface responsibility if there are many classes
to refresh after rename.
2020-01-20 10:13:20 +03:00
Skylot bb0fad2834 fix: resolve multi-threaded unloading 2020-01-20 10:13:20 +03:00
Skylot 08f9722e33 Merge branch 'master' into rename 2020-01-20 10:12:49 +03:00
Skylot 62ca30bbc6 fix: additional patterns to restore enum classes (#830) 2020-01-19 11:12:23 +00:00
S-trace 467403362d core: ConstStorage: Use ConcurrentHashMap for values map in ValueStorage
Exception in thread "pool-9-thread-7" java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)
        at java.util.HashMap$EntryIterator.next(HashMap.java:1479)
        at java.util.HashMap$EntryIterator.next(HashMap.java:1477)
        at jadx.core.dex.info.ConstStorage$ValueStorage.removeForCls(ConstStorage.java:61)
        at jadx.core.dex.info.ConstStorage.removeForClass(ConstStorage.java:100)
        at jadx.core.dex.nodes.ClassNode.deepUnload(ClassNode.java:290)
        at jadx.core.dex.nodes.ClassNode.deepUnload(ClassNode.java:295)
        at jadx.core.dex.nodes.ClassNode.reloadCode(ClassNode.java:284)
        at jadx.api.JavaClass.refresh(JavaClass.java:62)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
2020-01-17 10:38:15 +03:00
S-trace 265a78cd23 core: ConstStorage: Do not remove values from duplicates set in removeForCls()
If the constant already got duplicates - it will have duplicates even after
class reload, won't it?
But removing this constant from duplicates may break constants replacing
(just imagine a class TestClass with public static final int TEST_CONSTANT = 1;
 - after reloading TestClass each "(int) 1" litheral will be replaced to
"TEST_CONSTANT" reference in each reloaded class and trivial increments will
become werid expressions (int y = x + 1; will become
int y = x + TestClass.TEST_CONSTANT;)).
2020-01-17 10:38:15 +03:00
S-trace a0e13d0481 gui: RenameDialog: Rename tmp deobf map file too
Fixes /tmp/deobf_tmp_*.txt temporary files accumulation on renames.
2020-01-17 10:38:15 +03:00
S-trace 77fc6435a0 core: ConstStorage: Don't put known duplicate value to ValueStorage.values map
This is a microoptimization, which remove unnecessary values.put() and
values.remove() pair of operations if ValueStorage.put() is called for a
known duplicated value.
2020-01-17 10:38:15 +03:00
Skylot cd7e5bf020 Merge branch 'master' into rename 2020-01-17 10:37:43 +03:00
Skylot 5e7388f686 refactor: fix several issues reported by sonar 2020-01-16 12:16:32 +03:00
Skylot 1047e751e6 chore: fix github action for gradle wrapper validation 2020-01-16 10:47:31 +03:00
Jonathan Leitschuh c598871764 chore: official Gradle Wrapper Validation GitHub Action (PR #832)
See: https://github.com/gradle/wrapper-validation-action
2020-01-16 10:19:39 +03:00
Skylot 2921c66834 fix: replace constants inside annotations (#831) 2020-01-14 19:52:03 +00:00
Skylot 7bbb083c36 refactor: small changes to switch region and region debug print 2020-01-13 19:27:52 +00:00
Skylot 531650c9f2 refactor: allow to change temp dir using system property JADX_TMP_DIR 2020-01-13 15:32:32 +03:00
Skylot f3098741c3 test: switch with fallthrough cases (#826) 2020-01-08 14:26:40 +00:00
Skylot 9dbffef140 fix: deep reload for inner classes, const values and anonymous classes 2020-01-05 22:12:13 +03:00
Jan S c97e504686 fix: additionally show smali code of inner classes (PR #824) 2020-01-05 12:46:07 +03:00
Skylot 0c4b807caa fix: improve ClassNode reloading and revert some changes 2020-01-03 20:46:47 +03:00
S-trace 1eca2b6cb0 core: ClassInfo: Do not ignore setting alias to original class name
Fixes trouble with renaming class back to its original name.
2020-01-03 06:09:26 +03:00
S-trace 17cbb3eab0 core: Fix possible NPE in DebugInfoParser.addrChange()
This may happen because MethodNode.unloadInsnArr() call from BlockSplitter.visit() - after it instructions[] become null.
So, try to reload method before processing its instructions array and bail if insnArr still null even after reloading method.
2020-01-03 06:09:25 +03:00
S-trace c72f2a2c96 core: RenameReasonAttr: Do not append new reason if it is already there
Fixes possible "reason: invalid class name and invalid class name" comments after class refresh.
2020-01-03 06:09:23 +03:00
S-trace 610f531653 core: EnumVisitor: Do not remove ACC_ENUM access flag
This flag is necessary for class refresh, and should be left there.
Fixes disappearing of enum fields after class refresh.
2020-01-03 06:09:22 +03:00
S-trace 1e9b28b369 core: AType: Add FIELD_INIT and SOURCE_FILE to SKIP_ON_UNLOAD set
Fixes disappearing litheral values for replaced constants in switches and source file names..
2020-01-03 06:09:21 +03:00
S-trace 6d4caca6cc core: ClassModifier: Don't skip methods with SKIP_FIRST_ARG attr
Skipping those methods on class refresh leads to "M.this = r1;" like
assigments appears in the inner class constructors.

Unsure is this saint or not.
2020-01-03 06:09:20 +03:00
S-trace 15953f832f core: Do not call addConstField() on class refresh - fix constants replacing
There is a duplicate control in the ConstStorage.ValueStorage.add() method,
so each constant should be added only once, and not be added on class refresh.

Fixes "Replace constants" failure after renaming any node.
2020-01-03 06:09:19 +03:00
S-trace d346ed0570 core: MethodNode: Fix possible decompilation failure on refresh inner class
checkInstructions() may fail with NPE:
ERROR - NullPointerException in pass: BlockSplitter in method: com.google.common.primitives.Ints.IntArrayAsList.<init>(int[], int, int):void, dex: out.dex
java.lang.NullPointerException: null
        at jadx.core.dex.nodes.MethodNode.checkInstructions(MethodNode.java:159)
        at jadx.core.dex.visitors.blocksmaker.BlockSplitter.visit(BlockSplitter.java:49)
        at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:31)
        at jadx.core.dex.visitors.DepthTraversal.lambda$visit$1(DepthTraversal.java:16)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:16)
        at jadx.core.dex.visitors.DepthTraversal.lambda$visit$0(DepthTraversal.java:15)
        at java.util.ArrayList.forEach(ArrayList.java:1257)
        at jadx.core.dex.visitors.DepthTraversal.visit(DepthTraversal.java:15)
        at jadx.core.ProcessClass.process(ProcessClass.java:41)
        at jadx.core.ProcessClass.generateCode(ProcessClass.java:58)
        at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:292)
        at jadx.core.dex.nodes.ClassNode.decompile(ClassNode.java:271)
        at jadx.core.dex.nodes.ClassNode.refresh(ClassNode.java:303)
        at jadx.api.JavaClass.refresh(JavaClass.java:61)
        at jadx.gui.treemodel.JClass.refresh(JClass.java:63)
...

This happens because MethodNode.unloadInsnArr() call from BlockSplitter.visit() - after it instructions[] become null.
So, try to reload method before processing its instructions array.
2020-01-03 06:09:17 +03:00
S-trace df520a1134 core: ClassNode: Check is field really static or not in loadStaticValues()
Fixes appearing of the 0/null/false initializers for instance final fields.
2020-01-03 06:09:16 +03:00
S-trace f90fc1d5ec core: ClassNode: Load recursively missing information on refresh()
Fixes loss of static identifiers, comments, annotations and source file name after rename.
2020-01-03 06:09:14 +03:00
S-trace 797904afb5 gui: Perform refresh of non-displayed classes in background thread
After renaming some classes needs to be redecompiled to reflect new state.
Move recompilation of non-displayed classes to background thread.
This should improve performance on weak machines.
2020-01-03 06:09:13 +03:00
S-trace 489fbb5e42 gui: Improve performance of renaming
Fixes multiple decompilation of classes - now each class decompiled just once.
2020-01-03 06:09:12 +03:00
S-trace 9dd5a9ef89 gui: More advanced implementation of renaming
This implementation does not reload file after renaming, and so works faster.
2020-01-03 06:09:08 +03:00
Skylot 02213802c5 fix: make correct replacement for synthetic constructor (#808) 2019-12-28 08:42:39 +00:00
Skylot 8365855475 fix(gui): search only in short names of methods and fields (#818) 2019-12-27 18:55:11 +00:00
Skylot 55eb86d2d5 fix(gui): search class with --select-class also by not deobfuscated names 2019-12-27 18:52:28 +00:00
Skylot 0a9b944431 refactor(gui): add on finish runnable to open action 2019-12-27 18:42:07 +00:00
Skylot f1e229193c fix: resolve exception on assign inline 2019-12-27 21:20:14 +03:00
Skylot 04e309aeff fix: additional checks for 'if' blocks inside loops (#809) 2019-12-27 21:20:14 +03:00
Skylot 99eb31b312 fix(gui): add dots for progress titles 2019-12-27 21:19:37 +03:00
Soul Trace 287275d886 fix(gui): resolve --select-class option regression (PR #816) 2019-12-26 20:29:47 +03:00
Skylot af6f8b5391 fix(gui): resolve exceptions during index (#812) 2019-12-23 22:39:06 +03:00
Hen Ry 3b9b103c3f fix(gui): update Deutsch translation (PR #811) 2019-12-23 20:48:17 +03:00
Skylot 0c55ab9001 fix: resolve class cast exception introduced in CodeWriter refactoring (#810) 2019-12-22 16:19:47 +00:00
Skylot 9c88f70740 fix(gui): load file in background thread and show progress indicator 2019-12-22 15:56:50 +00:00
Skylot 9ab003df4c feat(gui): map back and forward mouse keys for navigation (#807) 2019-12-21 16:15:05 +00:00
Skylot 7f8d03d192 style: fix some sonar and compiler warnings 2019-12-21 15:37:25 +03:00
Skylot c64ffde11f refactor: use ICodeInfo interface instead CodeWriter 2019-12-21 12:36:54 +00:00
Hen Ry 1568008c67 fix(gui): improve Deutsch translation (PR #806) 2019-12-20 21:34:32 +03:00
Skylot 84211576e4 fix(gui): add Deutsch to locales list (#804) 2019-12-19 17:20:50 +00:00
Hen Ry 553f5b063f feat(gui): add Messages_de_DE.properties (PR #804) 2019-12-19 20:14:46 +03:00
Skylot f5d1f288d0 fix: don't inline constants in synchronized statement (#799) 2019-12-15 12:04:24 +00:00
Skylot a2df92dd68 fix(gui): correct app close on menu exit action 2019-12-14 15:14:20 +00:00
Skylot 1c6e51f8b2 fix: allow to regenerate class code (#791) 2019-12-13 18:37:10 +00:00
Soul Trace ef5da49bc0 fix(xml): reset nsMap in parse method (PR #798 #796)
Fixes injection of xmlns: attributes from other files (#796)
2019-12-13 21:16:08 +03:00
Skylot 7545625af4 test: add NYI test for empty finally block (#789) 2019-12-10 22:10:27 +03:00
Soul Trace e3055b95f6 feat(gui): support for renaming methods, classes and fields (PR #794 #791)
* Add getRealFullName() to ClassNode and JavaClass and searchJavaClassByRealName() to JadxWrapper

Those methods is like getFullName() and searchJavaClassByClassName(), but for class names without aliases.
It is necessary for renaming classes/methods/fields.

* core: Make getFieldNode(), getMethodNode() and getRoot() public

This is necessary for renaming functionality

* jadx-gui: Add Rename popup menu entry (renames classes, methods and fields)

It allows user to rename classes, methods and fields.
It updates deobfuscation map and reload file.
This may be suboptimal, and maybe some RenameVisitor should be added.
Deobfuscation should be enabled in order to allow this.
2019-12-10 22:08:27 +03:00
Soul Trace 78eed8629c feat(gui): reopened tabs on file reload (PR #793 #792)
* Add getRealFullName() to ClassNode and JavaClass and searchJavaClassByRealName() to JadxWrapper

Those methods is like getFullName() and searchJavaClassByClassName(), but for class names without aliases.
It is necessary for renaming classes/methods/fields.

* MainWindow: Try to restore open tabs on deobfuscation toggle

Restore open tabs if possible when user toggles deobfuscation mode.
Try to scroll to the position before toggling deobfuscation mode (may be not exact cause of the comments).
2019-12-10 21:41:57 +03:00
Skylot cc29da8e81 build: fix release build 2019-12-07 15:31:24 +00:00
Skylot d1a6841c20 fix: inline assign in complex conditions (#699) 2019-11-30 16:32:29 +00:00
Skylot 600842a1a6 fix: resolve error if input file don't has extension 2019-11-30 16:22:09 +00:00
Skylot 8ba3e935a5 build: update dependencies and gradle 2019-11-24 20:34:36 +00:00
Skylot 87504dd2cc refactor: additional checks for ssa vars and registers 2019-11-24 20:33:19 +00:00
Skylot e4e6f37949 fix: sort inner classes and methods by source lines 2019-11-19 20:05:21 +00:00
Skylot 4b314e9d99 fix: don't eliminate StringBuilder if no String arg present 2019-11-19 18:26:12 +00:00
Skylot a48ce296b8 fix: resolve code generation error for interface methods (#775) 2019-11-05 09:31:12 +00:00
Jan S cf3e17c4b8 feat(gui): support APK signature v3 (PR #773) 2019-11-01 19:31:24 +03:00
Skylot bae36f9720 fix: merge const block before return (#699) 2019-10-31 15:47:29 +00:00
Skylot 11db454b84 fix: duplicate result arg on instruction copy 2019-10-30 20:59:14 +00:00
Skylot 1b60c1d1a8 test: print smali code for debug purpose 2019-10-30 13:42:58 +00:00
Skylot 8321d5e380 fix: preserve arg type on PHI insn inline (#718) 2019-10-28 17:19:52 +00:00
Skylot 64c9ce2ab0 build: update sonarqube 2019-10-27 19:35:43 +00:00
Skylot 08f9a90c95 fix: force cast for null args in method invoke (temp fix for #724) 2019-10-27 16:53:25 +00:00
Skylot 9f06d6744e fix: increase region iterative traversal limit (#767) 2019-10-27 16:19:58 +00:00
Skylot f228a72118 fix(gui): fix search if class contains not generated inner class (#755) 2019-10-21 18:46:55 +01:00
Jan S 3249a5e0bc fix: workaround for IntelliJ bug on import line in build.gradle (PR #766) 2019-10-17 20:23:44 +03:00
Skylot d1ac43de33 fix(gui): add default contructor for classes serialized with GSON (#752) 2019-10-17 17:35:01 +03:00
Skylot 00f5e83506 fix: handle incorrect args count in signature (#763) 2019-10-17 16:51:06 +03:00
Skylot d3ecc1f640 fix: add dummy class if class loading exception occur (#763) 2019-10-17 16:51:03 +03:00
Jan S 902247fcdb fix: don't stop loading classes in case of an error (PR #764)
* fix: don't stop loading classes in case of an error
* style: reformat code
2019-10-15 20:25:18 +03:00
Skylot bd9e1096cc fix: handle methods with all NOPs (#744) 2019-08-30 15:37:38 +01:00
Skylot db892adf34 fix: don't run class process from visitors to avoid deadlock (#743) 2019-08-27 17:24:18 +01:00
Skylot 1cbaad3ec9 fix: make correct class members loading in jadx api (#742) 2019-08-25 19:53:12 +01:00
Skylot 401d08ea49 refactor: move all smali libs usage to one utility class 2019-08-21 14:45:32 +01:00
Skylot ba17f7bc00 refactor: move type with outer generic to different class 2019-08-15 21:43:57 +01:00
Skylot db2b537380 fix: try to resolve generic type variables (#662) 2019-08-15 21:39:43 +01:00
Skylot 06f26ef8f5 refactor: use enum for wildcard bounds instead of int 2019-08-15 14:31:30 +01:00
Skylot a71bb7a532 fix(gui): yet another fix for broken find usage action 2019-08-12 10:32:38 +01:00
Skylot 99934b5100 chore: update dependencies 2019-08-12 10:05:24 +01:00
Skylot ff5f6fca3c fix(gui): fix "Go to declaration" and "Find usage" menu actions 2019-08-11 22:03:47 +03:00
Skylot 3578f7d68f fix(gui): use editor font on tabs 2019-08-11 21:40:46 +03:00
Skylot 7bc01dcfa8 fix(gui): ignore mouse click on empty space in tree (#737) 2019-08-11 19:39:05 +03:00
Skylot bc7a748420 feat(cli): add options for change log level (#735) 2019-08-08 13:14:36 +03:00
Skylot c0194d025d refactor: fix misuse of immutable type flag 2019-08-03 17:31:13 +03:00
Skylot 19ca8a096b chore: resolve minor code issues in debug info parser 2019-08-03 14:19:54 +03:00
Skylot cf5bfc297b test: fix regression for code auto check 2019-08-02 21:05:03 +03:00
Skylot a17f9136dd refactor: enable class unloading after code generation 2019-08-01 23:29:30 +03:00
Skylot 7d07fb0b77 chore: fix issues reported by lgtm.com 2019-08-01 12:14:29 +03:00
Skylot 99935bada6 docs: update readme and contributing rules 2019-07-31 21:40:23 +03:00
Skylot be9dae57b9 fix: add explicit cast for byte literal in method invoke (#719) 2019-07-30 22:46:28 +03:00
Skylot 4629043721 fix: convert inner enums and fix inner classes reference (#719) 2019-07-30 20:49:31 +03:00
Skylot 068234f0ca fix: remove synchronization lock for code generation (#726) 2019-07-29 14:55:50 +03:00
Skylot ccb8ed1394 fix: add assign for inlined getter methods 2019-07-29 12:48:38 +03:00
Skylot 8d68d409eb test: another deboxing issue 2019-07-28 21:09:56 +03:00
Skylot e842e022ba fix: use nice name for 'package-private' in modifiers change message 2019-07-28 20:42:07 +03:00
Skylot 1e6b30343c fix: several improvements for multi-variable type search (#720) 2019-07-28 20:22:28 +03:00
Skylot ddedb8d8a0 fix: don't override type of method parameter in const deboxing (#723) 2019-07-26 16:14:27 +03:00
Skylot 472aa52706 fix: resolve some multi-thread issues 2019-07-25 21:53:37 +03:00
Skylot ab97084058 refactor: move passes list to root node 2019-07-25 17:54:04 +03:00
Skylot 0911b2dc2f test: NYI test for issue #722 2019-07-24 17:00:05 +03:00
Skylot fd7d08cb10 feat: initial deboxing implementation (#717) 2019-07-23 20:37:37 +03:00
Skylot 3ae8359408 fix: improve exception handler remove (#703) 2019-07-22 20:38:16 +03:00
Skylot 6b76a3c787 fix: protect method from second load 2019-07-22 18:43:02 +03:00
Skylot 9fbf9ef667 fix(gui): compare files extension in case insensitive way 2019-07-22 18:43:02 +03:00
Skylot c8de7b97dd fix: instead commenting move constructor call to the top (#704) 2019-07-21 19:45:22 +03:00
Skylot b32dc17dd7 fix: don't change AST before checks in ternary transform (#710) 2019-07-20 21:33:20 +03:00
Skylot 7c53b985cd refactor(gui): remove JCertificate node 2019-07-19 18:19:08 +03:00
Skylot c8df26f227 feat(gui): add class links for AndroidManifest.xml and other minor fixes 2019-07-19 18:03:40 +03:00
Skylot 3bc9671905 perf(gui): speed up line numbers rendering (#714) 2019-07-18 23:19:06 +03:00
Skylot 7fd959e6e3 refactor: improve variables handling in instruction wrapping 2019-07-17 22:53:00 +03:00
Skylot 24dc68652e fix: check that iteration variable in for-each loop not used outside (#708) 2019-07-17 22:42:33 +03:00
Skylot aad2d24c58 fix: unbind unused ssa variable after ternary conversion (#708) 2019-07-16 19:44:48 +03:00
Skylot 15d56abeb6 fix: read correct buffer size for string pool parsing (#712) 2019-07-15 21:19:58 +03:00
Skylot d89ec67888 style: resolve compiler warnings 2019-07-15 17:12:40 +03:00
Skylot f9f840fb9d refactor: remove redundant FieldArg and change arith one arg insn 2019-07-15 17:01:02 +03:00
Skylot 8e8a2faa10 fix(res): skip string if parsing failed (#712) 2019-07-14 17:06:19 +03:00
Skylot 0c2784bb42 refactor: inline fields in arithmetic operations 2019-07-14 15:09:01 +03:00
Skylot c555cd0825 fix: rename packages with reserved names (#711) 2019-07-14 13:13:00 +03:00
Skylot 92e28326a4 misc: don't add same edge insn several times 2019-07-13 13:24:52 +03:00
Skylot 2dbdd1f079 fix: support instructions removing in SimplifyVisitor 2019-07-13 13:19:58 +03:00
Skylot fc58022d56 misc: show shorter exception stacktrace in code 2019-07-13 13:17:22 +03:00
Skylot ed9fe8a573 fix: incorrect init values of inherited fields 2019-07-13 13:10:23 +03:00
Skylot 49e234d9f8 fix: improve finally extraction 2019-07-12 23:26:46 +03:00
Skylot a587ce88ea fix: ignore finally extraction with only one 'if' instruction (#709) 2019-07-12 21:21:14 +03:00
Skylot a530371b6f fix: improve StringBuilder elimination (#704) 2019-07-11 20:07:14 +03:00
Skylot 0c5a83c021 style: fix code style in test 2019-07-10 21:32:11 +03:00
Skylot 12bb632371 fix: always cast null objects in overloaded method (#707) 2019-07-10 21:11:02 +03:00
Skylot e4fc6774b1 fix: make correct hash calculation for GenericObject type (#705) 2019-07-10 16:58:52 +03:00
Skylot f57dfb3f2e test: check method override with generic arguments (#701) 2019-07-09 13:08:32 +03:00
Skylot c3f7a049d8 fix: ignore incorrect dex files in apk (#700) 2019-07-08 12:24:54 +03:00
Skylot 3eee83c2f2 fix: adjust insn reorder check in code shrink visitor (#695) 2019-07-07 14:18:21 +03:00
Skylot ed8c662631 fix: add generic types propagation (#695) 2019-07-06 19:12:31 +03:00
Skylot 850df18d7c refactor: update duplicate methods in InsnArg classes 2019-07-05 20:55:00 +03:00
Skylot 7f4da306c9 refactor: remove cloning library dependency 2019-07-05 20:45:28 +03:00
Skylot 424a8ffaf4 fix: inline constant strings (#685) 2019-07-05 19:10:57 +03:00
Skylot 8410e62531 fix: force one branch ternary in constructors (#685) 2019-07-05 17:14:46 +03:00
Skylot 533b686e0b fix: comment out instructions also before other constructor call (#685) 2019-07-05 17:05:38 +03:00
Skylot c6c54f90dc fix: comment out instructions before super call in constructor (#685) 2019-07-03 14:39:21 +03:00
Kend 0f5fd4e48a fix(gui): update Chinese translation (PR #697) 2019-06-27 12:39:48 +03:00
Skylot a7247e8a88 build: remove unused test-app submodule 2019-06-27 11:59:25 +03:00
Skylot c10a30346b style: reformat gradle files 2019-06-27 11:53:56 +03:00
Skylot 436e86fdf2 build: update gradle and dependencies 2019-06-27 11:16:44 +03:00
Jan S 29a137bde3 fix: jadx-gui.bat and jadx.bat do not work (#692) (PR #694) 2019-06-21 17:44:45 +03:00
2562 changed files with 198951 additions and 32173 deletions
-14
View File
@@ -1,14 +0,0 @@
coverage:
precision: 2
round: down
range: "50...100"
status:
project:
default: on
patch:
default: on
changes:
default: off
comment: false
+13 -1
View File
@@ -7,11 +7,23 @@ insert_final_newline = true
indent_style = tab
tab_width = 4
continuation_indent_size = 8 #IntelliJ Idea specific workaround
charset = utf-8
trim_trailing_whitespace = true
[*.java]
ij_java_continuation_indent_size = 8
ij_java_use_single_class_imports = true
ij_java_class_count_to_use_import_on_demand = 99
ij_java_names_count_to_use_import_on_demand = 99
ij_java_packages_to_use_import_on_demand = *
[*.kt]
ij_kotlin_continuation_indent_size = 8
ij_kotlin_name_count_to_use_star_import = 99
ij_kotlin_name_count_to_use_star_import_for_members = 99
ij_kotlin_packages_to_use_import_on_demand = *
[*.yml]
indent_style = space
indent_size = 2
+12
View File
@@ -0,0 +1,12 @@
* text=auto eol=lf
*.java text eol=lf diff=java
*.kt text eol=lf diff=kotlin
*.kts text eol=lf diff=kotlin
gradlew text eol=lf
*.bat text eol=crlf
*.png binary
*.jar binary
+1
View File
@@ -0,0 +1 @@
blank_issues_enabled: false
@@ -1,23 +0,0 @@
---
name: Decompilation error
about: Create a report to help us improve jadx decompiler
title: "[core]"
labels: Core, bug
assignees: ''
---
**Checks before report**
- [ ] check [latest unstable build](https://bintray.com/skylot/jadx/unstable/_latestVersion#files) (maybe issue already fixed)
- [ ] search existing issues by exception message
(for example `JadxRuntimeException: Can't find immediate dominator for block`)
- [ ] check [Troubleshooting Q&A](https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A) section on wiki
**Describe error**
- provide full name of method or class with error
- provide full java stacktrace
**Note**: no need to copy method fallback code (commented pseudocode)
- attach or provide link to apk file (double check apk version)
**Note**: GitHub don't allow attach files with `.apk` extension, but you can change extension by adding `.zip` at the end :)
@@ -0,0 +1,40 @@
name: Decompilation issue
description: Create a report to help us improve jadx decompiler
title: '[core] '
labels:
- Core
- bug
body:
- type: markdown
attributes:
value: |
**Checks before submit**
- check [Troubleshooting Q&A](https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A) section on wiki
- try [latest unstable build](https://nightly.link/skylot/jadx/workflows/build-artifacts/master), maybe issue already fixed
- search existing issues by exception message
- type: textarea
id: details
attributes:
label: Issue details
placeholder: >-
Describe issue
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output or stacktrace
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
render: java
- type: textarea
id: sample
attributes:
label: Provide sample and class/method full name
description: |
- sample: attach or provide a link
- full name of class or method with issue
- other details which may help to reproduce issue
- type: input
id: jadx-version
attributes:
label: Jadx version
@@ -0,0 +1,13 @@
name: Feature Request
description: Suggest an idea for jadx
title: '[feature] '
labels:
- 'new feature'
body:
- type: textarea
id: details
attributes:
label: Describe your idea
placeholder: Feature details
validations:
required: true
+43
View File
@@ -0,0 +1,43 @@
name: jadx-gui issue
description: Create a bug report about issue found in jadx-gui
title: '[gui] '
labels:
- GUI
- bug
body:
- type: markdown
attributes:
value: |
**Checks before submit**
- check [Troubleshooting Q&A](https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A) section on wiki
- try [latest unstable build](https://nightly.link/skylot/jadx/workflows/build-artifacts/master), maybe issue already fixed
- search existing issues by exception message
- type: textarea
id: details
attributes:
label: Issue details
placeholder: Describe issue and how to reproduce it
validations:
required: true
- type: input
id: jadx-version
attributes:
label: Jadx version
placeholder: check `Help->About`
validations:
required: true
- type: input
id: java-version
attributes:
label: Java version
placeholder: check `Help->About`
validations:
required: true
- type: checkboxes
id: os
attributes:
label: OS
options:
- label: Windows
- label: Linux
- label: macOS
+7
View File
@@ -0,0 +1,7 @@
version: 2
updates:
# Set update schedule for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
+5
View File
@@ -0,0 +1,5 @@
:exclamation: Please review the [guidelines for contributing](https://github.com/skylot/jadx/blob/master/CONTRIBUTING.md#Pull-Request-Process)
### Description
Please describe your pull request.
Reference issue it fixes.
+90
View File
@@ -0,0 +1,90 @@
name: Build Artifacts
on:
push:
branches: [ master, build-test ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
- name: Set jadx version
run: |
JADX_REV=$(git rev-list --count HEAD)
JADX_VERSION="r${JADX_REV}.${GITHUB_SHA:0:7}"
echo "JADX_VERSION=$JADX_VERSION" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build
run: ./gradlew dist distWin
env:
JADX_BUILD_JAVA_VERSION: 11
- name: Save bundle artifact
uses: actions/upload-artifact@v7
with:
name: ${{ format('jadx-{0}', env.JADX_VERSION) }}
# Waiting fix for https://github.com/actions/upload-artifact/issues/39 to upload zip file
# Upload unpacked files for now
path: build/jadx/**/*
if-no-files-found: error
retention-days: 14
- name: Save Windows bundle artifact
uses: actions/upload-artifact@v7
with:
name: ${{ format('jadx-gui-{0}-no-jre-win', env.JADX_VERSION) }}
# Upload unpacked files for now
path: jadx-gui/build/jadx-gui-win/*
if-no-files-found: error
retention-days: 14
build-win-bundle:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set up JDK
uses: oracle-actions/setup-java@v1
with:
release: 25
- name: Print Java version
shell: bash
run: java -version
- name: Set jadx version
shell: bash
run: |
JADX_REV=$(git rev-list --count HEAD)
JADX_VERSION="r${JADX_REV}.${GITHUB_SHA:0:7}"
echo "JADX_VERSION=$JADX_VERSION" >> $GITHUB_ENV
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build
run: ./gradlew dist -PbundleJRE=true
- name: Save Windows with JRE bundle artifact
uses: actions/upload-artifact@v7
with:
name: ${{ format('jadx-gui-{0}-with-jre-win', env.JADX_VERSION) }}
# Upload unpacked files for now
path: jadx-gui/build/jadx-gui-with-jre-win/*
if-no-files-found: error
retention-days: 14
+31
View File
@@ -0,0 +1,31 @@
name: Build Test
on:
push:
branches: [ master, build-test ]
pull_request:
branches: [ master ]
jobs:
tests:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build
run: ./gradlew build dist distWin
env:
JADX_BUILD_JAVA_VERSION: 11
+92
View File
@@ -0,0 +1,92 @@
name: Release
on:
push:
tags:
- "v*.*.*"
# additional permissions for provided GitHub token to create new release
permissions:
contents: write
jobs:
build-release-win-bundle:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: oracle-actions/setup-java@v1
with:
release: 25
- name: Set jadx version
uses: actions/github-script@v9
with:
script: |
const jadxVersion = context.ref.split('/').pop().substring(1)
core.exportVariable('JADX_VERSION', jadxVersion);
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build
run: ./gradlew dist -PbundleJRE=true
- name: Save JRE bundle artifact
uses: actions/upload-artifact@v7
with:
name: ${{ format('jadx-gui-{0}-with-jre-win', env.JADX_VERSION) }}
path: ${{ format('build/distWinWithJre/jadx-gui-{0}-with-jre-win.zip', env.JADX_VERSION) }}
if-no-files-found: error
retention-days: 1
release:
needs: build-release-win-bundle
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: 25
- name: Set jadx version and release name
uses: actions/github-script@v9
with:
script: |
const jadxVersion = context.ref.split('/').pop().substring(1)
core.exportVariable('JADX_VERSION', jadxVersion);
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v6
- name: Build
run: ./gradlew dist distWin
env:
JADX_BUILD_JAVA_VERSION: 11
- name: Download Windows JRE bundle
uses: actions/download-artifact@v8
with:
name: ${{ format('jadx-gui-{0}-with-jre-win', env.JADX_VERSION) }}
path: ${{ format('build/jadx-gui-{0}-with-jre-win', env.JADX_VERSION) }}
- run: |
cd build
pwd
ls -l
ls jadx-gui-*-with-jre-win
mv jadx-gui-*-with-jre-win/jadx-gui-*-with-jre-win.zip .
mv distWin/jadx-gui-*-win.zip .
ls -l *.zip
- name: Release
uses: softprops/action-gh-release@v3
with:
name: ${{ env.JADX_VERSION }}
draft: true
fail_on_unmatched_files: true
files: build/jadx-*.zip
+14 -1
View File
@@ -5,6 +5,7 @@
# IntelliJ Idea files
.idea/
.run/
out/
*.iml
*.ipr
@@ -20,14 +21,26 @@ build/
classes/
idea/
.gradle/
.kotlin/
node_modules/
.vscode/
jadx-output/
*-tmp/
**/tmp/
*.jobf
*.jadx
*.dex
*.class
*.jar
*.dump
*.log
*.cfg
*.orig
*.json
*.dot
.env
cliff.toml
jadx-gui/src/main/resources/logback.xml
+3 -21
View File
@@ -7,26 +7,8 @@ before_script:
stages:
- test
- check
java-8:
build-test:
stage: test
image: openjdk:8
script: ./gradlew clean build
java-11:
stage: test
image: openjdk:11
script: ./gradlew clean build
check:
stage: check
image: openjdk:8
script:
- export JADX_LAST_TAG="$(git describe --abbrev=0 --tags)"
- export JADX_VERSION="${JADX_LAST_TAG:1}-dev-$(git rev-parse --short HEAD)"
- ./gradlew clean sonarqube -Dsonar.host.url=$SONAR_HOST -Dsonar.organization=$SONAR_ORG -Dsonar.login=$SONAR_TOKEN -Dsonar.branch.name=dev
- ./gradlew clean dist
artifacts:
paths:
- build/jadx*.zip
image: eclipse-temurin:21
script: JADX_BUILD_JAVA_VERSION=11 JADX_TEST_JAVA_VERSION=11 ./gradlew clean build dist distWin
-3
View File
@@ -1,3 +0,0 @@
[submodule "jadx-test-app/test-app"]
path = jadx-test-app/test-app
url = git://github.com/skylot/jadx-test-app.git
+5
View File
@@ -0,0 +1,5 @@
jdk:
- openjdk11
install:
- echo "Jitpack is not supported. Use artifacts from Maven Central (https://search.maven.org/search?q=jadx), check usage help at https://github.com/skylot/jadx/wiki/Use-jadx-as-a-library"
- ./gradlew intentional-fail
-35
View File
@@ -1,35 +0,0 @@
branch: release
verifyConditions:
- '@semantic-release/github'
prepare:
- path: '@semantic-release/exec'
cmd: "JADX_VERSION=${nextRelease.version} ./gradlew clean dist"
preset: "angular"
generateNotes:
- path: '@semantic-release/release-notes-generator'
writerOpts:
groupBy: "type"
commitGroupsSort:
- "feat"
- "perf"
- "fix"
commitsSort: "header"
publish:
- path: '@semantic-release/exec'
cmd: "JADX_VERSION=${nextRelease.version} BINTRAY_PACKAGE=releases bash scripts/bintray-upload.sh"
- path: '@semantic-release/github'
assets:
- path: 'build/*.zip'
- path: 'build/*.exe'
success:
- path: '@semantic-release/github'
successComment: false
fail:
- path: '@semantic-release/github'
failComment: false
+12
View File
@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="jadx-gui" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="jadx.gui.JadxGUI"/>
<module name="jadx.jadx-gui.main"/>
<option name="PROGRAM_PARAMETERS" value="-v"/>
<option name="VM_PARAMETERS"
value="-Xms128M -XX:MaxRAMPercentage=70.0 -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Djava.util.Arrays.useLegacyMergeSort=true -Djdk.util.zip.disableZip64ExtraFieldValidation=true -XX:+IgnoreUnrecognizedVMOptions --add-opens=java.base/java.lang=ALL-UNNAMED --enable-native-access=ALL-UNNAMED -Dsun.java2d.noddraw=true -Dsun.java2d.d3d=false -Dsun.java2d.ddforcevram=true -Dsun.java2d.ddblit=false -Dswing.useflipBufferStrategy=true"/>
<method v="2">
<option name="Make" enabled="true"/>
</method>
</configuration>
</component>
-40
View File
@@ -1,40 +0,0 @@
language: java
sudo: false
dist: trusty
# don't build on tag push
if: tag IS blank
git:
depth: false
before_install:
- chmod +x gradlew
# override install to skip 'gradle assemble'
install: true
env:
global:
- TERM=dumb
- JADX_LAST_TAG=$(git describe --abbrev=0 --tags)
- JADX_VERSION="${JADX_LAST_TAG:1}-b$TRAVIS_BUILD_NUMBER-$(git rev-parse --short HEAD)"
jdk:
- openjdk8
- oraclejdk8
- openjdk11
script: ./gradlew clean build
jobs:
include:
- stage: deploy-unstable
jdk: openjdk8
if: branch = master AND repo = env(MAIN_REPO) AND type = push
script: bash scripts/travis-master.sh
- stage: deploy-release
jdk: openjdk8
if: branch = release AND repo = env(MAIN_REPO) AND type = push
script: bash scripts/travis-release.sh
+20
View File
@@ -0,0 +1,20 @@
# Config for 'typos' spellchecker (https://github.com/crate-ci/typos)
[default.extend-words]
IPUT = "IPUT"
Laf = "Laf"
Darcula="Darcula"
[default]
extend-ignore-identifiers-re = [
"finaly", # intentional package name
]
[files]
extend-exclude = [
"config/",
"jadx-core/src/main/resources/",
"jadx-core/src/test/",
"jadx-gui/src/main/resources/i18n/",
"!jadx-gui/src/main/resources/i18n/Messages_en_US.properties",
]
+63
View File
@@ -0,0 +1,63 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
+26 -6
View File
@@ -1,7 +1,27 @@
# Contribution
# Contributing
To support this project you can:
- Post thoughts about new features/optimizations that important to you
- Submit bug using one of following patterns:
* Java code examples which decompiles incorrectly
* Error log and link to _public available_ apk file or app page on Google play
Please note, we have [code of conduct](CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
## Open Issue
1. Before proceed, please do:
- check [Troubleshooting Q&A](https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A) section on wiki
- search existing issues by exception message
2. Describe error:
- full name of method or class with error
- full java stacktrace (no need to copy method fallback code (commented pseudocode))
- **IMPORTANT!:** attach or provide link to apk file (double check apk version)
**Note**: GitHub don't allow attaching files with `.apk` extension, but you can change extension by adding `.zip` at the end :)
## Pull Request Process
1. Please don't submit any code style fixes or dependencies updates changes.
1. Use only features and API from Java 11 or below.
1. Make sure your code is correctly formatted, see description here: [Code Formatting](https://github.com/skylot/jadx/wiki/Code-Formatting).
1. Make sure your changes are passing build: `./gradlew clean build dist`
+224 -79
View File
@@ -1,111 +1,256 @@
<img src="https://raw.githubusercontent.com/skylot/jadx/master/jadx-gui/src/main/resources/logos/jadx-logo.png" width="64" align="left" />
## JADX
[![Build Status](https://travis-ci.org/skylot/jadx.png?branch=master)](https://travis-ci.org/skylot/jadx)
[![Code Coverage](https://codecov.io/gh/skylot/jadx/branch/master/graph/badge.svg)](https://codecov.io/gh/skylot/jadx)
[![SonarQube Bugs](https://sonarcloud.io/api/project_badges/measure?project=jadx&metric=bugs)](https://sonarcloud.io/dashboard?id=jadx)
![Build status](https://img.shields.io/github/actions/workflow/status/skylot/jadx/build-artifacts.yml)
![GitHub contributors](https://img.shields.io/github/contributors/skylot/jadx)
![GitHub all releases](https://img.shields.io/github/downloads/skylot/jadx/total)
![GitHub release (latest by SemVer)](https://img.shields.io/github/downloads/skylot/jadx/latest/total)
![Latest release](https://img.shields.io/github/release/skylot/jadx.svg)
[![Maven Central](https://img.shields.io/maven-central/v/io.github.skylot/jadx-core)](https://search.maven.org/search?q=g:io.github.skylot%20AND%20jadx)
![Java 11+](https://img.shields.io/badge/Java-11%2B-blue)
[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
**jadx** - Dex to Java decompiler
Command line and GUI tools for produce Java source code from Android Dex and Apk files
Command line and GUI tools for producing Java source code from Android Dex and Apk files
![jadx-gui screenshot](https://i.imgur.com/h917IBZ.png)
> [!WARNING]
> Please note that in most cases **jadx** can't decompile all 100% of the code, so errors will occur.<br />
> Check [Troubleshooting guide](https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A#decompilation-issues) for workarounds.
**Main features:**
- decompile Dalvik bytecode to Java code from APK, dex, aar, aab and zip files
- decode `AndroidManifest.xml` and other resources from `resources.arsc`
- deobfuscator included
### Downloads
- latest [unstable build: ![Download](https://api.bintray.com/packages/skylot/jadx/unstable/images/download.svg) ](https://bintray.com/skylot/jadx/unstable/_latestVersion#files)
- release from [github: ![Latest release](https://img.shields.io/github/release/skylot/jadx.svg)](https://github.com/skylot/jadx/releases/latest)
- release from [bintray: ![Download](https://api.bintray.com/packages/skylot/jadx/releases/images/download.svg) ](https://bintray.com/skylot/jadx/releases/_latestVersion#files)
**jadx-gui features:**
- view decompiled code with highlighted syntax
- jump to declaration
- find usage
- full text search
- smali debugger, check [wiki page](https://github.com/skylot/jadx/wiki/Smali-debugger) for setup and usage
Jadx-gui key bindings can be found [here](https://github.com/skylot/jadx/wiki/JADX-GUI-Key-bindings)
See these features in action here: [jadx-gui features overview](https://github.com/skylot/jadx/wiki/jadx-gui-features-overview)
<img src="https://user-images.githubusercontent.com/118523/142730720-839f017e-38db-423e-b53f-39f5f0a0316f.png" width="700"/>
### Download
- release
from [github: ![Latest release](https://img.shields.io/github/release/skylot/jadx.svg)](https://github.com/skylot/jadx/releases/latest)
- latest [unstable build ![GitHub commits since tagged version (branch)](https://img.shields.io/github/commits-since/skylot/jadx/latest/master)](https://nightly.link/skylot/jadx/workflows/build-artifacts/master)
After download unpack zip file go to `bin` directory and run:
- `jadx` - command line version
- `jadx-gui` - graphical version
- `jadx-gui` - UI version
On Windows run `.bat` files with double-click\
**Note:** ensure you have installed Java 8 64-bit version
**Note:** ensure you have installed Java 11 or later 64-bit version.
For Windows, you can download it from [oracle.com](https://www.oracle.com/java/technologies/downloads/#jdk17-windows) (select x64 Installer).
### Install
- Arch Linux
[![Arch Linux package](https://img.shields.io/archlinux/v/extra/any/jadx)](https://archlinux.org/packages/extra/any/jadx/)
[![AUR Version](https://img.shields.io/aur/version/jadx-git)](https://aur.archlinux.org/packages/jadx-git)
```bash
sudo pacman -S jadx
```
- macOS
[![homebrew version](https://img.shields.io/homebrew/v/jadx)](https://formulae.brew.sh/formula/jadx)
```bash
brew install jadx
```
- Flathub
[![Flathub Version](https://img.shields.io/flathub/v/com.github.skylot.jadx)](https://flathub.org/apps/com.github.skylot.jadx)
```bash
flatpak install flathub com.github.skylot.jadx
```
### Related projects:
- [PyJadx](https://github.com/romainthomas/pyjadx) - python binding for jadx by [@romainthomas](https://github.com/romainthomas)
### Use jadx as a library
You can use jadx in your java projects, check details on [wiki page](https://github.com/skylot/jadx/wiki/Use-jadx-as-a-library)
### Building jadx from source
JDK 8 or higher must be installed:
git clone https://github.com/skylot/jadx.git
cd jadx
./gradlew dist
### Build from source
JDK 17 or higher must be installed:
```
git clone https://github.com/skylot/jadx.git
cd jadx
./gradlew dist
```
(on Windows, use `gradlew.bat` instead of `./gradlew`)
Scripts for run jadx will be placed in `build/jadx/bin`
and also packed to `build/jadx-<version>.zip`
### macOS
You can install using brew:
brew install jadx
### Run
Run **jadx** on itself:
cd build/jadx/
bin/jadx -d out lib/jadx-core-*.jar
# or
bin/jadx-gui lib/jadx-core-*.jar
### Usage
```
jadx[-gui] [options] <input file> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc)
jadx[-gui] [command] [options] <input files> (.apk, .dex, .jar, .class, .smali, .zip, .aar, .arsc, .aab, .xapk, .apkm, .jadx.kts)
commands (use '<command> --help' for command options):
plugins - manage jadx plugins
options:
-d, --output-dir - output directory
-ds, --output-dir-src - output directory for sources
-dr, --output-dir-res - output directory for resources
-j, --threads-count - processing threads count
-r, --no-res - do not decode resources
-s, --no-src - do not decompile source code
--single-class - decompile a single class
--output-format - can be 'java' or 'json' (default: java)
-e, --export-gradle - save as android gradle project
--show-bad-code - show inconsistent code (incorrectly decompiled)
--no-imports - disable use of imports, always write entire package name
--no-debug-info - disable debug info
--no-inline-anonymous - disable anonymous classes inline
--no-replace-consts - don't replace constant value with matching constant field
--escape-unicode - escape non latin characters in strings (with \u)
--respect-bytecode-access-modifiers - don't change original access modifiers
--deobf - activate deobfuscation
--deobf-min - min length of name, renamed if shorter (default: 3)
--deobf-max - max length of name, renamed if longer (default: 64)
--deobf-rewrite-cfg - force to save deobfuscation map
--deobf-use-sourcename - use source file name as class name alias
--rename-flags - what to rename, comma-separated, 'case' for system case sensitivity, 'valid' for java identifiers, 'printable' characters, 'none' or 'all'
--fs-case-sensitive - treat filesystem as case sensitive, false by default
--cfg - save methods control flow graph to dot file
--raw-cfg - save methods control flow graph (use raw instructions)
-f, --fallback - make simple dump (using goto instead of 'if', 'for', etc)
-v, --verbose - verbose output
--version - print jadx version
-h, --help - print this help
Example:
jadx -d out classes.dex
jadx --rename-flags "none" classes.dex
jadx --rename-flags "valid,printable" classes.dex
-d, --output-dir - output directory
-ds, --output-dir-src - output directory for sources
-dr, --output-dir-res - output directory for resources
-r, --no-res - do not decode resources
-s, --no-src - do not decompile source code
-j, --threads-count - processing threads count, default: 16
--single-class - decompile a single class, full name, raw or alias
--single-class-output - file or dir for write if decompile a single class
--output-format - can be 'java' or 'json', default: java
-e, --export-gradle - save as gradle project (set '--export-gradle-type' to 'auto')
--export-gradle-type - Gradle project template for export:
'auto' - detect automatically
'android-app' - Android Application (apk)
'android-library' - Android Library (aar)
'simple-java' - simple Java
-m, --decompilation-mode - code output mode:
'auto' - trying best options (default)
'restructure' - restore code structure (normal java code)
'simple' - simplified instructions (linear, with goto's)
'fallback' - raw instructions without modifications
--show-bad-code - show inconsistent code (incorrectly decompiled)
--no-xml-pretty-print - do not prettify XML
--no-imports - disable use of imports, always write entire package name
--no-debug-info - disable debug info parsing and processing
--add-debug-lines - add comments with debug line numbers if available
--no-inline-anonymous - disable anonymous classes inline
--no-inline-methods - disable methods inline
--no-move-inner-classes - disable move inner classes into parent
--no-inline-kotlin-lambda - disable inline for Kotlin lambdas
--no-finally - don't extract finally block
--no-restore-switch-over-string - don't restore switch over string
--no-replace-consts - don't replace constant value with matching constant field
--escape-unicode - escape non latin characters in strings (with \u)
--respect-bytecode-access-modifiers - don't change original access modifiers
--mappings-path - deobfuscation mappings file or directory. Allowed formats: Tiny and Tiny v2 (both '.tiny'), Enigma (.mapping) or Enigma directory
--mappings-mode - set mode for handling the deobfuscation mapping file:
'read' - just read, user can always save manually (default)
'read-and-autosave-every-change' - read and autosave after every change
'read-and-autosave-before-closing' - read and autosave before exiting the app or closing the project
'ignore' - don't read or save (can be used to skip loading mapping files referenced in the project file)
--deobf - activate deobfuscation
--deobf-min - min length of name, renamed if shorter, default: 3
--deobf-max - max length of name, renamed if longer, default: 64
--deobf-whitelist - space separated list of classes (full name) and packages (ends with '.*') to exclude from deobfuscation, default: android.support.v4.* android.support.v7.* android.support.v4.os.* android.support.annotation.Px androidx.core.os.* androidx.annotation.Px
--deobf-cfg-file - deobfuscation mappings file used for JADX auto-generated names (in the JOBF file format), default: same dir and name as input file with '.jobf' extension
--deobf-cfg-file-mode - set mode for handling the JADX auto-generated names' deobfuscation map file:
'read' - read if found, don't save (default)
'read-or-save' - read if found, save otherwise (don't overwrite)
'overwrite' - don't read, always save
'ignore' - don't read and don't save
--deobf-res-name-source - better name source for resources:
'auto' - automatically select best name (default)
'resources' - use resources names
'code' - use R class fields names
--use-source-name-as-class-name-alias - use source name as class name alias:
'always' - always use source name if it's available
'if-better' - use source name if it seems better than the current one
'never' - never use source name, even if it's available
--source-name-repeat-limit - allow using source name if it appears less than a limit number, default: 10
--use-kotlin-methods-for-var-names - use kotlin intrinsic methods to rename variables, values: disable, apply, apply-and-hide, default: apply
--use-headers-for-detect-resource-extensions - Use headers for detect resource extensions if resource obfuscated
--rename-flags - fix options (comma-separated list of):
'case' - fix case sensitivity issues (according to --fs-case-sensitive option),
'valid' - rename java identifiers to make them valid,
'printable' - remove non-printable chars from identifiers,
or single 'none' - to disable all renames
or single 'all' - to enable all (default)
--integer-format - how integers are displayed:
'auto' - automatically select (default)
'decimal' - use decimal
'hexadecimal' - use hexadecimal
--type-update-limit - type update limit count (per one instruction), default: 10
--fs-case-sensitive - treat filesystem as case sensitive, false by default
--cfg - save methods control flow graph to dot file
--raw-cfg - save methods control flow graph (use raw instructions)
--call-graph - save app call graph in format: 'dot' or 'json', default: none
-f, --fallback - set '--decompilation-mode' to 'fallback' (deprecated)
--use-dx - use dx/d8 to convert java bytecode
--comments-level - set code comments level, values: error, warn, info, debug, user-only, none, default: info
--log-level - set log level, values: quiet, progress, error, warn, info, debug, default: progress
-v, --verbose - verbose output (set --log-level to DEBUG)
-q, --quiet - turn off output (set --log-level to QUIET)
--disable-plugins - comma separated list of plugin ids to disable
--config <config-ref> - load configuration from file, <config-ref> can be:
path to '.json' file
short name - uses file with this name from config directory
'none' - to disable config loading
--save-config <config-ref> - save current options into configuration file and exit, <config-ref> can be:
empty - for default config
path to '.json' file
short name - file will be saved in config directory
--print-files - print files and directories used by jadx (config, cache, temp)
--version - print jadx version
-h, --help - print this help
Plugin options (-P<name>=<value>):
dex-input: Load .dex and .apk files
- dex-input.verify-checksum - verify dex file checksum before load, values: [yes, no], default: yes
java-convert: Convert .class, .jar and .aar files to dex
- java-convert.mode - convert mode, values: [dx, d8, both], default: both
- java-convert.d8-desugar - use desugar in d8, values: [yes, no], default: no
kotlin-metadata: Use kotlin.Metadata annotation for code generation
- kotlin-metadata.class-alias - rename class alias, values: [yes, no], default: yes
- kotlin-metadata.method-args - rename function arguments, values: [yes, no], default: yes
- kotlin-metadata.fields - rename fields, values: [yes, no], default: yes
- kotlin-metadata.companion - rename companion object, values: [yes, no], default: yes
- kotlin-metadata.data-class - add data class modifier, values: [yes, no], default: yes
- kotlin-metadata.to-string - rename fields using toString, values: [yes, no], default: yes
- kotlin-metadata.getters - rename simple getters to field names, values: [yes, no], default: yes
kotlin-smap: Use kotlin.SourceDebugExtension annotation for rename class alias
- kotlin-smap.class-alias-source-dbg - rename class alias from SourceDebugExtension, values: [yes, no], default: no
rename-mappings: various mappings support
- rename-mappings.format - mapping format, values: [AUTO, TINY_FILE, TINY_2_FILE, ENIGMA_FILE, ENIGMA_DIR, PROGUARD_FILE, SRG_FILE, XSRG_FILE, JAM_FILE, CSRG_FILE, TSRG_FILE, TSRG_2_FILE, INTELLIJ_MIGRATION_MAP_FILE, RECAF_SIMPLE_FILE, JOBF_FILE], default: AUTO
- rename-mappings.invert - invert mapping on load, values: [yes, no], default: no
smali-input: Load .smali files
- smali-input.api-level - Android API level, default: 27
Environment variables:
JADX_DISABLE_XML_SECURITY - set to 'true' to disable all security checks for XML files
JADX_DISABLE_ZIP_SECURITY - set to 'true' to disable all security checks for zip files
JADX_ZIP_MAX_ENTRIES_COUNT - maximum allowed number of entries in zip files (default: 100 000)
JADX_CONFIG_DIR - custom config directory, using system by default
JADX_CACHE_DIR - custom cache directory, using system by default
JADX_TMP_DIR - custom temp directory, using system by default
Examples:
jadx -d out classes.dex
jadx --rename-flags "none" classes.dex
jadx --rename-flags "valid, printable" classes.dex
jadx --log-level ERROR app.apk
jadx -Pdex-input.verify-checksum=no app.apk
```
These options also worked on jadx-gui running from command line and override options from preferences dialog
These options also work in jadx-gui running from command line and override options from preferences' dialog
Usage for `plugins` command
```
usage: plugins [options]
options:
-i, --install <locationId> - install plugin with locationId
-j, --install-jar <path-to.jar> - install plugin from jar file
-l, --list - list installed plugins
-a, --available - list available plugins from jadx-plugins-list (aka marketplace)
-u, --update - update installed plugins
--uninstall <pluginId> - uninstall plugin with pluginId
--disable <pluginId> - disable plugin with pluginId
--enable <pluginId> - enable plugin with pluginId
--list-all - list all plugins including bundled and dropins
--list-versions <locationId> - fetch latest versions of plugin from locationId (will download all artefacts, limited to 10)
-h, --help - print this help
```
### Troubleshooting
##### Out of memory error:
- Reduce processing threads count (`-j` option)
- Increase maximum java heap size:
* command line (example for linux):
`JAVA_OPTS="-Xmx4G" jadx -j 1 some.apk`
* edit 'jadx' script (jadx.bat on Windows) and setup bigger heap size:
`DEFAULT_JVM_OPTS="-Xmx2500M"`
Please check wiki page [Troubleshooting Q&A](https://github.com/skylot/jadx/wiki/Troubleshooting-Q&A)
### Contributing
To support this project you can:
- Post thoughts about new features/optimizations that important to you
- Submit decompilation issues, please read before proceed: [Open issue](CONTRIBUTING.md#Open-Issue)
- Open pull request, please follow these rules: [Pull Request Process](CONTRIBUTING.md#Pull-Request-Process)
---------------------------------------
*Licensed under the Apache 2.0 License*
*Copyright 2018 by Skylot*
+8
View File
@@ -0,0 +1,8 @@
# Security Policy
## Reporting a Vulnerability
To report a security issue, please open a [new security advisory](https://github.com/skylot/jadx/security/advisories/new).
Please fill the steps you took to create the issue, affected versions, and, if known, mitigations for the issue.
We will check and respond within 3 working days.
If the issue is confirmed as a vulnerability, we will apply required mitigations at the next release.
-169
View File
@@ -1,169 +0,0 @@
import com.diffplug.spotless.LineEnding
plugins {
id 'org.sonarqube' version '2.7'
id 'com.github.ben-manes.versions' version '0.21.0'
id "com.diffplug.gradle.spotless" version "3.21.1"
}
ext.jadxVersion = System.getenv('JADX_VERSION') ?: "dev"
version = jadxVersion
println("jadx version: ${jadxVersion}")
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'checkstyle'
version = jadxVersion
tasks.withType(JavaCompile) {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
if (!"$it".contains(':jadx-samples:')) {
options.compilerArgs << '-Xlint' << '-Xlint:unchecked' << '-Xlint:deprecation'
}
}
compileJava {
options.encoding = "UTF-8"
}
jar {
version = jadxVersion
manifest {
mainAttributes('jadx-version': jadxVersion)
}
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.26'
testCompile 'ch.qos.logback:logback-classic:1.2.3'
testCompile 'org.hamcrest:hamcrest-library:2.1'
testCompile 'org.mockito:mockito-core:2.25.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.1'
testCompile 'org.eclipse.jdt.core.compiler:ecj:4.6.1'
}
test {
useJUnitPlatform()
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
google()
}
jacoco {
toolVersion = "0.8.2"
}
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}
checkstyleMain {
// exclude all sources in samples module
exclude '**/samples/**'
}
}
sonarqube {
properties {
property 'sonar.exclusions', '**/jadx/samples/**/*,**/test-app/**/*'
property 'sonar.coverage.exclusions', '**/jadx/gui/**/*'
}
}
spotless {
java {
target fileTree(rootDir).matching {
include 'jadx-cli/src/**/java/**/*.java'
include 'jadx-core/src/**/java/**/*.java'
include 'jadx-gui/src/**/java/**/*.java'
}
importOrderFile 'config/code-formatter/eclipse.importorder'
eclipse().configFile 'config/code-formatter/eclipse.xml'
removeUnusedImports()
lineEndings(LineEnding.UNIX)
encoding("UTF-8")
trimTrailingWhitespace()
endWithNewline()
}
format 'misc', {
target '**/*.gradle', '**/*.md', '**/*.xml', '**/.gitignore', '**/.properties'
targetExclude "jadx-test-app/test-app/**", ".gradle/**", ".idea/**"
lineEndings(LineEnding.UNIX)
encoding("UTF-8")
trimTrailingWhitespace()
endWithNewline()
}
}
dependencyUpdates.resolutionStrategy = {
componentSelection { rules ->
rules.all { ComponentSelection selection ->
boolean rejected = ['alpha', 'beta', 'rc', 'cr', 'm', 'atlassian'].any { qualifier ->
selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
}
if (rejected) {
selection.reject('Release candidate')
}
}
}
}
task copyArtifacts(type: Sync, dependsOn: ['jadx-cli:installDist', 'jadx-gui:installDist']) {
destinationDir file("$buildDir/jadx")
['jadx-cli', 'jadx-gui'].each {
from tasks.getByPath(":${it}:installDist").destinationDir
}
}
task pack(type: Zip, dependsOn: copyArtifacts) {
destinationDir buildDir
archiveName "jadx-${jadxVersion}.zip"
from copyArtifacts.destinationDir
}
task copyExe(type: Copy, dependsOn: 'jadx-gui:createExe') {
group 'jadx'
description = 'Copy exe to build dir'
destinationDir buildDir
from tasks.getByPath('jadx-gui:createExe').outputs
include '*.exe'
}
task dist(dependsOn: [pack, copyExe]) {
group 'jadx'
description = 'Build jadx distribution zip'
}
task samples(dependsOn: 'jadx-samples:samples') {
group 'jadx'
}
task testAppCheck(dependsOn: 'jadx-test-app:testAppCheck') {
group 'jadx'
}
task cleanBuildDir(type: Delete) {
group 'jadx'
delete buildDir
}
test.dependsOn(samples)
clean.dependsOn(cleanBuildDir)
+223
View File
@@ -0,0 +1,223 @@
import com.diffplug.gradle.spotless.FormatExtension
import com.diffplug.gradle.spotless.SpotlessExtension
import com.diffplug.spotless.LineEnding
import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import java.util.Locale
plugins {
id("com.github.ben-manes.versions") version "0.54.0"
id("se.patrikerdes.use-latest-versions") version "0.2.19"
id("com.diffplug.spotless") version "8.7.0"
}
val jadxEnv = loadEnv(file("$rootDir/.env"))
val jadxVersion by extra { jadxEnv["JADX_VERSION"] ?: "dev" }
println("jadx version: $jadxVersion")
version = jadxVersion
val jadxBuildJavaVersion by extra { getBuildJavaVersion() }
fun getBuildJavaVersion(): Int? {
val envVarName = "JADX_BUILD_JAVA_VERSION"
val buildJavaVer = jadxEnv[envVarName]?.toInt() ?: return null
if (buildJavaVer < 11) {
throw GradleException("'$envVarName' can't be set to lower than 11")
}
println("Set Java toolchain for jadx build to version '$buildJavaVer'")
return buildJavaVer
}
// control ErrorProne checks level, can be: off, warn, error
val jadxBuildChecksMode: String by extra { getBuildChecksMode() }
fun getBuildChecksMode(): String {
val buildChecksMode = jadxEnv["JADX_BUILD_CHECKS_MODE"]?.lowercase() ?: "off"
val expectedValues = listOf("off", "warn", "error")
if (!expectedValues.contains(buildChecksMode)) {
throw GradleException("Unknown check mode: '$buildChecksMode', should be one of $expectedValues")
}
if (buildChecksMode != "off") {
val javaVersion = jadxBuildJavaVersion?.let { JavaVersion.toVersion(it) } ?: JavaVersion.current()
if (!javaVersion.isCompatibleWith(JavaVersion.VERSION_21)) {
throw GradleException("Error Prone requires Java 21")
}
}
return buildChecksMode
}
allprojects {
apply(plugin = "java")
apply(plugin = "checkstyle")
apply(plugin = "com.diffplug.spotless")
apply(plugin = "com.github.ben-manes.versions")
apply(plugin = "se.patrikerdes.use-latest-versions")
repositories {
mavenCentral()
}
configure<SpotlessExtension> {
java {
importOrderFile("$rootDir/config/code-formatter/eclipse.importorder")
eclipse().configFile("$rootDir/config/code-formatter/eclipse.xml")
removeUnusedImports()
commonFormatOptions()
}
kotlin {
ktlint().editorConfigOverride(mapOf("indent_style" to "tab"))
commonFormatOptions()
}
kotlinGradle {
ktlint()
commonFormatOptions()
}
format("misc") {
target("**/*.gradle", "**/*.xml", "**/.gitignore", "**/.properties")
targetExclude(".gradle/**", ".idea/**", "*/build/**")
commonFormatOptions()
}
}
tasks.named<DependencyUpdatesTask>("dependencyUpdates") {
rejectVersionIf {
// disallow release candidates as upgradable versions from stable versions
isNonStable(candidate.version) && !isNonStable(currentVersion)
}
}
}
fun FormatExtension.commonFormatOptions() {
lineEndings = LineEnding.UNIX
encoding = Charsets.UTF_8
trimTrailingWhitespace()
endWithNewline()
}
fun isNonStable(version: String): Boolean {
val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase(Locale.getDefault()).contains(it) }
val regex = "^[0-9,.v-]+(-r)?$".toRegex()
val isStable = stableKeyword || regex.matches(version)
return isStable.not()
}
fun loadEnv(file: File): Map<String, String> {
val envMap = HashMap<String, String>()
System
.getenv()
.filter { it.key.startsWith("JADX_") }
.forEach { envMap[it.key] = it.value }
if (file.exists()) {
file
.readLines()
.map { it.trim() }
.filter { it.isNotEmpty() && !it.startsWith("#") }
.forEach {
val (k, v) = it.split("=", limit = 2)
envMap[k.trim()] = v.trim()
}
}
println(
"Loaded env vars (${envMap.size}):\n${
envMap.toList().sortedBy { it.first }.joinToString(separator = "\n") { "${it.first}=${it.second}" }
}\n",
)
return envMap
}
val distWinConfiguration: Configuration by configurations.creating {
isCanBeConsumed = false
}
val distWinWithJreConfiguration: Configuration by configurations.creating {
isCanBeConsumed = false
}
dependencies {
distWinConfiguration(project(":jadx-gui", "distWinConfiguration"))
distWinWithJreConfiguration(project(":jadx-gui", "distWinWithJreConfiguration"))
}
val copyArtifacts by tasks.registering(Copy::class) {
val jarCliPattern = "jadx-cli-(.*)-all.jar".toPattern()
from(tasks.getByPath(":jadx-cli:installShadowDist")) {
exclude("**/*.jar")
filter { line ->
jarCliPattern
.matcher(line)
.replaceAll("jadx-$1-all.jar")
.replace("-jar \"\\\"\$CLASSPATH\\\"\"", "-cp \"\\\"\$CLASSPATH\\\"\" jadx.cli.JadxCLI")
.replace("-jar \"%CLASSPATH%\"", "-cp \"%CLASSPATH%\" jadx.cli.JadxCLI")
}
}
val jarGuiPattern = "jadx-gui-(.*)-all.jar".toPattern()
from(tasks.getByPath(":jadx-gui:installShadowDist")) {
exclude("**/*.jar")
filter { line -> jarGuiPattern.matcher(line).replaceAll("jadx-$1-all.jar") }
}
from(tasks.getByPath(":jadx-gui:installShadowDist")) {
include("**/*.jar")
rename("jadx-gui-(.*)-all.jar", "jadx-$1-all.jar")
}
from(layout.projectDirectory) {
include("README.md")
include("LICENSE")
}
into(layout.buildDirectory.dir("jadx"))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
val pack by tasks.registering(Zip::class) {
from(copyArtifacts)
archiveFileName.set("jadx-$jadxVersion.zip")
destinationDirectory.set(layout.buildDirectory)
eachFile {
if (path == "bin/jadx" || path == "bin/jadx-gui") {
permissions {
unix("rwxr-xr-x")
}
}
}
}
val distWin by tasks.registering(Zip::class) {
group = "jadx"
description = "Build Windows bundle"
from(distWinConfiguration)
destinationDirectory.set(layout.buildDirectory.dir("distWin"))
archiveFileName.set("jadx-gui-$jadxVersion-win.zip")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
val distWinWithJre by tasks.registering(Zip::class) {
description = "Build Windows with JRE bundle"
from(distWinWithJreConfiguration)
destinationDirectory.set(layout.buildDirectory.dir("distWinWithJre"))
archiveFileName.set("jadx-gui-$jadxVersion-with-jre-win.zip")
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
val dist by tasks.registering {
group = "jadx"
description = "Build jadx distribution zip bundles"
dependsOn(pack)
val os = DefaultNativePlatform.getCurrentOperatingSystem()
if (os.isWindows) {
if (project.hasProperty("bundleJRE")) {
println("Build win bundle with JRE")
dependsOn(distWinWithJre)
} else {
dependsOn(distWin)
}
}
}
val cleanBuildDir by tasks.registering(Delete::class) {
delete(layout.buildDirectory)
}
tasks.getByName("clean").dependsOn(cleanBuildDir)
+15
View File
@@ -0,0 +1,15 @@
plugins {
`kotlin-dsl`
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.10")
implementation("org.openrewrite:plugin:6.19.1")
implementation("net.ltgt.errorprone:net.ltgt.errorprone.gradle.plugin:4.2.0")
implementation("net.ltgt.nullaway:net.ltgt.nullaway.gradle.plugin:2.3.0")
}
repositories {
gradlePluginPortal()
}
@@ -0,0 +1,97 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import net.ltgt.gradle.errorprone.CheckSeverity
import net.ltgt.gradle.errorprone.errorprone
import net.ltgt.gradle.nullaway.nullaway
plugins {
java
checkstyle
id("jadx-rewrite")
id("net.ltgt.errorprone")
id("net.ltgt.nullaway")
}
val jadxVersion: String by rootProject.extra
val jadxBuildJavaVersion: Int? by rootProject.extra
val jadxBuildChecksMode: String by rootProject.extra
group = "io.github.skylot"
version = jadxVersion
dependencies {
implementation("org.slf4j:slf4j-api:2.0.18")
compileOnly("org.jetbrains:annotations:26.1.0")
testImplementation("ch.qos.logback:logback-classic:1.5.34")
testImplementation("org.assertj:assertj-core:3.27.7")
testImplementation("org.junit.jupiter:junit-jupiter:5.13.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testCompileOnly("org.jetbrains:annotations:26.1.0")
errorprone("com.google.errorprone:error_prone_core:2.50.0")
errorprone("com.uber.nullaway:nullaway:0.13.7")
}
repositories {
mavenCentral()
// required for: aapt-proto, r8, smali
google()
}
java {
jadxBuildJavaVersion?.let { buildJavaVer ->
toolchain {
languageVersion = JavaLanguageVersion.of(buildJavaVer)
}
}
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks {
compileJava {
options.encoding = "UTF-8"
// options.compilerArgs = listOf("-Xlint:deprecation")
}
jar {
manifest {
attributes("jadx-version" to jadxVersion)
}
}
test {
useJUnitPlatform()
maxParallelForks = Runtime.getRuntime().availableProcessors()
testLogging {
showExceptions = true
exceptionFormat = TestExceptionFormat.FULL
showCauses = true
}
}
}
tasks.withType<JavaCompile>().configureEach {
val checkEnabled = jadxBuildChecksMode != "off"
if (checkEnabled) {
options.compilerArgs.add("-XDaddTypeAnnotationsToSymbol=true")
}
options.errorprone {
isEnabled = checkEnabled
allErrorsAsWarnings = jadxBuildChecksMode == "warn"
excludedPaths = ".*/test/.*"
nullaway {
if (jadxBuildChecksMode == "error") {
error()
}
annotatedPackages.add("jadx")
}
// TODO: fix and enable all checks
disable("MixedMutabilityReturnType")
disable("EqualsGetClass")
disable("OperatorPrecedence")
disable("UnusedVariable")
disable("ImmutableEnumChecker")
}
}
@@ -0,0 +1,17 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
id("jadx-java")
id("org.jetbrains.kotlin.jvm")
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect")) // don't work from plugin classloader
}
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
@@ -0,0 +1,81 @@
plugins {
id("jadx-java")
id("java-library")
id("maven-publish")
id("signing")
}
val jadxVersion: String by rootProject.extra
group = "io.github.skylot"
version = jadxVersion
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = project.name
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set(project.name)
description.set(project.description ?: "Dex to Java decompiler")
url.set("https://github.com/skylot/jadx")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("skylot")
name.set("Skylot")
email.set(project.properties["libEmail"].toString())
url.set("https://github.com/skylot")
}
}
scm {
connection.set("scm:git:git://github.com/skylot/jadx.git")
developerConnection.set("scm:git:ssh://github.com:skylot/jadx.git")
url.set("https://github.com/skylot/jadx")
}
}
}
}
repositories {
maven {
val releasesRepoUrl = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/")
val snapshotsRepoUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = project.properties["ossrhUser"].toString()
password = project.properties["ossrhPassword"].toString()
}
}
}
}
signing {
isRequired = gradle.taskGraph.hasTask("publish")
sign(publishing.publications["mavenJava"])
}
tasks.javadoc {
val stdOptions = options as StandardJavadocDocletOptions
stdOptions.addBooleanOption("html5", true)
// disable 'missing' warnings
stdOptions.addStringOption("Xdoclint:all,-missing", "-quiet")
}
@@ -0,0 +1,35 @@
plugins {
id("org.openrewrite.rewrite")
}
repositories {
mavenCentral()
}
dependencies {
rewrite("org.openrewrite.recipe:rewrite-testing-frameworks:3.38.0")
rewrite("org.openrewrite.recipe:rewrite-logging-frameworks:3.29.1")
rewrite("org.openrewrite.recipe:rewrite-migrate-java:3.37.0")
rewrite("org.openrewrite.recipe:rewrite-static-analysis:2.37.0")
}
tasks {
rewrite {
// exclusion("src/test/java/jadx/tests/integration")
// activeRecipe("org.openrewrite.java.migrate.Java8toJava11")
// checkstyle auto fix
// activeRecipe("org.openrewrite.staticanalysis.CodeCleanup")
// setCheckstyleConfigFile(file("$rootDir/config/checkstyle/checkstyle.xml"))
// logging
// activeRecipe("org.openrewrite.java.logging.slf4j.Slf4jBestPractices")
// activeRecipe("org.openrewrite.java.logging.slf4j.LoggersNamedForEnclosingClass")
// activeRecipe("org.openrewrite.java.logging.slf4j.ParameterizedLogging")
// activeRecipe("org.openrewrite.java.logging.PrintStackTraceToLogError")
// testing
activeRecipe("org.openrewrite.java.testing.assertj.Assertj")
}
}
+21 -1
View File
@@ -78,7 +78,9 @@
<!-- annotations -->
<module name="AnnotationLocation"/>
<module name="AnnotationUseStyle"/>
<module name="AnnotationUseStyle">
<property name="elementStyle" value="compact"/>
</module>
<module name="MissingOverride"/>
<!-- <module name="MissingDeprecated"/> -->
@@ -117,6 +119,24 @@
<module name="OuterTypeNumber"/>
<module name="SuppressWarningsHolder"/>
<module name="IllegalType">
<property name="illegalClassNames" value="java.util.ArrayList, java.util.HashMap, java.util.HashSet,
java.util.LinkedHashMap, java.util.LinkedHashSet, java.util.TreeMap, java.util.TreeSet"/>
</module>
<module name="IllegalImport">
<property name="illegalClasses" value="jadx.core.utils.DebugUtils"/>
<!-- don't use nullable annotations from RxJava -->
<property name="illegalClasses" value="io.reactivex.rxjava3.annotations.NonNull"/>
<property name="illegalClasses" value="io.reactivex.rxjava3.annotations.Nullable"/>
</module>
<module name="RegexpSinglelineJava">
<property name="id" value="printstacktrace"/>
<property name="format" value="\.printStackTrace\(\)"/>
<property name="ignoreComments" value="true"/>
<property name="message"
value="Using Throwable.printStackTrace() is forbidden. Use logger to print exception"/>
</module>
</module>
<module name="NewlineAtEndOfFile"/>
+222 -170
View File
@@ -1,77 +1,248 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="16">
<profile kind="CodeFormatterProfile" name="jadx eclipse" version="16">
<profiles version="23">
<profile kind="CodeFormatterProfile" name="jadx eclipse" version="23">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_with_spaces" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="48"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_record_components" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_logical_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_switch_case_arrow_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="separate_lines_if_wrapped"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.text_block_indentation" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_permitted_types" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_annotations" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_not_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_permitted_types_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_constructor" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="48"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.keep_switch_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_arrow" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="100"/>
@@ -80,267 +251,148 @@
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_additive_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_shift_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_parameters" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_loops" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_relational_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation" value="separate_lines_if_wrapped"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.align_selector_in_method_invocation_on_expression_first_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_record_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_switch_case_with_arrow_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_switch_case_with_colon" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="48"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_additive_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_conditional_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_shift_operator" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines" value="2147483647"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_code_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_assignment_operator" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_switch_case_with_arrow" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_type_arguments" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method" value="49"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assertion_message" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_logical_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_relational_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_tag_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_string_concatenation" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_logical_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_shift_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_permitted_types" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line" value="one_line_never"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="end_of_line"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_additive_operator" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block" value="0"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="tab"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_relational_operator" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.wrap_before_string_concatenation" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="140"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
+1
View File
@@ -0,0 +1 @@
SmaliTokenMaker.java
+5
View File
@@ -0,0 +1,5 @@
Refer to the following instructions to modify and use to generate SmaliTokenMarker
```shell
jflex SmaliTokenMaker.flex --skel skeleton.default
```
+679
View File
@@ -0,0 +1,679 @@
/*
* Generated on 11/22/21, 8:58 PM
*/
package jadx.gui.ui.codearea;
import java.io.*;
import javax.swing.text.Segment;
import org.fife.ui.rsyntaxtextarea.*;
/*
* 用于Smali代码高亮
* MartinKay@qq.com
*/
%%
%public
%class SmaliTokenMaker
%extends AbstractJFlexCTokenMaker
%unicode
/* Case sensitive */
%type org.fife.ui.rsyntaxtextarea.Token
%{
/**
* Constructor. This must be here because JFlex does not generate a
* no-parameter constructor.
*/
public SmaliTokenMaker() {
}
/**
* Adds the token specified to the current linked list of tokens.
*
* @param tokenType The token's type.
* @see #addToken(int, int, int)
*/
private void addHyperlinkToken(int start, int end, int tokenType) {
int so = start + offsetShift;
addToken(zzBuffer, start,end, tokenType, so, true);
}
/**
* Adds the token specified to the current linked list of tokens.
*
* @param tokenType The token's type.
*/
private void addToken(int tokenType) {
addToken(zzStartRead, zzMarkedPos-1, tokenType);
}
/**
* Adds the token specified to the current linked list of tokens.
*
* @param tokenType The token's type.
* @see #addHyperlinkToken(int, int, int)
*/
private void addToken(int start, int end, int tokenType) {
int so = start + offsetShift;
addToken(zzBuffer, start,end, tokenType, so, false);
}
/**
* Adds the token specified to the current linked list of tokens.
*
* @param array The character array.
* @param start The starting offset in the array.
* @param end The ending offset in the array.
* @param tokenType The token's type.
* @param startOffset The offset in the document at which this token
* occurs.
* @param hyperlink Whether this token is a hyperlink.
*/
public void addToken(char[] array, int start, int end, int tokenType,
int startOffset, boolean hyperlink) {
super.addToken(array, start,end, tokenType, startOffset, hyperlink);
zzStartRead = zzMarkedPos;
}
/**
* {@inheritDoc}
*/
public String[] getLineCommentStartAndEnd(int languageIndex) {
return new String[] { "#", null };
}
/**
* Returns the first token in the linked list of tokens generated
* from <code>text</code>. This method must be implemented by
* subclasses so they can correctly implement syntax highlighting.
*
* @param text The text from which to get tokens.
* @param initialTokenType The token type we should start with.
* @param startOffset The offset into the document at which
* <code>text</code> starts.
* @return The first <code>Token</code> in a linked list representing
* the syntax highlighted text.
*/
public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
resetTokenList();
this.offsetShift = -text.offset + startOffset;
// Start off in the proper state.
int state = Token.NULL;
switch (initialTokenType) {
/* No multi-line comments */
/* No documentation comments */
default:
state = Token.NULL;
}
s = text;
try {
yyreset(zzReader);
yybegin(state);
return yylex();
} catch (IOException ioe) {
ioe.printStackTrace();
return new TokenImpl();
}
}
/**
* Refills the input buffer.
*
* @return <code>true</code> if EOF was reached, otherwise
* <code>false</code>.
*/
private boolean zzRefill() {
return zzCurrentPos>=s.offset+s.count;
}
/**
* Resets the scanner to read from a new input stream.
* Does not close the old reader.
*
* All internal variables are reset, the old input stream
* <b>cannot</b> be reused (internal buffer is discarded and lost).
* Lexical state is set to <tt>YY_INITIAL</tt>.
*
* @param reader the new input stream
*/
public final void yyreset(Reader reader) {
// 's' has been updated.
zzBuffer = s.array;
/*
* We replaced the line below with the two below it because zzRefill
* no longer "refills" the buffer (since the way we do it, it's always
* "full" the first time through, since it points to the segment's
* array). So, we assign zzEndRead here.
*/
//zzStartRead = zzEndRead = s.offset;
zzStartRead = s.offset;
zzEndRead = zzStartRead + s.count - 1;
zzCurrentPos = zzMarkedPos = zzPushbackPos = s.offset;
zzLexicalState = YYINITIAL;
zzReader = reader;
zzAtBOL = true;
zzAtEOF = false;
}
%}
Letter = [A-Za-z]
LetterOrUnderscore = ({Letter}|"_")
NonzeroDigit = [1-9]
Digit = ("0"|{NonzeroDigit})
HexDigit = ({Digit}|[A-Fa-f])
OctalDigit = ([0-7])
AnyCharacterButApostropheOrBackSlash = ([^\\'])
AnyCharacterButDoubleQuoteOrBackSlash = ([^\\\"\n])
EscapedSourceCharacter = ("u"{HexDigit}{HexDigit}{HexDigit}{HexDigit})
Escape = ("\\"(([btnfr\"'\\])|([0123]{OctalDigit}?{OctalDigit}?)|({OctalDigit}{OctalDigit}?)|{EscapedSourceCharacter}))
NonSeparator = ([^\t\f\r\n\ \(\)\{\}\[\]\;\,\.\=\>\<\!\~\?\:\+\-\*\/\&\|\^\%\"\']|"#"|"\\")
IdentifierStart = ({LetterOrUnderscore}|"$")
IdentifierPart = ({IdentifierStart}|{Digit}|("\\"{EscapedSourceCharacter}))
LineTerminator = (\n)
WhiteSpace = ([ \t\f]+)
CharLiteral = ([\']({AnyCharacterButApostropheOrBackSlash}|{Escape})[\'])
UnclosedCharLiteral = ([\'][^\'\n]*)
ErrorCharLiteral = ({UnclosedCharLiteral}[\'])
StringLiteral = ([\"]({AnyCharacterButDoubleQuoteOrBackSlash}|{Escape})*[\"])
UnclosedStringLiteral = ([\"]([\\].|[^\\\"])*[^\"]?)
ErrorStringLiteral = ({UnclosedStringLiteral}[\"])
/* No multi-line comments */
/* No documentation comments */
LineCommentBegin = "#"
IntegerLiteral = ({Digit}+)
HexLiteral = (0x{HexDigit}+)
FloatLiteral = (({Digit}+)("."{Digit}+)?(e[+-]?{Digit}+)? | ({Digit}+)?("."{Digit}+)(e[+-]?{Digit}+)?)
ErrorNumberFormat = (({IntegerLiteral}|{HexLiteral}|{FloatLiteral}){NonSeparator}+)
BooleanLiteral = ("true"|"false")
Separator = ([\(\)\{\}\[\]])
Separator2 = ([\;,.])
Identifier = ({IdentifierStart}{IdentifierPart}*)
URLGenDelim = ([:\/\?#\[\]@])
URLSubDelim = ([\!\$&'\(\)\*\+,;=])
URLUnreserved = ({LetterOrUnderscore}|{Digit}|[\-\.\~])
URLCharacter = ({URLGenDelim}|{URLSubDelim}|{URLUnreserved}|[%])
URLCharacters = ({URLCharacter}*)
URLEndCharacter = ([\/\$]|{Letter}|{Digit})
URL = (((https?|f(tp|ile))"://"|"www.")({URLCharacters}{URLEndCharacter})?)
/* Custom Regex */
/* fully-qualified name Rules */
SimpleName = ([a-zA-Z0-9_$]*)
QUALIFIED_TYPE_NAME = ("L"({SimpleName}{SLASH})*{SimpleName}*";")
/* Types */
VOID_TYPE = ("V")
BOOLEAN_TYPE = ("Z")
BYTE_TYPE = ("B")
SHORT_TYPE = ("S")
CHAR_TYPE = ("C")
INT_TYPE = ("I")
LONG_TYPE = ("J")
FLOAT_TYPE = ("F")
DOUBLE_TYPE = ("D")
/* Multi Args Types Highlight */
MULTI_ARGS_TYPES = (({BOOLEAN_TYPE}|{BYTE_TYPE}|{SHORT_TYPE}|{CHAR_TYPE}|{INT_TYPE}|{LONG_TYPE}|{FLOAT_TYPE}|{DOUBLE_TYPE})+);
/* Types fully-qualified name */
COMPOUND_METHOD_ARG_LITERAL = (({BOOLEAN_TYPE}|{BYTE_TYPE}|{SHORT_TYPE}|{CHAR_TYPE}|{INT_TYPE}|{LONG_TYPE}|{FLOAT_TYPE}|{DOUBLE_TYPE})+{QUALIFIED_TYPE_NAME})
LBRACK = ("[")
RBRACK = ("]")
LPAREN = ("(")
RPAREN = (")")
LBRACE = ("{")
RBRACE = ("}")
COLON = (":")
ASSIGN = ("=")
DOT = (".")
SUB = ("-")
COMMA = (",")
SLASH = ("/")
LT = ("<")
GT = (">")
ARROW = ("->")
SEMI = (";")
ARROW_FUNCTION = ({ARROW}[a-zA-Z_$<>]*)
CustomSeparator = ({Separator}|{ARROW_FUNCTION})
/* Register */
VREGISTER = ("v"("0"|[1-9])*)
PREGISTER = ("p"("0"|[1-9])*)
/* Flags */
FLAG_PSWITCH = (":pswitch_"{SimpleName})
FLAG_PSWITCH_DATA = (":pswitch_data_"{SimpleName})
FLAG_GOTO = (":goto_"{SimpleName})
FLAG_COND = (":cond_"{SimpleName})
FLAG_TRY_START = (":try_start_"{SimpleName})
FLAG_TRY_END = (":try_end_"{SimpleName})
FLAG_CATCH = (":catch_"{SimpleName})
FLAG_CATCHALL = (":catchall_"{SimpleName})
FLAG_ARRAY = (":array_"{SimpleName})
/* No string state */
/* No char state */
/* No MLC state */
/* No documentation comment state */
%state EOL_COMMENT
%%
<YYINITIAL> {
/* Keywords Instructions Highlight */
"nop" |
"move" |
"move/from16" |
"move/16" |
"move-wide" |
"move-wide/from16" |
"move-wide/16" |
"move-object" |
"move-object/from16" |
"move-object/16" |
"move-result" |
"move-result-wide" |
"move-result-object" |
"move-exception" |
"return-void" |
"return" |
"return-wide" |
"return-object" |
"const/4" |
"const/16" |
"const" |
"const/high16" |
"const-wide/16" |
"const-wide/32" |
"const-wide" |
"const-wide/high16" |
"const-string" |
"const-string/jumbo" |
"const-class" |
"monitor-enter" |
"monitor-exit" |
"check-cast" |
"instance-of" |
"array-length" |
"new-instance" |
"new-array" |
"filled-new-array" |
"filled-new-array/range" |
"fill-array-data" |
"throw" |
"goto" |
"goto/16" |
"goto/32" |
"cmpl-float" |
"cmpg-float" |
"cmpl-double" |
"cmpg-double" |
"cmp-long" |
"if-eq" |
"if-ne" |
"if-lt" |
"if-ge" |
"if-gt" |
"if-le" |
"if-eqz" |
"if-nez" |
"if-ltz" |
"if-gez" |
"if-gtz" |
"if-lez" |
"aget" |
"aget-wide" |
"aget-object" |
"aget-boolean" |
"aget-byte" |
"aget-char" |
"aget-short" |
"aput" |
"aput-wide" |
"aput-object" |
"aput-boolean" |
"aput-byte" |
"aput-char" |
"aput-short" |
"iget" |
"iget-wide" |
"iget-object" |
"iget-boolean" |
"iget-byte" |
"iget-char" |
"iget-short" |
"iput" |
"iput-wide" |
"iput-object" |
"iput-boolean" |
"iput-byte" |
"iput-char" |
"iput-short" |
"sget" |
"sget-wide" |
"sget-object" |
"sget-boolean" |
"sget-byte" |
"sget-char" |
"sget-short" |
"sput" |
"sput-wide" |
"sput-object" |
"sput-boolean" |
"sput-byte" |
"sput-char" |
"sput-short" |
"invoke-virtual" |
"invoke-super" |
"invoke-direct" |
"invoke-static" |
"invoke-interface" |
"invoke-virtual/range" |
"invoke-super/range" |
"invoke-direct/range" |
"invoke-static/range" |
"invoke-interface/range" |
"neg-int" |
"not-int" |
"neg-long" |
"not-long" |
"neg-float" |
"neg-double" |
"int-to-long" |
"int-to-float" |
"int-to-double" |
"long-to-int" |
"long-to-float" |
"long-to-double" |
"float-to-int" |
"float-to-long" |
"float-to-double" |
"double-to-int" |
"double-to-long" |
"double-to-float" |
"int-to-byte" |
"int-to-char" |
"int-to-short" |
"add-int" |
"sub-int" |
"mul-int" |
"div-int" |
"rem-int" |
"and-int" |
"or-int" |
"xor-int" |
"shl-int" |
"shr-int" |
"ushr-int" |
"add-long" |
"sub-long" |
"mul-long" |
"div-long" |
"rem-long" |
"and-long" |
"or-long" |
"xor-long" |
"shl-long" |
"shr-long" |
"ushr-long" |
"add-float" |
"sub-float" |
"mul-float" |
"div-float" |
"rem-float" |
"add-double" |
"sub-double" |
"mul-double" |
"div-double" |
"rem-double" |
"add-int/2addr" |
"sub-int/2addr" |
"mul-int/2addr" |
"div-int/2addr" |
"rem-int/2addr" |
"and-int/2addr" |
"or-int/2addr" |
"xor-int/2addr" |
"shl-int/2addr" |
"shr-int/2addr" |
"ushr-int/2addr" |
"add-long/2addr" |
"sub-long/2addr" |
"mul-long/2addr" |
"div-long/2addr" |
"rem-long/2addr" |
"and-long/2addr" |
"or-long/2addr" |
"xor-long/2addr" |
"shl-long/2addr" |
"shr-long/2addr" |
"ushr-long/2addr" |
"add-float/2addr" |
"sub-float/2addr" |
"mul-float/2addr" |
"div-float/2addr" |
"rem-float/2addr" |
"add-double/2addr" |
"sub-double/2addr" |
"mul-double/2addr" |
"div-double/2addr" |
"rem-double/2addr" |
"add-int/lit16" |
"rsub-int" |
"mul-int/lit16" |
"div-int/lit16" |
"rem-int/lit16" |
"and-int/lit16" |
"or-int/lit16" |
"xor-int/lit16" |
"add-int/lit8" |
"rsub-int/lit8" |
"mul-int/lit8" |
"div-int/lit8" |
"rem-int/lit8" |
"and-int/lit8" |
"or-int/lit8" |
"xor-int/lit8" |
"shl-int/lit8" |
"shr-int/lit8" |
"ushr-int/lit8" |
"invoke-polymorphic" |
"invoke-polymorphic/range" |
"invoke-custom" |
"invoke-custom/range" |
"const-method-handle" |
"const-method-type" |
"packed-switch" |
"sparse-switch" { addToken(Token.FUNCTION); }
/* Keywords Modifiers(IDENTIFIER标识符、修饰符) Highlight */
"public" |
"private" |
"protected" |
"final" |
"annotation" |
"static" |
"synthetic" |
"constructor" |
"abstract" |
"enum" |
"interface" |
"transient" |
"bridge" |
"declared-synchronized" |
"volatile" |
"strictfp" |
"varargs" |
"native" { addToken(Token.RESERVED_WORD); }
/* Keywords Directives Highlight */
".method" |
".end method" |
".implements" |
".class" |
".prologue" |
".source" |
".super" |
".field" |
".end field" |
".registers" |
".locals" |
".param" |
".line" |
".catch" |
".catchall" |
".annotation" |
".end annotation" |
".local" |
".end local" |
".restart local" |
".packed-switch" |
".end packed-switch" |
".array-data" |
".end array-data" |
".sparse-switch" |
".end sparse-switch" |
".end param" { addToken(Token.RESERVED_WORD_2); }
/* VARIABLE Register Highlight */
{VREGISTER} |
{PREGISTER} { addToken(Token.VARIABLE); }
/* Data types Highlight */
{QUALIFIED_TYPE_NAME} |
{COMPOUND_METHOD_ARG_LITERAL} |
{MULTI_ARGS_TYPES} |
{QUALIFIED_TYPE_NAME} |
{VOID_TYPE} |
{BOOLEAN_TYPE} |
{BYTE_TYPE} |
{SHORT_TYPE} |
{CHAR_TYPE} |
{INT_TYPE} |
{LONG_TYPE} |
{FLOAT_TYPE} |
{DOUBLE_TYPE} { addToken(Token.DATA_TYPE); }
/* FLAGS */
{FLAG_PSWITCH} |
{FLAG_PSWITCH_DATA} |
{FLAG_GOTO} |
{FLAG_COND} |
{FLAG_TRY_START} |
{FLAG_TRY_END} |
{FLAG_CATCHALL} |
{FLAG_ARRAY} |
{FLAG_CATCH} { addToken(Token.MARKUP_TAG_NAME); }
/* Functions */
/* No functions */
{BooleanLiteral} { addToken(Token.LITERAL_BOOLEAN); }
{LineTerminator} { addNullToken(); return firstToken; }
{Identifier} { addToken(Token.IDENTIFIER); }
{WhiteSpace} { addToken(Token.WHITESPACE); }
/* String/Character literals. */
{CharLiteral} { addToken(Token.LITERAL_CHAR); }
{UnclosedCharLiteral} { addToken(Token.ERROR_CHAR); addNullToken(); return firstToken; }
{ErrorCharLiteral} { addToken(Token.ERROR_CHAR); }
{StringLiteral} { addToken(Token.LITERAL_STRING_DOUBLE_QUOTE); }
{UnclosedStringLiteral} { addToken(Token.ERROR_STRING_DOUBLE); addNullToken(); return firstToken; }
{ErrorStringLiteral} { addToken(Token.ERROR_STRING_DOUBLE); }
/* Comment literals. */
/* No multi-line comments */
/* No documentation comments */
{LineCommentBegin} { start = zzMarkedPos-1; yybegin(EOL_COMMENT); }
/* Separators. */
{CustomSeparator} { addToken(Token.SEPARATOR); }
{Separator2} { addToken(Token.IDENTIFIER); }
/* Operators. */
"!" |
";" |
"." |
"=" |
"/" |
"'" |
"(" |
")" |
"," |
"->" |
";->" |
"<" |
">" |
"@" |
"[" |
"]" |
"{" |
"}" { addToken(Token.OPERATOR); }
/* Numbers */
{IntegerLiteral} { addToken(Token.LITERAL_NUMBER_DECIMAL_INT); }
{HexLiteral} { addToken(Token.LITERAL_NUMBER_HEXADECIMAL); }
{FloatLiteral} { addToken(Token.LITERAL_NUMBER_FLOAT); }
{ErrorNumberFormat} { addToken(Token.ERROR_NUMBER_FORMAT); }
/* Ended with a line not in a string or comment. */
<<EOF>> { addNullToken(); return firstToken; }
/* Catch any other (unhandled) characters. */
. { addToken(Token.IDENTIFIER); }
}
/* No char state */
/* No string state */
/* No multi-line comment state */
/* No documentation comment state */
<EOL_COMMENT> {
[^hwf\n]+ {}
{URL} { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_EOL); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_EOL); start = zzMarkedPos; }
[hwf] {}
\n { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; }
<<EOF>> { addToken(start,zzStartRead-1, Token.COMMENT_EOL); addNullToken(); return firstToken; }
}
+246
View File
@@ -0,0 +1,246 @@
/** This character denotes the end of file */
public static final int YYEOF = -1;
/** initial size of the lookahead buffer */
--- private static final int ZZ_BUFFERSIZE = ...;
/** lexical states */
--- lexical states, charmap
/* error codes */
private static final int ZZ_UNKNOWN_ERROR = 0;
private static final int ZZ_NO_MATCH = 1;
private static final int ZZ_PUSHBACK_2BIG = 2;
/* error messages for the codes above */
private static final String ZZ_ERROR_MSG[] = {
"Unkown internal scanner error",
"Error: could not match input",
"Error: pushback value was too large"
};
--- isFinal list
/** the input device */
private java.io.Reader zzReader;
/** the current state of the DFA */
private int zzState;
/** the current lexical state */
private int zzLexicalState = YYINITIAL;
/** this buffer contains the current text to be matched and is
the source of the yytext() string */
private char zzBuffer[];
/** the textposition at the last accepting state */
private int zzMarkedPos;
/** the textposition at the last state to be included in yytext */
private int zzPushbackPos;
/** the current text position in the buffer */
private int zzCurrentPos;
/** startRead marks the beginning of the yytext() string in the buffer */
private int zzStartRead;
/** endRead marks the last character in the buffer, that has been read
from input */
private int zzEndRead;
/** number of newlines encountered up to the start of the matched text */
private int yyline;
/** the number of characters up to the start of the matched text */
private int yychar;
/**
* the number of characters from the last newline up to the start of the
* matched text
*/
private int yycolumn;
/**
* zzAtBOL == true <=> the scanner is currently at the beginning of a line
*/
private boolean zzAtBOL = true;
/** zzAtEOF == true <=> the scanner is at the EOF */
private boolean zzAtEOF;
--- user class code
/**
* Creates a new scanner
* There is also a java.io.InputStream version of this constructor.
*
* @param in the java.io.Reader to read input from.
*/
--- constructor declaration
/**
* Closes the input stream.
*/
public final void yyclose() throws java.io.IOException {
zzAtEOF = true; /* indicate end of file */
zzEndRead = zzStartRead; /* invalidate buffer */
if (zzReader != null)
zzReader.close();
}
/**
* Enters a new lexical state
*
* @param newState the new lexical state
*/
public final void yybegin(int newState) {
zzLexicalState = newState;
}
public final int yystate() {
return zzLexicalState;
}
/**
* Returns the text matched by the current regular expression.
*/
public final String yytext() {
return new String( zzBuffer, zzStartRead, zzMarkedPos-zzStartRead );
}
/**
* Returns the character at position <tt>pos</tt> from the
* matched text.
*
* It is equivalent to yytext().charAt(pos), but faster
*
* @param pos the position of the character to fetch.
* A value from 0 to yylength()-1.
*
* @return the character at position pos
*/
public final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
}
/**
* Returns the length of the matched text region.
*/
public final int yylength() {
return zzMarkedPos-zzStartRead;
}
/**
* Reports an error that occured while scanning.
*
* In a wellformed scanner (no or only correct usage of
* yypushback(int) and a match-all fallback rule) this method
* will only be called with things that "Can't Possibly Happen".
* If this method is called, something is seriously wrong
* (e.g. a JFlex bug producing a faulty scanner etc.).
*
* Usual syntax/scanner level error handling should be done
* in error fallback rules.
*
* @param errorCode the code of the errormessage to display
*/
--- zzScanError declaration
String message;
try {
message = ZZ_ERROR_MSG[errorCode];
}
catch (ArrayIndexOutOfBoundsException e) {
message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR];
}
--- throws clause
}
/**
* Pushes the specified amount of characters back into the input stream.
*
* They will be read again by then next call of the scanning method
*
* @param number the number of characters to be read again.
* This number must not be greater than yylength()!
*/
--- yypushback decl (contains zzScanError exception)
if ( number > yylength() )
zzScanError(ZZ_PUSHBACK_2BIG);
zzMarkedPos -= number;
}
--- zzDoEOF
/**
* Resumes scanning until the next regular expression is matched,
* the end of input is encountered or an I/O-Error occurs.
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
*/
--- yylex declaration
int zzInput;
int zzAction;
// cached fields:
int zzCurrentPosL;
int zzMarkedPosL;
int zzEndReadL = zzEndRead;
char [] zzBufferL = zzBuffer;
char [] zzCMapL = ZZ_CMAP;
--- local declarations
while (true) {
zzMarkedPosL = zzMarkedPos;
--- start admin (line, char, col count)
zzAction = -1;
zzCurrentPosL = zzCurrentPos = zzStartRead = zzMarkedPosL;
--- start admin (lexstate etc)
zzForAction: {
while (true) {
--- next input, line, col, char count, next transition, isFinal action
zzAction = zzState;
zzMarkedPosL = zzCurrentPosL;
--- line count update
}
}
}
// store back cached position
zzMarkedPos = zzMarkedPosL;
--- char count update
--- actions
default:
if (zzInput == YYEOF && zzStartRead == zzCurrentPos) {
zzAtEOF = true;
--- eofvalue
}
else {
--- no match
}
}
}
}
--- main
}
+10
View File
@@ -0,0 +1,10 @@
[Desktop Entry]
Name=JADX GUI
Comment=Dex to Java decompiler
Icon=jadx
Exec=jadx-gui %f
Terminal=false
Type=Application
Categories=Development;Java;
Keywords=Java;Decompiler;
StartupWMClass=jadx-gui-JadxGUI
+16 -1
View File
@@ -1 +1,16 @@
org.gradle.daemon=false
org.gradle.warning.mode=all
org.gradle.parallel=true
org.gradle.caching=true
### Disable configuration cache for now: causing issues with spotless and version plugins
# org.gradle.configuration-cache=true
# org.gradle.configuration-cache.problems=warn
# Flags for google-java-format (optimize imports by spotless) for Java >= 16.
# Java < 9 will ignore unsupported flags (thanks to -XX:+IgnoreUnrecognizedVMOptions)
org.gradle.jvmargs=-XX:+IgnoreUnrecognizedVMOptions \
--add-exports='jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED' \
--add-exports='jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED' \
--add-exports='jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED' \
--add-exports='jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED' \
--add-exports='jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED'
Binary file not shown.
+4 -1
View File
@@ -1,5 +1,8 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-bin.zip
distributionSha256Sum=2ab2958f2a1e51120c326cad6f385153bb11ee93b3c216c5fccebfdfbb7ec6cb
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Vendored
+193 -117
View File
@@ -1,78 +1,128 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright © 2015 the original authors.
#
# 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
#
# https://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.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
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
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -81,92 +131,118 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=$(save "$@")
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+93 -84
View File
@@ -1,84 +1,93 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
@rem
@rem Copyright 2015 the original author or authors.
@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 https://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
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
:execute
@rem Setup the command line
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
-28
View File
@@ -1,28 +0,0 @@
apply plugin: 'application'
mainClassName = 'jadx.cli.JadxCLI'
applicationName = 'jadx'
dependencies {
compile(project(':jadx-core'))
compile 'com.beust:jcommander:1.74'
compile 'ch.qos.logback:logback-classic:1.2.3'
}
applicationDistribution.with {
into('') {
from '../.'
include 'README.md'
include 'NOTICE'
include 'LICENSE'
}
}
startScripts {
defaultJvmOpts = ['-Xms128M', '-Xmx4g', '-XX:+UseG1GC']
doLast {
def str = windowsScript.text
str = str.replaceAll('set JAVA_EXE=%JAVA_HOME%/bin/java.exe', 'set JAVA_EXE="%JAVA_HOME%/bin/java.exe"')
windowsScript.text = str
}
}
+57
View File
@@ -0,0 +1,57 @@
plugins {
id("jadx-java")
id("jadx-library")
id("application")
// use shadow only for application scripts, jar will be copied from jadx-gui
id("com.gradleup.shadow") version "8.3.8"
}
dependencies {
implementation(project(":jadx-core"))
implementation(project(":jadx-plugins-tools"))
implementation(project(":jadx-commons:jadx-app-commons"))
implementation(project(":jadx-commons:jadx-analysis"))
runtimeOnly(project(":jadx-plugins:jadx-dex-input"))
runtimeOnly(project(":jadx-plugins:jadx-java-input"))
runtimeOnly(project(":jadx-plugins:jadx-java-convert"))
runtimeOnly(project(":jadx-plugins:jadx-smali-input"))
runtimeOnly(project(":jadx-plugins:jadx-rename-mappings"))
runtimeOnly(project(":jadx-plugins:jadx-kotlin-metadata"))
runtimeOnly(project(":jadx-plugins:jadx-kotlin-source-debug-extension"))
runtimeOnly(project(":jadx-plugins:jadx-xapk-input"))
runtimeOnly(project(":jadx-plugins:jadx-aab-input"))
runtimeOnly(project(":jadx-plugins:jadx-apkm-input"))
runtimeOnly(project(":jadx-plugins:jadx-apks-input"))
implementation("org.jcommander:jcommander:2.0")
implementation("ch.qos.logback:logback-classic:1.5.34")
implementation("com.google.code.gson:gson:2.14.0")
}
application {
applicationName = "jadx"
mainClass.set("jadx.cli.JadxCLI")
applicationDefaultJvmArgs =
listOf(
"-XX:+IgnoreUnrecognizedVMOptions",
"-Xms256M",
"-XX:MaxRAMPercentage=70.0",
"-XX:ParallelGCThreads=3",
// disable zip checks (#1962)
"-Djdk.util.zip.disableZip64ExtraFieldValidation=true",
// Foreign API access for 'directories' library (Windows only)
"--enable-native-access=ALL-UNNAMED",
)
applicationDistribution.from("$rootDir") {
include("README.md")
include("NOTICE")
include("LICENSE")
}
}
tasks.shadowJar {
// shadow jar not needed
configurations = listOf()
}
@@ -4,97 +4,239 @@ import java.io.PrintStream;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.function.Supplier;
import org.jetbrains.annotations.Nullable;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.ParameterDescription;
import com.beust.jcommander.ParameterException;
import com.beust.jcommander.Parameterized;
import jadx.api.JadxDecompiler;
import jadx.api.plugins.JadxPluginInfo;
import jadx.api.plugins.options.JadxPluginOptions;
import jadx.api.plugins.options.OptionDescription;
import jadx.core.plugins.JadxPluginManager;
import jadx.core.plugins.PluginContext;
import jadx.core.utils.Utils;
public class JCommanderWrapper<T> {
public class JCommanderWrapper {
private final JCommander jc;
private final JadxCLIArgs argsObj;
public JCommanderWrapper(T obj) {
this.jc = JCommander.newBuilder().addObject(obj).build();
public JCommanderWrapper(JadxCLIArgs argsObj) {
JCommander.Builder builder = JCommander.newBuilder().addObject(argsObj);
builder.acceptUnknownOptions(true); // workaround for "default" command
JadxCLICommands.append(builder);
this.jc = builder.build();
this.argsObj = argsObj;
}
public boolean parse(String[] args) {
try {
jc.parse(args);
String[] fixedArgs = fixArgsForEmptySaveConfig(args);
jc.parse(fixedArgs);
applyFiles(argsObj);
return true;
} catch (ParameterException e) {
System.err.println("Arguments parse error: " + e.getMessage());
printUsage();
return false;
}
}
public void overrideProvided(T obj) {
List<ParameterDescription> fieldsParams = jc.getParameters();
List<ParameterDescription> parameters = new ArrayList<>(1 + fieldsParams.size());
parameters.add(jc.getMainParameterValue());
parameters.addAll(fieldsParams);
for (ParameterDescription parameter : parameters) {
public void overrideProvided(JadxCLIArgs obj) {
applyFiles(obj);
for (ParameterDescription parameter : jc.getParameters()) {
if (parameter.isAssigned()) {
// copy assigned field value to obj
Parameterized parameterized = parameter.getParameterized();
Object val = parameterized.get(parameter.getObject());
parameterized.set(obj, val);
overrideProperty(obj, parameter);
}
}
}
public boolean processCommands() {
String parsedCommand = jc.getParsedCommand();
if (parsedCommand == null) {
return false;
}
return JadxCLICommands.process(this, jc, parsedCommand);
}
/**
* The main parameter parsing doesn't work if accepting unknown options
*/
private void applyFiles(JadxCLIArgs argsObj) {
argsObj.setFiles(jc.getUnknownOptions());
}
/**
* Override assigned field value to obj
*/
private static void overrideProperty(JadxCLIArgs obj, ParameterDescription parameter) {
Parameterized parameterized = parameter.getParameterized();
Object providedValue = parameterized.get(parameter.getObject());
Object newValue = mergeValues(parameterized.getType(), providedValue, () -> parameterized.get(obj));
parameterized.set(obj, newValue);
}
@SuppressWarnings({ "rawtypes", "unchecked" })
private static Object mergeValues(Class<?> type, Object value, Supplier<Object> prevValueProvider) {
if (type.isAssignableFrom(Map.class)) {
// merge maps instead replacing whole map
Map prevMap = (Map) prevValueProvider.get();
return Utils.mergeMaps(prevMap, (Map) value); // value map will override keys in prevMap
}
// simple override
return value;
}
/**
* Workaround to allow empty value (i.e. zero arity) for '--save-config' option
* Insert empty string arg if another option start right after this one, or it is a last one.
*/
private String[] fixArgsForEmptySaveConfig(String[] args) {
int len = args.length;
for (int i = 0; i < len; i++) {
String arg = args[i];
if (arg.equals("--save-config")) {
int next = i + 1;
if (next == len) {
return insertEmptyArg(args, next, true);
}
if (next < len) {
String nextArg = args[next];
if (nextArg.startsWith("-")) {
return insertEmptyArg(args, next, false);
}
}
break;
}
}
return args;
}
private static String[] insertEmptyArg(String[] args, int i, boolean add) {
List<String> strings = new ArrayList<>(Arrays.asList(args));
if (add) {
strings.add("");
} else {
strings.add(i, "");
}
return strings.toArray(new String[0]);
}
public void printUsage() {
// print usage in not sorted fields order (by default its sorted by description)
LogHelper.setLogLevel(LogHelper.LogLevelEnum.ERROR); // mute logger while printing help
// print usage in not sorted fields order (by default sorted by description)
PrintStream out = System.out;
out.println();
out.println("jadx - dex to java decompiler, version: " + JadxDecompiler.getVersion());
out.println();
out.println("usage: jadx [options] " + jc.getMainParameterDescription());
out.println("usage: jadx [command] [options] " + jc.getMainParameterDescription());
out.println("commands (use '<command> --help' for command options):");
for (String command : jc.getCommands().keySet()) {
out.println(" " + command + "\t - " + jc.getUsageFormatter().getCommandDescription(command));
}
out.println();
int maxNamesLen = printOptions(jc, out, true);
out.println(appendPluginOptions(maxNamesLen));
out.println();
out.println("Environment variables:");
out.println(" JADX_DISABLE_XML_SECURITY - set to 'true' to disable all security checks for XML files");
out.println(" JADX_DISABLE_ZIP_SECURITY - set to 'true' to disable all security checks for zip files");
out.println(" JADX_ZIP_MAX_ENTRIES_COUNT - maximum allowed number of entries in zip files (default: 100 000)");
out.println(" JADX_CONFIG_DIR - custom config directory, using system by default");
out.println(" JADX_CACHE_DIR - custom cache directory, using system by default");
out.println(" JADX_TMP_DIR - custom temp directory, using system by default");
out.println();
out.println("Examples:");
out.println(" jadx -d out classes.dex");
out.println(" jadx --rename-flags \"none\" classes.dex");
out.println(" jadx --rename-flags \"valid, printable\" classes.dex");
out.println(" jadx --log-level ERROR app.apk");
out.println(" jadx -Pdex-input.verify-checksum=no app.apk");
}
public void printUsage(JCommander subCommander) {
PrintStream out = System.out;
out.println("usage: " + subCommander.getProgramName() + " [options]");
printOptions(subCommander, out, false);
}
private static int printOptions(JCommander jc, PrintStream out, boolean addDefaults) {
out.println("options:");
List<ParameterDescription> params = jc.getParameters();
Map<String, ParameterDescription> paramsMap = new LinkedHashMap<>(params.size());
Map<String, ParameterDescription> paramsMap = new HashMap<>(params.size());
int maxNamesLen = 0;
for (ParameterDescription p : params) {
paramsMap.put(p.getParameterized().getName(), p);
int len = p.getNames().length();
if (len > maxNamesLen) {
maxNamesLen = len;
String valueDesc = getValueDesc(p);
if (valueDesc != null) {
len += 1 + valueDesc.length();
}
maxNamesLen = Math.max(maxNamesLen, len);
}
maxNamesLen += 3;
JadxCLIArgs args = (JadxCLIArgs) jc.getObjects().get(0);
Object args = jc.getObjects().get(0);
for (Field f : getFields(args.getClass())) {
String name = f.getName();
ParameterDescription p = paramsMap.get(name);
if (p == null) {
if (p == null || p.getParameter().hidden()) {
continue;
}
StringBuilder opt = new StringBuilder();
opt.append(" ").append(p.getNames());
addSpaces(opt, maxNamesLen - opt.length() + 3);
opt.append("- ").append(p.getDescription());
addDefaultValue(args, f, opt);
String valueDesc = getValueDesc(p);
if (valueDesc != null) {
opt.append(' ').append(valueDesc);
}
addSpaces(opt, maxNamesLen - opt.length());
String description = p.getDescription();
if (description.contains("\n")) {
String[] lines = description.split("\n");
opt.append("- ").append(lines[0]);
for (int i = 1; i < lines.length; i++) {
opt.append('\n');
addSpaces(opt, maxNamesLen + 2);
opt.append(lines[i]);
}
} else {
opt.append("- ").append(description);
}
if (addDefaults) {
String defaultValue = getDefaultValue(args, f);
if (defaultValue != null
&& !defaultValue.isEmpty()
&& !description.contains("(default)")) {
opt.append(", default: ").append(defaultValue);
}
}
out.println(opt);
}
out.println("Example:");
out.println(" jadx -d out classes.dex");
return maxNamesLen;
}
private static @Nullable String getValueDesc(ParameterDescription p) {
Parameter parameterAnnotation = p.getParameterAnnotation();
return parameterAnnotation == null ? null : parameterAnnotation.defaultValueDescription();
}
/**
* Get all declared fields of the specified class and all super classes
*
* @param clazz
* @return
*/
private List<Field> getFields(Class<?> clazz) {
List<Field> fieldList = new LinkedList<>();
private static List<Field> getFields(Class<?> clazz) {
List<Field> fieldList = new ArrayList<>();
while (clazz != null) {
fieldList.addAll(Arrays.asList(clazz.getDeclaredFields()));
clazz = clazz.getSuperclass();
@@ -102,26 +244,26 @@ public class JCommanderWrapper<T> {
return fieldList;
}
private void addDefaultValue(JadxCLIArgs args, Field f, StringBuilder opt) {
Class<?> fieldType = f.getType();
if (fieldType == int.class) {
try {
int val = f.getInt(args);
opt.append(" (default: ").append(val).append(')');
} catch (Exception e) {
// ignore
@Nullable
private static String getDefaultValue(Object args, Field f) {
try {
Class<?> fieldType = f.getType();
if (fieldType == int.class) {
return Integer.toString(f.getInt(args));
}
}
if (fieldType == String.class) {
try {
String val = (String) f.get(args);
if (fieldType == String.class) {
return (String) f.get(args);
}
if (Enum.class.isAssignableFrom(fieldType)) {
Enum<?> val = (Enum<?>) f.get(args);
if (val != null) {
opt.append(" (default: ").append(val).append(')');
return val.name().toLowerCase(Locale.ROOT);
}
} catch (Exception e) {
// ignore
}
} catch (Exception e) {
// ignore
}
return null;
}
private static void addSpaces(StringBuilder str, int count) {
@@ -129,4 +271,51 @@ public class JCommanderWrapper<T> {
str.append(' ');
}
}
private String appendPluginOptions(int maxNamesLen) {
StringBuilder sb = new StringBuilder();
// load and init all options plugins to print all options
try (JadxDecompiler decompiler = new JadxDecompiler(argsObj.toJadxArgs())) {
JadxPluginManager pluginManager = decompiler.getPluginManager();
pluginManager.load(decompiler.getArgs().getPluginLoader());
pluginManager.initAll();
try {
for (PluginContext context : pluginManager.getAllPluginContexts()) {
JadxPluginOptions options = context.getOptions();
if (options != null) {
appendPlugin(context.getPluginInfo(), context.getOptions(), sb, maxNamesLen);
}
}
} finally {
pluginManager.unloadAll();
}
}
if (sb.length() == 0) {
return "";
}
return "\nPlugin options (-P<name>=<value>):" + sb;
}
private boolean appendPlugin(JadxPluginInfo pluginInfo, JadxPluginOptions options, StringBuilder out, int maxNamesLen) {
List<OptionDescription> descs = options.getOptionsDescriptions();
if (descs.isEmpty()) {
return false;
}
out.append("\n ");
out.append(pluginInfo.getPluginId()).append(": ").append(pluginInfo.getDescription());
for (OptionDescription desc : descs) {
StringBuilder opt = new StringBuilder();
opt.append(" - ").append(desc.name());
addSpaces(opt, maxNamesLen - opt.length());
opt.append("- ").append(desc.description());
if (!desc.values().isEmpty()) {
opt.append(", values: ").append(desc.values());
}
if (desc.defaultValue() != null) {
opt.append(", default: ").append(desc.defaultValue());
}
out.append("\n").append(opt);
}
return true;
}
}
@@ -0,0 +1,48 @@
package jadx.cli;
import java.util.Set;
import jadx.api.JadxArgs;
import jadx.api.security.JadxSecurityFlag;
import jadx.api.security.impl.JadxSecurity;
import jadx.commons.app.JadxCommonEnv;
import jadx.zip.security.DisabledZipSecurity;
import jadx.zip.security.IJadxZipSecurity;
import jadx.zip.security.JadxZipSecurity;
public class JadxAppCommon {
public static void applyEnvVars(JadxArgs jadxArgs) {
Set<JadxSecurityFlag> flags = JadxSecurityFlag.all();
IJadxZipSecurity zipSecurity;
boolean disableXmlSecurity = JadxCommonEnv.getBool("JADX_DISABLE_XML_SECURITY", false);
if (disableXmlSecurity) {
flags.remove(JadxSecurityFlag.SECURE_XML_PARSER);
// TODO: not related to 'xml security', but kept for compatibility
flags.remove(JadxSecurityFlag.VERIFY_APP_PACKAGE);
}
boolean disableZipSecurity = JadxCommonEnv.getBool("JADX_DISABLE_ZIP_SECURITY", false);
if (disableZipSecurity) {
flags.remove(JadxSecurityFlag.SECURE_ZIP_READER);
zipSecurity = DisabledZipSecurity.INSTANCE;
} else {
JadxZipSecurity jadxZipSecurity = new JadxZipSecurity();
int maxZipEntriesCount = JadxCommonEnv.getInt("JADX_ZIP_MAX_ENTRIES_COUNT", -2);
if (maxZipEntriesCount != -2) {
jadxZipSecurity.setMaxEntriesCount(maxZipEntriesCount);
}
int zipBombMinUncompressedSize = JadxCommonEnv.getInt("JADX_ZIP_BOMB_MIN_UNCOMPRESSED_SIZE", -2);
if (zipBombMinUncompressedSize != -2) {
jadxZipSecurity.setZipBombMinUncompressedSize(zipBombMinUncompressedSize);
}
int setZipBombDetectionFactor = JadxCommonEnv.getInt("JADX_ZIP_BOMB_DETECTION_FACTOR", -2);
if (setZipBombDetectionFactor != -2) {
jadxZipSecurity.setZipBombDetectionFactor(setZipBombDetectionFactor);
}
zipSecurity = jadxZipSecurity;
}
jadxArgs.setSecurity(new JadxSecurity(flags, zipSecurity));
}
}
+136 -19
View File
@@ -1,47 +1,164 @@
package jadx.cli;
import java.nio.file.Path;
import java.util.function.Consumer;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jadx.analysis.callgraph.JadxCallGraph;
import jadx.analysis.callgraph.api.ICallGraph;
import jadx.api.JadxArgs;
import jadx.api.JadxDecompiler;
import jadx.api.impl.AnnotatedCodeWriter;
import jadx.api.impl.NoOpCodeCache;
import jadx.api.impl.SimpleCodeWriter;
import jadx.api.usage.impl.EmptyUsageInfoCache;
import jadx.cli.LogHelper.LogLevelEnum;
import jadx.cli.config.JadxConfigAdapter;
import jadx.cli.plugins.JadxFilesGetter;
import jadx.core.utils.exceptions.JadxArgsValidateException;
import jadx.core.utils.exceptions.JadxRuntimeException;
import jadx.plugins.tools.JadxExternalPluginsLoader;
public class JadxCLI {
private static final Logger LOG = LoggerFactory.getLogger(JadxCLI.class);
public static void main(String[] args) {
int result = 0;
int result = 1;
try {
JadxCLIArgs jadxArgs = new JadxCLIArgs();
if (jadxArgs.processArgs(args)) {
result = processAndSave(jadxArgs);
}
} catch (Exception e) {
LOG.error("jadx error: {}", e.getMessage(), e);
result = 1;
result = execute(args);
} finally {
System.exit(result);
}
}
static int processAndSave(JadxCLIArgs inputArgs) {
JadxArgs args = inputArgs.toJadxArgs();
JadxDecompiler jadx = new JadxDecompiler(args);
public static int execute(String[] args) {
return execute(args, null);
}
public static int execute(String[] args, @Nullable Consumer<JadxArgs> argsMod) {
try {
jadx.load();
JadxCLIArgs cliArgs = JadxCLIArgs.processArgs(args,
new JadxCLIArgs(),
new JadxConfigAdapter<>(JadxCLIArgs.class, "cli"));
if (cliArgs == null) {
return 0;
}
JadxArgs jadxArgs = buildArgs(cliArgs);
if (argsMod != null) {
argsMod.accept(jadxArgs);
}
return runSave(jadxArgs, cliArgs);
} catch (JadxArgsValidateException e) {
LOG.error("Incorrect arguments: {}", e.getMessage());
return 1;
} catch (Throwable e) {
LOG.error("Process error:", e);
return 1;
}
jadx.save();
int errorsCount = jadx.getErrorsCount();
if (errorsCount != 0) {
jadx.printErrorsReport();
LOG.error("finished with errors");
} else {
}
private static JadxArgs buildArgs(JadxCLIArgs cliArgs) {
JadxArgs jadxArgs = cliArgs.toJadxArgs();
jadxArgs.setCodeCache(new NoOpCodeCache());
jadxArgs.setUsageInfoCache(new EmptyUsageInfoCache());
jadxArgs.setPluginLoader(new JadxExternalPluginsLoader());
jadxArgs.setFilesGetter(JadxFilesGetter.INSTANCE);
initCodeWriterProvider(jadxArgs);
JadxAppCommon.applyEnvVars(jadxArgs);
return jadxArgs;
}
private static int runSave(JadxArgs jadxArgs, JadxCLIArgs cliArgs) {
try (JadxDecompiler jadx = new JadxDecompiler(jadxArgs)) {
jadx.load();
if (checkForErrors(jadx)) {
return 2;
}
writeCallGraph(jadx, cliArgs);
if (!SingleClassMode.process(jadx, cliArgs)) {
save(jadx);
}
int errorsCount = jadx.getErrorsCount();
if (errorsCount != 0) {
jadx.printErrorsReport();
LOG.error("finished with errors, count: {}", errorsCount);
return 3;
}
LOG.info("done");
return 0;
}
return errorsCount;
}
private static void initCodeWriterProvider(JadxArgs jadxArgs) {
switch (jadxArgs.getOutputFormat()) {
case JAVA:
jadxArgs.setCodeWriterProvider(SimpleCodeWriter::new);
break;
case JSON:
// needed for code offsets and source lines
jadxArgs.setCodeWriterProvider(AnnotatedCodeWriter::new);
break;
}
}
private static boolean checkForErrors(JadxDecompiler jadx) {
if (jadx.getRoot().getClasses().isEmpty()) {
if (jadx.getArgs().isSkipResources()) {
LOG.error("Load failed! No classes for decompile!");
return true;
}
if (!jadx.getArgs().isSkipSources()) {
LOG.warn("No classes to decompile; decoding resources only");
jadx.getArgs().setSkipSources(true);
}
}
int errorsCount = jadx.getErrorsCount();
if (errorsCount > 0) {
LOG.error("Loading finished with errors! Count: {}", errorsCount);
// continue processing
}
return false;
}
private static void save(JadxDecompiler jadx) {
if (LogHelper.getLogLevel() == LogLevelEnum.QUIET) {
jadx.save();
} else {
LOG.info("processing ...");
jadx.save(500, (done, total) -> {
int progress = (int) (done * 100.0 / total);
System.out.printf("INFO - progress: %d of %d (%d%%)\r", done, total, progress);
});
// dumb line clear :)
System.out.print(" \r");
}
}
private static void writeCallGraph(JadxDecompiler jadx, JadxCLIArgs cliArgs) {
JadxCLIArgs.CallGraphSaveMode mode = cliArgs.callGraphSaveMode;
if (mode == null || mode == JadxCLIArgs.CallGraphSaveMode.NONE) {
return;
}
Path outPath = jadx.getArgs().getOutDir().toPath();
ICallGraph callGraph = JadxCallGraph.builder(jadx)
.resolvedOnly(true)
.build();
Path cgPath;
switch (mode) {
case JSON:
cgPath = outPath.resolve("callgraph.json");
callGraph.writeJson(cgPath);
break;
case DOT:
cgPath = outPath.resolve("callgraph.dot");
callGraph.writeDot(cgPath);
break;
default:
throw new JadxRuntimeException("Unexpected call graph save mode: " + mode);
}
LOG.info("Call graph saved: {}", cgPath.toAbsolutePath());
}
}
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,37 @@
package jadx.cli;
import java.util.LinkedHashMap;
import java.util.Map;
import com.beust.jcommander.JCommander;
import jadx.cli.commands.CommandPlugins;
import jadx.cli.commands.ICommand;
import jadx.core.utils.exceptions.JadxArgsValidateException;
public class JadxCLICommands {
private static final Map<String, ICommand> COMMANDS_MAP = new LinkedHashMap<>();
static {
JadxCLICommands.register(new CommandPlugins());
}
public static void register(ICommand command) {
COMMANDS_MAP.put(command.name(), command);
}
public static void append(JCommander.Builder builder) {
COMMANDS_MAP.forEach(builder::addCommand);
}
public static boolean process(JCommanderWrapper jcw, JCommander jc, String parsedCommand) {
ICommand command = COMMANDS_MAP.get(parsedCommand);
if (command == null) {
throw new JadxArgsValidateException("Unknown command: " + parsedCommand
+ ". Expected one of: " + COMMANDS_MAP.keySet());
}
JCommander subCommander = jc.getCommands().get(parsedCommand);
command.process(jcw, subCommander);
return true;
}
}
@@ -0,0 +1,114 @@
package jadx.cli;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.slf4j.LoggerFactory;
import ch.qos.logback.classic.Level;
import ch.qos.logback.classic.Logger;
import jadx.api.JadxDecompiler;
public class LogHelper {
private static final org.slf4j.Logger LOG = LoggerFactory.getLogger(LogHelper.class);
public enum LogLevelEnum {
QUIET(Level.OFF),
PROGRESS(Level.OFF),
ERROR(Level.ERROR),
WARN(Level.WARN),
INFO(Level.INFO),
DEBUG(Level.DEBUG);
private final Level level;
LogLevelEnum(Level level) {
this.level = level;
}
public Level getLevel() {
return level;
}
}
@Nullable("For disable log level control")
private static LogLevelEnum logLevelValue;
public static void initLogLevel(JadxCLIArgs args) {
logLevelValue = getLogLevelFromArgs(args);
}
private static LogLevelEnum getLogLevelFromArgs(JadxCLIArgs args) {
if (isCustomLogConfig()) {
return null;
}
if (args.quiet) {
args.logLevel = LogLevelEnum.QUIET;
} else if (args.verbose) {
args.logLevel = LogLevelEnum.DEBUG;
}
return args.logLevel;
}
public static void setLogLevel(LogLevelEnum newLogLevel) {
logLevelValue = newLogLevel;
applyLogLevel(logLevelValue);
}
public static void applyLogLevels() {
if (logLevelValue == null) {
return;
}
applyLogLevel(logLevelValue);
if (logLevelValue == LogLevelEnum.PROGRESS) {
fixForShowProgress();
}
}
/**
* Show progress: change to 'INFO' for control classes
*/
private static void fixForShowProgress() {
setLevelForClass(JadxCLI.class, Level.INFO);
setLevelForClass(JadxDecompiler.class, Level.INFO);
setLevelForClass(SingleClassMode.class, Level.INFO);
// show warnings and errors from input plugins
setLevelForPackage("jadx.plugins.input", Level.WARN);
}
private static void applyLogLevel(@NotNull LogLevelEnum logLevel) {
Logger rootLogger = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
rootLogger.setLevel(logLevel.getLevel());
}
@Nullable
public static LogLevelEnum getLogLevel() {
return logLevelValue;
}
public static void setLevelForClass(Class<?> cls, Level level) {
((Logger) LoggerFactory.getLogger(cls)).setLevel(level);
}
public static void setLevelForPackage(String pkgName, Level level) {
((Logger) LoggerFactory.getLogger(pkgName)).setLevel(level);
}
/**
* Try to detect if user provide custom logback config via -Dlogback.configurationFile=
*/
private static boolean isCustomLogConfig() {
try {
String logbackConfig = System.getProperty("logback.configurationFile");
if (logbackConfig == null) {
return false;
}
LOG.debug("Use custom log config: {}", logbackConfig);
return true;
} catch (Exception e) {
LOG.error("Failed to detect custom log config", e);
}
return false;
}
}
@@ -0,0 +1,88 @@
package jadx.cli;
import java.io.File;
import java.util.List;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jadx.api.ICodeInfo;
import jadx.api.JadxDecompiler;
import jadx.core.dex.attributes.AFlag;
import jadx.core.dex.nodes.ClassNode;
import jadx.core.dex.visitors.SaveCode;
import jadx.core.utils.exceptions.JadxArgsValidateException;
import jadx.core.utils.exceptions.JadxRuntimeException;
import jadx.core.utils.files.FileUtils;
public class SingleClassMode {
private static final Logger LOG = LoggerFactory.getLogger(SingleClassMode.class);
public static boolean process(JadxDecompiler jadx, JadxCLIArgs cliArgs) {
String singleClass = cliArgs.getSingleClass();
String singleClassOutput = cliArgs.getSingleClassOutput();
if (singleClass == null && singleClassOutput == null) {
return false;
}
ClassNode clsForProcess;
if (singleClass != null) {
clsForProcess = jadx.getRoot().resolveClass(singleClass);
if (clsForProcess == null) {
clsForProcess = jadx.getRoot().getClasses().stream()
.filter(cls -> cls.getClassInfo().getAliasFullName().equals(singleClass))
.findFirst().orElse(null);
}
if (clsForProcess == null) {
throw new JadxArgsValidateException("Input class not found: " + singleClass);
}
if (clsForProcess.contains(AFlag.DONT_GENERATE)) {
throw new JadxArgsValidateException("Input class can't be saved by current jadx settings (marked as DONT_GENERATE)");
}
if (clsForProcess.isInner()) {
clsForProcess = clsForProcess.getTopParentClass();
LOG.warn("Input class is inner, parent class will be saved: {}", clsForProcess.getFullName());
}
} else {
// singleClassOutput is set
// expect only one class to be loaded
List<ClassNode> classes = jadx.getRoot().getClasses().stream()
.filter(c -> !c.isInner() && !c.contains(AFlag.DONT_GENERATE))
.collect(Collectors.toList());
int size = classes.size();
if (size == 1) {
clsForProcess = classes.get(0);
} else {
throw new JadxArgsValidateException("Found " + size + " classes, single class output can't be used");
}
}
ICodeInfo codeInfo;
try {
codeInfo = clsForProcess.decompile();
} catch (Exception e) {
throw new JadxRuntimeException("Class decompilation failed", e);
}
String fileExt = SaveCode.getFileExtension(jadx.getRoot());
File out;
if (singleClassOutput == null) {
out = new File(jadx.getArgs().getOutDirSrc(), clsForProcess.getClassInfo().getAliasFullPath() + fileExt);
} else {
if (singleClassOutput.endsWith(fileExt)) {
// treat as file name
out = new File(singleClassOutput);
} else {
// treat as directory
out = new File(singleClassOutput, clsForProcess.getShortName() + fileExt);
}
}
File resultOut = FileUtils.prepareFile(out);
if (clsForProcess.getClassInfo().hasAlias()) {
LOG.info("Saving class '{}' (alias: '{}') to file '{}'",
clsForProcess.getClassInfo().getFullName(), clsForProcess.getFullName(), resultOut.getAbsolutePath());
} else {
LOG.info("Saving class '{}' to file '{}'", clsForProcess.getFullName(), resultOut.getAbsolutePath());
}
SaveCode.save(codeInfo.getCodeStr(), resultOut);
return true;
}
}
@@ -0,0 +1,73 @@
package jadx.cli.clst;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.EnumSet;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jadx.api.JadxArgs;
import jadx.api.JadxDecompiler;
import jadx.api.args.UseSourceNameAsClassNameAlias;
import jadx.core.clsp.ClsSet;
import jadx.core.dex.nodes.RootNode;
import jadx.core.utils.files.FileUtils;
/**
* Utility class for convert dex or jar to jadx classes set (.jcst)
*/
public class ConvertToClsSet {
private static final Logger LOG = LoggerFactory.getLogger(ConvertToClsSet.class);
public static void usage() {
LOG.info("<android API level (number)> <output .jcst file> <several input dex or jar files> ");
LOG.info("Arguments to update core.jcst: "
+ "<android API level (number)> "
+ "<jadx root>/jadx-core/src/main/resources/clst/core.jcst "
+ "<sdk_root>/platforms/android-<api level>/android.jar"
+ "<sdk_root>/platforms/android-<api level>/optional/android.car.jar "
+ "<sdk_root>/platforms/android-<api level>/optional/org.apache.http.legacy.jar");
}
public static void main(String[] args) {
if (args.length != 5) {
usage();
System.exit(1);
}
int androidApiLevel = Integer.parseInt(args[0]);
List<Path> inputPaths = Stream.of(args).skip(1).map(Paths::get).collect(Collectors.toList());
Path output = inputPaths.remove(0);
JadxArgs jadxArgs = new JadxArgs();
jadxArgs.setInputFiles(FileUtils.toFiles(inputPaths));
// disable not needed passes executed at prepare stage
jadxArgs.setDeobfuscationOn(false);
jadxArgs.setRenameFlags(EnumSet.noneOf(JadxArgs.RenameEnum.class));
jadxArgs.setUseSourceNameAsClassNameAlias(UseSourceNameAsClassNameAlias.NEVER);
jadxArgs.setMoveInnerClasses(false);
jadxArgs.setInlineAnonymousClasses(false);
jadxArgs.setInlineMethods(false);
// don't require/load class set file
jadxArgs.setLoadJadxClsSetFile(false);
try (JadxDecompiler decompiler = new JadxDecompiler(jadxArgs)) {
decompiler.load();
RootNode root = decompiler.getRoot();
ClsSet set = new ClsSet(root);
set.setAndroidApiLevel(androidApiLevel);
set.loadFrom(root);
set.save(output);
LOG.info("Output: {}", output);
LOG.info("done");
} catch (Exception e) {
LOG.error("Failed with error", e);
}
}
}
@@ -0,0 +1,218 @@
package jadx.cli.commands;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import com.beust.jcommander.JCommander;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;
import jadx.api.plugins.JadxPluginInfo;
import jadx.cli.JCommanderWrapper;
import jadx.cli.LogHelper;
import jadx.core.utils.StringUtils;
import jadx.plugins.tools.JadxPluginsList;
import jadx.plugins.tools.JadxPluginsTools;
import jadx.plugins.tools.data.JadxPluginListEntry;
import jadx.plugins.tools.data.JadxPluginMetadata;
import jadx.plugins.tools.data.JadxPluginUpdate;
@Parameters(commandDescription = "manage jadx plugins")
public class CommandPlugins implements ICommand {
@Parameter(names = { "-i", "--install" }, description = "install plugin with locationId", defaultValueDescription = "<locationId>")
protected String install;
@Parameter(names = { "-j", "--install-jar" }, description = "install plugin from jar file", defaultValueDescription = "<path-to.jar>")
protected String installJar;
@Parameter(names = { "-l", "--list" }, description = "list installed plugins")
protected boolean list;
@Parameter(names = { "-a", "--available" }, description = "list available plugins from jadx-plugins-list (aka marketplace)")
protected boolean available;
@Parameter(names = { "-u", "--update" }, description = "update installed plugins")
protected boolean update;
@Parameter(names = { "--uninstall" }, description = "uninstall plugin with pluginId", defaultValueDescription = "<pluginId>")
protected String uninstall;
@Parameter(names = { "--disable" }, description = "disable plugin with pluginId", defaultValueDescription = "<pluginId>")
protected String disable;
@Parameter(names = { "--enable" }, description = "enable plugin with pluginId", defaultValueDescription = "<pluginId>")
protected String enable;
@Parameter(names = { "--list-all" }, description = "list all plugins including bundled and dropins")
protected boolean listAll;
@Parameter(
names = { "--list-versions" },
description = "fetch latest versions of plugin from locationId (will download all artefacts, limited to 10)",
defaultValueDescription = "<locationId>"
)
protected String listVersions;
@Parameter(names = { "-h", "--help" }, description = "print this help", help = true)
protected boolean printHelp = false;
@Override
public String name() {
return "plugins";
}
@SuppressWarnings("UnnecessaryReturnStatement")
@Override
public void process(JCommanderWrapper jcw, JCommander subCommander) {
if (printHelp) {
jcw.printUsage(subCommander);
return;
}
Set<String> unknownOptions = new HashSet<>(subCommander.getUnknownOptions());
boolean verbose = unknownOptions.remove("-v") || unknownOptions.remove("--verbose");
LogHelper.setLogLevel(verbose ? LogHelper.LogLevelEnum.DEBUG : LogHelper.LogLevelEnum.INFO);
if (!unknownOptions.isEmpty()) {
System.out.println("Error: found unknown options: " + unknownOptions);
}
if (install != null) {
installPlugin(install);
return;
}
if (installJar != null) {
installPlugin("file:" + installJar);
return;
}
if (uninstall != null) {
boolean uninstalled = JadxPluginsTools.getInstance().uninstall(uninstall);
System.out.println(uninstalled ? "Uninstalled" : "Plugin not found");
return;
}
if (update) {
List<JadxPluginUpdate> updates = JadxPluginsTools.getInstance().updateAll();
if (updates.isEmpty()) {
System.out.println("No updates");
} else {
System.out.println("Installed updates: " + updates.size());
for (JadxPluginUpdate update : updates) {
System.out.println(" " + update.getPluginId() + ": " + update.getOldVersion() + " -> " + update.getNewVersion());
}
}
return;
}
if (list) {
printPlugins(JadxPluginsTools.getInstance().getInstalled());
return;
}
if (listAll) {
printAllPlugins();
return;
}
if (listVersions != null) {
printVersions(listVersions, 10);
return;
}
if (available) {
List<JadxPluginListEntry> availableList = JadxPluginsList.getInstance().get();
System.out.println("Available plugins: " + availableList.size());
for (JadxPluginListEntry plugin : availableList) {
System.out.println(" - " + plugin.getName() + ": " + plugin.getDescription()
+ " (" + plugin.getLocationId() + ")");
}
return;
}
if (disable != null) {
if (JadxPluginsTools.getInstance().changeDisabledStatus(disable, true)) {
System.out.println("Plugin '" + disable + "' disabled.");
} else {
System.out.println("Plugin '" + disable + "' already disabled.");
}
return;
}
if (enable != null) {
if (JadxPluginsTools.getInstance().changeDisabledStatus(enable, false)) {
System.out.println("Plugin '" + enable + "' enabled.");
} else {
System.out.println("Plugin '" + enable + "' already enabled.");
}
return;
}
}
private static void printPlugins(List<JadxPluginMetadata> installed) {
System.out.println("Installed plugins: " + installed.size());
for (JadxPluginMetadata plugin : installed) {
StringBuilder sb = new StringBuilder();
sb.append(" - ").append(plugin.getPluginId());
String version = plugin.getVersion();
if (version != null) {
sb.append(" (").append(version).append(')');
}
if (plugin.isDisabled()) {
sb.append(" (disabled)");
}
sb.append(" - ").append(plugin.getName());
sb.append(": ").append(formatDescription(plugin.getDescription()));
System.out.println(sb);
}
}
private void printVersions(String locationId, int limit) {
System.out.println("Loading ...");
List<JadxPluginMetadata> versions = JadxPluginsTools.getInstance().getVersionsByLocation(locationId, 1, limit);
if (versions.isEmpty()) {
System.out.println("No versions found");
return;
}
JadxPluginMetadata plugin = versions.get(0);
System.out.println("Versions for plugin id: " + plugin.getPluginId());
for (JadxPluginMetadata version : versions) {
StringBuilder sb = new StringBuilder();
sb.append(" - ").append(version.getVersion());
String reqVer = version.getRequiredJadxVersion();
if (StringUtils.notBlank(reqVer)) {
sb.append(", require jadx: ").append(reqVer);
}
System.out.println(sb);
}
}
private static void printAllPlugins() {
List<JadxPluginMetadata> installed = JadxPluginsTools.getInstance().getInstalled();
printPlugins(installed);
Set<String> installedSet = installed.stream().map(JadxPluginMetadata::getPluginId).collect(Collectors.toSet());
List<JadxPluginInfo> plugins = JadxPluginsTools.getInstance().getAllPluginsInfo();
System.out.println("Other plugins: " + plugins.size());
for (JadxPluginInfo plugin : plugins) {
if (!installedSet.contains(plugin.getPluginId())) {
System.out.println(" - " + plugin.getPluginId()
+ " - " + plugin.getName()
+ ": " + formatDescription(plugin.getDescription()));
}
}
}
private static String formatDescription(String desc) {
if (desc.contains("\n")) {
// remove new lines
desc = desc.replaceAll("\\R+", " ");
}
int maxLen = 512;
if (desc.length() > maxLen) {
// truncate very long descriptions
desc = desc.substring(0, maxLen) + " ...";
}
return desc;
}
private void installPlugin(String locationId) {
JadxPluginMetadata plugin = JadxPluginsTools.getInstance().install(locationId);
System.out.println("Plugin installed: " + plugin.getPluginId() + ":" + plugin.getVersion());
}
}
@@ -0,0 +1,11 @@
package jadx.cli.commands;
import com.beust.jcommander.JCommander;
import jadx.cli.JCommanderWrapper;
public interface ICommand {
String name();
void process(JCommanderWrapper jcw, JCommander subCommander);
}
@@ -0,0 +1,7 @@
package jadx.cli.config;
/**
* Marker interface for jadx config objects
*/
public interface IJadxConfig {
}
@@ -0,0 +1,109 @@
package jadx.cli.config;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.function.Consumer;
import org.jetbrains.annotations.Nullable;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.stream.JsonReader;
import jadx.commons.app.JadxCommonFiles;
import jadx.core.utils.GsonUtils;
import jadx.core.utils.exceptions.JadxArgsValidateException;
import jadx.core.utils.exceptions.JadxRuntimeException;
public class JadxConfigAdapter<T extends IJadxConfig> {
private static final ExclusionStrategy GSON_EXCLUSION_STRATEGY = new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return f.getAnnotation(JadxConfigExclude.class) != null;
}
@Override
public boolean shouldSkipClass(Class<?> clazz) {
return false;
}
};
private final Class<T> configCls;
private final String defaultConfigFileName;
private final Gson gson;
private Path configPath;
public JadxConfigAdapter(Class<T> configCls, String defaultConfigName) {
this(configCls, defaultConfigName, gsonBuilder -> {
});
}
public JadxConfigAdapter(Class<T> configCls, String defaultConfigName, Consumer<GsonBuilder> applyGsonOptions) {
this.configCls = configCls;
this.defaultConfigFileName = defaultConfigName + ".json";
GsonBuilder gsonBuilder = GsonUtils.defaultGsonBuilder();
gsonBuilder.setExclusionStrategies(GSON_EXCLUSION_STRATEGY);
applyGsonOptions.accept(gsonBuilder);
this.gson = gsonBuilder.create();
}
public void useConfigRef(String configRef) {
this.configPath = resolveConfigRef(configRef);
}
public Path getConfigPath() {
return configPath;
}
public String getDefaultConfigFileName() {
return defaultConfigFileName;
}
public @Nullable T load() {
if (!Files.isRegularFile(configPath)) {
// file not found
return null;
}
try (JsonReader reader = gson.newJsonReader(Files.newBufferedReader(configPath))) {
return gson.fromJson(reader, configCls);
} catch (Exception e) {
throw new JadxRuntimeException("Failed to load config file: " + configPath, e);
}
}
public void save(T configObject) {
try {
String jsonStr = gson.toJson(configObject, configCls);
// don't use stream writer here because serialization errors will corrupt config
Files.writeString(configPath, jsonStr);
} catch (Exception e) {
throw new JadxRuntimeException("Failed to save config file: " + configPath, e);
}
}
public String objectToJsonString(T configObject) {
return gson.toJson(configObject, configCls);
}
public T jsonStringToObject(String jsonStr) {
return gson.fromJson(jsonStr, configCls);
}
private Path resolveConfigRef(String configRef) {
if (configRef == null || configRef.isEmpty()) {
// use default config file
return JadxCommonFiles.getConfigDir().resolve(defaultConfigFileName);
}
if (configRef.contains("/") || configRef.contains("\\")) {
if (!configRef.toLowerCase().endsWith(".json")) {
throw new JadxArgsValidateException("Config file extension should be '.json'");
}
return Path.of(configRef);
}
// treat as a short name
return JadxCommonFiles.getConfigDir().resolve(configRef + ".json");
}
}
@@ -0,0 +1,11 @@
package jadx.cli.config;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface JadxConfigExclude {
}
@@ -0,0 +1,31 @@
package jadx.cli.plugins;
import java.nio.file.Path;
import jadx.commons.app.JadxCommonFiles;
import jadx.commons.app.JadxTempFiles;
import jadx.core.plugins.files.IJadxFilesGetter;
public class JadxFilesGetter implements IJadxFilesGetter {
public static final JadxFilesGetter INSTANCE = new JadxFilesGetter();
@Override
public Path getConfigDir() {
return JadxCommonFiles.getConfigDir();
}
@Override
public Path getCacheDir() {
return JadxCommonFiles.getCacheDir();
}
@Override
public Path getTempDir() {
return JadxTempFiles.getTempRootDir();
}
private JadxFilesGetter() {
// singleton
}
}
@@ -0,0 +1,111 @@
package jadx.cli.tools;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jadx.api.JadxArgs;
import jadx.core.dex.nodes.RootNode;
import jadx.core.utils.android.TextResMapFile;
import jadx.core.xmlgen.ResTableBinaryParser;
import jadx.zip.IZipEntry;
import jadx.zip.ZipContent;
import jadx.zip.ZipReader;
import static jadx.core.utils.files.FileUtils.expandDirs;
/**
* Utility class for convert '.arsc' to simple text file with mapping id to resource name
*/
public class ConvertArscFile {
private static final Logger LOG = LoggerFactory.getLogger(ConvertArscFile.class);
private static int rewritesCount;
public static void usage() {
LOG.info("<res-map file> <input .arsc/android.jar files or dir>");
LOG.info("");
LOG.info("Note: If res-map already exists - it will be merged and updated");
}
public static void main(String[] args) throws IOException {
if (args.length < 2) {
usage();
System.exit(1);
}
List<Path> inputPaths = Stream.of(args).map(Paths::get).collect(Collectors.toList());
Path resMapFile = inputPaths.remove(0);
List<Path> inputResFiles = filterAndSort(expandDirs(inputPaths));
Map<Integer, String> resMap;
if (Files.isReadable(resMapFile)) {
resMap = TextResMapFile.read(resMapFile);
} else {
resMap = new HashMap<>();
}
LOG.info("Input entries count: {}", resMap.size());
RootNode root = new RootNode(new JadxArgs()); // not really needed
ZipReader zipReader = new ZipReader();
rewritesCount = 0;
for (Path resFile : inputResFiles) {
ResTableBinaryParser resTableParser = new ResTableBinaryParser(root, true);
if (resFile.getFileName().toString().endsWith(".jar")) {
// Load resources.arsc from android.jar
try (ZipContent zip = zipReader.open(resFile.toFile())) {
IZipEntry entry = zip.searchEntry("resources.arsc");
if (entry == null) {
LOG.error("Failed to load \"resources.arsc\" from {}", resFile);
continue;
}
try (InputStream inputStream = entry.getInputStream()) {
resTableParser.decode(inputStream);
}
}
} else {
// Load resources.arsc from extracted file
try (InputStream inputStream = Files.newInputStream(resFile)) {
resTableParser.decode(inputStream);
}
}
Map<Integer, String> singleResMap = resTableParser.getResStorage().getResourcesNames();
mergeResMaps(resMap, singleResMap);
LOG.info("{} entries count: {}, after merge: {}", resFile.getFileName(), singleResMap.size(), resMap.size());
}
LOG.info("Output entries count: {}", resMap.size());
LOG.info("Total rewrites count: {}", rewritesCount);
TextResMapFile.write(resMapFile, resMap);
LOG.info("Result file size: {} B", resMapFile.toFile().length());
LOG.info("done");
}
private static List<Path> filterAndSort(List<Path> inputPaths) {
return inputPaths.stream()
.filter(p -> {
String fileName = p.getFileName().toString();
return fileName.endsWith(".arsc") || fileName.endsWith(".jar");
})
.sorted()
.collect(Collectors.toList());
}
private static void mergeResMaps(Map<Integer, String> mainResMap, Map<Integer, String> newResMap) {
for (Map.Entry<Integer, String> entry : newResMap.entrySet()) {
Integer id = entry.getKey();
String name = entry.getValue();
String prevName = mainResMap.put(id, name);
if (prevName != null && !name.equals(prevName)) {
LOG.debug("Rewrite id: {} from: '{}' to: '{}'", Integer.toHexString(id), prevName, name);
rewritesCount++;
}
}
}
}
+7 -4
View File
@@ -1,14 +1,17 @@
<!-- Jadx logger config. Used both in cli and gui -->
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>INFO</level>
</filter>
<encoder>
<pattern>%-5level - %msg%n</pattern>
</encoder>
</appender>
<root level="DEBUG">
<!-- jadx-gui -->
<logger name="com.pinterest.ktlint" level="INFO"/>
<logger name="guru.nidi.graphviz" level="WARN"/>
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>
</configuration>
@@ -0,0 +1,139 @@
package jadx.cli;
import java.io.IOException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.io.TempDir;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import jadx.api.plugins.loader.JadxBasePluginLoader;
import jadx.core.plugins.files.SingleDirFilesGetter;
import jadx.core.utils.Utils;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
public class BaseCliIntegrationTest {
private static final Logger LOG = LoggerFactory.getLogger(BaseCliIntegrationTest.class);
static final PathMatcher LOG_ALL_FILES = path -> {
LOG.debug("File in result dir: {}", path);
return true;
};
@TempDir
Path testDir;
Path outputDir;
@BeforeEach
public void setUp() {
outputDir = testDir.resolve("output");
}
int execJadxCli(String sampleName, String... options) {
return execJadxCli(buildArgs(List.of(options), sampleName));
}
int execJadxCli(String[] args) {
return JadxCLI.execute(args, jadxArgs -> {
// don't use global config and plugins
jadxArgs.setFilesGetter(new SingleDirFilesGetter(testDir));
jadxArgs.setPluginLoader(new JadxBasePluginLoader());
});
}
String[] buildArgs(List<String> options, String... inputSamples) {
List<String> args = new ArrayList<>(options);
args.add("-v");
args.add("-d");
args.add(outputDir.toAbsolutePath().toString());
for (String inputSample : inputSamples) {
try {
URL resource = getClass().getClassLoader().getResource(inputSample);
assertThat(resource).isNotNull();
String sampleFile = resource.toURI().getRawPath();
args.add(sampleFile);
} catch (URISyntaxException e) {
fail("Failed to load sample: " + inputSample, e);
}
}
return args.toArray(new String[0]);
}
void decompile(String... inputSamples) throws IOException {
int result = execJadxCli(buildArgs(List.of(), inputSamples));
assertThat(result).isEqualTo(0);
List<Path> resultJavaFiles = collectJavaFilesInDir(outputDir);
assertThat(resultJavaFiles).isNotEmpty();
// do not copy input files as resources
for (Path path : collectFilesInDir(outputDir, LOG_ALL_FILES)) {
for (String inputSample : inputSamples) {
assertThat(path.toAbsolutePath().toString()).doesNotContain(inputSample);
}
}
}
static void printFiles(List<Path> files) {
LOG.info("Output files (count: {}):", files.size());
for (Path file : files) {
LOG.info(" {}", file);
}
LOG.info("");
}
String pathToUniformString(Path path) {
return path.toString().replace('\\', '/');
}
Path printFileContent(Path file) {
try {
String content = Files.readString(outputDir.resolve(file));
String spacer = Utils.strRepeat("=", 70);
LOG.info("File content: {}\n{}\n{}\n{}", file, spacer, content, spacer);
return file;
} catch (IOException e) {
throw new RuntimeException("Failed to load file: " + file, e);
}
}
static List<Path> collectJavaFilesInDir(Path dir) throws IOException {
PathMatcher javaMatcher = dir.getFileSystem().getPathMatcher("glob:**.java");
return collectFilesInDir(dir, javaMatcher);
}
static List<Path> collectAllFilesInDir(Path dir) throws IOException {
try (Stream<Path> pathStream = Files.walk(dir)) {
List<Path> files = pathStream
.filter(Files::isRegularFile)
.map(dir::relativize)
.collect(Collectors.toList());
printFiles(files);
return files;
}
}
static List<Path> collectFilesInDir(Path dir, PathMatcher matcher) throws IOException {
try (Stream<Path> pathStream = Files.walk(dir)) {
List<Path> files = pathStream
.filter(p -> Files.isRegularFile(p, LinkOption.NOFOLLOW_LINKS))
.filter(matcher::matches)
.collect(Collectors.toList());
printFiles(files);
return files;
}
}
}
@@ -1,11 +1,14 @@
package jadx.cli;
import java.util.Collections;
import java.util.Map;
import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static jadx.core.utils.Utils.newConstStringMap;
import static org.assertj.core.api.Assertions.assertThat;
public class JadxCLIArgsTest {
@@ -13,38 +16,72 @@ public class JadxCLIArgsTest {
@Test
public void testInvertedBooleanOption() {
assertThat(parse("--no-replace-consts").isReplaceConsts(), is(false));
assertThat(parse("").isReplaceConsts(), is(true));
assertThat(parse("--no-replace-consts").isReplaceConsts()).isFalse();
assertThat(parse("").isReplaceConsts()).isTrue();
}
@Test
public void testEscapeUnicodeOption() {
assertThat(parse("--escape-unicode").isEscapeUnicode(), is(true));
assertThat(parse("").isEscapeUnicode(), is(false));
assertThat(parse("--escape-unicode").isEscapeUnicode()).isTrue();
assertThat(parse("").isEscapeUnicode()).isFalse();
}
@Test
public void testSrcOption() {
assertThat(parse("--no-src").isSkipSources(), is(true));
assertThat(parse("-s").isSkipSources(), is(true));
assertThat(parse("").isSkipSources(), is(false));
assertThat(parse("--no-src").isSkipSources()).isTrue();
assertThat(parse("-s").isSkipSources()).isTrue();
assertThat(parse("").isSkipSources()).isFalse();
}
@Test
public void testOptionsOverride() {
assertThat(override(new JadxCLIArgs(), "--no-imports").isUseImports(), is(false));
assertThat(override(new JadxCLIArgs(), "--no-debug-info").isDebugInfo(), is(false));
assertThat(override(new JadxCLIArgs(), "").isUseImports(), is(true));
assertThat(override(new JadxCLIArgs(), "--no-imports").isUseImports()).isFalse();
assertThat(override(new JadxCLIArgs(), "--no-debug-info").isDebugInfo()).isFalse();
assertThat(override(new JadxCLIArgs(), "").isUseImports()).isTrue();
JadxCLIArgs args = new JadxCLIArgs();
args.useImports = false;
assertThat(override(args, "--no-imports").isUseImports(), is(false));
assertThat(override(args, "--no-imports").isUseImports()).isFalse();
args.debugInfo = false;
assertThat(override(args, "--no-debug-info").isDebugInfo(), is(false));
assertThat(override(args, "--no-debug-info").isDebugInfo()).isFalse();
args = new JadxCLIArgs();
args.useImports = false;
assertThat(override(args, "").isUseImports(), is(false));
assertThat(override(args, "").isUseImports()).isFalse();
}
@Test
public void testPluginOptionsOverride() {
// add key to empty base map
checkPluginOptionsMerge(
Collections.emptyMap(),
"-Poption=otherValue",
newConstStringMap("option", "otherValue"));
// override one key
checkPluginOptionsMerge(
newConstStringMap("option", "value"),
"-Poption=otherValue",
newConstStringMap("option", "otherValue"));
// merge different keys
checkPluginOptionsMerge(
Collections.singletonMap("option1", "value1"),
"-Poption2=otherValue2",
newConstStringMap("option1", "value1", "option2", "otherValue2"));
// merge and override
checkPluginOptionsMerge(
newConstStringMap("option1", "value1", "option2", "value2"),
"-Poption2=otherValue2",
newConstStringMap("option1", "value1", "option2", "otherValue2"));
}
private void checkPluginOptionsMerge(Map<String, String> baseMap, String providedArgs, Map<String, String> expectedMap) {
JadxCLIArgs args = new JadxCLIArgs();
args.pluginOptions = baseMap;
Map<String, String> resultMap = override(args, providedArgs).getPluginOptions();
assertThat(resultMap).isEqualTo(expectedMap);
}
private JadxCLIArgs parse(String... args) {
@@ -52,15 +89,24 @@ public class JadxCLIArgsTest {
}
private JadxCLIArgs parse(JadxCLIArgs jadxArgs, String... args) {
boolean res = jadxArgs.processArgs(args);
assertThat(res, is(true));
LOG.info("Jadx args: {}", jadxArgs.toJadxArgs());
return jadxArgs;
return check(jadxArgs, jadxArgs.processArgs(args));
}
private JadxCLIArgs override(JadxCLIArgs jadxArgs, String... args) {
boolean res = jadxArgs.overrideProvided(args);
assertThat(res, is(true));
return check(jadxArgs, overrideProvided(jadxArgs, args));
}
private static boolean overrideProvided(JadxCLIArgs jadxArgs, String[] args) {
JCommanderWrapper jcw = new JCommanderWrapper(new JadxCLIArgs());
if (!jcw.parse(args)) {
return false;
}
jcw.overrideProvided(jadxArgs);
return jadxArgs.process(jcw);
}
private static JadxCLIArgs check(JadxCLIArgs jadxArgs, boolean res) {
assertThat(res).isTrue();
LOG.info("Jadx args: {}", jadxArgs.toJadxArgs());
return jadxArgs;
}
@@ -7,10 +7,10 @@ import org.junit.jupiter.api.Test;
import jadx.api.JadxArgs.RenameEnum;
import jadx.cli.JadxCLIArgs.RenameConverter;
import jadx.core.utils.exceptions.JadxArgsValidateException;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
public class RenameConverterTest {
@@ -24,26 +24,24 @@ public class RenameConverterTest {
@Test
public void all() {
Set<RenameEnum> set = converter.convert("all");
assertEquals(3, set.size());
assertTrue(set.contains(RenameEnum.CASE));
assertTrue(set.contains(RenameEnum.VALID));
assertTrue(set.contains(RenameEnum.PRINTABLE));
assertThat(set).hasSize(3);
assertThat(set).contains(RenameEnum.CASE);
assertThat(set).contains(RenameEnum.VALID);
assertThat(set).contains(RenameEnum.PRINTABLE);
}
@Test
public void none() {
Set<RenameEnum> set = converter.convert("none");
assertTrue(set.isEmpty());
assertThat(set).isEmpty();
}
@Test
public void wrong() {
IllegalArgumentException thrown = assertThrows(IllegalArgumentException.class,
JadxArgsValidateException thrown = assertThrows(JadxArgsValidateException.class,
() -> converter.convert("wrong"),
"Expected convert() to throw, but it didn't");
assertEquals("'wrong' is unknown for parameter someParam, "
+ "possible values are 'case', 'valid', 'printable'",
thrown.getMessage());
assertThat(thrown.getMessage()).isEqualTo("'wrong' is unknown for parameter someParam, possible values are case, valid, printable");
}
}
@@ -0,0 +1,77 @@
package jadx.cli;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class TestExport extends BaseCliIntegrationTest {
@Test
public void testBasicExport() throws Exception {
int result = execJadxCli("samples/small.apk");
assertThat(result).isEqualTo(0);
assertThat(collectAllFilesInDir(outputDir))
.map(this::pathToUniformString)
.haveExactly(2, new Condition<>(f -> f.startsWith("sources/") && f.endsWith(".java"), "sources"))
.haveExactly(10, new Condition<>(f -> f.startsWith("resources/"), "resources"))
.haveExactly(1, new Condition<>(f -> f.equals("resources/AndroidManifest.xml"), "manifest"))
.hasSize(12);
}
@Test
public void testGradleExportApk() throws Exception {
int result = execJadxCli("samples/small.apk", "--export-gradle");
assertThat(result).isEqualTo(0);
assertThat(collectAllFilesInDir(outputDir))
.describedAs("check output files")
.map(this::pathToUniformString)
.haveExactly(2, new Condition<>(f -> f.endsWith(".java"), "java classes"))
.haveExactly(0, new Condition<>(f -> f.endsWith("classes.dex"), "dex files"))
.hasSize(15);
}
@Test
public void testGradleExportAAR() throws Exception {
int result = execJadxCli("samples/test-lib.aar", "--export-gradle");
assertThat(result).isEqualTo(0);
assertThat(collectAllFilesInDir(outputDir))
.describedAs("check output files")
.map(this::printFileContent)
.map(this::pathToUniformString)
.haveExactly(1, new Condition<>(f -> f.startsWith("lib/src/main/java/") && f.endsWith(".java"), "java"))
.haveExactly(0, new Condition<>(f -> f.endsWith(".jar"), "jar files"))
.hasSize(8);
}
@Test
public void testGradleExportSimpleJava() throws Exception {
int result = execJadxCli("samples/HelloWorld.class", "--export-gradle");
assertThat(result).isEqualTo(0);
assertThat(collectAllFilesInDir(outputDir))
.describedAs("check output files")
.map(this::printFileContent)
.map(this::pathToUniformString)
.haveExactly(1, new Condition<>(f -> f.endsWith(".java") && f.startsWith("app/src/main/java/"), "java"))
.haveExactly(0, new Condition<>(f -> f.endsWith(".class"), "class files"))
.haveExactly(1, new Condition<>(f -> f.equals("settings.gradle.kts"), "settings"))
.haveExactly(1, new Condition<>(f -> f.equals("app/build.gradle.kts"), "build"))
.hasSize(3);
}
@Test
public void testGradleExportInvalidType() throws Exception {
int result = execJadxCli("samples/HelloWorld.class", "--export-gradle-type", "android-app");
assertThat(result).isEqualTo(0);
// expect output in 'android-app' template, but most fields will be set to UNKNOWN.
assertThat(collectAllFilesInDir(outputDir))
.describedAs("check output files")
.map(this::printFileContent)
.map(this::pathToUniformString)
.haveExactly(1, new Condition<>(f -> f.endsWith(".java") && f.startsWith("app/src/main/java/"), "java"))
.haveExactly(1, new Condition<>(f -> f.equals("settings.gradle"), "settings"))
.haveExactly(1, new Condition<>(f -> f.equals("build.gradle"), "build"))
.haveExactly(1, new Condition<>(f -> f.equals("app/build.gradle"), "app build"))
.hasSize(4);
}
}
@@ -0,0 +1,84 @@
package jadx.cli;
import java.nio.file.Path;
import java.util.List;
import org.assertj.core.api.Condition;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.assertThat;
public class TestInput extends BaseCliIntegrationTest {
@Test
public void testHelp() {
int result = execJadxCli(new String[] { "--help" });
assertThat(result).isEqualTo(0);
}
@Test
public void testApkInput() throws Exception {
int result = execJadxCli(buildArgs(List.of(), "samples/small.apk"));
assertThat(result).isEqualTo(0);
assertThat(collectAllFilesInDir(outputDir))
.describedAs("check output files")
.map(p -> p.getFileName().toString())
.haveExactly(2, new Condition<>(f -> f.endsWith(".java"), "java classes"))
.haveExactly(9, new Condition<>(f -> f.endsWith(".xml"), "xml resources"))
.haveExactly(1, new Condition<>(f -> f.equals("AndroidManifest.xml"), "manifest"))
.hasSize(12);
}
@Test
public void testDexInput() throws Exception {
decompile("samples/hello.dex");
}
@Test
public void testSmaliInput() throws Exception {
decompile("samples/HelloWorld.smali");
}
@Test
public void testClassInput() throws Exception {
decompile("samples/HelloWorld.class");
}
@Test
public void testMultipleInput() throws Exception {
decompile("samples/hello.dex", "samples/HelloWorld.smali");
}
@Test
public void testFallbackMode() throws Exception {
int result = execJadxCli(buildArgs(List.of("-f"), "samples/hello.dex"));
assertThat(result).isEqualTo(0);
List<Path> files = collectJavaFilesInDir(outputDir);
assertThat(files).hasSize(1);
}
@Test
public void testSimpleMode() throws Exception {
int result = execJadxCli(buildArgs(List.of("--decompilation-mode", "simple"), "samples/hello.dex"));
assertThat(result).isEqualTo(0);
List<Path> files = collectJavaFilesInDir(outputDir);
assertThat(files).hasSize(1);
}
@Test
public void testResourceOnly() throws Exception {
int result = execJadxCli(buildArgs(List.of(), "samples/resources-only.apk"));
assertThat(result).isEqualTo(0);
List<Path> files = collectFilesInDir(outputDir,
path -> path.getFileName().toString().equalsIgnoreCase("AndroidManifest.xml"));
assertThat(files).isNotEmpty();
}
@Test
public void testNoRenameForDefPkg() throws Exception {
int result = execJadxCli(buildArgs(List.of("--rename-flags", "none"), "samples/defpkg.smali"));
assertThat(result).isEqualTo(0);
List<Path> files = collectJavaFilesInDir(outputDir);
assertThat(files).hasSize(1);
}
}
@@ -0,0 +1,17 @@
package jadx.plugins.tools.utils;
import org.junit.jupiter.api.Test;
import static jadx.plugins.tools.utils.PluginUtils.extractVersion;
import static org.assertj.core.api.Assertions.assertThat;
class PluginUtilsTest {
@Test
public void testExtractVersion() {
assertThat(extractVersion("plugin-name-v1.2.3.jar")).isEqualTo("1.2.3");
assertThat(extractVersion("plugin-name-v1.2.jar")).isEqualTo("1.2");
assertThat(extractVersion("1.2.3.jar")).isEqualTo("1.2.3");
}
}
Binary file not shown.
@@ -0,0 +1,26 @@
.class Lsmali/HelloWorld;
.super Ljava/lang/Object;
.source "HelloWorld.java"
.method constructor <init>()V
.registers 1
.line 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static main([Ljava/lang/String;)V
.registers 2
.line 3
sget-object p0, Ljava/lang/System;->out:Ljava/io/PrintStream;
const-string v0, "Hello, World"
invoke-virtual {p0, v0}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
.line 4
return-void
.end method
@@ -0,0 +1,2 @@
.class public LA;
.super Ljava/lang/Object;
Binary file not shown.
Binary file not shown.
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
## jadx analysis
Various utilities for analyze and process code and related information.
### Call graph
Full app code usage/call graph.
Usage:
```java
JadxArgs args = new JadxArgs();
args.addInputFile(new File("input.apk"));
try (JadxDecompiler jadx = new JadxDecompiler(args)) {
jadx.load();
ICallGraph callGraph = JadxCallGraph.builder(jadx)
.includePackages("com.example") // filter nodes by package
.resolvedOnly(true) // add nodes only from app (exclude framework/lib calls)
.build();
for (ICallGraphEdge edge : callGraph.edges()) {
if (edge.isResolved()) {
System.out.printf("Edge from '%s' to '%s'%n", edge.from(), edge.to());
}
}
callGraph.writeDot(Path.of("test.dot")); // export to '.dot'
callGraph.writeJson(Path.of("test.json")); // export to JSON
}
```
@@ -0,0 +1,12 @@
plugins {
id("jadx-library")
}
dependencies {
implementation(project(":jadx-core"))
implementation("com.google.code.gson:gson:2.14.0")
testRuntimeOnly(project(":jadx-plugins:jadx-dex-input"))
testRuntimeOnly(project(":jadx-plugins:jadx-smali-input"))
}
@@ -0,0 +1,34 @@
package jadx.analysis.callgraph;
import java.nio.file.Path;
import java.util.List;
import jadx.analysis.callgraph.api.ICallGraph;
import jadx.analysis.callgraph.api.ICallGraphEdge;
import jadx.api.JadxArgs;
class CallGraph implements ICallGraph {
private final JadxArgs args;
private final List<ICallGraphEdge> edges;
public CallGraph(JadxArgs args, List<ICallGraphEdge> edges) {
this.args = args;
this.edges = edges;
}
@Override
public List<ICallGraphEdge> edges() {
return edges;
}
@Override
public void writeDot(Path path) {
new CallGraphExportDot(args, this).writeTo(path);
}
@Override
public void writeJson(Path path) {
new CallGraphExportJson(this).writeTo(path);
}
}
@@ -0,0 +1,6 @@
package jadx.analysis.callgraph;
import jadx.core.dex.attributes.AttrNode;
class CallGraphAttrNode extends AttrNode {
}
@@ -0,0 +1,92 @@
package jadx.analysis.callgraph;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicInteger;
import org.jetbrains.annotations.Nullable;
import jadx.analysis.callgraph.api.ICallGraph;
import jadx.analysis.callgraph.api.ICallGraphBuilder;
import jadx.analysis.callgraph.api.ICallGraphEdge;
import jadx.api.JadxDecompiler;
import jadx.core.dex.info.ClassInfo;
import jadx.core.dex.info.MethodInfo;
import jadx.core.dex.nodes.ClassNode;
import jadx.core.dex.nodes.MethodNode;
class CallGraphBuilder implements ICallGraphBuilder {
private final JadxDecompiler decompiler;
private boolean resolvedOnly = false;
private @Nullable String pkgFilter;
public CallGraphBuilder(JadxDecompiler decompiler) {
this.decompiler = decompiler;
}
@Override
public ICallGraphBuilder resolvedOnly(boolean resolved) {
this.resolvedOnly = resolved;
return this;
}
@Override
public ICallGraphBuilder includePackages(String pkgFilter) {
this.pkgFilter = pkgFilter.endsWith(".") ? pkgFilter : pkgFilter + '.';
return this;
}
@Override
public ICallGraph build() {
return new CallGraph(decompiler.getArgs(), collectEdges());
}
private List<ICallGraphEdge> collectEdges() {
AtomicInteger nodeId = new AtomicInteger();
Map<MethodInfo, CallGraphNode> nodes = new HashMap<>();
List<ICallGraphEdge> edges = new ArrayList<>();
for (ClassNode cls : decompiler.getRoot().getClasses(true)) {
if (ignorePkg(cls.getClassInfo())) {
continue;
}
for (MethodNode mth : cls.getMethods()) {
CallGraphNode thisNode = getCallGraphNode(mth, nodes, nodeId);
for (MethodNode use : mth.getUseIn()) {
if (ignorePkg(use.getDeclaringClass().getClassInfo())) {
continue;
}
CallGraphNode useInNode = getCallGraphNode(use, nodes, nodeId);
edges.add(new CallGraphEdge(useInNode, thisNode));
}
if (!resolvedOnly) {
for (MethodInfo used : mth.getUnresolvedUsed()) {
if (ignorePkg(used.getDeclClass())) {
continue;
}
CallGraphNode usedNode = getCallGraphNode(used, nodes, nodeId);
edges.add(new CallGraphEdge(thisNode, usedNode));
}
}
}
}
return edges;
}
private boolean ignorePkg(ClassInfo cls) {
if (pkgFilter == null) {
return false;
}
return !cls.getFullName().startsWith(pkgFilter);
}
private static CallGraphNode getCallGraphNode(MethodNode mth, Map<MethodInfo, CallGraphNode> nodes, AtomicInteger nodeId) {
return nodes.computeIfAbsent(mth.getMethodInfo(), i -> new CallGraphNode(nodeId.incrementAndGet(), mth));
}
private static CallGraphNode getCallGraphNode(MethodInfo mth, Map<MethodInfo, CallGraphNode> nodes, AtomicInteger nodeId) {
return nodes.computeIfAbsent(mth, i -> new CallGraphNode(nodeId.incrementAndGet(), mth));
}
}
@@ -0,0 +1,41 @@
package jadx.analysis.callgraph;
import jadx.analysis.callgraph.api.ICallGraphEdge;
import jadx.analysis.callgraph.api.ICallGraphNode;
import jadx.core.dex.attributes.IAttributeNode;
class CallGraphEdge implements ICallGraphEdge {
private final ICallGraphNode from;
private final ICallGraphNode to;
private final CallGraphAttrNode attrNode = new CallGraphAttrNode();
public CallGraphEdge(ICallGraphNode from, ICallGraphNode to) {
this.from = from;
this.to = to;
}
@Override
public ICallGraphNode from() {
return from;
}
@Override
public ICallGraphNode to() {
return to;
}
@Override
public boolean isResolved() {
return to.isResolved();
}
@Override
public IAttributeNode attributes() {
return attrNode;
}
@Override
public String toString() {
return "CallGraphEdge{from=" + from + ", to=" + to + '}';
}
}
@@ -0,0 +1,92 @@
package jadx.analysis.callgraph;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jadx.analysis.callgraph.api.ICallGraph;
import jadx.analysis.callgraph.api.ICallGraphEdge;
import jadx.analysis.callgraph.api.ICallGraphNode;
import jadx.api.ICodeWriter;
import jadx.api.JadxArgs;
import jadx.api.impl.SimpleCodeWriter;
import jadx.core.utils.DotGraphUtils;
import jadx.core.utils.files.FileUtils;
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;
public class CallGraphExportDot {
private final JadxArgs args;
private final ICallGraph callGraph;
public CallGraphExportDot(JadxArgs args, ICallGraph callGraph) {
this.args = args;
this.callGraph = callGraph;
}
public void writeTo(Path path) {
try {
FileUtils.makeDirsForFile(path);
Files.writeString(path, writeToString(), StandardCharsets.UTF_8,
WRITE, TRUNCATE_EXISTING, CREATE);
} catch (IOException e) {
throw new RuntimeException("Failed to save JSON file: " + path, e);
}
}
public String writeToString() {
// collect nodes
Map<Integer, Node> nodeMap = new HashMap<>();
for (ICallGraphEdge edge : callGraph.edges()) {
addNode(edge.from(), nodeMap);
addNode(edge.to(), nodeMap);
}
List<Node> nodes = new ArrayList<>(nodeMap.values());
nodes.sort(Comparator.comparingInt(o -> o.id));
SimpleCodeWriter cw = new SimpleCodeWriter(args);
cw.add("digraph CallGraph {");
for (Node node : nodes) {
cw.startLine();
addNodeName(cw, node.id);
cw.add("[shape=record,label=\"{");
cw.add(DotGraphUtils.escape(node.method));
cw.add("}\"];");
}
for (ICallGraphEdge edge : callGraph.edges()) {
cw.startLine();
addNodeName(cw, edge.from().getId());
cw.add(" -> ");
addNodeName(cw, edge.to().getId());
cw.add(';');
}
cw.startLine('}');
return cw.getCodeStr();
}
private void addNodeName(ICodeWriter cw, int id) {
cw.add('N').add(Integer.toString(id));
}
private void addNode(ICallGraphNode cgNode, Map<Integer, Node> nodeMap) {
nodeMap.computeIfAbsent(cgNode.getId(), id -> {
Node node = new Node();
node.id = id;
node.method = cgNode.getMethodInfo().getRawFullId();
return node;
});
}
static final class Node {
int id;
String method;
}
}
@@ -0,0 +1,97 @@
package jadx.analysis.callgraph;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.Strictness;
import jadx.analysis.callgraph.api.ICallGraph;
import jadx.analysis.callgraph.api.ICallGraphEdge;
import jadx.analysis.callgraph.api.ICallGraphNode;
import jadx.core.utils.files.FileUtils;
import static java.nio.file.StandardOpenOption.CREATE;
import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING;
import static java.nio.file.StandardOpenOption.WRITE;
public class CallGraphExportJson {
private final ICallGraph callGraph;
private final Gson gson;
public CallGraphExportJson(ICallGraph callGraph) {
this.callGraph = callGraph;
this.gson = new GsonBuilder()
.disableJdkUnsafe()
.disableInnerClassSerialization()
.setStrictness(Strictness.STRICT)
// .setPrettyPrinting() // TODO: add option for pretty print?
.create();
}
public void writeTo(Path path) {
try {
FileUtils.makeDirsForFile(path);
Files.writeString(path, writeToString(), StandardCharsets.UTF_8,
WRITE, TRUNCATE_EXISTING, CREATE);
} catch (IOException e) {
throw new RuntimeException("Failed to save JSON file: " + path, e);
}
}
public String writeToString() {
List<Edge> edges = new ArrayList<>();
Map<Integer, Node> nodeMap = new HashMap<>();
for (ICallGraphEdge edge : callGraph.edges()) {
ICallGraphNode from = edge.from();
ICallGraphNode to = edge.to();
addNode(from, nodeMap);
addNode(to, nodeMap);
Edge jsonEdge = new Edge();
jsonEdge.from = from.getId();
jsonEdge.to = to.getId();
jsonEdge.resolved = edge.isResolved();
edges.add(jsonEdge);
}
List<Node> nodes = new ArrayList<>(nodeMap.values());
nodes.sort(Comparator.comparingInt(o -> o.id));
RootNode rootNode = new RootNode();
rootNode.nodes = nodes;
rootNode.edges = edges;
return gson.toJson(rootNode);
}
private void addNode(ICallGraphNode cgNode, Map<Integer, Node> nodeMap) {
nodeMap.computeIfAbsent(cgNode.getId(), id -> {
Node node = new Node();
node.id = id;
node.method = cgNode.getMethodInfo().getRawFullId();
return node;
});
}
static final class RootNode {
List<Node> nodes;
List<Edge> edges;
}
static final class Node {
int id;
String method;
}
static final class Edge {
int from;
int to;
boolean resolved;
}
}
@@ -0,0 +1,60 @@
package jadx.analysis.callgraph;
import org.jetbrains.annotations.Nullable;
import jadx.analysis.callgraph.api.ICallGraphNode;
import jadx.core.dex.attributes.IAttributeNode;
import jadx.core.dex.info.MethodInfo;
import jadx.core.dex.nodes.MethodNode;
class CallGraphNode implements ICallGraphNode {
private final int id;
private final MethodInfo mthInfo;
private final @Nullable MethodNode mthNode;
private final CallGraphAttrNode attrNode;
public CallGraphNode(int id, MethodInfo mthInfo) {
this(id, mthInfo, null);
}
public CallGraphNode(int id, MethodNode mthNode) {
this(id, mthNode.getMethodInfo(), mthNode);
}
public CallGraphNode(int id, MethodInfo mthInfo, @Nullable MethodNode mthNode) {
this.id = id;
this.mthInfo = mthInfo;
this.mthNode = mthNode;
this.attrNode = new CallGraphAttrNode();
}
@Override
public int getId() {
return id;
}
@Override
public MethodInfo getMethodInfo() {
return mthInfo;
}
@Override
public @Nullable MethodNode getMethodNode() {
return mthNode;
}
@Override
public boolean isResolved() {
return mthNode != null;
}
@Override
public IAttributeNode attributes() {
return attrNode;
}
@Override
public String toString() {
return mthInfo.getFullId();
}
}
@@ -0,0 +1,11 @@
package jadx.analysis.callgraph;
import jadx.analysis.callgraph.api.ICallGraphBuilder;
import jadx.api.JadxDecompiler;
public class JadxCallGraph {
public static ICallGraphBuilder builder(JadxDecompiler decompiler) {
return new CallGraphBuilder(decompiler);
}
}
@@ -0,0 +1,13 @@
package jadx.analysis.callgraph.api;
import java.nio.file.Path;
import java.util.List;
public interface ICallGraph {
List<ICallGraphEdge> edges();
void writeDot(Path path);
void writeJson(Path path);
}
@@ -0,0 +1,10 @@
package jadx.analysis.callgraph.api;
public interface ICallGraphBuilder {
ICallGraphBuilder includePackages(String pkgFilter);
ICallGraphBuilder resolvedOnly(boolean resolved);
ICallGraph build();
}
@@ -0,0 +1,14 @@
package jadx.analysis.callgraph.api;
import jadx.core.dex.attributes.IAttributeNode;
public interface ICallGraphEdge {
ICallGraphNode from();
ICallGraphNode to();
boolean isResolved();
IAttributeNode attributes();
}
@@ -0,0 +1,21 @@
package jadx.analysis.callgraph.api;
import org.jetbrains.annotations.Nullable;
import jadx.core.dex.attributes.IAttributeNode;
import jadx.core.dex.info.MethodInfo;
import jadx.core.dex.nodes.MethodNode;
public interface ICallGraphNode {
int getId();
MethodInfo getMethodInfo();
@Nullable
MethodNode getMethodNode();
boolean isResolved();
IAttributeNode attributes();
}
@@ -0,0 +1,86 @@
package jadx.analysis.callgraph.test;
import java.io.File;
import java.net.MalformedURLException;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.Path;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.io.TempDir;
import jadx.analysis.callgraph.CallGraphExportDot;
import jadx.analysis.callgraph.CallGraphExportJson;
import jadx.analysis.callgraph.JadxCallGraph;
import jadx.analysis.callgraph.api.ICallGraph;
import jadx.analysis.callgraph.api.ICallGraphEdge;
import jadx.api.JadxArgs;
import jadx.api.JadxDecompiler;
import static org.assertj.core.api.Assertions.assertThat;
class JadxCallGraphTest {
@TempDir
Path tempDir;
@SuppressWarnings("unused")
void usageExample() {
JadxArgs args = new JadxArgs();
args.addInputFile(new File("input.apk"));
try (JadxDecompiler jadx = new JadxDecompiler(args)) {
jadx.load();
ICallGraph callGraph = JadxCallGraph.builder(jadx)
.includePackages("com.example")
.resolvedOnly(false)
.build();
for (ICallGraphEdge edge : callGraph.edges()) {
if (edge.isResolved()) {
System.out.printf("Edge from '%s' to '%s'%n", edge.from(), edge.to());
}
}
callGraph.writeDot(Path.of("test.dot"));
callGraph.writeJson(Path.of("test.json"));
}
}
@Test
void simpleTest() {
JadxArgs args = new JadxArgs();
args.addInputFile(getSampleFile("simple.smali"));
try (JadxDecompiler jadx = new JadxDecompiler(args)) {
jadx.load();
ICallGraph callGraph = JadxCallGraph.builder(jadx)
.includePackages("test.pkg")
.resolvedOnly(false)
.build();
assertThat(callGraph.edges()).hasSize(1);
for (ICallGraphEdge edge : callGraph.edges()) {
System.out.println("Edge from " + edge.from() + " to " + edge.to());
}
String dotStr = new CallGraphExportDot(jadx.getArgs(), callGraph).writeToString();
System.out.println("dot: " + dotStr);
String jsonStr = new CallGraphExportJson(callGraph).writeToString();
System.out.println("json: " + jsonStr);
callGraph.writeDot(tempDir.resolve("test.dot"));
callGraph.writeJson(tempDir.resolve("test.json"));
}
}
private File getSampleFile(String sampleName) {
try {
URL resource = getClass().getResource("/samples/" + sampleName);
assertThat(resource).describedAs("Sample not found: %s", sampleName).isNotNull();
return new File(resource.toURI().toURL().getFile());
} catch (MalformedURLException | URISyntaxException e) {
throw new RuntimeException("Failed to load sample file: " + sampleName, e);
}
}
}
@@ -0,0 +1,19 @@
.class Ltest/pkg/HelloWorld;
.super Ljava/lang/Object;
.source "HelloWorld.java"
.method public static main([Ljava/lang/String;)V
.registers 2
const-string v0, "Hello, World"
invoke-static {p0, v0}, Ltest/pkg/HelloWorld;->hello(Ljava/lang/String;)V
return-void
.end method
.method public static hello(Ljava/lang/String;)V
.registers 2
sget-object v0, Ljava/lang/System;->out:Ljava/io/PrintStream;
invoke-virtual {v0, p0}, Ljava/io/PrintStream;->println(Ljava/lang/String;)V
return-void
.end method
+6
View File
@@ -0,0 +1,6 @@
## jadx app commons
This module contains common utilities used in jadx apps (cli and gui) and not needed in jadx-code module:
- `JadxCommonFiles` - wrapper for `dev.dirs:directories` lib to get
'config' and 'cache' directories in cross-platform way
- `JadxCommonEnv` - utils for work with environment variables
@@ -0,0 +1,7 @@
plugins {
id("jadx-library")
}
dependencies {
implementation("io.get-coursier.util:directories-jni:0.1.4")
}
@@ -0,0 +1,31 @@
package jadx.commons.app;
import org.jetbrains.annotations.Nullable;
public class JadxCommonEnv {
public static @Nullable String get(String varName, @Nullable String defValue) {
String strValue = System.getenv(varName);
return isNullOrEmpty(strValue) ? defValue : strValue;
}
public static boolean getBool(String varName, boolean defValue) {
String strValue = System.getenv(varName);
if (isNullOrEmpty(strValue)) {
return defValue;
}
return strValue.equalsIgnoreCase("true");
}
public static int getInt(String varName, int defValue) {
String strValue = System.getenv(varName);
if (isNullOrEmpty(strValue)) {
return defValue;
}
return Integer.parseInt(strValue);
}
private static boolean isNullOrEmpty(@Nullable String value) {
return value == null || value.isEmpty();
}
}
@@ -0,0 +1,106 @@
package jadx.commons.app;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.Supplier;
import org.jetbrains.annotations.Nullable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import dev.dirs.ProjectDirectories;
import dev.dirs.impl.Windows;
import dev.dirs.impl.WindowsPowerShell;
import dev.dirs.jni.WindowsJni;
public class JadxCommonFiles {
private static final Logger LOG = LoggerFactory.getLogger(JadxCommonFiles.class);
private static final Path CONFIG_DIR;
private static final Path CACHE_DIR;
public static Path getConfigDir() {
return CONFIG_DIR;
}
public static Path getCacheDir() {
return CACHE_DIR;
}
static {
DirsLoader loader = new DirsLoader();
CONFIG_DIR = loader.getConfigDir();
CACHE_DIR = loader.getCacheDir();
}
private static final class DirsLoader {
private final Path configDir;
private final Path cacheDir;
DirsLoader() {
try {
AtomicReference<@Nullable ProjectDirectories> pdRef = new AtomicReference<>();
configDir = loadEnvDir("JADX_CONFIG_DIR", () -> loadDirs(pdRef).configDir);
cacheDir = loadEnvDir("JADX_CACHE_DIR", () -> loadDirs(pdRef).cacheDir);
} catch (Exception e) {
throw new RuntimeException("Failed to init common directories", e);
}
}
private static Path loadEnvDir(String envVar, Supplier<String> dirFunc) throws IOException {
String envDir = JadxCommonEnv.get(envVar, null);
String dirStr;
if (envDir != null) {
dirStr = envDir;
} else {
dirStr = dirFunc.get();
}
Path path = Path.of(dirStr).toAbsolutePath();
Files.createDirectories(path);
return path;
}
private static ProjectDirectories loadDirs(AtomicReference<@Nullable ProjectDirectories> pdRef) {
ProjectDirectories currentDirs = pdRef.get();
if (currentDirs != null) {
return currentDirs;
}
LOG.debug("Loading system dirs ...");
long start = System.currentTimeMillis();
ProjectDirectories loadedDirs = ProjectDirectories.from("io.github", "skylot", "jadx", DirsLoader::getWinDirs);
if (LOG.isDebugEnabled()) {
LOG.debug("Loaded system dirs ({}ms): config: {}, cache: {}",
System.currentTimeMillis() - start, loadedDirs.configDir, loadedDirs.cacheDir);
}
pdRef.set(loadedDirs);
return loadedDirs;
}
/**
* Return JNI, Foreign or PowerShell implementation
*/
private static Windows getWinDirs() {
Windows impl = Windows.getDefaultSupplier().get();
if (impl instanceof WindowsPowerShell) {
if (JadxSystemInfo.IS_AMD64) {
// JNI library compiled only for x86-64
impl = new WindowsJni();
}
}
LOG.debug("Using win dirs implementation: {}", impl.getClass().getSimpleName());
return impl;
}
Path getCacheDir() {
return cacheDir;
}
Path getConfigDir() {
return configDir;
}
}
}
@@ -0,0 +1,26 @@
package jadx.commons.app;
import java.util.Locale;
@SuppressWarnings("unused")
public class JadxSystemInfo {
public static final String JAVA_VM = System.getProperty("java.vm.name", "?");
public static final String JAVA_VER = System.getProperty("java.version", "?");
public static final String OS_NAME = System.getProperty("os.name", "?");
public static final String OS_ARCH = System.getProperty("os.arch", "?");
public static final String OS_VERSION = System.getProperty("os.version", "?");
private static final String OS_NAME_LOWER = OS_NAME.toLowerCase(Locale.ENGLISH);
public static final boolean IS_WINDOWS = OS_NAME_LOWER.startsWith("windows");
public static final boolean IS_MAC = OS_NAME_LOWER.startsWith("mac");
public static final boolean IS_LINUX = !IS_WINDOWS && !IS_MAC;
public static final boolean IS_UNIX = !IS_WINDOWS;
private static final String OS_ARCH_LOWER = OS_ARCH.toLowerCase(Locale.ENGLISH);
public static final boolean IS_AMD64 = OS_ARCH_LOWER.equals("amd64");
public static final boolean IS_ARM64 = OS_ARCH_LOWER.equals("aarch64");
private JadxSystemInfo() {
}
}
@@ -0,0 +1,33 @@
package jadx.commons.app;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class JadxTempFiles {
private static final String JADX_TMP_INSTANCE_PREFIX = "jadx-instance-";
private static final Path TEMP_ROOT_DIR = createTempRootDir();
public static Path getTempRootDir() {
return TEMP_ROOT_DIR;
}
private static Path createTempRootDir() {
try {
String jadxTmpDir = System.getenv("JADX_TMP_DIR");
Path dir;
if (jadxTmpDir != null) {
Path customTmpRootDir = Paths.get(jadxTmpDir);
Files.createDirectories(customTmpRootDir);
dir = Files.createTempDirectory(customTmpRootDir, JADX_TMP_INSTANCE_PREFIX);
} else {
dir = Files.createTempDirectory(JADX_TMP_INSTANCE_PREFIX);
}
dir.toFile().deleteOnExit();
return dir;
} catch (Exception e) {
throw new RuntimeException("Failed to create temp root directory", e);
}
}
}
+3
View File
@@ -0,0 +1,3 @@
## jadx zip
Custom zip reader implementation to fight tampering and provide additional security checks
+3
View File
@@ -0,0 +1,3 @@
plugins {
id("jadx-library")
}
@@ -0,0 +1,36 @@
package jadx.zip;
import java.io.File;
import java.io.InputStream;
public interface IZipEntry {
/**
* Zip entry name
*/
String getName();
/**
* Uncompressed bytes
*/
byte[] getBytes();
/**
* Stream of uncompressed bytes.
*/
InputStream getInputStream();
long getCompressedSize();
long getUncompressedSize();
boolean isDirectory();
File getZipFile();
/**
* Return true if {@link #getBytes()} method is more optimal to use other than
* {@link #getInputStream()}
*/
boolean preferBytes();
}

Some files were not shown because too many files have changed in this diff Show More