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

Search This thread

phimuskapsi

Senior Member
Jul 23, 2009
173
22
Stamford
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!
text.png


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.
 
Last edited:

ghostlypickel

Senior Member
Jan 6, 2010
58
25
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

Senior Member
Mar 8, 2008
661
11
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
 

phimuskapsi

Senior Member
Jul 23, 2009
173
22
Stamford
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!
 
Last edited:

ghostlypickel

Senior Member
Jan 6, 2010
58
25
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

Senior Member
Jul 23, 2009
173
22
Stamford
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
 
Last edited:

phimuskapsi

Senior Member
Jul 23, 2009
173
22
Stamford
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....
 
Last edited:

Corey@rabbit

Senior Member
Sep 26, 2009
1,248
282
Cali
if you edit an xml file can you drop it straight into an unzipped fram folder, rezip it, rename it and install?
 

phimuskapsi

Senior Member
Jul 23, 2009
173
22
Stamford
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
 

Corey@rabbit

Senior Member
Sep 26, 2009
1,248
282
Cali
when i decompile it said it couldnt for a few files, so recompiling will give me a bad apk, what if you recompile then pull just the xml files and place them in a good framework.apk . Have you tried that yet?

how many xml's are you changing at once?
 

phimuskapsi

Senior Member
Jul 23, 2009
173
22
Stamford
when i decompile it said it couldnt for a few files, so recompiling will give me a bad apk, what if you recompile then pull just the xml files and place them in a good framework.apk . Have you tried that yet?

how many xml's are you changing at once?

Just one. The reason I can't just drag and drop to a known good one is that the folder is not in the normal one. There are a bunch of folders missing. Look at the decoded folder vs. what's in the file when opened with 7-zip.

I'm changing /res/values/colors.xml
 

phimuskapsi

Senior Member
Jul 23, 2009
173
22
Stamford
Thought I had it there for a sec....getting much much closer. I can compile now, I get warnings but no errors...

Before when I had a "bad" framework, the droid text wouldn't even animate right, never got to the eye either.

Now I can get to the eye, but it just loops. Can fix by adb'ing the files back.

... Still working on this. Not giving up.,


EDIT: Yes. I'm positive. I've edited all I can in that file.
 
Last edited:

phimuskapsi

Senior Member
Jul 23, 2009
173
22
Stamford
whitefintext.png


Proof of concept...the only problem is the way I edited it...well, it's gonna be complicated to get it JUST to effect the notification bar. I'm working on that part now.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    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!
    text.png


    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.