Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,771,111 Members 47,707 Now Online
XDA Developers Android and Mobile Development Forum

[HOW-TO] Change status bar clock color

Tip us?
 
fxn
Old
(Last edited by fxn; 18th August 2009 at 02:02 AM.)
#1  
fxn's Avatar
Member - OP
Thanks Meter 16
Posts: 46
Join Date: May 2009
Smile [HOW-TO] Change status bar clock color

Short step by step write-up about how I changed the status bar clock color to red (because I like red )

NOTE BEFORE YOU START:
Standard disclaimer, I don't guarantee anything that might happen after following these steps, and I mean anything!! These steps worked for me and I have tried to include every minute step! My phone is running CM 3.9.9.1 but this should theoretically work on any ROM. But no guarantees.


1. Connect phone using USB and check that you can see your device using: adb devices
2. in your SDK/tools directory from command line do: adb pull /system/framework/services.jar services.jar
3. Make a backup of the services.jar file that just popped in the tools folder just in case!
4. Download smali and baksmali from http://code.google.com/p/smali/ and place them in the tools folder. Rename the files to baksmali.jar and smali.jar to save on typing later
5. Open the services.jar file with something such as winrar or 7zip or whatever you prefer
6. Copy out the classes.dex file to your SKD/tools folder
7. run following from command line: java -jar baksmali.jar -o classout/ classes.dex
8. Now browse to your new folders classout/com/android/server/status
9. Open the file StatusBarIcon.smali in something like notepad or context or any text editor
10. Locate a line that says: .line 46, under this line it should have something like:
const/high16 v6, -0x100
11. Change this to say: const/high16 v6, -0x1
12. Save the file
13. Now back to the command line and from your SDK/tools folder run: java -Xmx512M -jar smali.jar classout/ -o new-classes.dex
14. If the above finishes without errors you should have a file called new-classes.dex in your SDK/tools folder now that is the same size as your classes.dex file.
15. Rename the old classes.dex file to classes-old.dex and rename the new-classes.dex file to classes.dex
16. Open the services.jar file with your archiving tool again from step 5 and replace the existing classes.dex file with our new classes.dex we just created.
17. From command line run: adb remount
18. also from command line: adb push services.jar /system/framework/
19. Finally run: adb shell reboot

Your phone should now restart and after being very very patient (5+ mins i've had) the phone starts and your clock is now Red =o)))

Hope this worked out for you, too tired to change the other texts now...need sleep

.FxN

ps. Thanks to Cyanogen (in general), XDA-developers and this thread so; Ohsaka and mianosm and JF
The Following 6 Users Say Thank You to fxn For This Useful Post: [ Click to Expand ]
 
pep1t0
Old
#2  
Member
Thanks Meter 1
Posts: 74
Join Date: Jul 2009
nice... will try it out latter today... what would be the code for white color text? does this also modifies notification fonts?
HTC Google ION 32b
CyanogenMod 4.0.2 32b CC+Swap
RAv1.2.1G Recovery
4gb Class 6
The Following User Says Thank You to pep1t0 For This Useful Post: [ Click to Expand ]
 
fxn
Old
#3  
fxn's Avatar
Member - OP
Thanks Meter 16
Posts: 46
Join Date: May 2009
To change it to white just change this line:
const/high16 v6, -0x100
to
const v6, -0x1
Twitter: eFeXeN
Tutorials: Android Theme Videos
 
superatmel
Old
#4  
superatmel's Avatar
Senior Member
Thanks Meter 148
Posts: 130
Join Date: Aug 2009
Location: Barcelona

 
DONATE TO ME
And for the date where is the line?
 
MontAlbert
Old
#5  
Senior Member
Thanks Meter 154
Posts: 2,391
Join Date: Jan 2007
Quote:
Originally Posted by superatmel View Post
And for the date where is the line?
date is in layout, status_bar.xml
T-mobile G1- Sold
HTC Magic 32A- Sold
Nexus One- Sold
T-mobile HD2- Sold
HTC Inspire 4G- Backup phone
HTC Sensation- Sold due to HTC giving dev's the middle finger and dodgy build quality
Samsung Galaxy Nexus Sold due to crappy camera
LG Nexus 4 Given to the Missus
LG Nexus 5 Backup phone

OnePlus One Gotta love it- if only everyone could get one
follow me on Twitter
 
setzer715
Old
#6  
setzer715's Avatar
Senior Member
Thanks Meter 203
Posts: 1,213
Join Date: Jan 2009
Location: North Phoenix
Great write up! My problem is the OS I'm using uses odex files. I'm assuming the part I need to modify is in that file since my services.jar does not have classes.dex and its file size is only 1k. Do you know how to modify the odex file?
 
zapote21
Old
#7  
zapote21's Avatar
Senior Member
Thanks Meter 14
Posts: 168
Join Date: Aug 2009
Location: Tampa, FL
Quote:
.line 45
.local v2, layoutParams:Landroid/widget/LinearLayout$LayoutParams;
const/high16 v6, 0x4180

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

.line 46
const v6, -0xe0e0f

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

.line 47
Ok, I got this far, and this is what I see... Which one is the color? And how do I find the codes for other colors? My clock is white right now... Want to change that...

Phone: Verizon Note3
ROM: Beans KK 4.4.2 NC2
Recovery: TWRP
Theme: None ATM
ROM subject to change depending on mood
DONATE
 
MurderDeathKill
Old
#8  
Member
Thanks Meter 0
Posts: 55
Join Date: Sep 2009
Quote:
Originally Posted by zapote21 View Post
Ok, I got this far, and this is what I see... Which one is the color? And how do I find the codes for other colors? My clock is white right now... Want to change that...
const/high16 v6, 0x4180 is the color dude, it was answered in the post when some asked whats the code for the color white.
* MT3G (Sapphire, 32B) with Cyanogen 4.2.7.1
* RA-Dream-1-2-2 Recovery image
* Radio 2.22.19.26I
* Updated SPL HBoot-1.33.2005
* 4BG Class 6

PS: Please EVERYONE ADD A SIGNATURE TO YOUR PROFILES!!!
 
NisseGurra
Old
#9  
Senior Member
Thanks Meter 21
Posts: 169
Join Date: Nov 2005
Quote:
Originally Posted by setzer715 View Post
Great write up! My problem is the OS I'm using uses odex files. I'm assuming the part I need to modify is in that file since my services.jar does not have classes.dex and its file size is only 1k. Do you know how to modify the odex file?
I have same problem: no classes.dexfile in services.jar, any ideas how to proceed?
 
enatefox
Old
#10  
enatefox's Avatar
Senior Member
Thanks Meter 3
Posts: 1,846
Join Date: Jul 2008
Thanks fxn, worked for my Donut theme.

If you guys need help deodexing, I have a theme thread with full howto (including a link here) to help you out. Post #2 has it all.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Calc+ is a Smart and Beautiful Android Calculator

As we’ve said inthe past, there are quite a few calculators available on Android. … more

Get Better Debug Data with Crash Report SDK

Developing an application is a hard and often times ungratifying task. It also requires quite a … more

Navigate to Your Favorite Places with LocationDetector

If you’re enjoying an active way of life, you probablytravel a lot, go fishing, … more

LifeStats Automatic Journal Keeps Tabs of Your Day

Most of us live very active lives. This is after all why we’re fans of mobile … more