Decompile Android APKs with Dex2jar & JD-GUI

x32x01
  • by x32x01 ||
If you’re into Android reverse engineering or learning how to analyze Android APKs, one of the first steps is to decompile the app and see the code behind it. 😎 In this guide, you’ll learn how to do it easily using open-source tools like Dex2jar and JD-GUI.

Download & Set Up Dex2jar 📥​

The first thing you need is Dex2jar:
  • Download: Dex2jar.zip
  • Extract it anywhere on your computer.
You’ll also need a sample app to practice on:
  • Sample APK: yeahhub.apk
  • Move it inside the dex2jar folder after extraction.


About yeahhub.apk 🕵️‍♂️​

The yeahhub.apk app asks for a secret number. Your job is to decompile the app and find that number.
As we know, Java executables can be decompiled. Similarly, you can convert an APK into a JAR file.

Decompile APK to JAR 🛠️​

Open Command Prompt and run this command: d2j-dex2jar.bat yeahhub.apk
If everything works, you’ll get a file called: yeahhub-dex2jar.jar in the same folder. 🎉


Open the JAR with JD-GUI 👀​

Next, download JD-GUI from the official site. Then:
  1. Open JD-GUI.
  2. Open the yeahhub-dex2jar.jar file inside the tool.
Now you can see the full source code of the APK! 😲


Extract AndroidManifest.xml 📝​

After decompiling, you might want to extract AndroidManifest.xml which contains all the app settings. There are two ways:
  1. Using Android Studio (more advanced).
  2. Using WinRAR / WinZip (easy for beginners).
We’ll use WinRAR because it’s simple and fast.


Rebuild & Install APK 🔧​

After making changes or extracting what you need, you can rebuild the APK and install it on any Android device using ADB Installer.
  • We’ll cover detailed ADB installation steps in another guide.


Quick Code Example 💻​

Here’s an example of Java decompiled code you might see inside an APK:
Java:
public class MainActivity extends AppCompatActivity {
    private String secretNumber = "12345"; // The secret number to find

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        System.out.println("Secret Number: " + secretNumber);
    }
}

Summary:
Using Dex2jar and JD-GUI, you can decompile any Android APK, explore its code, extract AndroidManifest.xml, and learn important concepts in Android reverse engineering and ethical hacking. 🔐
 
Last edited:
Related Threads
x32x01
Replies
0
Views
988
x32x01
x32x01
x32x01
Replies
0
Views
1K
x32x01
x32x01
x32x01
Replies
0
Views
1K
x32x01
x32x01
x32x01
Replies
0
Views
1K
x32x01
x32x01
x32x01
Replies
0
Views
1K
x32x01
x32x01
Register & Login Faster
Forgot your password?
Forum Statistics
Threads
709
Messages
719
Members
69
Latest Member
MuhammadBilal
Back
Top