[Android Software/Hacking General [Developers Only]] husen4u:
Warning

If you read this you may go blind and never become erect again.

And there is a possibilty a sattelite will fall from the sky and crush your house

This most likely can be incorparated into any rom on any phone

Feel free to post this anywhere and include it in any rom(Just Give Proper Credit)

I made this about a year ago .Works quite well

it makes tweaking very easy

designed to make tearing apart full tweak scripts apart and testing lines a nd full scripts e easy.

allows you to make up to 7 totally different init.d profiles . the ability to turn on or off any profile.

So now you can develop 7 profiles to boot from and run any profile in realtime

also gives you 2 sysctl.conf to boot from and two more to run in realtime

you need root and busybox

the contents of the foldet ( etc) go in /etc

the contents of ( bin) go in /system/bin the 6 files containing (run) need to be executeable

now you can put install-recovery.sh in /etc to get everything to run at boot

if you have Gametheorys kernel you can use the sysinit i provided in / system/ bin

if you already have either of these used by something else just add the lines from mine to yours

init.d

put scripts in the main folder like normal

there are folders in side

prof1 to prof 6

you can set scripts in those

the foldercalled Scripts is to store unused stuff

also is the initd control where you can use root browser root explorer or any scriptmanager to run the (on,off or run) scripts

Note, i cleaned out all my scripts but decided to leave the main folder with a setup i use the most Remove them or use at your risk

now you have

sysctl.conf through sysctl.conf4 in your /etc folder

load those with sysctl settings

init the init.d/scripts/sysctl are scripts to turn on or off sysct1 and 2 and run 3-4 in tealtime

More (run at will) profiles

init.run folder

load setups in run1 to run6 folders

at anytime use the control panel in init.run to exec any ofrun1 through run6

Note all profile folders have a subfolder labeled (a) those are just like pocket folders to store unused scripts

FLASHABLE DISABLER

This design has something very valuable

each profile has its own (applet) in /system/bin

the install-recovery.sh execs all init.d and prof1 through prof6 applets

but when you use the control panel to turn on or off the profiles you are sinply changing the permissions to each (applet)

So incase you put a bad script in and boots up in a loop or something else

i made a flashable zip of all the bootable (applets) with permissions all at zero

This will render all the bootable profiles un executeable

your new init.d script throws you in a loop flash the

InitdDisableall.zip below and reboot

None of the profiles will execute

So this basically gives you 7 init,d folders . you can choose which ones to boot from

for instance

i load one folder with my settings.one core turned off and cpu set at 810 and a clogged up conservative governor with agressive lmk

say i want to convert movies or play games i boot from an init,d folder i loaded with both cores at full cpu and multitasking lmk and a different governor set for speed

And i added a realtime run feature

this means i can exec any of these folders in realtime without rebooting

Then as an added bonus there is an additional folder that allows you to load your profiles to 6 more folders that you can easily exec in realtime without booting

the sysctl has the same idea

you get 2 sysctl.conf you can load with different settings and choose which one to boot from

plus 2 more sysctl.conf to load that you can run in realtime

The idea is to be able to have many Profiles of settings prefabbed and the ability to exec them quickly

This makes switching from performance and battery saving very easy

It makes testing and designing your profiles very easy as well

Now if you look at Sepero's Bootbuddy

it runs scripts at boot from the ext sd

this is awsome for me, when testing scripts i test some from bootbuddy

i use this for certain things like build.prop or certain kernel tweaks that i am not confident about

if this tweak causes a bootloop i can remove the sd card and bootup without the tweak

after several bootups with no issue, i move the tweak from bootbuddy over to init.d

But if you only want to use bootbuddy and not init.d i added 2 more bootable folders so you can choose from 3 profiles to boot from or turn all off

HOW To Develop your profiles

When i start on a new phone this is my formula

first i find supported govenors

i choose the slowest governor

then make an init.d script to load the governor of choice at boot

Then i clog up the governor,this means i slow it down

I change the settings so it doesnt scale up very fast and scales down instantly

Maybe lengthen the duration between mpdecisions

This is awesome for battery use and further testing

Next I want to start chopping away at the cpu, So I remove all cpu cores but 1

then limit the cpu to a lower scale

I usually start nat around 900 mhz

Example

The lg motion with Gametheory's oc kernel with added governors

i used the Conservative governor setwith

sampling down 1

up threshold 96

down threshold 95 ( or higher)

one core on only running at 918 mhz

So now your phone is much slower,Much better battery life but less responsive

do an antutu benchmark

make sure to look at the Details,each individual score

NOTE if you dont know how to get started

use an app like Kernel tuner

check the settings and selected run at boot with init.d

close kernel tuner it will create an init.d script for you

now go to your init.d folder and make a copy of the script

go back to Kernel Tuner and Disable the run at boot settings. it will remove its scripts

but you have your copy

Now for the ease of profiling you need to Batch your tweaks

small and identical for easy swapping and removal

like all vm tweaks in a script only ,net tweaks in a script only

and save the varied settings in a folder

when you are done you will have several folders of batched tweaks

forinstance various Governor tweaks like i posted below

The Ondemand Governor

A init.d script to load the Ondemand governor with stock settings

but it has 4 scripts for ondemand governor with Slower settings and 4 with above stock settings

Do this for every governor you use

The same with cpu max limits

From here on the idea is to chop away at the cpu but keep the score the same or better (when i am done i will run the phone at 594 or 702 but is close to responsive as the 918,and when i run the phone at stock or better phone is fassst)

Running the phone at core only and at lower speeds make its much easier to indentify the results of individual tweaks

Next you need to look at your system

/proc/sys is a good place to start

here are many settings we are gonna start changes to optimize our phone.

fs,kernel,net and vm settings are here

Its nice to know this as many phones have the same files found here but a few may vary

Please Check Attact File For Download

Tweak Pak Is Not Flashable.

I Am Not Responsible For Any Damage To Your Device. Try It At Your Own Risk.

Sorry For My Bad English

Hope You Understand What I Want To Say

Credit To rhino889a