- 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.
As we know, Java executables can be decompiled. Similarly, you can convert an APK into a JAR file.
If everything works, you’ll get a file called: yeahhub-dex2jar.jar in the same folder. 🎉
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. 🔐
Download & Set Up Dex2jar 📥
The first thing you need is Dex2jar:- Download: Dex2jar.zip
- Extract it anywhere on your computer.
- 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.apkIf 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:- Open JD-GUI.
- Open the yeahhub-dex2jar.jar file inside the tool.
Extract AndroidManifest.xml 📝
After decompiling, you might want to extract AndroidManifest.xml which contains all the app settings. There are two ways:- Using Android Studio (more advanced).
- Using WinRAR / WinZip (easy for beginners).
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: