170

Is it possible to decompile an APK package or DEX file on Android platform? Are there any tools that can decompile an APK file?

Tanveer Badar
  • 5,438
  • 2
  • 27
  • 32
user3151261
  • 1,947
  • 2
  • 13
  • 12

8 Answers8

198

You need Three Tools to decompile an APK file.

  1. Dex2jar - Tools to work with android .dex and java .class files

  2. ApkTool - A tool for reverse engineering Android apk files

  3. JD-GUI - Java Decompiler is a tools to decompile and analyze Java 5 “byte code” and the later versions.

for more how-to-use-dextojar. Hope this will help You and all! :)

Community
  • 1
  • 1
Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70
  • 1
    I think all these tools run in windows platform. can I import these jar files into my android project and then run in android platform – user3151261 Jan 10 '14 at 02:39
  • Rupesh Yadav@ In this process some code of line is miss match to original code. www.decompileandroid.com/ from this web i able to decompile my code but both code are different why? – Shailendr singh Jun 02 '14 at 04:51
  • 1
    @Shailendrsingh the above is the standard process to decompile an APK and in case when obfuscation is enabled in app the decompiled classes code may differs. – Rupesh Yadav Jun 02 '14 at 06:33
  • ok if obfuscation is enable in app.how can i get original code which are written in app? – Shailendr singh Jun 02 '14 at 07:03
  • 2
    @Shailendrsingh its possible only if you are having reverse mapping file, otherwise can`t get 100% out of an APK file. – Rupesh Yadav Jun 02 '14 at 12:50
  • [AppUse](https://appsec-labs.com/AppUse) collected all the above tools into one tool. – Elhanan Mishraky Sep 24 '14 at 08:56
50

Online APK Decompiler
http://www.decompileandroid.com/
https://www.decompiler.com/
APK Decompiler App for Windows
http://forum.xda-developers.com/showthread.php?t=2493107

Update 2015/12/04
ClassyShark you can open APK/Zip/Class/Jar files and analyze their contents. https://github.com/google/android-classyshark

Update 2021/1/28
https://ibotpeaches.github.io/Apktool/
https://github.com/skylot/jadx

B M
  • 1,863
  • 1
  • 25
  • 40
  • 3
    DecompileAndroid unfortunately doesn't decompile strings.xml correctly – goRGon Feb 05 '15 at 19:50
  • ProGuard entirely remove R$string.class, but Android decompilers can reconstruct all information from resources.arsc. I think this DecompileAndroid hasn't implemented this kind of complicated function yet – LiangWang Feb 12 '16 at 00:01
  • thx for the update, jadx seems to work, although the export does not seem to work, so I cannot open the project in Android Studio – rubo77 Dec 22 '21 at 00:40
12

I have created a tool that combines dex2jar, jd-core and apktool: 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.

dirkvranckaert
  • 1,364
  • 1
  • 17
  • 30
9

An APK is just in zip format. You can unzip it like any other .zip file.

You can decompile .dex files using the dexdump tool, which is provided in the Android SDK.

See https://stackoverflow.com/a/7750547/116938 for more dex info.

Community
  • 1
  • 1
Austyn Mahoney
  • 11,398
  • 8
  • 64
  • 85
  • 1
    *"An APK is just in zip format"*, true but many files including the `AndroidManifest.xml` don't unzip properly and are not readable... – Ben Winding Aug 20 '20 at 04:06
6

http://www.decompileandroid.com/

This website will decompile the code embedded in APK files and extract all the other assets in the file.

Vladimir Panteleev
  • 24,651
  • 6
  • 70
  • 114
Ranjithkumar
  • 16,071
  • 12
  • 120
  • 159
5

You can decompile an apk on Android device using this : https://play.google.com/store/apps/details?id=com.njlabs.showjava

For more info look here: http://forum.xda-developers.com/showthread.php?t=2601315

EDIT: 28-02-2015

For decompiling an apk you can use this tool: https://apkstudio.codeplex.com/license

If that doesnt help check this link

Ultimo_m
  • 4,724
  • 4
  • 38
  • 60
3

You can also use the apktool: http://ibotpeaches.github.io/Apktool/ which will also give you the xml res files. Along with that you can also use the dex2jar system which will output the dex file in the apk to a jar file that can be opened with JD-GUI and exported to standard java files.

mostar
  • 4,723
  • 2
  • 28
  • 45
w9jds
  • 877
  • 6
  • 17
0

Also you can use Android Multitool. You can make minor changes in the app like hiding GUI elements or modifying small part of Logic and rebuild the apk. Its easy to use and decompile/recompile apk and jar files. Here is the Link you can checkout.

Cheers

trueblue
  • 306
  • 1
  • 5
  • 17