How to use APKTOOL

Started By: wangxiaoli Started On: 2017-11-27 21:24:29
803 2
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 :-
                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.
                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.
                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.

Download the zip file here :-
Extract the files in a folder named "SignApk", in any convienient location. (I preferred C:\)

Example of the code in image here :-

From xda, thanks great

Global moderators
2# 2017-11-27 23:19:45
this is help ful for developers {:4_177:}

Global moderators
3# 2017-11-29 20:39:30
Definitely common but so useful!
You have to log in before you can reply Login | Register now Sign in with facebook Sign in with google

Points Rules