I find the solution to decompile a file dex to jar from this link http://code.google.com/p/dex2jar/downloads/list but i don't understand how to use it.
-
1adding download link : https://sourceforge.net/projects/dex2jar/files/ project is moved. – jeet.chanchawat Sep 17 '20 at 10:35
-
to get only symbol information, just drag and drop the .dex file into your android studio – Abhinav Atul Feb 19 '21 at 16:48
13 Answers
Follow the below steps to do so_
- Rename your APK file(e.g., rename your APK file to .zip Ex- test.apk -> test.zip) & extract resultant zip file.
- Copy your .dex file in to dex2jar folder.
- Run setclasspath.bat. This should be run because this data is used in the next step.
- Go to Windows Command prompt, change the folder path to the path of your dex2jar folder and run the command as follows: d2j-dex2jar.bat classes.dex
- enjoy!! Your jar file will be ready in the same folder with name classes_dex2jar.jar.
Hope this helps you and All reading this... :)

- 12,096
- 4
- 53
- 70
-
16
-
6if you don't have `setclasspath.bat` you can just skeep part with it (works for me) – Mike Herasimov Jul 18 '16 at 19:39
- Download dex2jar https://code.google.com/p/dex2jar/downloads/list
- Run dex2jar on apk
d2j-dex2jar.sh someApk.apk
- open jar file in JD GUI http://jd.benow.ca/
Follow this guide: https://code.google.com/p/dex2jar/wiki/UserGuide
--Update 10/11/2016--
Found this ClassyShark from Google's github pretty easy to view code from APK.
https://github.com/google/android-classyshark
// make sure that you downloaded release https://github.com/pxb1988/dex2jar/releases (for the ppl who coldnt find this link in /dex2jar/downloads/list
-
2Where do you see this **d2j-dex2jar.sh**? I don't see it anywhere. – IgorGanapolsky Aug 19 '16 at 18:48
-
2@IgorGanapolsky , download the latest version of dex2jar (link: https://sourceforge.net/projects/dex2jar/) & you'll get both `bat` & `sh` versions of each script. – Touhid Feb 15 '17 at 18:20
-
I still can not find the d2j-dex2jar.sh file. İt is really interesting. – Olkunmustafa Feb 25 '18 at 10:33
Step 1 extract the contents of dex2jar.*.*.zip file Step 2 copy your .dex file to the extracted directory Step 3 execute dex2jar.bat <.dex filename> on windows, or ./dex2jar.sh <.dex filename> on linux

- 531
- 4
- 6
-
I'm using ubuntu and while running the 3rd command i'm getting an error: bash: ./dex2jar.sh:Permission denied , what's wrong happening here – Khay Jan 13 '14 at 07:22
-
3you will need to specify read,write and execute permission, possibly you can write chmod 777 "directory name" – Kirtikumar A. Aug 27 '14 at 05:34
-
1@kendrelaxman i m also not getting 3rd point can u tell me how to do that ? – nida Jan 15 '15 at 04:36
-
@kendrelaxman regarding the 3rd step what did you do? I'm using Windows. how should I execute it? cmd? – Ari Jun 30 '16 at 16:51
-
7
-
@IgorGanapolsky, make sure you do not clone, but download the release: https://github.com/pxb1988/dex2jar/releases – Daan Mar 11 '19 at 09:42
Simple way
- Rename your test.apk => test.zip
- Extract test.zip then open that folder
- Download dex2jax & Extract
- Copy classes.dex file from test folder
- Past to dex2jar Extracted folder
- if use windows press Alt & D keys then type cmd press Enter(open to cmd)
- run the command d2j-dex2jar.bat classes.dex
- Download JD-GUI
- Move classes-dex2jar.jar file to JD-GUI
- Everything Done..

- 2,978
- 26
- 31
old link
- the link http://code.google.com/p/dex2jar/downloads/list is old, it will redirect to https://github.com/pxb1988/dex2jar
dex2jar syntax
- in https://github.com/pxb1988/dex2jar, you can see your expected usage/syntax:
sh d2j-dex2jar.sh -f ~/path/to/apk_to_decompile.apk
- can convert from
apk
tojar
.
want
dex
tojar
- if you have
dex
file (eg. usingFDex2
dump from a running android apk/app), then you can: sh d2j-dex2jar.sh -f ~/path/to/dex_to_decompile.dex
- can got the converted
jar
fromdex
. - example:
/xxx/dex-tools-2.1-SNAPSHOT/d2j-dex2jar.sh -f com.huili.readingclub8825612.dex dex2jar com.huili.readingclub8825612.dex -> ./com.huili.readingclub8825612-dex2jar.jar
- if you have
want
jar
tojava src
- if you continue want convert from
jar
tojava sourcecode
, then you, have multiple choice:- using
Jadx
directly convertdex
tojava sourcecode
- first convert
dex
tojar, second convert
jarto
java sourcecode`
- using
- if you continue want convert from
Note
how to got d2j-dex2jar.sh
?
download from dex2jar github release, got dex-tools-2.1-SNAPSHOT.zip, unzip then got
- you expected Linux's
d2j-dex2jar.sh
- and Windows's
d2j-dex2jar.bat
- and related other tools
d2j-jar2dex.sh
d2j-dex2smali.sh
d2j-baksmali.sh
d2j-apk-sign.sh
- etc.
- and Windows's
what's the full process of convert dex
to java sourcecode
?
you can refer my (crifan)'s full answer in another post: android - decompiling DEX into Java sourcecode - Stack Overflow
or refer my full tutorial (but written in Chinese): 安卓应用的安全和破解

- 12,947
- 1
- 71
- 56
If anyone is still looking for an easy way to decompile an APK (with resource decompiling), have a look at the tools I have created: https://github.com/dirkvranckaert/AndroidDecompiler
Just checkout the project locally and run the script as documented and you'll get all the resources and sources decompiled.

- 1,364
- 1
- 17
- 30
You can decompile your .apk files and download online.

- 2,517
- 25
- 19
-
This worked like a charm! Was even able to go straight from apk to source. Thanks for the share! – mattLummus Jun 13 '16 at 17:21

- 2,963
- 1
- 36
- 40
-
1
-
1@IgorGanapolsky: It will be inside the directory extracted from the zip of dex2jar – ND27 Mar 09 '17 at 03:55
-
-
1@MustafaOlkun Download dex2jar-2.0.zip from above link. It is inside the folder. I just checked it. – Parinda Rajapaksha Feb 27 '18 at 04:17
-
1
If you're looking for the version for windows get it from source forge: https://sourceforge.net/projects/dex2jar/
It has the d2j-dex2jar.bat file you need

- 350
- 3
- 11
-
1In this case, please post this as a comment instead of an answer if you think its helpful to give a hint towards answering the original question. Answers are for complete solutions to the original question only and not to share your own experience. – Bobby Nov 05 '16 at 14:40
- Download Dex2jar and Extract it.
- Go to Download path ./d2j-dex2jar.sh /path-to-your/someApk.apk if .sh is not compilable, update the permission: chmod a+x d2j-dex2jar.sh.
- It will generate .jar file.
- Now use the jar with JD-GUI to decompile it

- 447
- 1
- 5
- 16
Can be used as follow:
- Download dex2jar here and extract it.
- Download Java decompiler here (If you want to investigate .class file)
- Get you release .apk file and change its extension with .zip
- Extract .zip and find the classes.dex and classes2.dex
- Paste these files into dex2jar folder where .bat file exist of dex2jar (normally names as d2j-dex2jar)
- From dex2jar folder, open cmd [Shift+right click to see option to open cmd/power shell]
- Type the command in cmd:
d2j-dex2jar release.apk
- You will get the .class file, open this file into Java Decompiler.

- 2,320
- 1
- 23
- 32
The below url is doing same as above answers. Instead of downloading some jar files and doing much activities, you can try to decompile by:

- 221
- 3
- 7