Sunteți pe pagina 1din 141

#!/system/bin/sh # # V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox.

# SuperMinFree Calculator & MFK Calculator (for min_free_kbytes) created by zepp elinrox also ;^] # # See http://goo.gl/krtf9 - Linux Memory Consumption - Nice article! # See http://goo.gl/hFdNO - Memory and SuperCharging Overview or... "Why 'Free R AM' Is NOT Wasted RAM!" # See http://goo.gl/4w0ba - MFK Calculator Info - explanation for vm.min_free_kb ytes. # # For Debugging: Delete the # at the beginning of the next line and watch the ou tput on the next run! # set -x -o errexit # line================================================= echo "" echo $line echo " NOTE: BUSYBOX v1.16.2 OR HIGHER IS RECOMMENDED!" echo $line sleep 2 busybox mount -o remount,rw /data 2>/dev/null busybox mount -o remount,rw / 2>/dev/null busybox mount -o remount,rw rootfs 2>/dev/null if [ -d "/sqlite_stmt_journals" ]; then madesqlitefolder=0 else mkdir /sqlite_stmt_journals; madesqlitefolder=1 fi if [ ! -d "/sqlite_stmt_journals" ]; then echo $line echo "" sleep 2 echo " Big Problem! Can't create a temporary folder!" echo "" sleep 2 echo " Possible reasons:" echo "" sleep 2 echo " 1. Not running as root...?" sleep 1 echo " 2. Busybox isn't installed...?" sleep 1 echo " 3. Busybox can't mount as r/w for some reason." echo "" sleep 2 echo $line fi if [ ! -d "/data/V6_SuperCharger" ]; then mkdir /data/V6_SuperCharger; fi if [ ! -d "/sdcard/V6_SuperCharger" ]; then mkdir /sdcard/V6_SuperCharger; fi cat > /sdcard/!SuperCharger.html <<EOF <br> <br> <i><u><b>-=The V6 SuperCharger=-</b></u> created by zeppelinrox.</i><br> <br> <u><b>Owner's Guide</b></u><br> <br> Hi! I hope that the V6 SuperCharger script is working well for you!<br> <br> <b>Are you 100% SuperCharged?</b> This file auto loads if minfrees <u>don't matc h!</u><br>

If this is the case, <u><b>READ</b></u> this entire help file - <u><b>BEFORE</b> </u> asking redundant questions!</u><br> <br> Here is some <b><u>Background Info</u></b> in case you're curious...<br> <br> <a href="http://goo.gl/krtf9">Linux Memory Consumption</a> - Nice article!<br> <a href="http://goo.gl/hFdNO">Memory and SuperCharging Overview</a> or... "Why ' Free RAM' Is NOT Wasted RAM!"<br> <a href="http://goo.gl/4w0ba">MFK Calculator Info</a> - explanation for <b>vm.mi n_free_kbytes</b><br> <br> Ok... now be sure to have <a href="http://play.google.com/store/apps/details?id= com.jrummy.busybox.installer">BusyBox</a> installed or else the scripts won't wo rk!<br> Most custom roms should already have a version installed and that usually works OK.<br> So if you need to, only install <b>BusyBox v1.16.2 or higher!</b><br> Note that some versions above v1.18.2 and below v1.19.1 sometimes give errors so <u>PAY ATTENTION</u> to the script output!<br> Versions above v1.19.0 should be fine though.<br> If all else fails or if you get "<b>applet not found</b>" errors, just grab wrai thdu's BusyBox build from the <a href="http://goo.gl/qM6yR">V6 SuperCharger Thre ad!</a><br> <br> A nice app for running the script is <a href="http://play.google.com/store/apps/ details?id=os.tools.scriptmanager">Script Manager</a><br> It can even load scripts on boot - on ANY ROM!<br> Plus, it even has WIDGETS!<br> So you can actually put a V6 SuperCharger shortcut on your desktop, launch it, a nd have a quick peek at your current status!<br> <br> But first, you need to set up Script Manager properly!<br> In the "Config" settings, enable "Browse as Root."<br> Then browse to where you saved the V6 SuperCharger script, select it, and in the script's properties box, be sure to select "Run as Root" ie. SuperUser!<br> <b>Do NOT run this file at boot!</b> (You don't want to run the install on every boot, do you?)<br> Run the V6 SuperCharger script, touch the screen to access the soft keyboard, an d enter your choice :)<br> <br> <u><b>Stock ROMs</b></u>: After running the script, have Script Manager load the newly created <b>/data/99SuperCharger.sh</b> on boot<br> In the "Config" settings, be sure that "Browse as Root" is enabled.<br> Press the menu key and then Browser. Navigate up to the root, then click on the "data" folder.<br> Click on 99SuperCharger.sh and select "Script" from the "Open As" menu.<br> In the properties dialogue box, check "Run as root" (SuperUser) and "Run at boot " and "Save".<br> And that's it!<br> Script Manager will load your most recent settings on boot!<br> If you run the script later and with different settings, you don't have to recon figure anything.<br> Script Manager will just load the new /data/99SuperCharger.sh on boot automagica lly ;^]<br> <br> <u><b>Custom ROMs</b></u>: If you have a custom rom that loads /system/etc/init. d boot scripts,<br> You DON'T need to use Script Manager to load a boot script. It will all be autom atic!<br> Also, if you can run boot scripts from the /system/etc/init.d folder, there are

other options.<br> For example you can use an app like Terminal Emulator to run the script.<br> <u>NON-ICS ROMS</u>: If your ROM has the option, <b>DISABLE "Lock Home In Memory .</b> This takes effect immediately.<br> Alternately, <u>if you need to free up extra ram</u>, you can use "Lock Home in Memory" as a "Saftey Lock".<br> ie. Use it to toggle your launcher from "Bulletproof" (0) or Hard To Kill (1) to "Weak" (2) in the event that you want to make the launcher an easy kill and fre e up extra RAM ;)<br> <br> <u><b>If Settings Don't Stick:</b></u> If you have Auto Memory Manager, DISABLE SuperUser permissions and if you have AutoKiller Memory Optimizer, DISABLE the a pply settings at boot option!<br> Also, if you have a <b>Custom ROM</b>, there might be something in the init.d fo lder that interferes with priorities and minfrees.<br> If you can't find the problem, a quick fix is to have Script Manager run <b>/sys tem/etc/init.d/*99SuperCharger</b> "at boot" and "as root."<br> <br> Another option is to make a Script Manager widget for <b>/system/etc/init.d/*99S uperCharger</b> or <b>/data/99SuperCharger.sh</b> on your homescreen and simply launch it after each reboot.<br> <br> For those with a <b>Milestone</b>, I made a version for <b>Androidiani Open Reco very</b> too :D<br> Just extract the zip to the root of the sdcard (it contains the directory struct ure), load AOR, and there will be a SuperCharger Menu on the main screen! <br> <br> For more SuperCharging help and info,<br> See the <a href="http://goo.gl/qM6yR">-=V6 SuperCharger Thread=-</a><br> Feedback is Welcome!<br> <br> -=zeppelinrox=- @ <a href="http://goo.gl/qM6yR">XDA</a> & <a href="http://www.dr oidforums.net/forum/droid-hacks/148268-script-v6-supercharger-htk-bulletproof-la unchers-fix-memory-all-androids.html">Droid</a> Forums<br> <br> EOF if [ "$madesqlitefolder" -eq 1 ]; then rm -r /sqlite_stmt_journals; fi 2>/dev/nu ll busybox mount -o remount,ro / 2>/dev/null busybox mount -o remount,ro rootfs 2>/dev/null echo " Test Driving Your Android Device..." echo $line echo "" sleep 1 if [ ! "`which busybox`" ]; then echo " BusyBox NOT FOUND..." echo "" sleep 4 echo $line echo " ...No Supe for you!!" echo $line echo "" sleep 4 echo " If you continue, problems can occur..." echo "" sleep 4 echo " ...and even bootloops!" echo "" sleep 4 echo " ...Please install BusyBox and try again..."

echo "" sleep 4 echo " Get BusyBox from the V6 SuperCharger Thread!" echo "" echo $line echo "" sleep 4 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/qM 6yR" echo "" echo $line echo "" sleep 4 echo " I hope that helped! :^)" echo "" sleep 4 echo " Continue anyway...?" echo "" sleep 2 echo -n " Enter Y for Yes, any key for No: " read bbnotfound echo "" case $bbnotfound in y|Y)echo " uh... right... okay..." echo "" echo $line echo "" sleep 2;; *)echo " Buh Bye..." exit 69;; esac else if [ ! "`which awk`" ]; then badbb="yes"; echo " WARNING: awk applet NOT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi if [ ! "`which sed`" ]; then badbb="yes"; echo " WARNING: sed applet NOT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi if [ ! "`which head`" ]; then badbb="yes"; echo " WARNING: head applet N OT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi if [ ! "`which pgrep`" ]; then badbb="yes"; echo " WARNING: pgrep applet NOT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi if [ "$badbb" ]; then echo "" echo " Your BusyBox is an EPIC FAIL... :p" echo "" sleep 4 echo " It's version does NOT even matter because..." echo "" sleep 4 echo $line echo " It's MISSING basic applets and functions!" echo $line echo "" sleep 4 echo " If you continue, problems can occur..." echo "" sleep 4 echo " ...and even bootloops!" echo "" sleep 4 echo " ...Please reinstall BusyBox and try again..."

echo "" sleep 4 echo " Get BusyBox from the V6 SuperCharger Thread!" echo "" sleep 4 echo $line echo " And DON'T play stupid and ask me what's wrong!!" echo $line echo "" sleep 4 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://g oo.gl/qM6yR" echo "" echo $line echo "" sleep 4 echo " I hope that helped! :^)" echo "" sleep 4 fi test1=`busybox | head -n 1 | awk '{print $1}'` test2=`busybox | head -n 1 | awk '{print $2}'` test3=`echo 1000,2000,3000,4000,5000,6000 | awk -F , '{printf "%.0f %.0f %.0f %.0f %.0f %.0f\n", $1/256, $2/256, $3/256, $4/256, $5/256, $6/256}'` if [ "$test2" ]; then echo " BusyBox $test2 Found!" else echo " ERROR! Can't determine BusyBox version!" fi echo "" sleep 1 if [ "$test1" = "BusyBox" ] && [ "$test3" = "4 8 12 16 20 23" ]; then echo " AWKing Awesome... AWK test passed!" echo "" sleep 1 test4=`pgrep ini` if [ "$test4" ]; then echo " Groovy... pgrep test passe d too!" else echo " BusyBox has holes in it..." echo "" sleep 4 echo " ...BulletProof Apps ain't gonna work..." echo "" sleep 4 echo $line echo " ...pgrep test FAILED!" echo $line fi else echo " There was an AWK error..." echo "" sleep 4 echo $line echo " ...what the AWK!?" echo $line echo "" sleep 4 if [ "$test3" != "4 8 12 16 20 23" ]; then echo $line echo " It can't even do... SIMPLE math! LOL WUT!?" echo $line echo "" sleep 4

fi echo " If you continue, problems can occur..." echo "" sleep 4 echo " ...and even bootloops!" echo "" sleep 4 echo " ...Please reinstall BusyBox and try again..." echo "" sleep 4 echo " Get BusyBox from the V6 SuperCharger Thread!" echo "" sleep 4 echo $line echo " And DON'T DARE ask me to support broken shit!!" echo $line echo "" sleep 4 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://g oo.gl/qM6yR" echo "" echo $line echo "" sleep 4 echo " I hope that helped! :^)" echo "" sleep 4 echo " Continue anyway...?" echo "" sleep 2 echo -n " Enter Y for Yes, any key for No: " read awkerror echo "" case $awkerror in y|Y)echo " uh... right... okay..." echo "" echo $line;; *)echo " Buh Bye..." exit 69;; esac fi echo "" sleep 1 fi if [ "`echo $(id) | sed 's/(.*//' | sed 's/.*=//'`" -eq 0 ]; then echo " Nice! You're Running as Root/SuperUser!" else echo " You are NOT running this script as root..." echo "" sleep 4 echo $line echo " ...No SuperUser for you!!" echo $line echo "" sleep 4 echo " ...Please Run as Root and try again..." echo "" sleep 4 echo " Loading Owner's Guide..." echo "" echo $line

echo "" sleep 4 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start -a android.inten t.action.VIEW -n com.android.browser/.BrowserActivity -d file:///sdcard/!SuperCh arger.html" echo "" echo $line echo "" sleep 4 echo " I hope that helped! :^)" echo "" sleep 4 exit 69 fi echo "" su=$(`which su` -v); su=${su#*:} if [ "$su" != "SUPERSU" ]; then echo $line echo "" sleep 1 echo " Now testing superuser binary file..." echo "" sleep 1 echo " If it hangs... update the su binary at XDA!" echo "" sleep 1 echo " Wiping Caches & Re-Flashing your ROM helps too!" echo "" echo $line echo -n " " test "`pm list packages`" && su=good || su=bad if [ "$su" = "good" ]; then echo "Bonus: su binary is good!" else echo $line sleep 4 echo " Bad news: that's an ERROR... su binary su-cks!" echo $line echo "" sleep 4 echo " If you continue, \"segfaults\" will occur..." echo "" sleep 4 echo " You should grab a FIXED su binary..." echo "" sleep 4 echo " ...from the V6 SuperCharger Thread!" echo "" sleep 4 echo " Or even better..." echo "" sleep 4 echo " ...just install The SuperCharger Starter Kit!" echo "" echo $line echo "" sleep 4 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://g oo.gl/qM6yR" echo "" echo $line

echo "" sleep 4 echo " I hope that helped! :^)" echo "" sleep 4 fi echo $line echo "" sleep 1 fi sleep 1 echo $line echo " Test Drive Complete!" echo $line echo "" sleep 2 speed=1 sleep="sleep $speed" smrun=`pgrep scriptmanager` bbversion=`busybox | head -n 1 | awk '{print $1,$2}'` ram=$((`free | awk '{ print $2 }' | sed -n 2p`/1024)) opt=0;ran=0;gb=0;ics=0;memory=c;a=already_modified;b=bad_jar;ram1=7078;oomstick= 0;ADJs=0;OOMs=0;minfrees=0 TMP_DIR="/sdcard/V6_SuperCharger/temp" initrcpath1="/init.rc" initrcpath="/data$initrcpath1" initrcbackup=$initrcpath.unsuper allrcpaths=`grep import $initrcpath1 | sed 's/.*import*.//'` busybox mount -o remount,rw / 2>/dev/null busybox mount -o remount,rw rootfs 2>/dev/null busybox mount -o remount,rw /system 2>/dev/null busybox mount -o remount,rw `busybox mount | grep system | awk '{print $1,$3}' | sed -n 1p` 2>/dev/null if [ "$allrcpaths" ] && [ ! -f "$allrcpaths" ]; then touch $allrcpaths; chown 0. 0 $allrcpaths; chmod 644 $allrcpaths; fi for rc in `busybox find /system -iname "*.rc"`; do if [ ! "`echo $rc | grep goldfish`" ] && [ ! "`echo $rc | grep ueventd`" ] && [ ! "`echo $allrcpaths | grep $rc`" ]; then chown 0.0 $rc; chmod 644 $rc allrcpaths="$allrcpaths $rc" if [ "`grep -ls "on boot" $rc`" ]; then rcpaths="$rcpaths $rc"; fi fi done busybox mount -o remount,ro / 2>/dev/null busybox mount -o remount,ro rootfs 2>/dev/null busybox mount -o remount,ro /system 2>/dev/null busybox mount -o remount,ro `busybox mount | grep system | awk '{print $1,$3}' | sed -n 1p` 2>/dev/null LIMIT1=0;LIMIT2=3;LIMIT3=6;LIMIT4=10;LIMIT5=12;LIMIT6=15 newscadj="$LIMIT1,$LIMIT2,$LIMIT3,$LIMIT4,$LIMIT5,$LIMIT6";oldscadj1="0,3,5,7,14 ,15";oldscadj2="0,2,4,7,14,15";oldscadj3="0,3,6,10,14,15";oldscadj4="0,4,8,12,14 ,15";scamadj1="0,2,5,7,14,15";scamadj2="0,1,2,4,6,15" if [ -f "/data/V6_SuperCharger/SuperChargerMinfree" ]; then cp -fr /data/V6_SuperCharger/SuperChargerMinfree /data/V6_SuperCharger/S uperChargerMinfreeOld scminfreeold=`cat /data/V6_SuperCharger/SuperChargerMinfreeOld` fi if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; then animation=`awk -F , '{print $3}' /data/V6_SuperCharger/SuperChargerOptions`; fi

if [ ! "$animation" ] || [ "$animation" -eq 1 ]; then clear;$sleep;echo $line;echo "";echo "";echo "";echo "";echo "";echo ""; echo "";echo "";echo "";echo "";echo "";$sleep clear;echo "";echo $line;echo "";echo "";echo "";echo "";echo "";echo "" ; echo "";echo "";echo "";echo "";$sleep clear;echo "";echo $line;echo $line;echo "";echo "";echo "";echo "";echo ""; echo "";echo "";echo "";echo "";$sleep clear;echo "";echo $line;echo "";echo $line;echo "";echo "";echo "";echo ""; echo "";echo "";echo "";echo "";$sleep clear;echo "";echo $line;echo " |/ #####";echo "";echo $line;echo " ";echo "";echo ""; echo "";echo "";echo "";echo "";$sleep clear;echo "";echo $line;echo " | / # #";echo " |/ #####";ec ho "";echo $line;echo "";echo "";echo "";echo "";echo "";echo "";$sleep clear;echo "";echo $line;echo " ||// # #";echo " | / # #"; echo " |/ #####";echo "";echo $line;echo "";echo "";echo "";echo "";echo "" ;$sleep clear;echo "";echo $line;echo " || // #####";echo " ||// # #" ;echo " | / # #";echo " |/ #####";echo "";echo $line;echo "";echo "" ;echo "";echo "";$sleep clear;echo "";echo $line;echo " || // #";echo " || // #####";ec ho " ||// # #";echo " | / # #";echo " |/ #####";echo "";echo $line;echo "";echo "";echo "";$sleep clear;echo "";echo $line;echo " || // # #" ;echo " || // # ";echo " || // #####";echo " ||// # #";echo " | / # #";echo " |/ #####";echo "";echo $line;echo "";echo "";$sleep clear;echo "";echo $line;echo " || // #####";echo " || // # #";echo " || // #";echo " || // #####";echo " ||// # #";echo " | / # #";echo " |/ #####";echo "";echo $line;echo "";$sleep clear;echo "";echo $line;echo "";echo " || // #####";echo " || // # #";echo " || // #";echo " || // #####";echo " ||// # #";echo " | / # #";echo " |/ #####";echo "";echo $line;sleep 2 clear;echo "";echo $line;echo "";echo " || // #####";echo " || // # #";echo " || // # -=SUPERCHARGER=-";echo " || // #####";echo " ||// # #";echo " | / # #";echo " |/ #####";echo "";echo $line;sleep 2 clear;echo " zoom...";echo $line;echo "";echo " || // #####";echo " || // # #";echo " || // # -=SUPERCHARGER=-";echo " || // #####";echo " ||// # #";echo " | / # # Presented";echo " |/ #####";echo "";echo $line;sleep 2 clear;echo " zoOM... zoOM...";echo $line;echo "";echo " || // ### ##";echo " || // # #";echo " || // # -=SUPERCHARGER=-";e cho " || // #####";echo " ||// # #";echo " | / # # Presented by:";echo " |/ #####";echo "";echo $line;sleep 2 clear;echo " zOOM... zOOM...";echo $line;echo "";echo " || // ### ##";echo " || // # #";echo " || // # -=SUPERCHARGER=-";e cho " || // #####";echo " ||// # #";echo " | / # # Presented by:";echo " |/ ##### -=zeppelinrox=-";echo "";echo $line;sl eep 2 else clear; echo ""; echo $line fi echo " NOTE: BUSYBOX v1.16.2 OR HIGHER IS RECOMMENDED!" echo $line echo "" $sleep if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; then speed=`awk -F , '{print $1}' /data/V6_SuperCharger/SuperChargerOptions` sleep="sleep $speed" buildprop=`awk -F , '{print $2}' /data/V6_SuperCharger/SuperChargerOptio ns` initrc=`awk -F , '{print $4}' /data/V6_SuperCharger/SuperChargerOptions`

launcheradj=`awk -F , '{print $5}' /data/V6_SuperCharger/SuperChargerOpt ions` fixemissions=`awk -F , '{print $6}' /data/V6_SuperCharger/SuperChargerOp tions` zepalign=`awk -F , '{print $7}' /data/V6_SuperCharger/SuperChargerOption s` detailing=`awk -F , '{print $8}' /data/V6_SuperCharger/SuperChargerOptio ns` misc3g=`awk -F , '{print $9}' /data/V6_SuperCharger/SuperChargerOptions` if [ ! "$misc3g" ]; then missingoptions=yes; fi else firstgear=yes; autoshowcalculated=yes; sleep="sleep 2" fi if [ "$smrun" ]; then echo " Touch the screen to bring up soft keyboard" else echo " Try Script Manager... it's easier!" fi echo "" echo $line echo "" $sleep echo " Additional BusyBox Info:" echo "" $sleep echo " `busybox | head -n 1 | awk '{print $1,$2,$3}'`" echo " `busybox | head -n 1 | awk '{print $4,$5,$6,$7,$8,$9,$10}'`" echo "" $sleep echo " BE SURE IT'S A COMPLETE VERSION!" echo "" $sleep echo " You are currently using $bbversion..." echo "" $sleep if [ "$bbversion" \> "BusyBox v1.16.1" ] && [ "$bbversion" \< "BusyBox v1.18.3" ] || [ "$bbversion" \> "BusyBox v1.18.9" ]; then echo " ...which is fi ne - if it's COMPLETE!" else echo $line echo -n " WARNING! Your BusyBox is " if [ "$bbversion" \> "BusyBox v1.18.2" ] && [ "$bbversion" \< "BusyBox v 1.19.0" ]; then echo "greater than v1.18.2" echo "" sleep 2 echo " ...and less that v1.19.0!" echo $line echo "" sleep 2 echo " These versions can cause problems..." else echo "less than v1.16.2" echo $line echo "" sleep 2 echo " Some commands may not even work..." fi echo "" sleep 2 echo " ..and you may have issues such as bootloops..." echo "" sleep 2

echo " ...proceed at your own risk!!" echo "" sleep 2 echo " Get BusyBox from the V6 SuperCharger Thread!" echo "" echo $line echo "" sleep 2 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/qM 6yR" fi echo "" echo $line homeadj=`getprop ro.HOME_APP_ADJ`;FA=`getprop ro.FOREGROUND_APP_ADJ`;PA=`getprop ro.PERCEPTIBLE_APP_ADJ`;VA=`getprop ro.VISIBLE_APP_ADJ` if [ ! "$FA" ] || [ "`grep build.version.release /system/build.prop | sed 's/.*= //'`" \> 3.69 ]; then ics=1;FA=0;PA=2 elif [ "$PA" ]; then gb=1 fi for launchers in `grep set.*/*.Launcher /d*/system/packages.xml | sed 's/\/*.L.* //' | sed 's/.*="//'` `grep -E "^<package.*serId" /d*/system/packages.xml | grep -E "adwfreak|zeam|tw3|tw4|nextgen|shell|home|trebuchet|launcher" | grep -Ev not ification | sed 's%.* name="\(.*\)".*%\1%' | cut -d '"' -f1` adwfreak zeam tw3 t w4 tw5 nextgen shell home trebuchet launcher acore; do llist="$llist `pgrep -l $ launchers | awk '{print $2}'`"; done for l in $llist; do for lpid in `pgrep $l`; do loom_adj=`cat /proc/$lpid/oom_adj`; skip= if [ "$l" = "android.process.acore" ] && [ "$loom_adj" -lt 0 ]; then ski p=yes elif [ "$loom_adj" -eq "$homeadj" ] || [ "$loom_adj" -eq "$VA" ] || [ "$ loom_adj" -eq "$PA" ] && [ "$ics" -eq 0 ] || [ "$ics" -eq 1 ]; then if [ ! "$HL" ] || [ "$HL" -gt "$loom_adj" ]; then if [ "$lname" ] && [ "$lname" != "android.process.acore" ] && [ "$l" = "android.process.acore" ]; then echo "" $sleep echo " Erm... Is $lname the launcher?" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read islauncher case $islauncher in n|N);; *)skip=yes;; esac echo "" echo $line fi if [ ! "$skip" ]; then HL=$loom_adj lname=$l fi if [ "$ics" -eq 0 ] && [ "$HL" -eq "$homeadj" ] && [ "$H L" -lt "$VA" ] && [ "$HL" -eq "$(($FA+1))" ]; then diehard="yes"; break; fi fi fi done done 2>/dev/null if [ "$ics" -eq 1 ] && [ "$HL" ] && [ "$HL" -lt 3 ]; then icssced=hellzyeah; VA= 3

elif [ "$ics" -eq 1 ]; then showicscentre=yes; VA=1 if [ ! "$HL" ]; then HL=6; fi fi if [ "$lname" ]; then echo " $lname is the home launcher!" echo $line echo "" $sleep echo -n " But verify groupings with the bOOM Stick" if [ "$lname" = "android.process.acore" ] && [ ! "$diehard" ]; then echo "..." echo "" $sleep echo " ...since launchers often HIDE INSIDE IT..." echo "" $sleep echo " ...so I'm not 100% sure :P" else echo "!" fi else echo "" $sleep echo " No home launcher detected in memory..." echo "" $sleep echo " ...so it must have gotten killed already!" fi echo "" echo $line echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo $line if [ "$ics" -eq 0 ] && [ "$lname" = "android.process.acore" ] && [ ! "$diehard" ] || [ ! "$HL" ]; then echo "" $sleep echo " Is Home is \"Locked in Memory\"?" echo "" $sleep echo " If it is, Enter Y for Yes, any key for No..." echo "" $sleep echo -n " Just say \"No\" if you don't know: " read homelocked echo "" case $homelocked in y|Y)HL=$VA echo " WHAT? You need to disable that feature!";; *)HL=$homeadj echo " Good Stuff!";; esac echo "" echo $line fi if [ -f "/sdcard/V6_SuperCharger/SuperChargerAdj" ] && [ ! "`grep "SuperCharger" /system/build.prop`" ]; then resuperable=indeed; newsupercharger=woohoo

echo "" $sleep echo " Oh wait... Did you flash a new ROM or kernel?" echo "" $sleep echo " I Will Automagically..." echo "" $sleep echo $line echo " Run The Re-SuperCharger!!" echo $line echo "" $sleep echo " This lets you restore settings and scripts..." echo "" $sleep echo " ...without overwriting your new system files!" echo "" $sleep echo " You may need to install separately..." echo "" $sleep echo " ...a Launcher, Nitro Lag Nullifier & 3G Turbo." echo "" elif [ "$firstgear" ]; then echo " Hey Rookie!!" echo $line echo "" $sleep echo " First Time SuperChargers..." echo "" $sleep echo " ...will make a Pit Stop in..." echo "" $sleep echo " ...Driver Options!" echo "" elif [ "$missingoptions" ]; then echo " Missing Some NEW Options!!" echo $line echo "" $sleep echo " You need to refresh them so..." echo "" $sleep echo " ...gonna make a Pit Stop in..." echo "" $sleep echo " ...Driver Options!" echo "" else echo " Prior scrolling speed of $speed had been set..." echo $line $sleep if [ "$ics" -eq 0 ]; then if [ "$buildprop" -eq 0 ]; then echo " LOCAL.PROP to be used f or SuperCharging!" else echo " BUILD.PROP to be used for SuperCharging!" fi echo $line

$sleep if [ "$launcheradj" -eq 0 ]; then echo " SuperCharged Launcher Option is BulletProof!!" elif [ "$launcheradj" -eq 2 ]; then echo " SuperCharged Launch er Option is Hard To Kill!" else echo " SuperCharged Launcher Option is... Die-Hard!!" fi echo $line $sleep fi echo -n " Miscellaneous Tweaks & 3G Enhancements - " if [ "$misc3g" -eq 0 ]; then echo "NO!" else echo "YES!" fi echo $line $sleep if [ -d "/system/etc/init.d" ]; then echo -n " Fix Emissions (Fixes FCs) Runs On Boot - " if [ "$fixemissions" -eq 0 ]; then echo "NO!" else echo "YES!" fi echo $line $sleep echo -n " Wheel Alignment(ZipAlign) Runs On Boot - " if [ "$zepalign" -eq 0 ]; then echo "NO!" else echo "YES!" fi echo $line $sleep echo -n " Detailing(Clean Database) Runs On Boot - " if [ "$detailing" -eq 0 ]; then echo "NO!" else echo "YES!" fi echo $line $sleep if [ "$ics" -eq 0 ]; then if [ "$initrc" -eq 1 ]; then echo " System Integration of $initrcpath1 is O N..." echo $line echo "" $sleep echo " Go to Driver Options and DISABLE..." echo "" $sleep echo " ...if you have root/permission is sues!" else echo " System Integration of $initrcpath1 is O FF..." echo $line echo "" $sleep echo " Go to Driver Options and ENABLE..." echo "" $sleep echo " ...for greater System Integra tion!" fi echo ""

echo $line $sleep fi fi echo "" echo " All settings can be changed in Driver Options!" echo "" $sleep echo $line echo " Note: You can bake $initrcpath into your ROM!" fi 2>/dev/null echo $line echo "" $sleep chmod 777 /sys/module/lowmemorykiller/parameters/minfree chmod 777 /sys/module/lowmemorykiller/parameters/adj echo -n " Press the Enter Key... and Come Get Some!!" read getsome while :; do MB0=4;MB1=0;MB2=0;MB3=0;MB4=0;MB5=0;MB6=0 SL0=0;SL1=0;SL2=0;SL3=0;SL4=0;SL5=0;SL6=0 scpercent=0;newlauncher=0;showbuildpropopt=0;break=0;restore=0;quickcharge=0;ca lculatorcharge=0;revert=0;ReSuperCharge=0;UnSuperCharged=0;UnSuperChargerError=0 ;UnIScream=;SuperChargerScriptManagerHelp=0;SuperChargerHelp=0;vroomverifier=;bp blind=;low=w;ldone= currentminfree=`cat /sys/module/lowmemorykiller/parameters/minfree` currentadj=`cat /sys/module/lowmemorykiller/parameters/adj` ram2=`$low$memory "$0" | awk '{print $1}'` if [ -f "/data/V6_SuperCharger/SuperChargerAdj" ]; then scadj=`cat /data/V6_Sup erCharger/SuperChargerAdj`; fi if [ -f "/data/V6_SuperCharger/SuperChargerMinfree" ]; then scminfree=`cat /dat a/V6_SuperCharger/SuperChargerMinfree`; fi if [ -f "/data/V6_SuperCharger/SuperChargerCustomMinfree" ]; then sccminfree=`c at /data/V6_SuperCharger/SuperChargerCustomMinfree`; fi if [ -f "/data/V6_SuperCharger/BulletProof_Apps_HitList" ]; then bpapplist=`cat /data/V6_SuperCharger/BulletProof_Apps_HitList`; fi for rc in $allrcpaths; do if [ -f "$rc.unsuper" ]; then allrcbackups="$allrcbackups $rc.unsuper"; fi if [ "`grep "super_service" $rc`" ]; then scservice="scsinstalled"; else scservice=; fi if [ "`grep "bullet_service" $rc`" ]; then bpservice="bpsinstalled"; els e bpservice=; fi done if [ "$opt" -ne 69 ]; then echo ""; else $sleep; fi echo $line echo " For Help & Info, see /sdcard/!SuperCharger.html" echo $line $sleep busybox echo " \\\\\\\\ T H E V 6 S U P E R C H A R G E R ////" echo " ============================================" busybox echo " \\\\\\\\ Driver's Console ////" echo " ==============================" echo "" echo "1. SuperCharger & Launcher Status {Update 9 RC9}" echo " }" echo "==================== 256 HP ====================" echo "2. UnLedded (Multitasking){8,12,22,24,26,28 MB}" echo "3. Ledded (Balanced){8,12,26,28,30,32 MB}" echo "4. Super UL (Aggressive){8,12,28,30,35,50 MB}"

echo " }" echo "==================== 512 HP ====================" echo "5. UnLedded (Multitasking){8,14,40,50,60, 75 MB}" echo "6. Ledded (Balanced){8,14,55,70,85,100 MB}" echo "7. Super UL (Aggressive){8,14,75,90,95,125 MB}" echo " }" echo "=================== 768+ HP ====================" echo "8. Super 768HP(Aggressive){8,16,150,165,180,200}" echo "9. Super 1000HP(Agressive){8,16,200,220,240,275}" echo " }" echo $line echo -n "10. Quick V6 Cust-OOMizer " if [ "$sccminfree" ]; then echo $sccminfree | awk -F , '{print "{"$1/256","$2/2 56","$3/256","$4/256","$5/256","$6/256"}"}' else echo " {Create Or Restore!}" fi echo $line echo "11. OOM Grouping Fixes + Hard To Kill Launcher }" echo "12. OOM Grouping Fixes + Die-Hard Launcher }" echo "13. OOM Grouping Fixes + BulletProof Launcher }" echo $line echo "14. UnKernelizer {UnDo Kernel/VM Tweaks}" echo "15. UnSuperCharger {UnDo Everything}" echo $line echo "16. The bOOM Stick {Verify OOM Groupings}" echo "17. BulletProof Apps {Hit or Miss}" echo "18. Engine Flush {ReCoupe RAM & Kill Lag}" echo "19. Detailing {Vacuum & Reindex SQL DBs}" echo "20. Wheel Alignment {ZipAlign APKs}" echo "21. Fix Emissions {Fix FCing Errors}" echo "22. Nitro Lag Nullifier {Experimental}" echo $line echo "23. System Installer {Terminal Usage}" echo "24. Re-SuperCharger {Restore V6 Settings}" echo "25. ICS Service Centre {Install services.jar}" echo "26. PowerShifting {Switch Presets FAST!}" echo $line echo "27. Owner's Guide {Open !SuperCharger.html}" echo "28. Help Centre {Open XDA SC Thread}" echo "29. Driver Options {Settings}" echo "30. SuperCharge You {Really!}" echo "31. ReStart Your Engine {Reboot Instantly}" echo "32. SuperClean & ReStart {Wipe Dalvik & Reboot}" echo "33. Eject {Exit}" echo $line busybox echo " \\\\\\\\ The One and ONLY OOM Fixer! ////" echo " ============================================" if [ "$ran" -eq 0 ] && [ ! "$resuperable" ]; then echo " So is it working? READ MESSAGES BELOW ;^]" echo $line echo " The Next 4 Sections Are Worth 25% Each!" echo $line fi echo "" echo -n " Launcher is" if [ "$ics" -eq 1 ] && [ ! "$icssced" ]; then echo " on ICeS .... so.... weak.. .. :("; status=4 elif [ "$HL" -gt "$VA" ]; then echo ".... so.... weak.... :("; status=4 elif [ "$HL" -eq "$VA" ]; then echo " Locked In Memory ie. Very Weak!"; status= 3

else oomstick=1; scpercent=$(($scpercent+25)) if [ "$HL" -eq "$FA" ]; then echo -n " BULLETPROOF ="; status=0 elif [ "$HL" -eq "$(($FA+1))" ]; then echo -n " DIE-HARD! ie."; status=1 else echo -n " HARD TO KILL="; status=2 fi echo -n " SUPERCHARGED" if [ "$ran" -eq 1 ]; then echo "!" else echo "! $scpercent%" fi fi echo "" echo $line sleep 2 echo -n " SuperCharger ADJ Entries " if [ "$icssced" ]; then ADJs=1; scpercent=$(($scpercent+25)) echo -n "ARE Patched In" if [ "$ran" -eq 1 ]; then echo "!" else echo "! $scpercent%" fi elif [ "$ics" -eq 1 ]; then echo "ARE NOT Patched In" echo " Select The \"ICS Service Centre\" Option!" elif [ "`grep "V6 SuperCharger" /system/build.prop`" ]; then ADJs=1; scpercent= $(($scpercent+25)) echo -n "in build.prop" if [ "$ran" -eq 1 ]; then echo "!" else echo "! $scpercent%" fi elif [ -f "/data/local.prop" ] && [ "`grep "V6 SuperCharger" /data/local.prop`" ]; then ADJs=1; scpercent=$(($scpercent+25)) echo -n "in local.prop" if [ "$ran" -eq 1 ]; then echo "!" else echo "! $scpercent%" fi else echo "NOT Found!" fi echo $line if [ "$currentadj" = "$newscadj" ] || [ "$currentadj" = "$oldscadj1" ] || [ "$c urrentadj" = "$oldscadj2" ] || [ "$currentadj" = "$oldscadj3" ] || [ "$currentad j" = "$oldscadj4" ] || [ "$currentadj" = "$scamadj1" ]; then OOMs=1; scpercent=$ (($scpercent+25)) if [ "$currentadj" != "$newscadj" ]; then echo "" echo " NON-SuperCharger OOM Grouping In Effect $scpercent%" echo "" if [ "$currentadj" = "$scamadj1" ]; then echo " ...and the Launcher Is NOT \"Non-Killable\"!" echo " If you thought it was, you were mislead..." echo "" echo " Apps simply got moved up a slot..." echo " ...so the minfrees become less aggressive!" echo "" echo $line echo " So there's NOTHING \"Non-Killable\" About It!" fi echo $line elif [ ! "$scadj" ] && [ "$ran" -eq 0 ]; then echo " OOM Grouping Fixe s ARE In Effect! $scpercent%"; echo $line fi elif [ "$currentadj" = "$scamadj2" ]; then echo " Found \"Stockish\" OOM Grouping..."

echo " echo $line

...which basically does nothing :P"

fi if [ "$ran" -eq 1 ]; then scpercent=$(($scpercent+25)) else if [ "$scadj" ] && [ "$status" -eq 3 ]; then echo "" echo " Home Launcher is \"Locked in Memory\"!" echo " You need to DISABLE this shi... feature..." echo " ...In both ROM and Launcher settings!" elif [ "$ics" -eq 1 ] && [ ! "$icssced" ]; then echo "" echo " SuperCharged Launcher is not in effect..." echo " ICS WON'T load values from a prop file :(" echo " You can do it with a SERVICES.JAR patch..." echo " Just select the \"ICS Service Centre\" Option!" echo " ...See the XDA Thread for more info." elif [ "$ics" -eq 0 ] && [ "$scadj" ] && [ "$oomstick" -eq 0 ] && [ "$bu ildprop" -eq 0 ]; then echo "" echo " SuperCharged Launcher Is NOT In Effect!" echo " You may need to use the build.prop option..." echo " Select 2 - 12 from the menu NOW to access it!" showbuildpropopt=1 fi if [ "$ics" -eq 0 ] && [ "$scadj" ] && [ "$oomstick" -eq 0 ] && [ "$buil dprop" -eq 0 ] || [ "$ics" -eq 1 ] && [ ! "$icssced" ]; then echo ""; echo $line ; fi if [ "$scadj" ] && [ "$currentadj" != "$scadj" ]; then echo "" echo " OOM Grouping Fixes ARE NOT In Effect!" echo " That means the boot script did NOT run..." echo " Select \"Owner's Guide\" on menu for Repairs!" elif [ "$scadj" ] && [ "$currentadj" = "$scadj" ]; then echo "" echo " OOM Grouping Fixes ARE In Effect! $scpercent%" echo " That means the boot script ran!" else newsupercharger=woohoo fi if [ "$ics" -eq 1 ] && [ ! "$icssced" ] || [ "$scadj" ]; then echo ""; e cho $line; fi if [ "$scminfree" ]; then echo ""; fi if [ "$scminfree" ] && [ "$currentminfree" != "$scminfree" ]; then echo " Current Values DON'T MATCH Prior SuperCharge!" if [ -f "/data/Ran_SuperCharger.log" ]; then echo " Check /dat a/Ran_SuperCharger for boot info." else echo " The boot script *99SuperCharger did NOT run!" fi echo " Select \"Owner's Guide\" on menu for Repairs!" elif [ "$scminfree" ] && [ "$currentminfree" = "$scminfree" ]; then minf rees=1; scpercent=$(($scpercent+25)) echo -n " Current Values MATCH Prior SuperCharge!" if [ "$scpercent" -lt 100 ]; then echo " $scpercent%" else echo " $scpercent%" fi echo " That means that it's working! ;)" fi fi if [ ! "$scminfree" ]; then echo " SuperCharger Minfrees NOT FOUND! Run 2 - 10!"

echo $line else echo ""; echo $line fi echo $currentminfree | awk -F , '{printf " Current Minfrees = %.0f,%.0f,%.0f, %.0f,%.0f,%.0f MB\n", $1/256, $2/256, $3/256, $4/256, $5/256, $6/256}' if [ "$scminfreeold" ]; then echo $scminfreeold | awk -F , '{print " Prior V6 Minfrees = "$1/256","$2/256","$3/256","$4/256","$5/256","$6/256" MB"}'; fi echo $line echo "" echo " You have $ram MB of RAM on your device..." if [ "$ram" -lt 256 ]; then echo -n " ...256 HP" calculatedmb="8, 12, $(($ram*11/100)), $(($ram*12/100)), $(($ram*13/100) ), $(($ram*14/100))" elif [ "$ram" -lt 512 ]; then echo -n " ...512 HP" calculatedmb="8, 12, $(($ram*11/100)), $(($ram*13/100)), $(($ram*15/100) ), $(($ram*17/100))" elif [ "$ram" -lt 768 ]; then echo -n " ...768 HP" calculatedmb="8, 14, $(($ram*15/100)), $(($ram*17/100)), $(($ram*19/100) ), $(($ram*21/100))" else echo -n " ...1000 HP" calculatedmb="8, 16, $(($ram*20/100)), $(($ram*22/100)), $(($ram*24/100) ), $(($ram*26/100))" fi calculatedminfree=`echo $calculatedmb | awk -F , '{print $1*256","$2*256","$3*2 56","$4*256","$5*256","$6*256}'` calculatedmbnosp=`echo $calculatedminfree | awk -F , '{print $1/256","$2/256"," $3/256","$4/256","$5/256","$6/256}'` echo " settings are recommended!" echo "" if [ "$currentminfree" != "$calculatedminfree" ]; then echo " -=SuperMinFree Calculator=- says:" echo "" echo " Cust-OOMize with $calculatedmb MB!" echo "" echo " Slot 3 Sets Free RAM & Is Your Task Killer!" echo "" else echo " BUT SuperMinFree Calculator Values are set..." echo "" echo $line echo " SO THAT'S COOL TOO!" fi echo $line if [ "$currentminfree" != "`cat /sdcard/V6_SuperCharger/SuperChargerMinfree`" ] && [ "$ran" -eq 0 ]; then echo " Re-SuperCharger Settings on SD Card..." echo "" awk -F , '{print " "$1/256", "$2/256", "$3/256", "$4/ 256", "$5/256", "$6/256" MB"}' /sdcard/V6_SuperCharger/SuperChargerMinfree echo $line fi 2>/dev/null if [ "$allrcpaths" ]; then echo "" echo " STOCK ROMS will benefit most from Services..." echo " ...since those builds have no init.d support!" echo "" if [ "$scservice" ] || [ "$bpservice" ] || [ ! "$scminfree" ]; then echo $line echo -n " SuperCharger Service is " if [ "$scservice" ]; then echo "Installed!"

else fi echo echo if [ else fi else

echo "NOT Installed!" $line -n " BulletProof Apps Service is " "$bpservice" ]; then echo "Installed!" echo "NOT Installed!"

if [ "$scpercent" -lt 100 ]; then echo $line; fi echo " Sorry, your ROM wipes service entries on boot." if [ "$scpercent" -eq 100 ]; then echo "" echo $line echo " You're 100% SuperCharged so it doesn't matter!" fi fi echo $line fi echo -n " Nitro Lag Nullifier is " if [ "`grep Nullifier /system/build.prop`" ]; then echo "Installed!" else echo "NOT Installed!" fi echo $line if [ ! -f "`ls /system/etc/init.d/*BulletProof_Apps*`" ] && [ ! -f "/data/97Bul letProof_Apps.sh" ]; then echo " BulletProof Apps Script is NOT Installed!" elif [ "`cat /proc/*/cmdline | grep Bullet`" != "Bullet" ]; then for i in `cat /proc/*/cmdline | grep Bullet`; do if [ "`echo $i | grep Proof`" ] && [ "`echo $i | grep Effect`" ] ; then echo " $i" elif [ "`echo $i | grep Proof`" ] && [ "`echo $i | grep init.d`" ]; then echo " `echo $i | sed 's/.*etc//'` is Running!" elif [ "`echo $i | grep Proof`" ] && [ "`echo $i | grep data`" ] ; then echo "$i is Running!" fi if [ "$i" != "Bullet" ]; then echo $line; fi done ldone=yes elif [ "`ls /system/etc/init.d/*BulletProof_Apps*`" ]; then echo " `ls /system/ etc/init.d/*BulletProof_Apps* | sed 's/.*etc//'` is NOT Running!" elif [ -f "/data/97BulletProof_Apps.sh" ]; then echo "/data/97BulletProof_Apps. sh is NOT Running!" fi 2>/dev/null if [ ! "$ldone" ]; then echo $line; fi echo "" if [ "$ics" -eq 1 ]; then echo " Lag? Disabling Compcache May Help!" else echo " Lag? Disable Lock Home in Memory & Compcache!" fi echo " Also Run Engine Flush Every Few Hours!" echo "" if [ "$smrun" ]; then echo " In Config, select Run as Root & Browse as Root!" echo " But DO NOT run this script at boot!" echo "" echo " For a quick status check..." echo " ...put a V6 SuperCharger WIDGET on the desktop!" else echo " Optimized for display with Script Manager." echo "" echo " SM can give you a quick status check..." echo " ...Put a V6 SuperCharger WIDGET on the desktop!"

echo " ...Try it! ;^]" fi echo "" echo $line ramkbytesfree=`free | awk '{ print $4 }' | sed -n 2p` ramkbytescached=`cat /proc/meminfo | grep Cached | awk '{print $2}' | sed -n 1p ` ramfree=$(($ramkbytesfree/1024));ramcached=$(($ramkbytescached/1024));ramreport edfree=$(($ramfree + $ramcached)) echo " True Free $ramfree MB = \"Free\" $ramreportedfree - Cached Apps $ramcach ed" echo $line echo " SuperCharger Level: $scpercent% SuperCharged!" echo $line if [ "$scpercent" -eq 0 ]; then echo " Hey Rookie! SCROLL UP to see the Menu Options!" echo $line elif [ "$ran" -eq 1 ] && [ "$scpercent" -lt 100 ]; then echo " Did it work? READ ABOVE MESSAGES AFTER REBOOT!" echo $line elif [ "$scpercent" -lt 100 ]; then if [ "$ADJs" -eq 0 ]; then echo " Lose 25% - ADJ Entries NOT Found / NOT Patched"; fi if [ "$oomstick" -eq 0 ]; then echo " Lose 25% - SuperCharged Launcher N OT In Effect"; fi if [ "$OOMs" -eq 0 ]; then echo " Lose 25% - OOM Grouping Fix(adj) NOT I n Effect"; fi if [ "$minfrees" -eq 0 ]; then echo " Lose 25% - SuperCharger Minfrees N OT In Effect"; fi echo $line fi $sleep if [ ! "$didsomething" ] && [ ! "$missingoptions" ] && [ ! "$resuperable" ] && [ "$scminfree" ] && [ "$currentminfree" != "$scminfree" ]; then echo "" echo " Values DON'T MATCH... Read The Owner's Guide!" echo "" echo $line echo "" $sleep su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start -a android.inten t.action.VIEW -n com.android.browser/.BrowserActivity -d file:///sdcard/!SuperCh arger.html" 2>/dev/null echo "" echo $line fi echo -n " Please Enter Option [1 - 33]: " if [ "$resuperable" ]; then opt=24; echo $opt elif [ "$firstgear" ] || [ "$missingoptions" ]; then opt=29; echo $opt elif [ "$autoshowcalculated" ]; then opt=10; echo $opt elif [ "$ics" -eq 1 ] && [ ! "$icssced" ] && [ "$scadj" ] && [ "$showicscentre" ]; then opt=25; echo $opt else read opt fi $sleep echo $line busybox echo " \\\\\\\\ V6 SUPERCHARGER ////" echo " =======================" echo "" $sleep

if [ "$opt" -gt 1 ] && [ "$opt" -le 29 ] || [ "$opt" -eq 32 ]; then didsomethin g=yes busybox mount -o remount,rw / 2>/dev/null busybox mount -o remount,rw rootfs 2>/dev/null busybox mount -o remount,rw /system 2>/dev/null busybox mount -o remount,rw `busybox mount | grep system | awk '{print $ 1,$3}' | sed -n 1p` 2>/dev/null if [ -d "/sqlite_stmt_journals" ]; then madesqlitefolder=0 else mkdir /sqlite_stmt_journals; madesqlitefolder=1 fi if [ "$opt" -ne 15 ]; then if [ ! "`grep "SuperCharger Installation" /system/build.prop`" ] ; then echo "# SuperCharger Installation Marker." >> /system/build.prop; fi if [ ! -d "/data/V6_SuperCharger/PowerShift_Scripts" ]; then mkd ir -p /data/V6_SuperCharger/PowerShift_Scripts; fi if [ ! -d "/data/V6_SuperCharger/BulletProof_One_Shots" ]; then mkdir /data/V6_SuperCharger/BulletProof_One_Shots; fi if [ ! -d "/sdcard/V6_SuperCharger/PowerShift_Scripts" ]; then m kdir -p /sdcard/V6_SuperCharger/PowerShift_Scripts; fi if [ ! -d "/sdcard/V6_SuperCharger/BulletProof_One_Shots" ]; the n mkdir /sdcard/V6_SuperCharger/BulletProof_One_Shots; fi if [ ! -d "/sdcard/V6_SuperCharger/temp" ]; then mkdir /sdcard/V 6_SuperCharger/temp; fi fi fi 2>/dev/null case $opt in 1) echo " V6 SUPERCHARGER AND LAUNCHER STATUS!";; 2) if [ "$ics" -eq 0 ]; then echo " 256HP UNLEDDED MINFREES +" else echo " 256HP UNLEDDED MINFREES SELECTED!" fi CONFIG="256HP UnLedd" MB1=8;MB2=12;MB3=22;MB4=24;MB5=26;MB6=28;; 3) if [ "$ics" -eq 0 ]; then echo " 256HP LEDDED MINFREES +" else echo " 256HP LEDDED MINFREES SELECTED!" fi CONFIG="256HP Ledded" MB1=8;MB2=12;MB3=26;MB4=28;MB5=30;MB6=32;; 4) if [ "$ics" -eq 0 ]; then echo " 256HP SUPER UNLEDDED MINFREES +" else echo " 256HP SUPER UNLEDDED MINFREES SELECTED!" fi CONFIG="256HP Super" MB1=8;MB2=12;MB3=28;MB4=30;MB5=35;MB6=50;; 5) if [ "$ics" -eq 0 ]; then echo " 512HP UNLEDDED MINFREES +" else echo " 512HP UNLEDDED MINFREES SELECTED!" fi CONFIG="512HP UnLedd" MB1=8;MB2=14;MB3=40;MB4=50;MB5=60;MB6=75;; 6) if [ "$ics" -eq 0 ]; then echo " 512HP LEDDED MINFREES +" else echo " 512HP LEDDED MINFREES SELECTED!" fi CONFIG="512HP Ledded" MB1=8;MB2=14;MB3=55;MB4=70;MB5=85;MB6=100;; 7) if [ "$ics" -eq 0 ]; then echo " 512HP SUPER UNLEDDED MINFREES +" else echo " 512HP SUPER UNLEDDED MINFREES SELECTED!" fi CONFIG="512HP Super" MB1=8;MB2=14;MB3=75;MB4=90;MB5=95;MB6=125;; 8) if [ "$ics" -eq 0 ]; then echo " 768HP SUPER UNLEDDED MINFREES +" else echo " 768HP SUPER UNLEDDED MINFREES SELECTED!" fi

if [ "$ram" -le 256 ]; then opt=26 echo $line $sleep echo " WHOA! There's NOT Enough RAM! lulz!" else CONFIG="768HP Super" MB1=8;MB2=16;MB3=150;MB4=165;MB5=180;MB6=200 fi;; 9) if [ "$ics" -eq 0 ]; then echo " 1000HP SUPER UNLEDDED MINFREES +" else echo " 1000HP SUPER UNLEDDED MINFREES SELECTED!" fi if [ "$ram" -le 256 ]; then opt=26 echo $line $sleep echo " WHOA! There's NOT Enough RAM! lulz!" else CONFIG="1000HP Super" MB1=8;MB2=16;MB3=200;MB4=220;MB5=240;MB6=275 fi;; 10)if [ "$ics" -eq 0 ]; then echo " CUST-OOMIZER MINFREES +" else echo " CUST-OOMIZER MINFREES SELECTED!" fi CONFIG="Cust-OOMized" echo $line echo "" $sleep echo " Your Current Minfree values are..." echo "" $sleep echo $currentminfree | awk -F , '{printf " %.0f, %.0f, %. 0f, %.0f, %.0f, %.0f MB\n", $1/256, $2/256, $3/256, $4/256, $5/256, $6/256}' echo "" $sleep echo " Your SuperMinFree Calculator values are..." echo "" $sleep echo " $calculatedmb MB" echo "" if [ "$sccminfree" ]; then $sleep echo " Your Prior Cust-OOMizer values are..." echo "" $sleep echo $sccminfree | awk -F , '{print " "$1/256", "$ 2/256", "$3/256", "$4/256", "$5/256", "$6/256" MB"}' echo "" fi if [ "$scminfreeold" ] && [ "$currentminfree" != "$scminfreeold" ]; the n $sleep echo " Your Prior V6 Minfrees are..." echo "" $sleep echo $scminfreeold | awk -F , '{print " "$1/256", "$2/256", "$3/256", "$4/256", "$5/256", "$6/256" MB"}' echo "" fi echo $line if [ "$sccminfree" ] && [ "$currentminfree" != "$sccminfree" ] && [ "$c alculatedminfree" != "$sccminfree" ] && [ ! "$autoshowcalculated" ]; then

echo "" $sleep echo " Restore Previous Cust-OOMizer Settings?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read crestore echo "" echo $line case $crestore in y|Y)restore=1 MB1=`echo $sccminfree | awk -F , '{print $1/256}'`;MB2 =`echo $sccminfree | awk -F , '{print $2/256}'`;MB3=`echo $sccminfree | awk -F , '{print $3/256}'`;MB4=`echo $sccminfree | awk -F , '{print $4/256}'`;MB5=`echo $sccminfree | awk -F , '{print $5/256}'`;MB6=`echo $sccminfree | awk -F , '{prin t $6/256}'` echo " Cust-OOMizer Settings will be Restored!";; *);; esac fi if [ "$currentminfree" != "$calculatedminfree" ] && [ "$calculatedminfr ee" != "$scminfree" ] && [ "$restore" -eq 0 ]; then echo "" $sleep echo " Apply SuperMinFree Calculator Settings?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read calculated echo "" echo $line case $calculated in y|Y)calculatorcharge=1 CONFIG="Calculator" MB1=`echo $calculatedmbnosp | awk -F , '{print $1}'`;M B2=`echo $calculatedmbnosp | awk -F , '{print $2}'`;MB3=`echo $calculatedmbnosp | awk -F , '{print $3}'`;MB4=`echo $calculatedmbnosp | awk -F , '{print $4}'`;MB 5=`echo $calculatedmbnosp | awk -F , '{print $5}'`;MB6=`echo $calculatedmbnosp | awk -F , '{print $6}'` echo " Cust-OOMizing with SuperMinFree Calculator!";; *)if [ "$autoshowcalculated" ]; then echo " Well... I tr ied to do you a favour... sheesh!"; fi;; esac fi 2>/dev/null if [ "$scminfreeold" ] && [ "$currentminfree" != "$scminfreeold" ] && [ "$sccminfree" != "$scminfreeold" ] && [ "$calculatedminfree" != "$scminfreeold" ] && [ "$restore" -eq 0 ] && [ "$calculatorcharge" -eq 0 ] && [ ! "$autoshowcal culated" ]; then echo "" $sleep echo " Revert to Prior V6 Minfrees?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read prior echo "" echo $line case $prior in y|Y)revert=1 MB1=`echo $scminfreeold | awk -F , '{print $1/256}'`;M

B2=`echo $scminfreeold | awk -F , '{print $2/256}'`;MB3=`echo $scminfreeold | aw k -F , '{print $3/256}'`;MB4=`echo $scminfreeold | awk -F , '{print $4/256}'`;MB 5=`echo $scminfreeold | awk -F , '{print $5/256}'`;MB6=`echo $scminfreeold | awk -F , '{print $6/256}'` echo " Prior V6 Minfrees will be Restored!";; *);; esac fi 2>/dev/null if [ "$currentminfree" != "$sccminfree" ] && [ "$currentminfree" != "$s cminfree" ] && [ "$restore" -eq 0 ] && [ "$calculatorcharge" -eq 0 ] && [ "$reve rt" -eq 0 ] && [ ! "$autoshowcalculated" ]; then echo "" $sleep echo " Apply Quick SuperCharge of Current Minfrees?" echo "" $sleep echo " If Yes, these become your Cust-OOMizer values." echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read quick echo "" echo $line case $quick in y|Y)quickcharge=1 MB1=`echo $currentminfree | awk -F , '{printf "%.0f\n" , $1/256}'`;MB2=`echo $currentminfree | awk -F , '{printf "%.0f\n", $2/256}'`;MB 3=`echo $currentminfree | awk -F , '{printf "%.0f\n", $3/256}'`;MB4=`echo $curre ntminfree | awk -F , '{printf "%.0f\n", $4/256}'`;MB5=`echo $currentminfree | aw k -F , '{printf "%.0f\n", $5/256}'`;MB6=`echo $currentminfree | awk -F , '{print f "%.0f\n", $6/256}'` echo " Quick Cust-OOMizer Settings will be Saved!";; *);; esac fi 2>/dev/null if [ "$restore" -eq 0 ] && [ "$calculatorcharge" -eq 0 ] && [ "$quickch arge" -eq 0 ] && [ "$revert" -eq 0 ] && [ ! "$autoshowcalculated" ]; then echo " Running Cust-OOMizer..." echo $line $sleep busybox echo " \\\\\\\\ V6 CUST-OOMIZER ////" echo " =======================" echo "" $sleep echo " Enter your desired lowmemorykiller OOM levels!" echo "" $sleep echo " Slot 3 determines your fee RAM the most!!" echo "" $sleep echo " Note: Enter \"X\" to Exit at any time ;^]" echo "" echo $line echo "" $sleep while [ "$break" -eq 0 ]; do echo -n " Slot 1: ";read MB1 if [ "$MB1" = "X" ] || [ "$MB1" = "x" ]; then break=1 elif [ "$MB1" -gt 0 ] 2>/dev/null; then break else echo " Input Error! Try again

:p";sleep 2; fi done while [ "$break" -eq 0 ]; echo -n " if [ "$MB2" = "X" elif [ "$MB2" -gt else echo " Input :p";sleep 2; fi done while [ "$break" -eq 0 ]; echo -n " if [ "$MB3" = "X" elif [ "$MB3" -gt else echo " Input :p";sleep 2; fi done while [ "$break" -eq 0 ]; echo -n " if [ "$MB4" = "X" elif [ "$MB4" -gt else echo " Input :p";sleep 2; fi done while [ "$break" -eq 0 ]; echo -n " if [ "$MB5" = "X" elif [ "$MB5" -gt else echo " Input :p";sleep 2; fi done while [ "$break" -eq 0 ]; echo -n " if [ "$MB6" = "X" elif [ "$MB6" -gt else echo " Input :p";sleep 2; fi done echo "" if [ "$break" -eq 0 ]; then $sleep echo $line echo " CONFIRM! $MB1, $MB2, $MB3, $MB4, $MB5, $MB6 MB?" echo $line echo "" $sleep echo -n " Enter N for No, any key for Yes: " read custOOM echo "" case $custOOM in n|N)opt=26;; *)echo $line echo " Cust-OOMizer Settings Accepted!" ;; esac fi fi if [ "$break" -eq 1 ] || [ "$MB1" -eq 0 ]; then opt=26; fi autoshowcalculated=;; 11)echo " OOM GROUPING FIXES PLUS..." echo "" do Slot 6: ";read MB6 ] || [ "$MB6" = "x" ]; then break=1 0 ] 2>/dev/null; then break Error! Try again do Slot 5: ";read MB5 ] || [ "$MB5" = "x" ]; then break=1 0 ] 2>/dev/null; then break Error! Try again do Slot 4: ";read MB4 ] || [ "$MB4" = "x" ]; then break=1 0 ] 2>/dev/null; then break Error! Try again do Slot 3: ";read MB3 ] || [ "$MB3" = "x" ]; then break=1 0 ] 2>/dev/null; then break Error! Try again do Slot 2: ";read MB2 ] || [ "$MB2" = "x" ]; then break=1 0 ] 2>/dev/null; then break Error! Try again

echo " ...HARD TO KILL LAUNCHER!" $sleep echo $line echo " This Launcher Is Strong BUT Still Killable" echo $line echo "" $sleep if [ "$gb" -eq 1 ]; then launcheradj=2 echo "$speed,$buildprop,$animation,$initrc,$launcheradj,$fixemis sions,$zepalign,$detailing,$misc3g" > /data/V6_SuperCharger/SuperChargerOptions cp -fr /data/V6_SuperCharger/SuperChargerOptions /sdcard/V6_Supe rCharger/SuperChargerOptions echo $line echo " Driver Options Updated!" else if [ "$ics" -eq 1 ]; then echo " The script CAN'T SuperCharge launchers on ICS!" echo "" $sleep echo " It can only apply adj/Grouping Fixes..." echo "" $sleep echo " ...and other tweaks!" echo "" $sleep echo $line if [ "$icssced" ]; then echo " Hey your services.jar is patched so who cares!" else echo " Select The \"ICS Service Centre\" Option Ne xt!" fi else opt=26 echo " Sorry, Hard To Kill Launcher..." echo "" $sleep echo " ...is not available on this ROM..." echo "" fi fi;; 12)echo " OOM GROUPING FIXES PLUS..." echo "" echo " ...DIE-HARD LAUNCHER!" $sleep echo $line echo " This Launcher Is Stronger and RECOMMENDED!" echo $line echo "" $sleep if [ "$ics" -eq 1 ]; then echo " The script CAN'T SuperCharge launchers on ICS!" echo "" $sleep echo " It can only apply adj/Grouping Fixes..." echo "" $sleep echo " ...and other tweaks!" echo "" $sleep echo $line if [ "$icssced" ]; then echo " Hey your services.jar is patched

so who cares!" else echo " Select The \"ICS Service Centre\" Option Next!" fi else launcheradj=1 echo "$speed,$buildprop,$animation,$initrc,$launcheradj,$fixemis sions,$zepalign,$detailing,$misc3g" > /data/V6_SuperCharger/SuperChargerOptions cp -fr /data/V6_SuperCharger/SuperChargerOptions /sdcard/V6_Supe rCharger/SuperChargerOptions echo $line echo " Driver Options Updated!" fi;; 13)echo " OOM GROUPING FIXES PLUS..." echo "" echo " ...BULLETPROOF LAUNCHER!" $sleep echo $line echo " This Launcher Is Strongest and UNKILLABLE!" echo $line echo "" $sleep if [ "$ics" -eq 1 ]; then echo " The script CAN'T SuperCharge launchers on ICS!" echo "" $sleep echo " It can only apply adj/Grouping Fixes..." echo "" $sleep echo " ...and other tweaks!" echo "" $sleep echo $line if [ "$icssced" ]; then echo " Hey your services.jar is patched so who cares!" else echo " Select The \"ICS Service Centre\" Option Next!" fi else echo " ==================" busybox echo " \\\\\\ WARNING! ///" echo " ==============" echo "" $sleep echo $line echo " This Breaks \"Long-Press Back To Kill\"!" echo $line echo "" $sleep echo " If you don't have or don't use this feature..." echo "" $sleep echo " ...or don't know what it is - just say \"Yes\" ;)" echo "" echo $line echo "" $sleep echo " Note: This is Gaming UN-FRIENDLY!!" echo "" echo $line echo "" $sleep echo -n " BulletProof? Enter Y for Yes, any key for No:"

read breakback echo "" echo $line case $breakback in y|Y)launcheradj=0 echo "$speed,$buildprop,$animation,$initrc,$launcherad j,$fixemissions,$zepalign,$detailing,$misc3g" > /data/V6_SuperCharger/SuperCharg erOptions cp -fr /data/V6_SuperCharger/SuperChargerOptions /sdca rd/V6_SuperCharger/SuperChargerOptions echo " Driver Options Updated!" echo $line echo "" $sleep echo $line echo " Break Back Button... erm... BulletProofing!";; *)echo " OK... Die-Hard Launcher Is Great Anyway!" opt=26;; esac fi;; 14)echo " ====================" busybox echo " //// UNKERNELIZER \\\\\\\\" if [ ! -f "`ls /system/etc/init.d/*SuperCharger*`" ] && [ ! -f "`ls /da ta/*SuperCharger*`" ] && [ ! -f "$initrcpath" ] && [ ! -f "$initrcbackup" ] && [ ! "$allrcbackups" ]; then echo $line $sleep echo " There's Nothing to UnKernelize!" opt=26 fi 2>/dev/null;; 15)echo " =======================" busybox echo " //// UN-SUPERCHARGER \\\\\\\\" echo $line echo "" $sleep echo -n " :|" sleep 3 echo -n " !@#?&%(*)(*)&(!)?!" sleep 3 echo " :/" sleep 3 echo "" echo $line echo "" echo " WHAT? UnSuperCharge? Are you sure?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read unsuper echo "" echo $line case $unsuper in y|Y)echo " Well... okay then... be like that! :p";; *)echo " False alarm... *whew*" opt=26;; esac;; 16)echo " =======================" busybox echo " //// THE bOOM STICK! \\\\\\\\";; 17)echo " ========================" busybox echo " //// BULLETPROOF APPS \\\\\\\\";;

18)echo " ====================" busybox echo " //// ENGINE FLUSH \\\\\\\\";; 19)echo " =================" busybox echo " //// DETAILING \\\\\\\\";; 20)echo " =======================" busybox echo " //// WHEEL ALIGNMENT \\\\\\\\";; 21)echo " =====================" busybox echo " //// FIX EMISSIONS \\\\\\\\";; 22)echo " ===========================" busybox echo " //// NITRO LAG NULLIFIER \\\\\\\\";; 23)echo " ======================" busybox echo " //// SYSTEM INSTALL \\\\\\\\";; 24)echo " =======================" busybox echo " //// RE-SUPERCHARGER \\\\\\\\";; 25)echo " ==========================" busybox echo " //// ICS SERVICE CENTRE \\\\\\\\" if [ "$ics" -eq 0 ]; then opt=26 echo $line echo "" $sleep echo " FAIL: This isn't an ICS ROM! lol" echo "" fi;; 26)echo " =====================" busybox echo " //// POWERSHIFTING \\\\\\\\" echo $line echo "" $sleep echo " Now you can quickly switch minfree settings!" echo "" $sleep echo " When you run a preset or the Cust-OOMizer..." echo "" $sleep echo " ...a PowerShift Script..." echo "" $sleep echo " ...is saved to your SD Card!" echo "" echo $line $sleep echo " You can find them in the folder..." echo "" $sleep echo " .../data/V6_SuperCharger/PowerShift_Scripts :D" echo $line echo "" $sleep echo " Create \"Quick Widgets\" for them..." echo "" $sleep echo " ...and PowerShift between settings!" echo "" $sleep echo $line echo " They will also be your new SuperCharger values!" echo $line echo "" $sleep echo " They will have descriptive names..."

echo "" $sleep echo " ...indicating minfree values." echo "" $sleep echo " Different Cust-OOMizer settings will be saved!" echo "";; 27)echo " =====================" busybox echo " //// Owner's Guide \\\\\\\\" echo $line echo "" $sleep echo " Loading Owner's Guide..." echo "" $sleep su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start -a android.inte nt.action.VIEW -n com.android.browser/.BrowserActivity -d file:///sdcard/!SuperC harger.html" echo "" echo $line echo "" $sleep echo " I hope that helped! :^)" echo "";; 28)echo " ===================" busybox echo " //// HELP CENTRE \\\\\\\\" echo $line echo "" $sleep echo " Loading web site for more help & updates..." echo "" $sleep su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/q M6yR" echo "" echo $line echo "" $sleep echo " I hope that helped! :^)" echo "";; 29)echo " ======================" busybox echo " //// DRIVER OPTIONS \\\\\\\\" echo $line echo "" $sleep echo " Scrolling Speed Options..." echo " ==========================" echo "" $sleep if [ "$scpercent" -lt 100 ]; then echo -n " " else echo -n " 0 (no delay), " fi echo "1 (fast), 2 (normal), 3 (slow)" while :; do echo "" $sleep if [ "$scpercent" -lt 100 ]; then echo -n " Please select scroll ing speed (1 - 3): " else echo -n " Please select scrolling speed (0 - 3): " fi

read speed echo "" case $speed in 0)sleep="sleep $speed";break;; 1)sleep="sleep $speed";break;; 2)sleep="sleep $speed";break;; 3)sleep="sleep $speed";break;; *)echo " Invalid entry... Please try again :p";; esac done echo $line echo " Scrolling Speed is now set to $speed..." echo $line echo "" $sleep if [ "$ics" -eq 0 ]; then echo " Build.prop vs Local.prop..." echo " ===========================" echo "" $sleep echo $line if [ ! "$buildprop" ] && [ ! -f "/data/local.prop" ]; then echo " WARNING: You don't have a /data/local.prop!" echo $line echo "" $sleep echo " You can try creating /data/local.prop..." echo "" $sleep echo " ...and see if the launcher gets SuperCharged!" echo "" $sleep echo $line fi echo " Using local.prop is STRONGLY recommended!" echo $line echo "" $sleep echo " But if the launcher DOES'T get SuperCharged..." echo "" $sleep echo " You can apply MEM and ADJ values..." echo "" $sleep echo " ...to build.prop instead of local.prop!" echo "" $sleep echo " This is more likely to stick but is RISKIER..." echo "" $sleep echo $line echo " WARNING: There is a small chance of bootloops!" echo "" $sleep echo " ...so have a backup available!" echo $line echo "" $sleep echo -n " Do you want to use Build.prop" if [ ! "$buildprop" ] && [ ! -f "/data/local.prop" ]; then

echo "..." echo "" $sleep echo " ...or create /data/local.prop?" else echo "?" fi echo "" $sleep buildpropold=$buildprop echo -n " Enter (B)uild.prop or any key for local.prop:" read buildpropopt echo "" echo $line case $buildpropopt in b|B)echo " Okay! build.prop Mode Activated!" buildprop=1;; *)echo " Okay! local.prop Mode Activated!" buildprop=0;; esac echo $line echo "" $sleep showbuildpropopt=0 if [ "$buildpropold" ] && [ "$buildprop" != "$buildpropold" ]; t hen if [ "$buildpropold" -eq 1 ]; then sed -n '/.*V6 SuperCharger/,/.*V6 SuperCharged/p ' /system/build.prop >> /data/local.prop echo " Copied SuperCharger entries to local.prop ..." echo "" $sleep sed -i '/.*V6 SuperCharger/,/.*V6 SuperCharged/d ' /system/build.prop echo " ...and cleaned SuperCharger from build. prop!" elif [ -f "/data/local.prop" ]; then sed -n '/.*V6 SuperCharger/,/.*V6 SuperCharged/p ' /data/local.prop >> /system/build.prop echo " Copied SuperCharger entries to build.prop ..." echo "" $sleep sed -i '/.*V6 SuperCharger/,/.*V6 SuperCharged/d ' /data/local.prop echo " ...and cleaned SuperCharger from local. prop!" fi echo "" echo $line echo "" $sleep fi echo -n " Press The Enter Key..." read enter echo "" echo $line echo "" $sleep echo " SuperCharged Launcher Strength"

echo " ==============================" echo "" $sleep if [ "$gb" -eq 1 ]; then echo " Hard To Kill Launcher is..." echo "" $sleep echo " ...Strong BUT Still Killable!" echo "" $sleep fi echo " Die-Hard Launcher is..." echo "" $sleep echo " ...VERY Strong and RECOMMENDED!" echo "" $sleep echo " BulletProof Launcher is..." echo "" $sleep echo " ...Strongest and UNKILLABLE!" echo "" $sleep echo " =======================================" busybox echo " \\\\\\ BULLETPROOF LAUNCHER WARNING! ///" echo " ===================================" echo "" $sleep echo $line echo " This Breaks \"Long-Press Back To Kill\"!" echo $line echo "" $sleep echo " If you don't have or don't use this feature..." echo "" $sleep echo " ...don't worry about it ;)" echo "" $sleep echo $line echo " Note: It is also Gaming UN-FRIENDLY!" while :; do echo $line echo "" $sleep echo " Select a Launcher Strength..." echo "" if [ "$gb" -eq 0 ]; then echo -n " " else echo -n " (H)TK, " fi echo -n "(B)ulletProof, any key for Die-Hard: " read lstrength echo "" echo $line case $lstrength in h|H)if [ "$gb" -eq 0 ]; then echo " Invalid entry ... Please try again :p" else echo " SuperCharged Launcher Strength is Hard To Kill!" launcheradj=2

break fi;; b|B)echo " SuperCharged Launcher Strength is BulletPro of!" launcheradj=0 break;; *)echo " SuperCharged Launcher Strength is DieHard!" launcheradj=1 break;; esac done if [ "$buildprop" -eq 1 ]; then prop="/system/build.prop" else prop="/data/local.prop" fi for p in /system/etc/ram.conf $prop; do if [ -f "$p" ]; then sed -i 's/ro.HOME_APP_ADJ=.*/ro.HOM E_APP_ADJ='$launcheradj/ $p; fi done echo $line echo "" $sleep else buildprop=1; launcheradj=1 fi echo " Miscellaneous & 3G Tweaks!" echo " ==========================" echo "" $sleep echo " SuperCharger can apply additional tweaks..." echo "" $sleep echo " ...which include battery savings!" echo "" $sleep echo " They are as follows..." echo "" echo $line echo "" $sleep echo " persist.sys.purgeable_assets = 1" echo " wifi.supplicant_scan_interval = 180" echo " windowsmgr.max_events_per_sec = 200" echo " pm.sleep_mode = 1" echo "" echo $line echo "" $sleep echo " 3G TurboCharger Enhancements effect..." echo "" $sleep echo " ...network buffersizes and TCP RAM allocation!" echo "" echo $line if [ "$scpercent" -eq 0 ]; then echo " An Option from 2 - 13 still needs to be run!" echo $line fi echo "" $sleep for p in /data/local.prop /system/build.prop; do if [ -f "$p" ]; then s

ed -i '/Miscellaneous/,/edge=/d' $p; fi; done for sc in /system/etc/init.d/*SuperCharger* /data/99SuperCharger.sh /sy stem/etc/hw_config.sh; do if [ -f "$sc" ]; then sed -i '/wmem_max/,/tcp_wmem/d' $sc; fi; done echo " Enable Miscellaneous & 3G Tweaks?" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read misc echo "" echo $line case $misc in n|N)echo " Miscellaneous & 3G Tweaks are now OFF!" misc3g=0;; *)for p in /data/local.prop /system/build.prop; do if [ -f "$p" ]; then sed -i '/END OOM_ADJ_Settings/ a\ # Miscellaneous Tweaks!\ persist.sys.purgeable_assets=1\ wifi.supplicant_scan_interval=180\ windowsmgr.max_events_per_sec=200\ pm.sleep_mode=1\ # 3G TurboCharger Enhancment!\ net.dns1=8.8.8.8\ net.dns2=8.8.4.4\ net.tcp.buffersize.default=6144,87380,110208,6144,16384,110208\ net.tcp.buffersize.wifi=262144,524288,1048576,262144,524288,1048576\ net.tcp.buffersize.lte=262144,524288,3145728,262144,524288,3145728\ net.tcp.buffersize.hsdpa=6144,262144,1048576,6144,262144,1048576\ net.tcp.buffersize.evdo_b=6144,262144,1048576,6144,262144,1048576\ net.tcp.buffersize.umts=6144,87380,110208,6144,16384,110208\ net.tcp.buffersize.hspa=6144,87380,262144,6144,16384,262144\ net.tcp.buffersize.gprs=6144,8760,11680,6144,8760,11680\ net.tcp.buffersize.edge=6144,26280,35040,6144,16384,35040' $p fi done for sc in /system/etc/init.d/*SuperCharger* /data/99SuperCharg er.sh /system/etc/hw_config.sh; do if [ -f "$sc" ]; then sed -i '/$#/ a\ busybox sysctl -w net.core.wmem_max=1048576;\ busybox sysctl -w net.core.rmem_max=1048576;\ busybox sysctl -w net.core.optmem_max=20480;\ busybox sysctl -w net.ipv4.tcp_moderate_rcvbuf=1; # Be sure that autotuning is in effect\ busybox sysctl -w net.ipv4.route.flush=1;\ busybox sysctl -w net.ipv4.udp_rmem_min=6144;\ busybox sysctl -w net.ipv4.udp_wmem_min=6144;\ busybox sysctl -w net.ipv4.tcp_rmem='"'6144 87380 1048576'"';\ busybox sysctl -w net.ipv4.tcp_wmem='"'6144 87380 1048576'"';' $sc fi done echo " Miscellaneous & 3G Tweaks are now ON!" misc3g=1;; esac echo $line echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo $line

echo "" $sleep touch $prop if [ -d "/system/etc/init.d" ]; then echo " Fix Emissions On Boot..." echo " ========================" echo "" $sleep echo " This should fix app Force Closes!" echo "" $sleep echo " FCs usually happen due to permission errors..." echo "" $sleep echo " This tool will ensure that ALL apps..." echo "" $sleep echo " ...have the correct permissions!" echo "" echo $line echo "" $sleep echo " Fix Emissions can run automatically on boot!" echo "" $sleep echo " *99SuperCharger would run FixEmissions.sh..." echo "" $sleep echo " ...so boot time would be unaffected!" echo "" if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then sed -i '/!FixEmissions/d' /system/etc/init.d/*SuperCharg er* sed -i '/sleep 60;/ i\ sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2>/dev/nu ll;\ sh /data/V6_SuperCharger/!FixEmissions.sh & 2>/dev/null; sleep 1;\ sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2>/dev/nu ll;' /system/etc/init.d/*SuperCharger* else echo $line $sleep echo " An Option from 2 - 13 still needs to be run!" fi 2>/dev/null if [ ! -f "/data/V6_SuperCharger/!FixEmissions.sh" ]; then echo $line $sleep echo " Fix Emissions has to run once from the menu!" fi echo $line echo "" $sleep echo " Run Fix Emissions on boot?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read bootfixemissions echo "" echo $line case $bootfixemissions in

y|Y)echo " Fix Emissions Set To Run On Boot!" fixemissions=1;; *)sed -i '/!FixEmissions.sh/s/^/# /' /system/etc/init.d/ *SuperCharger* 2>/dev/null echo " No FCing Fix On Boot For You!" fixemissions=0;; esac echo $line echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo $line echo "" $sleep echo " Wheel Alignment On Boot..." echo " ==========================" echo "" $sleep echo " ZipAlign optimizes all your APKs..." echo "" $sleep echo " ...which means less RAM comsumption..." echo "" $sleep echo " ...better battery life..." echo "" $sleep echo " ...and a faster device!!" echo "" echo $line echo "" $sleep echo " Wheel Alignment can run automatically on boot!" echo "" $sleep echo " *99SuperCharger would run WheelAlignment.sh..." echo "" $sleep echo " ...so boot time would be unaffected!" echo "" if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then sed -i '/!WheelAlignment/d' /system/etc/init.d/*SuperCha rger* sed -i '/terminate=/ a\ sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!WheelAlignment.sh 2>/dev/null;\ sh /data/V6_SuperCharger/!WheelAlignment.sh & 2>/dev/null; sleep 1;\ sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!WheelAlignment.sh 2>/dev/null;' /system/etc/init.d/*SuperCharger* else echo $line $sleep echo " An Option from 2 - 13 still needs to be run!" fi 2>/dev/null if [ ! -f "/data/V6_SuperCharger/!WheelAlignment.sh" ]; then echo $line $sleep echo " Wheel Alignment has to run once from the menu!"

fi echo $line echo "" $sleep echo " Run Wheel Alignment on boot?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read bootzepalign echo "" echo $line case $bootzepalign in y|Y)echo " Wheel Alignment Set To Run On Boot!" zepalign=1;; *)sed -i '/!WheelAlignment.sh/s/^/#/' /system/etc/init.d /*SuperCharger* 2>/dev/null echo " Boot Align Declined... does that rhyme?" zepalign=0;; esac echo $line echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo $line echo "" $sleep echo " Detailing On Boot..." echo " ====================" echo "" $sleep echo " You have many SQLite databases that become..." echo "" $sleep echo " ...fragmented and unoptimized over a few days." echo "" $sleep echo " This tool will optimize them with..." echo "" $sleep echo " ...SQLite VACUUM and REINDEX!" echo "" echo $line echo "" $sleep echo " Detailing can run automatically on boot!" echo "" $sleep echo " *99SuperCharger would run Detailing.sh..." echo "" $sleep echo " ...so boot time would be unaffected!" echo "" if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then sed -i '/!Detailing/d' /system/etc/init.d/*SuperCharger* sed -i '/sleep 60;/ a\ sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/null; \ sh /data/V6_SuperCharger/!Detailing.sh & 2>/dev/null; sleep 1;\

sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/null; sleep 480;' /system/etc/init.d/*SuperCharger* else echo $line $sleep echo " An Option from 2 - 13 still needs to be run!" fi 2>/dev/null if [ ! -f "/data/V6_SuperCharger/!Detailing.sh" ]; then echo $line $sleep echo " Detailing has to run once from the menu!" fi echo $line echo "" $sleep echo " Run Detailing on boot?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read bootdetailing echo "" echo $line case $bootdetailing in y|Y)echo " Detailing Set To Run On Boot!" detailing=1;; *)sed -i '/!Detailing.sh/s/^/# /' /system/etc/init.d/*Su perCharger* 2>/dev/null echo " Declined Detailing On Boot!" detailing=0;; esac echo $line echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo $line echo "" $sleep if [ "$ics" -eq 0 ]; then echo " System Integration - $initrcpath1 Options..." echo " ==================" echo "" $sleep echo " SuperCharger can attempt greater integration..." echo "" $sleep echo " ...with system files on boot using init.rc..." echo "" $sleep echo " If it sticks, it makes for a much cleaner mod!" echo "" $sleep echo " Root access issues are rare, but can occur..." echo "" echo $line $sleep echo " Regardless, a SuperCharged init.rc file..." echo "" $sleep

echo " ...can always be found in /data!" echo $line $sleep echo " Note: You can bake $initrcpath into your ROM!" echo $line echo "" $sleep echo " Custom ROMs: Settings should stick either way!" echo "" echo $line echo "" $sleep for sc in /system/etc/init.d/*SuperCharger* /data/99Supe rCharger.sh /system/etc/hw_config.sh; do if [ -f "$sc" ]; then sed -i '/diff/,/I ntegration/d' $sc; fi; done echo -n " Integrate? Enter Y for Yes, any key for No: " read bake echo "" echo $line case $bake in y|Y)for sc in /system/etc/init.d/*SuperCharger* /data/ 99SuperCharger.sh /system/etc/hw_config.sh; do if [ -f "$sc" ]; then sed -i '/remount,r w \/data/ i\ if [ -f "'$initrcpath'" ] && [ "\`grep "SuperCharger" /system/build.prop \`" ] && [ "\`diff '$initrcpath' '$initrcpath1'\`" ]; then\ busybox mount -o remount,rw /;\ busybox mount -o remount,rw rootfs;\ cp -fr '$initrcpath' '$initrcpath1';\ busybox mount -o remount,ro /;\ busybox mount -o remount,ro rootfs;\ fi 2>/dev/null; # System Integration Marker' $sc fi done echo " System Integration of $initrcpath1 i s now ON!" initrc=1;; *)echo " System Integration of $initrcpath1 i s now OFF!" initrc=0;; esac echo $line echo "" $sleep else initrc=0 fi else initrc=0; fixemissions=0; zepalign=0; detailing=0 fi echo " Disable AWESOME V6 Animation? (Say \"NO\"!) :P" echo " =======" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read animate echo "" echo $line case $animate in y|Y)echo " Boo... Animation is OFF... :/" animation=0;; *)echo " Yay... Animation is ON... :D"

animation=1;; esac echo $line echo "" $sleep echo "$speed,$buildprop,$animation,$initrc,$launcheradj,$fixemissions,$ zepalign,$detailing,$misc3g" > /data/V6_SuperCharger/SuperChargerOptions cp -fr /data/V6_SuperCharger/SuperChargerOptions /sdcard/V6_SuperCharge r/SuperChargerOptions echo " Driver Options Have Been Saved!" echo "" $sleep echo $line echo " Now Off To The Races!" firstgear=;missingoptions=;; 30)echo " =================" busybox echo " //// OFF TOPIC \\\\\\\\" echo $line echo "" $sleep echo " Ok this is \"Off Topic\"..." echo "" $sleep echo " ...but maybe there's a good reason..." echo "" $sleep echo " ...why this script is so popular :p" echo "" $sleep echo " It's profound... so just read the link..." echo "" $sleep echo " ...and decide for yourself if it makes sense!" echo "" $sleep echo " If you don't like it... remember..." echo "" $sleep echo " ...don't shoot the messenger!" echo "" $sleep echo " Either way... I'm not crazy..." echo "" $sleep echo " ...and you may learn something..." echo "" $sleep echo " ...even if you're a doctor!" echo "" echo $line echo "" sleep 4 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/0 dMcp" echo "";; 31)echo $line echo " !!POOF!!" echo $line echo "" sleep 2

busybox sync if [ -f "/proc/sys/kernel/sysrq" ]; then echo 1 > /proc/sys/kernel/sysrq 2>/dev/null echo b > /proc/sysrq-trigger 2>/dev/null fi echo " If it don't go poofie, just reboot manually!" echo "" reboot; busybox reboot;; 32)echo " ===================" busybox echo " //// SUPERCLEAN! \\\\\\\\" if [ "$ram1" -ne "$ram2" ]; then opt=26; fi;; 33)echo " Did you find this useful? Feedback is welcome!";; *) echo " #!*@%$*?%@&)&*#!*?(*)(*)&(!)%#!&?@#$*%&?&$%$*#?!" echo "" sleep 2 echo " oops.. typo?! $opt is an Invalid Option!" echo "" sleep 2 echo " 1 <= Valid Option => 33 !!" echo "" sleep 2 echo -n " hehe... Press the Enter Key to continue... ;)" read enter echo "" opt=69;; esac if [ "$opt" -ne 0 ] && [ "$opt" -ne 1 ] && [ "$opt" -ne 14 ] && [ "$opt" -ne 15 ] && [ "$opt" -ne 16 ] && [ ! "$opt" -gt 26 ] && [ "$ram1" -ne "$ram2" ]; then opt=69; resuperable=; firstgear=; showicscentre=; fi if [ "$ics" -eq 0 ] && [ "$opt" -ge 2 ] && [ "$opt" -le 10 ]; then echo "" $sleep echo $line if [ "$launcheradj" -eq 0 ]; then echo " BULLETPROOF LAUNC HER!" elif [ "$launcheradj" -eq 2 ]; then echo " HARD TO KILL LA UNCHER!" else echo " DIE-HARD LAUNCHER!" fi fi if [ "$opt" -le 25 ] || [ "$opt" -eq 32 ]; then echo $line echo "" $sleep fi if [ "$opt" -eq 1 ]; then echo " Out Of Memory (OOM) / lowmemorykiller values:" echo "" $sleep echo " "$currentminfree pages echo "" $sleep echo $currentminfree | awk -F , '{printf " Which means: %.0f, %.0f, %.0 f, %.0f, %.0f, %.0f MB\n", $1/256, $2/256, $3/256, $4/256, $5/256, $6/256}' echo "" echo $line if [ "$lname" ]; then echo " $lname is the home launcher!" echo $line echo ""

$sleep echo -n " But verify groupings with the bOOM Stick" if [ "$lname" = "android.process.acore" ] && [ ! "$diehard" ]; t hen echo "..." echo "" $sleep echo " else echo "!" fi echo "" echo $line

...since I'm not 100% sure... lol"

fi echo "" $sleep echo " Home Launcher Priority is: $HL" echo "" $sleep echo " Foreground App Priority is: $FA" echo "" $sleep if [ "$gb" -eq 1 ] || [ "$icssced" ]; then echo " Perceptible App Priority is: $PA" echo "" $sleep fi echo " Visible App Priority is: $VA" echo "" echo $line echo "" $sleep if [ "$status" -eq 4 ]; then echo " Launcher is greater than Visible App..." echo "" $sleep echo $line echo " Wow, that's one weak ass launcher! :(" elif [ "$status" -eq 3 ]; then echo " Launcher is equal to Visible App..." echo "" $sleep echo " ...Home Launcher is \"Locked In Memory\"!" echo "" $sleep echo $line echo " meh... that's still pretty weak! :P" elif [ "$status" -eq 0 ]; then echo " Launcher is equal to Foreground App..." echo "" $sleep if [ "$gb" -eq 1 ] || [ "$icssced" ]; then echo " ...is less than Perceptible App..." echo "" $sleep fi echo " ...and is less than Visible App..." echo "" $sleep echo $line echo " Home Launcher is BULLETPROOF!"

elif [ "$status" -eq 1 ]; then echo " Launcher is greater than Foreground App..." echo "" $sleep if [ "$gb" -eq 1 ] || [ "$icssced" ]; then echo " ...is less than Perceptible App..." echo "" $sleep fi echo " ...and is less than Visible App..." echo "" $sleep echo $line echo " Home Launcher is DIE-HARD!" else echo " Launcher is greater than Foreground App..." echo "" $sleep if [ "$gb" -eq 1 ] || [ "$icssced" ]; then echo " ...is equal to Perceptible App..." echo "" $sleep fi echo " ...and is less than Visible App..." echo "" $sleep echo $line echo " Home Launcher is very HARD TO KILL!" fi elif [ "$opt" -le 33 ]; then if [ "$opt" -le 13 ] || [ "$opt" -eq 24 ]; then if [ "`grep artprojects.RAM /d*/system/packages.xml`" ]; then echo $line echo " WARNING: Incompatibilty Error!" echo $line echo "" $sleep echo " A memory app of questionable integrity found!" echo "" $sleep echo " To ensure REAL SUPERCHARGING..." echo " ==================" echo "" $sleep echo " ...with A REAL SUPERCHARGED LAUNCHER..." echo " ============================" echo "" $sleep echo " You need to uninstall that \"cr-app\" :/" opt=33 fi 2>/dev/null fi if [ "$opt" -eq 24 ]; then echo " Your previous V6 SuperCharger Settings are..." echo "" $sleep awk -F , '{print " "$1/256",",$2/256",",$3/256",", $4/256",",$5/256",",$6/256 " MB"}' /sdcard/V6_SuperCharger/SuperChargerMinfree echo "" $sleep

echo " Re-SuperCharge from your SD Card?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read resuper echo "" echo $line case $resuper in y|Y)CONFIG=Re-Super if [ -f "/sdcard/V6_SuperCharger/97BulletProof_A pps.sh" ] && [ -f "/sdcard/V6_SuperCharger/BulletProof_Apps_HitList" ]; then echo "" $sleep echo " Re-BulletProof Apps too?" echo "" $sleep echo -n " Enter N for No, any key for Ye s: " read rebullet echo "" echo $line case $rebullet in n|N);; *)rebulletproof=yes if [ "`ls /sdcard/V6_Sup erCharger/*BulletProof_Apps`" ]; then cp -fr /sdcard/V6_SuperCharger/*BulletProo f_Apps /system/etc/init.d; fi 2>/dev/null if [ "`ls /sdcard/V6_Sup erCharger/BulletProof_Apps*`" ]; then cp -fr /sdcard/V6_SuperCharger/BulletProof _Apps* /data/V6_SuperCharger; fi 2>/dev/null if [ -f "/sdcard/V6_Supe rCharger/97BulletProof_Apps.sh" ]; then cp -fr /sdcard/V6_SuperCharger/97BulletP roof_Apps.sh /data; fi;; esac fi echo " Re-SuperCharging from your SD Card..." echo $line echo "" $sleep if [ "`ls /sdcard/V6_SuperCharger/SuperCharger*` " ]; then echo " ...your Driver Options..."; $sleep; cp -fr /sdcard/V6_Supe rCharger/SuperCharger* /data/V6_SuperCharger; fi 2>/dev/null if [ "`ls /sdcard/V6_SuperCharger/*SuperCharger` " ]; then cp -fr /sdcard/V6_SuperCharger/*SuperCharger /system/etc/init.d; fi 2> /dev/null if [ -f "/sdcard/V6_SuperCharger/99SuperCharger. sh" ]; then echo " ...your SuperCharger Settings..."; $sleep; cp -fr /sdcar d/V6_SuperCharger/99SuperCharger.sh /data; fi if [ -f "/data/97BulletProof_Apps.sh" ]; then ec ho " ...your BulletProof Apps Settings..."; $sleep; fi if [ -d "/sdcard/V6_SuperCharger/BulletProof_One _Shots" ]; then cp -fr /sdcard/V6_SuperCharger/BulletProof_One_Shots /data/V6_Su perCharger; fi if [ -d "/sdcard/V6_SuperCharger/PowerShift_Scri pts" ]; then echo " ...your PowerShift Scripts..."; $sleep; cp -fr /sdcard/ V6_SuperCharger/PowerShift_Scripts /data/V6_SuperCharger; fi if [ -f "/sdcard/V6_SuperCharger/!FastEngineFlus h.sh" ]; then echo " ...your \"Quick Widget\" Scripts..."; $sleep; cp -fr / sdcard/V6_SuperCharger/!FastEngineFlush.sh /data/V6_SuperCharger; fi if [ -f "/sdcard/V6_SuperCharger/!Detailing.sh"

]; then cp -fr /sdcard/V6_SuperCharger/!Detailing.sh /data/V6_SuperCharger; fi if [ -f "/sdcard/V6_SuperCharger/!FixEmissions.s h" ]; then cp -fr /sdcard/V6_SuperCharger/!FixEmissions.sh /data/V6_SuperCharger ; fi if [ -f "/sdcard/V6_SuperCharger/!WheelAlignment .sh" ]; then cp -fr /sdcard/V6_SuperCharger/!WheelAlignment.sh /data/V6_SuperCha rger; fi if [ -f "/sdcard/V6_SuperCharger/!SuperClean.sh" ]; then cp -fr /sdcard/V6_SuperCharger/!SuperClean.sh /data/V6_SuperCharger; fi echo " ...all \"Terminal Emulator\" Scripts ... "; dd if=$0 of=/system/xbin/v6 2>/dev/null if [ -f "/data/V6_SuperCharger/SuperChargerAdj" ]; then scadj=`cat /data/V6_SuperCharger/SuperChargerAdj`; fi if [ -f "/data/V6_SuperCharger/SuperChargerMinfr ee" ]; then scminfree=`cat /data/V6_SuperCharger/SuperChargerMinfree`; ReSuperCh arge=1; autoshowcalculated= MB1=`echo $scminfree | awk -F , '{print $1/256}'`;MB2=`echo $scminfree | awk -F , '{print $2/256}'`;MB3=`echo $scminfree | awk -F , '{print $3/256}'`;MB4=`echo $scminfree | awk -F , '{print $4/256}'`; MB5=`echo $scminfree | awk -F , '{print $5/256}'`;MB6=`echo $scminfree | awk -F , '{print $6/256}'` fi chown 0.0 /system/etc/init.d/* 2>/dev/null; chmo d 777 /system/etc/init.d/* 2>/dev/null chown 0.0 /data/V6_SuperCharger/*; chmod 777 /da ta/V6_SuperCharger/* chown 0.0 /data/V6_SuperCharger/BulletProof_One_ Shots/* 2>/dev/null; chmod 777 /data/V6_SuperCharger/BulletProof_One_Shots/* 2>/ dev/null chown 0.0 /data/V6_SuperCharger/PowerShift_Scrip ts/* 2>/dev/null; chmod 777 /data/V6_SuperCharger/PowerShift_Scripts/* 2>/dev/nu ll chown 0.0 /system/xbin/v6 2>/dev/null; chmod 777 /system/xbin/v6 2>/dev/null if [ "`ls /data/*.sh`" ]; then chown 0.0 /data/* .sh; chmod 777 /data/*.sh; fi if [ -f "/data/V6_SuperCharger/!FastEngineFlush. sh" ]; then cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh /system/xbin/flush; fi if [ -f "/data/V6_SuperCharger/!Detailing.sh" ]; then cp -fr /data/V6_SuperCharger/!Detailing.sh /system/xbin/vac; fi if [ -f "/data/V6_SuperCharger/!FixEmissions.sh" ]; then cp -fr /data/V6_SuperCharger/!FixEmissions.sh /system/xbin/fixfc; fi if [ -f "/data/V6_SuperCharger/!WheelAlignment.s h" ]; then cp -fr /data/V6_SuperCharger/!WheelAlignment.sh /system/xbin/zepalign ; fi if [ -f "/data/V6_SuperCharger/!SuperClean.sh" ] ; then cp -fr /data/V6_SuperCharger/!SuperClean.sh /system/xbin/sclean; fi echo "" echo $line $sleep echo " ...finished copying files to /system and /data!" echo $line echo "" $sleep if [ -f "/data/V6_SuperCharger/SuperChargerOptio ns" ]; then firstgear= speed=`awk -F , '{print $1}' /data/V6_Su perCharger/SuperChargerOptions`

sleep="sleep $speed" buildprop=`awk -F , '{print $2}' /data/V 6_SuperCharger/SuperChargerOptions` animation=`awk -F , '{print $3}' /data/V 6_SuperCharger/SuperChargerOptions` initrc=`awk -F , '{print $4}' /data/V6_S uperCharger/SuperChargerOptions` launcheradj=`awk -F , '{print $5}' /data /V6_SuperCharger/SuperChargerOptions` fixemissions=`awk -F , '{print $6}' /dat a/V6_SuperCharger/SuperChargerOptions` zepalign=`awk -F , '{print $7}' /data/V6 _SuperCharger/SuperChargerOptions` detailing=`awk -F , '{print $8}' /data/V 6_SuperCharger/SuperChargerOptions` misc3g=`awk -F , '{print $9}' /data/V6_S uperCharger/SuperChargerOptions` if [ ! "$launcheradj" ]; then launcherad j=1; fi if [ ! "$fixemissions" ]; then fixemissi ons=0; fi if [ ! "$zepalign" ]; then zepalign=0; f i if [ ! "$detailing" ]; then detailing=0; fi if [ ! "$misc3g" ]; then misc3g=1; missi ngoptions=yes; fi fi echo $line echo " Prior scrolling speed of $speed had bee n set..." echo $line $sleep if [ "$ics" -eq 0 ]; then if [ "$buildprop" -eq 0 ]; then echo " LOCAL.PROP to be used for SuperCharging!" else echo " BUILD.PROP to be used for SuperCharging!" fi echo $line $sleep if [ "$launcheradj" -eq 0 ]; then echo " SuperCharged Launcher Option is BulletProof!!" elif [ "$launcheradj" -eq 2 ]; then echo " SuperCharged Launcher Option is Hard To Kill!" else echo " SuperCharged Launcher Opti on is... Die-Hard!!" fi echo $line $sleep fi echo -n " Miscellaneous Tweaks & 3G Enhancemen ts - " if [ "$misc3g" -eq 0 ]; then echo "NO!" else echo "YES!" fi echo $line $sleep if [ -d "/system/etc/init.d" ]; then echo -n " Fix Emissions (Fixes FCs) Ru

ns On Boot - " if [ "$fixemissions" -eq 0 ]; then echo "NO!" else echo "YES!" fi echo $line $sleep echo -n " Wheel Alignment(ZipAlign) Ru ns On Boot - " if [ "$zepalign" -eq 0 ]; then echo "NO! " else echo "YES!" fi echo $line $sleep echo -n " Detailing(Clean Database) Ru ns On Boot - " if [ "$detailing" -eq 0 ]; then echo "NO !" else echo "YES!" fi echo $line $sleep if [ "$ics" -eq 0 ]; then if [ "$initrc" -eq 1 ]; then ech o " System Integration of $initrcpath1 is ON..." else echo " System Integration of $initrcpath1 is OFF..." fi echo $line $sleep fi fi echo "" if [ "$missingoptions" ]; then echo $line echo " Missing Some NEW Option s!!" echo $line echo "" $sleep echo " You need to refresh them so..." echo "" $sleep echo " ...Driver Options will be load ed..." echo "" $sleep echo " After Re-S uperCharging!" echo "" echo $line echo "" $sleep fi echo " If you previously used Terminal to execut e..." echo "" $sleep echo " \"v6\" \"flush\" \"vac\" \"fixfc\" \"zepa

lign\" \"sclean\"" echo "" $sleep echo $line echo " Those commands will work automagically !" echo $line echo "" $sleep echo " But to avoid conflicts (different rom, et c)..." echo "" $sleep echo " ored!" echo "" $sleep echo " Nitro Lag Nullifier and 3G TurboCharger.. ." echo "" $sleep echo " lled!" echo "" echo $line echo "" $sleep echo " But this comes first... heh..." echo "" echo $line echo "" $sleep opt=12;; *)echo " Re-SuperCharging Declined... meh..." if [ "$firstgear" ]; then echo $line echo "" $sleep echo " Going to load Driver Options inst ead!" echo "" fi resuperable=;opt=26;; esac fi if [ "$opt" -le 15 ]; then if [ "$opt" -ne 14 ]; then if [ -f "/sdcard/UnSuperCharged.html" ]; then rm /sdcard /UnSuperCharged.html; fi if [ -f "/sdcard/UnSuperChargerError.html" ]; then rm /s dcard/UnSuperChargerError.html; fi if [ -f "/sdcard/SuperChargerScriptManagerHelp.html" ]; then rm /sdcard/SuperChargerScriptManagerHelp.html; fi if [ -f "/sdcard/SuperChargerHelp.html" ]; then rm /sdca rd/SuperChargerHelp.html; fi fi if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1 ]; then SL0=$(($MB0*256));SL1=$(($MB1*256));SL2=$(($MB2*256));SL 3=$(($MB3*256));SL4=$(($MB4*256));SL5=$(($MB5*256));SL6=$(($MB6*256)) echo -n " zOOM... "; sleep 2; echo -n "zOOM..."; sleep 2 ...may need to be re-insta ...some system files were not rest

; echo "" echo "" elif [ "$scminfree" ]; then SL0=$(($MB0*256));SL1=`echo $scminfr ee | awk -F , '{print $1}'`;SL2=`echo $scminfree | awk -F , '{print $2}'`;SL3=`e cho $scminfree | awk -F , '{print $3}'`;SL4=`echo $scminfree | awk -F , '{print $4}'`;SL5=`echo $scminfree | awk -F , '{print $5}'`;SL6=`echo $scminfree | awk F , '{print $6}'` fi if [ "$opt" -le 13 ]; then echo "============== Information Panel =============" echo " =====================" echo "" $sleep if [ "$showbuildpropopt" -eq 1 ]; then echo " Even though you SuperCharged before..." echo "" $sleep echo " ...Your launcher is NOT SuperCharg ed..." echo "" $sleep echo " To apply MEM and ADJ values..." echo "" $sleep echo " ...You can try and use build.prop..." echo "" $sleep echo " ...instead of local. prop!" echo "" $sleep echo " This is more likely to work but riskier.. ." echo "" $sleep echo $line echo " WARNING: There is a small chance of bootl oops!" echo "" $sleep echo " ...so have a backup avail able!" echo $line echo "" $sleep echo " Do you want to use Build.prop?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read buildpropopt echo "" case $buildpropopt in y|Y)echo " Okay... will use the build.prop met hod!" buildprop=1;; *)echo " Okay... will try local.prop met hod again..." buildprop=0;; esac echo ""

$sleep echo "$speed,$buildprop,$animation,$initrc,$laun cheradj,$fixemissions,$zepalign,$detailing,$misc3g" > /data/V6_SuperCharger/Supe rChargerOptions cp -fr /data/V6_SuperCharger/SuperChargerOptions /sdcard/V6_SuperCharger/SuperChargerOptions echo " Settings have been saved!" echo "" $sleep echo " Note: This can be changed later under Opt ions!" echo "" echo $line echo "" $sleep fi for p in /system/build.prop /data/local.prop /system/bin /build.prop /system/etc/ram.conf; do if [ -f "$p" ]; then if [ -f "$p.unsuper" ]; then echo " Leav ing ORIGINAL ${p##*/} backup intact..." else echo " Backing up ORIGINAL ${p## */}..." echo "" $sleep cp -r $p $p.unsuper if [ "`diff $p $p.unsuper`" ]; t hen echo " ERROR BACKING UP $p!" else sed -i '/SuperCharger In stallation/d' $p.unsuper echo " ...as $p .unsuper!" fi fi echo "" $sleep fi done echo $line if [ "$ics" -eq 0 ]; then echo -n " MEM and ADJ values to be applied to " if [ "$buildprop" -eq 0 ]; then echo "LOCAL.PROP !" else echo "BUILD.PROP!" fi echo $line fi echo "" $sleep fi if [ "$opt" -le 14 ]; then if [ -f "$initrcpath1" ] && [ ! -f "$initrcpath" ]; then cp -r $initrcpath1 $initrcpath; fi for rc in $initrcpath1 $allrcpaths /system/etc/hw_config .sh; do if [ -f "$rc" ]; then echo " Found $rc!" echo ""

$sleep if [ "$rc" = "$initrcpath1" ]; then if [ -f "$initrcbackup" ]; then echo " Backup already exists... leaving backup intact" else echo " Backing up ORIGIN AL settings..." cp -r $initrcpath1 $init rcbackup if [ "`diff $initrcpath1 $initrcbackup`" ]; then echo "" $sleep echo " ERROR BAC KING UP $initrcpath1!" fi fi elif [ -f "$rc.unsuper" ]; then echo " B ackup already exists... leaving backup intact" else echo " Backing up ORIGINAL setti ngs..." cp -r $rc $rc.unsuper if [ "`diff $rc $rc.unsuper`" ]; then echo "" $sleep echo " ERROR BACKING UP $rc!" fi fi echo "" $sleep if [ "$opt" -ne 14 ]; then if [ "$ics" -eq 0 ] && [ "`grep -ls "on boot" $rc`" ] && [ "$rc" != "/system/etc/hw_config.sh" ]; then echo $line if [ "$rc" = "$initrcpat h1" ] && [ "$initrc" -eq 0 ]; then echo "" echo " System In tegration of $initrcpath1 is OFF..." echo "" $sleep echo " But for c ooking/baking into ROMs..." echo "" $sleep echo $line fi if [ "$rc" = "$initrcpat h1" ] && [ "$initrc" -eq 0 ]; then echo -n " /data/" elif [ "$rc" = "$initrcp ath1" ]; then echo -n " /" else echo -n " " fi if [ "$ics" -eq 0 ] && [ "$opt" -ge 11 ] && [ "$opt" -le 13 ] && [ "$ReSuperCharge" -eq 0 ]; then echo " ${rc##*/} will be OOM Fixed!" else

echo -n "${rc##* /} will be SuperCharged" if [ "$rc" = "$i nitrcpath1" ]; then echo "!" else echo "..."; echo $line; $sleep; echo " ...it will also run The SuperCharger Service!" fi fi elif [ "$opt" -le 10 ] || [ "$Re SuperCharge" -eq 1 ] && [ "$rc" != "$initrcpath1" ] && [ "$rc" != "/system/etc/h w_config.sh" ]; then echo $line; echo " It will run The SuperCharger Service !" fi fi echo $line echo "" $sleep fi done fi if [ "$opt" -eq 15 ]; then echo " UNSUPERCHARGE..." echo "" sleep 1 echo " ...UNFIX OOM GROUPINGS..." echo "" sleep 1 echo " ...RESTORE WEAK ASS LAUNCHER" echo "" echo $line $sleep echo " Boo... UnSuperCharging Performance...." echo $line echo "" $sleep if [ ! -f "`ls /system/etc/init.d/*SuperCharger*`" ] && [ ! -f "`ls /data/*SuperCharger*`" ] && [ ! -f "`ls /system/etc/init.d/*BulletPr oof_Apps*`" ] && [ ! -f "$initrcpath" ] && [ ! -f "$initrcbackup" ] && [ ! "$all rcbackups" ]; then echo " I Got Nothing To Do! Try SuperCharging fi rst!" echo "" $sleep UnSuperCharged=1 cat > /sdcard/UnSuperCharged.html <<EOF There was nothing to uninstall!<br> <br> For more SuperCharging help and info,<br> See the <a href="http://goo.gl/qM6yR">V6 SuperCharger Thread</a><br> Feedback is Welcome!<br> <br> -=zeppelinrox=- @ <a href="http://goo.gl/qM6yR">XDA</a> & <a href="http://www.dr oidforums.net/forum/droid-hacks/148268-script-v6-supercharger-htk-bulletproof-la unchers-fix-memory-all-androids.html">Droid</a> Forums<br> EOF echo $line echo " See /sdcard/UnSuperCharged.html for assis tance!" echo $line echo ""

$sleep else if [ -f "$initrcpath" ]; then rm $initrcpath; fi if [ -f "$initrcbackup" ]; then echo " BACKUP FOUND!" echo "" $sleep echo " Restoring $initrcpath1..." echo "" echo $line echo "" $sleep cp -fr $initrcbackup $initrcpath1 rm $initrcbackup fi for rc in $allrcpaths; do if [ ! -f "$rc.unsuper" ]; then echo " ERROR... ERROR... ER ROR... ERROR..." echo "" $sleep echo " NOT FOUND!" echo "" $sleep echo " default values!" echo "" sleep 3 UnSuperChargerError=1 cat > /sdcard/UnSuperChargerErro r.html <<EOF The backup file, $rc.unsuper, WAS NOT found!<br> Please do a manual restore of $rc from your ROM's update file!<br> <br> For more SuperCharging help and info,<br> See the <a href="http://goo.gl/qM6yR">V6 SuperCharger Thread</a><br> Feedback is Welcome!<br> <br> -=zeppelinrox=- @ <a href="http://goo.gl/qM6yR">XDA</a> & <a href="http://www.dr oidforums.net/forum/droid-hacks/148268-script-v6-supercharger-htk-bulletproof-la unchers-fix-memory-all-androids.html">Droid</a> Forums<br> EOF echo $line echo " See /sdcard/UnSuperCharge rError.html for help!" echo $line if [ "${rc##*/}" != "init.rc" ] ; then echo "" sleep 4 sed -i '/.*V6 SuperCharg er/,/.*V6 SuperCharged/d' $rc sed -i '/SuperCharger_Se rvice/,/SuperCharged_Service/d' $rc sed -i '/BulletProof_App s_Service/,/BulletProofed_Apps_Service/d' $rc sed -i '/vm\/.*min_free_ kbytes*/d' $rc sed -i '/vm\/.*oom.*/d' CAN'T restore some AN RC BACKUP WAS

$rc sed -i '/vm\/.*overcommi t_memory.*/d' $rc sed -i '/vm\/.*swappines s*/d' $rc sed -i '/kernel\/panic.* /d' $rc echo " Cleaned "$rc echo "" echo $line fi else echo " UND!" echo "" $sleep echo " Restoring ${rc##*/}..." mv $rc.unsuper $rc echo "" echo $line fi echo "" $sleep if [ ! -s "$rc" ]; then rm $rc; fi done fi 2>/dev/null fi if [ "$opt" -ne 14 ]; then for p in /data/local.prop /system/build.prop /system/bin /build.prop /system/etc/ram.conf; do if [ -f "$p" ]; then chown 0.0 $p; chmod 644 $p if [ "$opt" -eq 15 ] && [ ! -f "$p.unsup er" ] || [ "$opt" -le 13 ] || [ "$ReSuperCharge" -eq 1 ]; then if [ "$UnSuperCharged" -ne 1 ]; then echo " Cleaning ADJ valu es from ${p##*/}..." echo "" $sleep fi sed -i '/BEGIN OOM_ADJ_Settings/ ,/.*V6 SuperCharged/d' $p sed -i '/.*_ADJ/d' $p if [ "$UnSuperCharged" -ne 1 ]; then echo " Cleaning MEM valu es from ${p##*/}..." echo "" $sleep fi sed -i '/.*V6 SuperCharger/,/END OOM_MEM_Settings/d' $p if [ "$scminfree" ]; then sed -i '/.*_MEM/d' $p; fi fi fi done if [ "$opt" -eq 15 ] || [ "$opt" -le 10 ] || [ "$ReSuper Charge" -eq 1 ] && [ ! "$newsupercharger" ]; then BACKUP FO

if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then echo " Cleaning Up SuperCharge from /ini t.d folder" echo "" $sleep echo " Cleaning Up Grouping Fixes from / init.d folder" echo "" $sleep rm /system/etc/init.d/*SuperCharger* fi 2>/dev/null if [ -f "/data/99SuperCharger.sh" ]; then echo " Cleaning Up SuperCharge from /dat a folder" echo "" $sleep echo " Cleaning Up Grouping Fixes from / data folder" echo "" $sleep rm /data/99SuperCharger.sh fi fi if [ "`ls /data/SuperCharger*`" ]; then rm /data/SuperCh arger*; fi 2>/dev/null if [ "`ls /data/*-\(*\).sh`" ]; then rm /data/*-\(*\).sh ; fi 2>/dev/null if [ -f "/data/local/userinit.sh" ]; then sed -i '/.*Sup erCharger/d' /data/local/userinit.sh; fi if [ -f "/system/etc/hw_config.sh" ]; then sed -i '/.*V6 SuperCharger/,/.*V6 SuperCharged/d' /system/etc/hw_config.sh if [ "$UnSuperCharged" -ne 1 ] && [ ! "$newsuper charger" ]; then echo " Cleaning Up SuperCharge from hw_c onfig.sh..." echo "" $sleep fi fi fi if [ "$opt" -eq 15 ]; then if [ -d "/data/V6_SuperCharger" ]; then rm -r /data/V6_S uperCharger; fi if [ "`ls /data/*BulletProof_Apps*`" ]; then rm /data/*B ulletProof_Apps*; fi 2>/dev/null if [ "`ls /data/*SuperCharger*`" ]; then rm /data/*Super Charger*; fi 2>/dev/null if [ "`ls /system/etc/init.d/*BulletProof_Apps*`" ]; the n rm /system/etc/init.d/*BulletProof_Apps*; fi 2>/dev/null if [ -f "/system/xbin/v6" ]; then rm /system/xbin/v6; fi if [ -f "/system/xbin/flush" ]; then rm /system/xbin/flu sh; fi if [ -f "/system/xbin/vac" ]; then rm /system/xbin/vac; fi if [ -f "/system/xbin/fixfc" ]; then rm /system/xbin/fix fc; fi if [ -f "/system/xbin/zepalign" ]; then rm /system/xbin/ zepalign; fi if [ -f "/system/xbin/sclean" ]; then rm /system/xbin/sc

lean; fi if [ "$UnSuperCharged" -ne 1 ]; then for p in /data/local.prop /system/build.prop /sy stem/bin/build.prop /system/etc/hw_config.sh /system/etc/ram.conf; do if [ -f "$p.unsuper" ]; then echo " Restoring ORIGINAL ${p##* /}..." echo "" $sleep mv $p.unsuper $p fi if [ -f "$p" ] && [ ! -s "$p" ]; then r m $p; fi done echo " Removed Kernel/Memory Tweaks..." echo "" $sleep if [ "$UnSuperChargerError" -ne 1 ]; then echo " Your ROM's default minfree values are restored!" echo "" echo $line fi if [ ! "$icssced" ]; then echo "" $sleep echo " Out Of Memory (OOM) Groupings UnF ixed..." echo "" $sleep echo " ...OOM Priorities UnFixed..." echo "" $sleep echo " Weak Ass Launche r Restored :(" echo "" $sleep echo $line echo " UnSuperCharging Complet e!" echo $line echo "" $sleep echo " REBOOT NOW..." echo "" $sleep echo " ...FOR UNSUPERCHARGE TO TAKE EFFECT!" echo "" fi scminfree=;sccminfree=;scminfreeold=;bpapplist=; allrcbackups=;ran=0;minfrees=0 fi if [ "$icssced" ] && [ -f "/sdcard/V6_SuperCharger/servi ces.jar.unsuper" ]; then UnIScream=yes; fi fi if [ "$opt" -le 14 ]; then if [ "$opt" -eq 14 ]; then echo " Removing Kernel/Virtual Memory Tweaks..."

echo "" $sleep fi for rc in $initrcpath $allrcpaths; do if [ "$opt" -ne 14 ]; then sed -i '/BEGIN OOM_ADJ_Settings/,/.*V6 S uperCharged/d' $rc sed -i '/.*_ADJ/d' $rc sed -i '/.*V6 SuperCharger/,/END OOM_MEM _Settings/d' $rc if [ "$scminfree" ]; then sed -i '/.*_ME M/d' $rc sed -i '/write \/sys\/module\/lo wmemorykiller/d' $rc else sed -i '/write \/sys\/module\/lowme morykiller\/parameters\/adj/d' $rc fi fi if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1 ]; then sed -i '/SuperCharger_Service/,/SuperCharged_Service/d' $rc; fi sed -i '/vm\/.*min_free_kbytes*/d' $rc sed -i '/vm\/.*oom.*/d' $rc sed -i '/vm\/.*overcommit_memory.*/d' $rc sed -i '/vm\/.*swappiness*/d' $rc sed -i '/kernel\/panic.*/d' $rc done for sc in /system/etc/init.d/*SuperCharger* /data/99Supe rCharger.sh /system/etc/hw_config.sh; do if [ -f "$sc" ]; then if [ "$opt" -eq 14 ]; then sed -i '/.*-w vm.min_free_kbytes*/d' $sc sed -i '/.*oom.*/d' $sc sed -i '/.*overcommit_memory.*/d' $sc sed -i '/.*swappiness*/d' $sc sed -i '/.*panic.*/d' $sc elif [ "$sc" != "/system/etc/hw_config.sh" ]; th en rm $sc fi fi done if [ "$opt" -eq 14 ]; then echo " ...Kernel/Virtual Memory Tweaks Rem oved!" echo "" fi fi if [ "$opt" -le 13 ]; then echo $newscadj > /data/V6_SuperCharger/SuperChargerAdj scadj=`cat /data/V6_SuperCharger/SuperChargerAdj` adj1=`echo $scadj | awk -F , '{print $1}'`;adj2=`echo $s cadj | awk -F , '{print $2}'`;adj3=`echo $scadj | awk -F , '{print $3}'`;adj4=`e cho $scadj | awk -F , '{print $4}'`;adj5=`echo $scadj | awk -F , '{print $5}'`;a dj6=`echo $scadj | awk -F , '{print $6}'` if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1 ]; then if [ "$scminfree" ] && [ ! "$scminfreeold" ]; th en cp -fr /data/V6_SuperCharger/SuperCharge rMinfree /data/V6_SuperCharger/SuperChargerMinfreeOld scminfreeold=`cat /data/V6_SuperCharger/ SuperChargerMinfreeOld`

fi echo "$SL1,$SL2,$SL3,$SL4,$SL5,$SL6" > /data/V6_ SuperCharger/SuperChargerMinfree scminfree=`cat /data/V6_SuperCharger/SuperCharge rMinfree` if [ "$opt" -eq 10 ]; then echo $line echo "" if [ "$restore" -eq 1 ]; then echo " Restoring Prior Cust-OOMizer Settings!" else if [ "$sccminfree" ] && [ "$calc ulatorcharge" -eq 0 ]; then echo " Removing Prior Cu st-OOMizer Settings..." echo "" $sleep fi if [ "$quickcharge" -eq 1 ]; the n echo " Saving Quick Cust-OOMizer Settings!" elif [ "$calculatorcharge" -eq 1 ]; then echo " Applying SuperMinFree Calculator Settings!" elif [ "$revert" -eq 1 ]; then e cho " Reverting to Prior V6 Minfrees!" else echo " Saving Your New Cust-OOMizer Settings!" fi fi if [ "$calculatorcharge" -eq 0 ]; then c p -fr /data/V6_SuperCharger/SuperChargerMinfree /data/V6_SuperCharger/SuperCharg erCustomMinfree; fi echo "" $sleep fi echo $line if [ "$ReSuperCharge" -eq 1 ]; then echo " Re-SuperCharging Performance!" else echo " SuperCharging Performance: $CONFIG!" fi echo $line echo "" $sleep echo " Out Of Memory (OOM) / lowmemorykiller val ues:" echo "" $sleep echo $currentminfree | awk -F , '{printf " Ol d MB = %.0f, %.0f, %.0f, %.0f, %.0f, %.0f MB\n", $1/256, $2/256, $3/256, $4/256, $5/256, $6/256}' echo " New MB = $MB1, $MB2, $MB3, $MB4, $MB5, $MB6 MB" echo "" $sleep echo " Old Pages = "$currentminfree echo " New Pages = $scminfree" echo "" $sleep fi # # MFK Calculator (for min_free_kbytes) created by zeppel

inrox. # if [ "$SL3" -gt 0 ]; then SSMF=$SL3 else SSMF=`awk -F , '{print $3}' /sys/module/lowmemoryki ller/parameters/minfree` fi MFK=$(($SSMF*4/5)) echo $line echo " Make Foreground AND Background Apps STAY FAST!" echo $line echo "" $sleep echo " With The MFK Calculator!" echo " ========================" echo "" $sleep echo " Key Settings That Impact Typical Free RAM..." echo "" $sleep if [ "$ics" -eq 1 ] && [ ! "$icssced" ]; then echo -n " 5" else echo -n " $adj3" fi echo " = Secondary Server ADJ" echo " 3 = Secondary Server Slot" echo " $((SSMF/256)) = Secondary Server LMK MB" echo "" $sleep echo $line echo " Balanced MFK Calculation Complete..." echo $line echo "" $sleep echo " $MFK = Customized MFK (min_free_kbytes)" echo "" if [ "$buildprop" -eq 1 ]; then prop="/system/build.prop " else prop="/data/local.prop" fi for p in /system/etc/ram.conf $prop; do if [ -f "$p" ]; then echo "# V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox." >> $p sed -i '/OOM Grouping/ a\ # SuperMinFree Calculator & MFK Calculator (for min_free_kbytes) created by zepp elinrox also ;^]\ #\ # See http://goo.gl/krtf9 - Linux Memory Consumption - Nice article!\ # See http://goo.gl/hFdNO - Memory and SuperCharging Overview ...or... "Why '"'F ree RAM'"' Is NOT Wasted RAM!"\ # See http://goo.gl/4w0ba - MFK Calculator Info - explanation for vm.min_free_kb ytes.\ #\ # DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE!\ #\ # BEGIN OOM_MEM_Settings\ # END OOM_MEM_Settings\ # BEGIN OOM_ADJ_Settings\ # END OOM_ADJ_Settings\ # End of V6 SuperCharged Entries.' $p

if [ "$p" = "/system/etc/ram.conf" ]; th en sed -i '/END OOM_ADJ_Settings/ a\ LMK_ADJ="'$scadj'"\ LMK_MINFREE="'$scminfree'"' $p elif [ "$misc3g" -eq 1 ]; then sed -i '/ END OOM_ADJ_Settings/ a\ # Miscellaneous Tweaks!\ persist.sys.purgeable_assets=1\ wifi.supplicant_scan_interval=180\ windowsmgr.max_events_per_sec=200\ pm.sleep_mode=1\ # 3G TurboCharger Enhancment!\ net.dns1=8.8.8.8\ net.dns2=8.8.4.4\ net.tcp.buffersize.default=6144,87380,110208,6144,16384,110208\ net.tcp.buffersize.wifi=262144,524288,1048576,262144,524288,1048576\ net.tcp.buffersize.lte=262144,524288,3145728,262144,524288,3145728\ net.tcp.buffersize.hsdpa=6144,262144,1048576,6144,262144,1048576\ net.tcp.buffersize.evdo_b=6144,262144,1048576,6144,262144,1048576\ net.tcp.buffersize.umts=6144,87380,110208,6144,16384,110208\ net.tcp.buffersize.hspa=6144,87380,262144,6144,16384,262144\ net.tcp.buffersize.gprs=6144,8760,11680,6144,8760,11680\ net.tcp.buffersize.edge=6144,26280,35040,6144,16384,35040' $p fi fi done if [ "$ics" -eq 0 ]; then for rc in $initrcpath $rcpaths; do echo $line $sleep if [ "`grep -s "on early-boot" $rc`" ]; then sed -i '/on early-boot/ a\ # V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox.' $r c else sed -i '/on boot/ a\ # V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox.' $r c fi sed -i '/V6 SuperCharger/ a\ # SuperMinFree Calculator & MFK Calculator (for min_free_kbytes) created by zeppelinrox also ;^]\ #\ # See http://goo.gl/krtf9 - Linux Memory Consumption - Nice article!\ # See http://goo.gl/hFdNO - Memory and SuperCharging Overview ...or... "Why '"'Free RAM'"' Is NOT Wasted RAM!"\ # See http://goo.gl/4w0ba - MFK Calculator Info - explanation for vm.min_fre e_kbytes.\ #\ # DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE!\ #\ # BEGIN OOM_MEM_Settings\ # END OOM_MEM_Settings\ # BEGIN OOM_ADJ_Settings\ # END OOM_ADJ_Settings\ # End of V6 SuperCharged Entries.' $rc if [ "$scminfree" ]; then sed -i '/on bo ot/ a\ write /sys/module/lowmemorykiller/parameters/minfree '$scminfree $rc sed -i '/BEGIN OOM_MEM_Settings/ a\

setprop setprop setprop setprop setprop setprop setprop

ro.FOREGROUND_APP_MEM '$SL1'\ ro.VISIBLE_APP_MEM '$SL2'\ ro.SECONDARY_SERVER_MEM '$SL3'\ ro.BACKUP_APP_MEM '$SL4'\ ro.HOME_APP_MEM '$SL0'\ ro.HIDDEN_APP_MEM '$SL4'\ ro.EMPTY_APP_MEM '$SL6 $rc if [ "$gb" -eq 1 ]; then sed -i

'/ro.VISIBLE_APP_MEM/ a\ setprop ro.PERCEPTIBLE_APP_MEM '$SL0'\ setprop ro.HEAVY_WEIGHT_APP_MEM '$SL3 $rc else sed -i '/ro.HIDDEN_APP_MEM/ a\ setprop ro.CONTENT_PROVIDER_MEM '$SL5 $rc fi fi sed -i '/on boot/ a\ write /sys/module/lowmemorykiller/parameters/adj '$scadj $rc sed -i '/BEGIN OOM_ADJ_Settings/ a\ setprop ro.FOREGROUND_APP_ADJ '$adj1'\ setprop ro.VISIBLE_APP_ADJ '$adj2'\ setprop ro.SECONDARY_SERVER_ADJ '$adj3'\ setprop ro.BACKUP_APP_ADJ '$(($adj3+1))'\ setprop ro.HOME_APP_ADJ '$launcheradj'\ setprop ro.HIDDEN_APP_MIN_ADJ '$(($adj4-1))'\ setprop ro.EMPTY_APP_ADJ '$adj6 $rc if [ "$gb" -eq 1 ]; then sed -i '/ro.VIS IBLE_APP_ADJ/ a\ setprop ro.PERCEPTIBLE_APP_ADJ '$(($adj1+2))'\ setprop ro.HEAVY_WEIGHT_APP_ADJ '$(($adj2+1)) $rc else sed -i '/ro.HIDDEN_APP_MIN_ADJ/ a\ setprop ro.CONTENT_PROVIDER_ADJ '$adj4 $rc fi if [ "`grep -s "on early-boot" $rc`" ]; then sed -i '/minfree/ a\ write /proc/sys/vm/min_free_kbytes '$MFK $rc else sed -i '/END OOM_ADJ_Settings/ a\ write /proc/sys/vm/min_free_kbytes '$MFK $rc fi sed -i '/vm\/min_free_kbytes/ a\ write /proc/sys/vm/oom_kill_allocating_task 0\ write /proc/sys/vm/panic_on_oom 0\ write /proc/sys/vm/overcommit_memory 1\ write /proc/sys/vm/swappiness 20\ write /proc/sys/kernel/panic_on_oops 1\ write /proc/sys/kernel/panic 30' $rc if [ "$rc" = "$initrcpath" ] && [ "$init rc" -eq 0 ]; then echo -n " /data/" elif [ "$rc" = "$initrcpath" ]; then ech o -n " /" else echo -n " " fi if [ "$opt" -ge 11 ] && [ "$opt" -le 13 ] && [ "$ReSuperCharge" -eq 0 ]; then echo "${rc##*/} has been OOM Fixed!" else echo "${rc##*/} has been SuperCharg ed!" fi done echo $line echo ""

$sleep echo " Fixing Out Of Memory (OOM) Groupings..." echo "" $sleep echo " ...Fixing OOM Prioriti es..." echo "" $sleep for p in /system/etc/ram.conf $prop; do if [ -f "$p" ]; then if [ "$scminfree" ]; then sed -i '/BEGIN OOM_MEM_Settings/ a\ ro.FOREGROUND_APP_MEM='$SL1'\ ro.VISIBLE_APP_MEM='$SL2'\ ro.SECONDARY_SERVER_MEM='$SL3'\ ro.BACKUP_APP_MEM='$SL4'\ ro.HOME_APP_MEM='$SL0'\ ro.HIDDEN_APP_MEM='$SL4'\ ro.EMPTY_APP_MEM='$SL6 $p if [ "$gb" -eq 1 ]; then sed -i '/ro.VISIBLE_APP_MEM/ a\ ro.PERCEPTIBLE_APP_MEM='$SL0'\ ro.HEAVY_WEIGHT_APP_MEM='$SL3 $p else sed -i '/ro.HIDDEN_ APP_MEM/ a\ ro.CONTENT_PROVIDER_MEM='$SL5 $p fi fi sed -i '/BEGIN OOM_ADJ_Settings/ a\ ro.FOREGROUND_APP_ADJ='$adj1'\ ro.VISIBLE_APP_ADJ='$adj2'\ ro.SECONDARY_SERVER_ADJ='$adj3'\ ro.BACKUP_APP_ADJ='$(($adj3+1))'\ ro.HOME_APP_ADJ='$launcheradj'\ ro.HIDDEN_APP_MIN_ADJ='$(($adj4-1))'\ ro.EMPTY_APP_ADJ='$adj6 $p if [ "$gb" -eq 1 ]; then sed -i '/ro.VISIBLE_APP_ADJ/ a\ ro.PERCEPTIBLE_APP_ADJ='$(($adj1+2))'\ ro.HEAVY_WEIGHT_APP_ADJ='$(($adj2+1)) $p else sed -i '/ro.HIDDEN_APP_MIN_ ADJ/ a\ ro.CONTENT_PROVIDER_ADJ='$adj4 $p fi fi done echo " ...OOM Groupings and Priorities are now f ixed!" echo "" $sleep echo $line if [ "$launcheradj" -eq 0 ]; then echo "" echo " Applied BulletProof Launcher..." echo "" $sleep echo " Launcher is not only SuperCharged ..." echo ""

$sleep echo $line echo " BULLETPROOF!"

...It's

elif [ "$launcheradj" -eq 2 ]; then echo " Hard To Kill Launcher APPLIED!" else echo " Die-Hard Launcher APPLIED! " fi if [ "$homeadj" -ne "$launcheradj" ]; then newla uncher=1; fi fi echo $line echo "" $sleep echo " Applying Kernel/Memory Tweaks..." echo "" $sleep echo -n " ";busybox sysctl -w vm.min_free_ kbytes=$MFK echo -n " g_task=0 echo -n " on_oom=0 echo -n " memory=1 echo -n " piness=20 echo -n " n_oops=1 echo -n " .panic=30 echo "" echo $line echo "" $sleep if [ "$misc3g" -eq 1 ]; then echo " Applying Miscellaneous Tweaks..." echo "" $sleep setprop persist.sys.purgeable_assets 1 echo " persist.sys.purgeable_assets = 1" setprop wifi.supplicant_scan_interval 180 echo " wifi.supplicant_scan_interval = 180" setprop windowsmgr.max_events_per_sec 200 echo " windowsmgr.max_events_per_sec = 200" setprop pm.sleep_mode 1 echo " pm.sleep_mode = 1" echo "" echo $line echo "" $sleep fi echo "#!/system/bin/sh" > /data/99SuperCharger.sh echo "#" >> /data/99SuperCharger.sh for sc in /data/99SuperCharger.sh /system/etc/hw_config. sh; do if [ -f "$sc" ]; then cat >> $sc <<EOF # V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox. # ";busybox sysctl -w kernel ";busybox sysctl -w kernel.panic_o ";busybox sysctl -w vm.swap ";busybox sysctl -w vm.overcommit_ ";busybox sysctl -w vm.panic_ ";busybox sysctl -w vm.oom_kill_allocatin

# SuperMinFree Calculator & elinrox also ;^] # # See http://goo.gl/krtf9 # See http://goo.gl/hFdNO e RAM' Is NOT Wasted RAM!" # See http://goo.gl/4w0ba ytes. EOF

MFK Calculator (for min_free_kbytes) created by zepp Linux Memory Consumption - Nice article! Memory and SuperCharging Overview ...or... "Why 'Fre MFK Calculator Info - explanation for vm.min_free_kb

if [ "$sc" = "/data/99SuperCharger.sh" ] ; then cat >> $sc <<EOF ################################ # SuperCharger Service Notes # ################################ # To leave the SuperCharger Service running, insert a # at the beginning of the "stop super_service" entry near the bottom of this script (3rd or 4th last line) . # # To stop the SuperCharger Service, run Terminal Emulator and type... # "su" and Enter. # "stop super_service" and Enter. # # To restart the SuperCharger Service so it stays running, type... # "su" and Enter. # "start super_service" and Enter. # # If the service is running and you type: "cat /proc/*/cmdline | grep Super". # The output would be 2 lines: # /data/99SuperCharger.sh # Super # # If it's not running, the output would be the last item ie. "Super" which was g enerated by the typed command. # EOF if [ ! "$allrcpaths" ]; then cat >> $sc <<EOF # Ummm... this service won't work on your current ROM. Sorry :P # Instead use Script Manager to run this script if you're on a stock ROM OR sett ings don't stick via the SuperCharger boot script found in /system/etc/init.d! # EOF fi cat >> $sc <<EOF # echo ""; echo " See /data/Log_SuperCharger.log for the output!"; echo ""; # For debugging, delete the # at the beginning of the following 2 lines, and che ck /data/Log_SuperCharger.log file to see what may have fubarred. # set -x; # exec > /data/Log_SuperCharger.log 2>&1; # line=================================================; echo ""; echo \$line; echo " The -=V6 SuperCharger=- by -=zeppelinrox=-"; echo \$line; echo ""; if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then echo " You are NOT running this script as root..."; echo ""; echo \$line;

echo echo echo echo echo echo echo exit fi; echo echo echo echo echo echo EOF

" ...No SuperUser for you!!"; \$line; ""; " ...Please Run as Root and try again..."; ""; \$line; ""; 69;

" To verify application of settings..."; ""; " ...check out /data/Ran_SuperCharger.log!"; ""; \$line; "";

else cat >> $sc <<EOF # # DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE! # line=================================================; echo ""; echo \$line; echo ""; EOF echo " SuperCharging /system/etc /hw_config.sh!" echo "" echo $line echo "" $sleep fi if [ "$initrc" -eq 1 ]; then cat >> $sc <<EOF if [ -f "$initrcpath" ] && [ "\`grep "SuperCharger" /system/build.prop\`" ] && [ "\`diff $initrcpath $initrcpath1\`" ]; then busybox mount -o remount,rw /; busybox mount -o remount,rw rootfs; cp -fr $initrcpath $initrcpath1; busybox mount -o remount,ro /; busybox mount -o remount,ro rootfs; fi 2>/dev/null; # System Integration Marker EOF fi cat >> $sc <<EOF busybox mount -o remount,rw /data 2>/dev/null; busybox mount -o remount,rw /system 2>/dev/null; busybox mount -o remount,rw \`busybox mount | grep system | awk '{print \$1,\$3} ' | sed -n 1p\` 2>/dev/null; EOF if [ "$sc" = "/data/99SuperCharger.sh" ] ; then cat >> $sc <<EOF if [ "\`pgrep -l android\`" ]; then terminate=yes; if [ "\`pgrep scriptmanager | wc -l\`" -lt 2 ]; then echo " Waiting 90 seconds (avoid conflicts)... then...";echo ""; echo " Gonna SuperCharge this Android... zoOM... zOOM!"; echo ""; echo \$line; echo ""; sleep 90;

fi; fi; EOF fi cat >> $sc <<EOF if [ "\`cat /proc/sys/vm/min_free_kbytes\`" -ne $MFK ] || [ "\`cat /proc/sys/net /core/rmem_max\`" -ne 1048576 ]; then #################################### # Kernel & Virtual Memory Tweaks # #################################### busybox sysctl -w vm.min_free_kbytes=$MFK; busybox sysctl -w vm.oom_kill_allocating_task=0; busybox sysctl -w vm.panic_on_oom=0; busybox sysctl -w vm.overcommit_memory=1; busybox sysctl -w vm.swappiness=20; busybox sysctl -w kernel.panic_on_oops=1; busybox sysctl -w kernel.panic=30; ################################# # 3G TurboCharger Enhancment! # ################\$################ EOF if [ "$misc3g" -eq 1 ]; then cat >> $sc <<EOF busybox sysctl -w net.core.wmem_max=1048576; busybox sysctl -w net.core.rmem_max=1048576; busybox sysctl -w net.core.optmem_max=20480; busybox sysctl -w net.ipv4.tcp_moderate_rcvbuf=1; # Be sure that autotuning is in effect busybox sysctl -w net.ipv4.route.flush=1; busybox sysctl -w net.ipv4.udp_rmem_min=6144; busybox sysctl -w net.ipv4.udp_wmem_min=6144; busybox sysctl -w net.ipv4.tcp_rmem='6144 87380 1048576'; busybox sysctl -w net.ipv4.tcp_wmem='6144 87380 1048576'; EOF fi cat >> $sc <<EOF echo ""; echo \$line; echo ""; fi; currentadj=\`cat /sys/module/lowmemorykiller/parameters/adj\`; currentminfree=\`cat /sys/module/lowmemorykiller/parameters/minfree\`; scadj=\`cat /data/V6_SuperCharger/SuperChargerAdj\`; scminfree=\`cat /data/V6_SuperCharger/SuperChargerMinfree\`; if [ "\$scminfree" ] && [ "\$currentminfree" != "\$scminfree" ] || [ "\$scadj" ] && [ "\$currentadj" != "\$scadj" ]; then chmod 777 /sys/module/lowmemorykiller/parameters/adj; chmod 777 /sys/module/lowmemorykiller/parameters/minfree; echo \$scadj > /sys/module/lowmemorykiller/parameters/adj; if [ "\$scminfree" ]; then echo \$scminfree > /sys/module/lowmemorykille r/parameters/minfree; fi; EOF if [ "$buildprop" -eq 0 ]; then echo " sed -i '/.*_ADJ/d' /syst em/build.prop;" >> $sc echo " sed -i '/.*_MEM/d' /syst em/build.prop;" >> $sc if [ -f "/system/bin/build.prop" ]; then echo " sed -i '/.*_ADJ/

d' /system/bin/build.prop;" >> $sc echo " sed -i '/.*_MEM/ d' /system/bin/build.prop;" >> $sc fi fi cat >> $sc <<EOF echo " \$( date +"%m-%d-%Y %H:%M:%S" ): Applied settings from \$0!" >> / data/Ran_SuperCharger.log; echo " SuperCharger Settings Applied!"; elif [ "\`pgrep -l android\`" ]; then echo " \$( date +"%m-%d-%Y %H:%M:%S" ): No need to apply settings from \ $0!" >> /data/Ran_SuperCharger.log; echo " SuperCharger Settings Were ALREADY Applied!"; fi; echo ""; echo " \$0 Executed..."; EOF if [ "$sc" = "/data/99SuperCharger.sh" ] ; then cat >> $sc <<EOF echo ""; echo " ==========================="; echo " ) SuperCharge Complete! ("; echo " ==========================="; if [ "\$terminate" ]; then busybox mount -o remount,ro /system 2>/dev/null; busybox mount -o remount,ro \`busybox mount | grep system | awk '{print \$1,\$3}' | sed -n 1p\` 2>/dev/null; stop super_service; else \$0 & exit 0; fi; sleep 60; sed -i 's/# exec >/exec >/' /data/V6_SuperCharger/!FastEngineFlush.sh 2>/dev/nul l; sh /data/V6_SuperCharger/!FastEngineFlush.sh & 2>/dev/null; sleep 1; sed -i 's/exec >/# exec >/' /data/V6_SuperCharger/!FastEngineFlush.sh 2>/dev/nul l; EOF else cat >> $sc <<EOF #busybox mount -o remount,ro /system 2>/dev/null; #busybox mount -o remount,ro \`busybox mount | grep system | awk '{print \$1,\$3 }' | sed -n 1p\` 2>/dev/null; sh /system/etc/init.d/*KickAssKernel & 2>/dev/null; sh /data/99SuperCharger.sh & 2>/dev/null; EOF fi echo "# End of V6 SuperCharged Entries." >> $sc fi done chown 0.0 /data/99SuperCharger.sh; chmod 777 /data/99Sup erCharger.sh if [ "$rcpaths" ] || [ "$ics" -eq 0 ] && [ "$initrc" -eq 1 ] && [ -d "/system/etc/init.d" ]; then echo " For Super Stickiness..." echo "" $sleep fi if [ -d "/system/etc/init.d" ]; then cp -fr /data/99Supe rCharger.sh /system/etc/init.d/99SuperCharger echo " SuperCharging /system/etc/init.d folder..

." echo "" $sleep if [ ! "`diff /data/99SuperCharger.sh /system/et c/init.d/99SuperCharger`" ]; then sed -i 's/# echo/echo/' /system/etc/init .d/99SuperCharger sed -i 's/# set -x/set -x/' /system/etc/ init.d/99SuperCharger sed -i '/Log_SuperCharger/s/# exec/exec/ ' /system/etc/init.d/99SuperCharger sed -i '/super_service;/s/^/#/' /system/ etc/init.d/99SuperCharger sed -i '/terminate=/ a\ # sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!WheelAlignment.sh 2>/dev/null;\ # sh /data/V6_SuperCharger/!WheelAlignment.sh & 2>/dev/null; sleep 1;\ # sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!WheelAlignment.sh 2>/dev/null;' /system/etc/init.d/99SuperCharger sed -i '/busybox mount -o remount,rw `bu sybox mount/ a\ mv \$0 /system/etc/init.d/99SuperCharger;\ for i in \`busybox ls -r /system/etc/init.d\`; do\ if [ "\$j" ]; then break; fi;\ if [ ! -d "\$i" ]; then j=\$i; fi;\ done;\ echo " SuperCharger to run on boot as...";\ echo "";\ echo \$line;\ if [ "\$j" = "S98KickAssKernel" ] || [ "\$j" = "SS98KickAssKernel" ] && [ "\$i" \\\< "99SuperCharger1" ] || [ "\$j" \\\< "99SuperCharger1" ]; then\ echo " .../system/etc/init.d/99SuperCharger!";\ elif [ "\$j" = "SS98KickAssKernel" ] && [ "\$i" \\\< "S99SuperCharger" ] || [ "\ $j" \\\< "S99SuperCharger" ]; then\ mv /system/etc/init.d/99SuperCharger /system/etc/init.d/S99SuperCharger; \ echo " .../system/etc/init.d/S99SuperCharger!";\ else\ mv /system/etc/init.d/99SuperCharger /system/etc/init.d/SS99SuperCharger ;\ echo " .../system/etc/init.d/SS99SuperCharger!";\ fi;\ echo \$line;\ echo "";' /system/etc/init.d/99SuperCharger sed -i '/sleep 60;/ i\ sh /system/etc/init.d/*KickAssKernel & 2>/dev/null;\ sh /data/99SuperCharger.sh & 2>/dev/null;\ # sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2>/dev/ null;\ # sh /data/V6_SuperCharger/!FixEmissions.sh & 2>/dev/null; sleep 1;\ # sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2>/dev/ null;' /system/etc/init.d/99SuperCharger sed -i '/sleep 60;/ a\ # sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/nul l;\ # sh /data/V6_SuperCharger/!Detailing.sh & 2>/dev/null; sleep 1;\ # sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/nul l; sleep 480;' /system/etc/init.d/99SuperCharger if [ "$fixemissions" -eq 1 ]; then sed i '/!FixEmissions.sh/s/^# //' /system/etc/init.d/99SuperCharger; fi

if [ "$zepalign" -eq 1 ]; then sed -i '/ !WheelAlignment.sh/s/^#//' /system/etc/init.d/99SuperCharger; fi if [ "$detailing" -eq 1 ]; then sed -i ' /!Detailing.sh/s/^# //' /system/etc/init.d/99SuperCharger; fi j= for i in `busybox ls -r /system/etc/init .d`; do if [ "$j" ]; then break; fi if [ ! -d "$i" ]; then j=$i; fi done if [ "$j" = "S98KickAssKernel" ] || [ "$ j" = "SS98KickAssKernel" ] && [ "$i" \< "99SuperCharger1" ] || [ "$j" \< "99Supe rCharger1" ]; then echo " ...with /system/etc/i nit.d/99SuperCharger!" elif [ "$j" = "SS98KickAssKernel" ] && [ "$i" \< "S99SuperCharger" ] || [ "$j" \< "S99SuperCharger" ]; then mv /system/etc/init.d/99SuperCha rger /system/etc/init.d/S99SuperCharger echo " ...with /system/etc/in it.d/S99SuperCharger!" else mv /system/etc/init.d/99SuperCha rger /system/etc/init.d/SS99SuperCharger echo " ...with /system/etc/ini t.d/SS99SuperCharger!" fi else echo " WARNING: ERROR copying file to /s ystem/init.d!" echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /system | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" fi echo "" else echo " You have no /system/etc/init.d folder..." echo "" $sleep echo $line echo " ...so instead, use /data/99SuperCharge r.sh!" echo $line echo "" $sleep echo " Stock ROM? - Additional Configuration Req uired!" echo "" $sleep if [ "$opt" -le 10 ]; then echo -n " Some Changes are TEMPORARY & " if [ "$allrcpaths" ]; then echo "MAY NOT PERSIST!" else echo "WON'T PERSIST!" fi echo ""

$sleep echo " To enable PERSISTENT SuperCharger settings...." echo "" $sleep echo " ping Fixes..." else echo " To enable PERSISTENT OOM Grouping Fi xes..." fi echo "" $sleep if [ "$allrcpaths" ]; then echo " ...The SuperCharger Service should work!" echo "" $sleep echo " BUT if it doesn't..." echo "" $sleep fi if [ "$smrun" ]; then SuperChargerScriptManagerHelp=1 cat > /sdcard/SuperChargerScriptManagerH elp.html <<EOF Yay! You already have <a href="http://play.google.com/store/apps/details?id=os.t ools.scriptmanager">Script Manager!</a><br> After running the script, have Script Manager load the newly created <b>/data/99 SuperCharger.sh</b> on boot<br> In the "Config" settings, enable "Browse as Root."<br> Press the menu key and then Browser.<br> Navigate up to the root, then click on the "data" folder.<br> Click on 99SuperCharger.sh and select "Script" from the "Open As" menu.<br> In the properties dialogue box, check "Run as root" (ie. SuperUser) and "Run at boot" and "Save".<br> And that's it!<br> Script Manager will load your most recent settings on boot!<br> <br> Another option is to make a Script Manager widget for <b>/data/99SuperCharger.sh </b> on your homescreen and simply launch it after each reboot.<br> <br> If you run the script later and with different settings, you don't have to recon figure anything.<br> Script Manager will just load the new /data/99SuperCharger.sh on boot automagica lly ;^]<br> <br> For more SuperCharging help and info,<br> See the <a href="http://goo.gl/qM6yR">V6 SuperCharger Thread</a><br> Feedback is Welcome!<br> <br> -=zeppelinrox=- @ <a href="http://goo.gl/qM6yR">XDA</a> & <a href="http://www.dr oidforums.net/forum/droid-hacks/148268-script-v6-supercharger-htk-bulletproof-la unchers-fix-memory-all-androids.html">Droid</a> Forums<br> EOF echo "Use THIS app to load 99SuperCharge r.sh on boot!" echo "" $sleep echo $line echo " See /sdcard/SuperChargerScriptMan ...and OOM Grou

