October 18, 2010 by

Android uses a DEX archive in place of JAR. Also, the Java classes are compiled differently. To decompile the classes, you need to go through a few extra steps.

What Will You Need?

  1. Dex2Jar from https://code.google.com/p/dex2jar/
  2. A regular Java decompiler, such as JD from http://java.decompiler.free.fr.

Install these programs.

The Steps

First, extract the .apk file of the Android application.

jar  xvf  HelloWorld.apk

You will notice classes.dex file in the extracted folder.

Next, run dex2jar to convert the classes.dex file to a JAR file.

dex2jar.bat  classes.dex

This will produce an improbably named classes.dex.dex2jar.jar file.

Launch JD decompiler. Open the classes.dex.dex2jar.jar file and then view the .class files.

17 Comments

Skyman Scott

Would you please add nstructions on the steps to put the apk file back together? Thanks.

Reply
XtremeXcata

Man i cant understand how to open dex2jar.bat file and how to compile classes.dex !! plz tell me step by step!

Reply
Ayush Pateria

Its simple, Unzip dex2jar. In dex2jar directory paste your .apk or .dex file.
Open CMD, go to dex2jar durectory using cd, and type: dex2jar YourApp.apk
You will automatically get a .jar. Use jd gui to decompile it.

Reply
Ailson

Ailson :
Gostei, o melhor tutorial sobre o assunto. (Brazil). I liked, the best tutorial on the subject.

Reply
anvnguyen

When I run: jar xvf
It generates a *.arsc instead of a *.dex file.
Please help me!

Reply
kEERTHIKIRAN

converting using
C> dex2jar classes.dex

ust showing an error :
“Error occurred during initialization of VM
could ot reserve enough space for object heap
could not create the Java virtual machine”

My java and jdk are working perfectly and classpath is also good.Also using latest version JDK

What could I do ? please give me a suggession.

Reply
Salman

jar xvf ABC.apk
‘jar’ is not recognized as an internal or external command,operable program or batch file.

Reply
G3P0

Ayush Pateria :
Its simple, Unzip dex2jar. In dex2jar directory paste your .apk or .dex file.
Open CMD, go to dex2jar durectory using cd, and type: dex2jar YourApp.apk
You will automatically get a .jar. Use jd gui to decompile it.

I just downloaded the Git repo and extracted it.
I’m unable to find a .bat file in any of the directorys created. Is there another way to launch the decompiler?

G

Reply

Leave a Reply

Your email address will not be published. Required fields are marked *