[MOD]Lower Auto-Brightness levels to save battery - Galaxy S II Themes and Apps

Hi,
I wanted to share a little mod that could help in extending battery life - lowering default auto-brightness levels. As all of You know our big, bright SuperAMOLED Plus is an excelent display but for that it uses most of our battery:/ I like the idea of auto-brightness but I find it too bright for most of the time. Setting brightness manualy to one level makes it either too dim or it uses too much battery and switching it all the time that You go outside or turn on the light is a little bit inconvenient. In order to lower auto-brightness levels You have to change values in framework-res.apk/res/values/arrays.xml
These are stock Samsung values:
Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>32</item>
<item>69</item>
<item>118</item>
<item>177</item>
<item>255</item>
</integer-array>
These are values that I use (It is just an example):
Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>5</item>
<item>30</item>
<item>70</item>
<item>130</item>
<item>255</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 screen is 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". Now press 5 to zipalign apk. You will find your completed, zipaligned apk under place-apk-here-for-modding\unsignedframework-res.apk. Rename it back to framework-res.apk and adb push the file back to your phone
And here is a link for already modified framework-res.apk (originaly made by Kahvitahra with his modifications - APM + CRT + OS + JKays Green Battery I just added lower auto-brightness levels). It will work only with VillainRom 2.4.2:
http://www.multiupload.com/5TE5GY2J32
I hope that You'll like it

Thanks! 10char

LockeOn said:
Hi,
I wanted to share a little mod that could help in extending battery life - lowering default auto-brightness levels. As all of You know our big, bright SuperAMOLED Plus is an excelent display but for that it uses most of our battery:/ I like the idea of auto-brightness but I find it too bright for most of the time. Setting brightness manualy to one level makes it either too dim or it uses too much battery and switching it all the time that You go outside or turn on the light is a little bit inconvenient. In order to lower auto-brightness levels You have to change values in framework-res.apk/res/values/arrays.xml
These are stock Samsung values:
Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>32</item>
<item>69</item>
<item>118</item>
<item>177</item>
<item>255</item>
</integer-array>
These are values that I use (It is just an example):
Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>5</item>
<item>30</item>
<item>70</item>
<item>130</item>
<item>255</item>
</integer-array>
As You can see I was pretty aggressive with lowering these values and yet the screen is still bright in every situation. You can set them a little bit higher or lower in order to suit your preferences.
Here is a link for already modified framework-res.apk (originaly made by Kahvitahra with his modifications - APM + CRT + OS + JKays Green Battery I just added lower auto-brightness levels). It will work only with VillainRom 2.4.2:
http://www.multiupload.com/5TE5GY2J32
I hope that You'll like it
Click to expand...
Click to collapse
Thanks again

I'm on Batista 3.7.2..
open the framework-res.apk.. but couldn't find the arrays.xml
can i copy n paste the file.. ?

zoule HCo said:
I'm on Batista 3.7.2..
open the framework-res.apk.. but couldn't find the arrays.xml
can i copy n paste the file.. ?
Click to expand...
Click to collapse
You have to decompile the apk first!

zoule HCo said:
I'm on Batista 3.7.2..
open the framework-res.apk.. but couldn't find the arrays.xml
can i copy n paste the file.. ?
Click to expand...
Click to collapse
u need to decompile it /..smali..

kalpik said:
You have to decompile the apk first!
Click to expand...
Click to collapse
yup i already decompile the apk..
batista framework-res.apk i think fully modified..
will download the link above..

compiled, changed the values, can't notice any difference... but I'll keep watching.
Edit:
Ok, lower values - can notice the difference, it works!
My values - 255, 140, 90, 40, 10.

Yeah! Will try to compile later! Thx this was the mod I waiting for!
Sent from my GT-I9100 using XDA App
EDIT: Tryed to compile for cog 1.5 but stuck into bootloop...
EDIT2: Have made it work! Here the file for Cognition 1.5 with Lucid/Hyperdroid Theme with these params:
Code:
<item>3</item>
<item>30</item>
<item>70</item>
<item>140</item>
<item>255</item>

Can you outline the procedure and tools used..just simple steps would do.. Btw is the hack working as expected?
Sent from my GT-I9100 using Tapatalk

Excuse my ignorance, but how do I install this?
Sent from my GT-I9100

lostsoul said:
Excuse my ignorance, but how do I install this?
Sent from my GT-I9100
Click to expand...
Click to collapse
look for APK Manager links and how to
you need to decompil framework-res.apk
then compil back

sicopat said:
look for APK Manager links and how to
you need to decompil framework-res.apk
then compil back
Click to expand...
Click to collapse
Do you have to change anything in the apk manager setting? such as compression rate?
Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?

I really wanted to try this out, using MoDaCo but there is no framework-res.apk/res/values/arrays.xml in the framework-res.apk. Am I pulling it from the right place? I pulled it from /system/framework/

prosumerhacks said:
Can you outline the procedure and tools used..just simple steps would do.. Btw is the hack working as expected?
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
lostsoul said:
Excuse my ignorance, but how do I install this?
Sent from my GT-I9100
Click to expand...
Click to collapse
ebliss said:
Do you have to change anything in the apk manager setting? such as compression rate?
Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?
Click to expand...
Click to collapse
I will post a simple guide how to modify any framework-res.apk using apkmanager but it has to wait till midnight or so. Another thing is that I think that 70, 130 and 255 values can be lowered a little bit more - I have been using my phone all day while I was outside and the screen was really bright. If anyone will find some kind of perfect ultra low levels please share them, for now everybody can test their configuration. Last thing - i was using my phone a lot today and battery usage for display went down from usual 68-72% to 55-56%.

ebliss said:
Do you have to change anything in the apk manager setting? such as compression rate?
Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?
Click to expand...
Click to collapse
yes
DanRyb said:
I really wanted to try this out, using MoDaCo but there is no framework-res.apk/res/values/arrays.xml in the framework-res.apk. Am I pulling it from the right place? I pulled it from /system/framework/
Click to expand...
Click to collapse
on post 5, it is already mentioned that you need to decompile the apk first!

Thanks for your reply, but I did decompile it! I do not see that file within the structure listed!
desean said:
yes
on post 5, it is already mentioned that you need to decompile the apk first!
Click to expand...
Click to collapse

ebliss said:
Do you have to change anything in the apk manager setting? such as compression rate?
Also, during compiling, it will prompt whether this is a system apk, do I answer "y"?
Click to expand...
Click to collapse
don't change compression rate
every apks located in /system folders are system apk so Yes.
you press Yes then Yes again. a keep folder is created delete ressources.acrs in it, then press any kay in apk manager windows
in place here apk to mod you have now unsignedframework-res.apk, just rename it in framework-res.apk and if you want you can zipallign it (it will work without last step)

Thanks LockeOn for sharing.
Just a quick how-to for everyone else before more people post on how to apply the MOD, using APK manager (I think this is the easiest method)
Steps
Download APK manager and unpack somewhere
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
Run Script.bat and select option 9
Once done, go to projects\framework-res.apk\res\values\arrays.xml and edit your values as per first post.
Once edited, compile the apk using option 11
Qn: Is this a system apk. Ans: y
Qn: Aside from the signatures, would .... least. Ans: y
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.
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". Now press 5 to zipalign apk. You will find your completed, zipaligned apk under place-apk-here-for-modding\unsignedframework-res.apk
rename back to framework-res.apk and adb push the file back to your phone.
And here are the values I use, taking some values from my Hero days
Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>5</item>
<item>25</item>
<item>60</item>
<item>125</item>
<item>255</item>
</integer-array>
Since some MOD (like APM for example) make changes to the framework-res.apk, it is better for you to do your own instead of begging others to do and post here.
Edit1: Updated steps as recommended by LockeOn
Edit2: using more aggressive values now after few days testing
Code:
<integer-array name="config_autoBrightnessLcdBacklightValues">
<item>2</item>
<item>15</item>
<item>32</item>
<item>100</item>
<item>200</item>
</integer-array>
before this, i was always using minimum brightness instead of auto brightness thus decided to set 32 and below for majority of the values. it works for me when i am indoor and outdoor under low light. when outdoors under brightness, the increase is bright enough for me so I believe i have found my sweet spot
note that my environment and preference may diff from everyone so what works for me may not work for you

DanRyb said:
Thanks for your reply, but I did decompile it! I do not see that file within the structure listed!
Click to expand...
Click to collapse
I think you unpacked, not decompile.

Related

[MOD] Electron Beam / CRT screen off animation for JVP + PNGs optimization

CRT screen off animation for JVP for odexed (stock) and deodexed ROM's.
UPDATE 14.06.2011:
- /framework-res.apk/resources.arsc file isn't compressed (like in stock Samsung ROM's)
- optimized all framework PNGs (with optipng) in framework-res.apk and twframework-res.apk (lower memory footprint, maybe slightly faster)
- autofixing /system/framework permissions in CWM package
10.06.2011:
- fixed CWM package
- enabled animation in /framework-res.apk/res/values/bools.xml
All .apk files all zipaligned, like in stock ROM
Installation:
Download zip and apply via CWM:
CRT_screen_off-optimized-JVP-CWM3-proper.zip (5.71 MB)
OR (if you don't have CWM):
Download framework-res.apk and replace it in /system/framework/ directory by Root Explorer or adb shell. You should have ~6MB free space on /system partition before operation (delete some unneeded apps from system using Root Explorer or nitrality).
framework-res.apk (7.95 MB)
After installation you have to open Settings => Display => Animations and turn them ON to get it working Also don't change speed of animations by Spare Parts or nitrality - it will disable CRT screen off.
thank you so much that was prety fast
BTW what is electron beam ?
can you provide pics pls?
does not work, says installation aborted.
Tested? I Made the same and gives me a bootloop
Edit : cwm3 package Not working.
Sent from my GT-I9000 using Tapatalk
rhadoo04 said:
does not work, says installation aborted.
Click to expand...
Click to collapse
Same here.
Deodexed/zipaligned and dark core kernel 2.7.2 here.
Sorry didn't have CWM3 to test (CF-Root wasn't finished), and there was a problem with update-script. Here's the proper package, should work now:
--links in first post--
Tested on CF-Root for JVP, it works
BTW what is electron beam ?
Click to expand...
Click to collapse
It's other name for CRT screen off animation
Tested? I Made the same and gives me a bootloop
Click to expand...
Click to collapse
Using this framework-re.apk on my phone and it works
Bo$s said:
Sorry didn't have CWM3 to test (CF-Root wasn't finished), and there was a problem with update-script. Here's the proper package, should work now:
CRT_screen_off-JVP-CWM3-proper.zip (5.4 MB)
Tested on CF-Root for JVP, it works
It's other name for CRT screen off animation
Using this framework-re.apk on my phone and it works
Click to expand...
Click to collapse
thanks for the new file, gona try it!
Now i can begin with my new theme for JVP.
edit: Working as i should now, thanks!
CRT animation works a treat on JVP and SpeedMod 15H.
Thanks for doing this so quickly
I'll have to try this later
thanks, working like a charm
thanks great work!!! congratulation
can you please made like this mod for JPJV6 or tell me how to do it
suwidah said:
thanks great work!!! congratulation
can you please made like this mod for JPJV6 or tell me how to do it
Click to expand...
Click to collapse
Download apk_manager 5.0 beta (somewhere in apk_manager thread).
Download apktool 1.4.1 (or newer), extract it, replace apktool.jar in apk_manager/other folder with downloaded version.
Pull framework-res.apk and twframework-res.apk from /system/framework/ and put them in apk_manager (modding folder).
Open apk_manager, choose framework-res.apk as project, decompile it with dependency, as dependency give twframework-res.apk.
After decompile go to projects/framework-res.apk/res/values/.
Open bools.xml in notepad, change value of bool name='config_animateScreenLights' from 'true' to 'false' and save it.
Go to apk_manager, compile, answer Yes for question about system file, answer Yes in next question, go to keep folder, remove resources.arsc, then hit enter in apk_manager.
After successful compile you can choose zipalign options.
You will find unsignedframework-res.apk in modding folder, rename it to framework-res.apk and put in /system/framework/.
Pretty easy
WOW!! very useful and nice step by step.
Thanks Mr. Bo$s I will use your guide after I receive my SGS from repair in Sunday, I will tell you if I successful in this
no I haven't successful it's keep restart on boot animation:confused
I KNOW it says 'CWM3', but will it work with the 'CWM2.5' that comes with speedmod's new kernel?
thx for the response...
WORKED LIKE A CHARM!!!
I ended up using "Super Manager" (free) from the market to install the apk file instead of messing with CWM.
Thanks a lot for that!!
Raman's deodoxed XXJVP with Speedmod kernel k15-t6
DanDroidian said:
I KNOW it says 'CWM3', but will it work with the 'CWM2.5' that comes with speedmod's new kernel?
thx for the response...
Click to expand...
Click to collapse
It should work with CWM 2.5 too.
Sent from my GT-I9000 using Tapatalk
Bo$s said:
Download apk_manager 5.0 beta (somewhere in apk_manager thread).
Download apktool 1.4.1 (or newer), extract it, replace apktool.jar in apk_manager/other folder with downloaded version.
Pull framework-res.apk and twframework-res.apk from /system/framework/ and put them in apk_manager (modding folder).
Open apk_manager, choose framework-res.apk as project, decompile it with dependency, as dependency give twframework-res.apk.
After decompile go to projects/framework-res.apk/res/values/.
Open bools.xml in notepad, change value of bool name='config_animateScreenLights' from 'true' to 'false' and save it.
Go to apk_manager, compile, answer Yes for question about system file, answer Yes in next question, go to keep folder, remove resources.arsc, then hit enter in apk_manager.
After successful compile you can choose zipalign options.
You will find unsignedframework-res.apk in modding folder, rename it to framework-res.apk and put in /system/framework/.
Click to expand...
Click to collapse
after all that make reboot intio cwm recovery and take fix permissions
most of bt wifi drain or any problems come from noobish copying over files via adb, root explorer, cwm flashables that are not setting proper permisions and owners for files... fix permisions should be used 'just in case' after such interference with system
Thanks, works like a charm!
works like a charm, thanks.

