[MOD] Lower Captive Button Brightness levels to Stop Bleeding

Search This thread

jul644

Senior Member
Jul 22, 2009
955
200
London Ontario
www.lmgtfy.com
This is best done after you flash a ROM as you might lose some settings.
(I noticed my wall paper changed and i had to sign back into Google account)
---This framework-res.apk file is different for every ROM---

In order to lower button brightness levels You have to change values in framework-res.apk/res/values/arrays.xml and here is how (read whole post first )

These are stock HTC AMAZE values:

Code:
<integer-array name="config_autoBrightnessButtonBacklightValues">
        <item>255</item>
        <item>255</item>
        <item>255</item>
        <item>255</item>
        <item>-1</item>
        <item>0</item>
        <item>0</item>
        <item>0</item>
        <item>0</item>
        <item>0</item>
    </integer-array>

These are values should reduce the problem significantly

Code:
<integer-array name="config_autoBrightnessButtonBacklightValues">
        <item>190</item>
        <item>190</item>
        <item>190</item>
        <item>190</item>
        <item>-1</item>
        <item>0</item>
        <item>0</item>
        <item>0</item>
        <item>0</item>
        <item>0</item>
    </integer-array>

These brightness levels are corresponding to the amount of light that light sensor is getting - the lowest value is while in the low light the highest when for example your phone is in direct sunlight. Brightness values are defined by numbers 1 is the lowest possible setting and 255 is the maximum brightness that can be set.

As You can see I was pretty aggressive with lowering these values and yet the buttons are still bright in every situation. You can set them a little bit higher or lower in order to suit your preferences.


Here is a guide on how to perform this mod on any framework-res.apk using apk manager (thanks for the guide goes to desean):

1. Download APK manager and unpack somewhere

2. Grab framework-res.apk from your phone under \system\framework\ (e.g. adb pull) and place it in the "place-apk-here-for-modding" folder

3. Run Script.bat and select option 9

4. Once done, go to projects\framework-res.apk\res\values\arrays.xml and edit your values as per first post.

5. Once edited, compile the apk using option 11

6. Qn: Is this a system apk. Ans: y

7. Qn: Aside from the signatures, would .... least. Ans: y

8. Prompt: In the apk manager folder u'll find a keep folder..... done then press enter on this script. Press any key to continue . . . You have to go to "keep" folder and delete resources.arsc because arrays.xml have been changed. After this You can press any key in apk manager window.

9. Once done, input 22 in apk manager and select "unsignedframework-res.apk" by entering the number that stands for it. After selecting it You should see in apk main window in the top right corner "Current-App: unsignedframework-res.apk".

10. Now press 5 to zipalign apk. You will find your completed, zipaligned apk under place-apk-here-for-modding\unsignedframework-res.apk.

11.Rename it back to framework-res.apk and adb push the file back to your phone

To send it back to your phone

Prerequisites have...

The file you are pushing must be placed in the platform-tools folder of adb so if you are pushing file "framework-res.apk" this needs to be downloaded/copy and pasted in C:\android-sdk-windows\platform-tools

1: go to run and type cmd (or just open your command prompt)

2: cd C:\android-sdk-windows\platform-tools

3: adb remount

4: adb devices *if everything is set up right this should output a serial number*

5: adb push FFFFFFF.FFF /#####/###### *i hope my notes help here you need to put the file name in for the F(s) and in the pound signs you put the destination on the devices:

Code:
adb push framework-res.apk /system/framework

7. adb reboot this is how you finish

You have to copy the file to your phone with ADB or you will get a boot loop and have to re install your ROM.

Link for APK Manager HERE

If you have problems with apk manager showing java error (like it did) this post helped me fix that :)

Sources:
http://xdaforums.com/showthread.php?t=1235212
http://xdaforums.com/showthread.php?t=695701
http://xdaforums.com/showthread.php?t=642437

APK Manager 4.9 download link (currently original thread link down for me)
http://www.zshare.net/download/99034654c32618ba/
 
Last edited:

Bdix

Senior Member
Dec 30, 2010
178
11
you know there is a free app on the market that fixes this problem right?

Sent from my HTC_Amaze_4G using XDA App
 

Chance Ill

Senior Member
okay so you can all see when your watching a movie and your captive back light buttons are one and they bleed into the screen, i will post a quick tutorial how to fix this issue or any rom, but i need some one to exract their framework-res.apk from /system/framework directory

if some one can send me their i can make a quick tutorial :)

You've caught my interest. Here you go...... :)
 

Attachments

  • framework-res.apk
    7.6 MB · Views: 96

Double0EK

Senior Member
May 13, 2010
2,667
1,020
Cool...will gladly test when fixed. Also do you mind telling us what is changed in the framework-res.apk ?


Sent by accident from my Amaze using Tapatalk :)
 

jul644

Senior Member
Jul 22, 2009
955
200
London Ontario
www.lmgtfy.com
Cool...will gladly test when fixed. Also do you mind telling us what is changed in the framework-res.apk ?


