5,598,542 Members 44,192 Now Online
XDA Developers Android and Mobile Development Forum

[Solved!] Changing Notification Application Text Color - FroYo XML Editing

Tip us?
 
phimuskapsi
Old
(Last edited by phimuskapsi; 4th January 2011 at 06:13 PM.)
#1  
Senior Member - OP
Thanks Meter 22
Posts: 166
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
Default [Solved!] Changing Notification Application Text Color - FroYo XML Editing

Hey all! I sat down today, for hours, trying to figure this out and I finally got it. The solution was actually a little bit easier than I had thought but I had to jump through a lot of hoops, semi-boot loops and more.

Status Bar XML's per a couple requests. Download and pop in an Extracted (NOT decoded) framework-res.apk. These are encoded with light colors. You CAN edit these in a hex editor like HxD, open up the file, then Find 0800001C Make sure "Hex Values" is selected.


EDIT: Currently Making a Windows App to do this and other things. Stay tuned.


First things first:
- Instructions are from a Win 7 x64 PC perspective
- I am NOT liable if you screw something up
- Your phone must be rooted, have froyo (2.2), and be de-odexed.
- This guide assumes you know how to use adb, 7-Zip
- I am not going to explain the above steps, use google or xda's search.
- If you are going to edit any .9.png files like "status_bar_close_on.9.png" you MUST keep the existing transparency and black bars in place. If you don't you will NOT be able to finish the process.


** Quick Trick **
Windows 7: Right click My Computer, Click Properties, Click Advanced System Settings, Click Environment Variables. In user vars and system vars there is a "path" variable. Edit it. Copy paste your SDK path and the SDK\Tools path.

Windows XP: Right click My Computer, Properties, Advanced Tab, Environment Variables. In user vars and system vars there is a "path" variable. Edit it. Copy paste your SDK path and the SDK\Tools path.

This will allow ADB to run without being in the sdk\tools folder.

Instructions:
0. Make a backup of framework-res.apk from /system/framework
- Open the command Prompt
: adb pull /system/framework/framework-res.apk C:\phonetheme\backup\fwbu.apk
: adb pull /system/framework/framework-res.apk C:\phonetheme\working\framework-res.apk


1. Get APKTOOL.
2. Download the top 2 files. Extract the contents of the files to C:\Windows
3. Open the command prompt
: apktool if C:\phonetheme\backup\fwbu.apk droidx (or whatever your device is)
: apktool d -f -t droidx C:\phonetheme\working\framework-res.apk C:\phonetheme\working\framework-decoded\

Optional. Go to C:\phonetheme\working\framework-decoded\res\drawable-hdpi-v4\ and modify images if you wish. You do not have to do it this way, but it can be done. You can just open the apk with 7 zip and extract them/edit them as well.

4. Go to C:\phonetheme\working\framework-decoded\res\layout
5. Open status_bar_latest_event_content.xml in notepad
6. Where ever you see something like this: android:textColor="?textColorSecondaryInverse"

In between the quotes, replace @color/dim_foreground_dark (or whatever) with a 8 char hex string. The format is NORMAL, not BACKWARD like in Hex. So when you are done you should have something like "#FFFFFFFF". The format is #AARRGGBB

The first color changes the heading "Voicemail Messages"
The second changes the descriptor "Dial *86"
The third changes the datetime stamp

So mine is, "#FFFFFFF", then "#FF747c8d", last "#ffbdc8df"

7. Make all your color changes. Save.

8. Open up the command prompt again
: apktool b C:\phonetheme\working\framework-decoded C:\phonetheme\build\framework-res.apk

Now IF you get a LOT of messages, like hundreds. Your .9.png's are not compiling correctly. You may have to load the originals and start over.

If you get WARNINGS but not many (mine were related to a translation message for "en-GB") then you are fine.

9. Browse to C:\phonetheme\working\framework-decoded\build

Ah ha, that wasn't there before!

10. Open C:\phonetheme\working\framework-res.apk in 7-Zip
11. With it open delete the /res directory, AndroidManifest.xml, resources.arsc files from 7-Zip.

LEAVE THE /META-INF and /assets folders!

12. From the C:\phonetheme\working\framework-decoded\build directory, open apk directory. Select and drag the /res folder, AndroidManifest.xml, and resources.arsc to the 7-Zip window so they are in the archive.

13. Backup C:\phonetheme\working\framework-res.apk. Copy to C:\phonetheme\backup\ and name it something like framework-res-new.apk

