[Captivate Themes and Apps] tsachi:
Working with APK manager

What is APK manager?

APK manager is a tool for decompiling / recompiling apk files. If you want to change anything other than images, it is a must have.

The basics

The basic flow when using APK manager is

Place apk file in place-apk-here-for-modding folder

run the Script.bat file

Type 22 and select the file you want to work with

Type 9 and wait for it to finish decompiling

Modify the items you want modified (they will be in the projects folder)

type 11 to recompile

Sounds easy? It is, and it isn't. There are several places where things can go wrong. Here are a few of the things to watch for:

Bad starting file

This is mostly true for framework files that went through several cycles of modifications. The framework is forgiving to having extra items, or having bad .9 images (see post above about .9 images). Some people may have replaced images without recompiling the framework in a way that breaks internal links. If this happens you will very likely see error messages during the decompile stage. If that happens check the log file and correct things. One of the most common errors is .9 files replaced with regular images. See this post for how to solve this.

Things may not always be "fixable", so the best approach is to get the original framework that is the base for the one you need. Having a clean start can save a lot of headaches later on.

Overwriting your changes

When you recompile, assuming everything worked ok, you are prompted if this is a system file. Most likely you want to say yes. This ensures that the original signature is copied over. You will also be prompted if you want to copy some files over from the original. BE CAREFUL!. There are people who say you reduce the risk of errors if you copy things that didn't change. Personally, if I changed anything that required recompilation (mostly added new images or modified xml files) I always choose not to copy extra files. If you do choose to copy some files over, pay attention to the next step. Do not hit any key until you remove the modified files. You will need to go to the newly created "keep" folder (in the top apk manager directory) and remove any image that you changed and any xml that you modified. Also, if you modified xml files to add new images you need to delete "resources.arsc".

Failed rebuild

APK manager is trying to minimize work by only compiling newly changed items. If you built an apk and realized you have an error, or want to add more changes, I recommend removing the cached build. Go to the projects folder and delete the "build" folder. I've had cases where the new items didn't catch.

Removed items

I highly recommend to leave icons that you do not need. I've had occasions where I removed things that I thought had no more reference, but then ended with endless boot-loops. For example, if you modify the xml to only show 6 out of the 101 battery charge animations, leave the remaining icons in your project.

If you're stuck

Look at the log file. That would usually give you an answer. Also, if you are working on a recent GB ROM you probably need to get the beta 5 version. Version 4.9 will have problems compiling the newer files.