Dex2jar and JD-GUI are two different tools that are often used for reverse engineering Android apps. Dex2jar converts .dex files to .jar files, and JD-GUI is a Java decompiler that can decompile .jar files to the original Java source code.
Steps to install Dex2jar
For Windows
Follow the below steps to install dex2jar on the Windows Platform:
1. Download Dex2jar and extract the file.
2. Open the folder and open the command prompt from here, by pressing Shift and right-clicking on the mouse. Let's start with the help command:Remember: Before decompile an android app, make sure you have pasted the APK file inside the dex2jar directory.
For Linux (Kali Linux)
Now let it install dex2jar on the Linux Platform. I always prefer you, Kali Linux for penetration testing purposes.
1. Dex2jar comes, preinstall with Kali Linux. You do not need to install it again.
2. To run this application, go to reverse engineering and then click dex2jar.
3. I have an Android Application file on my desktop. I just want to decompile that file. So change the directory to Desktop. From here, type the following command to decompile that Android APK file.
4. A jar file just appears on the desktop screen.
Steps to Install JD-GUI and its Usage
For Windows
3. Now open the file. Here see the decompiled Java code of the Android APK file.
For Linux Platform
To open the jar file you need JD-GUI, but this tool does not come pre-install with Kali Linux. So you have to install it manually.1. Visit the official JD-GUI GitHub site. From here download it for Linux. As I am here using Debian-based Linux I am here to download the .deb file.
- Use the following command to install JD-GUI on Linux:
3. Run JD-GUI by searching on All Applications.
4. Select the jar file, and see the magic.
In this way, You can decompile any APK file in this way, just follow my steps.