FORUMS

Analysis & Opinion

Top Forum Discussions

[GUIDE] How to use APKTOOL

1,265 posts
Thanks Meter: 489
 
By anasdcool71, Senior Member on 17th September 2012, 06:12 PM
Post Reply Subscribe to Thread Email Thread
I've seen many users inquiring about how to decompile apps. Although there are many threads on this, still users don't search. So i decided to create this guide as our GT-S5360 forum didn't have one. I learnt this from v6ser's tut about 5-6 months ago, so i would like to thank him before starting this guide. Please PM me guys if I've missed something or written something wrong!

What is decompiling?
Android apps are BASICALLY made up of Java codes and XML files. After compiling the app, these files cannot be viewed. Decompiling is a process which decompiles the binary form of XMLs and .Java files into readable form. The XML files can be retained as it is, but the .java files are converted into smali files, a totally different language.

What is recompiling?
Recompiling is simply a way to convert the XML and smali files back into the binary form and building up of the APK with the changes made. All apps after recompiled have to be signed (except system apps).

Let's start!

Things needed :-
JRE (Java Runtime Environment)
Windows - Download apktool
Download apktool-install-windows
Place both apktool files in C:\Windows\"HERE"

First off, you need to install the framework.
The three apks needed :-
framework-res.apk (location : /system/framework)
SystemUI.apk (location : /system/app)
twframework-res.apk (location : /system/framework)

Go to Command Prompt, and type :-
Code:
apktool if {framework's folder/location}
Example in the image here :-


Repeat the same step for SystemUI.apk and twframework-res.apk too, besides framework-res.apk
These will be saved here - C:\Users\your_user_name\apktool\"HERE"

Next step, is the decompiling.
Code:
apktool d C:\filename.apk C:\folder_of_the_decompiled_files
Example in the image here :-


Now, you can view the XML and smali files. I would recommend Notepad++ to edit them.
After making your changes, you're gonna need to recompile so that the files are again in the apk form.

Next step, recompiling.
Code:
apktool b C:\folder_of_the_decompiled_files C:\newfilename.apk
(You can use other directories too, I've just used C:\ as an example)
Example in the image here :-


Now, final step is signing the apk file.
Remember don't sign the apk if it's a SYSTEM app, unless you have edited the AndroidManifest.xml.

Signing.
Download the zip file here :- http://www.mediafire.com/?gs6n10oh09c039n
Extract the files in a folder named "SignApk", in any convienient location. (I preferred C:\)

Example of the code in image here :-


That's it! I hope this guide helps a lot of newbies and other users out there!
Last edited by kinfauns; 15th April 2013 at 04:46 PM.
The Following 156 Users Say Thank You to anasdcool71 For This Useful Post: [ View ]
 
 
17th September 2012, 06:14 PM |#2  
Recognized Developer / Recognized Contributor
Flag New Delhi
Thanks Meter: 5,153
 
Donate to Me
More
Reserved. why use it when you have apk manager and VTS?
The Following 5 Users Say Thank You to hell_lock For This Useful Post: [ View ]
17th September 2012, 06:17 PM |#3  
anasdcool71's Avatar
OP Senior Member
Flag Jamshedpur
Thanks Meter: 489
 
More
Quote:
Originally Posted by hell_lock

Reserved. why use it when you have apk manager and VTS?

I and many other users prefer it a for being simple. Apk manager and others can cause a lot of trouble when you don't have adb, or anything else.
The Following 3 Users Say Thank You to anasdcool71 For This Useful Post: [ View ]
17th September 2012, 06:23 PM |#4  
-CALIBAN666-'s Avatar
Recognized Contributor
Flag Leverkusen-Wiesdorf
Thanks Meter: 3,934
 
Donate to Me
More
One of the usefullest threads i hope many newbies read this for understand.thumps up and up and up.....

MANY GREEEEETZ!!!
The Following User Says Thank You to -CALIBAN666- For This Useful Post: [ View ]
18th September 2012, 07:37 AM |#5  
manoranjan2050's Avatar
Senior Member
Flag JAGATSINGHPUR
Thanks Meter: 1,409
 
Donate to Me
More
Very nice thread..... Really helpful for all new user........

Sent from my GT-S6102 using Tapatalk 2
The Following 2 Users Say Thank You to manoranjan2050 For This Useful Post: [ View ]
18th September 2012, 12:19 PM |#6  
anasdcool71's Avatar
OP Senior Member
Flag Jamshedpur
Thanks Meter: 489
 
More
Glad you guys liked it.

Sent from my GT-S5360 using Tapatalk 2
The Following User Says Thank You to anasdcool71 For This Useful Post: [ View ]
19th September 2012, 12:18 PM |#7  
Kousthubha Kumar's Avatar
Senior Member
Thanks Meter: 333
 
More
Could be useful for newbies, a detailed tutorial is hard to get, good work
The Following User Says Thank You to Kousthubha Kumar For This Useful Post: [ View ]
21st September 2012, 09:01 AM |#8  
RivaultUser's Avatar
Senior Member
Thanks Meter: 18
 
More
Question
Thx a lot for the tutorial mate! It's really helpful!

1 question! : If I want to edit the framework( I get it from another mod, so it's not my stock framework). Do I need to install the framework every time I want to mod a framework that I just get?


Thx a lot man!



I'm a newbieee
21st September 2012, 09:37 AM |#9  
Member
Thanks Meter: 8
 
More
good thread
21st September 2012, 10:03 AM |#10  
anasdcool71's Avatar
OP Senior Member
Flag Jamshedpur
Thanks Meter: 489
 
More
Quote:
Originally Posted by RivaultUser

Thx a lot for the tutorial mate! It's really helpful!

1 question! : If I want to edit the framework( I get it from another mod, so it's not my stock framework). Do I need to install the framework every time I want to mod a framework that I just get?


Thx a lot man!



I'm a newbieee

No need...i mod many roms' frameworks but the installed one in apktool is repencis framework....btw, it would be better if you do it...

You can always press the thanks button if you wanna thank me!

Sent from my GT-S5360 using xda premium
The Following 4 Users Say Thank You to anasdcool71 For This Useful Post: [ View ]
21st September 2012, 10:49 AM |#11  
RivaultUser's Avatar
Senior Member
Thanks Meter: 18
 
More
Question
Quote:
Originally Posted by anasdcool71

No need...i mod many roms' frameworks but the installed one in apktool is repencis framework....btw, it would be better if you do it...

You can always press the thanks button if you wanna thank me!

Sent from my GT-S5360 using xda premium

Okay mate, can you help me solve this problem I had?
When I tried to recompile back my mod framework-res.apk I got this message :

C:\APKTOOL>apktool b testframework-res
W: Could not find sources
I: Checking whether resources has changed...
I: Building apk file...



What could not find resources means?


Thx for your help!

Read More
Post Reply Subscribe to Thread

Tags
apk, apktool, compile, decompile, how to

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes