Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,739,482 Members 53,857 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] Changing Status Bar/Making your own Metamorph theme

Tip us?
 
owq
Old
#1  
Junior Member - OP
Thanks Meter 9
Posts: 11
Join Date: Apr 2005
Default [Guide] Changing Status Bar/Making your own Metamorph theme

Adapted from http://zezke.xtreemhost.com/2010/9/b...id-status-bar/

This is just a brief guide. The steps are a little different for the XT720. This was tested on a XT720 using Dexter's Froyo 1.2a.

Getting started

Tools needed: apktool, android sdk, java jre, 7zip/winrar/etc, smali.jar and baksmali.jar

Changing the theme

adb pull /system/framework/framework-res.apk framework-res.apk
java -jar "apktool.jar" d -f framework-res.apk

Navigate to framework-res/res folder.

Here, the drawable-hdpi folder contains the images for the theme. You can either replace the images in here with images from another theme (easier, but might not always work) or modify the images yourself (complicated).


Changing the status bar colour

What you want is the status_bar.xml file in the layout folder.

Look for
Code:
Select Code
<com.android.server.status.DateView android:textSize="16.0sp" android:textStyle="bold" android:textColor="#ffffffff" android:gravity="left|center" android:id="@id/date" android:background="@drawable/statusbar_background" android:paddingLeft="6.0px" android:paddingRight="6.0px" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
near the end of the file.

To change the colour, change the value of the attribute android:textColor. For mine, I changed it to android:textColor="#ffffffff". This is in hexadecimal. The first two letters dictate the transparency. The rest is just the standard RGB hex code. For example, black is #ff000000. Full transparency is #00ffffff.

After making the modifications, you have to repack.

java -jar apktool.jar b "framework-res"

You'll find your new framework-res.apk in framework-res/dist.

P.S. Replacing the original framework-res.apk with the new one didn't work for me. I have to make a Metamorph theme and apply it. Coming to that in a moment.


Changing the clock colour

adb pull /system/framework/services.jar services.jar

Open services.jar (using 7zip) and extract classes.dex (only). Get smali.jar and baksmali.jar from Google Code (latest version when writing this guide 1.2.4).

java -Xmx512M -jar baksmali.jar -o classout classes.dex

This will create a directory named classout in your current working directory. Open it and go to com/android/server/status and open (using a text editor) StatusBarIcon.smali. Look for this fragment:

.line 60
const/high16 v6, -0x100

invoke-virtual {v4, v6}, Landroid/widget/TextView;->setTextColor(I)V

I think the important thing is the setTextColor(I)V. The .line60 may differ for most phones.

Now, the original colour is the line
const/high16 v6, -0x100

change it into
const v6, -0x1
for white.

Then save it.

I'm not sure what the other colour codes are, but I think you can find out with a search.

Now return to the folder containing services.jar and classes.dex. Rename classes.dex as classes.dex.backup just to be safe and have a backup. Recreate the dexfile:

java -Xmx512M -jar smali.jar classout -o classes.dex

Add the new classes.dex file to the services.jar (crucial that you add it instead of creating a new archive).

---Making Metamorphs

It's easier if you just use my Metamorph as a template.
http://forum.xda-developers.com/showthread.php?t=955698

In my Metamorph theme, replace the framework/services.jar with yours.

The framework-res/res folder contains files to replace in the system's framework-res.apk. Empty the folder, then extract files that you have changed from your new framework-res.apk(using 7zip/etc, this is important) and put them in this folder.

You can change the owq.xml file.

<item>framework-res.apk</item>
<path>/system/framework/</path>

Means that files in the archive /system/framework/framework-res.apk will be replaced with the ones in the Metamorph theme folder /framework-res

<item>framework.cpy</item>
<path>/system/framework/</path>

Means that files in /framework will be copied to /system/framework/, replacing any existing files. (Due to the .cpy extension, short for copy)
The Following 2 Users Say Thank You to owq For This Useful Post: [ Click to Expand ]
 
c19932
Old
(Last edited by c19932; 5th March 2011 at 04:28 AM.)
#2  
Senior Member
Thanks Meter 104
Posts: 1,013
Join Date: Jun 2010
thanks for the tutorial
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes