Closed Anon-Exploiter closed 1 year ago
To give more details.
This (https://stackoverflow.com/a/58969794) but in VS code utilizing your extension.
The issue arises in the appSrcRoot key's value. It isn't being satisfied with the decompiled code. I've shared the directory structure of an application decompiled with jadx in the screenshot.
It would be awesome if we can support it somehow! :)
If the decompiler produces valid Java code which matches the line numbers encoded in the app debug info, I think this should work.
Normally appSrcRoot
is set to the root of the package folders, where AndroidManifest.xml
normally lives (I don't see it in your source tree - does the decompiler not extract it?). The reason it's reporting No source files found
is because it's trying to find folders matching the package names inside a well-known source folder (like 'main' or 'java').
I would suggest:
/home/umar_0x01/apk-debugging/ViewerJNI
sources
folder to java
That should be enough to allow the debugger to find the package-name folders and the java source files. If your decompiler has produced a good Java file, everything should then match up and your breakpoints should be hit.
Thanks, I get your point. In my case, I'm using jadx
which keeps AndroidManifest.xml in the resources
directory and the Java source inside the sources directory.
I'm not sure if the decompiled code will have the same lines (sequence) as the original order. I think I've been having some issues in Android studio because of this as well since the bytecode doesn't match the Java code (in sequence/line numbers).
Yes, it's a common problem with decompilers - the line numbers are encoded in the compiled files so the decompiled files should be formatted to match, but many don't bother which makes debugging very difficult.
It looks like there is already an issue about this in jadx
: https://github.com/skylot/jadx/issues/476
Closing this one.
Hi,
Is it possible to make the extension work with source of decompiled applications (apks) using jadx or d2j-dex2jar? I've been trying to make it work with apks I have but it doesn't hit the breakpoints of those.
I guess it has to do something with the path of the application etc. which isn't being satisfied.