ThexXTURBOXx / dex2jar

Tools to work with android .dex and java .class files
Apache License 2.0
234 stars 59 forks source link

Dex2jar erases inner class info #15

Closed omeraydindev closed 3 years ago

omeraydindev commented 3 years ago

This was a painful one to track down, but this particular fork of dex2jar erases some of the inner class info when ran on a DEX file that was rewritten using dexlib2.

I have added a reproduction case in https://github.com/MikeAndrson/dex2jar/blob/main/main/src/main/java/Main.kt , it has a DEX file named classes_org.dex, and it:

The result is: [DeleteDelta, position: 4, lines: [ // access flags 0x0, INNERCLASS Main$1 null null]]

image

Now this might seem trivial but it kinda messes with decompilers, which was a big problem for my project. So I decided to track it down and realized that this issue doesn't exist on the original dex2jar. So I checked the commits of this fork and found this one: https://github.com/ThexXTURBOXx/dex2jar/commit/98196e0bf3947fde1a6afd00ce518e48130fb03a

image

I'm not sure why, but reverting the above change solves the issue.

You can try and see for yourself that the diff doesn't complain in my "revert" branch where I reverted that change: https://github.com/MikeAndrson/dex2jar/tree/revert


I'm not sure if the above change was necessary or not, but it does constitute a problem in my project 😅

ThexXTURBOXx commented 3 years ago

Thank you very much for your report! Indeed, there seems to be some error in the mentioned commit. I have reverted it similar to your approach in cc35ac953c4b074b96c93a617806bfe02d990fae. Again, thank you very much! :)