Sent by accident from my Amaze using Tapatalk :)

updated the original post, i dont have my amaze any more but these values should be low enough to fix the bleed but still see them!

Post back on your experience guys and if different levels work better

also if some one can do a before and after shot that would be wicked
 
  • Like
Reactions: Double0EK

silvscorp

Senior Member
Jan 30, 2007
419
31
updated the original post, i dont have my amaze any more but these values should be low enough to fix the bleed but still see them!

Post back on your experience guys and if different levels work better

also if some one can do a before and after shot that would be wicked

Very NICE!!! hope all devs can implement this in their future releases..
 

XmentalX

Senior Member
Nov 23, 2006
195
45
Bay Area
www.google.com
I just have this script run on boot

#!/system/bin/sh

echo 0 > /sys/class/leds/button-backlight/brightness
chmod 444 /sys/class/leds/button-backlight/brightness


In my case it disables them completely but you can replace the 0 with a value that suits you best and that will be your maximum brightness and it's much less invasive of a change to your device

Sent from my HTC_Amaze_4G using xda premium
 
  • Like
Reactions: Dom42 and jul644

jul644

Senior Member
Jul 22, 2009
955
200
London Ontario
www.lmgtfy.com
I just have this script run on boot

#!/system/bin/sh

echo 0 > /sys/class/leds/button-backlight/brightness
chmod 444 /sys/class/leds/button-backlight/brightness


In my case it disables them completely but you can replace the 0 with a value that suits you best and that will be your maximum brightness and it's much less invasive of a change to your device

Sent from my HTC_Amaze_4G using xda premium

thats very nice could i put that in the first thread? (do you just type that into cmd after a su command?
 

XmentalX

Senior Member
Nov 23, 2006
195
45
Bay Area
www.google.com
thats very nice could i put that in the first thread? (do you just type that into cmd after a su command?


you would run it as an init.d script if your rom supports it, or there is scripter on the market which you can just create a new script and copy and paste it into it.

that or if your going to copy and paste it into a command prompt just remove the #!/system/bin/sh line.

keep in mind why I run this on boot is because it doesnt survive a reboot so it must be reapplied as such unless the rom you run has the number premodified before flashing (i assume, just a guess not a developer by any means)

I learned this trick way back with my EVO 4g and subsequent 3D I now ditched sprint and am on Tmo. I take no credit for it so share and share alike :)
 
  • Like
Reactions: Double0EK

Double0EK

Senior Member
May 13, 2010
2,667
1,020
XmentalX - I just created a g-script with that command and it works like a charm. thanks

Sent by accident from my Amaze using Tapatalk :)
 
  • Like
Reactions: CalicoJeb

rubyman94

Senior Member
Nov 13, 2010
265
23
Is there any way to do it on a non rooted amaze?

Sent from my HTC_Amaze_4G using xda premium
 

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    This is best done after you flash a ROM as you might lose some settings.
    (I noticed my wall paper changed and i had to sign back into Google account)
    ---This framework-res.apk file is different for every ROM---

    In order to lower button brightness levels You have to change values in framework-res.apk/res/values/arrays.xml and here is how (read whole post first )

    These are stock HTC AMAZE values:

    Code:
    <integer-array name="config_autoBrightnessButtonBacklightValues">
            <item>255</item>
            <item>255</item>
            <item>255</item>
            <item>255</item>
            <item>-1</item>
            <item>0</item>
            <item>0</item>
            <item>0</item>
            <item>0</item>
            <item>0</item>
        </integer-array>

    These are values should reduce the problem significantly

    Code:
    <integer-array name="config_autoBrightnessButtonBacklightValues">
            <item>190</item>
            <item>190</item>
            <item>190</item>
            <item>190</item>
            <item>-1</item>
            <item>0</item>
            <item>0</item>
            <item>0</item>
            <item>0</item>
            <item>0</item>
        </integer-array>

    These brightness levels are corresponding to the amount of light that light sensor is getting - the lowest value is while in the low light the highest when for example your phone is in direct sunlight. Brightness values are defined by numbers 1 is the lowest possible setting and 255 is the maximum brightness that can be set.

    As You can see I was pretty aggressive with lowering these values and yet the buttons are still bright in every situation. You can set them a little bit higher or lower in order to suit your preferences.


    Here is a guide on how to perform this mod on any framework-res.apk using apk manager (thanks for the guide goes to desean):

    1. Download APK manager and unpack somewhere

    2. Grab framework-res.apk from your phone under \system\framework\ (e.g. adb pull) and place it in the "place-apk-here-for-modding" folder

    3. Run Script.bat and select option 9

    4. Once done, go to projects\framework-res.apk\res\values\arrays.xml and edit your values as per first post.

    5. Once edited, compile the apk using option 11

    6. Qn: Is this a system apk. Ans: y

    7. Qn: Aside from the signatures, would .... least. Ans: y

    8. Prompt: In the apk manager folder u'll find a keep folder..... done then press enter on this script. Press any key to continue . . . You have to go to "keep" folder and delete resources.arsc because arrays.xml have been changed. After this You can press any key in apk manager window.

    9. Once done, input 22 in apk manager and select "unsignedframework-res.apk" by entering the number that stands for it. After selecting it You should see in apk main window in the top right corner "Current-App: unsignedframework-res.apk".

    10. Now press 5 to zipalign apk. You will find your completed, zipaligned apk under place-apk-here-for-modding\unsignedframework-res.apk.

    11.Rename it back to framework-res.apk and adb push the file back to your phone

    To send it back to your phone

    Prerequisites have...

    The file you are pushing must be placed in the platform-tools folder of adb so if you are pushing file "framework-res.apk" this needs to be downloaded/copy and pasted in C:\android-sdk-windows\platform-tools

    1: go to run and type cmd (or just open your command prompt)

    2: cd C:\android-sdk-windows\platform-tools

    3: adb remount

    4: adb devices *if everything is set up right this should output a serial number*

    5: adb push FFFFFFF.FFF /#####/###### *i hope my notes help here you need to put the file name in for the F(s) and in the pound signs you put the destination on the devices:

    Code:
    adb push framework-res.apk /system/framework

    7. adb reboot this is how you finish

    You have to copy the file to your phone with ADB or you will get a boot loop and have to re install your ROM.

    Link for APK Manager HERE

    If you have problems with apk manager showing java error (like it did) this post helped me fix that :)

    Sources:
    http://xdaforums.com/showthread.php?t=1235212
    http://xdaforums.com/showthread.php?t=695701
    http://xdaforums.com/showthread.php?t=642437

    APK Manager 4.9 download link (currently original thread link down for me)
    http://www.zshare.net/download/99034654c32618ba/
    5
    Thanks for the additional tips, frodoboy. Are you saying that zipaligning isn't necessary? That's the step that was causing me problems with Apk Manager presumably due to something wrong with the filename or file path. I had serious doubts that my 3.5MB unsignedframework-res.apk file was correct for renaming and putting back into the ROM when the original file was 8MB.

    I'm on Energy 2.3.2012. The main reason I'm sticking with it is because I like the smaller fonts in the text message history window. I was prepared to use the framework-res.apk that was posted in the main Energy thread, but I think I'd prefer a dim setting for the max brightness like 31 or 63 rather than have it completely off.

    I'm working on implementing this mod in the ROM I'm releasing today. I've always been annoying by the high brightness setting of the LEDs as well... hate when they bleed onto the screen.
    2
    I just have this script run on boot

    #!/system/bin/sh

    echo 0 > /sys/class/leds/button-backlight/brightness
    chmod 444 /sys/class/leds/button-backlight/brightness


    In my case it disables them completely but you can replace the 0 with a value that suits you best and that will be your maximum brightness and it's much less invasive of a change to your device

    Sent from my HTC_Amaze_4G using xda premium
    2
    Thanks for the additional tips, frodoboy. Are you saying that zipaligning isn't necessary? That's the step that was causing me problems with Apk Manager presumably due to something wrong with the filename or file path. I had serious doubts that my 3.5MB unsignedframework-res.apk file was correct for renaming and putting back into the ROM when the original file was 8MB.

    I'm on Energy 2.3.2012. The main reason I'm sticking with it is because I like the smaller fonts in the text message history window. I was prepared to use the framework-res.apk that was posted in the main Energy thread, but I think I'd prefer a dim setting for the max brightness like 31 or 63 rather than have it completely off.

    Hmm. Are you using NRG's stock kernel or Faux's kernel? If you are using Faux's, he has lowered the voltages to the buttons to help with the bleed issue and for better battery life. If you set the values too low with this mod, the lights will shut off completely. I went back to stock kernel and my setting of 25 works great. Low light and low bleed in darkness and completely off in sunlight.

    Zip aligning is necessary. Did you make sure you followed step #8 exactly and delete "resourcs.arsc?" Then you zipalign, rename and push back to the phone. It worked fine for me.

    ---------- Post added at 10:47 AM ---------- Previous post was at 10:45 AM ----------

    I'm working on implementing this mod in the ROM I'm releasing today. I've always been annoying by the high brightness setting of the LEDs as well... hate when they bleed onto the screen.

    Thanks for that NRG. I hate having to mod the ROMs to my liking when they come out but this will make it one less thing for me to have to do every time! :D

    OH....I JUST REALIZED!!! Did you say "The ROM I'm releasing today???" Is this a new "tweak" of 3.0? Can't wait for that. Nothing on your Energy ROM thread yet but the day is young.
    1
    Now easier than ever thanks to Morrislee =)

    http://xdaforums.com/showpost.php?p=24510680&postcount=7

    Read down that thread a few posts for a super easy, no computer necessary method using this file too =) (via misfit61871)


    http://xdaforums.com/showpost.php?p=24524099&postcount=10

    Sent from my HTC_Amaze_4G using xda premium