skylot
Repos
4
Followers
715

Dex to Java decompiler

32490
3987

Events

issue comment
[Question] Unable to set breakpoint

@Nova-Noir breakpoints now works only in smali viewer in Show dalvik bytecode mode (checkbox in right click menu in smali viewer) this mode should be enabled automatically on debug start, but looks like something goes wrong this time :cry:

Created at 2 weeks ago
issue comment
`jadx-next` issues

renamed almost every class to "PG"

Do these classes contains /* compiled from: PG */? If yes, just disable Use source file name as class name alias option in preferences. Anyway, looks like I need to check other classes names before applying source file name.

Exporting mappings doesn't include the currently open mappings.

This is weird. I will check this. And thanks for report these issues :+1:

Created at 2 weeks ago
issue comment
support use Android mapping.txt to deobfuscation

@01Sr work in progress right now. Implementation use FabricMC/mapping-io library to support various mapping formats including proguard. Although, proguard is slightly harder because mapping needs to be reversed before apply.

Created at 2 weeks ago
issue comment
[feature] Pass cli args via a configuration file

@Fi5t thanks for bringing up this topic. There are several implementations and issues: Now jadx-cli already support "@ syntax" from jcommander library, so it is possible to store cli flags in file.
Example with usage notes:

-v
# split option and value
-d
out-jadx-tmp
# remove quotes for string values
--rename-flags
none

classes.dex

and use like:

jadx @config

It is possible to implement generation of this file in jadx-gui to export settings. But taking into account that there are other options stored in jadx project file like renames (#1341) and comments, maybe it will better just support jadx project file in jadx-cli. Main issue in that approach that jadx-gui uses 2 configs: project and global settings, so looks like export for jadx-cli will needed anyway. So in short: we need to implement import of jadx project file with embedded global settings into jadx-cli and add export of such file in jadx-gui.

P.S this will also help to resolve #534 (support excluded packages in jadx-cli)

Created at 2 weeks ago

fix(gui): hi-dpi main window initial size (#1728)(PR #1729)

fix(gui): correct html render in comments search results

feat: add base scripting support

feat(gui): support scripts in UI

feat(gui): add auto complete for jadx scripts

feat(script): add options support

feat: add package node, allow to rename packages

refactor: split and simplify deobfuscator

refactor: use package nodes in api and ui

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: importopen; exportsave

  • 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

refactor: move mappings feature to separate plugin module

refactor: move plugins-api module into jadx-core

refactor: make input plugin api similar to pass plugins

feat(gui): save usage data into disk cache

build: configure spotless for kotlin, apply code style fixes

script: add sample deobf by code script (#1706)

feat(gui): add run, check and format script actions

feat(script): add code area popup menu action

feat(gui): allow to dock log viewer, new filter modes

chore: update dependencies

Created at 3 weeks ago

fix(gui): correct html render in comments search results

Created at 3 weeks ago
issue comment
[gui] Scaled main window size in Hi-DPI environment

@shatyuka thanks! I merged your PR. Also, I hope that someone else can check and confirm this fix :slightly_smiling_face:

Created at 3 weeks ago

fix(gui): hi-dpi main window initial size (#1728)(PR #1729)

Created at 3 weeks ago
closed issue
[gui] Scaled main window size in Hi-DPI environment

For 200% scaled monitor, jadx got scaled twice, for DisplayMode returns native resolution.

https://github.com/skylot/jadx/blob/bb4d88cc6841eaf3368e96943a59aa42fe1cb26b/jadx-gui/src/main/java/jadx/gui/ui/MainWindow.java#L1425-L1427

Also, main window size got even bigger with multiple screens.

I'll make a PR later.

Created at 3 weeks ago
pull request closed
fix(gui): hi-dpi main window initial size

Description

Fix the abnormal main window initial size in Hi-DPI screen.

Fixes: #1728

Created at 3 weeks ago
issue comment
[core] method.getInstructions() is null when using jadx as a library

Well, MethodNode is considered internal, so better try to not use it. But if you really want to, there are several solutions:

  1. Call method MethodNode.load() as @jpstotz mentioned
  2. As mentioned in # 1482 you can insert additional pass, but in this case you should put in after ProcessInstructionsVisitor, so insert line should be:
addCustomPassAfter(passes, ProcessInstructionsVisitor.class, customPass);

This will work because instructions array available only in first passes working on input instructions, next it replaced with basic blocks tree.

Also, getInsnsCount() return an approximation of instructions count, actually it is a size of code block in code units (2 bytes for DEX). Looks like I forget to rename this property after I rename ICodeReader.getUnitsCount().

Created at 3 weeks ago
closed issue
java.lang.IllegalArgumentException: pos 6766 is not in range 6788-6791

Please describe what you did before the error occurred. IMPORTANT! If the error occurs with a specific APK file please attach or provide link to apk file!

  • Jadx version: 1.4.5
  • Java version: 1.8.0_291
  • Java VM: Oracle Corporation Java HotSpot(TM) 64-Bit Server VM
  • Platform: Mac OS X (10.16 x86_64)
  • Max heap size: 11470 MB
  • Program args: -Xms128M -XX:MaxRAMPercentage=70.0 -XX:+UseG1GC -Dawt.useSystemAAFontSettings=lcd -Dswing.aatext=true -Djava.util.Arrays.useLegacyMergeSort=true
java.lang.IllegalArgumentException: pos 6766 is not in range 6788-6791
	at org.fife.ui.rsyntaxtextarea.TokenImpl.makeStartAt(TokenImpl.java:805)
	at org.fife.ui.rsyntaxtextarea.TokenUtils.getSubTokenList(TokenUtils.java:134)
	at org.fife.ui.rsyntaxtextarea.WrappedSyntaxView$WrappedLine.calculateLineCount(WrappedSyntaxView.java:1188)
	at org.fife.ui.rsyntaxtextarea.WrappedSyntaxView$WrappedLine.getPreferredSpan(WrappedSyntaxView.java:1236)
	at javax.swing.text.View.getMinimumSpan(View.java:250)
	at javax.swing.text.BoxView.calculateMajorAxisRequirements(BoxView.java:871)
	at javax.swing.text.BoxView.checkRequests(BoxView.java:930)
	at javax.swing.text.BoxView.setSpanOnAxis(BoxView.java:329)
	at javax.swing.text.BoxView.layout(BoxView.java:709)
	at javax.swing.text.BoxView.setSize(BoxView.java:397)
	at org.fife.ui.rsyntaxtextarea.WrappedSyntaxView.setSize(WrappedSyntaxView.java:1018)
	at javax.swing.plaf.basic.BasicTextUI$RootView.setSize(BasicTextUI.java:1722)
	at javax.swing.plaf.basic.BasicTextUI.getPreferredSize(BasicTextUI.java:912)
	at javax.swing.plaf.basic.BasicTextAreaUI.getPreferredSize(BasicTextAreaUI.java:120)
	at javax.swing.JComponent.getPreferredSize(JComponent.java:1662)
	at javax.swing.JTextArea.getPreferredSize(JTextArea.java:618)
	at javax.swing.ScrollPaneLayout.layoutContainer(ScrollPaneLayout.java:791)
	at java.awt.Container.layout(Container.java:1513)
	at java.awt.Container.doLayout(Container.java:1502)
	at java.awt.Container.validateTree(Container.java:1698)
	at java.awt.Container.validateTree(Container.java:1707)
	at java.awt.Container.validateTree(Container.java:1707)
	at java.awt.Container.validateTree(Container.java:1707)
	at java.awt.Container.validateTree(Container.java:1707)
	at java.awt.Container.validate(Container.java:1633)
	at javax.swing.plaf.basic.BasicTabbedPaneUI.ensureCurrentLayout(BasicTabbedPaneUI.java:1447)
	at javax.swing.plaf.basic.BasicTabbedPaneUI.getTabRunCount(BasicTabbedPaneUI.java:1473)
	at com.formdev.flatlaf.ui.FlatTabbedPaneUI.ensureCurrentLayout(FlatTabbedPaneUI.java:1607)
	at com.formdev.flatlaf.ui.FlatTabbedPaneUI.paint(FlatTabbedPaneUI.java:1051)
	at javax.swing.plaf.ComponentUI.update(ComponentUI.java:161)
	at com.formdev.flatlaf.ui.FlatTabbedPaneUI.update(FlatTabbedPaneUI.java:1040)
	at javax.swing.JComponent.paintComponent(JComponent.java:780)
	at javax.swing.JComponent.paint(JComponent.java:1056)
	at javax.swing.JComponent.paintChildren(JComponent.java:889)
	at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1047)
	at javax.swing.JComponent.paint(JComponent.java:1065)
	at javax.swing.JComponent.paintToOffscreen(JComponent.java:5210)
	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
	at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
	at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
	at javax.swing.JComponent._paintImmediately(JComponent.java:5158)
	at javax.swing.JComponent.paintImmediately(JComponent.java:4969)
	at javax.swing.RepaintManager$4.run(RepaintManager.java:831)
	at javax.swing.RepaintManager$4.run(RepaintManager.java:814)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:814)
	at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:789)
	at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:738)
	at javax.swing.RepaintManager.access$1200(RepaintManager.java:64)
	at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1732)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at com.formdev.flatlaf.SubMenuUsabilityHelper$SubMenuEventQueue.dispatchEvent(SubMenuUsabilityHelper.java:301)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Created at 3 weeks ago
issue comment
java.lang.IllegalArgumentException: pos 5395 is not in range 5419-5430

