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?
- Dex2Jar from https://code.google.com/p/dex2jar/
- 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.
Would you please add nstructions on the steps to put the apk file back together? Thanks.
Try apktool: http://code.google.com/p/android-apktool/
Also, Eclipse Android tooling can build APK files.
[…] least, those are the steps according to WebageSolutions. AndroidGuys says you can stop at #6 then just use WinRAR to open the […]
[…] unpack the files. If you don’t, install it.Now go ahead and adjust it to your liking![Thanks Web Age for the Dex2Jar hint]How To Modify .apk Files originally appeared on AndroidGuys.Follow us on […]
podrias explicarlo mejor para novato
Man i cant understand how to open dex2jar.bat file and how to compile classes.dex !! plz tell me step by step!
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.
It is much easier with AndroChef Java Decompiler: http://www.neshkov.com/ac_decompiler.html
[…] least, those are the steps according to WebageSolutions. AndroidGuys says you can stop at #6 then just use WinRAR to open the […]
I worked for me fine. Thanks for sharing.
Can’t understand the steps, can you create a video demo? 😀
How did u actually acquire the ideas to compose ““Decompile Android’s DEX File
When I run: jar xvf
It generates a *.arsc instead of a *.dex file.
Please help me!
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.
jar xvf ABC.apk
‘jar’ is not recognized as an internal or external command,operable program or batch file.
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