Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,676 Members 51,405 Now Online
XDA Developers Android and Mobile Development Forum

[TUTORIAL][HOW TO]Decompile,Recompile apps via APKTOOL{screenshot explanation]

Tip us?
 
Powerhouse
Old
(Last edited by Powerhouse; 16th January 2014 at 02:31 AM.)
#1  
Powerhouse's Avatar
Senior Member - OP
Thanks Meter 1966
Posts: 795
Join Date: Mar 2013
Default [TUTORIAL][HOW TO]Decompile,Recompile apps via APKTOOL{screenshot explanation]

HOW TO DE-COMPILE , RE-COMPILE USING "APKTOOL"

WHAT IS APK-TOOL :
ABOUT :
It is a tool for re-engineering 3rd party, closed, binary Android apps.

It can decode resources to nearly original form and rebuild them after making some modifications; it makes possible to debug smali code step by step.

Also it makes working with app easier because of project-like files structure and automation of some repetitive tasks like building apk, etc.
EXPLANATION :
Suppose you want to modify an App according to the way you want it to be ..!!! This can't be done without any Tool .. So @iBotPeaches introduced the legendary Tool "APK-TOOL" ... It is used to modify the apps ..!! De-odexed app's make the work more easier ..It can decode resources to nearly original form..It hepls us with many repetitive tasks ..
[/INDENT][/INDENT]



SETTING UP APK-TOOL :


1) Install Java JDK :-

Before installing the Android SDK, you’ll have to install Oracle’s Java development kit. You can download it from here...(click me !!)

Even if you already have the Java runtime (JRE) installed, you’ll need to install the JDK as well...


After installing Java JDK , you can now download the Android SDK from Google .

NOTE :- If you see a any type of Java-related error during installation, then download and install the x86 version of the JDK, not the x64 one ...



2) Install Android SDK :-

Download Android SDK from here...(click me !!!)


After clicking on "DOWNLOAD FOR OTHER PLATFORMS" , you will get an extended menu ..




After downloading the .exe file , then Double click on the .exe file and install it in C:\ Drive or on whichever drive you wanna install .



3) Android SDK Setup :

Once the Android SDK is downloaded and installed, launch the SDK Manager application from your Start menu.



Enable the Android SDK tools and SDK Platform-tools checkbox and click the Install button. This downloads and installs the platform-tools package, which contains ADB and other utilities.




4) SETTING UP APK-TOOL :

Download Apk-tool from here ...(click me ...!! )

Now extract the Tar file...Open the extracted Apk-tool Folder...



Now hold shift and right-click button ..Now select "open command prompt here" in the new extended menu ..


And now , you gotta install Framework-res.apk,system-UI.apk ..etc ..

Code:
Select Code
apktool if framework-res.apk
or

Code:
Select Code
apktool if name_of_apk_you_wanna_install .apk

Now lets decompile a .apk file ..

Here i will take Framework-res.apk as example ..

Code:
Select Code
apktool d framework-res.apk
or

Code:
Select Code
apktool d name_of_app_you_wanna_decompile .apk




After Modding the app it's time to re-compile the app ... Note that here you need not to enter the .apk extension as weel Just add the Decompiled folder name .. Like in my case the folder name is "framework-res"

Code:
Select Code
apktool b framework-res
or
Code:
Select Code
apktool b name_of _the_folder_of_app_you_decompiled
Now you can find your Modified new app in the 'dist" folder which is present in the De-compiled app Folder ..











Most important part is that you gotta sign your modified app .. In case of a system app there is no need . But if you modded any non-system app then signing the app is necessary or else the app won't install ..


SIGNING APP


Download this..{click me..!!}

Extract the .zip file and place the app which is to be signed in the folder..Now

Code:
Select Code
java -jar signapk.jar certificate.pem key.pk8 path_of-folder-having-the-apkWhichIsToBeSigned .apk path-of-the-new-signed-apk.apk
eg ::
Code:
Select Code
 java -jar signapk.jar certificate.pem key.pk8 c:/xda/apktool/system_unsigned.apk c:/xda/apktool/system_signed.apk

ZIPALIGNING THE APP

copy zipalign.exe from C:\Program Files\Android\android-sdk\tools

Open cmd and type this code

Code:
Select Code
zipalign -fv 4 nameOfAppYouWantToZipalign.apk New_NameOfZipalignedApp.apk
eg :

Code:
Select Code
zipalign -fv 4 framework-res.apk framework-new.apk



CREDITS ::

brut.all
iBotPeaches
All the guys who supported me and whatsapp friends ..
android-blog {learn it from 'em when i was new}
The Following 4 Users Say Thank You to Powerhouse For This Useful Post: [ Click to Expand ]
 
Powerhouse
Old
(Last edited by Powerhouse; 28th December 2013 at 06:29 PM.)
#2  
Powerhouse's Avatar
Senior Member - OP
Thanks Meter 1966
Posts: 795
Join Date: Mar 2013
Please click me ..!!

Dont forget to Rate the thread as 5stars and newsWorthy thread
The Following 3 Users Say Thank You to Powerhouse For This Useful Post: [ Click to Expand ]
 
Powerhouse
Old
#3  
Powerhouse's Avatar
Senior Member - OP
Thanks Meter 1966
Posts: 795
Join Date: Mar 2013
reserved once again}
The Following 2 Users Say Thank You to Powerhouse For This Useful Post: [ Click to Expand ]
 
iamareebjamal
Old
#4  
iamareebjamal's Avatar
Recognized Contributor / Themer
Thanks Meter 4609
Posts: 3,581
Join Date: Aug 2012
Location: Batcave
(Just saying)

You don't require Android SDK for apktool
 
Powerhouse
Old
#5  
Powerhouse's Avatar
Senior Member - OP
Thanks Meter 1966
Posts: 795
Join Date: Mar 2013
Quote:
Originally Posted by iamareebjamal View Post
(Just saying)

You don't require Android SDK for apktool
Ya ..There is no need of Android SDK for apktoool but the tools might be helpful for Logcat'ting and Pushing the files via ADB ..
 
Hitesh2626
Old
#6  
Hitesh2626's Avatar
Recognized Contributor
Thanks Meter 1339
Posts: 1,592
Join Date: Feb 2013
Location: ☆◢Mumbai◣☆
Nice explanation it is very helpful for Newbies
The Following User Says Thank You to Hitesh2626 For This Useful Post: [ Click to Expand ]
 
Nonta72
Old
#7  
Nonta72's Avatar
Senior Member
Thanks Meter 409
Posts: 446
Join Date: Mar 2013
Location: Gallifrey
Anyway to do this using Android Device itself ?








Sent from Gallifrey using TARDIS

The Following User Says Thank You to Nonta72 For This Useful Post: [ Click to Expand ]
Tags
how to decompile recompile using apk-tool, how to hack xda accounts xd 2, how to kill people xd, how to use apktool
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes