javaandroidsmalidex2jar

Alternate method to reversing than reading smali code?


I am reversing an android app. I want to modify and rebuild it. I used APK Studio (which is pretty much a GUI version of apktool) to get the files inside the apk. Now reading smali code is very difficult.

I also tried to unzip it, get classes.dex, then got the jar files (using dex2jar) and opened it in jd-gui but that method does not get the complete source code and yeah some java code was obviously missing. So I cannot use that to rebuild it.

So any alternate method available which I can use to rebuild the app without having to go through smali code??

I know exactly which class and which code I have to change. But I can't reach the same code in smali files.


Solution

  • The two-step conversion via dex2jar and then decompile the Java class files is known to make problems. The main reason for this is that DEX is a register based architecture where as Java is a stack based architecture. The conversion between both systems is complex and error-prone.

    Therefore I prefer a "one-step" decompilation (directly DEX to Java source code) as it is done by Jadx - a Dex to Java decompiler.

    Jadx usually can decompile most of the methods. However for very complex methods or methods that were originally not compiled from Java source code the decompilation can fail.