Decompile .smali files on an APK

BimoZX picture BimoZX · Apr 7, 2011 · Viewed 226.8k times · Source

I downloaded APK Manager that lets me unpack APK files.

But it only unpacks it and doesn't decompile the .smali file to .java.

Is it possible to decompile the .smali to .java?

Answer

Aleadam picture Aleadam · Apr 14, 2011

No, APK Manager decompiles the .dex file into .smali and binary .xml to human readable xml.

The sequence (based on APK Manager 4.9) is 22 to select the package, and then 9 to decompile it. If you press 1 instead of 9, then you will just unpack it (useful only if you want to exchange .png images).

There is no tool available to decompile back to .java files and most probably it won't be any. There is an alternative, which is using dex2jar to transform the dex file in to a .class file, and then use a jar decompiler (such as the free jd-gui) to plain text java. The process is far from optimal, though, and it won't generate working code, but it's decent enough to be able to read it.

dex2jar: https://github.com/pxb1988/dex2jar

jd-gui: http://jd.benow.ca/

Edit: I knew there was somewhere here in SO a question with very similar answers... decompiling DEX into Java sourcecode