Android Applications: Extracting the Source Code

In this short tutorial, I will show you how to extract the code source of an android application. Starting with the name of the application we will be able to access the JAVA code source.

I assume that the used operating system is Linux (in my case Ubuntu 16.04).

STEP 1: Download the APK File

STEP 2: Decompress the APK File

$ mv application.apk application.zip
$ unzip application.zip

STEP 3: Extract Class Files

$ d2j-dex2jar.sh classes.dex

This will generate a jar file containing the class file.

STEP 4: Decompile Class Files

$ java -jar path-to/jd-cli.jar application.jar
$ jar xvf application.src.jar

Conclusion

Feel free to comment or ask any questions and please don’t forget to clap.

Notes

$ ./gradlew
$ cd dex-tools/build/distributions
$ unzip dex-tools-2.1-SNAPSHOT.zip

Then use the d2j-jar2dex.sh found in the unzipped folder.

Reference: https://github.com/pxb1988/dex2jar/issues/170

Big fan of technology with a recent interest in finance following the rise of cryptocurrencies.