Saturday, February 16, 2013

Theming the Clock

This tutorial will be done using Ubuntu 12.04, although all tools are available for Windows and OSX; however the commands will differ (OSX might be the same since it is also UNIX based).  You could easily use UOT Kitchen if you want an easy theme.  However if you want more options and to actually know what is happening, use this guide.

***disclaimer, make a backup of your ROM, if this is done wrong you may have to restore***

To begin theming, you will need several things:


  1. A rooted phone, I will be using the Samsung Galaxy Exhibit, running CM7, courtesy of Tim1928
  2. A launcher of choice I will be using ADW
  3. Photo editing software (Gimp, Photoshop, paint, or some equivalent)
  4. Apktool, set up with apktool in your file path (Here is a tutorial) 
  5. Preferably adb set up; however this is not necessary, you could use ES file explorer
  6. Archive manager such as roller (comes with linux) or 7zip
  7. Text editor (gedit, notepad ++, etc...)
  8. Prior knowledge of how to use the above tools (Google, xda, and rootzwiki are all helpful)

We will only make one modification to the status bar.   After learning the process, you can modify anything you want.  This will make the time in the status bar pink or whatever color you like.


What it looks like now

The first step is to get SystemUI.apk (located in system/app/) and framework-res.apk (located in system/framework) and put them in a folder.  

ADB commands for linux are as follows:



open terminal 

cd android/sdk/platform-tools

./adb pull /system/framework/framework-res.apk /home/theapant/theme

./adb pull /system/app/SystemUI.apk /home/theapant/theme



**replace /home/theapant/theme with the path to your theme folder**



The second step is to install the framework-res.apk, commands for linux are as follows:

open terminal

cd theme

apktool if framework-res.apk 



The third step is to decompile SystemUI.apk and framework-res.apk, commands for linux are as follows:

open terminal

cd theme

apktool d SystemUI.apk 

apktool d framework-res.apk

The fourth step is to modify all the files you want.  For just the clock you only need modify this in SystemUI/res/layout/status_bar.xml.  First find the line 

<com.android.systemui.statusbar.Clock and add this  before the />

android:textColor="#fffb07e7" 

**note, change the 6 characters after #ff to whatever color value you want. (here is a good website to find the value http://html-color-codes.info/)**

Save the file and make a new folder inside theme.


Now it's time to recompile,commands for linux are as follows:

open terminal

cd theme


apktool b SystemUI new/new.apk






Now it's time to zipalign the app, commands for linux are as follows:


open terminal

cd theme/new


zipalign -v 4 new.apk SystemUI.apk







Finally to remove the old SystemUI.apk and replace it with this one, use the following commands:


open terminal

cd android/sdk/platform-tools

./adb shell

mount -oremount,rw /dev/block/mtdblock3 /system

rm /system/app/SystemUI.apk

close terminal

open terminal

cd android/sdk/platform-tools

./adb push /home/theapant/theme/new/SystemUI.apk /system/app

reboot




If that doesn't work for you and the status bar is gone, with an archive manager open both of the apks and drag and drop in status_bar.xml into SystemUI.apk/res/layout of the original apk and repeat the previous steps to remove the old apk and push the new one.



There you have it! If you have issues, post in the comments and myself or someone can help resolve it.  





No comments:

Post a Comment