agerHelp.html" else echo " ..Please ENABLE boot scripts to b e run from..." echo " nit.d folder!" echo " Easier: Script Manager can solve everything ;)" echo "" $sleep SuperChargerHelp=1 cat > /sdcard/SuperChargerHelp.html <<EO F To enable init.d boot scripts, go <a href="http://goo.gl/rZTyW">HERE</a><br> This is for Motorolas! At least some of them anyway.<br> If that page is incompatible with your phone, do some reasearch!<br> <br> A very nice and easy solution is to simply use<br> Script Manager to load scripts on boot - on ANY ROM!<br> Here is the <a href="http://play.google.com/store/apps/details?id=os.tools.scrip tmanager">Google Play Link</a><br> So first, you use Script Manager to run the V6 SuperCharger script.<br> Then use it again to load the newly created <b>/data/99SuperCharger.sh</b> on bo ot<br> In the 99SuperCharger.sh properties dialogue box, check "Run as root" (ie. Super User) and "Run at boot" and "Save".<br> And that's it!<br> Script Manager will load your most recent settings on boot!<br> <br> Another option is to make a Script Manager widget for <b>/data/99SuperCharger.sh </b> on your homescreen and simply launch it after each reboot.<br> <br> If you run the script later and with different settings, you don't have to recon figure anything.<br> Script Manager will just load the new /data/99SuperCharger.sh on boot automagica lly ;^]<br> <br> For more SuperCharging help and info,<br> See the <a href="http://goo.gl/qM6yR">V6 SuperCharger Thread</a><br> Feedback is Welcome!<br> <br> -=zeppelinrox=- @ <a href="http://goo.gl/qM6yR">XDA</a> & <a href="http://www.dr oidforums.net/forum/droid-hacks/148268-script-v6-supercharger-htk-bulletproof-la unchers-fix-memory-all-androids.html">Droid</a> Forums<br> EOF echo $line echo "See /sdcard/SuperChargerHelp.html for more help!" fi fi echo $line if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1 ]; then if [ "$allrcpaths" ] && [ ! "$scsinfo" ]; then if [ -d "/system/etc/init.d" ]; then echo "" $sleep echo " And for added, Auto Insur ance..." echo "" $sleep .../system/etc/i

echo $line fi if [ ! "$scservice" ]; then echo " Insta lling SuperCharger Service to..." else echo " SuperCharger Service had bee n installed to..." fi echo $line echo "" $sleep fi for scs in $initrcpath $allrcpaths; do cat >> $scs <<EOF # SuperCharger_Service created by zeppelinrox. # # DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE! ################################ # SuperCharger Service Notes # ################################ # To restart the SuperCharger Service so it stays running, run Terminal Emulator and type... # "su" and Enter. # "start super_service" and Enter. # # To stop the SuperCharger Service, type... # "su" and Enter. # "stop super_service" and Enter. # # If the service is running and you type: "cat /proc/*/cmdline | grep Super". # The output would be 2 lines: # /data/99SuperCharger.sh # Super # # If it's not running, the output would be the last item ie. "Super" which was g enerated by the typed command. # service super_service /system/bin/sh /data/99SuperCharger.sh class post-zygote_services user root group root # # End of SuperCharged_Service Entries. EOF if [ "$scs" != "$initrcpath" ] && [ ! "$ scsinfo" ]; then echo " ...$scs!"; fi if [ ! "$scservice" ]; then $sleep; fi done if [ "$allrcpaths" ] && [ ! "$scsinfo" ]; then echo "" echo $line echo "" $sleep echo " You can leave the service on by e ither..." echo "" $sleep echo " ...reading comments in /data/99Su perCharger.sh" echo "" $sleep

echo " Or... Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and E nter..." echo " echo "" $sleep echo " ce\" and Enter." echo " =" echo "" $sleep echo " To stop the SuperCharger Service. .." echo "" $sleep echo " ce\" and Enter." echo " =" echo "" echo $line echo "" $sleep echo "If the service is running and you type..." echo "" $sleep echo " | grep Super\"" echo "" $sleep echo " The output would look like this:" echo "" $sleep echo " /data/99SuperCharger.sh" echo " Super" echo "" echo $line elif [ ! "$allrcpaths" ] && [ ! "$scsinfo" ]; th en echo $line echo " SuperCharger Service Entries I nstalled!" echo $line echo "" $sleep echo " This won't work on this ROM but.. . " echo "" $sleep echo " g into a ROM!" echo "" $sleep echo " Just read the comments in $initrc path :)" echo "" ...it makes for easy cookin ...\"cat /proc/*/cmdline ================= ...type \"stop super_servi ================== ==" ...type \"start super_servi

echo $line fi echo "" $sleep echo " Setting LowMemoryKiller to..." echo "" $sleep echo " ...$MB1, $MB2, $MB3, $MB4, $MB5, $MB6 MB" echo "" $sleep echo "$scminfree" > /sys/module/lowmemorykiller/ parameters/minfree currentminfree=`cat /sys/module/lowmemorykiller/ parameters/minfree` echo " OOM Minfree levels are now set to..." echo "" $sleep echo " ..."$currentminfree echo "" if [ "$newlauncher" -eq 0 ]; then $sleep echo $line echo " SUPERCHARGE IN EFFECT IMMEDI ATELY!!" fi echo $line echo "" $sleep cat > "/data/V6_SuperCharger/PowerShift_Scripts/ $CONFIG-($MB1,$MB2,$MB3,$MB4,$MB5,$MB6)-PowerShift.sh" <<EOF #!/system/bin/sh # # PowerShift Script for use with The V6 SuperCharger created by zeppelinrox. # SuperMinFree Calculator & MFK Calculator (for min_free_kbytes) created by zepp elinrox also ;^] # # See http://goo.gl/krtf9 - Linux Memory Consumption - Nice article! # See http://goo.gl/hFdNO - Memory and SuperCharging Overview ...or... "Why 'Fre e RAM' Is NOT Wasted RAM!" # See http://goo.gl/4w0ba - MFK Calculator Info - explanation for vm.min_free_kb ytes. # line================================================= clear echo "" echo \$line echo " The -=V6 SuperCharger=- by -=zeppelinrox=-" echo \$line echo "" sleep 1 if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then sleep 2 echo " You are NOT running this script as root..." echo "" sleep 3 echo \$line echo " ...No SuperUser for you!!" echo \$line echo ""

sleep 3 echo " ...Please Run as Root and try again..." echo "" echo \$line echo "" sleep 3 exit 69 fi busybox mount -o remount,rw /data 2>/dev/null busybox mount -o remount,rw /system 2>/dev/null busybox mount -o remount,rw \`busybox mount | grep system | awk '{print \$1,\$3} ' | sed -n 1p\` 2>/dev/null echo " PowerShifting to a different gear!" echo "" sleep 1 echo \$line awk -F , '{print " Current Minfrees = "\$1/256","\$2/256","\$3/256","\$4/256", "\$5/256","\$6/256" MB"}' /sys/module/lowmemorykiller/parameters/minfree echo \$line echo "" sleep 1 echo " Setting LowMemoryKiller to..." echo "" sleep 1 echo \$line echo " ...$MB1, $MB2, $MB3, $MB4, $MB5, $MB6 MB" echo \$line echo "" sleep 1 echo $scminfree > /sys/module/lowmemorykiller/parameters/minfree echo $scminfree > /data/V6_SuperCharger/SuperChargerMinfree echo " OOM Minfree levels are now set to..." echo "" sleep 1 echo " ...\`cat /sys/module/lowmemorykiller/parameters/minfree\`" echo "" sleep 1 echo " They are also your new SuperCharger values!" echo "" echo \$line echo "" sleep 1 echo " Applying Updated Kernel/Memory Tweaks..." echo "" sleep 1 echo -n " ...";busybox sysctl -w vm.min_free_kbytes=$MFK echo "" sleep 1 echo \$line echo " Updating MFK in *99SuperCharger Boot Scripts..." echo \$line echo "" sleep 1 sed -i 's/vm.min_free_kbytes=.*/vm.min_free_kbytes=$MFK;/' /system/etc/init.d/*S uperCharger* 2>/dev/null sed -i 's/free_kbytes\`" -ne .* ] /free_kbytes\`" -ne $MFK ] /' /system/etc/init .d/*SuperCharger* 2>/dev/null sed -i 's/vm.min_free_kbytes=.*/vm.min_free_kbytes=$MFK;/' /data/99SuperCharger. sh 2>/dev/null sed -i 's/free_kbytes\`" -ne .* ] /free_kbytes\`" -ne $MFK ] /' /data/99SuperCha

rger.sh echo " echo " echo " echo "" busybox busybox ' | sed exit 0 EOF

2>/dev/null ===========================" ) PowerShift Completed! (" ===========================" mount -o remount,ro /system 2>/dev/null mount -o remount,ro \`busybox mount | grep system | awk '{print \$1,\$3} -n 1p\` 2>/dev/null

chown 0.0 /data/V6_SuperCharger/PowerShift_Scrip ts/*; chmod 777 /data/V6_SuperCharger/PowerShift_Scripts/* echo " A PowerShift Script was saved as..." echo "" $sleep echo " $CONFIG-($MB1,$MB2,$MB3,$MB4,$MB5,$MB6)-P owerShift.sh!" echo "" $sleep echo " Goto data/V6_SuperCharger/PowerShift_Scri pts.." echo "" $sleep echo " ...make a \"Quick Widget\" fo r it..." echo "" $sleep echo " ...and PowerShift between sett ings!" echo "" $sleep echo " They'll also be your new SuperCharger va lues!" echo "" echo $line scsinfo=shown fi echo "$scadj" > /sys/module/lowmemorykiller/parameters/a dj if [ "$newlauncher" -eq 1 ]; then $sleep echo " LAUNCHER CHANGE DETECTED!" echo $line echo "" $sleep echo " REBOOT NOW TO ENABLE..." echo "" $sleep if [ "$launcheradj" -eq 0 ]; then echo " ...BULLETPROOF LAUNCHER..." elif [ "$launcheradj" -eq 2 ]; then echo " ...HARD TO KILL LAUNCHER..." else echo " ...DIE-HARD LAUNCHER..." fi echo "" $sleep echo " ...AND OOM GROUPING F IXES!" echo "" $sleep

echo $line fi if [ "$SuperChargerHelp" -eq 1 ]; then $sleep echo " RUN /data/99SuperCharger.sh AFTER EACH RE BOOT!" elif [ "$SuperChargerScriptManagerHelp" -eq 1 ]; then $sleep echo " DON'T FORGET to have Script Manager load. .." echo " boot!" echo " r it!" elif [ "$opt" -le 10 ] || [ "$ics" -eq 1 ] || [ "$ReSupe rCharge" -eq 1 ]; then $sleep if [ "$ReSuperCharge" -eq 1 ]; then echo -n " Re stored" else echo -n "$CONFIG" fi echo " Settings WILL PERSIST after reboot!" echo $line echo "" $sleep echo " If they don't persist, read the Owner's G uide!" echo "" else echo "" $sleep echo " If OOM Fixes are't in effect after a rebo ot..." echo "" $sleep echo " ak..." echo "" $sleep echo " uide!" echo "" fi echo $line echo "" $sleep echo " SO... you know if it works or not by..." echo "" $sleep echo " ...READING THE INFO Under The Driver's Console!" echo "" $sleep echo $line echo " PLEASE: READ THE ABOVE MESSAGES BEFORE ASKING!" echo $line echo "" $sleep echo " Because I may SNAP and call you names! ;o]" echo "" echo $line ...read the Owner's G ...and the Launcher is we ...or make a Script Manager WIDGET fo .../data/99SuperCharger.sh on

echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" fi if [ -f "/system/bin/build.prop" ]; then cp -fr /system/build.pr op /system/bin; fi if [ "$opt" -ne 15 ]; then if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1 ] || [ "$ics" -eq 1 ]; then ran=1; fi if [ -f "$initrcpath" ] && [ "$initrc" -eq 1 ]; then cp -fr $initrcpath $initrcpath1; fi echo " Backing up refreshed files to SD Card..." echo "" $sleep if [ -d "/data/V6_SuperCharger" ]; then cp -fr /data/V6_ SuperCharger /sdcard; fi for rc in $initrcpath $allrcpaths; do cp -fr $rc* /sdcar d/V6_SuperCharger; done if [ -f "/data/99SuperCharger.sh" ]; then cp -fr /data/9 9SuperCharger.sh /sdcard/V6_SuperCharger; fi if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then cp -fr /system/etc/init.d/*SuperCharger* /sdcard/V6_SuperCharger; fi 2>/dev/null if [ "`ls /system/build.prop*`" ]; then cp -fr /system/b uild.prop* /sdcard/V6_SuperCharger; fi 2>/dev/null if [ "`ls /data/local.prop*`" ]; then cp -fr /data/local .prop* /sdcard/V6_SuperCharger; fi 2>/dev/null if [ "`ls /system/etc/hw_config.sh*`" ]; then cp -fr /sy stem/etc/hw_config.sh* /sdcard/V6_SuperCharger; fi 2>/dev/null if [ "`ls /system/etc/ram.conf*`" ]; then cp -fr /system /etc/ram.conf* /sdcard/V6_SuperCharger; fi 2>/dev/null echo " ...Re-SuperCharger backup complete!" echo "" if [ "$rebulletproof" ] && [ "$allrcpaths" ]; then opt=1 7 elif [ "$newsupercharger" ] || [ "$ics" -eq 1 ]; then echo $line echo "" $sleep if [ "$ics" -eq 0 ]; then opt=32 if [ "$resuperable" ] || [ "$ReSuperChar ge" -eq 1 ]; then echo " Re-SuperCharger is ALMOST done!" else echo " I think this is your FIRST S uperCharge..." fi else if [ "$icssced" ] || [ "$servicesjarinst alled" ]; then echo " I Scream SUPERCHARGED!" else echo " Now off to the \"ICS Service Centre\"..."; opt=25 fi fi echo "" $sleep resuperable= fi fi fi if [ "$opt" -eq 16 ] || [ "$opt" -eq 17 ]; then

if [ "$opt" -eq 16 ]; then echo " Does Your OOM Stick?!" echo " =====================" echo "" $sleep echo " Find Out Here... AND Find Your Home Launcher!!" echo "" $sleep echo " Choose from 2 bitchin' OOM Sticks..." echo "" $sleep echo " zOOM Stick (Quick) Mode is faster..." echo "" $sleep echo " ...it shows App Name, Priority (ADJ), and PID!" echo "" $sleep echo " vrOOM Stick (Verbose) mode is slower..." echo "" $sleep echo " ...but adds Path and/or Apk file info!" echo "" echo $line echo "" $sleep echo " Do you want vrOOM or zOOM Stick mode?" echo "" $sleep echo -n " Enter V for vrOOM, any key for zOOM: " read chooseverifier echo "" echo $line case $chooseverifier in v|V)echo " vrOOM Stick Verifier (Verbose) selected..." vroomverifier=1;; *)echo " zOOM Stick Verifier (Quick) selected... " vroomverifier=0;; esac fi if [ "$opt" -eq 17 ] && [ ! "$rebulletproof" ] && [ "$bpapplist" ] && [ "`cat /proc/*/cmdline | grep Bullet`" != "Bullet" ]; then echo " You are currently BulletProofing..." echo "" $sleep for bpapp in $bpapplist; do echo " $bpapp"; don e echo "" echo $line echo "" $sleep echo " Un-BulletProof Previously BulletProofed Apps?" echo "" $sleep echo " You can Un-BulletProof All or Individually ;^]" echo "" $sleep echo " \"One-Shot\" scripts will remain untouched..." echo "" $sleep

echo -n " Enter Y for Yes, any key for No: " read unbp echo "" echo $line case $unbp in y|Y)while :;do echo "" $sleep echo -n " Un-BulletProof (A)ll (I)ndivid ually E(X)it? " read unbpopt echo "" echo $line case $unbpopt in a|A)if [ "`ls /data/V6_SuperCharger/Bu lletProof_Apps*.sh`" ]; then rm /data/V6_SuperCharger/BulletProof_Apps*.sh; fi 2 >/dev/null if [ "`ls /data/V6_SuperCharge r/BulletProof_Apps*`" ]; then rm /data/V6_SuperCharger/BulletProof_Apps*; fi 2>/ dev/null if [ "`ls /data/*BulletProof_A pps*`" ]; then rm /data/*BulletProof_Apps*; fi 2>/dev/null if [ "`ls /system/etc/init.d/* BulletProof_Apps*`" ]; then rm /system/etc/init.d/*BulletProof_Apps*; fi 2>/dev/ null echo " Un-BulletProo fed ALL Apps!" bpapplist=; opt=16 break;; i|I)for unbpapp in $bpapplist; do echo "" $sleep echo " Un-Bulletproof $u nbpapp?" echo "" echo -n " Enter Y for Ye s, any key for No: " read unbpone echo "" echo $line case $unbpone in y|Y)sed -i '/Begin '$u nbpapp'/,/End '$unbpapp'/d' /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh sed -i '/'$unb papp'/d' /data/V6_SuperCharger/BulletProof_Apps_HitList echo " Un-Bull etProofed $unbpapp!" echo $line;; *);; esac done bpapplist=`cat /data/V6_SuperC harger/BulletProof_Apps_HitList` echo "" $sleep echo " Here's Your Updated Hit List!" echo "" $sleep for bpapp in $bpapplist; do ec

ho "

$bpapp"; done echo "" showedbpapplist=yes; opt=16 break;; x|X)echo " Ok... let's BulletPro

of something!" break;; *)echo " lease try again :p" echo $line;; esac done;; *)echo " esac if [ "$opt" -eq 17 ]; then echo $line echo "" $sleep fi fi if [ "$opt" -eq 17 ] && [ ! "$rebulletproof" ]; then echo " This will attempt to lock an app in memory!" echo "" $sleep echo " Do you want to view the current process list?" echo "" $sleep echo " You can BulletProof Apps without viewing it!" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read bp echo "" echo $line case $bp in n|N)echo " Okay... I hope you know what process to ent er!" bpblind=yes;; *)echo " Loading zOOM Stick Verifier (Quick)..." vroomverifier=0;; esac fi if [ "$vroomverifier" ]; then echo $line echo "" $sleep echo " =================================" echo "----=== zeppelinrox's bOOM Stick Verifier ===---" echo " =================================" echo "" $sleep oomadj1=`awk -F , '{print $1}' /sys/module/lowmemorykill er/parameters/adj`;oomadj2=`awk -F , '{print $2}' /sys/module/lowmemorykiller/pa rameters/adj`;oomadj3=`awk -F , '{print $3}' /sys/module/lowmemorykiller/paramet ers/adj`;oomadj4=`awk -F , '{print $4}' /sys/module/lowmemorykiller/parameters/a dj`;oomadj5=`awk -F , '{print $5}' /sys/module/lowmemorykiller/parameters/adj`;o omadj6=`awk -F , '{print $6}' /sys/module/lowmemorykiller/parameters/adj` if [ "$vroomverifier" -eq 0 ]; then echo " Using zOOM Stick Mode (Quick)..."; echo " "; $sleep Cool Beans!";; Invalid entry... P

echo " ADJ PID else o ""; $sleep echo " ADJ PID fi echo echo echo if [

Process"

echo " Using vrOOM Stick Mode (Verbose)..."; ech Process/Path (APK)"

"" " FOREGROUND_APP OOM GROUPING" " ===========================" "$HL" -gt -18 ] && [ "$HL" -lt "$oomadj1" ]; then echo "" echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)" echo ""

fi for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$i/oom_ad j" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -gt -18 ] && [ "`cat /proc/$i/oom_adj`" -lt "$oomadj1" ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ " $lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the NEXT line ! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/.*\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $app name" else # apkname=`su -c "LD_LIBRARY_PATH=/vendor/ lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=.*//'"` apkname=`busybox find / -iname "*$appnam e*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i/cmdline `" echo " ($apkname)" else echo " `cat /proc/$i/cmdline`" fi fi fi done if [ "$HL" -eq "$oomadj1" ]; then echo "" echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)" echo "" fi for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$i/oom_ad j" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -eq "$oomadj1 " ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ " $lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the NEXT line ! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/.*\///'` echo -n " `cat /proc/$i/oom_adj` "

echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $app name" else # apkname=`su -c "LD_LIBRARY_PATH=/vendor/ lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=.*//'"` apkname=`busybox find / -iname "*$appnam e*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i/cmdline `" echo " ($apkname)" else echo " `cat /proc/$i/cmdline`" fi fi fi done echo "" if [ "$scadj" ] && [ "$currentadj" = "$scadj" ] && [ "$o omstick" -eq 1 ] && [ "$HL" -ne "$oomadj1" ]; then echo " HOME_LAUNCHER OOM GROUPING!" echo " ===========================" for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$ i/oom_adj" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -gt " $oomadj1" ] && [ "`cat /proc/$i/oom_adj`" -lt "$oomadj2" ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ "$lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the N EXT line! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/. *\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $appname" else apkname=`su -c "LD_LIBRARY_PATH= /vendor/lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=. *//'"` # apkname=`busybox find / -iname " *$appname*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i /cmdline`" echo " ($apkname)" else echo " `cat /proc/$i/cmdli ne`" fi fi if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ]; then echo ""; fi fi done echo "" echo " VISIBLE_APP OOM GROUPING" echo " ========================" for i in `ls /proc`; do

if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$ i/oom_adj" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -eq " $oomadj2" ]; then appname=`cat /proc/$i/cmdline | sed 's/. *\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $appname" else # apkname=`su -c "LD_LIBRARY_PATH= /vendor/lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=. *//'"` apkname=`busybox find / -iname " *$appname*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i /cmdline`" echo " ($apkname)" else echo " `cat /proc/$i/cmdli ne`" fi fi fi done else echo " VISIBLE_APP OOM GROUPING" echo " ========================" if [ "$HL" -gt "$oomadj1" ] && [ "$HL" -le "$oom adj2" ]; then echo "" echo " HOME LAUNCHER IS IN HERE! (ADJ=$H L)" echo "" fi for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$ i/oom_adj" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -gt " $oomadj1" ] && [ "`cat /proc/$i/oom_adj`" -le "$oomadj2" ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ "$lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the N EXT line! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/. *\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $appname" else # apkname=`su -c "LD_LIBRARY_PATH= /vendor/lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=. *//'"` apkname=`busybox find / -iname " *$appname*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i /cmdline`"

echo " ($apkname)" else echo " `cat /proc/$i/cmdli ne`" fi fi fi done fi echo echo echo if [ then echo "" echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)" echo "" fi for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$i/oom_ad j" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -gt "$oomadj2 " ] && [ "`cat /proc/$i/oom_adj`" -le "$oomadj3" ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ " $lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the NEXT line ! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/.*\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $app name" else # apkname=`su -c "LD_LIBRARY_PATH=/vendor/ lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=.*//'"` apkname=`busybox find / -iname "*$appnam e*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i/cmdline `" echo " ($apkname)" else echo " `cat /proc/$i/cmdline`" fi fi fi done echo "" echo " HIDDEN_APP OOM GROUPING" echo " =======================" if [ "$HL" -gt "$oomadj3" ] && [ "$HL" -le "$oomadj4" ]; then echo "" echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)" echo "" fi for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$i/oom_ad j" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -gt "$oomadj3 " ] && [ "`cat /proc/$i/oom_adj`" -le "$oomadj4" ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ " "" " SECONDARY_SERVER OOM GROUPING" " =============================" "$HL" -gt "$oomadj2" ] && [ "$HL" -le "$oomadj3" ];

$lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the NEXT line ! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/.*\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $app name" else # apkname=`su -c "LD_LIBRARY_PATH=/vendor/ lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=.*//'"` apkname=`busybox find / -iname "*$appnam e*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i/cmdline `" echo " ($apkname)" else echo " `cat /proc/$i/cmdline`" fi fi fi done echo "" echo " CONTENT_PROVIDER OOM GROUPING" echo " =============================" if [ "$HL" -gt "$oomadj4" ] && [ "$HL" -le "$oomadj5" ]; then echo "" echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)" echo "" fi for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$i/oom_ad j" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -gt "$oomadj4 " ] && [ "`cat /proc/$i/oom_adj`" -le "$oomadj5" ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ " $lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the NEXT line ! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/.*\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $app name" else # apkname=`su -c "LD_LIBRARY_PATH=/vendor/ lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=.*//'"` apkname=`busybox find / -iname "*$appnam e*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i/cmdline `" echo " ($apkname)" else echo " `cat /proc/$i/cmdline`" fi fi

fi done echo echo echo if [ then

"" " EMPTY_APP OOM GROUPING" " ======================" "$HL" -gt "$oomadj5" ] && [ "$HL" -le "$oomadj6" ]; echo "" echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)" echo ""

fi for i in `ls /proc`; do if [ "$i" -ne 0 ] 2>/dev/null && [ -f "/proc/$i/oom_ad j" ] && [ "`cat /proc/$i/cmdline`" ] && [ "`cat /proc/$i/oom_adj`" -gt "$oomadj5 " ] && [ "`cat /proc/$i/oom_adj`" -le "$oomadj6" ]; then if [ "`cat /proc/$i/oom_adj`" -eq "$HL" ] && [ " $lname" = "`cat /proc/$i/cmdline`" ]; then echo "" echo " Home Launcher is on the NEXT line ! (ADJ=$HL)" fi appname=`cat /proc/$i/cmdline | sed 's/.*\///'` echo -n " `cat /proc/$i/oom_adj` " echo -n $i if [ "$vroomverifier" -eq 0 ]; then echo " $app name" else # apkname=`su -c "LD_LIBRARY_PATH=/vendor/ lib:/system/lib pm list packages -f $appname | sed 's/.*://' | sed 's/=.*//'"` apkname=`busybox find / -iname "*$appnam e*.apk" -maxdepth 3 | tail -n 1` if [ "$apkname" ]; then echo -n " `cat /proc/$i/cmdline `" echo " ($apkname)" else echo " `cat /proc/$i/cmdline`" fi fi fi done echo "" if [ "$opt" -eq 16 ]; then echo $line; echo " zOOM Stick Complete!" elif [ "$vroomverifier" -eq 1 ]; then echo $line; echo " vrOOM Stick Complete!" fi fi if [ "$vroomverifier" ] && [ "$opt" -eq 17 ] || [ "$bpblind" ] | | [ "$rebulletproof" ]; then if [ "$rebulletproof" ] && [ "$allrcpaths" ]; then echo $line echo " Installing BulletProof Apps Service to... " echo $line echo "" $sleep fi for bps in $initrcpath $allrcpaths; do sed -i '/BulletProof_Apps_Service/,/BulletProofe d_Apps_Service/d' $bps

cat >> $bps <<EOF # BulletProof_Apps_Service created by zeppelinrox. # # DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE! #################################### # BulletProof Apps Service Notes # #################################### # To stop the BulletProof Apps Service, run Terminal Emulator and type... # "su" and Enter. # "stop bullet_service" and Enter. # # To restart the BulletProof Apps Service, type... # "su" and Enter. # "start bullet_service" and Enter. # # If the service is running and you type: "cat /proc/*/cmdline | grep Bullet". # The output would be 3 lines: # /data/97BulletProof_Apps.sh # BulletProof_Apps_is_In_Effect! # Bullet # # If it's not running, the output would be the last item ie. "Bullet" which was generated by the typed command. # service bullet_service /system/bin/sh /data/97BulletProof_Apps.sh class post-zygote_services user root group root # # End of BulletProofed_Apps_Service Entries. EOF cp -fr $bps /sdcard/V6_SuperCharger if [ "$bps" != "$initrcpath" ] && [ "$rebulletpr oof" ] && [ "$allrcpaths" ]; then echo " ...$bps!"; $sleep; fi done if [ "$rebulletproof" ] && [ "$allrcpaths" ]; then echo "" if [ "$resuperable" ] || [ "$ics" -eq 1 ]; then echo $line echo "" $sleep if [ "$ics" -eq 0 ]; then opt=32 echo " Re-SuperCharger is ALMOST done!" else if [ "$icssced" ] || [ "$service sjarinstalled" ]; then echo " I Scream SUPERCHARGED!" else echo " Now off to the \"ICS Service Centre\"..."; opt=25 fi fi echo "" $sleep else newsupercharger=; opt=24 fi resuperable=; rebulletproof= fi fi if [ "$vroomverifier" ] && [ "$opt" -eq 17 ] || [ "$bpblind" ]; then

cat > /data/97BulletProof_Apps.sh <<EOF #!/system/bin/sh # # BulletProof Apps Boot Script created by zeppelinrox. # # Usage: 1. Runs automatically via custom rom's init.d folder or BulletProof App s Service. # 2. Type in Terminal: "su" and enter, "/data/97*" and enter. # 3. Script Manager: launch it once like any other script OR with a widge t (DO NOT PUT IT ON A SCHEDULE!) # # To verify that it's running, type in Terminal: # 1. "pstree | grep Bullet" - for init.d script or usage option 2 # 2. "pstree | grep sleep" - if using the service or Script Manager # 3. "cat /proc/*/cmdline | grep Bullet" - Sure-Fire method ;^] # - This output should be 3 items: # a. "/path/to/*97BulletProof_Apps*" # b. "BulletProof_Apps_is_In_Effect!" (sleep message) # c. "Bullet" (created by your query so this doesn't mean anything) # # This script loads a list of apps via /data/V6_SuperCharger/BulletProof_Apps_Hi tList. # You can easily add to or edit the HitList right from your device! # Just enter a unique segment of the proces name! However, the more info you giv e, the better ;^] # # This ALSO loads /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh. # Read the comments in that file for "Fine Tuning" instrucions! #################################### # BulletProof Apps Service Notes # #################################### # To leave the BulletProof Apps Service running, insert a # at the beginning of the "stop bullet_service" entry near the middle of this script. # # To stop the BulletProof Apps Service, run Terminal Emulator and type... # "su" and Enter. # "stop bullet_service" and Enter. # # To restart the BulletProof Apps Service, type... # "su" and Enter. # "start bullet_service" and Enter. # # If the service is running and you type: "cat /proc/*/cmdline | grep Bullet". # The output would be 3 lines: # /data/97BulletProof_Apps.sh # BulletProof_Apps_is_In_Effect! # Bullet # # If it's not running, the output would be the last item ie. "Bullet" which was generated by the typed command. # EOF if [ ! "$allrcpaths" ]; then cat >> /data/97BulletProof_Apps.sh <<EOF # Ummm... this service won't work on your current ROM. Sorry :P # EOF fi cat >> /data/97BulletProof_Apps.sh <<EOF clear;

# For debugging, delete the # at the beginning of the following 2 lines, and che ck /data/Log_BulletProof_Apps.log file to see what may have fubarred. # set -x; # exec > /data/Log_BulletProof_Apps.log 2>&1; # line=================================================; echo ""; echo \$line; echo " -=BulletProof Apps=- script by -=zeppelinrox=-"; echo \$line; echo ""; if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then echo " You are NOT running this script as root..."; echo ""; echo \$line; echo " ...No SuperUser for you!!"; echo \$line; echo ""; echo " ...Please Run as Root and try again..."; echo ""; echo \$line; echo ""; exit 69; elif [ "\`pgrep -l android\`" ]; then busybox mount -o remount,rw /data 2>/dev/null; if [ "\`pgrep scriptmanager | wc -l\`" -gt 1 ]; then sleep 2; echo " DO NOT PUT THIS ON A SCHEDULE!"; echo ""; sleep 2; echo " It runs every 30 seconds automatically!"; echo " ======================================="; echo ""; sleep 2; fi 2>/dev/null; echo " To verify that it's working..."; echo ""; echo " ...check out /data/Ran_BulletProof_Apps.log!"; echo ""; # stop bullet_service; while :; do echo \$line; echo " zOOM... zOOM..."; echo \$line; echo ""; bpapplist=\`cat /data/V6_SuperCharger/BulletProof_Apps_HitList\` ; for bpapp in \$bpapplist; do if [ "\`pgrep \$bpapp\`" ]; then for bp in \`pgrep \$bpapp\`; do echo -17 > /proc/\$bp/oom_adj; renice -10 \$bp; echo " BulletProofed \$bpapp!"; echo -n " \$bpapp's oom score is "; cat /proc/\$bp/oom_score; echo -n " \$bpapp's oom priority is "; cat /proc/\$bp/oom_adj; echo ""; done; else

echo " Can't find \$bpapp running..."; echo " ...so it can't be BulletProof ed :("; echo ""; fi; done; sh /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh; echo " This should update every 30 seconds!" > /data/Ran_BulletP roof_Apps.log; echo " \$( date +"%m-%d-%Y %H:%M:%S" ): BulletProofed Apps with \$0!" >> /data/Ran_BulletProof_Apps.log; echo " =============================="; echo " ) BulletProofing Complete! ("; echo " =============================="; echo ""; echo " Taking 30 seconds to reload... then..."; echo ""; echo " ...Gonna BulletProof Some More!"; echo ""; sleep 30 | grep "BulletProof_Apps_is_In_Effect!"; rm /data/Log_BulletProof_Apps.log 2>/dev/null; done; else \$0 & exit 0; fi; EOF chown 0.0 /data/97BulletProof_Apps.sh; chmod 777 /data/97Bulle tProof_Apps.sh cp -fr /data/97BulletProof_Apps.sh /sdcard/V6_SuperCharger if [ -d "/system/etc/init.d" ]; then cp -fr /data/97BulletProo f_Apps.sh /system/etc/init.d/97BulletProof_Apps if [ ! "`diff /data/97BulletProof_Apps.sh /system/etc/in it.d/97BulletProof_Apps`" ]; then sed -i 's/clear/# clear/' /system/etc/init.d/97B ulletProof_Apps sed -i 's/# exec >/exec >/' /system/etc/init.d/9 7BulletProof_Apps sed -i '/bullet_service;/s/#//' /system/etc/init .d/97BulletProof_Apps for i in /system/etc/init.d/S*; do Sfiles=$i;bre ak;done if [ "$Sfiles" != "/system/etc/init.d/S*" ]; the n mv /system/etc/init.d/97BulletProof_Apps /system/etc/init.d/S97BulletProof_App s; fi cp -fr /system/etc/init.d/*BulletProof_Apps* /sd card/V6_SuperCharger else echo $line echo "" $sleep echo " WARNING: ERROR copying file to /system/in it.d!" echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /syst em | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" echo "" fi

fi while :; do bpps=;bppid=;bpappname=;apprunning= echo $line echo "" $sleep if [ ! "$bptips" ]; then echo " Ideas: BulletProof the Phone, Media or SM S App!" echo "" $sleep if [ "$ics" -eq 1 ] && [ ! "$icssced" ];then echo $line echo " ICS TIP! Try BulletProofing The L auncher Here!" echo $line echo "" $sleep fi bptips=shown fi echo " Enter a unique segment of the process name..." echo "" $sleep echo " Example: \"Opera\" for Opera Browser..." echo "" $sleep echo -n " Or press the Enter key to exit: " read bpps echo "" echo $line if [ ! "$bpps" ]; then echo " Okay... See Ya Later! ;^]" break else touch /data/V6_SuperCharger/BulletProof_Apps_HitLis t if [ ! "`pgrep $bpps`" ]; then echo " Can't find $bpps running..." echo "" $sleep echo " ...so it can't be Bul letProofed :(" echo $line echo "" $sleep echo " Tip: You can manually edit/add ap ps to..." echo "" $sleep echo " /data/V6_SuperCharger/BulletProof _Apps_HitList!" echo "" echo $line; bpappname=$bpps else bppid=`pgrep $bpps`; apprunning=true if [ -f "/proc/$bppid/cmdline" ]; then b pappname=`cat /proc/$bppid/cmdline | sed 's/.*\///'` else echo "" echo " Grrrr... there's more tha n one match!"

echo "" $sleep for b in `pgrep $bpps`; do if [ "`cat /proc/$b/cmdline`" ]; then bpappnametemp=`cat /proc /$b/cmdline | sed 's/.*\///'` echo -n " Want $bpappnam etemp? (Y)es or E(N)ter: " read pick case $pick in y|Y)bpappname=$bpappna metemp;; *);; esac echo "" $sleep fi if [ "$bpappname" ]; then echo $line; break; fi done 2>/dev/null fi fi if [ "$bpappname" ]; then bpappname=${bpappname% :*} if [ "$apprunning" ]; then $sleep echo " BulletProofing $bpappname ..." echo "" $sleep echo "-17" > /proc/`pgrep $bpps` /oom_adj renice -10 `pgrep $bpps` echo " $bpappname has been Bulle tProofed!" echo "" $sleep echo -n " $bpappname's oom score is " cat /proc/`pgrep $bpps`/oom_scor e echo "" $sleep echo -n " $bpappname's oom prior ity is " cat /proc/`pgrep $bpps`/oom_adj echo $line fi if [ "`ls /data/V6_SuperCharger/BulletPr oof_One_Shots | grep $bpappname`" ]; then $sleep; echo " This BulletProof \"One-Shot\" Script Exists! :o)" else echo "" $sleep echo " Save BulletProof \"One-Sh ot\" Script to..." echo "" $sleep

echo " ...data/V6_SuperCharger/B ulletProof_One_Shots?" echo "" $sleep if [ ! "$bpwinfo" ]; then echo " If so, with Scrip t Manager..." echo "" $sleep echo " "Quick Widget\" for it..." echo "" $sleep echo " r put it on a timed schedule!" echo "" $sleep bpwinfo=shown fi echo -n " Enter N for No, any ke y for Yes: " read bpsps echo "" echo $line case $bpsps in n|N)echo " Okay... maybe next time!";; *)cat > /data/V6_SuperCh arger/BulletProof_One_Shots/1Shot-$bpappname.sh <<EOF #!/system/bin/sh # # BulletProof "One-Shot" Script created by zeppelinrox. # line================================================= clear echo "" echo \$line echo " -=BulletProof=- \"One-Shot\" by -=zeppelinrox=-" echo \$line echo "" sleep 1 if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then sleep 2 echo " You are NOT running this script as root..." echo "" sleep 3 echo \$line echo " ...No SuperUser for you!!" echo \$line echo "" sleep 3 echo " ...Please Run as Root and try again..." echo "" echo \$line echo "" sleep 3 exit 69 elif [ "\`pgrep $bpappname\`" ]; then for bp in \`pgrep $bpappname\`; do echo -17 > /proc/\$bp/oom_adj ...o ...make a \

renice -10 \$bp echo " BulletProofed $bpappname!" echo "" echo -n " $bpappname's oom score is " cat /proc/\$bp/oom_score echo "" echo -n " $bpappname's oom priority is " cat /proc/\$bp/oom_adj echo "" done else echo echo echo echo fi sleep 1 echo " echo " echo " echo "" exit 0 EOF " Can't find $bpappname running..." "" " ...so it can't be BulletProofed :(" ""

=======================================" ) BulletProof \"One-Shot\" Completed! (" ======================================="

echo " Saved 1Shot-$bp appname.sh to..." echo "" $sleep chown 0.0 /data/V6_Sup erCharger/BulletProof_One_Shots/*; chmod 777 /data/V6_SuperCharger/BulletProof_O ne_Shots/* cp -fr /data/V6_SuperC harger/BulletProof_One_Shots /sdcard/V6_SuperCharger echo " ...data/V6_Supe rCharger/BulletProof_One_Shots!";; esac fi if [ ! "$bpainfo" ]; then echo $line echo "" $sleep echo " The *97BulletProof_Apps B oot Script loads..." echo "" $sleep echo " /data/V6_SuperCharger/Bul letProof_Apps_HitList." echo "" $sleep echo $line echo " Tip: Manually trim or add apps to this list!" echo $line echo "" $sleep echo " If it DOESN'T run automat ically..." echo " =======" $sleep echo " ...make a \"Quic k Widget\" for..."

echo "" $sleep echo " f_Apps Boot Script..."

...The *97BulletProo

echo "" $sleep echo " OR, for LESS overhead... use Terminal Emulator!" echo "" $sleep echo " Type: \"su\" and enter, \ "/data/97*\" and enter!" echo "" $sleep echo " T!" echo "" $sleep echo $line echo " NOTE: DO NOT put it on a timed schedule!" echo $line echo "" $sleep echo " It runs every 30 secon ds automatically!" echo "" echo $line echo "" $sleep echo " Also, in the /data/V6_Sup erCharger folder..." echo "" $sleep echo " of_Apps_Fine_Tuner.sh" echo "" $sleep echo $line echo " Read its notes and \"Fine Tune\" App Priorities!" bpainfo=shown fi if [ "$bpapplist" ] && [ ! "$showedbpapp list" ]; then echo $line echo "" $sleep echo " You are already BulletPro ofing..." echo "" $sleep for bpapp in $bpapplist; do echo " $bpapp"; done echo "" fi showedbpapplist= echo $line if [ "`echo $bpapplist | grep $bpappname `" ]; then $sleep; echo " $bpappname's on the Hit List! ;^]" ...find BulletPro THAT'S I

else echo "" $sleep echo " Add $bpappname to the Hit List?" echo "" $sleep echo -n " Enter Y for Yes, any k ey for No: " read bpabs echo "" echo $line case $bpabs in y|Y)echo "" $sleep echo $bpappname >> /data /V6_SuperCharger/BulletProof_Apps_HitList bpapplist=`cat /data/V6_ SuperCharger/BulletProof_Apps_HitList` if [ ! -f "/data/V6_Supe rCharger/BulletProof_Apps_Fine_Tuner.sh" ]; then cat > /data/V6_S uperCharger/BulletProof_Apps_Fine_Tuner.sh <<EOF #!/system/bin/sh # # BulletProof Apps Fine Tuner created by zeppelinrox. # # Use this file to "Fine Tune" App Priorities to your liking! # # The possible values of oom_adj range from -17 to 15. # The higher the score, more likely the associated process is to be killed by OO M-killer. # # A niceness (effects CPU Time) of -20 is the highest priority and 19 is the low est priority. # A higher priority process will get a larger chunk of the CPU time than a lower priority process. # 0 is usually the default niceness for processes and is inherited from its pare nt process. # # In this script, by default, all apps have priorities applied as follows: # echo -17 > /proc/\`pgrep *com.app.name*\`/oom_adj # renice -10 \`pgrep *com.app.name*\` # The renice of -10 should be sufficient to keep it snappy but not interfere wit h other apps that you're using ;^] # # At the opposite end, if you wanted something to get killed off easily, you can change it to: # echo 15 > /proc/\`pgrep *com.app.name*\`/oom_adj # renice 19 \`pgrep *com.app.name*\` # # Typically, an apps (Secondary Servers) values (when SuperCharged) are: # echo 6 > /proc/\`pgrep *com.app.name*\`/oom_adj # renice 0 \`pgrep *com.app.name*\` # line=================================================; echo \$line; echo " -=BulletProof Apps Fine Tuner Module=-"; echo \$line; echo "";

echo echo echo echo echo echo echo echo EOF

" Find this in /data/V6_SuperCharger folder..."; ""; " ...read its comments..."; ""; " ...and \"Fine Tune\" App Priorities!"; ""; \$line; "";

fi if [ ! "`grep $bpappname /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh`" ]; then cat >> /data/V6_ SuperCharger/BulletProof_Apps_Fine_Tuner.sh <<EOF # Begin $bpappname BulletProofing if [ "\`pgrep $bpappname\`" ]; then for bp in \`pgrep $bpappname\`; do echo -17 > /proc/\$bp/oom_adj; renice -10 \$bp; echo " BulletProofed $bpappname!"; echo -n " $bpappname's oom score is "; cat /proc/\$bp/oom_score; echo -n " $bpappname's oom priority is "; cat /proc/\$bp/oom_adj; echo ""; done; else echo " Can't find $bpappname running..."; echo " ...so it can't be BulletProofed :("; echo ""; fi; # End $bpappname BulletProofing EOF fi chown 0.0 /data/V6_Super Charger/BulletProof_Apps*; chmod 777 /data/V6_SuperCharger/BulletProof_Apps* cp -fr /data/V6_SuperCha rger/BulletProof_Apps* /sdcard/V6_SuperCharger echo " Here's Your Updat ed HitList!" echo "" $sleep for bpapp in $bpapplist; do echo " $bpapp"; done echo "" echo $line echo "" $sleep echo " BulletProof_Apps_ HitList will be loaded via..." echo "" $sleep if [ -d "/system/etc/ini t.d" ]; then echo " ...`ls /system/etc/init.d/*BulletProof*`" else echo " .../data/97BulletProof_Apps.sh!" fi echo "" if [ ! "$bpsinfo" ]; the n

$sleep echo $line echo " Is it wor king? See /data/Ran_BulletProof_Apps!" echo $line echo "" $sleep echo " Or... in Terminal Emulator, you can type..." echo "" $sleep echo " \"pstree | grep Bullet\" OR \"pstree | grep sleep\"" echo "" echo " OR... get COMPLETE information with..." echo "" $sleep echo " ..\"cat /proc/*/cmdline | grep Bullet\"!" echo "" $sleep echo " The outpu t should look like this:" echo "" $sleep echo " h/to/*97BulletProof_Apps*" echo " etProof_Apps_is_In_Effect!" echo " et" echo "" fi if [ "$allrcpaths" ] && [ ! "$bpsinfo" ]; then echo $line echo "" $sleep echo " The Bulle tProof Apps Service should..." echo "" $sleep echo " automatically run this on a schedule!" echo "" $sleep echo " BUT if it doesn't, just be sure that..." echo "" $sleep echo " ...the *9 7BulletProof_Apps script runs at boot!" echo "" $sleep echo $line echo " BulletPro of Apps Service was installed to..." echo $line echo "" ... Bull Bull /pat .

$sleep for bps in $allr cpaths; do echo " ...$bps!" if [ ! " $bpservice" ]; then $sleep; fi done echo "" echo $line echo "" $sleep echo " You can s top the service by either..." echo "" $sleep echo " ...read ing comments in 97BulletProof_Apps.sh" echo "" $sleep echo " Or... Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and Enter..." echo " ==" echo "" $sleep echo " type \"stop bullet_service\" and Enter." echo " ===================" echo "" $sleep echo " To restar t the BulletProof Apps Service..." echo "" $sleep echo " ype \"start bullet_service\" and Enter." echo " ====================" echo "" echo $line echo "" $sleep echo " \"cat /pr oc/*/cmdline | grep Bullet\"..." echo "" $sleep echo " ...will also show if the service is running!" echo "" elif [ ! "$allrcpaths" ] && [ ! "$bpsinfo" ]; then echo $line $sleep echo " BulletPro ..t ...

of Apps Service Entries Installed!" echo $line echo "" $sleep echo " This won' t work on this ROM but... " echo "" $sleep echo " it makes for easy cooking into a ROM!" echo "" $sleep echo " Just read the comments in $initrcpath :)" echo "" if [ "$smrun" ]; then echo $li ne echo "" $sleep echo "TH IS app can load 97BulletProof_Apps.sh on boot!" echo "" fi fi bpsinfo=shown;; *)echo " Okay... maybe next ti me!";; esac fi fi fi done if [ "$bpapplist" ]; then echo $line echo "" $sleep echo $line echo " ALL BulletProof* files backed up to SD Card..." fi fi fi if [ "$opt" -eq 18 ]; then echo " Your device may get laggy after a day or two.." echo "" $sleep echo " ...if you haven't rebooted." echo "" $sleep echo " It happens when system caches keep growing..." echo "" $sleep echo " ...and free RAM keeps shrinking..." echo "" $sleep echo " ...and apps are starved for memory!" echo "" echo $line echo "" ...

$sleep echo " This Engine Flush will give you a Quick Boost!" echo "" $sleep echo " The system will drop all file system caches..." echo "" $sleep echo " ...which means more free RAM and no lag!" echo "" $sleep echo " ..so no need to reboot!" echo "" $sleep echo $line echo " Note that \"Used RAM\" INCLUDES Cached Apps!!" echo $line echo "" $sleep echo " ie. Most tools will report $ramreportedfree MB Free RAM!" echo "" $sleep ramused=$((`free | awk '{ print $3 }' | sed -n 2p`/1024)) ramkbytesfree=`free | awk '{ print $4 }' | sed -n 2p` ramkbytescached=`cat /proc/meminfo | grep Cached | awk '{print $ 2}' | sed -n 1p` ramfree=$(($ramkbytesfree/1024));ramcached=$(($ramkbytescached/1 024));ramreportedfree=$(($ramfree + $ramcached)) echo " Current RAM Stats:" echo " =================" echo "" $sleep echo " Total: $ram MB Used: $ramused MB True Free: $ramfree MB " echo "" $sleep echo $line echo " True Free $ramfree MB = \"Free\" $ramreportedfree - Cache d Apps $ramcached" echo $line echo "" $sleep echo " ...OR... True Free RAM $ramfree" echo " Cached Apps + $ramcached" echo " ========" echo " Reported \"Free\" RAM = $ramreportedfree MB" echo "" echo $line echo "" $sleep echo " Continue and drop all file system caches?" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read flush echo "" echo $line case $flush in n|N)echo " File system caches were retained...";; *)busybox sync; echo 3 > /proc/sys/vm/drop_caches sleep 2

echo 0 > /proc/sys/vm/drop_caches echo " Engine Flush Completed!" echo $line echo "" $sleep ramused=$((`free | awk '{ print $3 }' | sed -n 2p`/102 4)) ramkbytesfree=`free | awk '{ print $4 }' | sed -n 2p` ramkbytescached=`cat /proc/meminfo | grep Cached | awk '{print $2}' | sed -n 1p` ramfree=$(($ramkbytesfree/1024));ramcached=$(($ramkbyt escached/1024));ramreportedfree=$(($ramfree + $ramcached)) echo " Updated RAM Stats:" echo " =================" echo "" $sleep echo " Total: $ram MB Used: $ramused MB True Free: $ ramfree MB" echo "" $sleep echo " Reported Free RAM: $ramreportedfree MB!" echo "" $sleep echo $line echo " True Free $ramfree MB = \"Free\" $ramreportedfr ee - Cached Apps $ramcached" echo $line echo "" $sleep echo " ...OR... True Free RAM $ramfree" echo " Cached Apps + $ramcached" echo " ========" echo " Reported \"Free\" RAM = $ramreportedfree MB" echo "" $sleep echo $line echo " ...Enjoy Your Quick Boost ;^]" ;; esac echo $line echo "" $sleep cat > /data/V6_SuperCharger/!FastEngineFlush.sh <<EOF #!/system/bin/sh # # Fast Engine Flush Script created by zeppelinrox. # # See http://goo.gl/krtf9 - Linux Memory Consumption - Nice article which also d iscusses the "drop system cache" function! # See http://goo.gl/hFdNO - Memory and SuperCharging Overview ...or... "Why 'Fre e RAM' Is NOT Wasted RAM!" # # Credit imoseyon for making the drop caches command more well known :) # See http://www.droidforums.net/forum/liberty-rom-d2/122733-tutorial-sysctl-you -guide-better-preformance-battery-life.html # Credit dorimanx (Cool XDA dev!) for the neat idea to show before and after sta ts :D # # For debugging, delete the # at the beginning of the following 2 lines, and che

ck /data/Log_FastEngineFlush.log file to see what may have fubarred. # set -x # exec > /data/Log_FastEngineFlush.log 2>&1 # line================================================= clear echo "" echo \$line echo " -=Fast Engine Flush=- script by -=zeppelinrox=-" echo \$line echo "" sleep 1 if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then sleep 2 echo " You are NOT running this script as root..." echo "" sleep 3 echo \$line echo " ...No SuperUser for you!!" echo \$line echo "" sleep 3 echo " ...Please Run as Root and try again..." echo "" echo \$line echo "" sleep 3 exit 69 fi busybox mount -o remount,rw /data 2>/dev/null ram=\$((\`free | awk '{ print \$2 }' | sed -n 2p\`/1024)) ramused=\$((\`free | awk '{ print \$3 }' | sed -n 2p\`/1024)) ramkbytesfree=\`free | awk '{ print \$4 }' | sed -n 2p\` ramkbytescached=\`cat /proc/meminfo | grep Cached | awk '{print \$2}' | sed -n 1 p\` ramfree=\$((\$ramkbytesfree/1024));ramcached=\$((\$ramkbytescached/1024));ramrep ortedfree=\$((\$ramfree + \$ramcached)) echo " Note that \"Used RAM\" INCLUDES Cached Apps!!" echo "" sleep 1 echo \$line echo " RAM Stats BEFORE Engine Flush..." echo \$line echo "" sleep 1 echo " Total: \$ram MB Used: \$ramused MB True Free: \$ramfree MB" echo "" sleep 1 echo " Most tools will report \$ramreportedfree MB Free RAM!" echo "" sleep 1 echo \$line echo " True Free \$ramfree MB = \"Free\" \$ramreportedfree - Cached Apps \$ramca ched" echo \$line echo "" sleep 1 echo " ...OR... True Free RAM \$ramfree" echo " Cached Apps + \$ramcached" echo " ========"

echo " Reported \"Free\" RAM = \$ramreportedfree MB" echo "" busybox sync; echo 3 > /proc/sys/vm/drop_caches sleep 3 echo 1 > /proc/sys/vm/drop_caches ramused=\$((\`free | awk '{ print \$3 }' | sed -n 2p\`/1024)) ramkbytesfree=\`free | awk '{ print \$4 }' | sed -n 2p\` ramkbytescached=\`cat /proc/meminfo | grep Cached | awk '{print \$2}' | sed -n 1 p\` ramfree=\$((\$ramkbytesfree/1024));ramcached=\$((\$ramkbytescached/1024));ramrep ortedfree=\$((\$ramfree + \$ramcached)) echo \$line echo " ...RAM Stats AFTER Engine Flush" echo \$line echo "" sleep 1 echo " Total: \$ram MB Used: \$ramused MB True Free: \$ramfree MB" echo "" sleep 1 echo " Most tools will report \$ramreportedfree MB Free RAM!" echo "" sleep 1 echo \$line echo " True Free \$ramfree MB = \"Free\" \$ramreportedfree - Cached Apps \$ramca ched" echo \$line echo "" sleep 1 echo " ...OR... True Free RAM \$ramfree" echo " Cached Apps + \$ramcached" echo " ========" echo " Reported \"Free\" RAM = \$ramreportedfree MB" echo "" sleep 1 echo " ==================================" echo " ) Fast Engine Flush Completed! (" echo " ==================================" exit 0 EOF chown 0.0 /data/V6_SuperCharger/!FastEngineFlush.sh; chmod 777 / data/V6_SuperCharger/!FastEngineFlush.sh cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh /sdcard/V6_Supe rCharger cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh /sdcard/V6_Supe rCharger/flush cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh /system/xbin/fl ush echo " For Fast Flushing..." echo "" $sleep echo "../data/V6_SuperCharger/!FastEngineFlush.sh.." echo "" $sleep echo " ...was created!" echo "" $sleep echo " With Script Manager..." echo "" $sleep echo " ...make a \"Quick Widget\" for it..."

echo "" $sleep echo " ...or put it on a timed schedule!" echo "" echo $line echo "" $sleep if [ ! "`diff /data/V6_SuperCharger/!FastEngineFlush.sh /system/ xbin/flush`" ]; then echo " There is another copy in /system/xbin..." echo "" $sleep echo " To use this script with Terminal Emulator..." echo "" $sleep echo " Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and Enter..." echo " ==" echo "" $sleep echo " ...type \"flush\" and Enter..." echo " =====" echo "" $sleep echo " THAT'S IT!" else echo " WARNING: ERROR copying file to /system/xbin!" echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /system | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" fi echo "" fi if [ "$opt" -eq 19 ]; then echo " You have many SQLite databases that become..." echo "" $sleep echo " ...fragmented and unoptimized over a few days." echo "" $sleep echo " This tool will optimize them with..." echo "" $sleep echo " ...SQLite VACUUM and REINDEX!" echo "" echo $line echo "" $sleep if [ "`which sqlite3`" ]; then cat > /data/V6_SuperCharger/!Detailing.sh <<EOF #!/system/bin/sh # # Detailing Script (SQLite VACUUM & REINDEX) created by zeppelinrox. #

# Credit avgjoemomma (from XDA) for the added reindex bit :) # # For debugging, delete the # at the beginning of the following 2 lines, and che ck /data/Log_Detailing.log file to see what may have fubarred. # set -x # exec > /data/Log_Detailing.log 2>&1 # line================================================= clear echo "" if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then echo \$line echo " -=Detailing=- script by -=zeppelinrox=-" echo \$line echo "" sleep 3 echo " You are NOT running this script as root..." echo "" sleep 3 echo \$line echo " ...No SuperUser for you!!" echo \$line echo "" sleep 3 echo " ...Please Run as Root and try again..." echo "" echo \$line echo "" sleep 3 exit 69 elif [ ! "\`which sqlite3\`" ]; then echo \$line echo " -=Detailing=- script by -=zeppelinrox=-" echo \$line echo "" sleep 3 echo " Doh... sqlite3 binary was NOT found..." echo "" sleep 3 echo \$line echo " ...No Vacuuming for you!!" echo \$line echo "" sleep 3 echo " Load the XDA SuperCharger thread..." echo "" sleep 3 echo " ...and install The SuperCharger Starter Kit!" echo "" echo \$line echo "" sleep 3 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/qM 6yR" echo "" echo \$line echo "" sleep 3 exit 69 fi 2>/dev/null

busybox mount -o remount,rw /data 2>/dev/null echo " Commencing SQLite VACUUM & REINDEX!" echo "" sleep 1 echo " Please IGNORE any errors that say..." echo " ======" echo "" sleep 1 echo " \"malformed database\" OR \"collation sequence\"!" echo " ================== ==================" echo "" sleep 1 echo " ...as they won't effect SQLite Optimization!" echo "" sleep 1 echo \$line echo " This may take awhile... please wait..." echo \$line echo "" sleep 1 LOG_FILE=/data/Ran_Detailing.log START=\`busybox date +%s\` BEGAN=\`date\` TOTAL=\`busybox find /*d* -iname "*.db" | wc -l\` INCREMENT=3 PROGRESS=0 PROGRESS_BAR="" echo " Start Detailing: \$BEGAN" > \$LOG_FILE echo "" >> \$LOG_FILE sync for i in \`busybox find /*d* -iname "*.db"\`; do PROGRESS=\$((\$PROGRESS+1)) PERCENT=\$(( \$PROGRESS * 100 / \$TOTAL )) if [ "\$PERCENT" -eq "\$INCREMENT" ]; then INCREMENT=\$(( \$INCREMENT + 3 )) PROGRESS_BAR="\$PROGRESS_BAR=" fi clear echo "" echo -n " >" echo -e "\r \$PROGRESS_BAR>" echo " -=Detailing=- by -=zeppelinrox=-" echo -n " >" echo -e "\r \$PROGRESS_BAR>" echo "" echo " Processing DBs - \$PERCENT% (\$PROGRESS of \$TOTAL)" echo "" echo " VACUUMING: \$i" | tee -a \$LOG_FILE sqlite3 \$i 'VACUUM;'; echo " REINDEXING: \$i" | tee -a \$LOG_FILE sqlite3 \$i 'REINDEX;'; done sync STOP=\`busybox date +%s\` ENDED=\`date\` RUNTIME=\`busybox expr \$STOP - \$START\` HOURS=\`busybox expr \$RUNTIME / 3600\` REMAINDER=\`busybox expr \$RUNTIME % 3600\` MINS=\`busybox expr \$REMAINDER / 60\` SECS=\`busybox expr \$REMAINDER % 60\`

RUNTIME=\`busybox printf "%02d:%02d:%02d\n" "\$HOURS" "\$MINS" "\$SECS"\` echo "" | tee -a \$LOG_FILE echo \$line echo "" sleep 1 echo " Done Optimizing Databases for ALL Apps..." echo "" sleep 1 echo " ...Say Hello To Optimized DBs!" echo "" echo \$line echo "" sleep 1 echo " Start Time: \$BEGAN" | tee -a \$LOG_FILE echo " Stop Time: \$ENDED" | tee -a \$LOG_FILE echo "" | tee -a \$LOG_FILE echo " Completion Time: \$RUNTIME" | tee -a \$LOG_FILE echo "" sleep 1 echo " See \$LOG_FILE for more details!" echo "" sleep 1 echo " ==========================" echo " ) Detailing Completed! (" echo " ==========================" echo "" exit 0 EOF chown 0.0 /data/V6_SuperCharger/!Detailing.sh; chmod 777 /data/V6_SuperCharger/!Detailing.sh cp -fr /data/V6_SuperCharger/!Detailing.sh /sdcard/V6_Su perCharger cp -fr /data/V6_SuperCharger/!Detailing.sh /sdcard/V6_Su perCharger/vac cp -fr /data/V6_SuperCharger/!Detailing.sh /system/xbin/ vac echo " Optimize SQLite databases now?" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read detail echo "" echo $line case $detail in n|N)echo " SQLite Optimization Declined... meh..." ;; *)echo " Time to clean up after you! ;^] " echo $line echo "" $sleep sh /data/V6_SuperCharger/!Detailing.sh;; esac echo $line echo "" $sleep echo " For Diligent Detailing..." echo "" $sleep echo " .../data/V6_SuperCharger/!Detailing.sh..."

echo "" $sleep echo " ...was created!" echo "" $sleep echo " With Script Manager..." echo "" $sleep echo " ...make a \"Quick Widget\" for it..." echo "" $sleep echo " ...or put it on a weekly schedule!" echo "" echo $line echo "" $sleep if [ ! "`diff /data/V6_SuperCharger/!Detailing.sh /syste m/xbin/vac`" ]; then echo " There is another copy in /system/xbin..." echo "" $sleep echo " To use this script with Terminal Emulator ..." echo "" $sleep echo " Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and Enter..." echo " ==" echo "" $sleep echo " ...type \"vac\" and E nter..." echo " echo "" $sleep echo " else echo " WARNING: ERROR copying file to /system/xb in!" echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /syst em | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" fi echo "" if [ -d "/system/etc/init.d" ]; then echo $line echo "" $sleep echo " Detailing can run automatically on boot!" echo "" $sleep echo " *99SuperCharger would run Detailing.sh. .." echo "" ===" THAT'S IT!"

$sleep echo " cted!"

...so boot time would be unaffe

echo "" $sleep echo $line echo " You can configure this in Driver Options! " fi else echo " Doh... sqlite3 binary was NOT found..." echo "" $sleep echo $line echo " ...No Vacuuming for you!!" echo $line echo "" $sleep echo " Load the XDA SuperCharger thread..." echo "" $sleep echo " ...and install The SuperCharger Starter Kit!" echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo $line echo "" su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/qM6yR" echo "" fi fi if [ "$opt" -eq 20 ]; then echo " ZipAlign optimizes all your APKs..." echo "" $sleep echo " ...which means less RAM comsumption..." echo "" $sleep echo " ...better battery life..." echo "" $sleep echo " ...and a faster device!!" echo "" $sleep echo $line echo " If you get Force Closes, run Fix Emissions too!" echo $line echo "" $sleep if [ "`which zipalign`" ]; then cat > /data/V6_SuperCharger/!WheelAlignment.sh <<EOF #!/system/bin/sh # # "ZepAlign" / Wheel Alignment Script (ZipAlign) created by zeppelinrox. # # ZipAligns all data and system apks (apps) that have not yet been ZipAligned # ZipAlign optimizes all your apps, resulting in less RAM comsumption and a fast

er device! ;^] # # Props: Automatic ZipAlign by Wes Garner (original script) # oknowton for the change from MD5 to zipalign -c 4 # # Tweaks & Enhancements by zeppelinrox... # - Added support for /vendor/app (for ICS) # - Added support for /mnt/asec # - Added support for more data directories ie. dbdata, datadata, etc. # - Added debugging # - Tweaked interface a bit ;^] # # For debugging, delete the # at the beginning of the following 2 lines, and che ck /data/Log_ZepAlign.log file to see what may have fubarred. # set -x # exec > /data/Log_ZepAlign.log 2>&1 # line================================================= clear echo "" echo \$line echo " -=Wheel Alignment=- script by -=zeppelinrox=-" echo \$line echo "" sleep 2 if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then sleep 1 echo " You are NOT running this script as root..." echo "" sleep 3 echo \$line echo " ...No SuperUser for you!!" echo \$line echo "" sleep 3 echo " ...Please Run as Root and try again..." echo "" echo \$line echo "" sleep 3 exit 69 elif [ ! "\`which zipalign\`" ]; then sleep 1 echo " Doh... zipalign binary was NOT found..." echo "" sleep 3 echo \$line echo " ...No ZepAligning for you!!" echo \$line echo "" sleep 3 echo " Load the XDA SuperCharger thread..." echo "" sleep 3 echo " ...and install The SuperCharger Starter Kit!" echo "" echo \$line echo "" sleep 3 su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/qM

6yR" echo "" echo \$line echo "" sleep 3 exit 69 fi 2>/dev/null busybox mount -o remount,rw /data 2>/dev/null busybox mount -o remount,rw /system 2>/dev/null busybox mount -o remount,rw \`busybox mount | grep system | awk '{print \$1,\$3} ' | sed -n 1p\` 2>/dev/null LOG_FILE=/data/Ran_ZepAlign.log START=\`busybox date +%s\` BEGAN=\`date\` TOTAL=\$((\`ls /d*/*/*.apk | wc -l\`+\`ls /system/*/*.apk | wc -l\`+\`ls /vendor /*/*.apk | wc -l\`+\`ls /mnt/asec/*/*.apk | wc -l\`)) INCREMENT=3 PROGRESS=0 PROGRESS_BAR="" echo " Start Wheel Alignment ( \"ZepAlign\" ): \$BEGAN" > \$LOG_FILE echo "" >> \$LOG_FILE sync for apk in /d*/*/*.apk /system/*/*.apk /vendor/*/*.apk /mnt/asec/*/*.apk; do PROGRESS=\$((\$PROGRESS+1)) PERCENT=\$(( \$PROGRESS * 100 / \$TOTAL )) if [ "\$PERCENT" -eq "\$INCREMENT" ]; then INCREMENT=\$(( \$INCREMENT + 3 )) PROGRESS_BAR="\$PROGRESS_BAR=" fi clear echo "" echo -n " >" echo -e "\r \$PROGRESS_BAR>" echo " Wheel Alignment by -=zeppelinrox=-" echo -n " >" echo -e "\r \$PROGRESS_BAR>" if [ -f "\$apk" ]; then echo "" echo " Processing APKs - \$PERCENT% (\$PROGRESS of \$TOTAL )" zipalign -c 4 \$apk ZIPCHECK=\$? if [ "\$ZIPCHECK" -eq 1 ]; then echo ""; echo " ZipAligning \$apk..." | tee -a \$LOG_FIL E zipalign -f 4 \$apk /cache/\$(busybox basename \$apk) if [ -e "/cache/\$(busybox basename \$apk)" ]; then busybox cp -f -p /cache/\$(busybox basename \$ap k) \$apk | tee -a \$LOG_FILE busybox rm /cache/\$(busybox basename \$apk) else echo " ZipAligning \$apk... Failed" | tee -a \$LOG_ FILE fi else echo ""; echo " ZipAlign already completed on \$apk" | tee -a \$LOG_FILE fi fi done sync busybox mount -o remount,ro /system 2>/dev/null

busybox mount -o remount,ro \`busybox mount | grep system | awk '{print \$1,\$3} ' | sed -n 1p\` 2>/dev/null STOP=\`busybox date +%s\` ENDED=\`date\` RUNTIME=\`busybox expr \$STOP - \$START\` HOURS=\`busybox expr \$RUNTIME / 3600\` REMAINDER=\`busybox expr \$RUNTIME % 3600\` MINS=\`busybox expr \$REMAINDER / 60\` SECS=\`busybox expr \$REMAINDER % 60\` RUNTIME=\`busybox printf "%02d:%02d:%02d\n" "\$HOURS" "\$MINS" "\$SECS"\` echo "" | tee -a \$LOG_FILE echo \$line echo "" sleep 1 echo " Done \"ZepAligning\" ALL data and system APKs..." echo "" sleep 1 echo " ...Say Hello To Optimized Apps!" echo "" echo \$line echo "" sleep 1 echo " Start Time: \$BEGAN" | tee -a \$LOG_FILE echo " Stop Time: \$ENDED" | tee -a \$LOG_FILE echo "" | tee -a \$LOG_FILE echo " Completion Time: \$RUNTIME" | tee -a \$LOG_FILE echo "" sleep 1 echo " See \$LOG_FILE for more details!" echo "" sleep 1 echo " ================================" echo " ) Wheel Alignment Completed! (" echo " ================================" echo "" exit 0 EOF chown 0.0 /data/V6_SuperCharger/!WheelAlignment.sh; chmo d 777 /data/V6_SuperCharger/!WheelAlignment.sh cp -fr /data/V6_SuperCharger/!WheelAlignment.sh /sdcard/ V6_SuperCharger cp -fr /data/V6_SuperCharger/!WheelAlignment.sh /sdcard/ V6_SuperCharger/zepalign cp -fr /data/V6_SuperCharger/!WheelAlignment.sh /system/ xbin/zepalign echo " ZipAlign data and system APKs now?" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read align echo "" echo $line case $align in n|N)echo " No Wheel Alignment? Watch out for teh curb s!";; *)echo " Gonna \"ZepAlign\" in no time! ; ^]" echo $line echo "" $sleep

sh /data/V6_SuperCharger/!WheelAlignment.sh;; esac echo $line echo "" $sleep echo " For Zippy... uhh... \"ZepAligning\"..." echo "" $sleep echo " .../data/V6_SuperCharger/!WheelAlignment.sh..." echo "" $sleep echo " ...was created!" echo "" $sleep echo " With Script Manager..." echo "" $sleep echo " ...make a \"Quick Widget\" for it..." echo "" $sleep echo " ...or put it on a weekly schedule!" echo "" echo $line echo "" $sleep if [ ! "`diff /data/V6_SuperCharger/!WheelAlignment.sh / system/xbin/zepalign`" ]; then echo " There is another copy in /system/xbin..." echo "" $sleep echo " To use this script with Terminal Emulator ..." echo "" $sleep echo " Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and Enter..." echo " ==" echo "" $sleep echo " ...type \"zepalign\" and E nter..." echo " ========" echo "" $sleep echo " THAT'S IT!" else echo " WARNING: ERROR copying file to /system/xb in!" echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /syst em | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" fi echo "" echo $line

echo "" $sleep if [ -d "/system/etc/init.d" ]; then echo " Wheel Alignment can run automatically on boot!" echo "" $sleep echo " *99SuperCharger would run WheelAlignment. sh..." echo "" $sleep echo " cted!" echo "" $sleep echo $line echo " You can configure this in Driver Options! " echo $line echo "" $sleep fi echo " Run the Fix Permissions option?" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read emissions echo "" echo $line case $emissions in n|N)echo " Okay... but run it if you get FCs!!"; ; *)echo "" echo " busybox echo " \\\\\\\\" echo $line echo "" $sleep opt=21;; esac else echo " Doh... zipalign binary was NOT found..." echo "" $sleep echo $line echo " ...No ZepAligning for you!!" echo $line echo "" $sleep echo " Load the XDA SuperCharger thread..." echo "" $sleep echo " ...and install The SuperCharger Starter Kit!" echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo $line =====================" //// FIX EMISSIONS ...so boot time would be unaffe

echo "" su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/qM6yR" echo "" fi fi if [ "$opt" -eq 21 ]; then echo " This should fix app Force Closes!" echo "" $sleep echo " FCs usually happen due to permission errors..." echo "" $sleep echo " This tool will ensure that ALL apps..." echo "" $sleep echo " ...have the correct permissions!" echo "" echo $line echo "" $sleep cat > /data/V6_SuperCharger/!FixEmissions.sh <<EOF #!/system/bin/sh # # Fix Emissions Script (Fix Permissions) created by zeppelinrox. # # Sets permissions for android data directories and apks. # This should fix app force closes (FCs). # It's quite fast - setting permissions for 300 apps in approximately 1 minute. # # Props: Originally and MOSTLY (erm... something like 90% of it lol) by Jared Ru mmler (JRummy16). # However, I actually meshed together 3 different Fix Permissions scripts ;^] # # Tweaks & Enhancements by zeppelinrox... # - Removed the usage of the "pm list packages" command - it didn't work on boot. # - Added support for /vendor/app (for ICS) # - No longer excludes framework-res.apk or com.htc.resources.apk # - Added support for more data directories ie. dbdata, datadata, etc. # - Added debugging # - Tweaked interface a bit ;^] # # For debugging, delete the # at the beginning of the following 2 lines, and che ck /data/Log_FixEmissions.log file to see what may have fubarred. # set -x # exec > /data/Log_FixEmissions.log 2>&1 # line================================================= clear echo "" echo \$line echo " -=Fix Emissions=- script by -=zeppelinrox=-" echo \$line echo "" sleep 2 if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then sleep 1 echo " You are NOT running this script as root..." echo ""

sleep 3 echo \$line echo " ...No SuperUser for you!!" echo \$line echo "" sleep 3 echo " ...Please Run as Root and try again..." echo "" echo \$line echo "" sleep 3 exit 69 fi busybox mount -o remount,rw /data 2>/dev/null busybox mount -o remount,rw /system 2>/dev/null busybox mount -o remount,rw \`busybox mount | grep system | awk '{print \$1,\$3} ' | sed -n 1p\` 2>/dev/null LOG_FILE=/data/Ran_FixEmissions.log START=\`busybox date +%s\` BEGAN=\`date\` TOTAL=\`cat /d*/system/packages.xml | grep -E "^<package.*serId" | wc -l\` INCREMENT=3 PROGRESS=0 PROGRESS_BAR="" echo " Start Fix Emissions: \$BEGAN" > \$LOG_FILE echo "" >> \$LOG_FILE echo " Setting & Fixing Permissions For..." >> \$LOG_FILE echo "" >> \$LOG_FILE sync cat /d*/system/packages.xml | grep -E "^<package.*serId" | while read pkgline; d o PKGNAME=\`echo \$pkgline | sed 's%.* name="\(.*\)".*%\1%' | cut -d '"' f1\` CODEPATH=\`echo \$pkgline | sed 's%.* codePath="\(.*\)".*%\1%' | cut -d '"' -f1\` DATAPATH=/d*/d*/\$PKGNAME PKGUID=\`echo \$pkgline | sed 's%.*serId="\(.*\)".*%\1%' | cut -d '"' -f 1\` PROGRESS=\$((\$PROGRESS+1)) PERCENT=\$(( \$PROGRESS * 100 / \$TOTAL )) if [ "\$PERCENT" -eq "\$INCREMENT" ]; then INCREMENT=\$(( \$INCREMENT + 3 )) PROGRESS_BAR="\$PROGRESS_BAR=" fi clear echo "" echo -n " >" echo -e "\r \$PROGRESS_BAR>" echo " \"Fix Emissions\" by -=zeppelinrox=-" echo -n " >" echo -e "\r \$PROGRESS_BAR>" echo "" echo " Processing Apps - \$PERCENT% (\$PROGRESS of \$TOTAL)" echo "" echo " Setting & Fixing Permissions For..." echo "" echo " ...\$PKGNAME" echo " \$PKGNAME (\$CODEPATH)" >> \$LOG_FILE if [ -e "\$CODEPATH" ]; then APPDIR=\`busybox dirname \$CODEPATH\`

if [ "\$APPDIR" = "/system/app" ] || [ "\$APPDIR" = "/vendor/app " ]; then busybox chown 0 \$CODEPATH busybox chown :0 \$CODEPATH busybox chmod 644 \$CODEPATH elif [ "\$APPDIR" = "`ls -d /d*/app`" ]; then busybox chown 1000 \$CODEPATH busybox chown :1000 \$CODEPATH busybox chmod 644 \$CODEPATH elif [ "\$APPDIR" = "`ls -d /d*/app-private`" ]; then busybox chown 1000 \$CODEPATH busybox chown :\$PKGUID \$CODEPATH busybox chmod 640 \$CODEPATH fi if [ -d "\$DATAPATH" ]; then busybox chmod 755 \$DATAPATH busybox chown \$PKGUID \$DATAPATH busybox chown :\$PKGUID \$DATAPATH DIRS=\`busybox find \$DATAPATH -mindepth 1 -type d\` for file in \$DIRS; do PERM=755 NEWUID=\$PKGUID NEWGID=\$PKGUID FNAME=\`busybox basename \$file\` case \$FNAME in lib)busybox chmod 755 \$ file NEWUID=1000 NEWGID=1000 PERM=755;; shared_prefs)busybox chmod 771 \$file PERM=660;; databases)busybox chmod 771 \$file PERM=660;; cache)busybox chmod 771 \$file PERM=600;; files)busybox chmod 771 \$file PERM=775;; *)busybox chmod 771 \$ file PERM=771;; esac busybox chown \$NEWUID \$file busybox chown :\$NEWGID \$file busybox find \$file -type f -maxdepth 2 ! -perm \$PERM -exec busybox chmod \$PERM {} ';' busybox find \$file -type f -maxdepth 1 ! -user \$NEWUID -exec busybox chown \$NEWUID {} ';' busybox find \$file -type f -maxdepth 1 ! -group \$NEWGID -exec busybox chown :\$NEWGID {} ';' done fi fi 2>/dev/null done sync busybox mount -o remount,ro /system 2>/dev/null busybox mount -o remount,ro \`busybox mount | grep system | awk '{print \$1,\$3} ' | sed -n 1p\` 2>/dev/null STOP=\`busybox date +%s\` ENDED=\`date\`

RUNTIME=\`busybox expr \$STOP - \$START\` HOURS=\`busybox expr \$RUNTIME / 3600\` REMAINDER=\`busybox expr \$RUNTIME % 3600\` MINS=\`busybox expr \$REMAINDER / 60\` SECS=\`busybox expr \$REMAINDER % 60\` RUNTIME=\`busybox printf "%02d:%02d:%02d\n" "\$HOURS" "\$MINS" "\$SECS"\` echo "" | tee -a \$LOG_FILE echo \$line echo "" sleep 1 echo " FIXED Permissions For ALL Apps..." echo "" sleep 1 echo " ...Say Buh Bye To Force Close Errors!" echo "" echo \$line echo "" sleep 1 echo " Start Time: \$BEGAN" | tee -a \$LOG_FILE echo " Stop Time: \$ENDED" | tee -a \$LOG_FILE echo "" | tee -a \$LOG_FILE echo " Completion Time: \$RUNTIME" | tee -a \$LOG_FILE echo "" sleep 1 echo " See \$LOG_FILE for more detail!" echo "" sleep 1 echo " ==============================" echo " ) Fix Emissions Completed! (" echo " ==============================" echo "" exit 0 EOF busybox mount -o remount,rw /system 2>/dev/null busybox mount -o remount,rw `busybox mount | grep system | awk ' {print $1,$3}' | sed -n 1p` 2>/dev/null chown 0.0 /data/V6_SuperCharger/!FixEmissions.sh; chmod 777 /dat a/V6_SuperCharger/!FixEmissions.sh cp -fr /data/V6_SuperCharger/!FixEmissions.sh /sdcard/V6_SuperCh arger cp -fr /data/V6_SuperCharger/!FixEmissions.sh /sdcard/V6_SuperCh arger/fixfc cp -fr /data/V6_SuperCharger/!FixEmissions.sh /system/xbin/fixfc echo " Fix Permissions now?" echo "" $sleep echo -n " Enter N for No, any key for Yes: " read emissions echo "" echo $line case $emissions in n|N)echo " Fix Emissions Declined... What The FC!?";; *)echo "" echo " Cool... This won't take too long ;^]" echo "" $sleep sh /data/V6_SuperCharger/!FixEmissions.sh;; esac echo $line echo ""

$sleep echo " For a Fast FCing Fix..." echo "" $sleep echo " .../data/V6_SuperCharger/!FixEmissions.sh..." echo "" $sleep echo " ...was created!" echo "" $sleep echo " With Script Manager..." echo "" $sleep echo " ...make a \"Quick Widget\" for it..." echo "" $sleep echo " ...or put it on a weekly schedule!" echo "" echo $line echo "" $sleep if [ ! "`diff /data/V6_SuperCharger/!FixEmissions.sh /system/xbi n/fixfc`" ]; then echo " There is another copy in /system/xbin..." echo "" $sleep echo " To use this script with Terminal Emulator..." echo "" $sleep echo " Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and Enter..." echo " ==" echo "" $sleep echo " ...type \"fixfc\" and Enter..." echo " =====" echo "" $sleep echo " THAT'S IT!" else echo " WARNING: ERROR copying file to /system/xbin!" echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /system | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" fi echo "" if [ -d "/system/etc/init.d" ]; then echo $line echo "" $sleep echo " Fix Emissions can run automatically on boot!" echo "" $sleep echo " *99SuperCharger would run FixEmissions.sh..."

echo "" $sleep echo " ...so boot time would be unaffected!" echo "" $sleep echo $line echo " You can configure this in Driver Options!" fi fi if [ "$opt" -eq 22 ]; then echo " This is EXPERIMENTAL..." echo "" $sleep echo " ...it may improve multitasking..." echo "" $sleep echo " ...it may make your device even snappier..." echo "" $sleep echo " ...it may really do nothing..." echo "" $sleep echo " But some people swear that it's great!" echo "" $sleep echo " Values are added at the bottom of build.prop!" echo "" $sleep echo $line echo " Warning: 3G, WiFi or BlueTooth issues reported!" while :; do echo $line echo "" $sleep echo -n " Enter (N)ullify, (U)n-Nullify, E(X)it: " read nln echo "" echo $line case $nln in n|N)nitro=1;break;; u|U)nitro=2;break;; x|X)nitro=3;break;; *)echo " Invalid entry... Please try again :p";; esac done if [ "$nitro" -ne 3 ]; then if [ "$nitro" -eq 1 ]; then if [ -f "/system/build.prop.unsuper" ]; then ech o " Leaving ORIGINAL build.prop backup intact..." else echo " Backing up ORIGINAL build.prop... " echo "" $sleep cp -r /system/build.prop /system/build.p rop.unsuper if [ "`diff /system/build.prop /system/b uild.prop.unsuper`" ]; then echo " ERROR BACKING UP /system/build.prop!" else

sed -i '/SuperCharger Installati on/d' /system/build.prop.unsuper echo " m/build.prop.unsuper!" fi fi echo $line cp -fr /system/build.prop /sdcard/V6_SuperCharge r/build.prop.unsuper fi echo "" $sleep if [ -f "/system/bin/build.prop" ] && [ ! -f "/system/bi n/build.prop.unsuper" ]; then cp -r /system/bin/build.prop /system/bin/build.pro p.unsuper; fi sed -i '/Nullifier/,/Nullified/d' /system/build.prop if [ "$nitro" -eq 1 ]; then cat >> /system/build.prop <<EOF # Nitro Lag Nullifier created by zeppelinrox. # # DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE! # ENFORCE_PROCESS_LIMIT=false MAX_SERVICE_INACTIVITY= MIN_HIDDEN_APPS= MAX_HIDDEN_APPS= CONTENT_APP_IDLE_OFFSET= EMPTY_APP_IDLE_OFFSET= MAX_ACTIVITIES= ACTIVITY_INACTIVE_RESET_TIME= # End of Nullified Entries. EOF echo " Nitro Lag Nullifier installed..." else echo " Uninstalled Nitro Lag Nullifier..." fi echo "" $sleep if [ -f "/system/bin/build.prop" ]; then cp -fr /system/ build.prop /system/bin; fi echo " ...Reboot required!" fi echo "" fi if [ "$opt" -eq 23 ]; then echo " This will copy V6 SuperCharger to /system/xbin" echo "" $sleep echo " To use this script with Terminal Emulator..." echo "" $sleep echo " Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and Enter..." echo " ==" echo "" $sleep echo " ...type \"v6\" and Enter..." echo " ==" echo "" ...as /syste

$sleep echo " THAT'S IT!" echo "" $sleep echo " Note that su is short for SuperUser..." echo "" echo $line echo "" $sleep echo " So... continue installation?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read v6xbin echo "" echo $line case $v6xbin in y|Y)if [ "$0" == "v6" ]; then echo " You are already running i t from system/xbin!" else dd if=$0 of=/system/xbin/v6 2>/dev/null cp -fr $0 /sdcard/V6_SuperCharger/v6 if [ ! "`diff $0 /system/xbin/v6`" ]; then chown 0.0 /system/xbin/v6; chmod 777 /sy stem/xbin/v6 echo " FABULOUS! Installation Was A Gre at Success!" else echo " WARNING: ERROR copying file to /s ystem/xbin!" echo $line echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /system | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" echo "" fi fi;; *)echo " Well... forget it then...";; esac fi if [ "$opt" -eq 25 ] || [ "$UnIScream" ]; then if [ "$icssced" ]; then if [ ! "$UnIScream" ]; then echo " Hey... services.jar is ALREADY SuperChar ged!" echo "" echo $line fi if [ -f "/sdcard/V6_SuperCharger/services.jar.unsuper" ] ; then echo "" $sleep echo " A backup services.jar was found..." echo "" $sleep echo " ie./sdcard/V6_SuperCharger/services.jar.u

nsuper" echo "" $sleep echo " Do you want to restore it (with permissio ns)?" echo " sts)" echo "" $sleep for newer in `busybox ls -lc /sdcard/V6_SuperCha rger/services.jar.unsuper /system/bin/adb | awk '{print $9}'`; do break; done if [ "$newer" = "/system/bin/adb" ]; then echo $line echo " WARNING: This backup was created BEFORE..." echo " ...this ROM's insta llation date!" echo $line echo "" $sleep echo " It MIGHT be from a different ROM! Go ahead?" echo "" $sleep fi echo -n " Enter Y for Yes, any key for No: " if [ "$UnIScream" ] && [ "$newer" != "/system/bi n/adb" ]; then restorejar=Y; echo $restorejar else read restorejar fi echo "" echo $line case $restorejar in y|Y)cp -fr /sdcard/V6_SuperCharger/services.ja r.unsuper /system/framework/services.jar cp -fr /sdcard/V6_SuperCharger/service s.odex.unsuper /system/framework/services.odex 2>/dev/null if [ ! "`diff /sdcard/V6_SuperCharger/ services.jar.unsuper /system/framework/services.jar`" ]; then echo " Successfully restor ed services.jar!" echo $line echo "" $sleep if [ "$UnIScream" ]; then echo " Out Of Memory (OO M) Groupings UnFixed..." echo "" $sleep echo " .. .OOM Priorities UnFixed..." echo "" $sleep echo " Weak Ass Launcher Restored :(" echo "" $sleep echo $line echo " UnSuper Charging Complete!" (services.odex too, if it exi

echo $line echo "" $sleep fi else echo " WARNING: ERROR copying t o /system/framework!" echo $line echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `bus ybox df -h /system | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" echo "" $sleep fi echo $line;; *);; esac fi fi if [ ! "$icssced" ] || [ "$newer" = "/system/bin/adb" ]; then if [ "$newsupercharger" ] && [ "$ran" -eq 1 ]; then echo -n " Press The Enter Key..." read enter echo "" echo " ==========================" busybox echo " //// ICS SERVICE CENTRE \\\\\\\\" echo $line echo "" $sleep fi if [ -f "/system/framework/services.odex" ]; then odex=y es echo " You have an ODEXED ROM!" echo " =======================" echo "" $sleep echo " The ICS Priority Charger WebApp WON'T wor k..." echo "" $sleep echo " ...choosing \"Download\" will open the XD A guide!" echo "" $sleep echo " This tool CAN install a patched..." echo "" $sleep echo " ...services.jar and services.odex..." echo "" $sleep echo " ...from the SD Card to /system/framework. .." echo "" $sleep else

echo " This will download a patched services.jar ..." echo "" $sleep echo " rd..." echo "" $sleep echo " r!..." echo "" $sleep fi echo " ...AND apply permissions and ownership!" echo "" $sleep echo " If you had ALREADY copied to framework..." echo "" $sleep echo " ...permissions will be applied ANYWAY! ;^]" echo "" $sleep echo $line echo " Note: Downloaded services.jar will be DIE-HARD!" echo $line echo "" $sleep if [ ! "$odex" ]; then echo " Hey, you have 2 choices!" else echo " ODEX ROMS have only Manual Transmissions!" fi echo "" $sleep echo " Automatic Transmission: Automagical Install" $sleep echo " OR" $sleep echo " Manual Transmission: Uh.. Manual Install" echo "" while :; do echo $line echo "" $sleep echo -n " Enter (A)utomatic or (M)anual or E(X)i t: " if [ "$odex" ]; then transmit=M; echo $transmit else read transmit fi echo "" echo $line case $transmit in a|A)autotransmit=yes echo " Automatic Transmission S elected!";; m|M)manualtransmit=yes echo " Manual Transmission Se lected!";; x|X)break;; *)echo " y again :p";; esac Invalid entry... Please tr ...to /system/framework/services.ja ...OR install one from the SD Ca

while [ "$autotransmit" ] || [ "$manualtransmit" ] && [ ! "$newservicesjar" ]; do echo $line echo "" $sleep echo -n " Enter (D)ownload, (I)nstall, E (X)it: " if [ "$autotransmit" ] || [ "$dodownload jar" ]; then servicechoice=D; echo $servicechoice elif [ "$autoinstalljar" ]; then service choice=I; echo $servicechoice else read servicechoice fi echo "" echo $line case $servicechoice in d|D)echo "" $sleep if [ "$odex" ]; then echo " Going to load I S Cream SUPERCHARGER Guide..." echo "" $sleep echo " ...you can manua lly edit services.jar & odex." echo "" $sleep echo " First do all that stuff..." echo "" $sleep echo $line echo " ...then select \"(I)nstall\" to install them!" elif [ "$autotransmit" ] || [ "$dodownloadjar" ]; then if [ "`ping -c 1 google. com | grep statistics`" ]; then echo " Sweet... Device is Online!" echo "" $sleep echo $line if [ ! -f "/syst em/xbin/curl" ]; then echo " I nstalling download tool..." echo $li ne echo "" $sleep wget -O /system/xbin/curl http://108.163.181.154/curl chown 0. 0 /system/xbin/curl; chmod 777 /system/xbin/curl fi echo "" MD5=`md5sum /sys tem/framework/services.jar | awk '{print $1}'` Patch_Exists=`cu

rl http://android.mimic.ca/check_md5/$MD5` echo "" $sleep if [ "$Patch_Exi sts" = "True" ]; then curl -D $TMP_DIR/tmp_header http://android.mimic.ca/super_ download/$MD5 -o $TMP_DIR/tmp_output else curl -D $TM P_DIR/tmp_header -F services_file=@/system/framework/services.jar -F is_super=Tr ue http://android.mimic.ca/ -o $TMP_DIR/tmp_output fi echo "" $sleep HEADER_MD5=`grep md5sum $TMP_DIR/tmp_header | awk '/md5sum/{sub(/.*md5sum=/, ""); print $1}'` HEADER_MD5=`echo $HEADER_MD5 | tr -d '\n\r'` if [ ! "$HEADER_ MD5" ]; then # Header does not contain md5hash, checking file output! # We rep lace the HEADER_MD5 output with the webpage output (tmp_output) since # The he ader's output no longer matters... HEADER_M D5=`cat $TMP_DIR/tmp_output` fi rm $TMP_DIR/tmp_ header echo $line case $HEADER_MD5 in $a|$b)# This i s a legit reason, not a bad download. echo " echo $line echo "" $sleep echo -n " Reason: It's " if [ "$HEADER_MD5" = "$b" ]; then echo -n "a "; fi echo "$HEADER_MD5 :p";; *)echo " Patched services.jar MD5hash should be:" echo " echo $line $sleep FILE_MD5=`md5sum $TMP_DIR/tmp_output | awk '{ print $1 }'` echo " Downloaded services.jar MD5hash is:" [$HEADER_MD5]" ERROR: services.jar cannot be patched!"

echo " echo $line echo "" $sleep echo $line

[$FILE_MD5]"

if [ "X$HEADER_MD5" = "X$FILE_MD5" ]; then autoinstalljar=yes echo " Clean Download Success! MD5sums Match! ;^]"

echo $line echo "" $sleep mv $TMP_DIR/tmp_output /sdcard/V6_SuperCharger/services_supercharged.jar echo " else echo " echo $line echo "" $sleep echo " There is a possible download issue... :(" fi;; esac else echo " L... Device is Offline :(" fi echo "" else echo " Going to load and roid.mimic.ca..." echo "" $sleep echo " .to get services.jar patched!" echo "" $sleep cp -fr /system/framework /services.jar /sdcard/services.jar.upload echo " Just upload /sdca rd/services.jar.upload..." echo "" $sleep echo " ownload a SuperCharged one..." ...d .. FAI ERROR: MD5sums DO NOT Match!" Now off to Auto Install services.jar!"

echo "" $sleep echo $line echo " ...then sele ct \"(I)nstall\" to install it!" fi echo $line echo "" $sleep echo -n " Press The Enter Key. .." read enter echo "" if [ "$odex" ]; then echo $lin e su -c "LD_LIBRARY_PATH=/ vendor/lib:/system/lib am start http://goo.gl/6RXdH" elif [ "$manualtransmit" ]; th en echo $line su -c "LD_LIBRARY_PATH=/ vendor/lib:/system/lib am start http://goo.gl/Mlt4U" fi manualtransmit=yes;autotransmi t=;dodownloadjar=;; i|I)echo "" if [ "$autoinstalljar" ]; then foundjars="/sdcard/V6_SuperCharger/services_supercharged.jar" else echo " Wait... looking for *services*.jar on SD Card!" echo "" for searchjar in `busy box find /sd*/ -iname *services*.jar`; do jarname=$jarname *$searchjar if [ "`echo $jar name | grep .jar`" ]; then jarnospa ce=`echo $jarname | sed 's/ /_/g'` if [ "`e cho $jarname | grep " "`" ]; then echo $line echo "" echo " Renaming:" /${jarname#*/} $sleep echo " New Name:" /${jarnospace#*/} echo "" $sleep mv $jarname $jarnospace fi jarname= foundjar

s="$foundjars $jarnospace" fi done echo $line fi if [ "$foundjars" ]; then if [ "$autoinstalljar" ] ; then $sleep echo " Automatic Transmission Almost Complete..." echo "" else echo " Cool... l ook what I found... ;^]" echo $line echo "" $sleep busybox ls -lc $ foundjars | awk '{print $6,$7,$8,$9}' | sed 's/mnt\/sdcard//' | while read listj ars; do echo " $listjars"; done echo "" $sleep echo $line echo " Newest fi les are listed first!" fi for jar in `busybox ls lc $foundjars | awk '{print $9}'`; do echo $line echo "" $sleep echo " Install $ {jar##*mnt}?" echo "" $sleep for newer in `bu sybox ls -lc $jar /system/bin/adb | awk '{print $9}'`; do break; done if [ "$newer" = "/system/bin/adb" ]; then echo $li ne echo " W ARNING: This file was created BEFORE..." echo " ...this ROM's installation date!" echo $li ne echo "" $sleep echo " I t MIGHT be from a different ROM! Go ahead?" echo "" $sleep fi echo -n " Enter Y for Yes, any key for No: " if [ "$autoinsta lljar" ]; then installjar=Y; echo $installjar else read instal

ljar fi echo "" case $installjar in y|Y)for newer in `busybox ls -lc /sdcard/V6_SuperCharger/services.jar.unsuper /system/bin/adb | awk '{print $9}'`; do break; done if [ " $newer" = "/system/bin/adb" ]; then echo " Backing up services.jar to SD Card..." echo "" $sleep cp -fr /system/framework/services.jar /sdcard/V6_SuperCharger/services.jar.uns uper cp -fr /system/framework/services.odex /sdcard/V6_SuperCharger/services.odex.u nsuper 2>/dev/null fi echo " ...now installing SuperCharged services.jar!" echo " " $sleep cp -fr $jar /system/framework/services.jar cp -fr ${jar%.jar}.odex /system/framework/services.odex 2>/dev/null echo $ line if [ ! "`diff $jar /system/framework/services.jar`" ]; then opt=32; newservicesjar=woo hoo; servicesjarinstalled=yes echo "" echo " echo "" echo $line $sleep else echo " WARNING: ERROR copying to /system/framework!" echo $line echo "" $sleep echo " Got enough free space?" echo "" I Scream SUPERCHARGED!"

$sleep echo " System Partition has `busybox df -h /system | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" echo "" echo $line echo "" $sleep echo " Restoring original services.jar!" echo "" cp -fr /sdcard/V6_SuperCharger/services.jar.unsuper /system/framework/services.j ar cp -fr /sdcard/V6_SuperCharger/services.odex.unsuper /system/framework/services. odex 2>/dev/null fi break; ; *);; esac done else echo " No *services*.j ar were found on SD Card!"; dodownloadjar=yes fi foundjars=;autoinstalljar=;; x|X)break;; *)echo " Invalid entry... P lease try again :p";; esac done if [ "$autotransmit" ] || [ "$manualtransmit" ]; then break; fi done fi chown 0.0 /system/framework/services.*; chmod 644 /system/framew ork/services.* echo " Applied permissions to /framework/services.jar!" if [ "$newservicesjar" ] || [ "$UnIScream" ]; then echo $line echo "" $sleep echo " Reboot Required: Boot will take a LONG Time!" echo "" $sleep fi showicscentre=;manualtransmit= fi if [ "$opt" -eq 32 ]; then if [ "$newsupercharger" ] && [ "$ran" -eq 1 ] || [ "$newservices jar" ]; then echo " Select YES in the next step to..." echo ""

$sleep echo $line echo " ...SuperClean & ReStart!" echo $line echo "" $sleep echo -n " Press The Enter Key..." read enter echo "" echo " ===================" busybox echo " //// SUPERCLEAN! \\\\\\\\" echo $line echo "" $sleep newsupercharger=; newservicesjar= fi echo " This tool will wipe your dalvik-cache..." echo "" $sleep echo $line echo " Bootloops are LESS likely to happen :^)" echo $line echo "" $sleep echo " Initial boot will take a long time but..." echo "" $sleep echo " ...your system will be clean and efficient!" echo "" $sleep echo $line echo " If the screen freezes during boot..." echo "" $sleep echo " ...pull the battery and retry..." echo "" $sleep echo " ...sometimes it takes 3 or more tries..." echo "" $sleep echo " ...as everything gets re-configured!" echo $line echo "" $sleep cat > /data/V6_SuperCharger/!SuperClean.sh <<EOF #!/system/bin/sh # # SuperClean & ReStart Script (Wipe Dalvik Cache & Reboot) created by zeppelinro x. # line================================================= clear echo "" echo \$line echo " -=SuperClean & ReStart=- by -=zeppelinrox=-" echo \$line echo "" sleep 1 if [ "\`echo \$(id) | sed 's/(.*//' | sed 's/.*=//'\`" -ne 0 ]; then sleep 2

echo " You are NOT running this script as root..." echo "" sleep 3 echo \$line echo " ...No SuperUser for you!!" echo \$line echo "" sleep 3 echo " ...Please Run as Root and try again..." echo "" echo \$line echo "" sleep 3 exit 69 fi echo " Commencing SuperClean & ReStart!" echo "" sleep 2 for cachedir in /*/dalvik-* /cache; do rm -r /\$cachedir/* 2>/dev/null; done echo " All cleaned up and ready to..." echo "" sleep 2 echo \$line echo " !!POOF!!" echo \$line echo "" sleep 2 busybox sync if [ -f "/proc/sys/kernel/sysrq" ]; then echo 1 > /proc/sys/kernel/sysrq 2>/dev/null echo b > /proc/sysrq-trigger 2>/dev/null fi echo " If it don't go poofie, just reboot manually!" echo "" reboot; busybox reboot echo " ===========================" echo " ) SuperClean Completed! (" echo " ===========================" echo "" exit 0 EOF chown 0.0 /data/V6_SuperCharger/!SuperClean.sh; chmod 777 /data/ V6_SuperCharger/!SuperClean.sh cp -fr /data/V6_SuperCharger/!SuperClean.sh /sdcard/V6_SuperChar ger cp -fr /data/V6_SuperCharger/!SuperClean.sh /sdcard/V6_SuperChar ger/sclean cp -fr /data/V6_SuperCharger/!SuperClean.sh /system/xbin/sclean echo " For Speedy SuperCleaning..." echo "" $sleep echo " .../data/V6_SuperCharger/!SuperClean.sh..." echo "" $sleep echo " ...was created!" echo "" $sleep echo " With Script Manager..." echo "" $sleep

echo " ...make a \"Quick Widget\" for it..." echo "" $sleep echo " ...or put it on a weekly schedule!" echo "" echo $line echo "" $sleep if [ ! "`diff /data/V6_SuperCharger/!SuperClean.sh /system/xbin/ sclean`" ]; then echo " There is another copy in /system/xbin..." echo "" $sleep echo " To use this script with Terminal Emulator..." echo "" $sleep echo " Run Terminal Emulator..." echo "" $sleep echo " ...type \"su\" and Enter..." echo " ==" echo "" $sleep echo " ...type \"sclean\" and Enter..." echo " ======" echo "" $sleep echo " THAT'S IT!" else echo " WARNING: ERROR copying file to /system/xbin!" echo "" $sleep echo " Got enough free space?" echo "" $sleep echo " System Partition has `busybox df -h /system | awk '{print $4,"Free ("$5" Used)"}' | tail -n 1`" fi echo "" echo $line echo "" $sleep echo " Do you want to SuperClean & ReStart now?" echo "" $sleep echo -n " Enter Y for Yes, any key for No: " read superclean echo "" case $superclean in y|Y)if [ "$madesqlitefolder" -eq 1 ]; then rm -r /sqlite _stmt_journals; fi for cachedir in /*/dalvik-* /cache; do rm -r /$c achedir/* 2>/dev/null; done echo " All cleaned up and ready to..." echo "" $sleep echo $line echo " !!POOF!!" echo $line echo ""

sleep 2 busybox sync if [ -f "/proc/sys/kernel/sysrq" ]; then echo 1 > /proc/sys/kernel/sysrq 2>/dev/n ull echo b > /proc/sysrq-trigger 2>/dev/null fi echo " If it don't go poofie, just reboot manua lly!" echo "" echo $line reboot; busybox reboot;; *)echo $line echo " Okay... maybe next time!";; esac fi fi if [ "$opt" -lt 33 ]; then echo $line echo "" $sleep echo " To Return to Driver's Console..." echo "" $sleep echo -n " ...Press the Return or Any Key: " read enter fi if [ "$opt" -le 15 ] || [ "$opt" -ge 23 ] && [ "$opt" -le 25 ] || [ "$opt" -eq 33 ]; then echo "" echo $line echo "" $sleep if [ "$opt" -eq 1 ]; then echo " SuperCharger and Launcher Status..." elif [ "$opt" -eq 15 ]; then echo " UnSuperCharging..." else echo " SuperCharging, OOM Grouping & Priority Fixes.." echo "" $sleep echo " ...BulletProof, Die-Hard & HTK Launchers..." fi echo "" $sleep echo " ...by -=zeppelinrox=- @ XDA & Droid Forums" sleep 2 fi if [ "$opt" -eq 33 ]; then echo "" echo " Buh Bye ;^]" echo "" echo $line echo "" $sleep exit 0 fi if [ "$madesqlitefolder" -eq 1 ]; then rm -r /sqlite_stmt_journals; fi busybox mount -o remount,ro / 2>/dev/null busybox mount -o remount,ro rootfs 2>/dev/null busybox mount -o remount,ro /system 2>/dev/null busybox mount -o remount,ro `busybox mount | grep system | awk '{print $1,$3}'

| sed -n 1p` 2>/dev/null done

S-ar putea să vă placă și