how to use DEXtoJar

Decompiler

Decompiler Problem Overview


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.

Decompiler Solutions


Solution 1 - Decompiler

Follow the below steps to do so_

>1. Rename your APK file(e.g., rename your APK file to .zip Ex- test.apk -> test.zip) & extract resultant zip file. 2. Copy your .dex file in to dex2jar folder.

  1. Run setclasspath.bat. This should be run because this data is used in the next step.
  2. 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
  3. enjoy!! Your jar file will be ready in the same folder with name classes_dex2jar.jar.

Hope this helps you and All reading this... :)

Solution 2 - Decompiler

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

Solution 3 - Decompiler

  1. Download dex2jar https://code.google.com/p/dex2jar/downloads/list
  2. Run dex2jar on apk d2j-dex2jar.sh someApk.apk
  3. 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

Solution 4 - Decompiler

Simple way

  1. Rename your test.apk => test.zip

  2. Extract test.zip then open that folder

  3. Download dex2jax & Extract

  4. Copy classes.dex file from test folder

  5. Past to dex2jar Extracted folder

  6. if use windows press Alt & D keys then type cmd press Enter(open to cmd)

  7. run the command d2j-dex2jar.bat classes.dex

  8. Download JD-GUI

  9. Move classes-dex2jar.jar file to JD-GUI

  10. Everything Done..

Solution 5 - Decompiler

  1. old link
  1. dex2jar syntax
  1. want dex to jar
  • if you have dex file (eg. using FDex2 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 from dex.
  • 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
  1. want jar to java src
  • if you continue want convert from jar to java sourcecode, then you, have multiple choice: * using Jadx directly convert dex to java sourcecode * first convert dex to jar, second convert jartojava sourcecode`

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.

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): 安卓应用的安全和破解

Solution 6 - Decompiler

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.

Solution 7 - Decompiler

You can decompile your .apk files and download online.

http://www.javadecompilers.com/

Solution 8 - Decompiler

  1. Download latest dex2jar from here -> dex2jar
  2. Run this command on linux -> sh d2j-dex2jar.sh classes.dex
  3. Download java decompiler from here - > JD-GUI
  4. Drag and drop the classes-dex2jar.jar file to JD-GUI

Solution 9 - Decompiler

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

Solution 10 - Decompiler

  1. Download Dex2jar and Extract it.
  2. 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.
  3. It will generate .jar file.
  4. Now use the jar with JD-GUI to decompile it

Solution 11 - Decompiler

After you extract the classes.dex file, just drag and drop it to d2j-dex2jar

Solution 12 - Decompiler

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:

http://apk-deguard.com/

Solution 13 - Decompiler

Can be used as follow:

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionfouView Question on Stackoverflow
Solution 1 - DecompilerRupesh YadavView Answer on Stackoverflow
Solution 2 - DecompilerNitin NizhawanView Answer on Stackoverflow
Solution 3 - DecompilerPrakashView Answer on Stackoverflow
Solution 4 - DecompilerA.G.THAMAYSView Answer on Stackoverflow
Solution 5 - DecompilercrifanView Answer on Stackoverflow
Solution 6 - DecompilerdirkvranckaertView Answer on Stackoverflow
Solution 7 - DecompilerBurhan ARASView Answer on Stackoverflow
Solution 8 - DecompilerParinda RajapakshaView Answer on Stackoverflow
Solution 9 - DecompilerTommyView Answer on Stackoverflow
Solution 10 - DecompilerND27View Answer on Stackoverflow
Solution 11 - DecompilerByBoraView Answer on Stackoverflow
Solution 12 - DecompilerSarojini2064130View Answer on Stackoverflow
Solution 13 - DecompilerAmir RazaView Answer on Stackoverflow