FORUMS
Remove All Ads from XDA

[HOW TO] Use and install APKtool

172 posts
Thanks Meter: 221
 
By v6ser, Senior Member on 8th July 2012, 11:34 PM
Post Reply Email Thread
So, here i'm again porting a tutorial based on DSM_'s Tut

What do you need:
JRE (Java Runtime Environment)

Install:

Windows:
Download apktool
Download apktool-install-windows
Unpack both pakages you will get three files, copy those files to your Windows directory i.e. C:\WINDOWS

Decoding files:
Open Command. Run>cmd
Type-
Quote
apktool d file.apk [directory]
Example - apktool d D:\nfsshift.apk D:\nfsshift
Done!


FrameworkFiles

Apktool needs the framework files to decode and build apks.

Standard framework is embedded into apktool, so you don't need to do anything for most apk files. But some manufacturers, for example Samsung, add their own framework files and use them in system apps. To use apktool against such apps, you must pull framework from a device and install/register it to apktool.

For Example, you want to decode TouchWizLauncher.apk from Android v2.2 of Galaxy 5. If you try to do that, you will get an error message:


You need to install framework in apktool Type-

apktool if [framework location]


I have the got the framework-res.apk & twframework-res.apk by extracting the ROM. You can also copy it from your phone. But take care you must copy framework.apk from that ROM in which you got the Application file.




Then try again


Now is working.


How to build decoded files:
Just type

apktool b [directory in which you have decoded the files]
Example - apktool b D:\nfsshift
Done!



You will find the apk file inside the decoded directory, like I found it in - D:\nfsshift\dist\nfsshift.apk

Now you need to sign your APK file.


How to Sign APK files:


When publishing an application or a custom rom you need to sign the .apk or .zip files with a certificate using a private key. The Android system uses the certificate to identify the author of an application and establish trust relationship between applications. The classic way of doing this was to use keytool then sign it with jarsigner. In this tutorial i’ll explain an alternative method which is relatively easy to use for most people using a tool called SignApk.jar.

First download the SignAPK tool - http://www.mediafire.com/?rw57ftajd6nm81s
Extract them to a directory you will remember. I have put them in C:\SignApk

Now just open cmd and type -
Quote

cd C:\SignApk
java -jar signapk.jar certificate.pem key.pk8 your-app.apk your-app-signed.apk
Example - java -jar signapk.jar certificate.pem key.pk8 D:\nfsshift\dist\nfsshift.apk D:\nfsshift\dist\nfsshift-signed.apk



Your APK is signed and can be installed.
The Following 24 Users Say Thank You to v6ser For This Useful Post: [ View ] Gift v6ser Ad-Free
 
 
5th August 2012, 09:09 AM |#2  
dodoik's Avatar
Senior Member
Flag pekanbaru
Thanks Meter: 171
 
More
●๋•ηι¢є ιηƒσ●๋•

Sent from my GT-S7500 using xda app-developers app
6th April 2016, 10:49 PM |#3  
I know this is an old post but I need some help. I have the apktool, dex2jar and jd-gui in a folder on my Desktop

I installed the framework-res.apk and it installs into a different folder. Do I need to have the Framework folder into the same folder as the other files or will it be able to locate the framework files no matter where they are.

The reason I ask is because even though I have installed the framework, I am still getting error message when attempting apktool d filename.apk. Any ideas would be helpful, thank you
Attached Thumbnails
Click image for larger version

Name:	ss.jpg
Views:	580
Size:	103.9 KB
ID:	3709950  
Post Reply Subscribe to Thread

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

Advanced Search
Display Modes