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

The first step is to download the application apk file. For this, we can use tools that we find online. One of them is . Otherwise feel free to ask Google: “download apk”.

STEP 2: Decompress the APK File

To open decompress the APK just rename it to give it the “zip” extension and then decompress it.

$ mv application.apk
$ unzip

STEP 3: Extract Class Files

Among the extracted files, you will find a “classes.dex” file. This the file that contains the binary code in class file. To decompress it, use the “dextojar” command available at:

$ classes.dex

This will generate a jar file containing the class file.

STEP 4: Decompile Class Files

To decompile the class files we can use the jd-cli java decompiler available at

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


Here you go! You should now have access to the java source code…

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


To compile dex2jar use the following steps:

$ ./gradlew
$ cd dex-tools/build/distributions
$ unzip

Then use the found in the unzipped folder.