[Tweak][V2.4] Extend your Battery Life - init.d, build.prop and everything

Search This thread

kobridge

Senior Member
Jan 10, 2012
1,710
3,460
Jacksonville, FL
Samsung Galaxy S22 Ultra
Yeah thats right :) But only when yiur not connected to a wifi hotspot already, but you have wifi turned on.

Sent from my SPH-D710 using xda premium

This is what I'm saying. Once we connected to one network, wifi will not try to search the new network until it lose the current connection. So, do we need to set up 5 minutes for this? My point was, how long we have to wait until wifi automatically find the new network and some people could complain why it's not immediately detect the new network. If wifi is turned on but no wifi network connected, then phone will search the network based on this time. That's why I said, it's based on user's preference.
 
  • Like
Reactions: countryteazer

TeamERA

Senior Member
Nov 2, 2011
586
306
Everywhere
Could you please be more specific? I'm not trying to down play it. I just want to find what was wrong and how you fixed it.
What I'm seeing is, adding some missing items based on stock build.prop sequence. For me, I rearranged the sequence based on the item name to make it easy to find and modify. That's why I said, almost same. I do not see any missing items or added items yet.

Oh I wasnt trying to sound that way, sorry. But there were about 10 duplicate lines, some 3 times, others 2 times. You had conflicting values also, so Im just trying to help not take credit. I did want to thank you for thanking me in the OP, but I see you removed that ;). Anyways Ill keep trying to help if and when you call upon it, as I will for any member of xda.

And these build.props wont cause any boot loops :)

Sent from my SPH-D710 using xda premium
 

TeamERA

Senior Member
Nov 2, 2011
586
306
Everywhere
This is what I'm saying. Once we connected to one network, wifi will not try to search the new network until it lose the current connection. So, do we need to set up 5 minutes for this? My point was, how long we have to wait until wifi automatically find the new network and some people could complain why it's not immediately detect the new network. If wifi is turned on but no wifi network connected, then phone will search the network based on this time. That's why I said, it's based on user's preference.

What your saying is right, but 5 min is clearly a small number compared to 3 min , as 15sec is compared to 3 minutes. So if they complain about 5 min, dont you think they may complain about 3 minutes, remember stock is 15 seconds.

Sent from my SPH-D710 using xda premium
 
  • Like
Reactions: countryteazer

kobridge

Senior Member
Jan 10, 2012
1,710
3,460
Jacksonville, FL
Samsung Galaxy S22 Ultra
Oh I wasnt trying to sound that way, sorry. But there were about 10 duplicate lines, some 3 times, others 2 times. You had conflicting values also, so Im just trying to help not take credit. I did want to thank you for thanking me in the OP, but I see you removed that ;). Anyways Ill keep trying to help if and when you call upon it, as I will for any member of xda.

And these build.props wont cause any boot loops :)

Sent from my SPH-D710 using xda premium

This is why I published the second version and now planning to publish another version soon. I'm still keeping my big thanks to you in my second post. :D
Thanks for your explanation!
 

countryteazer

Senior Member
Jul 5, 2008
406
128
Alls I know is I'm using the build.prop from the link TeamERA provided along with the init.d scripts that kobridge posted with the Blu Kuban ROM and I'm seeing the best battery life I've ever seen on any ICS related ROM. A very big thanks to both of you!
 

kobridge

Senior Member
Jan 10, 2012
1,710
3,460
Jacksonville, FL
Samsung Galaxy S22 Ultra
GB Blazer ROM 4.1 EL29 test

GB Kernel Test - Blazer 4.1 EL29 - Not able to change the CPU frequencies and frequency change causes phone freezing during the sleep & wakeup. No way to change this by init.d script so far. Only the way would be using Tegrak or System Tuner Pro tools. I tried System Tuner Pro and set the conservative governor as on boot instead of init.d option. Working like a charm and no freezing yet. Will report back the battery life. I turned on the default tweaks included in Blazer rom (init.d scripts) except the S70darky_zipalign script because it seems like this script is causing some widget not displayed - most of widgets not displayed but app shortcuts.

By default, all init.d scripts on blazer rom 4.1 are disabled. To run those scripts, you need to change the permission to 755 from 644. The tweaks look great!

Update: Blazer CPU governor changed to conservative from default ondemand and CPU underclocked to 1GHz. Besides of that, everything runs with Blazer defaults. Battery status : running 8 hours and 89% battery left. Getting almost same battery performance like running CPU tweaks on ICS.
 
Last edited:
  • Like
Reactions: TeamERA

daniel4653

Senior Member
Jul 10, 2010
9,404
2,969
Southern California
I'm confused on how to possibly get this working on code name. All I have done so far is push the build.prop file for aokp that was posted yesterday.

Sent from my SPH-D710 using xda premium
 

RustedRoot

