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

JADX decompilation using DEX2JAR #16

Closed
soucevi1 opened this issue Mar 3, 2021 · 4 comments
Closed

JADX decompilation using DEX2JAR #16

soucevi1 opened this issue Mar 3, 2021 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@soucevi1
Copy link

soucevi1 commented Mar 3, 2021

Hi, you did a good job on this project, I really like to use it.
I noticed one small thing -- when you run the program with -decompile JADX, you can see the following in the output:

...

[+]Decompling JAR with DEX2JAR
dex2jar /opt/AndroidProjectCreator/target/library/temp/8a9550a5-7498-4d34-a1d8-86375119c668/apktool/classes.dex -> /opt/AndroidProjectCreator/target/library/temp/8a9550a5-7498-4d34-a1d8-86375119c668/output.jar

[+]Decompilation finished
[+]Decompling JAR with JADX
INFO  - loading ...
INFO  - processing ...

...

But JADX is a DEX -> Java decompiler and it does not need a JAR. In fact, when you give JADX a JAR file, JADX will convert it to DEX first:

$ jadx -d $(pwd) $(pwd)/classes-dex2jar.jar
INFO  - loading ...
INFO  - converting to dex: classes-dex2jar.jar ...

...

AndroidProjectCreator works well even now, going DEX -> JAR -> (DEX) -> Java, and this issue has a low severity. But if it decompiled to Java straight from DEX, it might save some execution time. Also, the results might be a little more accurate, as I can imagine that the DEX -> JAR -> DEX conversion can lead to some kind of loss of information or precision, especially with obfuscated APKs.

@ThisIsLibra ThisIsLibra self-assigned this Mar 6, 2021
@ThisIsLibra ThisIsLibra added the enhancement New feature or request label Mar 6, 2021
@ThisIsLibra
Copy link
Owner

Hello soucevi1, great to hear you like the tool! Thank you for the compliment :)

As for your suggestion, I think it is a really good one. The conversion of of the classes.dex file to the JAR file is indeed causing some unwanted noise in the decompiled output. I will see if I can find some time sometime soon to ensure that the decompilation is done directly, as it sounds perfectly doable.

Cheers, and let me know if you have other suggestions, or feedback in general!

@soucevi1
Copy link
Author

I just realized one more thing -- apart from DEX files, JADX also accepts whole APKs and decompiles all classes files it finds within. This might solve the multiple DEX support someone was asking for in #15. It would be only solved for -decompile JADX though, so not really a complete solution, but it might help.

@ThisIsLibra
Copy link
Owner

I do have a different solution for the multi-dex support in mind, but I like the way your helping with the project. Im currently finishing some other research I'm working on. After that, I'll make some time for APC to resolve this issue, and hopefully introduce a new feature I have in mind. If you find any other bugs, please do make issues for them!

@ThisIsLibra
Copy link
Owner

Just pushed version 1.5-stable that contains a fix for this issue. Thank you for reporting it!

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

No branches or pull requests

2 participants