Decompile Android’s DEX File


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 http://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.

  1. #1 by Skyman Scott on December 23, 2010 - 5:43 pm

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

  2. #2 by Bibhas Bhattacharya on January 4, 2011 - 5:32 pm

    Try apktool: http://code.google.com/p/android-apktool/

    Also, Eclipse Android tooling can build APK files.

  3. #3 by dano on July 24, 2011 - 12:00 pm

    podrias explicarlo mejor para novato

  4. #4 by XtremeXcata on December 24, 2011 - 6:56 am

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

  5. #5 by Ayush Pateria on January 30, 2012 - 8:38 am

    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.

  6. #6 by Nasko on April 28, 2012 - 1:12 am

    It is much easier with AndroChef Java Decompiler: http://www.neshkov.com/ac_decompiler.html

  7. #7 by Ailson on May 31, 2012 - 12:07 pm

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

  8. #8 by Rahinur Rahaman on October 2, 2012 - 12:18 am

    I worked for me fine. Thanks for sharing.

  9. #9 by aldrine on November 13, 2012 - 9:49 am

    Can’t understand the steps, can you create a video demo? :D

  10. #10 by http://tinyurl.com/stumtanks42593 on January 24, 2013 - 11:24 pm

    How did u actually acquire the ideas to compose ““Decompile Android’s DEX File

  11. #11 by anvnguyen on April 28, 2013 - 9:26 pm

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

  12. #12 by kEERTHIKIRAN on July 31, 2013 - 11:30 am

    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.

(will not be published)
*