Reputation: 711
I find the solution to decompile a file dex to jar from this link https://github.com/pxb1988/dex2jar but i don't understand how to use it.
Upvotes: 68
Views: 256794
Reputation: 14318
sh d2j-dex2jar.sh -f ~/path/to/apk_to_decompile.apk
apk
to jar
.dex
to jar
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
jar
from dex
./xxx/dex-tools-2.1-SNAPSHOT/d2j-dex2jar.sh -f com.huili.readingclub8825612.dex dex2jar com.huili.readingclub8825612.dex -> ./com.huili.readingclub8825612-dex2jar.jar
jar
to java src
jar
to java sourcecode
, then you, have multiple choice:
* using Jadx
directly convert dex
to java sourcecode
* first convert dex
to jar, second convert
jarto
java sourcecode`d2j-dex2jar.sh
?download from dex2jar github release, got dex-tools-2.1-SNAPSHOT.zip, unzip then got
d2j-dex2jar.sh
d2j-dex2jar.bat
d2j-jar2dex.sh
d2j-dex2smali.sh
d2j-baksmali.sh
d2j-apk-sign.sh
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): 安卓应用的安全和破解
Upvotes: 5
Reputation: 2860
Can be used as follow:
d2j-dex2jar release.apk
Upvotes: 1
Reputation: 221
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:
Upvotes: -1
Reputation: 1
After you extract the classes.dex file, just drag and drop it to d2j-dex2jar
Upvotes: 0
Reputation: 437
Upvotes: 1
Reputation: 4617
d2j-dex2jar.sh someApk.apk
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
Upvotes: 45
Reputation: 370
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
Upvotes: 2
Reputation: 3109
Upvotes: 3
Reputation: 3098
Simple way
Upvotes: 28
Reputation: 2517
You can decompile your .apk files and download online.
http://www.javadecompilers.com/
Upvotes: 4
Reputation: 1464
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.
Upvotes: 4
Reputation: 12302
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... :)
Upvotes: 90
Reputation: 531
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
Upvotes: 43