Question

I have searching in search Engine regarding convert dex file to jar file but I got failure to find dex2jar file in code.Google.com

I have getting basic idea from here.

But when I download file from dex2jar-0.0.9.8.zip form here, I unable to found dex2jar.jar file so can you tell me else where I can find file?

Was it helpful?

Solution

Extract the dex2jar-0.0.9.8.zip file and move to desktop folder like dex2jar-0.0.9.7...then take the android app classes.dex file and move to this directory ...open the terminal and change to your dex2jar directory..type this command

./d2j-dex2jar.sh classes.dex

you will get classesdex2.jar file and you can open this file using java decompiler...

OTHER TIPS

Navigate to extracted folder in command prompt and run command "dex2jar your.apk" and its output will be jar file. This jar file can be viewed in jd-gui window.

check the link below , it shows with snapshots

http://a4apphack.com/security/sec-code/extract-android-apk-from-market-and-decompile-it-to-java-source

Extract dex2jar-0.0.9.8.zip and copy classes.dex, which is extarcted from apk file to that folder and use below command instead of dex2jar classes.dex because it is deprecated

./d2j-dex2jar.sh classes.dex

dex2jar is not an actual jar. if you look closely, you will see that there is d2j-dex2jar.bat instead :) hope this helps

extract the dex2jar-0.0.9.8.zip and in your terminal go to the dex2jar-0.0.9.8 folder and run the delow command

  $d2j-dex2jar.sh -f -o test_apk-debug.jar ./Desktop/YourApk.apk 

//now you can see the jar file. if you open the jar you can fine the class files under you package name.

I too had the same issue, Thus I downloaded my file from here.

While the file is downloading, go to your .apk file. Rename the .apk to .zip and extract zip file (which was apk once) inside a new folder.

Now as the file is been downloaded "dex2jar-0.0.9.15.zip". Extract this file inside new folder you just create and you will have a folder "/dex2jar-0.0.9.15".

Copy your "classes.dex" file from new folder to "/dex2jar-0.0.9.15" and now open Terminal and switch inside the /dex2jar-0.0.9.15 folder. And run command

tamta@tamta:~/new_folder/dex2jar-0.0.9.15$ ./d2j-dex2jar.sh classes.dex

This will create a file classes-dex2jar.jar for you inside the same folder.

Until now you had .dex file known as Dalvik Executable. If you use apktool you only get .smali , which is also not in a understandable form, So now we use "JAVA Decompiler" but we can understand JAVA and to convert do the following.

Goto Download Link

And download JD-GUI.

As you open JD-GUI:

goto folder
/new_folder/dex2jar-0.0.9.15

and open: "classes-dex2jar.jar"

Now again goto >file>Save All Sources

and save the file with the name src.

Now extract src, and enjoy reading android source code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top