This issue may be fixed by commit b28f8ba85bd2de925e842947eae5d01f5e41baf1 related to #1712, please try latest unstable build.

Created at 3 weeks ago
issue comment
java.lang.IllegalArgumentException: pos 6766 is not in range 6788-6791

Duplicate of #1697

Also, this may be fixed recently by commit b28f8ba85bd2de925e842947eae5d01f5e41baf1 related to #1712, so please try latest unstable build.

Created at 3 weeks ago
pull request closed
Changes

:exclamation: Please review the guidelines for contributing

Description

Please describe your pull request. Reference issue it fixes.

Created at 3 weeks ago
closed issue
BUG: jadx-gui is having serious visual issues in Windows 10

Tested with jadx/jadx-gui versions 1.3.3 and 1.4.4, the jadx-gui program's GUI starts breaking when hovering code.

In Macbook, I have never experienced this issue with jadx. I am now trying to use it on Windows and have been experiencing this issue for some weeks now.

I don't know exactly why it occurs, but it usually happens when I'm in jadx for a while (>15 mins). This issue is really bad because I have to restart jadx, recompile the program and reopen the interesting classes to continue my reversing.

I'm happy to share with you any details you need to get this issue fixed, as it's a real nuisance (for me or for anyone else experiencing the same issue).

Screenshots: issue_jadx1 issue_jadx2

Created at 3 weeks ago
issue comment
Change Google Maven repository

I think this change is not needed, check my comment at https://github.com/skylot/jadx/issues/1724#issuecomment-1312515761

Created at 3 weeks ago
issue comment
BUG: ./gradlew dist error

@rickyrsyah looks like a network issue, because these urls works fine for me. Also, I don't think you PR is needed because gradle shortcut is correct and maven.google.com repository also points to urls at dl.google.com (check jar artifact link at https://maven.google.com/web/index.html#com.android.tools.build:apksig:7.3.1). So issue may be in name resolution (DNS) or Google mess up with redirections :rofl:

Created at 3 weeks ago

feat(script): add code area popup menu action

feat(gui): allow to dock log viewer, new filter modes

Created at 3 weeks ago
closed issue
Frida snippet don't work for constructors anymore

When generating a Frida snippet via jadx for a constructor, the code looks like this:

let MyClass = Java.use("com.MyClass");
MyClass["$init"].implementation = function () {
    console.log('$init is called');
    let ret = this.$new();
    console.log('$init ret value is ' + ret);
    return ret;
};

This generates the following error in the latest frida versions (haven't tested how far back that dates):

Error: Implementation for MyClass expected return value compatible with void

When using let ret = this.$init(); instead, it works for me.

let MyClass = Java.use("com.MyClass");
MyClass["$init"].implementation = function () {
    console.log('$init is called');
    let ret = this.$init();
    console.log('$init ret value is ' + ret);
    return ret;
};
Created at 1 month ago
issue comment
Frida snippet don't work for constructors anymore

Great! Thanks for verify.

Created at 1 month ago

fix(gui): show all code sources in summary (remove dex filter) (#1716)

feat(gui): add native libs info to summary (#1717)

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

fix(gui): add template for constructor and void methods to Frida snippet (#1714)

feat: add base scripting support

feat(gui): support scripts in UI

feat(gui): add auto complete for jadx scripts

feat(script): add options support

feat: add package node, allow to rename packages

refactor: split and simplify deobfuscator

refactor: use package nodes in api and ui

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: importopen; exportsave

  • 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

refactor: move mappings feature to separate plugin module

refactor: move plugins-api module into jadx-core

refactor: make input plugin api similar to pass plugins

feat(gui): save usage data into disk cache

build: configure spotless for kotlin, apply code style fixes

script: add sample deobf by code script (#1706)

feat(gui): add run, check and format script actions

feat(script): add code area popup menu action

Created at 1 month ago
issue comment
Frida snippet don't work for constructors anymore

@daMatz I commit additional changes including separate template for constructors and void methods. Please check :slightly_smiling_face:

@xxr0ss thank you for your help :+1:

Created at 1 month ago

fix(gui): add template for constructor and void methods to Frida snippet (#1714)

Created at 1 month ago
reopened issue
Frida snippet don't work for constructors anymore

When generating a Frida snippet via jadx for a constructor, the code looks like this:

let MyClass = Java.use("com.MyClass");
MyClass["$init"].implementation = function () {
    console.log('$init is called');
    let ret = this.$new();
    console.log('$init ret value is ' + ret);
    return ret;
};

This generates the following error in the latest frida versions (haven't tested how far back that dates):

Error: Implementation for MyClass expected return value compatible with void

When using let ret = this.$init(); instead, it works for me.

let MyClass = Java.use("com.MyClass");
MyClass["$init"].implementation = function () {
    console.log('$init is called');
    let ret = this.$init();
    console.log('$init ret value is ' + ret);
    return ret;
};
Created at 1 month ago