If you are interested in learning how to download the source of Android, pull an APK (Android application) off a device and then pull the package apart to view the code and work out how it all works, you will need a Java Decompiler. For those of you who read this blog you will know that If you wanted to strip an APK back to Java code, you would have had to use a PC to do this.
Now that has changed thanks to an app called Show Java – A Java Decompiler ready made for Android. This will help you to extract the .java source code from an APK (Android application) or .jar file from your device.
- Download the app from your mobile browser https://play.google.com/store/apps/details?id=com.njlabs.showjava
- Select the .Jar/APK from your SD card or from a list of installed apps
- It will show you the code in a clean-syntax highlighted form
- The decompiled source can be easily copied from the SD card (the source is stored in Show Java on the SD card)
- Includes a simple source browser with a summary of all decompilation errors as well as classes that could not be decompiled
This is an open source project right which uses dex2jar and Class File Reader (CFR). The app will require the following permissions:
- Network communication – this is used for automated bug reporting
- External Storage (SD card) – used to store the decompiled source code and to have a working directory for the app
- Affects Battery – this prevents the device from sleeping
We’ve used this app and it does work. If you experience any crashes with the app or apps you test, notify the developer.
Safe surfing folks!