[Android Themes] theimpaler747:
In Depth Look: Using Apktool or Apk Manager.

What are they?

Apktool and Apk Manager allow you to decompile, reengineer, and compile apks after making changes to files in the decompiled apk.

Why would I need them?

These tools allow you to edit XMLs, edit smali files, and change many other aspects of the apk that you wouldn't be able to do without decompiling the apk.

Setting up apktool on a mac

If you have a mac like me, remember that apk manager doesn't work on macs. So, you must use apktool, which is absolutely fine, as in my opinion apktool is better than apk manager. To set up apktool, you must have root mode enabled on your mac. To do that, simply follow these steps:

Open system preferences

Open accounts

Go to login options

Hit join next to network account server

Select open directory utility

Click the lock at the bottom of the window that pops up and enter an admin password

Then, go to the top bar on your mac, hit edit, and select enable root mode

Once you have root mode enabled, you're ready to set up apktool:

From the apktool website, download apktool1.3.2.tar.bz2 and apktool-install-macosx-2.2_r01-1.tar.bz2

Next, open terminal

su

tar -C /usr/local/bin -xvf <zipped file name>

tar -C /usr/local/bin -xvf <zipped file name> (for the second file)

Now to confirm it worked, type "apktool" no quotes

You should get a help menu for apktool

If so, you're good to go! :D

Now, once you have it set up, you're ready to go! After typing apktool, you'll see the help menu which'll give you the commands available for apktool, but I'll go over the basic ones here.

apktool d "apk path here" will decompile the apk

apktool b "decompiled apk path here" will build an apk from a previously decompiled one

apktool if "framework-res.apk path here" will install a framework res or any app really to allow you to work with dependent apps. For example, if you want to modify an HTC sense apk, you'll need to install the htc.resources.apk first through this method before decompiling the sense apk.

What if I have windows?

The steps will be very similar. See the apktool website I have listed above for a bit more info, but as I said, it's not too far off minus the having to get root access part.

This seems to complex, and I hate using commands! I wish there were another way....

Oh, but there is! *ends cheesy infomercial voice* Apk manager will give you a simplified setup, and all of the same features plus more; all you need is windows or linux.

Great! How do I get that?

Download Apk Manager

Extract the zip

Open up the enclosed script

The rest is pretty self explanatory ;)

Now, even will apk manager, you'll need to make sure you know how to set frameworks up and such, but it makes it much easier with its convenient scripts. If you have any questions, ask them here and I'll certainly do my best to answer them :D

Helpful Hint!

Remember, once you have an apk decompiled with apktool or apk manager, you have the best chance to correctly edit .9pngs!

If you open the .9png in the decompiled app and edit it with gimp or photoshop while leaving the pre-drawn boarder there, you'll be able to recompile the apk with a properly edited and themed .9png ;)

Advanced Decompiling

Sometimes, you have that pesky app that just won't decompile correctly. Usually, it's an app related to others, like a proprietary system app based off framework-res.apks.

When this happens, you need to ensure that the frameworks are there to have the app's recourse tables properly compile.

For either apktool or apk manager, find a folder on your computer called "apktool."

The should be a folder in here called "framework," and inside that, a 1.apk.

For an app that is dependent on the framework-res.apk in a specific phone/rom, take the framework-res.apk for that rom and rename it 1.apk.

Replace the default one in the folder with yours.

If there's a second one, like the twframework-res.apk for Samsung phones, rename it 2.apk and place it in the "framework" folder.

Now, decompile like normal, and everything should be good :)