[Galaxy S II I9100G Android Development] Ryuinferno:
Kickstart Guide on Theming BL ROM

Ok...as promised, here is a short (not so short maybe...:p) write up on what to modify for theming...I found out all these through my personal experience so far...;)

First, I will guide you on how to set up your environment correctly for apktool (Win7 only) as I see that some have problems with it...

Setting up apktool the FULL way:

1. Download and install JRE 1.7 from here, and remember to choose the right version (32 bit or 64 bit, depending on your computer):

http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html

**Install JRE 1.6 from here: http://www.oracle.com/technetwork/java/javase/downloads/jre6u38-downloads-1877409.html only if you set up everything and still can't make apktool to work...

2. Download and install JDK 1.6 from here, and remember to choose the right version (32 bit or 64 bit, depending on your computer): http://www.oracle.com/technetwork/java/javase/downloads/jdk6u38-downloads-1877406.html

**DO NOT use JDK 7 as it is not working properly with apktool

3. Download the latest version of apktool but I personally recommend APK Multi Tools as it has a lot of extra functions: http://apkmultitool.com/?q=node/5

4. Optional: Download the latest Android SDK from here: http://developer.android.com/sdk/index.html

This is to set up adb, which eases the pulling and pushing of files and debugging too, but it is not mandatory.

5. Hard part: Now, you will have to key in your environment variables

For JRE:

a) Find out where is it installed, usually if 64-bit, it will be somewhere here: C:\Program Files\Java\jre7, or if 32-bit, C:\Program Files (x86)\Java\jre7...but if you change the place where you installed JDK, then it will be different

b) Go to Computer>>System Properties>>Advanced system settings

c) In the "Advanced" tab, go to "Environment Variables"

d) Under "System variables", search for "Path" and select it, then press edit

e) Under "Variable value", go to the very end of the line and add ";C:\Program Files\Java\jre7\bin" without the quotes. Remember to change the path according to your computer, as long as you point to the bin folder.

f) Press OK and OK again. Restart your computer.

**If you are using JRE 1.6, just change "jre7" to "jre6"...

For JDK:

a) Find out where is it installed, usually if 64-bit, it will be somewhere here: C:\Program Files\Java\jdk1.6.0_38, or if 32-bit, C:\Program Files (x86)\Java\jdk1.6.0_38...but if you change the place where you installed JDK, then it will be different

b) Go to Computer>>System Properties>>Advanced system settings

c) In the "Advanced" tab, go to "Environment Variables"

d) Under "System variables", search for "Path" and select it, then press edit

e) Under "Variable value", go to the very end of the line and add ";C:\Program Files\Java\jdk1.6.0_38\bin" without the quotes. Remember to change the path according to your computer, as long as you point to the bin folder.

f) Press OK and OK again. Restart your computer.

g) You are ready to use apktool or APK Multi Tools! :D

For adb:

**Remember to launch SDK Manager at least once to download the latest Android SDK Tools and Android SDK Platform-tools

a) Find out where SDK is installed, if you use the latest windows installer, it may be at C:\Program Files (x86)\Android\android-sdk...again, if you change the path of installation, use that.

b) b) Go to Computer>>System Properties>>Advanced system settings

c) In the "Advanced" tab, go to "Environment Variables"

d) Under "System variables", search for "Path" and select it, then press edit

e) Under "Variable value", go to the very end of the line and add ";C:\Program Files (x86)\Android\android-sdk\platform-tools" without the quotes. Remember to change the path according to your computer, as long as you point to the bin folder.

f) Press OK and OK again. Restart your computer.

g) You are ready to use adb! :D

Next, get familiar with apktool first...I will not guide you on that...ok, to get going, get these files from the latest version of the ROM (preferably from Mulitlang.zip so that more users can enjoy the theme):

1. framework-res.apk

2. twframework-res.apk

3. blazing-res.apk

4. SystemUI.apk​

By theming these files, you can actually change the look of your phone for about 70%...the remaining 30% can only be achieved by modifying system apps one by one...but put those aside first, those are easy to settle...;)

I would suggest users to start theming with SystemUI.apk as it is the easiest to theme compared to others and it is quite independent (other apps depend a lot on framework-res or twframework-res)

SystemUI.apk & blazing-res.apk

1. As usual, decompile these files.

2. Then start changing the pngs in /res/drawable-hdpi as you like. The names are quite self explanatory, but here are a few specific ones:

a) The signal bar uses only 4 bars, so just change stat_sys_signal_0.png to stat_sys_signal_4.png. It is not necessary to change the ones with 5 or 6 bars

b) The lock icon in the notification drawer is actually this: ic_sysbar_brightness.png, take note

c) You will see a lot of battery icons, this is due to the 1% battery mod. Either leave them untouched or replace them ALL, or else you will get weird effects (i.e. different icons)

d) To change the background of the notification drawer, change this: tw_quickpanel_bg.png...I know, it is very tiny...

e) There will be no effect if you change the icons of the quick toggles in SystemUI.apk as 15 toggles is implemented, the pictures from blazing-res.apk are used instead, so modify those in blazing-res.apk​

3. Now for the harder part: code...Basically, there are no necessary codes to be changed in blazing-res.apk, just take note about the quick toggle icons in it. For SystemUI.apk, you might wanna get a online hex colour schemer so that you can check the hex code of the colours you want, e.g. #FF000000 is opaque black...take note of these files:

a) /res/values/colors.xml

b) /res/values/drawables.xml

c) /res/values/styles.xml

d) /res/values/dimens.xml​

But put extra emphasis on colors.xml and drawables.xml if you want to edit colours...styles.xml and dimens.xml are more about sizes...This is where you will need so trail and errors as there are many and you will need to determine which to edit. I will give a common example here: edit the highlighted part in /res/values/styles.xml to change the size of the statusbar clock:

[COLOR="Red"]16.0dip[/COLOR]
normal
#ffbebebe

4. After you are done, compile them and push them back to the phone via adb or as a CWM zip to test them out. You will need to repeat several times before you can get the effect you want.

framework-res.apk and twframework-res.apk

1. Decompile them.

2. Know what they affect:

a) framework-res.apk: General Android system stuff and most of Sammy's stuff

b) twframmework-res.apk: Some Sammy's stuff (Video player and Task Manager)​

3. Start replacing pictures in /res/drawable-hdpi and /res/drawable-nodpi.

4. Similar to SystemUI.apk, the essential codes are here:

a) /res/values/colors.xml

b) /res/values/drawables.xml

c) /res/values/styles.xml

d) /res/values/dimens.xml​

You might want to pay extra attention to these files as they can really affect a lot, especially styles.xml...I modified a line in it and certain system apps crashed. So to make life easier, modify colors.xml and drawables.xml first. styles.xml and dimens.xml can come later after you are done with those.

**Some quick hint: the text colours are determined by colors.xml, and to know which is being used for what, you will have to compare with styles.xml

5. Compile and test your creations using whatever method you like. ;)

So after you completed theming the 4 files stated above, then you can start to modify system apps. Here is a list of apps you should modify:

- Settings.apk

- Phone.apk

- Contacts.apk

- Mms.apk

- ClockPackage.apk

- Camera.apk

- FmRadio.apk

- TouchWiz30Calendar.apk

- TouchWiz30Calculator.apk

- TouchWiz30Launcher.apk

- SecDownloadProvider.apk

- SecDownloadProviderUi.apk

- SecBrowser.apk

- VideoPlayer.apk

- TaskProvider.apk

But the most minimal theme should at least have the apps in bold themed and change the icons of the other apps...:p...it's up to you to decide...

So that's all from me...will add more information to this when I have more time...:)...Happy theming!