[Galaxy S II Themes and Apps] dully79:
How to decompile using apkmanager 4.9

WINDOWS

I dont use any other OS so i cannot write a guide. Google is your friend!!.

So you have learned how to do the basics and graduated from the nursery (kindergarten if you prefer) and your intersted in making some real theme-ing modifications.:)

In order to do this we need to be able to decompile our apk's.

"Why do we need to decompile??" you ask....

Well, just like a Piñata we need to smash it open (decompile) to get all the good stuff and allow us to correctly and easily edit such things as .9.png's, xml's and smali.

-----------------------------------------------------------------------------

"What do we need??"

1-Java

2-Android SDK (we only need tools and platform tools)

3-apk manager (obviously)

Java​

*Firstly we need java set-up.

Open up a cmd window/ terminal and type or copy and paste:

java -version

If you recieve a message that looks like this-

>>SCREEN<<

Then ignore the next step and continue to Android SDK.

*Go >>HERE<< and download the JRE for your system.

*Install java by default following the prompts without changing any of the options.

*We need to check java has installed correctly,

Open up a cmd window/ terminal and type or copy and paste:

java -version

If you recieve the message then skip to Android SDK, if not proceed.

*We need to add the path to java so it is recognised to be run from any directory follow these instructions for Windows:

**Open My Computer and select "view system information" on the left pane.

**Click the Advanced tab and then click Environment Variables.

**In the "System variables" area click New.

**Enter JAVA_HOME in the Variable name field. Enter the pathname of the JRE installation directory in the Variable value field. For example mine is: C:\Program Files\Java\jdk1.6.0_27;%JAVA_HOME%\bin; Click OK.

>>SCREEN<<

**Click OK.

**Try step 1 again, success?? (MAKE SURE YOU USE A FRESH CMD WINDOW!!)

For more information on path setting look >>HERE<<

-----------------------------------------------------------------------------

Android SDK​

The android SDK allows you to download the latest platform resources but all we really need from it is the tools

*Go >>HERE<< and download the SDK for your system.

*Install by default following the prompts.

*When installed click next and start SDK manager.

*In the window that opens up check "Tools/Android SDK Tools+Android SDK Platform Tools", click install (everything else is optional for this guide!).

*Add the path as we did earlier but this time add it to "Path":

"C:\Program Files\Android\android-sdk\platform-tools;C:\Program Files\Android\android-sdk\platform-tools;"

WITHOUT THE QUOTES!!!

>>SCREEN<<

*Check the installation by Opening up a cmd window/terminal and type or copy and paste:

adb

If you recieve a long message then all is good.

>>SCREEN<<

-----------------------------------------------------------------------------

Apk Manager​

*Get apk manager from >>HERE<< and extract to appropiate folder, eg "

apk_manager

".

-----------------------------------------------------------------------------

"How do i use apkmanager??" i hear you cry.

Install the frameworks:

​

*Firstly we want install our frameworks to try and prevent any future errors for dependant apk's.

*Navigate to to your default directory (TIP IT'S THE DIRECTORY THAT SHOWS WHEN YOU OPEN A CMD/TERMINAL WINDOW) example "C:\Documents and Settings\Administrator"

*In here create a folder called apktool

*Inside apktool create a folder called framework

*Inside framework place inside your framework-res.apk and twframework-res.apk and rename them:

framework-res.apk to 1.apk

twframework-res.apk to 2.apk

You can install extra frameworks if desired but change the tags for example i want to install ICS framework but i have GB installed simply do this:

Copy over and rename

framework-res.apk to 1-ICS.apk

twframework-res.apk to 2-ICS.apk

>>SCREEN<<

-----------------------------------------------------------------------------

Decompiling:​

*Start the "script.bat" by double clicking. (At first time of running this will create the necessary folders).

*Goto apk_manager\place-apk-here-for-modding\ and drop in the apk you want to work with.

*Select option 22 and the number of the apk to decompile.

*Select option 9 and let apk manager do its magic

*When finshed check the log in the apk_manager folder for errors and rectify.

*The decompiled apk is found in apk_manager\projects

-----------------------------------------------------------------------------

Compiling:​

*Select option 22 and the number of the apk to compile.

*Select option 11

*When prompted choose y/n to system apk depending on its origin (market apps no!!) If it is a system apk then select y and y again

*When the script has finished working navigate to apk_manager\keep and delete any file you modified. If you edited any xml's or "hidden" xml's for example values\colors.xml delete resources.arsc. If you edited smali delete classes.desc (if deodexed) then hit any key to continue.

*When finished your new apk will be located in apk_manager\place-apk-here-for-modding\ with the prefix "unsigned"

*

COPY

out of the folder Rename by removing the "unsigned" for use.

-----------------------------------------------------------------------------

Signing:

***DO NOT SIGN SYSTEM APPS***DO NOT SIGN SYSTEM APPS***DO NOT SIGN SYSTEM APPS***

***DO NOT SIGN SYSTEM APPS***DO NOT SIGN SYSTEM APPS***DO NOT SIGN SYSTEM APPS***

*Select option 22 (MUST BE "UNSIGNED" APK)

*Select option 12

*When finished working the apk will be located in apk_manager\place-apk-here-for-modding\ with the prefix "signed"

*

COPY

out of the folder Rename by removing the "signed" for use.

-----------------------------------------------------------------------------

Now you can add your new files to the universal theme zip.:)

-----------------------------------------------------------------------------

Here is a video on using apk manager:

>>Video<<

Quality isnt great.:(

-----------------------------------------------------------------------------

Credits:

*Brut.all for apktool

*Daneshm90 for apk manager

*jesus freke for smali/baksmali

*xda for being xda

*The members who help this place what it is