Senior Member
Dec 7, 2010
332
158
Tucson AZ
Amazfit
All's well save for the 70wifi script. Keep getting 127 Exit Code in Script Manager when booting. 3 other scripts returning 0 Codes. Running Team ERA's FD26 build.prop and Agat's FD26 with Sfhubs FD26 modded kernel plus. Removed Agat's 7Tweaks from init.d (I assume that was necessary?). Pray tell, what am I missing?

SOLVED: Copied sqlite3 to System/bin and System/xbin folders. (How do I give thanks to myself? Lol. Gave thanks to Kobridge however.)
 

Attachments

  • Screenshot_2012-05-06-17-44-02.jpg
    Screenshot_2012-05-06-17-44-02.jpg
    38 KB · Views: 163
Last edited:

JohnCorleone

Senior Member
Dec 19, 2010
16,188
5,864
Whittier,CA
Kobridge, here's a idle battery drain shot with wifi set to never sleep on Venum Ice. I do have a few init.d scripts running. I am going to try yours on next battery cycle...

Sent from my SPH-D710 using Xparent Blue Tapatalk 2
 

Attachments

  • uploadfromtaptalk1336341756768.jpg
    uploadfromtaptalk1336341756768.jpg
    47 KB · Views: 167
  • Like
Reactions: im0rtalz

kobridge

Senior Member
Jan 10, 2012
1,710
3,460
Jacksonville, FL
Samsung Galaxy S22 Ultra
I'm confused on how to possibly get this working on code name. All I have done so far is push the build.prop file for aokp that was posted yesterday.

Sent from my SPH-D710 using xda premium

init.d script should run fine on AOKP if you have the proper build.prop. Try it and let me know.

All's well save for the 70wifi script. Keep getting 127 Exit Code in Script Manager when booting. 3 other scripts returning 0 Codes. Running Team ERA's FD26 build.prop and Agat's FD26 with Sfhubs FD26 modded kernel plus. Removed Agat's 7Tweaks from init.d (I assume that was necessary?). Pray tell, what am I missing?

SOLVED: Copied sqlite3 to System/bin and System/xbin folders. (How do I give thanks to myself? Lol. Gave thanks to Kobridge however.)

Check out this thread http://xdaforums.com/showthread.php?t=1630792. WiFi sleeps well now and there's some tweak also.
The above portion is from my op. Check out the link to properly use the 7Tweaks.

Update: wrong URL. corrected URL now.

Kobridge, here's a idle battery drain shot with wifi set to never sleep on Venum Ice. I do have a few init.d scripts running. I am going to try yours on next battery cycle...

Sent from my SPH-D710 using Xparent Blue Tapatalk 2

ya, comparing both would be great.
 
Last edited:

daniel4653

Senior Member
Jul 10, 2010
9,404
2,969
Southern California
Well i pushed the files into the folder and fixed permissions and rebooted so far so good ? Lol no immediate difference in battery

Sent from my SPH-D710 using xda premium
 

kobridge

Senior Member
Jan 10, 2012
1,710
3,460
Jacksonville, FL
Samsung Galaxy S22 Ultra
Well i pushed the files into the folder and fixed permissions and rebooted so far so good ? Lol no immediate difference in battery

Sent from my SPH-D710 using xda premium

CPU related scripts tries to under clock the CPU to max 1GHz and mostly works during the sleep & standby. During the on-screen mode, the battery savings would be minimal. If you have any tools like System Tuner (Pro), Better Battery Stat, or Battery monitor widger (Pro), check the CPU utilization after the some sleep. If you still see lots of 1.2GHz CPU utilization, then it means that scripts are not working.
If the scripts works then you will see lots of CPU offline and low MHz times.
 

RustedRoot

Senior Member
Dec 7, 2010
332
158
Tucson AZ
Amazfit
kobridge;25769045 Check out this thread [url said:
http://xdaforums.com/showthread.php?t=1630792[/url]. WiFi sleeps well now and there's some tweak also.
The above portion is from my op. Check out the link to properly use the 7Tweaks.

Update: wrong URL. corrected URL now.

I had seen your thread on wifi never sleeping when you first posted it and thought, hmmm, I'm fairly certain mine does. I've mentioned 3g Battery Saver Pro in other threads and have had good success with it, but I wonder if it's redundant with your scripts installed (?) Seems to be working fine in tandem.

I used the sqlite3 file from a Titantium backup folder in data/data (I have no idea how it got there but a BusyBox file is in same folder) and it works, but let me ask you should I install a clean copy of it from the SuperOneClick app?

No biggie, but I couldn't find the link re: 7Tweaks script from the referenced thread. Interested to see (i.e. learn) what it says.
 
  • Like
Reactions: kobridge

kobridge

Senior Member
Jan 10, 2012
1,710
3,460
Jacksonville, FL
Samsung Galaxy S22 Ultra
I had seen your thread on wifi never sleeping when you first posted it and thought, hmmm, I'm fairly certain mine does. I've mentioned 3g Battery Saver Pro in other threads and have had good success with it, but I wonder if it's redundant with your scripts installed (?) Seems to be working fine in tandem.

I used the sqlite3 file from a Titantium backup folder in data/data (I have no idea how it got there but a BusyBox file is in same folder) and it works, but let me ask you should I install a clean copy of it from the SuperOneClick app?

No biggie, but I couldn't find the link re: 7Tweaks script from the referenced thread. Interested to see (i.e. learn) what it says.

I don't think you don't need a clean copy. The linked url explains how to add wifi delay option in the database. Once it's created based the linked url, you can use the 7tweaks file in this thread from op section.

Edit: what I mean is 70wifiSleepWait_kobridge.zip file at OP. unzip it and put into init.d directory. You will need this script only when you want to change the wifi delay time (need to change the value inside of the script). To check whether wifi sleeps after the screen off, you can jsut use the small values as less as.
 
Last edited:
  • Like
Reactions: RustedRoot

Top Liked Posts

  • There are no posts matching your filters.
  • 33
    (To any visitors to this thread,
    Please Rate this thread based on your reading and tweaks that I provided. If the rate is too low, that means I'm doing a bad job in here! If the rate goes down below 4 stars, I'll stop providing these tweaks! So, please excuse me. Please don't rate this thread with the only reason that I do not provide the tweaks for your rom, which you are using! I'm using my own time for this just like lots of other users. Only the thing that makes me more happy and get focused on this would be your rates and 'thanks' on this thread)


    ** All the information in here is for informational purpose only. I'm getting lots of new requests and great feedbacks but I can't handle everything. Please don't ask me to do anything. If anything is causing a boot loop or force closing in here, I'll drop those contents. But be sure that any other rom users beside of rooted Stock ICS, don't try this and don't ask me to do anything.

    Please don't post your battery life in here if it's not from the Stock ICS. This is not a place to show-up or for any competition. This is a place to show-up the battery life before and after the tweaks.

    Currently supporting ROMS - Any sfhub's rom, any Calk's Rom, any Agat's rom, VeNuM_ICE_Rom_RL5.0, MIJJz BLEND ICS, AnaKonda Rom ICS, etc....

    Now flashable zip files are available at http://xdaforums.com/showthread.php?p=26201865#post26201865


    *Note* Please read the second post also for quick install guide, Q/A, progress report, issues and change logs.


    Maybe some of you already know that I was working on the tweaks to extend the battery life. In here, all the information is based on my experimental test and its result. Personally I spent lots of time for this stuff and to get the longest battery life. So, if you believe this information is not helpful, please don't blame me and don't even think about trying these tweaks.

    But if you want to give it a shot, I would be more than happy to help you to get the better result.

    Rule of thumb: Do it with your own risk and don't ask me to buy you a beer because you're doing it. But, if you like this info and/or you see any longer battery life of your phone, please don't hesitate saying 'thank you' and/or consider to buy me a beer.
    I'm ok with not leaving any comments and just taking this tweak and recommendation but don't use this info in any other places with 'copy and paste' style.


    OK. Now let's get started.
    1. Who needs this tweak?
    2. What do you need?
    3. How to run init.d scripts?
    4. what's in init.d scripts?
    5. build.prop tweaks
    6. Additional tweaks on your phone
    7. Startups
    8. Closing comments

    1. Who needs this tweak?
    If you are a heavy user or gamer, this place wouldn't be a right place for you. In here, I'm only focusing on extending battery life and keep it longer without recharging it under our daily usage.

    Because it's really hard to save the battery during the screen on (awake status), I'm only focused on the battery savings during the screen is off or sleep (lazy) status. I've seen lots of battery drains during the stand-by mode and I tested lots of things to save the battery during this time frame.

    Actually this was my first project working on this phone because I was never able to use my phone more than one day without recharging it before I started this project. In my location, almost everything is not good - so weak radio signal, 3G/4G is not enough to get the fast data speed.

    Somehow, wifi is the biggest consumer of battery drain.

    Guess what? I had to find out some way to extend my battery life.

    I believe the information in here would be very helpful for the person who
    • keeps phone offline most of time
    • lives in bad signal area
    • reasonably think battery life is more important than performance (the performance with this tweak is still good but not best)
    • do not believe in battery saver apps
    • wants to experience the best battery life!

    2. What do you need?
    • Most importantly your phone
    • init.d support (startup scripts during the boot)
    • Smanager if your kernel does not support init.d or install-recovery.sh
    • file editor like root explorer
    • root access, busybox (rooted phone)
    • init.d scripts and build.prop files (download)

    3. How to run init.d script?
    I've already posted one thread in here - http://xdaforums.com/showthread.php?t=1610741 (thanks for the people who already left great feedbacks)
    From there, you will find out how you can get the init.d script support during the boot and how to test whether it's working or not. If you don't have the Kernel that is not supporting init.d script or install-recovery.sh during the boot, you can also use the SManager tool to run the scripts in here during the boot.

    4. what's in init.d scripts?

    4.1 cpufreq_governor
    21cpufreq_governor script sets the governor that contorls the CPU's thresholds and sampling_rates. I choosed ondemand governor and some values are changed from Calk's original script (big thanks to Calkulin and he provided some init.d scripts on his FD02 tweaked rom).
    4.2 cpufreq_screenstate_scaling
    31cpufreq_screenstate_scaling script defines the governor values and decides the actions based on the phone's state - conservative, ondeman, lazy, awake, sleep modes. I've changed lots of values from Calk's original script to save more battery power thru this script. As indicated in Calk's original thread for FD02, this script would not run if you have already installed some CPU control apps something like OC Widget, Quick Clock, SETCPU, and Android OC.

    For both cpufreq_governor and cpufreq_screenstate_scaling scripts, I had to stay with maximum 1GHz CPU speed and it couldn't go down below 1GHZ because if it goes not below 1GHz, some of the apps could be force closed, frozen, or even you can see the random reboot. Especially, stock camera app and some other camera apps had issues running under 1GHz CPU speed (facebook camera, FX Camera Zoom). If you don't care about the camera apps and want to save more battery, then we can set up maximum CPU speed to 800 MHz and I had no issues with that except the camera apps. With 800 MHz setting, I saw more battery saving and battery life, but I'm not posting that script in here.

    4.3 tweaks_kobridge
    41tweaks_kobridge script has almost everything in it to improve the network speed, sdcard tweaks, other battery saving tweaks, VM management, Kernel, wifi tweaks, etc. For some of the values in here, there are some overlaps with build.prop tweaks. So, if you do not apply the tweaks to the build.prop file, many tweaks would still work.

    4.4 zipalign
    zipalign is an archive alignment tool introduced first time with 1.6 Android SDK (software development kit). It optimizes the way an Android application package (APK) is packaged. Doing so enables the Android operating system to interact with the application more efficiently, and hence has the potential to make the application and overall the whole system much faster. Execution time is minimized for zipaligned applications, resulting is lesser amount of RAM consumption when running the APK.

    If less number of applications with an unaligned home application, you’d see slower application launch times. This is the best case scenario. For a worst case scenario, having a number of unaligned applications will result in the system repeatedly starting and killing processes, struggling with lags and huge battery drain.

    4.5 Wifi Sleep Wait timer
    In my original version of this tweak, it was required to manually insert the table row to use this tweak. But it's fixed and now you can use this tweak without manually handling the database.

    What this tweak does is, it controls the time until wifi sleeps after the screen turned off. By default, it's 15 minutes. So, even you turned off the screen, by default, phone will wait for 15 minutes and then turn off the wifi. By using this tweak, you will have the control over wifi idle time until wifi sleeps.

    5. build.prop tweaks
    build.prop file is created while you flash the rom and /system folder will be totally replaced by your new rom. So, don't expect your tweak would be there forever even after you flashed a new rom (Every Rom format the /system partition before it's installed). If you have your own customized tweaks, then make backup those tweaks before you apply the new rom. After flashing new rom, those tweaks won't be there.
    The file list needs to be backed up -
    /system/etc/init.d folder and it's contents
    /system/build.prop
    /system/etc/install-recovery.sh (if it's there)
    /system/etc/gps.conf (if you have GPS tweak)

    Basically build.prop file defines lots of system values related to phone settings and those values are loaded to phone during the boot.
    Because build.prop is created by rom, it holds some current rom's build related information. So, if you want to keep this file up to dated, whenever you flash the new rom, take the new build.prop file and compare it with this tweaked file.
    Update the current rom's build.prop file based on your comparison -
    1. don't update/replace any ro.build.xxxx and ro.product.xxx items
    2. for any all other items, replace the lines with the items in tweaked file.

    By doing above steps, I believe you've started already getting lots of battery savings. But there're some more critical things that could affect your phone's battery life. The below section is not directly related to init.d and build.prop tweaks but it's important as much as tweaks!

    6. Additional tweaks on your phone
    I've worked on this part so long time since I've started using ICS ROM. I also tried almost every battery saver apps but didn't get any better result using my own method because sometimes there are lots of overheads using it (I'm trying to avoid describing any individual app's pros and cons in here and just provide you the better way to configure your phone).

    Currently I'm on FD26 rooted stock rom/modem/kernel. So, all the information in here is based on this rom but it's not limited to any specific phone or build. You could probably use it in anywhere.

    1. Wifi
    Some of you understand that wifi is faster than 3G and use less battery than 3G. You also say that 4G is the biggest monster consuming lots of battery. But that would be true and false.
    Sometimes, wifi uses lots of battery to get the faster speed and keep the connection.
    My suggestion is turning off wifi connection when you are in the area where wifi is not available and keep the 3G turned on. But if you are in the area where the wifi is available and connected, then you don't need to turn off the wifi.

    Based on my and JC's test, turning on wifi (if you are connected to wifi), keeping wifi turned on during the standby or sleep mode does not affect the battery life a lot.

    2. 3G
    Keeping 3G turned on is a good habit. Because it covers wifi and 4G whenever those are not available. 3G uses battery a lot less than wifi and 4G.

    Howto keep it on: setting -> more -> mobile networks -> check 3G DATA

    3. 4G
    Just like wifi, minimize turning on 4G network. This use a lot of battery if you are in the bad reception area. If the signal strength is really good, then it would be probably ok keeping 4G turned on. In some cases, 4G would be the only solution to watch the movies, streaming videos when the wifi is not available.
    Based on my limited test, using 4G in good reception area is much better than using wifi with low/weak signal.

    4. Call option
    Mark checkbox for Turn on proximity sensor for your convenience even there would be a little battery drain. But if you are a heavy talker, then I recommend to uncheck this option.

    5. Sound
    Lower the sound/vibration level within the acceptable range for you. There would be some differences on battery behavior by turning off or on of sound/vibration. But I don't want to recommend anything in here because I don't want you to lose any incoming calls/messages/etc.

    6. Display
    Automatic brightness should be fine in most cases. It's really related to screen on time battery consumption. I don't want to deal with this option at this time.
    Pulse notification light, display battery percentage - turn it on or off based on your preference. Battery consumption by turning on these options would be minimal. I saw that some people said that they recommend to turning off the 'pulse notification light'. But I don't agree with that. One blinking LED light almost does not use any battery!
    display timeout - I set it with highest value provided. After using the phone, I manually press the power button to go to sleep mode. With short timeout value, I have to keep press the button or screen to keep the screen on. I don't like this method.

    Turn on 'Auto adjust screen power'.

    7. Power saving mode
    I always keep this option off because I do not want to lose anything because of low battery. I would rather change the numbers in my tweak (battery profile 2 in scaling tweak).

    8. Account and sync
    Most of time, I keep this option turned off. This would be one of the battery eating monster. I would rather individually sync the apps whenever I need it or from the actual apps.

    9. Battery
    when you charge the battery and phone shows that 100% charged, unplug the cable few seconds and plug-in again to charger. Repeat this couple of times and your battery would be really fully charged. Many times, even phone shows 100% charged, it could be the minimum 100% range. Actually, there's some voltage allowed and considered as 100% charge. But by maximizing the voltage during the charge, your battery life could be extended.

    10. Motion
    Turn off this option if you don't need this.

    11. email
    If possible, turn off the option that pushing email immediately. Instead, put the retrieval interval as long as you can. Based on my test, it could extend your battery life as maximum as couple of hours. In my case, I put the 2 hours interval. By doing this, your phone is much easier to enter the 'deep sleep' mode.

    7. Startups
    For me, I don't allow the apps automatically start during the boot as much as possible. If it's the system app and critical app for the phone's normal operation, then you have to allow those startups but otherwise, you can disable the startup apps based on your test.

    For this, I usually use Rom Toolbox and/or System Tuner Pro. These apps allow us to enable or disable the startup apps.

    For any apps like I don't use frequently or at all, I disable the apps from the 'event' (rom toolbox) or startups (system tuner pro). Once you disable the startups, you may need some test to see what happens when you manually launch the apps. If your app does not start normally, then go back and enable the event again.

    There's also one more battery eating moster - widgets (currently doing some experimental test on it)
    Regardless of widgets are in foreground screen or just stays in widgets folder, almost same amount of battery could be used by widgets to make it upto dated and refresh the connections, etc.

    So, if you don't need the widget or don't use, go to (from Rom Toolbox) Auto Start Manager -> Applications -> select app you want to check -> it will show that widget updating is enabled or not. If it's enabled and you don't want it, just disable it. Then the app is not going to use that specific widget and actually widget will disappear from widgets folder.

    8. Closing comments
    Thanks for reading my guide and tweaks. I hope everyone of you found some useful information in here.
    I'm not perfect just like you. So, there could be some wrong information. If you find anything like that, please let me know.

    Again,
    Do it with your own risk and don't ask me to buy you a beer because you're doing it. But, if you like this info and/or you see any longer battery life of your phone, please don't hesitate saying 'thank you' and/or consider to buy me a beer.
    I'm ok with not leaving any comments and just taking this tweak and recommendation but don't use this info in any other places with 'copy and paste' style.

    What's in attachment:
    all_in_here.zip First version of tweaks. build.prop is based on FD26.
    70wifiSleepWait_kobridge.zip Tweak to handle the wifi lag time before sleep. Wifi will be turned on 10 seconds after the screen turned off. To make this tweak work, you will need sqlite3 and some manual task. Check here http://xdaforums.com/showthread.php?t=1630792
    FE07stock_build.prop.zip This is a build.prop file tweaked based on stock kernel FE07. This file would not work on other Roms but stock. You can use this on other stock based kernel but some information about the phone would be incorrectly displayed at settings > About phone. So, use the right version of build.prop. For any other Roms/Kernels, you can just keep your build.prop if you do not find any tweaked build.prop based on your kernel/rom.
    init.d.v2b.zip Including CPU tweaks, additional tweaks, and wifi idle (lag) time tweak. Set to max cpu speed to 1Ghz on awake, max 500Mhz during the sleep. Fast and lots of power savings during the sleep mode.
    init.dv2b2.zip Same as init.d.v2b scripts except some more CPU tweak changes. Same Max awake and sleep speed. Targeting more power save but no result yet. Experimental tweaks (you may experience a little slowness of phone with these tweaks).
    Tweaked-FE10-build.prop.zip This is a tweaked Stock FE10 build.prop. This file would not work on other Roms but stock. Directly under /system folder and permission set to 644. Other init.d tweaks don't need to be changed.
    zipalign.zip Two files included. zipalign goes to /system/xbin, permission 755, move the file if it's not there. 11zipalign goes to /system/etc/init.d. permission 755. If there is any apk files those are not zip aligned, this tweak will automatically align the apk files for better performance and battery savings.
    zipalign.v3.1.zip 11zipalign modified a little to confirm the temporary APK file removal. If temporary APK is not deleted, it will be shown in log file and Temporary APK will be removed during the next boot.
    init.d.v2.4.zip Complete set of init.d scripts. 41tweaks_other tweak changed a lot based on sysctl and fixed one error. 21&31cpufreq tweaks were also changed more aggressively. 11 & 70 are same. In the zip file, included sqlite3, busybox, zipalign executables in case you don't have it.
    70wifiSleepWait_kobridge.v2.zip Check the section 4.5 from OP. Now this tweak works without any manual database handling.
    5
    Here are the finished build.prop files. You may need to set permissions once you paste it in /system/

    These are files from a team member working on this phone, he wanted to help.

    61517aeb-75ba-6c74.jpg


    AOKP
    http://d-h.st/g5S

    CM9a3 (tested)
    http://d-h.st/ZOk

    CNA
    http://d-h.st/JpD

    FD26
    http://d-h.st/jGo

    MIUI
    http://d-h.st/Ete


    Sent from my SPH-D710 using xda premium
    3
    Quick guide about how to install these tweaks :
    Because many people asked me how to run these tweaks, I spent sometime to give you the quick instruction. To follow this instruction, you will need the following files downloaded and available at your sdcard.

    Pre-requisite:
    1. init.d scripts (able to download from op section). Download the zip file and unzip it. Save the files into your sdcard.
    2. build.prop file (able to download from op section).
    3. sqlite3 executable (just in case you want to use the tweak that updating wifi idle time before sleep). where to download and how to use it is here - http://xdaforums.com/showthread.php?t=1630792
    4. Get the install-recovery.sh from here if you are on the stock kernel (not repacked) - http://xdaforums.com/showthread.php?t=1610741
    If you have sfhub's auto root tool, then run the option 'E' to install the init.d support installed on your phone. Actually his tool will install the install-recovery.sh. (I assume that you've already have busybox installed, otherwise, you can download it too from above link)

    Backup:
    Do the backup for the following files -
    1. /system/etc/init.d files - if there's any existing init.d scripts then back it up.
    2. /system/build.prop - backup this file also for just in case

    Now you are ready to start, follow these steps:
    1. copy downloaded init.d script into /system/etc/init.d folder. If the init.d folder is not there, create the folder 'init.d' under /system/etc. Be sure that init.d folder permission should be 'rwxr_xr_x' (755). For the copied init.d scripts, check the permissions and changed it to same 755 (if it's not like that). If there's any script that you don't want to run during the boot, then change the permission to 'rw_r__r__' (644).
    2. copy the install-recovery.sh file to /system/etc folder (only if you are on stock kernel or you've never installed sfhub's auto root tool (option 'E'). Change the permission to 'r_xr_x___' (550).
    3. copy build.prop file to /system folder. Change the permission to 'rw_r__r__' (644).
    4. Additional steps if you don't have sqlite3 or busybox.
    copy the files to /system/xbin folder. permission 755.
    5. You are done now. Reboot the phone.

    How to verify that the script is running - the easiest way would be checking the Maximum CPU speed and SD tweaks applied to your phone. If you have any tool like Rom Toolbox (Pro) or System Tuner (Pro), then goto the options that showing CPU or SDcard (SD Boost), it will show the different values if you did not applied the tweaks previously.

    Hope this help!

    [Q/A]
    On which Rom/Kernel this tweak is going to work?
    The tweaks in here is mainly for the stock based ICS roms/Kernels only.
    Any sfhub's rom, any Calk's Rom, any Agat's rom, VeNuM_ICE_Rom_RL5.0, MIJJz BLEND ICS, AnaKonda Rom ICS, etc....
    init.d tweak files can be used for some other roms but it's not tested from my side. build.prop tweak is also mainly for stock roms and based on specific kernel version. If the kernel is upgraded, then you will need a different build.prop.

    Can I try it on different rom and kernel?
    Before applying the tweaks, make sure that you have the nandroid backup first and try it. If the phone is stuck on boot screen, you may need to flash your rom again thru the odin or CWM recovery.
    (usually incorrect edit on build.prop file could cause a freezing on boot screen. So be sure that you know how to edit build.prop)

    Does build.prop support different ROMs except the stock?
    Basically, my answer is no. To make the build.prop working on different ROM, it needs to be modified based on your rom and kernel. Currently I have a few versions supporting stock rom and kernel - check the progress report and change log for any updates. For any other Roms, please check the same area also.


    Progress report:
    4/29/12 10:50 pm US EST I'm adding three more screenshots.
    screenshot#4 : Lasting More than 21 hours and battery still left 52%
    #5: showing screen-on statistics. In here, on battery time was reset somehow. But actual time is 21+ hours (same on screenshot #4,5,6)
    #6: It shows which apps were running during the sleep mode and screen was off. If you wonder which apps are running when the phone is on sleep/deep sleep mode, you can check the apps thru this kind of tool (battery monitor widget). If you want to save more battery, you can change the options from each apps if it provides a such kind of options.
    4/30/12 My first full battery cycle test was ended up with about 40 hours until battery capacity reaches to 30%. During my test, I found some apps were still running during the sleep mode and those were using lots of battery. In my case, some of those apps were touchdown (email), Kakao talk (sns), and facebook apps. In many cases, we are not able to control the method how the application run in foreground and background. Some apps provides us how to sync and when to sync but there are still lots of chances for those apps for the improvement at least in the perspective of battery consumption.

    5/1/12 The second version tweak is coming soon -> done.
    5/2/12 WiFi issue resolved. http://xdaforums.com/showthread.php?t=1630792 and added one more tweak file. Before applying this file, read the attached thread first. You won't be disappointed.
    5/4/12 Tested battery consumption with wifi turned on 24x7 (like JC's snapshot somewhere in this thread). Not bad at all. #7 snapshot shows that. About 19 hours and still 63% remaining (with on screen 30m, voice call 2m, lots of snapshots, lots of emails (100+), some SNS). Added snapshots #8 & 9.
    5/5/12 Big Thanks to TeamERA and team member who converted build.prop for each Kernels. TeamERA provided build.prop files based on different Kernels(Roms). Check out the post #88.
    Supported Kernel: AOKP CM9a3 (tested) CNA FD26 MIUI. For FD26, I've checked the items and values on it. There's some items sequence change made comparing build.prop in here and minor values changes - post #94.
    So anyone who had issues on boot screen with build.prop that I posted, now you can try build.prop tweak based on your current rom.
    5/6/12 GB Kernel Test - Blazer 4.1 EL29 - Not able to change the CPU frequencies and frequency change is causing phone freezing during the sleep & wakeup. No way to change this by init.d script so far. Only the way would be using Tegrak or System Tuner Pro tools. I tried System Tuner Pro and set the conservative governor (underclock to 1GHz) as on boot instead of init.d option. Working like a charm and no freezing yet.
    Update: since applied, 19 hours and 70% of battery remaining. For more info, post your questions. Related post: http://xdaforums.com/showthread.php?t=1625299&page=11 post #107.
    5/8/12 Added FE07 Stock based tweaked build.prop. Only for Stock FE07 based Kennels.
    5/9/12 Two more zip files added. init.d.v2b - moderate CPU tweaks. init.dv2b2 - agressive CPU tweaks (could save more battery).
    5/10/12 Added AOKP FE07 version of build.prop at post #156.
    http://xdaforums.com/showpost.php?p=25907510&postcount=156
    5/14/12 zipalign tweak added
    5/16/12 wifiSleepWait tweak improved. Check the section 4.5 from OP. Now this tweak works without any manual database handling.
    5/17/12 Now supporting flashable zip files. You may get customized flashable zip files based on your rom. Check out - http://xdaforums.com/showthread.php?t=1658471

    Issue Log:
    5/1/12 a. It seems like changing the Wi-Fi option to 'Never' and pm.sleep_mode to 1 does not work. My previous test based on the 3G turned on always and minimized turning on wifi. Now I'm testing wi-fi options but status shows that wifi is turned on always. Checking more details... Checked with wifi fixer but wifi still does not sleep. Started removing anything related wifi, but no luck yet. Spending several hours but no luck. Going to test on fresh installed stock rom/kernel.

    Status: Resolved. http://xdaforums.com/showthread.php?t=1630792

    b. AOKP Rom users or custom Kernel users - Do not sue these tweaks. Basically I cannot help any issues on AOKP because I'm not a user of AOKP. So far, it's known that 31tweak file is causing a boot loop on Samsung logo screen.

    Change log:

    4/29/12 41tweaks_kobridge tweak updated. changed value setprop pm.sleep_mode to sync with build.prop.
    4/30/12 lcd_density value changed back to default 240. It's my mistake uploading the file based on my configuration and forgot to change it back to default. Thanks to TeamERA for findings. If anything else found, more updates will be added to build.prop.
    Thanks again to TeamERA. He found another one - "In your kobridgetweaks script you have ring delay at 1000, and in build.prop 0, it should be 0". Updated attached zip file.
    5/2/12 New wifi idle tweak init.d file attached (only for the update of existing table)
    5/4/12 Added 11 email section.
    5/6/12 Wrong link in wifi section corrected.
    5/8/12 Build.prop created based on FE07. Rearranged tweaked items based on Stock sequence. Removed duplicates.
    5/9/12 uploaded updated init.d scripts. CPU tweaks changed to deal with only ondemand governor. Fixed few errors on 41tweaks. Currently it's a beta version because very few times, I saw that wifi was not automatically reconnected after the sleep. I confirmed that it's the stock rom issue and it's not coming from the tweaks in here.
    5/14/12 zipalign tweak updated to confirm the removal of temporary APK files.
    5/15/12 Improvement on 41Tweaks_other tweak file (more tweaks based on sysctl). Fixed on error from previous file. 21&31 CPU tweak files were changed more aggressively.
    5/16/12 70wifiSleepWait_kobridge version2 tweak uploaded.
    3
    Thanks kobridge. I think this script is just what I've been looking for and I'm going to give it a run.

    sfhub, somewhat off topic, but continuing with kobridge's related thread, How to run init.d scripts on boot, how come chmod 755 is not expressed rwx-rx-rx instead of -rwxr-xr-x? Seems more logical to me.

    It's always rwxrwxrwx order.
    rwx (read write execute) -> 4 + 2 + 1 -> 7
    rw_ -> 4 + 2 + 0 -> 6
    r_x -> 4 + 0 + 1 -> 5
    r__ -> 4 + 0 + 0 -> 4

    the second bit is always for w (write) permission. So, the order -rx is not possible.

    Some basic binary calculation and permission related info:
    The permission is consist of 9 bits for user, group, and other (each user group holds 3 bits).
    With binary expression, it would be same
    111 (user) 111 (group) 111 (other)

    For first bit represent the read permision and the second is for write, third one is for execute.
    so 755 equals in binary expression 111 101 101 (= rwxr_xr_x)
    3
    If you are enabling the init.d support by running his tool, be sure that the existing install-recovery.sh file was not created by his old Auto root tool nor you manually created it following this guide. If the file is the one you created by sfhub's tool or my guide in here, be sure that you remove the old file manually before you run his new Auto Root Tool. Otherwise, the init.d scripts would run twice whenever you reboot your phone.
    BTW the installer in Auto Root checks to see if the existing install-recovery.sh is the one that adds init.d support. If it is, it just overwrites it. Only if the existing install-recovery.sh has nothing to do with init.d support does it move it to install-recovery-orig.sh. The way it detects whether the existing install-recovery.sh is used for init.d support is the presence of the BusyboxBin string, which is the shell variable used to define the busybox location used by the script. The chances some arbitrary install-recovery.sh script defines that string is very low (but not zero)

    So bottom line if Auto Root is working properly, it shouldn't be necessary to remove your existing init.d install-recovery.sh script as it will not cause a situation where init.d is run twice.

    Also I forgot to mention that some people wanted to run init.d but didn't have busybox installed. I didn't want to clobber busybox for people that have installed it, so basically just had the init.d install-recovery.sh use /system/xbin/busybox-initd (which gets copied into place by the auto root installer) This makes it easier (more symmetrical) to remove init.d support and associated busybox-initd without worrying about who installed busybox to start with.

    For the "new-install-recovery.zip" you should do a symlink from busybox-initd to busybox
    Code:
    su
    cd /system/xbin
    ln -s busybox busybox-initd