14. Open the command prompt window
: adb remount
: adb push C:\phonetheme\working\framework-res.apk /sdcard/framework-res.apk
: adb push C:\phonetheme\backup\fwbu.apk /sdcard/fwbu.apk (you only need to do this when you have a new backup!
: adb shell
#: su (if not already #)

[At this point, I always make my screen on and unlocked, you don't have to, but I like to]

#: cp /sdcard/framework-res.apk /system/framework/

At this point, if you try and open anything on your phone, it will lock for a second and droid to the droid text/eye animation for a second. IF it loops! You will notice that you are still connected over ADB.

If and only IF it LOOPS from the eye to the text or if the text animation looks obviously broken. Type the following
#: cp /sdcard/fwbu.apk /system/framework/framework-res.apk

The next time it loops, it will load your backup and start running again. DO NOT REBOOT! Other wise you have to nandroid or SBF it like I did.


#: rm /sdcard/framework-res.apk
#: exit
: adb remount
: adb pull /system/framework/framework-res.apk C:\phonetheme\backup\fwbu.apk

If it comes up normally, and you get to the lock screen, unlock, and open your notification shade. Tada! You are done!

Best part? Because the decoded folder is there, if you want to make changes you just start at Step 7 again, delete the build folder, re-build and so on.

Here's what mine looks like!


Last note. If I missed something, let me know, or if you have problems, report them here. I'll try and answer best I can. I worked for hours on this today, so I may have missed something, though I doubt it.
The Following 2 Users Say Thank You to phimuskapsi For This Useful Post: [ Click to Expand ]
 
ghostlypickel
Old
#2  
Member
Thanks Meter 13
Posts: 51
Join Date: Jan 2010
In the XML. Look in the "layout" folder of framework-res.apk. I'm not sure whicl file it is. But try this:

Pull every file from the "layout" folder. Open each XML file in a hex editor, like HxD or Hex Workshop. Now in status_bar.xml if you edit it the right way you can change the color of notification, like when you get a text message or when you connect the phone to a computer. That's for notifications though.

So you might want to try other XML files.

Open an random one (in the hex editor), and look for the values 08 00 00 1C, then you have to change the values AFTER that. The are black so that values are going to be 00 00 00 FF. Change the 0's to the color you want, the color you want has to be a hex value.

If that's confusing. PM, and I'll give you my gTalk.
 
drewden123
Old
#3  
drewden123's Avatar
Senior Member
Thanks Meter 13
Posts: 660
Join Date: Mar 2008

 
DONATE TO ME
Quote:
Originally Posted by ghostlypickel View Post
In the XML. Look in the "layout" folder of framework-res.apk. I'm not sure whicl file it is. But try this:

Pull every file from the "layout" folder. Open each XML file in a hex editor, like HxD or Hex Workshop. Now in status_bar.xml if you edit it the right way you can change the color of notification, like when you get a text message or when you connect the phone to a computer. That's for notifications though.

So you might want to try other XML files.

Open an random one (in the hex editor), and look for the values 08 00 00 1C, then you have to change the values AFTER that. The are black so that values are going to be 00 00 00 FF. Change the 0's to the color you want, the color you want has to be a hex value.

If that's confusing. PM, and I'll give you my gTalk.
Yes. He's correct ^^^. I replied to your question in my theme thread and this correlates with what I stated. Look for other status bar xml's. I know there are more than just status_bar.xml

Sent from my DROIDX using Tapatalk
Romans 10:11
 
phimuskapsi
Old
(Last edited by phimuskapsi; 27th August 2010 at 07:28 PM.)
#4  
Senior Member - OP
Thanks Meter 22
Posts: 166
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
Doesn't work for FroYo.

The hex string 0800001C doesn't exist in the other status bar xmls. I think I've figured this out though.

This is out of status_bar_extended.xml (plain-text)
Code:
android:textColor="?textColorSecondaryInverse"
Then I found a file in /res/values/styles.xml I see:
Code:
 <item name="textColorSecondaryInverse">@color/secondary_text_light</item>
Then in /res/color/secondary_text_light.xml
Code:
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" android:state_enabled="false" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_enabled="false" android:state_selected="true" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_enabled="false" android:state_pressed="true" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_selected="true" android:color="@color/dim_foreground_dark" />
    <item android:state_pressed="true" android:color="@color/dim_foreground_dark" />
    <item android:state_enabled="false" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_window_focused="false" android:color="@color/dim_foreground_light" />
    <item android:color="@color/dim_foreground_light" />
</selector>
Then FINALLY in /res/values/colors.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <color name="darker_gray">#ffaaaaaa</color>
    <color name="white">#ffffffff</color>
    <color name="black">#ff000000</color>
    <color name="transparent">#00000000</color>
    <color name="background_dark">#ff000000</color>
    <color name="background_light">#ffffffff</color>
    <color name="safe_mode_text">#80ffffff</color>
    <color name="bright_foreground_dark">#ffffffff</color>
    <color name="bright_foreground_dark_disabled">#80ffffff</color>
    <color name="bright_foreground_dark_inverse">#ff000000</color>
    <color name="dim_foreground_dark">#ffbebebe</color>
    <color name="dim_foreground_dark_disabled">#80bebebe</color>
    <color name="dim_foreground_dark_inverse">#ff323232</color>
    <color name="dim_foreground_dark_inverse_disabled">#80323232</color>
    <color name="hint_foreground_dark">#ff808080</color>
    <color name="bright_foreground_light">#ff000000</color>
    <color name="bright_foreground_light_inverse">#ffffffff</color>
    <color name="bright_foreground_light_disabled">#80000000</color>
    <color name="dim_foreground_light">#ff323232</color>
    <color name="dim_foreground_light_disabled">#80323232</color>
    <color name="dim_foreground_light_inverse">#ffbebebe</color>
    <color name="dim_foreground_light_inverse_disabled">#80bebebe</color>
    <color name="hint_foreground_light">#ff808080</color>
    <color name="lighter_gray">#ffdddddd</color>
    <color name="perms_dangerous_grp_color">#ffdd6826</color>
    <color name="perms_dangerous_perm_color">#ffdd6826</color>
    <color name="shadow">#cc222222</color>
    <color name="search_url_text_normal">#ff7fa87f</color>
    <item type="color" name="search_url_text_selected">@color/black</item>
    <item type="color" name="search_url_text_pressed">@color/black</item>
    <item type="color" name="search_widget_corpus_item_background">@color/lighter_gray</item>
    <item type="color" name="sliding_tab_text_color_active">@color/black</item>
    <item type="color" name="sliding_tab_text_color_shadow">@color/black</item>
    <color name="keyguard_text_color_normal">#ffffffff</color>
    <color name="keyguard_text_color_unlock">#ffa7d84c</color>
    <color name="keyguard_text_color_soundoff">#ffffffff</color>
    <color name="keyguard_text_color_soundon">#ffe69310</color>
    <color name="keyguard_text_color_decline">#fffe0a5a</color>
    <color name="config_defaultNotificationColor">#ff00ff00</color>
</resources>
I think I have to hex edit that, and figure out where in the hex it is....I'll test it all out and let you guys know!
 
evilkal
Old
#5  
Senior Member
Thanks Meter 47
Posts: 139
Join Date: Jul 2010

 
DONATE TO ME
Please do... I wanna shade those damn notifications black asap lol.
Samsung Galaxy Nexus - Unlocked/Rooted 4.0.3
 
ghostlypickel
Old
#6  
Member
Thanks Meter 13
Posts: 51
Join Date: Jan 2010
Quote:
Originally Posted by phimuskapsi View Post
Doesn't work for FroYo.

The hex string 0800001C doesn't exist in the other status bar xmls. I think I've figured this out though.

This is out of status_bar_extended.xml (plain-text)
Code:
android:textColor="?textColorSecondaryInverse"
Then I found a file in /res/values/styles.xml I see:
Code:
 <item name="textColorSecondaryInverse">@color/secondary_text_light</item>
Then in /res/color/secondary_text_light.xml
Code:
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_window_focused="false" android:state_enabled="false" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_enabled="false" android:state_selected="true" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_enabled="false" android:state_pressed="true" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_selected="true" android:color="@color/dim_foreground_dark" />
    <item android:state_pressed="true" android:color="@color/dim_foreground_dark" />
    <item android:state_enabled="false" android:color="@color/dim_foreground_light_disabled" />
    <item android:state_window_focused="false" android:color="@color/dim_foreground_light" />
    <item android:color="@color/dim_foreground_light" />
</selector>
Then FINALLY in /res/values/colors.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<resources>
    <color name="darker_gray">#ffaaaaaa</color>
    <color name="white">#ffffffff</color>
    <color name="black">#ff000000</color>
    <color name="transparent">#00000000</color>
    <color name="background_dark">#ff000000</color>
    <color name="background_light">#ffffffff</color>
    <color name="safe_mode_text">#80ffffff</color>
    <color name="bright_foreground_dark">#ffffffff</color>
    <color name="bright_foreground_dark_disabled">#80ffffff</color>
    <color name="bright_foreground_dark_inverse">#ff000000</color>
    <color name="dim_foreground_dark">#ffbebebe</color>
    <color name="dim_foreground_dark_disabled">#80bebebe</color>
    <color name="dim_foreground_dark_inverse">#ff323232</color>
    <color name="dim_foreground_dark_inverse_disabled">#80323232</color>
    <color name="hint_foreground_dark">#ff808080</color>
    <color name="bright_foreground_light">#ff000000</color>
    <color name="bright_foreground_light_inverse">#ffffffff</color>
    <color name="bright_foreground_light_disabled">#80000000</color>
    <color name="dim_foreground_light">#ff323232</color>
    <color name="dim_foreground_light_disabled">#80323232</color>
    <color name="dim_foreground_light_inverse">#ffbebebe</color>
    <color name="dim_foreground_light_inverse_disabled">#80bebebe</color>
    <color name="hint_foreground_light">#ff808080</color>
    <color name="lighter_gray">#ffdddddd</color>
    <color name="perms_dangerous_grp_color">#ffdd6826</color>
    <color name="perms_dangerous_perm_color">#ffdd6826</color>
    <color name="shadow">#cc222222</color>
    <color name="search_url_text_normal">#ff7fa87f</color>
    <item type="color" name="search_url_text_selected">@color/black</item>
    <item type="color" name="search_url_text_pressed">@color/black</item>
    <item type="color" name="search_widget_corpus_item_background">@color/lighter_gray</item>
    <item type="color" name="sliding_tab_text_color_active">@color/black</item>
    <item type="color" name="sliding_tab_text_color_shadow">@color/black</item>
    <color name="keyguard_text_color_normal">#ffffffff</color>
    <color name="keyguard_text_color_unlock">#ffa7d84c</color>
    <color name="keyguard_text_color_soundoff">#ffffffff</color>
    <color name="keyguard_text_color_soundon">#ffe69310</color>
    <color name="keyguard_text_color_decline">#fffe0a5a</color>
    <color name="config_defaultNotificationColor">#ff00ff00</color>
</resources>
I think I have to hex edit that, and figure out where in the hex it is....I'll test it all out and let you guys know!
08 00 00 1C does exist. That's how I was able to change the colors for my theme.

Make sure the there are spaces, exactly like I typed.
 
phimuskapsi
Old
(Last edited by phimuskapsi; 27th August 2010 at 08:05 PM.)
#7  
Senior Member - OP
Thanks Meter 22
Posts: 166
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
I have gone through all of the other status bar xmls, searched for it with and without spaces. Both work in HxD search. Anyway. My method now.

1. Get apk tool and follow the instructions to install
2. Decode framework-res.apk to a dir of your choosing
3. Now you have xmls you can edit without a hex editor, notepad works.
4. Change the values, re-encode with apktool
5. Pop the new framework on.

I'm out smoking a cig I'll test this method when I go back in. and update with results
No more theme development for me...too much work for a thankless job :P

Gonna step up my game to an HTC One on 4/19!

http://www.twitter.com/phimuskapsi
http://www.xperimentalcode.com
 
phimuskapsi
Old
(Last edited by phimuskapsi; 27th August 2010 at 11:31 PM.)
#8  
Senior Member - OP
Thanks Meter 22
Posts: 166
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
Getting errors on build...hrm...

EDIT: Finally got it to build. Making a nandroid backup before copying it back though....
EDIT2: built and then signed (which I shouldn't have done apparently) almost bricked. Apparently my nandroid backup failed too -.- says it can't mount the sdcard. I'll be back, have to SBF to 2.1 then Root, then install 2.2 again.
EDIT3: Whew, after a scare where SBF failed (had to format the ROM!) got it back on. About 15 minutes and I'll try somethin else.
EDIT4: Finally looks like I'm ok...working on nandroid, keep getting an error....
 
bad4u6669
Old
#9  
bad4u6669's Avatar
Senior Member
Thanks Meter 280
Posts: 1,244
Join Date: Sep 2009
Location: Cali
if you edit an xml file can you drop it straight into an unzipped fram folder, rezip it, rename it and install?
 
phimuskapsi
Old
#10  
Senior Member - OP
Thanks Meter 22
Posts: 166
Join Date: Jul 2009
Location: Rochester

 
DONATE TO ME
No. because the apk is decompiled. It has to be recompiled then I think signed. I've tried a couple methods and every time I copy the recompiled one to system, signed or not I get trapped at a logo loop. Thankfully if you use adb to copy the framework over you can copy a good one back the adb connection stays open. Copy it back and after a few seconds it starts to loaf properly again

Sent from my DROIDX using XDA App
No more theme development for me...too much work for a thankless job :P

Gonna step up my game to an HTC One on 4/19!

http://www.twitter.com/phimuskapsi
http://www.xperimentalcode.com

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Sony Z Ultra Google Play Edition Receives Bluetooth Certification for Android 4.4.3

You may recall that a few days ago, Sprint jumped the gun … more

Easily Configure Xposed Module Projects in Eclipse

XDA Recognized Developer rovo89‘s innovative and versatile Xposed Framework allows … more

Android Control Center Becomes Quick Control Panel, Brings Host of New Features

You may recall that back in August of last year, we talked … more

Polish Your Custom Themes with Theme Debugger

Creating a custom Android theme from scratch can be quite the laborious task. In addition to … more