Subscribe For Free Updates!

We'll not spam mate! We promise.

Sunday 24 May 2015

How to Extract source code from APK

How to Extract source code from APK

Are you an Android enthusiast? Did you ever wish to customize an app to your needs? Wondered how you can get source code of an android app In this post, I will teach you how to get source code of an android apk file along with resource files like XML files, images,icons everything that is part of an apk.

Here is the method or guide showing how to do it.

What You Need 
1.Download the apk file for which you want the source code.
2.
Download Dex2jar from here
3.
Download jdgui, a java de-compiler to get .java files from .class files here
4.
Download apktool-install-windows-r05-ibot.tar.bz2 ( for windows ) and apktool1.5.2.tar.bz2 from here

Procedure
1.extract these two folders and you get 3 files. 
(Put all these files in one folder -  aapt.exe, apktool.bat and apktool.jar)
2.Copy the apk file into this folder.
3.Open CMD and change directory to the folder where you have aapt.exe and other files. 
( Press shift and right click in dex2jar folder to open command prompt there - a shortcut)
4.run this command  [apktool decode apk-file-name.apk]
5.You get All Resource files ( media files, XML files )and AndroidManifest.xml inside the folder com.test.app folder.6.Keep a copy of apk file and rename the .apk file to test.zip and extract using any unzipping soft wares.
 ( rename test.apk to test.zip and extract.).
7. You will have a folder with the zip-file name ( for example here "test").
8.Now extract dex2jar file you downloaded move the classes.dex file in test folder (from the apk you just extracted into dex2jar folder.
9.Open CMD and change directory to dex2jar folder. 
 10.Press shift and right click in dex2jar folder to open command prompt there - a shortcut)type  [d2j-dex2jar classes.dex]
11. you will get a file classes-dex2jar.jar file in dex2jar folder.12.Open jd-gui, click on File, Open and select the classes-dex2jar.jar file you got in the previous step and click on File, Save all resources and save it to file. 
Now extract that file you will get all the .java files for that apk.
Create a new folder src in  com.test.app folder you got and move the contents of folder created by jd-gui intosrc folder.
Now you have got all the resources and java files for the apk file.

Credits
X.D.A Developers

Help Us By Promoting
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment