[MOD] Lower auto brightness to save battery

Search This thread

newcastle9

Senior Member
Nov 13, 2010
192
48
Last edited:

neotekz

Senior Member
Oct 7, 2007
1,414
170
Ottawa
if you have some experience with apk manager you can do this yourself it's fairly easy. Here's a write up i did for the galaxy nexus a while ago. It should be similar for the nexus 4 just different values for the brightness.

Basically what you have to do is decompile the framework-res.apk and change the values is arrays.xml and recompile and push it back using adb.

1. Download APK manager
2. Grab framework-res.apk from your phone under \system\framework\ (you can use root explorer or adb push) and place it in the "place-apk-here-for-modding" folder
3. Run Script.bat and select option 9
4. go to projects\framework-res.apk\res\values\arrays.xml and edit your values with the ones roger posted in my link above
5. Once edited, compile the apk using option 11
6. Is this a system apk. Ans: y
7. Qn: Aside from the signatures...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 . . . go to "keep" folder and delete resources.arsc and then press any key
9. Choose option 22 to set project to unsignedframework-res.apk
10. Choose option 5 to zipalign the new apk.
11. rename the unsignedframework-res.apk to framework-res.apk and push it to system/framework with these commands in adb.

Code:
Mount System in recovery

adb push framework-res.apk /system/framework/framework-res.apk
reboot


here are the values in arrays.xml to be changed. (the values and number of items will probably be different for the Nexus 4 but you can add or delete items if you want more or less brightness settings)

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues"> 
<item>16</item> 
<item>40</item> 
<item>60</item> 
<item>70</item> 
<item>70</item> 
<item>250</item> 
</integer-array>

here's what i had the new values at.(The lower value of 5 might be too dim or bright for the nexus 4 so you might have to see what you prefer)

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues"> 
<item>5</item> 
<item>20</item> 
<item>50</item> 
<item>70</item> 
<item>150</item> 
<item>250</item> 
</integer-array>

You can play around with the numbers to see what suits you. Just make sure you do a nandroid backup before attempting this mod.
 

evostevo1

Senior Member
Dec 1, 2010
276
34
Will this work even on odexed ?

Sent from my Nexus 4 using xda app-developers app
 

SIGUEL

Senior Member
Mar 7, 2009
337
28
San Juan
if you have some experience with apk manager you can do this yourself it's fairly easy. Here's a write up i did for the galaxy nexus a while ago. It should be similar for the nexus 4 just different values for the brightness.

Basically what you have to do is decompile the framework-res.apk and change the values is arrays.xml and recompile and push it back using adb.

1. Download APK manager
2. Grab framework-res.apk from your phone under \system\framework\ (you can use root explorer or adb push) and place it in the "place-apk-here-for-modding" folder
3. Run Script.bat and select option 9
4. go to projects\framework-res.apk\res\values\arrays.xml and edit your values with the ones roger posted in my link above
5. Once edited, compile the apk using option 11
6. Is this a system apk. Ans: y
7. Qn: Aside from the signatures...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 . . . go to "keep" folder and delete resources.arsc and then press any key
9. Choose option 22 to set project to unsignedframework-res.apk
10. Choose option 5 to zipalign the new apk.
11. rename the unsignedframework-res.apk to framework-res.apk and push it to system/framework with these commands in adb.

Code:
Mount System in recovery

adb push framework-res.apk /system/framework/framework-res.apk
reboot


here are the values in arrays.xml to be changed. (the values and number of items will probably be different for the Nexus 4 but you can add or delete items if you want more or less brightness settings)

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues"> 
<item>16</item> 
<item>40</item> 
<item>60</item> 
<item>70</item> 
<item>70</item> 
<item>250</item> 
</integer-array>

here's what i had the new values at.(The lower value of 5 might be too dim or bright for the nexus 4 so you might have to see what you prefer)

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues"> 
<item>5</item> 
<item>20</item> 
<item>50</item> 
<item>70</item> 
<item>150</item> 
<item>250</item> 
</integer-array>

You can play around with the numbers to see what suits you. Just make sure you do a nandroid backup before attempting this mod.

For some reasons APK managers dont work with JB 4.2, The steps in Xylon for Nexus4 are too bright compared to stock, but thanks anyway I will keep looking for a fix.

Sent from my Nexus 4
 

thesebastian

Senior Member
Sep 25, 2012
1,877
445
Barcelona
if you have some experience with apk manager you can do this yourself it's fairly easy. Here's a write up i did for the galaxy nexus a while ago. It should be similar for the nexus 4 just different values for the brightness.

Basically what you have to do is decompile the framework-res.apk and change the values is arrays.xml and recompile and push it back using adb.

1. Download APK manager
2. Grab framework-res.apk from your phone under \system\framework\ (you can use root explorer or adb push) and place it in the "place-apk-here-for-modding" folder
3. Run Script.bat and select option 9
4. go to projects\framework-res.apk\res\values\arrays.xml and edit your values with the ones roger posted in my link above
5. Once edited, compile the apk using option 11
6. Is this a system apk. Ans: y
7. Qn: Aside from the signatures...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 . . . go to "keep" folder and delete resources.arsc and then press any key
9. Choose option 22 to set project to unsignedframework-res.apk
10. Choose option 5 to zipalign the new apk.
11. rename the unsignedframework-res.apk to framework-res.apk and push it to system/framework with these commands in adb.

Code:
Mount System in recovery

adb push framework-res.apk /system/framework/framework-res.apk
reboot


here are the values in arrays.xml to be changed. (the values and number of items will probably be different for the Nexus 4 but you can add or delete items if you want more or less brightness settings)

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues"> 
<item>16</item> 
<item>40</item> 
<item>60</item> 
<item>70</item> 
<item>70</item> 
<item>250</item> 
</integer-array>

here's what i had the new values at.(The lower value of 5 might be too dim or bright for the nexus 4 so you might have to see what you prefer)

Code:
<integer-array name="config_autoBrightnessLcdBacklightValues"> 
<item>5</item> 
<item>20</item> 
<item>50</item> 
<item>70</item> 
<item>150</item> 
<item>250</item> 
</integer-array>

You can play around with the numbers to see what suits you. Just make sure you do a nandroid backup before attempting this mod.

Tried to do that...but i tried to install the compiled apk with "Solid Explorer".
I finished up with all crashing (because of the framework-res replacement) and after a forced reboot i got a boot loop ( i think ). (Oh, i forgot to edit permissions whether its needed) haha
Nandroid restore after that :good:

But i really wanted to try Paranoid Android values in Nexus 4.

I need a more detailed guide because i'm doing something wrong...
I copy/pasted the resources file (from original framework-res.apk) in order to "compile" the apk.....after that...zipaligned.....and then tried to install it normal (but can't) second..tried to install it with the explorer..
 
Last edited:

neotekz

Senior Member
Oct 7, 2007
1,414
170
Ottawa
Tried to do that...but i tried to install the compiled apk with "Solid Explorer".
I finished up with all crashing (because of the framework-res replacement) and after a forced reboot i got a boot loop ( i think ). (Oh, i forgot to edit permissions whether its needed) haha
Nandroid restore after that :good:

But i really wanted to try Paranoid Android values in Nexus 4.

I need a more detailed guide because i'm doing something wrong...
I copy/pasted the resources file (from original framework-res.apk) in order to "compile" the apk.....after that...zipaligned.....and then tried to install it normal (but can't) second..tried to install it with the explorer..

Try using a different version of apk manager. I remember having to use a few different versions before it worked. I don't remember what version. It might of been apktool that I used. I haven't done this mod in a while since the auto brightness of the nexus 4 with AOKP is good and I just use screen dim when I want to go lower.
 

thesebastian

Senior Member
Sep 25, 2012
1,877
445
Barcelona
Try using a different version of apk manager. I remember having to use a few different versions before it worked. I don't remember what version. It might of been apktool that I used. I haven't done this mod in a while since the auto brightness of the nexus 4 with AOKP is good and I just use screen dim when I want to go lower.

In my case...i wanted to use Paranoid_Android Kernel (it's AOSP kernel with different gamma settings called "Halfbreed"). But PA ROM has higher Auto Brightness for this gamma...that's why i wanted to try this. I'm on Stock right now QQ.

BTW...i'm very noob with all this...so it's ok :p
I tried to use apktool 1st...
but i don't know how to sign the file..zip align...etc if i use that tool...
 

johnw.xda

Senior Member
Jan 8, 2011
116
5
Can it work for 4.3 ?

Hi, I want lower auto brightness to save battery life, but my nexus 4 is 4.3 (I buy it just 3 days)
can I still use this one for lower auto brightness to save battery life ?
can you tell me, how do you mod this? (/system/framework/framework-res.apk)
just unzip it, then change setting, then re-zip it?
I want to learn this skill to mod it by my self.
thanks.
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 6
    if you have some experience with apk manager you can do this yourself it's fairly easy. Here's a write up i did for the galaxy nexus a while ago. It should be similar for the nexus 4 just different values for the brightness.

    Basically what you have to do is decompile the framework-res.apk and change the values is arrays.xml and recompile and push it back using adb.

    1. Download APK manager
    2. Grab framework-res.apk from your phone under \system\framework\ (you can use root explorer or adb push) and place it in the "place-apk-here-for-modding" folder
    3. Run Script.bat and select option 9
    4. go to projects\framework-res.apk\res\values\arrays.xml and edit your values with the ones roger posted in my link above
    5. Once edited, compile the apk using option 11
    6. Is this a system apk. Ans: y
    7. Qn: Aside from the signatures...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 . . . go to "keep" folder and delete resources.arsc and then press any key
    9. Choose option 22 to set project to unsignedframework-res.apk
    10. Choose option 5 to zipalign the new apk.
    11. rename the unsignedframework-res.apk to framework-res.apk and push it to system/framework with these commands in adb.

    Code:
    Mount System in recovery
    
    adb push framework-res.apk /system/framework/framework-res.apk
    reboot


    here are the values in arrays.xml to be changed. (the values and number of items will probably be different for the Nexus 4 but you can add or delete items if you want more or less brightness settings)

    Code:
    <integer-array name="config_autoBrightnessLcdBacklightValues"> 
    <item>16</item> 
    <item>40</item> 
    <item>60</item> 
    <item>70</item> 
    <item>70</item> 
    <item>250</item> 
    </integer-array>

    here's what i had the new values at.(The lower value of 5 might be too dim or bright for the nexus 4 so you might have to see what you prefer)

    Code:
    <integer-array name="config_autoBrightnessLcdBacklightValues"> 
    <item>5</item> 
    <item>20</item> 
    <item>50</item> 
    <item>70</item> 
    <item>150</item> 
    <item>250</item> 
    </integer-array>

    You can play around with the numbers to see what suits you. Just make sure you do a nandroid backup before attempting this mod.
    3
    hi guys i modded the stock framework apk to give lower brightness at lower light here are the values i set

    10
    15
    20
    30
    40
    50
    55
    70
    80
    100
    200
    255

    here are the stock values

    14
    28
    37
    51
    71
    80
    96
    108
    144
    181
    254
    255

    to install copy the file to your system/framework folder and overwrite the old one

    DOWNLOAD
    http://www65.zippyshare.com/v/73724600/file.html
    2
    For some reasons APK managers dont work with JB 4.2, The steps in Xylon for Nexus4 are too bright compared to stock, but thanks anyway I will keep looking for a fix.

    Sent from my Nexus 4

    I posted a apk manager that works with android 4.2.1

    http://xdaforums.com/showthread.php?t=2063477

    Sent from my Nexus 4 using Tapatalk 2
    1
    Will this work even on odexed ?

    Sent from my Nexus 4 using xda app-developers app

    Yep I'm using it on stock odexed

    Sent from my Nexus 4 using Tapatalk 2