How to Install and Use Dex2jar on Kali Linux (2025)

How to Install and Use Dex2jar on Kali Linux (2025)
User
7 Min Read
2025/07/23

I’ve used Dex2jar on Kali Linux more times than I can count especially when I needed to peek into an APK and see what it’s really doing under the hood. It extracts the classes.dex file from the APK and turns it into a .jar, which can then be opened with a Java decompiler to explore the app’s internals.

If you’ve ever needed to reverse engineer an APK or poke around in .smali files, Dex2jar makes that process much easier. In this article, I’ll show you how to install and use Dex2jar on Kali Linux with a few practical examples no fluff.

Some Notes on How Dex2jar Actually Works

I used to think Dex2jar was just one big tool, but turns out it’s made of smaller parts that each do a specific job. Honestly, most people won’t need to care but if you’re curious or get stuck somewhere, knowing these might help.

dex-reader

This one’s basically the starting point. It reads .dex or .odex files (the bytecode stuff in APKs). I never had to touch it directly, but it feeds the rest of the pipeline.

dex-translator

Converts that raw bytecode into something more workable. There’s an intermediate format called dex-ir kind of an internal layer before it becomes .class files.

dex-tools

A few extra utilities. I’ve used these to tweak an APK or dig into obfuscated classes they’re not magic, but useful when you know what you’re looking for.

I haven’t had a reason to use the smali or writer modules they seem like dev-facing tools that might show up in later updates.

Convert .dex to .jar on Kali

If you’ve got a classes.dex file (maybe pulled from an APK), and just want to turn it into a .jar, here’s what I usually do:

cd ~/Desktop

d2j-dex2jar.sh classes.dex

That should drop a classes-dex2jar.jar file right there. You can throw it into JD-GUI or whatever decompiler you like. That’s it.

kali linux ingenierie inverse

 

In this way, a JAR file will create, as you see below:

 

kali linux ingenierie inverse 2

*

Use Dex2jar On Kali Linux

 

How to Install Dex2jar on Kali Linux

If you’re using Kali with the full desktop version, Dex2jar should already be there under the reverse engineering tools. But in case it’s missing, just run:

sudo apt update
sudo apt install dex2jar

That’s all. After that, you can run d2j-dex2jar.sh from anywhere in the terminal.

Use Dex2jar on an APK

I usually just run this when I’ve got an APK and want to peek inside the code:

sh d2j-dex2jar.sh -f myapp.apk

After running the command, you’ll usually find a JAR file with a name like myapp-dex2jar.jar right in the same directory. Once you’ve got the .jar file, JD-GUI is great for exploring the decompiled classes it gives a clean tree view of the code structure.

If the .jar already exists, the -f flag just overwrites it. Saves time when testing different versions.

Converting .jar back to .dex

I had to do this once when I modified a decompiled app and wanted to rebuild it. I ran into this exact scenario before this is what I ended up doing:

With the old Android SDK, I used:

dx --dex --output=classes.dex my-modified.jar

It got the job done, but not without a bit of fiddling around with the SDK path I had to dig through some folders to make it work.

Later I tried Dex2jar’s own tool:

d2j-jar2dex.sh –output=classes.dex my-modified.jar

Worked just as well maybe even faster. Either way, you’ll end up with a new classes.dex file you can pack back into an APK.

Conclusion

That’s pretty much the whole Dex2jar journey on Kali from installing it to converting APKs and digging into the code.

One thing to watch out for: if you’re dealing with a big .dex file, the default JVM memory might not be enough. I hit that wall once got an out-of-memory error right in the middle of a conversion.

 

A quick tweak to the d2j_invoke script (just bumped up the memory flags) and it worked fine afterward. If you ever run into the same issue or want to explore other tools, the Eldernode community is a solid place to ask around.

0 out of 0 votes
Leave a Reply

Full Name*
Email*
Comment *

Calculate the value of 5 + 9 :

Save my name, email, and website in this browser for the next time I comment.
Recent Replies
Show More

We are by your side every step of the way

Think about developing your online business; We will protect it compassionately

We are by your side every step of the way

+8595670151

7 days a week, 24 hours a day