As we discussed earlier, that Android applications are simply an archive file of data and resources. Even then, we can't simply unzip the archive package (.apk
) and get the readable sources. For these scenarios, we have to rely on tools that will convert the byte code (as in classes.dex
) into readable source code.
One of the approaches to convert byte codes to readable files is using a tool called dex2jar. The .dex
file is the converted Java bytecode to Dalvik bytecode, making it optimized and efficient for mobile platforms. This free tool simply converts the .dex
file present in the Android application to a corresponding .jar
file. Please follow the ensuing steps:
Download the dex2jar tool from https://code.google.com/p/dex2jar/.
Now we can use it to run against our application's
.dex
file and convert to.jar
format.Now, all we need to do is go to the command prompt and navigate to the folder where dex2jar is located. Next, we need to run the
d2j-dex2jar.bat...