Android applications are packed inside a APK file, which is just a ZIP file containing among other things a compact Dalvik Executable (.dex) file.
First step is to extract the “classes.dex” file from the APK:

$ unzip program.apk classes.dex Archive: program.apk inflating: classes.dex

Now, we use the tool dex2jar to convert the classes.dex file to Java .class files:

$ bash dex2jar/ ./classes.dex version: 2 [main] INFO - dex2jar ./classes.dex -\> ./classes.dex.dex2jar.jar Done.

From here we obtain the file “classes.dex.dex2jar.jar”, now we can use the java decompiler JD-GUI to extract the source code:

$ ./jd-gui classes.dex.dex2jar.jar

Now just go to “File -> Save all sources” and it will generate the zip file “” containing all the decompiled Java source code :)