[Tutorial] Doing simple mods on framework-res.apk when apktool doesn't work properly

Hi again!
Some people asked how I did the mod I posted on the thread http://forum.xda-developers.com/showthread.php?t=1738094 and I promised I would say it.
First off, this method will require you to go deep inside binary files, so please don't try to do it if you didn't completely understand every step and know the basics about the hexadecimal, binary diffs, etc.
Before start
I will start saying what was supposed to work. You should use apktool to decode the apk, modify what you want, and then use apktool build it again. But, as of the latest version of apktool I tried (1.4.3), decode and build doesn't work for for Xperia S' framework-res.apk. (Maybe bug http://code.google.com/p/android-apktool/issues/detail?id=313 and http://code.google.com/p/android-apktool/issues/detail?id=256 are related?)
The closest I could get is using apktool 1.4.1, but the generated file was so smaller than the original and I wasn't brave enough to test on my phone.
Anyway, you will need to do this "normal" process (decode and build) for this method too. You can use any version of apktool that decode and build without errors. I used 1.4.1, but I believe a newer version could get a closer output, thus a easy file to do a binary diff. Don't worry, we won't flash these malformed apk's!
So, lets start.
PLEASE, read all the steps before start to understand the whole thing. The main idea is to find some bytes that precedes the value we want to change, then find these bytes on the original resources file and change the value we want.
1. Make sure you have adb, apktool, and everything needed on your path. I will give you the commands assuming all of them are in your path.
2. Get the necessary apk's from your phone:
Code:
[email protected]:~/Android/LT26i$ adb pull /system/framework/framework-res.apk
3972 KB/s (22227101 bytes in 5.463s)
[email protected]:~/Android/LT26i$ adb pull /system/framework/SemcGenericUxpRes.apk
4970 KB/s (2095961 bytes in 0.411s)
3. Install the apk's on apktool
Code:
[email protected]:~/Android/LT26i$ apktool if framework-res.apk nozomi
I: Framework installed to: /home/brunojcm/apktool/framework/1-nozomi.apk
[email protected]:~/Android/LT26i$ apktool if SemcGenericUxpRes.apk nozomi
I: Framework installed to: /home/brunojcm/apktool/framework/2-nozomi.apk
4. decode and build the framework-res.apk WITHOUT changing anything:
Code:
[email protected]:~/Android/LT26i$ apktool d -f -t nozomi framework-res.apk framework-res
(some lines, with warnings)
I: Done.
I: Copying assets and libs...
Code:
[email protected]:~/Android/LT26i$ apktool b framework-res unchanged/framework-res.apk
(few lines)
I: Building apk file...
5. Do the same of the step above, but CHANGING what you want before build. Pay attention to the output folder of the build, it's different from the previous step.
Code:
[email protected]:~/Android/LT26i$ apktool d -f -t nozomi framework-res.apk framework-res
(some lines, with warnings)
I: Done.
I: Copying assets and libs...
(CHANGE WHAT YOU WANT)
Code:
[email protected]:~/Android/LT26i$ apktool b framework-res changed/framework-res.apk
(few lines)
I: Building apk file...
I changed the config_showNavigationBar, inside framework-res/res/values/bools.xml, but you can try changing what you want. I recommend you to start changing one single boolean value, then you can try to do more advanced things.
6. Here starts the fun! Since we have almost the same apk file, because we built both using the same apktool version, the only different bytes must be the boolean we changed. So we can unpack both apk's and run a binary diff of the resources.arsc. I'm using the vbindiff (apt-get install vbindiff) on ubuntu, but there should be other binary diffs or hexadecimal editors. So unpack and run the following:
Code:
vbindiff unchanged/framework-res.apk_FILES/resources.arsc changed/framework-res.apk_FILES/resources.arsc
It will show you the binary representation of the two files, the changed and the unchanged. Press enter once and you will see some chars in red (if you don't see, you did something worng). These represent the changed value. It was 00 00 00 00 (false) and is FF FF FF FF (true) on the modified file. Now we can observe what we have around the value we want to changed. We need to observe because we're going to edit the original file. Note that there is a column containing a hexa sequence (27, 28, 29, 2A, 2B). Our changed value is in the same line of the 29. This is the line that starts with '0077 F500'.
Copy the text of the vbindiff, containing the changed value and everything around it, to a draft file for further reference. I've attached a print of this screen, se below.
7. Now we need to do the final ninja hit: Change the original apk. Actually, the original resources.arsc. But things are no so easy, because the value we need to change is not on the same position it was is the file we changed. If we go to the position 0077 F500, something completely diferent will be there. So we need to search for something near the value we want to change. I will search for the sequence '29 1D', which is 8 bytes before the value we want to change. Yes, it's a short sequence and will occours a lot of times, but it is the best we can use. Maybe '00 29 1D', but no more than that. Let's go, unpack the original framework-res.apk and run:
Code:
vbindiff framework-res.apk_FILES/resources.arsc
Now hit F to find the sequence, and H to Hexa sequence, and type the sequence you choose (here, '00 29 1D'). To find the next occourrence, press F, then N. Do it until you find this sequence in a similiar way of the original file, having one line below with 2A, and below 2B etc. It should be near '007D C5CF'. Now you need to press E, go to the column where you have '00 00 00 00' and change to 'FF FF FF FF'. Pay attention to the other lines to change the right columns. The edited values will be in yellow. You can see the second attached print screen.
8. This is the easiest step, just copy the modified resources.arsc to the original apk. It should not be the apktool-built one, it should be the file you modified on the vbindiff editor.
I did it using the Gnome archive manager, just drag and drop the resources.arsc inside the archiver window after open the framework-res.apk.
And voilà! Your modded apk is ready!
------
Hope someone can understand this and make some mods. I did my best to explain what I did, but it's a really hard procedure thus not easy to explain.
If you have any doubts, just post and I will try to answer!
And if you like, click thanks to me!
as far as i know SemcGenericUxpRes.apk is odexed, this doesn't affect the process?
iBotPeaches has taken over development of apktool. The development thread is here:
http://forum.xda-developers.com/showthread.php?t=1755243
The latest version seems a lot better than 1.4.3
---------- Post added at 10:36 AM ---------- Previous post was at 10:35 AM ----------
Yakandu said:
as far as i know SemcGenericUxpRes.apk is odexed, this doesn't affect the process?
Click to expand...
Click to collapse
i believe only the code is odexed so you can make changes to the resources without breaking the odex file.
Frist thanks to brunojcm for share this tutorial
finally with this tutorial i could make smaller on screen buttons .
Install via CWM : Smaller On Screen Buttons.zip
Tested on .58 stock rom
Some mods by me SHOULD come tomorrow after school. Nothing big, just a few things.
Sent from my LT26i with Tapatalk 2
Soheil_rf said:
Frist thanks to brunojcm for share this tutorial
finally with this tutorial i could make smaller on screen buttons.
Install via CWM : Smaller On Screen Buttons.zip
Tested on .58 stock rom
Click to expand...
Click to collapse
Cool you understood it!
What did you change to accomplish that? just booleans or integers too? were they easy to find?
brunojcm said:
Cool you understood it!
What did you change to accomplish that? just booleans or integers too? were they easy to find?
Click to expand...
Click to collapse
after enable navigation bar in bools.xml you can change size of bar in dimens.xml ( navigation_bar_height and navigation_bar_width )
Soheil_rf said:
Frist thanks to brunojcm for share this tutorial
finally with this tutorial i could make smaller on screen buttons .
http://img818.imageshack.us/img818/1254/screenshot2012080916234.png
http://img195.imageshack.us/img195/8084/screenshot2012080916240.png
http://img402.imageshack.us/img402/2717/screenshot2012080916242.png
Install via CWM : Smaller On Screen Buttons.zip
Tested on .58 stock rom
Click to expand...
Click to collapse
How you made that? I get confused on the file comparing thing... Or you just have to decompile, change the DPI and compile back?
Your file works fine on .452 firmware. However, it has some icon bugs on status bar (the USB connnection and debugging ones) and the carrier name stays a little over where it should be.
Felimenta97 said:
How you made that? I get confused on the file comparing thing... Or you just have to decompile, change the DPI and compile back?
Your file works fine on .452 firmware. However, it has some icon bugs on status bar (the USB connnection and debugging ones) and the carrier name stays a little over where it should be.
Click to expand...
Click to collapse
Try to reading Tutorial again , its simple but gets some time
maybe you are using moded SystemUI.apk or .58 FW had some difference
here its normal
Soheil_rf said:
Try to reading Tutorial again , its simple but gets some time
...
Click to expand...
Click to collapse
Could make your mod, Felimenta97?
brunojcm said:
Could make your mod, Felimenta97?
Click to expand...
Click to collapse
Nope. Always something Ib my way. Was replacing the resources.arsc after I rebuild the app. But I read I have to replace the Meta-Inf and Manifest.xml. But now no time.
Sent from my LT26i with Tapatalk 2
You wont be able to recompile and use the same apk that's the entire point to this article and getting around this limitaion.
Simply put hex edit the resources.arsc after binary dif finds the changes integers and replace with the original in the framework-res.apk.
-smc
somemadcaaant said:
You wont be able to recompile and use the same apk that's the entire point to this article and getting around this limitaion.
Simply put hex edit the resources.arsc after binary dif finds the changes integers and replace with the original in the framework-res.apk.
-smc
Click to expand...
Click to collapse
Well, I see. I'm just trying to see what would be the effect of setting True to the Animate Screen Lights line on bools.xml I'm no developer, just a simple user trying to do some mods by myself
Sent from my LT26i with Tapatalk 2
Felimenta97 said:
Well, I see. I'm just trying to see what would be the effect of setting True to the Animate Screen Lights line on bools.xml I'm no developer, just a simple user trying to do some mods by myself
Sent from my LT26i with Tapatalk 2
Click to expand...
Click to collapse
What was it supposed to do?
brunojcm said:
What was it supposed to do?
Click to expand...
Click to collapse
As far as I know, it's the responsible for the screen off animation, at least on GB.
Sent from my LT26i with Tapatalk 2
Don't get discouraged, i've never tried to play with the screen animations but maybe there's something else you need to find/edit? Seems like a fairly small change you tried to make.
If it's not a small change not being able to recompile the framework-res file makes doing more advanced mods frustratingly impossible, i've got several mods waiting to go for our phone when we're able to.
-smc
I want to try myself some mods too. 30 volume step, Sense multitasking, etc. And it compiles perfectly (except when it says that there it's something that it's missing a translation, a file I didn't even touched). One day, when I have more time, I will try to do such things, slowly.
Sent from my LT26i with Tapatalk 2
Why to use apktool instead of 7zip?
I tried replacing a .png in framework.res and get errors.
Erachter said:
Why to use apktool instead of 7zip?
I tried replacing a .png in framework.res and get errors.
Click to expand...
Click to collapse
Because it involves a lot more than just removing files
Sent from my LT26i with Tapatalk 2
Thanks to iBotPeaches the latest custom build of apktool is now out:
[UTIL][Sept 2 2012] Apktool v1.5.0 - a tool for reverse engineering apk files
A new version has been released!
v1.5.0 (Released September 2 - 2012 ) Codename : Pikmin
Fix for colours being decompiled with improper hex colours
Fix for <string-array> being treated as array on occasion
Support for Mac OS X user:home, instead of dumping frames into /home
Updated internal framework.jar to API16
Added <user-sdk> reading to insert into apktool.yml to help with aapt building
Supported -d mode
Added --verbose mode to output contents of AAPT (note this is a HUGE output). Only used for debugging.
Ignore bootclasspath on debug mode. (Causes some classes in smali to be fail decompile)
New AAPT (Linux only) - http://miui.connortumbleson.com/othe...apt/linux/aapt
Get the patched aapt.
@Felimenta97 if your getting the language error it should be normal depending on what framework you are using, single language is never set for a multilanguage firmware.
-smc

[MOD] Lower auto brightness to save battery

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
Click to expand...
Click to collapse
here are the stock values
14
28
37
51
71
80
96
108
144
181
254
255
Click to expand...
Click to collapse
to install copy the file to your system/framework folder and overwrite the old one
DOWNLOAD
http://www65.zippyshare.com/v/73724600/file.html
Will this work on something like Xylon?
Sent from my Nexus 4 using Tapatalk 2
joshnichols189 said:
Will this work on something like Xylon?
Click to expand...
Click to collapse
No, Xylon uses a modded framework. You flash this and you'll get system UI force close.
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.
Will this work even on odexed ?
Sent from my Nexus 4 using xda app-developers app
evostevo1 said:
Will this work even on odexed ?
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
Yep I'm using it on stock odexed
Sent from my Nexus 4 using Tapatalk 2
neotekz said:
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.
Click to expand...
Click to collapse
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
Will this work with this ROM?
http://forum.xda-developers.com/showthread.php?t=2009561
I am assuming yes, but I just want to make sure.
SIGUEL said:
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
Click to expand...
Click to collapse
I posted a apk manager that works with android 4.2.1
http://forum.xda-developers.com/showthread.php?t=2063477
Sent from my Nexus 4 using Tapatalk 2
TheLawIX said:
Will this work with this ROM?
http://forum.xda-developers.com/showthread.php?t=2009561
I am assuming yes, but I just want to make sure.
Click to expand...
Click to collapse
I'm not sure I think that ROM has a custom framework
Sent from my Nexus 4 using Tapatalk 2
newcastle9 said:
I posted a apk manager that works with android 4.2.1
http://forum.xda-developers.com/showthread.php?t=2063477
Sent from my Nexus 4 using Tapatalk 2
Click to expand...
Click to collapse
Thanks a lot, this one worked.
Sent from my Nexus 4
I tried it here, but looks like it didn't work, no change at all for the lowest level.
neotekz said:
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.
Click to expand...
Click to collapse
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..
thesebastian said:
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..
Click to expand...
Click to collapse
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.
neotekz said:
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.
Click to expand...
Click to collapse
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
I tried to use apktool 1st...
but i don't know how to sign the file..zip align...etc if i use that tool...
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.

[How To][GUIDE] enable CRT Animation

CRT Animation On/Off running any GB rom (2.3.x)
Here is the screen Off/On animations mod. An awesome tweak which makes your phone's sleeping animations like old tv's shutting down.
Lets Begin.
[NOTE: Im not responsible for any bricked devices.]
Things needed
1. JAVA - Click Here
2. APK MANAGER - Click Here
3. Notepad++ - Click Here
Procedure
1. Download all the above applications.
2. Open APKMANAGER folder and place your roms "framework-res.apk" in "place-apk-here-for-modding" folder.
(framework-res.apk is placed in "/system/framework/here")
3. Open APKMANAGER folder and open "Script.bat".
4. Open "script.bat" and press "9" and hit enter. (this decompiles your framework-res.apk)
5. If sucessful, close this script and go to "APKMANAGER"/"projects"/"framework-res.apk"/"res"/"values" folder. Open "bools.xml"
6. Change
"<bool name="config_animateScreenLights">true</bool>"
to
"<bool name="config_animateScreenLights">false</bool>"
7. Again open script.bat and click on "11". (It will compile the application)
8. It will ask whether it is a system application or not, type "y" and hit enter.
9. It will show
"Aside from the signatures, would you like to copy over any additional files that you didn't modify
from the original apk in order to ensure least # of errors (y/n)
Press "y" and hit enter!
10. It will do the extracting. DO NOT PRESS ANY KEY NOW.
11. Open "APKMANAGER" folder, there will be a new folder "keep". Delete "resources.arsc" file from there.
12. Now open script and hit enter.
Click to expand...
Click to collapse
And the most IMPORTANT part.
After flashing framework go to settings>Display>Animations, select "All Animations".
AND if you dont want the animation simply change
"<bool name="config_animateScreenLights">false</bool>"
to
"<bool name="config_animateScreenLights">true</bool>"
CREDITS
Daneshm90 for the APKMANAGER
me for the guide
Reserved
dude!! 4 your kind information sadly there is no any value folder in frameworks - res !!
& also bool.img in frameworks whole app.!! in our galaxy y!!
thewarlord said:
dude!! 4 your kind information sadly there is no any value folder in frameworks - res !!
& also bool.img in frameworks whole app.!! in our galaxy y!!
Click to expand...
Click to collapse
i have checked in the stock rom of y.
it is there
If you decompile framework-res.apk you will get it.
I will attach images for easier use.
Have you actually tried this because this has been around for ages
I'm sure
Stock framework in our phone does not support this
cm7 percy does not support this
Both due to hardware libs
deleted
DarkEyed said:
i will edit the thread with images tomorow
Click to expand...
Click to collapse
I don't think you understand
I'm not saying that the files mentioned don't exist because they do
I'm saying you can edit them as mentioned but due to our hardware libs the changes will have absolutely no effect

[HOW TO] Add Ambient Display on Settings [Lollipop]

Thank for raffaele88 for this tutorial
Code:
You will need
framework-res.apk from the rom you are modding
SystemUI.apk from your Rom
Notepad++ or another text editor of your choice
apktool
First decompile Systemui.apk with this comand​
Code:
apktool d systemui.apk
Navigate to systemui/res/values/bools and open it with Notepad++ and change this line:
from
PHP:
<bool name="doze_display_state_supported">false</bool>
<bool name="doze_pulse_on_pick_up">false</bool>
to
Code:
<bool name="doze_display_state_supported">true</bool>
<bool name="doze_pulse_on_pick_up">true</bool>
Save and ricompile systemui with this comand:
PHP:
apktool b systemui
Now start to mod framework-res.apk
Decompile framework-res.apk with apktool with this comand:
Code:
apktool d framework-res.apk
Navigate to framework-res/res/values/string and open it with notepad++ and change this line:
from
PHP:
<string name="config_dozeComponent"></string>
to
PHP:
<string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
Save and close.....
Now in the same folder open bool.xml and with notepad++ and mod this line:
from
PHP:
<bool name="config_dozeAfterScreenOff">false</bool>
<bool name="config_powerDecoupleInteractiveModeFromDisplay">false</bool>
to
PHP:
<bool name="config_dozeAfterScreenOff">true</bool>
<bool name="config_powerDecoupleInteractiveModeFromDisplay">true</bool>
Save it and close....
Now in the same folder open Interger.xml with notepad++ andmod this line:
from
PHP:
<integer name="config_screenBrightnessDoze">1</integer>
to
PHP:
<integer name="config_screenBrightnessDoze">17</integer>
Now recompile with this comand:
PHP:
apktool b framework-res.apk
Enjoy Ambient Display​
Not trying to be a jerk, but I noticed a typo in your commands:
apktool b systemui
should be $ apktool b systemui.apk
There are some people who would copy and paste and not realize why their apk wasn't compiling properly
Does it work well? However I cant decompile correctly apks because of this error: ".....could not decide arsc file." it will be great if we could have a flashable zip ?
Please post a flashable zip for stock 5.0 =)
Today i will make flash zip
Don't know why but caused bootloop. Maybe I made a mistake. Why I'm saying this is to remind that you should backup system first just in any case especially if you are going to flash new apk's on your existing rom.
hell !!! i need flashable zip for stock. i was editing systemui apk on kitkat but a few times i f.cked up
Can you upload the edited file? There's no need to do this procedure every time.
Sorry for noob questions, but what am I supposed to do after compiled framework-res.apk and systemUI.apk? And where can I find these file? (I have a flashable ROM zip)
IMO that "feature" would bring more issues than benefits... For example, huge battery drain.
I downloaded a zip from forum.frandroid and display settings shows ambient display. But I think there are some issue with the sensors. Sometimes my phone light up even if it is in my pocket, and pick up the phone from a table do not wake up the screen when a notification come
rskyline said:
IMO that "feature" would bring more issues than benefits... For example, huge battery drain.
Click to expand...
Click to collapse
i used it with lollipop port and now using app called "screen notifications" i think both battery drain not noticable
brsclkr said:
i used it with lollipop port and now using app called "screen notifications" i think both battery drain not noticable
Click to expand...
Click to collapse
Strangely even on the nexus 6 it says that battery won't last as much as with that feature off, even its screen is optimized for that feature (AMOLED)
rskyline said:
Strangely even on the nexus 6 it says that battery won't last as much as with that feature off, even its screen is optimized for that feature (AMOLED)
Click to expand...
Click to collapse
Definetely. In AMOLED screens, each pixel has its own backlight, black pixels don't produce light and don't require energy, so Ambient Display is suitable for AMOLED screens, but IPS LCD (Nexus 4's screen) costs more energy when backlight is on even if all pixels are black. Because of that, Ambient Display on Nexus 4 will drain much more battery.
I applied the changes but it ended up in a bootloop even though compiling and everything went fine. Luckily I've done a backup.
I used these instructions from Android Origins website and ambient display feature becomes available under display settings however as others have reported it really does not work correctly. When I pick up the phone nothing happens, notifications do turn on the display but at the cost of battery life. I would not suggest bothering with this as it is essentially useless on our devices. If you do want to try definitely backup in case you run into issues.
question
Is there a way that i can call this feature from an app? like an intent? i would like to setup a service to call this funtionality under other circustances also what is actually done at this point? are we just showing the same thing but in blank and white? how can i archive the same in other screens.
Thank you
Does it work well? However I cant decompile correctly apks because of this error: ".....could not decide arsc file." it will be great if we could have a flashable zip
[GS] said:
Thank for raffaele88 for this tutorial
Code:
You will need
framework-res.apk from the rom you are modding
SystemUI.apk from your Rom
Notepad++ or another text editor of your choice
.....
Enjoy Ambient Display[/CENTER][/QUOTE]
I want to translate into my language (now, it is only displayed in English). I have found in systemui and framework(values, values-vi....) but did not find the line that contains the word Ambient. Can you guide me? My Rom support multi language. thank you.
Click to expand...
Click to collapse
thank you for tutorial, worked well on my device

Categories

Resources