Introduction to Basic ROM Theming

Difficulty Level: Beginner-Intermediate

Introduction

This guide will teach you how to to proceed about theming the basic parts of a ROM

First up, learn to use GIMP/Photoshop very very well. You just cannot live without it if you want to create a theme.

Next, have a basic idea how Android styles are defined in the XML format. ( Android Developer Site )

Now, the next stage is actually modifying parts of the system graphics. Most of the images are in /system/app/SystemUI.apk and /system/framework/framework-res.apk. You can get these apks by connecting your phone in USB Debugging mode, and typing the following commands in a terminal.

Next, its time to decompile them. There are various decompiling/building tools available out of which the most used is “apktool” ( APKTool HomePage ). If you’re on Windows, AndroidSuite is a pretty productive tool for compiling/decompiling ( XDA Thread ).

APktool requires you to install these packages to the local system so that apktool can use the resources from them during the decompile/build process. This can be done by executing the following command

For decompiling using apktool use the following command in the terminal

After you’ve decompiled the apk, study it. Study the images, the XML files. Get to know how the things are working. Then, modify what you need to. Modify the images using GIMP or Photoshop.

You cannot use regular image editing techniques on *.9.png files, as these require special handling in order to preserve their transparency. Refer to a guide to working with nine-patch files for more information

Notepad++ is a very nice XML editor in Windows, in Linux there’s gedit or Kate. After you’re done with the modifications, now is the time to recompile the apk. Recompile using apktool using the following command

Then, if it a system apk, you’re done. Push it back to the system or create flashable ZIP and flash it. If its not a system apk, you’re not done yet. Sign the apk and then flash or push it.