Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option for updating DEX files with line numbers matching decompiled source #1654

Open
misterzed88 opened this issue Aug 24, 2022 · 1 comment

Comments

@misterzed88
Copy link

misterzed88 commented Aug 24, 2022

JADX has a nice line number mapping display where one can see the original line numbers in the decompiled source.

Would it be possible to add an option which actually updates the line number info present in the original DEX files with the new ones matching the decompiled source? I am aware that this invalidates APK signatures.

This feature would enable seamless source-code debugging.

Related to issue #476.

@e0x70i
Copy link

e0x70i commented Mar 18, 2023

I couldn't find anything that accomplished this, so added a feature to APKLab to write back to the smali files, and let APKLab orchestrate rebuilding the APK with the updated smali files: APKLab/APKLab#186

Initially explored modifying JADX to write back to the dex's directly, but found this challenging. Although JADX already keeps track of "sourcelines" from the dex, JADX primarily focuses on decompiling Dex files into Java source code. Implementing this functionality in JADX would involve considerable changes to the existing codebase, increasing the complexity and maintenance burden, and updating the dex binary debug_info_items statemachine seemed like a lot of work that smali/baksmali can already handle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants