Vous êtes sur la page 1sur 194

#!

/system/bin/sh
#
# V6 SuperCharger Update 9 RC11 by -=zeppelinrox=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
# V6 SuperCharger, OOM Grouping & Priority Fixes created by zeppelinrox.
# SuperMinFree Calculator & MFK Calculator (for min_free_kbytes) created by zepp
elinrox also ;^]
# Entropy-ness Enlarger (sysctl tweak for kernel.random.read_wakeup_threshold th
at keeps entropy_avail full) discovered by zeppelinrox.
#
# See http://goo.gl/qM6yR - SuperCharger thread at XDA
# See http://goo.gl/IvGL1 - Ultimatic Jar Patcher Tools thread at XDA for more G
oodness and MultiTasking!
# ie. Patch services.jar for ICS and above to get 100%
SuperCharged with "Jelly ISCream"
# Patch services.jar for ALL ROMS (Froyo and above
) and get "Maximum MultiTasking Mods"
# Patch services.jar for Sense 4 and above ROMS (N
ot needed for Sense 3.6 and below) and get a "Non-Sense App Limit"
#
# 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_free_kb
ytes.
# See http://goo.gl/P8Bvu - How Entropy-ness Enlarger works.
# See http://goo.gl/Zc85j - Possible reasons why it may actually do something :p
#
# For Debugging: Delete the # at the beginning of the next line and watch the ou
tput on the next run!
# set -x
#
if [ ! -d "/data/local/busybox*/xbin" ]; then export PATH=$PATH:/system/xbin:/sb
in:/vendor/bin:/system/sbin:/system/bin
else export PATH=$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin:`
ls -d /data/local/busybox*/xbin 2>/dev/null`
fi 2>/dev/null
line=================================================
echo ""
echo $line
echo " NOTE: BUSYBOX v1.16.2 OR HIGHER IS RECOMMENDED!"
echo $line
sleep 2
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
mount -o remount,rw / 2>/dev/null
mount -o remount,rw rootfs 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 [ "`ls $EXTERNAL_STORAGE`" ]; then storage=${EXTERNAL_STORAGE#*mnt}
elif [ "`ls $EXTERNAL_STORAGE2`" ]; then storage=${EXTERNAL_STORAGE2#*mnt}
elif [ "`ls $USBHOST_STORAGE`" ]; then storage=${USBHOST_STORAGE#*mnt}
elif [ "`ls $SECONDARY_STORAGE`" ]; then storage=${SECONDARY_STORAGE#*mnt}
elif [ "`ls $PHONE_STORAGE`" ]; then storage=${PHONE_STORAGE#*mnt}
else storage="/sdcard"
fi 2>/dev/null
cat > $storage/!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>Did this file just auto load?</b> If so, there are 3 reasons why this could h
appen:<br>
1. You're <u>not</u> 100% SuperCharged and minfrees <u>don't match</u>! If this
is the case, <u><b>READ</b></u> this entire help file - <u><b>BEFORE</b></u> ask
ing redundant questions!</u><br>
2. You set Wheel Alignment to run on boot but you don't have the zipalign binary
installed. Get it by installing the <a href="http://goo.gl/1JPl8">SuperCharger
Starter Kit</a>.<br>
3. You set Detailing to run on boot but you don't have the sqlite3 binary instal
led. Get it by installing the <a href="http://goo.gl/1JPl8">SuperCharger Starter
Kit</a>.<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>
<a href="http://goo.gl/P8Bvu">Entropy-ness Enlarger Info</a> - explanation for <
b>kernel.random.read_wakeup_threshold</b><br>
<a href="http://goo.gl/Zc85j">Entropy-ness Enlarger Musings...</a> - Possible re
asons why it may actually do something :p<br>
<br>
<u><b>Patching services.jar/odex for ALL ROMS:</b></u>: It actually has 3 Mods.
See the <a href="http://goo.gl/IvGL1">-=Ultimatic Jar Patcher Tools=-</a> thread
.<br>
Mod 1. "Jelly ISCream" for ICS, Jelly Bean and above. This will SuperCharge Your
Home Launcher and ADJ/OOM Priorities!<br>
Mod 2. "Maximum MultiTasking Mods" for Froyo and above<br>
Mod 3. "Non-Sense App Limit" for Sense 4 and above (Not needed for Sense 3.6 and
below).<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 Busy
Box from the <a href="http://goo.gl/qM6yR">V6 SuperCharger Thread!</a><br>
Or even better, get the <b>SuperCharger Starter Kit!</b>
<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>PRE-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 $storage (it contains the directory structur
e), 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 [ ! -d "/sqlite_stmt_journals" ]; then FAIL=yes
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 [ "$madesqlitefolder" -eq 1 ]; then rm -r /sqlite_stmt_journals; fi 2>/dev/nu
ll
mount -o remount,ro / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
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 FAIL=yes
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..."
echo ""
exit 69;;
esac
else
if [ ! "`which awk`" ]; then badbb=yes; echo " WARNING: awk applet NOT F
OUND... Bad BusyBox!"; echo $line; sleep 2; fi
if [ ! "`which sed`" ]; then badbb=yes; echo " WARNING: sed applet NOT F
OUND... Bad BusyBox!"; echo $line; sleep 2; fi
if [ ! "`which head`" ]; then badbb=yes; echo " WARNING: head applet NOT
FOUND... Bad BusyBox!"; echo $line; sleep 2; fi
if [ ! "`which pgrep`" ]; then badbb=yes; echo " WARNING: pgrep applet N
OT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi
if [ "$badbb" ]; then FAIL=yes
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!"; FAIL=yes
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 FAIL=yes
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 FAIL=yes
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..."
echo ""
exit 69;;
esac
fi
echo ""
sleep 1
fi
id=$(id); id=${id#*=}; id=${id%%[\( ]*}
if [ "$id" = "0" ] || [ "$id" = "root" ]; then echo " Nice! You're Runnin
g as Root/SuperUser!"
else FAIL=yes
echo $line
echo " You are NOT running this script as root..."
echo $line
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://$storage/!SuperC
harger.html"
echo ""
echo $line
echo ""
sleep 4
echo " I hope that helped! :^)"
echo ""
sleep 4
exit 69
fi
echo ""
sleep 1
echo $line
echo -n " Test Drive Report: "
if [ "$FAIL" ]; then echo "FAIL!"
else echo "PASS!"
fi
echo $line
echo ""
sleep 2
animspeed="busybox sleep 0.2"
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;preics=yes;jb=0;memory=c;a=already_modified;b=bad_jar;ram1=9500
;oomstick=0;ADJs=0;OOMs=0;minfrees=0
heapsize=$(($ram*16/100))
remainder=$(($heapsize%2))
heapsize=$(($heapsize+$remainder))
if [ "$ram" -lt 512 ]; then sdtweak=1024
else sdtweak=2048
fi
TMP_DIR="$storage/V6_SuperCharger/temp"
initrcpath1="/init.rc"
initrcpath="/data$initrcpath1"
initrcbackup=$initrcpath.unsuper
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"
minfreefile="/sys/module/lowmemorykiller/parameters/minfree"
if [ -f "/sys/module/lowmemorykiller/parameters/adj" ]; then adjfile="/sys/modul
e/lowmemorykiller/parameters/adj"
elif [ -f "/data/V6_SuperCharger/SuperChargerAdj" ]; then adjfile="/data/V6_Supe
rCharger/SuperChargerAdj"
fi
if [ -f "/proc/1/oom_adj" ]; then oom_adj="oom_adj"
elif [ -f "/proc/1/oom_score_adj" ]; then oom_adj="oom_score_adj"
fi
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
mount -o remount,rw / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 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 "/data/V6_SuperCharger" ]; then mkdir /data/V6_SuperCharger; fi
if [ ! -d "$storage/V6_SuperCharger" ]; then mkdir $storage/V6_SuperCharger; fi
for rc in `grep import $initrcpath1 | grep -v "#" | sed 's/.*import*.//'` `busyb
ox find /system -iname "*.rc"`; do
if [ "`echo $rc | grep -v goldfish | grep -v ueventd`" ] && [ ! "`echo $
allrcpaths | grep $rc`" ]; then
if [ ! -f "$rc" ]; then
echo "on early-boot" > $rc
echo "on boot" > $rc
touch $rc.unsuper
fi
chown 0.0 $rc; chmod 644 $rc
allrcpaths="$allrcpaths $rc"
if [ "`grep -ls "on boot" $rc`" ]; then rcpaths="$rcpaths $rc";
fi
fi
done
mount -o remount,ro / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 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
if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; then
speed=`awk -F , '{print $1}' /data/V6_SuperCharger/SuperChargerOptions`
buildprop=`awk -F , '{print $2}' /data/V6_SuperCharger/SuperChargerOptio
ns`
animation=`awk -F , '{print $3}' /data/V6_SuperCharger/SuperChargerOptio
ns`
initrc=`awk -F , '{print $4}' /data/V6_SuperCharger/SuperChargerOptions`
launcheradj=`awk -F , '{print $5}' /data/V6_SuperCharger/SuperChargerOpt
ions`
panicmode=`awk -F , '{print $6}' /data/V6_SuperCharger/SuperChargerOptio
ns`
fixalign=`awk -F , '{print $7}' /data/V6_SuperCharger/SuperChargerOption
s`
zepalign=`awk -F , '{print $8}' /data/V6_SuperCharger/SuperChargerOption
s`
fixemissions=`awk -F , '{print $9}' /data/V6_SuperCharger/SuperChargerOp
tions`
detailing=`awk -F , '{print $10}' /data/V6_SuperCharger/SuperChargerOpti
ons`
detailinterval=`awk -F , '{print $11}' /data/V6_SuperCharger/SuperCharge
rOptions`
miscsd=`awk -F , '{print $12}' /data/V6_SuperCharger/SuperChargerOptions
`
tc3g=`awk -F , '{print $13}' /data/V6_SuperCharger/SuperChargerOptions`
flushOmaticHours=`grep "^flushOmaticHours=" /data/V6_SuperCharger/!FastE
ngineFlush.sh | sed 's/flushOmaticHours=//'` 2>/dev/null
sleep="sleep $speed"
if [ "$buildprop" -eq 1 ]; then prop="/system/build.prop"
else prop="/data/local.prop"
fi
if [ ! "$detailinterval" ] || [ "`echo $detailinterval | grep "[^0-9]"`"
] || [ "$detailinterval" -gt 9 ]; then detailinterval=3; fi
if [ ! "$flushOmaticHours" ] || [ "`echo $flushOmaticHours | grep "[^0-9
]"`" ] || [ "$flushOmaticHours" -gt 24 ]; then flushOmaticHours=0; fi
if [ ! "$tc3g" ]; then missingoptions=yes; animation=1; fi
else firstgear=yes; autoshowcalculated=yes; sleep="sleep 2"
fi
if [ ! "$animation" ] || [ "$animation" -eq 1 ]; then
clear;$animspeed;echo $line;echo "";echo "";echo "";echo "";echo "";echo
""; echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo $line;echo "";echo "";echo "";echo "";echo "";echo ""
; echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo $line;echo $line;echo "";echo "";echo "";echo "";echo
""; echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo $line;echo "";echo $line;echo "";echo "";echo "";echo
""; echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo $line;echo " |/ #####";echo "";echo $line;echo "
";echo "";echo ""; echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo $line;echo " | / # #";echo " |/ #####";ec
ho "";echo $line;echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo $line;echo " ||// # #";echo " | / # #";
echo " |/ #####";echo "";echo $line;echo "";echo "";echo "";echo "";echo ""
;$animspeed
clear;echo "";echo $line;echo " || // #####";echo " ||// # #"
;echo " | / # #";echo " |/ #####";echo "";echo $line;echo "";echo ""
;echo "";echo "";$animspeed
clear;echo "";echo $line;echo " || // #";echo " || // #####";ec
ho " ||// # #";echo " | / # #";echo " |/ #####";echo "";echo
$line;echo "";echo "";echo "";$animspeed
clear;echo "";echo $line;echo " || // # #" ;echo " || // #
";echo " || // #####";echo " ||// # #";echo " | / # #";echo "
|/ #####";echo "";echo $line;echo "";echo "";$animspeed
clear;echo "";echo $line;echo " || // #####";echo " || // #
#";echo " || // #";echo " || // #####";echo " ||// # #";echo
" | / # #";echo " |/ #####";echo "";echo $line;echo "";$animspeed
clear;echo "";echo $line;echo "";echo " || // #####";echo " ||
// # #";echo " || // #";echo " || // #####";echo " ||// #
#";echo " | / # #";echo " |/ #####";echo "";echo $line;sleep 1
clear;echo "";echo $line;echo "";echo " || // #####";echo " ||
// # #";echo " || // # -=SUPERCHARGER=-";echo " || //
#####";echo " ||// # #";echo " | / # #";echo " |/ #####";echo
"";echo $line;sleep 1
clear;echo " zoom...";echo $line;echo "";echo " || // #####";echo
" || // # #";echo " || // # -=SUPERCHARGER=-";echo "
|| // #####";echo " ||// # #";echo " | / # # Presented";echo "
|/ #####";echo "";echo $line;sleep 1
clear;echo " zoOM... zoOM...";echo $line;echo "";echo " || // ###
##";echo " || // # #";echo " || // # -=SUPERCHARGER=-";e
cho " || // #####";echo " ||// # #";echo " | / # # Presented
by:";echo " |/ #####";echo "";echo $line;sleep 1
clear;echo " zOOM... zOOM...";echo $line;echo "";echo " || // ###
##";echo " || // # #";echo " || // # -=SUPERCHARGER=-";e
cho " || // #####";echo " ||// # #";echo " | / # # Presented
by:";echo " |/ ##### -=zeppelinrox=-";echo "";echo $line;sl
eep 1
else clear; echo ""; echo $line
fi
echo " NOTE: BUSYBOX v1.16.2 OR HIGHER IS RECOMMENDED!"
echo $line
echo ""
sleep 2
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 " $bbversion"
echo " `busybox | head -n 1 | awk '{print $3,$4,$5,$6,$7,$8,$9,$10}'`"
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 ""
homeadj=`getprop ro.HOME_APP_ADJ`;FA=`getprop ro.FOREGROUND_APP_ADJ`;PA=`getprop
ro.PERCEPTIBLE_APP_ADJ`;VA=`getprop ro.VISIBLE_APP_ADJ`
api="`grep ro.build.version.sdk /system/build.prop | sed 's/.*=//' | tr -d '\r'`
"
if [ "$api" -ge 14 ]; then postics=yes;preics=;FA=0;PA=2
if [ "$api" -ge 16 ]; then jb=1; fi
elif [ "$PA" ]; then gb=1
fi
adjs1=0; adjs3=0; adjs5=0; adjs6=0; adjs7=0
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|tw5|nextgen|shell|home|trebuchet|launcher" | sed 's%.
* name="\(.*\)".*%\1%' | cut -d '"' -f1` adwfreak zeam tw3 tw4 tw5 nextgen shell
home trebuchet launcher acore; do
validlauncher=`pgrep -l $launchers | awk '{print $2}' | grep -Ev "/|noti
fication|gowidget|downloadservice"` 2>/dev/null
if [ "$validlauncher" ] && [ ! "`echo $llist | grep $validlauncher`" ];
then llist="$llist $validlauncher"; fi 2>/dev/null
done
for l in $llist; do
for lpid in `pgrep $l`; do loom_adj=`cat /proc/$lpid/$oom_adj`
if [ "$loom_adj" -eq -1000 ]; then loom_adj=-16
elif [ "$loom_adj" -eq 1000 ]; then loom_adj=15
elif [ "${loom_adj#-}" -gt 20 ]; then loom_adj=`echo $loom_adj | awk '{p
rintf "%.0f\n", $1*17/1000}'`
fi
if [ "$l" = "android.process.acore" ] && [ "$loom_adj" -lt 0 ]; then con
tinue
elif [ ! "$HL" ] || [ "$HL" -gt "$loom_adj" ]; then
if [ "$lname" ] && [ "$lname" != "android.process.acore" ] && [
"$l" = "android.process.acore" ]; then
echo $line
echo ""
$sleep
echo " Erm... Is $lname the launcher?"
echo ""
$sleep
echo -n " Enter N for No, any key for Yes: "
read islauncher
echo ""
case $islauncher in
n|N);;
*)continue;;
esac
fi
HL=$loom_adj
lname=$l
if [ "$preics" ] && [ "$HL" -eq "$homeadj" ] && [ "$HL" -lt "$VA
" ] && [ "$HL" -eq "$(($FA+1))" ]; then diehard=yes; break; fi
fi
done
done 2>/dev/null
if [ "$postics" ]; then
for i in `ls /proc`; do
if [ "$i" -ne 0 ] && [ -f "/proc/$i/$oom_adj" ] && [ "`cat /proc
/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj | awk '{
printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -eq 1 ]; then adjs1=$(($adjs1+1)); fi
if [ "$adj" -eq 3 ]; then adjs3=$(($adjs3+1)); fi
if [ "$adj" -eq 5 ]; then adjs5=$(($adjs5+1)); fi
if [ "$adj" -eq 6 ]; then adjs6=$(($adjs6+1)); fi
if [ "$adj" -eq 7 ]; then adjs7=$(($adjs7+1)); fi
fi
done 2>/dev/null
if [ ! "$HL" ]; then HL=6; fi
if [ "$HL" -eq 1 ] && [ "$adjs1" -eq 1 ] || [ "$adjs3" -gt 0 ]; then ser
vicesjarpatched=hellzyeah; VA=3
elif [ "$HL" -eq 0 ] || [ "$HL" -eq 2 ] && [ "$adjs1" -eq 0 ]; then serv
icesjarpatched=hellzyeah; VA=3
else VA=1
if [ "$HL" -gt 2 ]; then
if [ "$adjs7" -gt 0 ] || [ "$adjs5" -gt 0 ] && [ "$adjs6
" -eq 1 ]; then showparlor=yes
elif [ "$adjs7" -gt 0 ] || [ "$adjs6" -gt 0 ] && [ "$adj
s5" -eq 1 ]; then showparlor=yes
else servicesjarpatched=hellzyeah; usedwebapp=yes
fi
elif [ "$HL" -eq 1 ]; then servicesjarpatched=hellzyeah; usedweb
app=yes
elif [ "$adjs7" -gt 0 ] || [ "$adjs5" -gt 0 ] && [ "$adjs6" -eq
0 ]; then showparlor=yes
elif [ "$adjs7" -gt 0 ] || [ "$adjs6" -gt 0 ] && [ "$adjs5" -eq
0 ]; then showparlor=yes
else servicesjarpatched=hellzyeah; usedwebapp=yes
fi
if [ -f "$storage/ultimatic.tmp" ]; then showparlor=; rm $storag
e/ultimatic.tmp; fi
fi
fi
if [ "$preics" ] && [ "$HL" -gt "$homeadj" ]; then hijackedadj=$HL
if [ "$homeadj" -eq "$(($FA+1))" ]; then hijackedlname=$lname; fi
elif [ "$servicesjarpatched" ] && [ "$HL" -gt 2 ]; then hijackedadj=$HL
if [ "$adjs1" -eq 1 ]; then hijackedlname=$lname; fi
fi
if [ "$hijackedlname" ]; then
for i in `ls /proc`; do
if [ "`cat /proc/$i/$oom_adj`" -eq 1 ] || [ "`cat /proc/$i/$oom_
adj`" -eq 58 ] && [ "$i" -ne 0 ] && [ -f "/proc/$i/$oom_adj" ] && [ "`cat /proc/
$i/cmdline`" ]; then
HL=1
lname=`cat /proc/$i/cmdline | sed 's/.*\///'`
break
fi
done 2>/dev/null
fi
if [ "$lname" ]; then
echo $line
if [ "$hijackedadj" ] && [ ! "$hijackedlname" ]; then echo " $lname is N
OT the Home Launcher!"
else echo " $lname is the Home Launcher!"
fi
echo $line
echo ""
$sleep
if [ "$hijackedadj" ]; then
echo $line
if [ "$hijackedlname" ]; then
echo " BUT it may have HIJACKED Home Launcher Status!"
echo $line
echo ""
$sleep
echo " Since $hijackedlname... "
echo ""
$sleep
echo " ...has an ADJ priority of $hijack
edadj :P"
echo ""
else echo " Home Launcher Status may have been HIJACKED!"
fi
echo $line
echo ""
$sleep
fi
echo -n " 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 $line
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 [ "$preics" ] && [ "$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 "$storage/V6_SuperCharger/SuperChargerAdj" ]; then rookie=yes; fi
if [ -f "$storage/V6_SuperCharger/SuperChargerAdj" ] && [ ! "`grep "SuperCharger
" /system/build.prop`" ]; then newsupercharger=woohoo
if [ -f "$initrcpath" ]; then rm $initrcpath; fi
echo ""
$sleep
echo " Oh wait... Did you flash a new ROM or kernel?"
echo ""
$sleep
echo " I Can 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 ""
echo $line
echo ""
$sleep
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"}' $storage/V6_SuperCharger/SuperChargerMinfree
echo ""
$sleep
echo " Re-SuperCharge from $storage?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read resuper
echo ""
echo $line
case $resuper in
y|Y)echo " Re-SuperCharger will Auto Load!"
autoresupercharge=indeed;;
*)echo " Re-SuperCharging Declined... meh..."
if [ "$firstgear" ]; then
echo $line
echo ""
$sleep
echo " Going to load Driver Options instead!"
echo ""
fi;;
esac
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 has been applied - $speed"
echo $line
$sleep
if [ "$preics" ]; then
echo -n " Prop file used for SuperCharging - "
if [ "$buildprop" -eq 0 ]; then echo "LOCAL.PROP"
else echo "BUILD.PROP"
fi
echo $line
$sleep
echo -n " SuperCharged Launcher Option is"
if [ "$launcheradj" -eq 0 ]; then echo " BulletProof!!"
elif [ "$launcheradj" -eq 2 ]; then echo " Hard To Kill!"
else echo "... Die-Hard!!"
fi
echo $line
$sleep
fi
echo -n " Kernel & Virtual Memory Tweaks"
if [ "$panicmode" -eq 3 ]; then kpanic=0; kpoops=0; echo " are Rock Hard
!"
elif [ "$panicmode" -eq 2 ]; then kpanic=30; kpoops=0; echo " - Rock & R
oll!"
elif [ "$panicmode" -eq 0 ]; then kpanic=30; kpoops=1; echo " - Disco Da
nce!"
else kpanic=30; kpoops=1; echo " ala Soft Rock!"
fi
echo $line
$sleep
echo -n " Miscellaneous and SD Card Speed Tweaks - "
if [ "$miscsd" -eq 0 ]; then echo "NO!"
else echo "YES!"
fi
echo $line
$sleep
echo -n " 3G TurboCharger Enhancement(3GTC Addon)- "
if [ "$tc3g" -eq 0 ]; then echo "NO!"
else echo "YES!"
fi
echo $line
$sleep
if [ "$flushOmaticHours" -eq 0 ]; then echo " Engine Flush-O-Matic Mode
is Currently - OFF!"
else echo " Engine Flush-O-Matic - Enabled @ Every - $flushOmaticHours"
hrs
fi
echo $line
$sleep
if [ -d "/system/etc/init.d" ]; then
echo -n " Fix Alignment (Dual Tool) Runs On Boot - "
if [ "$fixalign" -eq 0 ]; then echo "NO!"
else echo "YES!"
fi
echo $line
$sleep
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
if [ "$detailing" -eq 0 ]; then echo " Detailing(Clean Database
) Runs On Boot - NO!"
else echo " Detailing(Clean Database) Runs Every $detailinterva
l Boots!"
fi
echo $line
$sleep
if [ "$preics" ]; then
echo -n " System Integration of $initrcpath1 Setting -
"
if [ "$initrc" -eq 1 ]; then
echo "ON!"
echo $line
echo ""
$sleep
echo " Go to Driver Options and DISABLE..."
echo ""
$sleep
echo " ...if you have root/permission is
sues!"
else
echo "OFF!"
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
if [ -f "/data/!!SuperChargerBootLoopMessage.log" ]; then
echo $line
echo " DAMMIT... A Boot Loop Was Detected!"
echo $line
echo ""
$sleep
echo " Do Over! Re-Enabling /init.d/*99SuperCharger..."
echo ""
echo $line
echo ""
$sleep
rm /data/!!SuperChargerBootLoopMessage.log
fi
chmod 777 $minfreefile
if [ "$adjfile" ]; then chmod 777 $adjfile; fi
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
;SuperChargerScriptManagerHelp=0;SuperChargerHelp=0;vroomverifier=;bpblind=;low=
w;scservice=;bpservice=
currentminfree=`cat $minfreefile`
if [ ! "$adjfile" ]; then oomadj1=0;oomadj2=1;oomadj3=2;oomadj4=4;oomadj5=9;oom
adj6=15;currentadj="0,1,2,4,9,15"
elif [ "`awk -F , '{print $3}' $adjfile`" -gt 15 ]; then
oomadj1=`awk -F , '{printf "%.0f\n", $1*17/1000}' $adjfile`;oomadj2=`awk
-F , '{printf "%.0f\n", $2*17/1000}' $adjfile`;oomadj3=`awk -F , '{printf "%.0f
\n", $3*17/1000}' $adjfile`;oomadj4=`awk -F , '{printf "%.0f\n", $4*17/1000}' $a
djfile`;oomadj5=`awk -F , '{printf "%.0f\n", $5*17/1000}' $adjfile`;oomadj6=15
currentadj="$oomadj1,$oomadj2,$oomadj3,$oomadj4,$oomadj5,$oomadj6"
else
oomadj1=`awk -F , '{print $1}' $adjfile`;oomadj2=`awk -F , '{print $2}'
$adjfile`;oomadj3=`awk -F , '{print $3}' $adjfile`;oomadj4=`awk -F , '{print $4}
' $adjfile`;oomadj5=`awk -F , '{print $5}' $adjfile`;oomadj6=`awk -F , '{print $
6}' $adjfile`
currentadj=`cat $adjfile`
fi
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"; fi
if [ "`grep "bullet_service" $rc`" ]; then bpservice="bpsinstalled"; fi
done
if [ "$opt" -ne 69 ]; then echo ""; else $sleep; fi
echo $line
echo " For Help & Info, see $storage/!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 RC11}"
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. UnSuperCharger {UnDo Everything}"
echo $line
echo "15. The bOOM Stick {Verify OOM Groupings}"
echo "16. BulletProof Apps {Hit or Miss}"
echo "17. Engine Flush-O-Matic {ReCoupe RAM Booster}"
echo "18. Detailing {Vacuum & Reindex SQL DBs}"
echo "19. Wheel Alignment {ZipAlign APKs}"
echo "20. Fix Emissions {Fix FCing Errors}"
echo "21. Fix Alignment {ZipAlign & Fix FCs}"
echo "22. Nitro Lag Nullifier {Experimental}"
echo $line
echo "23. System Installer {Terminal Usage}"
echo "24. Re-SuperCharger {Restore V6 Settings}"
echo "25. Jelly ISCream Parlor {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 ] && [ ! "$rookie" ]; 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 [ "$postics" ] && [ ! "$servicesjarpatched" ]; then echo " NOT Patched.... s
o.... weak :("; status=4
elif [ "$usedwebapp" ]; then echo " Patched via WebApp ie. Very Weak!"; status=
3
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 [ "$servicesjarpatched" ]; then ADJs=1; scpercent=$(($scpercent+25))
echo -n "ARE Patched In"
if [ "$ran" -eq 1 ]; then echo "!"
else echo "! $scpercent%"
fi
elif [ "$postics" ]; then
echo "ARE NOT Patched In!"
echo " Select The \"Jelly ISCream Parlor\" 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 Home Is NOT \"Locked In Memory\"!"
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 " You Got SCAMMED!"
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 " ...which basically does nothing :P"
echo $line
fi
if [ "$ran" -eq 1 ]; then scpercent=$(($scpercent+25))
else
if [ "$showparlor" ] || [ "$usedwebapp" ] && [ "$postics" ]; then
echo ""
echo " SuperCharged Launcher is NOT in effect..."
if [ "$showparlor" ]; then
echo " This ROM WON'T load values from a prop file!"
echo " You can do it with a SERVICES.JAR patch..."
echo " Just pick the \"Jelly ISCream Parlor\" Option!"
echo " Note: Automatic Transmission is OUTDATED!"
else
echo " It was Patched with the OUTDATED WebApp!"
echo " Pick the \"Jelly ISCream Parlor\" Option!"
fi
echo " ...See the XDA Thread for more info."
elif [ "$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 [ "$preics" ] && [ "$scadj" ] && [ "$oomstick" -eq 0 ] && [ "$build
prop" -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 [ "$preics" ] && [ "$scadj" ] && [ "$oomstick" -eq 0 ] && [ "$buildpr
op" -eq 0 ] || [ "$showparlor" ] || [ "$usedwebapp" ]; 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 [ "$showparlor" ] || [ "$usedwebapp" ] || [ "$scadj" ]; then echo "";
echo $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 640 ]; then echo -n " ...768 HP"
calculatedmb="8, 14, $(($ram*13/100)), $(($ram*15/100)), $(($ram*17/100)
), $(($ram*19/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))"
elif [ "$ram" -lt 896 ]; then echo -n " ...1000 HP"
calculatedmb="8, 14, $(($ram*17/100)), $(($ram*19/100)), $(($ram*21/100)
), $(($ram*23/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 $storage/V6_SuperCharger/SuperChargerMinfree`"
] && [ "$ran" -eq 0 ]; then
echo " Re-SuperCharger Settings on $storage..."
echo ""
awk -F , '{print " "$1/256", "$2/256", "$3/256", "$4/
256", "$5/256", "$6/256" MB"}' $storage/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 echo "NOT Installed!"
fi
echo $line
echo -n " BulletProof Apps Service is "
if [ "$bpservice" ]; then echo "Installed!"
else echo "NOT Installed!"
fi
else
if [ "$minfrees" -eq 0 ]; then echo $line; fi
echo " Sorry, your ROM wipes service entries on boot."
if [ "$minfrees" -eq 1 ]; then
echo ""
echo $line
echo " But the Minfrees Match so it doesn't matter!"
fi
fi
echo $line
fi
if [ ! -f "`ls /system/etc/init.d/*BulletProof_Apps*`" ] && [ ! -f "/data/97Bul
letProof_Apps.sh" ]; then echo " BulletProof Apps Script is NOT Installed!"
elif [ "`busybox ps -w | grep Bullet | wc -l`" -gt 1 ]; then
for i in `busybox ps -w | grep Bullet`; do
if [ "`echo $i | grep Effect`" ]; then echo " $i"; ech
o $line
elif [ "`echo $i | grep init.d`" ]; then echo " `echo $i | sed '
s/.*etc//'` is Running!"; echo $line
elif [ "`echo $i | grep data`" ]; then echo "$i is Running!"; ec
ho $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!"
else echo "/data/97BulletProof_Apps.sh is NOT Running!"
fi 2>/dev/null
if [ "$ldone" ]; then ldone=
else echo $line
fi
if [ ! -f "/system/xbin/flush" ] && [ ! -f "/data/V6_SuperCharger/!FastEngineFl
ush.sh" ]; then echo " Fast Engine Flush is NOT Installed!"
elif [ "$flushOmaticHours" -eq 0 ]; then echo " Engine Flush-O-Matic is N
OT Enabled!"
elif [ "`busybox ps -w | grep -i flush | grep -E "_|/" | wc -l`" -gt 1 ]; then
for i in `busybox ps -w | grep -i flush | grep -E "_|/"`; do
if [ "`echo $i | grep Effect`" ]; then echo " $i"; echo $l
ine
elif [ "`echo $i | grep xbin`" ]; then echo " $i is Runn
ing!"; echo $line
elif [ "`echo $i | grep data`" ]; then echo " `echo $i |
sed 's/.*SuperCharger\///'` is Running!"; echo $line
fi
done
echo " Engine Flush-O-Matic is ON @ Every $flushOmaticHours hrs"
echo $line
ldone=yes
else echo " Engine Flush-O-Matic is ON & NOT in RAM!"
fi 2>/dev/null
if [ "$ldone" ]; then ldone=
else 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 [ `cat /proc/sys/kernel/random/entropy_avail` -gt 1000 ];then echo " Whoah..
. Your Entropy-ness is THIS BIG => `cat /proc/sys/kernel/random/entropy_avail`"
else echo " Entropy-ness Envy? It is THIS small => `cat /proc/sys/kernel/r
andom/entropy_avail`"
fi
echo $line
echo ""
if [ "$postics" ]; 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 ] && [ "$rookie" ]; then
echo " Hey Rookie! SCROLL UP to see the Menu Options!"
echo $line
elif [ "$ran" -eq 1 ] && [ "$scpercent" -lt 90 ]; 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
if [ "$usedwebapp" ]; then echo $line; echo " OUTDATED Web App Pat
ch Is In Effect"; fi
echo $line
fi
$sleep
if [ ! "$didsomething" ] && [ ! "$missingoptions" ] && [ ! "$newsupercharger" ]
&& [ "$scminfree" ] && [ "$currentminfree" != "$scminfree" ]; then
if [ -d "/system/etc/init.d" ] && [ "`ls /system/etc/init.d/*SuperCharge
r*`" ] || [ ! -d "/system/etc/init.d" ]; 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 andro
id.intent.action.VIEW -n com.android.browser/.BrowserActivity -d file://$storage
/!SuperCharger.html" 2>/dev/null
echo ""
echo $line
fi 2>/dev/null
fi
echo -n " Please Enter Option [1 - 33]: "
if [ "$autoresupercharge" ]; then opt=24; echo $opt
elif [ "$firstgear" ] || [ "$missingoptions" ]; then opt=29; echo $opt
elif [ "$autoshowcalculated" ] && [ "$currentminfree" != "$calculatedminfree" ]
; then opt=10; echo $opt
elif [ "$postics" ] && [ "$scadj" ] && [ "$showparlor" ]; then opt=25; echo $op
t
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
mount -o remount,rw / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 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 14 ]; then
if [ ! "`grep "SuperCharger Installation" /system/build.prop`" ]
; then echo "# SuperCharger Installation Marker." >> /system/build.prop; fi
if [ ! -d "/data/V6_SuperCharger" ]; then mkdir /data/V6_SuperCh
arger; fi
if [ ! -d "/data/V6_SuperCharger/PowerShift_Scripts" ]; then mkd
ir /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 "$storage/V6_SuperCharger" ]; then mkdir $storage/V6_S
uperCharger; fi
if [ ! -d "$storage/V6_SuperCharger/PowerShift_Scripts" ]; then
mkdir $storage/V6_SuperCharger/PowerShift_Scripts; fi
if [ ! -d "$storage/V6_SuperCharger/BulletProof_One_Shots" ]; th
en mkdir $storage/V6_SuperCharger/BulletProof_One_Shots; fi
if [ ! -d "$storage/V6_SuperCharger/temp" ]; then mkdir $storage
/V6_SuperCharger/temp; fi
fi
fi 2>/dev/null
case $opt in
1) echo " V6 SUPERCHARGER AND LAUNCHER STATUS!";;
2) if [ "$preics" ]; 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 [ "$preics" ]; 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 [ "$preics" ]; 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 [ "$preics" ]; 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 [ "$preics" ]; 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 [ "$preics" ]; 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 [ "$preics" ]; 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 [ "$preics" ]; 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 [ "$preics" ]; 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
if [ "$autoshowcalculated" ]; then echo " If not, come back late
r for more options!"
else echo " If not, there are still more options ahead!"
fi
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 free 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 ]; do
echo -n " Slot 2: ";read MB2
if [ "$MB2" = "X" ] || [ "$MB2" = "x" ]; then break=1
elif [ "$MB2" -gt 0 ] 2>/dev/null; then break
else echo " Input Error! Try again
:p";sleep 2; fi
done
while [ "$break" -eq 0 ]; do
echo -n " Slot 3: ";read MB3
if [ "$MB3" = "X" ] || [ "$MB3" = "x" ]; then break=1
elif [ "$MB3" -gt 0 ] 2>/dev/null; then break
else echo " Input Error! Try again
:p";sleep 2; fi
done
while [ "$break" -eq 0 ]; do
echo -n " Slot 4: ";read MB4
if [ "$MB4" = "X" ] || [ "$MB4" = "x" ]; then break=1
elif [ "$MB4" -gt 0 ] 2>/dev/null; then break
else echo " Input Error! Try again
:p";sleep 2; fi
done
while [ "$break" -eq 0 ]; do
echo -n " Slot 5: ";read MB5
if [ "$MB5" = "X" ] || [ "$MB5" = "x" ]; then break=1
elif [ "$MB5" -gt 0 ] 2>/dev/null; then break
else echo " Input Error! Try again
:p";sleep 2; fi
done
while [ "$break" -eq 0 ]; do
echo -n " Slot 6: ";read MB6
if [ "$MB6" = "X" ] || [ "$MB6" = "x" ]; then break=1
elif [ "$MB6" -gt 0 ] 2>/dev/null; then break
else echo " Input Error! Try again
: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 ""
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,$panicmo
de,$fixalign,$zepalign,$fixemissions,$detailing,$detailinterval,$miscsd,$tc3g" >
/data/V6_SuperCharger/SuperChargerOptions
cp -fr /data/V6_SuperCharger/SuperChargerOptions $storage/V6_Sup
erCharger/SuperChargerOptions
echo $line
echo " Driver Options Updated!"
else
if [ "$postics" ]; then
echo " This CAN'T SuperCharge ADJs on POST-ICS ROMS!"
echo ""
$sleep
echo " It can only apply adj/Grouping Fixes..."
echo ""
$sleep
echo " ...and other tweaks!"
echo ""
$sleep
echo $line
if [ "$servicesjarpatched" ]; then
echo " Hey your services.jar is already patched.
.."
echo ""
$sleep
echo " ...with a Hard To Kill Launch
er..."
echo ""
$sleep
if [ "$HL" -eq 2 ]; then echo "
...so who cares!"
else echo " See The \"Jelly ISCream Par
lor\" to change it!"
fi
else echo " Select The \"Jelly ISCream Parlor\" Option N
ext!"
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 [ "$postics" ]; then
echo " This CAN'T SuperCharge ADJs on POST-ICS ROMS!"
echo ""
$sleep
echo " It can only apply adj/Grouping Fixes..."
echo ""
$sleep
echo " ...and other tweaks!"
echo ""
$sleep
echo $line
if [ "$servicesjarpatched" ]; then
echo " Hey your services.jar is already patched..."
echo ""
$sleep
echo " ...with a Die-Hard Launcher..."
echo ""
$sleep
if [ "$HL" -eq 1 ]; then echo "
...so who cares!"
else echo " See The \"Jelly ISCream Parlor\" to
change it!"
fi
else echo " Select The \"Jelly ISCream Parlor\" Option Next!"
fi
else launcheradj=1
echo "$speed,$buildprop,$animation,$initrc,$launcheradj,$panicmo
de,$fixalign,$zepalign,$fixemissions,$detailing,$detailinterval,$miscsd,$tc3g" >
/data/V6_SuperCharger/SuperChargerOptions
cp -fr /data/V6_SuperCharger/SuperChargerOptions $storage/V6_Sup
erCharger/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 [ "$postics" ]; then
echo " This CAN'T SuperCharge ADJs on POST-ICS ROMS!"
echo ""
$sleep
echo " It can only apply adj/Grouping Fixes..."
echo ""
$sleep
echo " ...and other tweaks!"
echo ""
$sleep
echo $line
if [ "$servicesjarpatched" ]; then
echo " Hey your services.jar is already patched..."
echo ""
$sleep
echo " ...with a BulletProof Launcher..."
echo ""
$sleep
if [ "$HL" -eq 0 ]; then echo "
...so who cares!"
else echo " See The \"Jelly ISCream Parlor\" to
change it!"
fi
else echo " Select The \"Jelly ISCream Parlor\" 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 ""
$sleep
echo $line
echo " Note 1: This is NOT for Gamers! (Less Free RAM)"
echo $line
$sleep
echo " Note 2: It also does not play nice with Tasker!"
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,$panicmode,$fixalign,$zepalign,$fixemissions,$detailing,$detailinterval,$miscs
d,$tc3g" > /data/V6_SuperCharger/SuperChargerOptions
cp -fr /data/V6_SuperCharger/SuperChargerOptions $stor
age/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 " //// 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;;
15)echo " ======================="
busybox echo " //// THE bOOM STICK! \\\\\\\\";;
16)echo " ========================"
busybox echo " //// BULLETPROOF APPS \\\\\\\\";;
17)if [ "$flushOmaticHours" -ne 0 ]; then
flushmodebar=" ================================"
flushmode=" //// -=Engine Flush-O-Matic=- \\\\\\\\"
else
flushmodebar=" ============================="
flushmode=" //// -=Fast Engine Flush=- \\\\\\\\"
fi
animspeed="busybox sleep 0.125"
clear;sleep 1;echo $line;echo "";echo "";echo "";echo "";echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "
";echo "";$animspeed
clear;echo "";echo $line;echo "";echo "";echo "";echo "";echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "
";$animspeed
clear;echo "";echo "";echo $line;echo "";echo "";echo "";echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "
";$animspeed
clear;echo "";echo "";echo $line;echo " ===================
====";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";ec
ho "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "";echo "";e
cho "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";e
cho "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo $line;echo "";echo "";echo "";echo "";echo "";echo "";ec
ho "";echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo $line;echo "
";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "
";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo "$flushmodebar";busybox echo "$flushmode";echo $line;ech
o "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";ech
o "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "$flushmodeb
ar";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";echo ""
;echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "";echo "$fl
ushmodebar";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo ""
;echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $l
ine;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
\ /";echo " )_.._(";echo "";echo "$flushmodeba
r";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";echo "";
echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $lin
e;echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
|| ________ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo "$flushm
odebar";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";ech
o "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
|___| __";echo " || ________ -( (-";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo
$line;echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
| |";echo " |___| __";echo " || _
_______ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo "$flushmodebar";bu
sybox echo "$flushmode";echo $line;echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
| |";echo " | |";echo " |___| __"
;echo " || ________ -( (-";echo " |_(--------)
'-'";echo " \ /";echo " )_.._(";ech
o "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo "";$
animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
| D";echo " | |";echo " | |";echo "
|___| __";echo " || ________ -( (-";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";
echo $line;echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
___";echo " | D";echo " | |";echo "
| |";echo " |___| __";echo " |
| ________ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo "$flushmodebar"
;busybox echo "$flushmode";echo $line;$animspeed; $animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
| D";echo " | |";echo " | |";echo "
|___| __";echo " || ________ -( (-";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";
echo $line;echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
| |";echo " | |";echo " |___| __"
;echo " || ________ -( (-";echo " |_(--------)
'-'";echo " \ /";echo " )_.._(";ech
o "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo "";$
animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
| |";echo " |___| __";echo " || _
_______ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo "$flushmodebar";bu
sybox echo "$flushmode";echo $line;echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
|___| __";echo " || ________ -( (-";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo
$line;echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
|| ________ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo "$flushm
odebar";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";ech
o "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $lin
e;echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
\ /";echo " )_.._(";echo "";echo "$flushmodeba
r";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";echo "";
echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "
)_.._(";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $l
ine;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;busybox echo " \\\\\\\\ V6
SUPERCHARGER ////";echo " =======================";echo "";echo "$fl
ushmodebar";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo ""
;echo "";echo "";echo "";echo "";$animspeed
clear;echo " =======";echo "
zoom...";echo $line;busybox echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo " =======================";
echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo " ==================";echo "
zoom...";echo $line;busybox echo " \\\\\
\\\ V6 SUPERCHARGER ////";echo " =======================";echo "";ec
ho "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";
echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo " ============================";echo "
zoom...";echo $line;busybox echo " \\\\\\\\ V6 SUP
ERCHARGER ////";echo " =======================";echo "";echo "$flush
modebar";busybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";ec
ho "";echo "";echo "";echo "";$animspeed
clear;echo " ======================================";echo "
zoom...";echo $line;busybox echo " \\\\\\\\ V6 SUPERCHARGER
////";echo " =======================";echo "";echo "$flushmodebar";b
usybox echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";echo "";echo
"";echo "";echo "";$animspeed
clear;echo $line;echo " zoom...";echo $line;busybox echo " \
\\\\\\\ V6 SUPERCHARGER ////";echo " =======================";echo "
";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo "";echo
"";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo $line;echo " zoom... zoom..."
;echo $line;busybox echo " \\\\\\\\ V6 SUPERCHARGER ////";echo "
=======================";echo "";echo "$flushmodebar";busybox echo "$flu
shmode";echo $line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo
"";$animspeed
clear;echo $line;echo " zoom... zoom...";echo $line
;busybox echo " \\\\\\\\ V6 SUPERCHARGER ////";echo " ===
====================";echo "";echo "$flushmodebar";busybox echo "$flushmode";ech
o $line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";$animspe
ed
clear;echo $line;echo " zoom... zoom...";echo $line;busybox e
cho " \\\\\\\\ V6 SUPERCHARGER ////";echo " =============
==========";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;ec
ho "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo $line;echo " zoom... zoom...";echo $line;busybox echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo " =======================
";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo
"";echo "";echo "";echo "";echo "";echo "";echo "";busybox sleep 0.5
clear;echo $line;echo " zOOM... zOOM...";echo $line;busybox echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo " =======================
";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo
"";echo "";echo "";echo "";echo "";echo "";echo "";busybox sleep 0.5
clear;echo $line;echo " zoom... zoom...";echo $line;busybox echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo " =======================
";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo
"";echo "";echo "";echo "";echo "";echo "";echo "";busybox sleep 0.5
clear;echo $line;echo " zOOM... zOOM...";echo $line;busybox echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo " =======================
";echo "";echo "$flushmodebar";busybox echo "$flushmode";echo $line;echo "";echo
"";echo "";echo "";echo "";echo "";echo "";echo "";busybox sleep 1
clear;echo $line;echo " zOOM... zOOM...";echo $line;busybox echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo " =======================
";echo "";echo "$flushmodebar";busybox echo "$flushmode";;
18)echo " ================="
busybox echo " //// DETAILING \\\\\\\\";;
19)echo " ======================="
busybox echo " //// WHEEL ALIGNMENT \\\\\\\\";;
20)echo " ====================="
busybox echo " //// FIX EMISSIONS \\\\\\\\";;
21)echo " ====================="
busybox echo " //// FIX ALIGNMENT \\\\\\\\";;
22)echo " ==========================="
busybox echo " //// NITRO LAG NULLIFIER \\\\\\\\";;
23)echo " ======================"
busybox echo " //// SYSTEM INSTALL \\\\\\\\";;
24)echo " ======================="
busybox echo " //// RE-SUPERCHARGER \\\\\\\\";;
25)echo " ============================"
busybox echo " //// JELLY ISCREAM PARLOR \\\\\\\\"
if [ "$preics" ]; then opt=26
echo $line
echo ""
$sleep
echo " FAIL: This is a PRE-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 is automatically saved!"
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://$storage/!Super
Charger.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 ""
for p in /data/local.prop /system/build.prop /system/bin/build.prop /sy
stem/etc/ram.conf; do
if [ -f "$p" ]; then chown 0.0 $p; chmod 644 $p
if [ ! -f "$p.unsuper" ]; then backedup=yes
$sleep
echo " Backing up ORIGINAL ${p##*/}..."
echo ""
$sleep
cp -r $p $p.unsuper
if [ "`diff $p $p.unsuper`" ]; then echo " ERROR
BACKING UP $p!"
else
sed -i '/SuperCharger Installation/d' $p
.unsuper
echo " ...as $p.unsuper!"
fi
echo ""
fi
fi
done
if [ -f "$initrcpath1" ] && [ ! -f "$initrcpath" ]; then cp -r $initrcp
ath1 $initrcpath; fi
for rc in $initrcpath1 $allrcpaths /system/etc/hw_config.sh; do
if [ -f "$rc" ] && [ "$rc" = "$initrcpath1" ] && [ ! -f "$initrc
backup" ]; then backedup=yes
$sleep
echo " Backing up ORIGINAL $rc..."
cp -r $rc $initrcbackup
if [ "`diff $rc $initrcbackup`" ]; then
echo ""
$sleep
echo " ERROR BACKING UP $rc!"
fi
echo ""
elif [ -f "$rc" ] && [ "$rc" != "$initrcpath1" ] && [ ! -f "$rc.
unsuper" ]; then backedup=yes
$sleep
echo " Backing up ORIGINAL $rc..."
cp -r $rc $rc.unsuper
if [ "`diff $rc $rc.unsuper`" ]; then
echo ""
$sleep
echo " ERROR BACKING UP $rc!"
fi
echo ""
fi
done 2>/dev/null
if [ "$backedup" ]; then backedup=; echo $line; echo ""; fi
$sleep
echo " Scrolling Speed Options..."
echo " =========================="
echo ""
$sleep
echo -n " "
if [ "$scpercent" -eq 100 ]; then echo -n "0 (no delay), "; fi
echo "1 (fast), 2 (normal), 3 (slow)"
while :; do
echo ""
$sleep
if [ "$scpercent" -eq 100 ]; then echo -n " Please select scroll
ing speed (0 - 3): "
else echo -n " Please select scrolling speed (1 - 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 [ "$preics" ]; 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)buildprop=1
prop="/system/build.prop"
echo " Okay! build.prop Mode Activated!";;
*)buildprop=0
prop="/data/local.prop"
echo " Okay! local.prop Mode Activated!";;
esac
echo $line
echo ""
$sleep
showbuildpropopt=0
if [ ! -f "$prop" ]; then touch $prop; chown 0.0 $prop; chmod 64
4 $prop; fi
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 1: This is NOT for Gamers! (Less Free RAM)"
echo $line
$sleep
echo " Note 2: It also does not play nice with Tasker!"
while :; do
echo $line
echo ""
$sleep
echo " Select a Launcher Strength..."
echo ""
echo -n " "
if [ "$gb" -eq 1 ]; then 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 launcheradj=2
echo " SuperCharged Launcher Strength is
Hard To Kill!"
break
fi;;
b|B)launcheradj=0
echo " SuperCharged Launcher Strength is Bulle
tProof!"
break;;
*)launcheradj=1
echo " SuperCharged Launcher Strength is Die-
Hard!"
break;;
esac
done
for p in /system/etc/ram.conf $prop; do if [ -f "$p" ]; then sed
-i 's/ro.HOME_APP_ADJ=.*/ro.HOME_APP_ADJ='$launcheradj/ $p; fi; done
echo $line
echo ""
$sleep
else buildprop=1; prop="/system/build.prop"; launcheradj=1
fi
echo " Kernel & Virtual Memory Tweaks..."
echo " ================================="
echo ""
$sleep
echo " SuperCharger will apply additional tweaks..."
echo ""
$sleep
echo " ...for RAM management and battery savings!"
echo ""
$sleep
echo $line
echo " Note: The Kick Ass Kernelizer has DOZENS MORE!"
echo $line
echo ""
$sleep
echo $line
echo " But The -=Entropy-ness Enlarger=- is included!"
echo $line
echo ""
$sleep
echo " \"Kernel Panics\" are inevitable..."
echo ""
$sleep
echo " ...and can result in \"Random Reboots\"!"
echo ""
$sleep
echo " Choose a \"Random Reboot Tolerance\" Level... "
echo ""
$sleep
echo " 1. Rock Hard Kernel aka DON'T PANIC!"
echo " ================================="
echo " ...this PREVENTS reboots!"
echo " ...so choose this for STABLE kernels!"
echo " Note: This causes hangs on reboot on some ROMS"
echo ""
$sleep
echo " 2. Rock & Roll Kernel aka OOPS... DON'T PANIC!"
echo " ==========================================="
echo " ...reboots after a 30s recovery attempt..."
echo " ...but NOT when an OOPS or BUG turns up!"
echo " Note: This causes hangs on reboot on some ROMS"
echo ""
$sleep
echo " 3. Soft Rock Kernel aka EVERYBODY PANIC!"
echo " ====================================="
echo " ...reboots after a 30s recovery attempt!"
echo " ...battery drains on a frozen screen..."
echo " ...so choose this for UNSTABLE kernels!"
echo ""
if [ "$scpercent" -eq 0 ]; then
$sleep
echo $line
echo " An Option from 2 - 13 still needs to be run!"
fi
echo $line
echo ""
$sleep
for sc in /system/etc/init.d/*SuperCharger* /data/99SuperCharger.sh /sy
stem/etc/hw_config.sh; do
if [ -f "$sc" ]; then
sed -i '/.*oom.*/d' $sc
sed -i '/.*overcommit_memory.*/d' $sc
sed -i '/.*swappiness.*/d' $sc
sed -i '/.*panic.*/d' $sc
sed -i '/.*read_wakeup_threshold.*/d' $sc
fi
done
for rc in $initrcpath $allrcpaths; do
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
sed -i '/random\/read_wakeup_threshold.*/d' $rc
done
echo " (N)one - use your ROM's / other tweak's values"
echo " Rock (H)ard - NEVER reboot on panic."
echo " (R)ock & Roll - Wait 30s but NOT on OOPS/Bug."
echo " (S)oft Rock - Wait 30s on ANY panic."
echo ""
$sleep
echo $line
echo " VM Tweaks & Entropy-ness Enlarger Still Apply!"
echo $line
while :; do
echo ""
$sleep
echo -n " Pick a Kernel Strength / \"Reboot Tolerance\": "
read kvm
echo ""
echo $line
case $kvm in
n|N)panicmode=0; kpanic=30; kpoops=1
echo " NONE!? Good Luck with that! LOL"
break;;
h|H)panicmode=3; kpanic=0; kpoops=0
echo " DON'T PANIC! Rock Hard Kernel Chosen!"
break;;
r|R)panicmode=2; kpanic=30; kpoops=0
echo " OOPS... DON'T PANIC! Rock & Roll Kernel Chosen!
"
break;;
s|S)panicmode=1; kpanic=30; kpoops=1
echo " EVERYBODY PANIC! Soft Rock Kernel Chosen!"
break;;
*)echo " Invalid entry... Please try again :p"
echo $line;;
esac
done
echo $line
echo ""
$sleep
for sc in /system/etc/init.d/*SuperCharger* /data/99SuperCharger.sh /sy
stem/etc/hw_config.sh; do
if [ -f "$sc" ]; then sed -i '/min_free_kbytes=/ a\
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='$kpoops';\
# busybox sysctl -w kernel.panic='$kpanic';\
busybox sysctl -w kernel.random.read_wakeup_threshold=1376; # Entropy-n
ess Enlarger - keeps entropy_avail full - MAY save battery and/or boost responsi
veness' $sc
fi
if [ "$panicmode" -ne 0 ]; then sed -i '/^#.*kernel.panic/s/#//'
$sc; fi
done
for rc in $initrcpath $rcpaths; do 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 '$kpoops'\
# write /proc/sys/kernel/panic '$kpanic'\
write /proc/sys/kernel/random/read_wakeup_threshold 1376' $rc
if [ "$panicmode" -ne 0 ]; then sed -i '/^#.*kernel\/panic/s/#/
/' $rc; fi
done
echo " Applying Kernel & Virtual Memory Tweaks..."
echo ""
$sleep
echo -n " ";busybox sysctl -w vm.oom_kill_allocating_task=0
echo -n " ";busybox sysctl -w vm.panic_on_oom=0
echo -n " ";busybox sysctl -w vm.overcommit_memory=1
echo -n " ";busybox sysctl -w vm.swappiness=20
if [ "$panicmode" -ne 0 ]; then
echo -n " ";busybox sysctl -w kernel.panic_on_o
ops=$kpoops
echo -n " ";busybox sysctl -w kernel.pa
nic=$kpanic
fi
echo -n " ";busybox sysctl -w kernel.random.read_wakeup_threshold=137
6
echo ""
$sleep
echo $line
echo " Note: Last one's the -=Entropy-ness Enlarger=-!"
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
echo " Miscellaneous & SD Card Speed Tweaks..."
echo " ======================================="
echo ""
$sleep
echo " SuperCharger can apply additional tweaks..."
echo ""
$sleep
echo " ...which include additional battery savings!"
echo ""
$sleep
echo " They are as follows..."
echo ""
$sleep
echo " ...based on the $ram MB of RAM on your device!"
echo ""
echo $line
echo ""
$sleep
echo " SD Card Read Speed Tweak = $sdtweak KB"
if [ "`getprop | grep heapgrowthlimit`" ]; then echo " dalvik.vm
.heapgrowthlimit = $heapsize MB"; fi
echo " dalvik.vm.heapsize = $heapsize MB"
if [ "`getprop | grep persist.sys.vm.heapsize`" ]; then echo "
persist.sys.vm.heapsize = $heapsize MB"; fi
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 ""
if [ "$scpercent" -eq 0 ]; then
$sleep
echo $line
echo " An Option from 2 - 13 still needs to be run!"
fi
echo $line
echo ""
$sleep
if [ "$tc3g" ]; then sed -i '/#=#/,/sleep_mode/d' $prop
else sed -i '/#=#/,/edge=/d' $prop
fi
for sc in /system/etc/init.d/*SuperCharger* /data/99SuperCharger.sh /sy
stem/etc/hw_config.sh; do
if [ -f "$sc" ] && [ "$tc3g" ]; then sed -i '/179/,/queue/d' $sc
elif [ -f "$sc" ];then
sed -i '/wmem_max/,/queue/d' $sc
sed -i '/#=#/ a\
#########################\
# SD Read Speed Tweak #\
############==###########' $sc
fi
done
for rc in $initrcpath $allrcpaths; do sed -i '/bdi\/read_ahead_kb/d' $r
c; done
echo " Enable Miscellaneous & SD Card Speed Tweaks?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read misc
echo ""
echo $line
case $misc in
y|Y)miscsd=1
echo " Miscellaneous & SD Card Speed Tweaks are ON!"
echo $line
echo ""
$sleep
sed -i '/END OOM_ADJ_Settings/ a\
############=##############\
# Miscellaneous Tweaks! #\
###########################\
dalvik.vm.heapgrowthlimit='$heapsize'm\
dalvik.vm.heapsize='$heapsize'm\
persist.sys.vm.heapsize='$heapsize'm\
persist.sys.purgeable_assets=1\
wifi.supplicant_scan_interval=180\
windowsmgr.max_events_per_sec=200\
pm.sleep_mode=1' $prop
if [ ! "`getprop | grep heapgrowthlimit`" ]; then sed -i
'/heapgrowthlimit/d' $prop; fi
if [ ! "`getprop | grep persist.sys.vm.heapsize`" ]; the
n sed -i '/persist.sys.vm.heapsize/d' $prop; fi
for sc in /system/etc/init.d/*SuperCharger* /data/99Supe
rCharger.sh /system/etc/hw_config.sh; do
if [ -f "$sc" ]; then sed -i '/#==#/ a\
if [ "\`ls /sys/devices/virtual/bdi/179*/read_ahead_kb\`" ]; then\
for i in \`ls /sys/devices/virtual/bdi/179*/read_ahead_kb\`; do
echo '$sdtweak' > \$i; done;\
fi 2>/dev/null;\
echo '$sdtweak' > /sys/block/mmcblk0/bdi/read_ahead_kb 2>/dev/null;\
echo '$sdtweak' > /sys/block/mmcblk0/queue/read_ahead_kb 2>/dev/null;' $
sc
fi
done
for rc in $initrcpath $rcpaths; do sed -i '/KVM Tweaks/
i\
write /sys/block/mmcblk0/bdi/read_ahead_kb '$sdtweak $rc
done
echo " Applying Miscellaneous & SD Speed Tweaks..."
echo ""
$sleep
if [ "`ls /sys/devices/virtual/bdi/179*/read_ahead_kb`"
]; then read_ahead=yes
for i in `ls /sys/devices/virtual/bdi/179*/read_
ahead_kb`; do echo $sdtweak > $i; done
fi 2>/dev/null
if [ -f "/sys/block/mmcblk0/bdi/read_ahead_kb" ]; then r
ead_ahead=yes
echo $sdtweak > /sys/block/mmcblk0/bdi/read_ahea
d_kb
fi
if [ -f "/sys/block/mmcblk0/queue/read_ahead_kb" ]; then
read_ahead=yes
echo $sdtweak > /sys/block/mmcblk0/queue/read_ah
ead_kb
fi
if [ "$read_ahead" ]; then echo " SD Card Read S
peed Tweak = $sdtweak KB"
else
echo $line
echo " Sorry! Can't Apply SD Card Read Speed Tw
eak!"
echo $line
echo ""
$sleep
fi
if [ "`getprop | grep heapgrowthlimit`" ]; then
setprop dalvik.vm.heapgrowthlimit $heapsize"m"
echo " dalvik.vm.heapgrowthlimit = $heaps
ize MB"
fi
setprop dalvik.vm.heapsize $heapsize"m"
echo " dalvik.vm.heapsize = $heapsize MB"
if [ "`getprop | grep persist.sys.vm.heapsize`" ]; then
setprop persist.sys.vm.heapsize $heapsize"m"
echo " persist.sys.vm.heapsize = $heaps
ize MB"
fi
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 "";;
*)miscsd=0
echo " Miscellaneous & SD Card Speed Tweaks are OFF!";;
esac
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
echo " 3G TurboCharger Enhancement..."
echo " =============================="
echo ""
$sleep
echo " 3G TurboCharger Enhancement effects..."
echo ""
$sleep
echo " ...network buffersizes and TCP RAM allocation!"
echo ""
$sleep
echo $line
echo " This is an ADDON to my 3G TurboCharger Script!"
if [ "$scpercent" -eq 0 ]; then
echo $line
echo ""
$sleep
echo $line
echo " An Option from 2 - 13 still needs to be run!"
fi
echo $line
echo ""
$sleep
sed -i '/#==#/,/edge=/d' $prop
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 3G TurboCharger Enhancement?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read misc
echo ""
echo $line
case $misc in
y|Y)tc3g=1
echo " 3G TurboCharger Enhancement is now ON!"
echo $line
echo ""
$sleep
sed -i '/V6 SuperCharged/ i\
###############==#################\
# 3G TurboCharger Enhancement! #\
##################################\
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' $prop
if [ ! "`getprop | grep heapgrowthlimit`" ]; then sed -i
'/heapgrowthlimit/d' $prop; fi
if [ ! "`getprop | grep persist.sys.vm.heapsize`" ]; the
n sed -i '/persist.sys.vm.heapsize/d' $prop; fi
for sc in /system/etc/init.d/*SuperCharger* /data/99Supe
rCharger.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 t
hat 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 " Applying 3G TurboCharger Enhancement..."
echo ""
$sleep
setprop net.dns1 8.8.8.8
setprop net.dns2 8.8.4.4
setprop net.tcp.buffersize.default 6144,87380,110208,614
4,16384,110208
setprop net.tcp.buffersize.wifi 262144,524288,1048576,26
2144,524288,1048576
setprop net.tcp.buffersize.lte 262144,524288,3145728,262
144,524288,3145728
setprop net.tcp.buffersize.hsdpa 6144,262144,1048576,614
4,262144,1048576
setprop net.tcp.buffersize.evdo_b 6144,262144,1048576,61
44,262144,1048576
setprop net.tcp.buffersize.umts 6144,87380,110208,6144,1
6384,110208
setprop net.tcp.buffersize.hspa 6144,87380,262144,6144,1
6384,262144
setprop net.tcp.buffersize.gprs 6144,8760,11680,6144,876
0,11680
setprop net.tcp.buffersize.edge 6144,26280,35040,6144,16
384,35040
echo -n " ";busybox sysctl -w net.core.wmem_m
ax=1048576
echo -n " ";busybox sysctl -w net.core.rmem_m
ax=1048576
echo -n " ";busybox sysctl -w net.core.optmem_m
ax=20480
echo -n " ";busybox sysctl -w net.ipv4.tcp_moderate_rcvb
uf=1
echo -n " ";busybox sysctl -w net.ipv4.route.flu
sh=1
echo -n " ";busybox sysctl -w net.ipv4.udp_rmem_m
in=6144
echo -n " ";busybox sysctl -w net.ipv4.udp_wmem_m
in=6144
echo -n " ";busybox sysctl -w net.ipv4.tcp_rmem=
'6144 87380 1048576'
echo -n " ";busybox sysctl -w net.ipv4.tcp_wmem=
'6144 87380 1048576'
echo "";;
*)tc3g=0
echo " 3G TurboCharger Enhancement is now OFF!";;
esac
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
if [ -d "/system/etc/init.d" ]; then
echo " Fix Alignment On Boot..."
echo " =========================="
echo ""
$sleep
echo " This combines two scripts into one..."
echo ""
$sleep
echo " ...Wheel Alignment AND Fix Emissions!"
echo ""
$sleep
echo " ZipAlign optimizes all your APKs..."
echo ""
$sleep
echo " ...which means less RAM comsumption..."
echo ""
$sleep
echo " ...better battery life and a faster device!!"
echo ""
$sleep
echo " But sometimes... Force Closes can result..."
echo ""
$sleep
echo " ...so this Fixes Permissions of each app..."
echo ""
$sleep
echo " ...immediately after zipaligning it!"
echo ""
$sleep
echo " It's REALLY FAST and..."
echo ""
$sleep
echo $line
echo " It's the ONLY script of it's kind ;^]"
echo $line
echo ""
$sleep
echo " Fix Alignment can run automatically on boot!"
echo ""
$sleep
echo " *99SuperCharger would run FixAlignment.sh..."
echo ""
$sleep
echo " ...so boot time would be unaffected!"
echo ""
echo $line
echo ""
$sleep
if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then
sed -i '/!FixAlignment/d' /system/etc/init.d/*SuperCharg
er*
sed -i '/scriptmanager/ i\
sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!FixAlignment.sh 2
>/dev/null;\
sh /data/V6_SuperCharger/!FixAlignment.sh & sleep 2;\
sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!FixAlignment.sh 2
>/dev/null;' /system/etc/init.d/*SuperCharger*
fi 2>/dev/null
echo " Run Fix Alignment on boot?"
echo ""
$sleep
echo " Note 1 : If you say Yes..."
echo " Wheel Alignment and Fix Emissions..."
echo " ...On Boot are automatically disabled!"
echo ""
$sleep
echo " Note 2 : If you say No..."
echo " Wheel Alignment and Fix Emissions..."
echo " ...boot options become available!"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read bootfixalign
echo ""
echo $line
case $bootfixalign in
y|Y)fixalign=1; zepalign=0; fixemissions=0
if [ ! "`ls /system/etc/init.d/*SuperCharger*`" ]; the
n
echo " An Option from 2 - 13 still needs to be r
un!"
echo $line
echo ""
$sleep
echo $line
fi 2>/dev/null
if [ ! -f "/data/V6_SuperCharger/!FixAlignment.sh" ];
then
echo " Fix Alignment has to run once from the me
nu!"
echo $line
echo ""
$sleep
echo $line
fi
echo " Fix Alignment Set To Run On Boot!"
sed -i '/!FixEmissions.sh/s/.*sed /# sed /' /system/et
c/init.d/*SuperCharger* 2>/dev/null
sed -i '/!FixEmissions.sh/s/.*sh \//# sh \//' /system/
etc/init.d/*SuperCharger* 2>/dev/null
sed -i '/!WheelAlignment.sh/s/.*sed /# sed /' /
system/etc/init.d/*SuperCharger* 2>/dev/null
sed -i '/!WheelAlignment.sh/s/.*sh \//# sh \//'
/system/etc/init.d/*SuperCharger* 2>/dev/null;;
*)fixalign=0
echo " Boot Fix Align Declined... does that rhyme?"
sed -i '/!FixAlignment.sh/s/^/#/' /system/etc/init.d/*
SuperCharger* 2>/dev/null;;
esac
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
if [ "$fixalign" -eq 0 ]; then
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 ""
$sleep
echo $line
echo " If you get Force Closes, run Fix Emissions!"
echo $line
echo ""
$sleep
if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then
sed -i '/!WheelAlignment/d' /system/etc/init.d/*
SuperCharger*
sed -i '/scriptmanager/ i\
sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!WheelAlig
nment.sh 2>/dev/null;\
sh /data/V6_SuperCharger/!WheelAlignment.sh & sleep 2;\
sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!WheelAlig
nment.sh 2>/dev/null;' /system/etc/init.d/*SuperCharger*
fi 2>/dev/null
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)zepalign=1
if [ ! "`ls /system/etc/init.d/*SuperCharger*`
" ]; then
echo " An Option from 2 - 13 still needs
to be run!"
echo $line
echo ""
$sleep
echo $line
fi 2>/dev/null
if [ ! -f "/data/V6_SuperCharger/!WheelAlignme
nt.sh" ]; then
echo " Wheel Alignment has to run once f
rom the menu!"
echo $line
echo ""
$sleep
echo $line
fi
echo " Wheel Alignment Set To Run On Boo
t!";;
*)zepalign=0
echo " Boot Align Declined... does that rh
yme?"
sed -i '/!WheelAlignment.sh/s/^/#/' /system/et
c/init.d/*SuperCharger* 2>/dev/null;;
esac
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
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 ""
echo $line
echo ""
$sleep
if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then
sed -i '/!FixEmissions/d' /system/etc/init.d/*Su
perCharger*
sed -i '/sleep 90;/ i\
sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2
>/dev/null;\
sh /data/V6_SuperCharger/!FixEmissions.sh & sleep 2;\
sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2
>/dev/null;' /system/etc/init.d/*SuperCharger*
fi 2>/dev/null
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)fixemissions=1
if [ ! "`ls /system/etc/init.d/*SuperCharger*`
" ]; then
echo " An Option from 2 - 13 still needs
to be run!"
echo $line
echo ""
$sleep
echo $line
fi 2>/dev/null
if [ ! -f "/data/V6_SuperCharger/!FixEmissions
.sh" ]; then
echo " Fix Emissions has to run once fro
m the menu!"
echo $line
echo ""
$sleep
echo $line
fi
echo " Fix Emissions Set To Run On Boot
!";;
*)fixemissions=0
echo " No FCing Fix On Boot For You!"
sed -i '/!FixEmissions.sh/s/^/# /' /system/etc
/init.d/*SuperCharger* 2>/dev/null;;
esac
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
fi
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 ""
$sleep
echo " AND you can specify how often it runs..."
echo ""
$sleep
echo " ...so if you input 4, it runs every 4th boot!"
echo ""
$sleep
echo $line
echo -n " Current Status: Detailing "
if [ "$detailing" -eq 0 ]; then echo "DOES NOT Run On Boot!"
else echo "Runs Every $detailinterval Boots!"
fi
echo $line
echo ""
$sleep
echo $line
echo " You can also configure this within the script!"
echo $line
echo ""
$sleep
if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then
sed -i '/!Detailing/d' /system/etc/init.d/*SuperCharger*
sed -i '/sleep 90;/ a\
sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/null;
\
sh /data/V6_SuperCharger/!Detailing.sh & sleep 2;\
sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/null;
sleep 480;' /system/etc/init.d/*SuperCharger*
fi 2>/dev/null
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)detailing=1
if [ ! "`ls /system/etc/init.d/*SuperCharger*`" ]; the
n
echo " An Option from 2 - 13 still needs to be r
un!"
echo $line
echo ""
$sleep
echo $line
fi 2>/dev/null
if [ ! -f "/data/V6_SuperCharger/!Detailing.sh" ]; the
n
echo " Detailing has to run once from the menu!"
echo $line
echo ""
$sleep
echo $line
fi
while :; do
echo ""
$sleep
echo -n " How often? 1=every boot to 9=every 9th
boot: "
read detailinterval
echo ""
echo $line
case $detailinterval in
[1-9])echo " Detailing Set To Run Every
$detailinterval Boots!"
break;;
*)echo " Invalid entry... Please
try again :p"
echo $line;;
esac
done;;
*)detailing=0; detailinterval=0
sed -i '/!Detailing.sh/s/^/# /' /system/etc/init.d/*Su
perCharger* 2>/dev/null
echo " Declined Detailing On Boot!";;
esac
if [ -f "/data/V6_SuperCharger/!Detailing.sh" ]; then sed -i 's/
^runonbootinterval=.*/runonbootinterval='$detailinterval'/' /data/V6_SuperCharge
r/!Detailing.sh; fi
if [ -f "/system/xbin/vac" ]; then sed -i 's/^runonbootinterval=
.*/runonbootinterval='$detailinterval'/' /system/xbin/vac; fi
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
if [ "$preics" ]; 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)initrc=1
for sc in /system/etc/init.d/*SuperCharger* /d
ata/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\
mount -o remount,rw / 2>/dev/null;\
mount -o remount,rw rootfs 2>/dev/null;\
busybox mount -o remount,rw / 2>/dev/null;\
busybox mount -o remount,rw rootfs 2>/dev/null;\
cp -fr '$initrcpath' '$initrcpath1';\
mount -o remount,ro / 2>/dev/null;\
mount -o remount,ro rootfs 2>/dev/null;\
busybox mount -o remount,ro / 2>/dev/null;\
busybox mount -o remount,ro rootfs 2>/dev/null;\
fi 2>/dev/null; # System Integration Marker' $sc
fi
done
echo " System Integration of $initrcpath1 i
s now ON!";;
*)initrc=0
echo " System Integration of $initrcpath1 i
s now OFF!";;
esac
echo $line
echo ""
$sleep
else initrc=0
fi
else initrc=0; fixalign=0; fixemissions=0; zepalign=0; detailing=0; det
ailinterval=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)animation=0
echo " Boo... Animation is OFF... :/";;
*)animation=1
echo " Yay... Animation is ON... :D";;
esac
echo $line
echo ""
$sleep
echo "$speed,$buildprop,$animation,$initrc,$launcheradj,$panicmode,$fix
align,$zepalign,$fixemissions,$detailing,$detailinterval,$miscsd,$tc3g" > /data/
V6_SuperCharger/SuperChargerOptions
cp -fr /data/V6_SuperCharger/SuperChargerOptions $storage/V6_SuperCharg
er/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" -gt 26 ] && [ "$ram1" -ne "$ram2" ]; then opt=69; autoresuperch
arge=; firstgear=; showparlor=; fi
if [ "$preics" ] && [ "$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 " ...since I'm not 100% sure... lol"
else echo "!"
fi
echo ""
echo $line
fi
echo ""
$sleep
echo " Home Launcher Priority is: $HL"
echo ""
$sleep
echo " Foreground App Priority is: $FA"
echo ""
$sleep
if [ "$gb" -eq 1 ] || [ "$servicesjarpatched" ]; 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 ] || [ "$servicesjarpatched" ]; 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 ] || [ "$servicesjarpatched" ]; 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 ] || [ "$servicesjarpatched" ]; 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
if [ "$autoresupercharge" ]; then resuper=Y
else
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"}' $storage/V6_SuperCharger/SuperCharger
Minfree
echo ""
$sleep
echo " Re-SuperCharge from $storage?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read resuper
echo ""
fi
echo $line
case $resuper in
y|Y)CONFIG=Re-Super
if [ -f "$storage/V6_SuperCharger/97BulletProof_
Apps.sh" ] && [ -f "$storage/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 $storage/V6_Su
perCharger/*BulletProof_Apps`" ]; then cp -fr $storage/V6_SuperCharger/*BulletPr
oof_Apps /system/etc/init.d; fi 2>/dev/null
if [ "`ls $storage/V6_Su
perCharger/BulletProof_Apps*`" ]; then cp -fr $storage/V6_SuperCharger/BulletPro
of_Apps* /data/V6_SuperCharger; fi 2>/dev/null
if [ -f "$storage/V6_Sup
erCharger/97BulletProof_Apps.sh" ]; then cp -fr $storage/V6_SuperCharger/97Bulle
tProof_Apps.sh /data; fi;;
esac
fi
echo " Re-SuperCharging from $storage..."
echo $line
echo ""
$sleep
if [ "`ls $storage/V6_SuperCharger/SuperCharger*
`" ]; then echo " ...your Driver Options..."; $sleep; cp -fr $storage/V6_Su
perCharger/SuperCharger* /data/V6_SuperCharger; fi 2>/dev/null
if [ "`ls $storage/V6_SuperCharger/*SuperCharger
`" ]; then cp -fr $storage/V6_SuperCharger/*SuperCharger /system/etc/init.d; fi
2>/dev/null
if [ -f "$storage/V6_SuperCharger/99SuperCharger
.sh" ]; then echo " ...your SuperCharger Settings..."; $sleep; cp -fr $stor
age/V6_SuperCharger/99SuperCharger.sh /data; fi
if [ -f "/data/97BulletProof_Apps.sh" ]; then ec
ho " ...your BulletProof Apps Settings..."; $sleep; fi
if [ -d "$storage/V6_SuperCharger/BulletProof_On
e_Shots" ]; then cp -fr $storage/V6_SuperCharger/BulletProof_One_Shots /data/V6_
SuperCharger; fi
if [ -d "$storage/V6_SuperCharger/PowerShift_Scr
ipts" ]; then echo " ...your PowerShift Scripts..."; $sleep; cp -fr $storag
e/V6_SuperCharger/PowerShift_Scripts /data/V6_SuperCharger; fi
if [ -f "$storage/V6_SuperCharger/!FastEngineFlu
sh.sh" ]; then echo " ...your \"Quick Widget\" Scripts..."; $sleep; cp -fr
$storage/V6_SuperCharger/!FastEngineFlush.sh /data/V6_SuperCharger; fi
if [ -f "$storage/V6_SuperCharger/!Detailing.sh"
]; then cp -fr $storage/V6_SuperCharger/!Detailing.sh /data/V6_SuperCharger; fi
if [ -f "$storage/V6_SuperCharger/!FixAlignment.
sh" ]; then cp -fr $storage/V6_SuperCharger/!FixAlignment.sh /data/V6_SuperCharg
er; fi
if [ -f "$storage/V6_SuperCharger/!FixEmissions.
sh" ]; then cp -fr $storage/V6_SuperCharger/!FixEmissions.sh /data/V6_SuperCharg
er; fi
if [ -f "$storage/V6_SuperCharger/!WheelAlignmen
t.sh" ]; then cp -fr $storage/V6_SuperCharger/!WheelAlignment.sh /data/V6_SuperC
harger; fi
if [ -f "$storage/V6_SuperCharger/!SuperClean.sh
" ]; then cp -fr $storage/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 2>/dev/null
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/!FixAlignment.sh"
]; then cp -fr /data/V6_SuperCharger/!FixAlignment.sh /system/xbin/fixalign; 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`
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`
panicmode=`awk -F , '{print $6}' /data/V
6_SuperCharger/SuperChargerOptions`
fixalign=`awk -F , '{print $7}' /data/V6
_SuperCharger/SuperChargerOptions`
zepalign=`awk -F , '{print $8}' /data/V6
_SuperCharger/SuperChargerOptions`
fixemissions=`awk -F , '{print $9}' /dat
a/V6_SuperCharger/SuperChargerOptions`
detailing=`awk -F , '{print $10}' /data/
V6_SuperCharger/SuperChargerOptions`
detailinterval=`awk -F , '{print $11}' /
data/V6_SuperCharger/SuperChargerOptions`
miscsd=`awk -F , '{print $12}' /data/V6_
SuperCharger/SuperChargerOptions`
tc3g=`awk -F , '{print $13}' /data/V6_Su
perCharger/SuperChargerOptions`
flushOmaticHours=`grep "^flushOmaticHour
s=" /data/V6_SuperCharger/!FastEngineFlush.sh | sed 's/flushOmaticHours=//'` 2>/
dev/null
sleep="sleep $speed"
if [ "$buildprop" -eq 1 ]; then prop="/s
ystem/build.prop"
else prop="/data/local.prop"
fi
if [ ! "$detailinterval" ] || [ "`echo $
detailinterval | grep "[^0-9]"`" ] || [ "$detailinterval" -gt 9 ]; then detailin
terval=3; fi
if [ ! "$flushOmaticHours" ] || [ "`echo
$flushOmaticHours | grep "[^0-9]"`" ] || [ "$flushOmaticHours" -gt 24 ]; then f
lushOmaticHours=0; fi
if [ ! "$launcheradj" ]; then launcherad
j=1; fi
if [ ! "$panicmode" ]; then panicmode=1;
kpanic=30; kpoops=1; fi
if [ ! "$fixalign" ]; then fixalign=0; f
i
if [ ! "$zepalign" ]; then zepalign=0; f
i
if [ ! "$fixemissions" ]; then fixemissi
ons=0; fi
if [ ! "$detailing" ]; then detailing=0;
fi
if [ ! "$detailinterval" ]; then detaili
nterval=3; fi
if [ ! "$miscsd" ]; then miscsd=0; fi
if [ ! "$tc3g" ]; then tc3g=0; missingop
tions=yes; fi
fi
echo $line
echo " Prior Scrolling Speed has been applied -
$speed"
echo $line
$sleep
if [ "$preics" ]; then
echo -n " Prop file used for SuperCharg
ing - "
if [ "$buildprop" -eq 0 ]; then echo "LO
CAL.PROP"
else echo "BUILD.PROP"
fi
echo $line
$sleep
echo -n " SuperCharged Launcher Option
is"
if [ "$launcheradj" -eq 0 ]; then echo "
BulletProof!!"
elif [ "$launcheradj" -eq 2 ]; then echo
" Hard To Kill!"
else echo "... Die-Hard!!"
fi
echo $line
$sleep
fi
echo -n " Kernel & Virtual Memory Tweaks"
if [ "$panicmode" -eq 3 ]; then kpanic=0; kpoops
=0; echo " are Rock Hard!"
elif [ "$panicmode" -eq 2 ]; then kpanic=30; kpo
ops=0; echo " - Rock & Roll!"
elif [ "$panicmode" -eq 0 ]; then kpanic=30; kpo
ops=1; echo " - Disco Dance!"
else kpanic=30; kpoops=1; echo " ala Soft Rock!"
fi
echo $line
$sleep
echo -n " Miscellaneous and SD Card Speed Tweak
s - "
if [ "$miscsd" -eq 0 ]; then echo "NO!"
else echo "YES!"
fi
echo $line
$sleep
echo -n " 3G TurboCharger Enhancement(3GTC Addo
n)- "
if [ "$tc3g" -eq 0 ]; then echo "NO!"
else echo "YES!"
fi
echo $line
$sleep
if [ "$flushOmaticHours" -eq 0 ]; then echo " E
ngine Flush-O-Matic Mode is Currently - OFF!"
else echo " Engine Flush-O-Matic - Enabled @ Ev
ery - $flushOmaticHours"hrs
fi
echo $line
$sleep
if [ -d "/system/etc/init.d" ]; then
echo -n " Fix Alignment (Dual Tool) Run
s On Boot - "
if [ "$fixalign" -eq 0 ]; then echo "NO!
"
else echo "YES!"
fi
echo $line
$sleep
echo -n " Fix Emissions (Fixes FCs) Run
s On Boot - "
if [ "$fixemissions" -eq 0 ]; then echo
"NO!"
else echo "YES!"
fi
echo $line
$sleep
echo -n " Wheel Alignment(ZipAlign) Run
s On Boot - "
if [ "$zepalign" -eq 0 ]; then echo "NO!
"
else echo "YES!"
fi
echo $line
$sleep
if [ "$detailing" -eq 0 ]; then echo "
Detailing(Clean Database) Runs On Boot - NO!"
else echo " Detailing(Clean Database) R
uns Every $detailinterval Boots!"
fi
echo $line
$sleep
if [ "$preics" ]; then
echo -n " System Integration of
$initrcpath1 Setting - "
if [ "$initrc" -eq 1 ]; then ech
o "ON!"
else echo "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\" or \"flush\" or \"vac\" or \"fixal
ign\" or..."
echo ""
$sleep
echo " ...\"fixfc\" or \"zepalign\" or \"
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 " ...some system files were not rest
ored!"
echo ""
$sleep
echo " Nitro Lag Nullifier and 3G TurboCharger..
."
echo ""
$sleep
echo " ...may need to be re-insta
lled!"
echo ""
echo $line
echo ""
$sleep
echo " But this comes first... heh..."
echo ""
echo $line
echo ""
$sleep
opt=12;;
*)echo " Re-SuperCharging Declined... meh...";;
esac
fi
if [ "$opt" -le 14 ]; then
if [ -f "$storage/UnSuperCharged.html" ]; then rm $storage/UnSup
erCharged.html; fi
if [ -f "$storage/UnSuperChargerError.html" ]; then rm $storage/
UnSuperChargerError.html; fi
if [ -f "$storage/SuperChargerScriptManagerHelp.html" ]; then rm
$storage/SuperChargerScriptManagerHelp.html; fi
if [ -f "$storage/SuperChargerHelp.html" ]; then rm $storage/Sup
erChargerHelp.html; fi
if [ "$opt" -le 13 ]; then
echo -n " zOOM... "; sleep 2; echo -n "zOOM..."; sleep 2
; echo ""
echo ""
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
SL0=$(($MB0*256));SL1=$(($MB1*256));SL2=$(($MB2*
256));SL3=$(($MB3*256));SL4=$(($MB4*256));SL5=$(($MB5*256));SL6=$(($MB6*256))
echo "$SL1,$SL2,$SL3,$SL4,$SL5,$SL6" > /data/V6_
SuperCharger/SuperChargerMinfree
scminfree=`cat /data/V6_SuperCharger/SuperCharge
rMinfree`
elif [ "$scminfree" ]; then SL0=$(($MB0*256));SL1=`echo
$scminfree | awk -F , '{print $1}'`;SL2=`echo $scminfree | awk -F , '{print $2}'
`;SL3=`echo $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
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)buildprop=1
prop="/system/build.prop"
echo " Okay... will use the build.prop
method!";;
*)buildprop=0
prop="/data/local.prop"
echo " Okay... will try local.prop met
hod again...";;
esac
echo ""
$sleep
echo "$speed,$buildprop,$animation,$initrc,$laun
cheradj,$panicmode,$fixalign,$zepalign,$fixemissions,$detailing,$detailinterval,
$miscsd,$tc3g" > /data/V6_SuperCharger/SuperChargerOptions
cp -fr /data/V6_SuperCharger/SuperChargerOptions
$storage/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 /data/local.prop /system/build.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 [ "$preics" ]; 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
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 $rc $initrcbackup
if [ "`diff $rc $initrcb
ackup`" ]; then
echo ""
$sleep
echo " ERROR BAC
KING UP $rc!"
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 [ "$preics" ] && [ "`grep -ls "on boo
t" $rc`" ] && [ "$rc" != "/system/etc/hw_config.sh" ]; then
echo $line
if [ "$rc" = "$initrcpath1" ] &&
[ "$initrc" -eq 0 ]; then
echo ""
echo " System Integratio
n of $rc is OFF..."
echo ""
$sleep
echo " But for cooking/b
aking into ROMs..."
echo ""
$sleep
echo $line
fi
echo -n " "
if [ "$rc" = "$initrcpath1" ] &&
[ "$initrc" -eq 0 ]; then echo -n "/data/"
elif [ "$rc" = "$initrcpath1" ];
then echo -n "/"
fi
if [ "$preics" ] && [ "$opt" -ge
11 ] && [ "$opt" -le 13 ] && [ "$ReSuperCharge" -eq 0 ]; then echo "${rc##*/} w
ill be OOM Fixed!"
else
echo -n "${rc##*/} will
be SuperCharged"
if [ "$rc" = "$initrcpat
h1" ]; then echo "!"
else echo "..."
echo $line
$sleep
echo " ...it wi
ll also run The SuperCharger Service!"
fi
fi
elif [ "$opt" -le 10 ] || [ "$ReSuperCha
rge" -eq 1 ] && [ "$rc" != "$initrcpath1" ] && [ "$rc" != "/system/etc/hw_config
.sh" ]; then echo $line; echo " It will run The SuperCharger Service!"
fi
echo $line
echo ""
$sleep
fi
done
for rc in $initrcpath $allrcpaths; do
sed -i '/#=#/,/KVM Tweaks/d' $rc
sed -i '/.*V6 SuperCharger/,/.*V6 SuperCharged/d
' $rc
sed -i '/.*_ADJ/d' $rc
if [ "$scminfree" ]; then sed -i '/.*_MEM/d' $rc
sed -i '/write \/sys\/module\/lowmemoryk
iller/d' $rc
else sed -i '/write \/sys\/module\/lowmemorykill
er\/parameters\/adj/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
sed -i '/random\/read_wakeup_threshold.*/d' $rc
sed -i '/bdi\/read_ahead_kb/d' $rc
if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1
]; then sed -i '/SuperCharger_Service/,/SuperCharged_Service/d' $rc; fi
done
else
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 > $storage/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 $storage/UnSuperCharged.html for assi
stance!"
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" ] && [ ! -s "$rc.u
nsuper" ]; then rm $rc; rm $rc.unsuper; continue
elif [ ! -f "$rc.unsuper" ]; then
echo " ERROR... ERROR... ER
ROR... ERROR..."
echo ""
$sleep
echo " AN RC BACKUP WAS
NOT FOUND!"
echo ""
$sleep
echo " CAN'T restore some
default values!"
echo ""
sleep 3
UnSuperChargerError=1
cat > $storage/UnSuperChargerErr
or.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 $storage/UnSuperCharg
erError.html for help!"
if [ "${rc##*/}" != "init.rc" ]
; then
echo $line
echo ""
sleep 4
sed -i '/#=#/,/KVM Tweak
s/d' $rc
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
echo " Cleaned "$rc
echo ""
fi
else
echo " BACKUP FO
UND!"
echo ""
$sleep
echo " Restoring ${rc##*/}..."
mv $rc.unsuper $rc
echo ""
fi
echo $line
echo ""
$sleep
done
fi 2>/dev/null
fi
for p in /data/local.prop /system/build.prop /system/bin/build.p
rop /system/etc/ram.conf; do
if [ -f "$p" ]; then
if [ "$opt" -eq 14 ] && [ ! -f "$p.unsuper" ] ||
[ "$opt" -le 13 ]; then
if [ "$UnSuperCharged" -ne 1 ]; then
echo " Cleaning ADJ values from
${p##*/}..."
echo ""
$sleep
fi
sed -i '/.*V6 SuperCharger/,/.*V6 SuperC
harged/d' $p
sed -i '/.*_ADJ/d' $p
if [ "$UnSuperCharged" -ne 1 ]; then
echo " Cleaning MEM values from
${p##*/}..."
echo ""
$sleep
fi
if [ "$scminfree" ]; then sed -i '/.*_ME
M/d' $p; fi
fi
fi
done
if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then
if [ "$opt" -eq 14 ] || [ "$opt" -le 10 ] || [ "$ReSuper
Charge" -eq 1 ] && [ ! "$newsupercharger" ]; then
echo " Cleaning Up SuperCharge from /init.d fold
er"
echo ""
$sleep
echo " Cleaning Up Grouping Fixes from /init.d f
older"
echo ""
$sleep
fi
rm /system/etc/init.d/*SuperCharger*
fi 2>/dev/null
if [ -f "/data/99SuperCharger.sh" ]; then
if [ "$opt" -eq 14 ] || [ "$opt" -le 10 ] || [ "$ReSuper
Charge" -eq 1 ] && [ ! "$newsupercharger" ]; then
echo " Cleaning Up SuperCharge from /data folder
"
echo ""
$sleep
echo " Cleaning Up Grouping Fixes from /data fol
der"
echo ""
$sleep
fi
rm /data/99SuperCharger.sh
fi
if [ "`ls /data/SuperCharger*`" ]; then rm /data/SuperCharger*;
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 '/.*SuperCharge
r/d' /data/local/userinit.sh; fi
if [ -f "/system/etc/hw_config.sh" ]; then sed -i '/.*V6 SuperCh
arger/,/.*V6 SuperCharged/d' /system/etc/hw_config.sh
if [ "$UnSuperCharged" -ne 1 ] && [ ! "$newsupercharger"
]; then
echo " Cleaning Up SuperCharge from hw_config.sh
..."
echo ""
$sleep
fi
fi
if [ "$opt" -eq 14 ]; 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/fixalign" ]; then rm /system/xbin/
fixalign; 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" ] && [ ! -s "$p.uns
uper" ]; then rm $p; rm $p.unsuper
elif [ -f "$p.unsuper" ]; then
echo " Restoring ORIGINAL ${p##*
/}..."
echo ""
$sleep
mv $p.unsuper $p
fi
done
echo " Removed Kernel & Virtual Memory Tweaks...
"
echo ""
$sleep
if [ "$miscsd" -eq 1 ]; then
echo " ...Removed Miscellaneous & SD Sp
eed Tweaks..."
echo ""
$sleep
fi
if [ "$tc3g" -eq 1 ]; then
echo " ...3G TurboCharger E
nhancement..."
echo ""
$sleep
fi
if [ "$UnSuperChargerError" -ne 1 ]; then
echo " Your ROM's default minfree values
are restored!"
echo ""
echo $line
fi
if [ ! "$servicesjarpatched" ]; 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 [ "$servicesjarpatched" ] && [ -f "$storage/V6_SuperC
harger/services.jar.unsuper" ]; then UnIScream=yes; fi
else
if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1 ]; then
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}' $minfreefile`
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 [ "$postics" ] && [ ! "$servicesjarpatched" ]; then e
cho -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 ""
for rc in $initrcpath $rcpaths; do
if [ "`grep -s "on early-boot" $rc`" ] && [ "$pr
eics" ]; then sed -i '/on early-boot/ a\
# V6 SuperCharger, OOM Grouping & Priority Fixes created by -=zeppelinrox=-'
$rc
else sed -i '/on boot/ a\
# V6 SuperCharger, OOM Grouping & Priority Fixes created by -=zeppelinrox=-'
$rc
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 [ "`grep -s "on early-boot" $rc`" ] && [ "$pr
eics" ]; then sed -i '/on boot/ a\
#################=##################' $rc
else sed -i '/END OOM_ADJ_Settings/ a\
#################=##################' $rc
fi
sed -i '/#=#/ a\
# Kernel & Virtual Memory Tweaks #\
####################################\
write /proc/sys/vm/min_free_kbytes '$MFK'\
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 '$kpoops'\
# write /proc/sys/kernel/panic '$kpanic'\
write /proc/sys/kernel/random/read_wakeup_threshold 1376\
# End of KVM Tweaks' $rc
if [ "$panicmode" -ne 0 ]; then sed -i '/^#.*ker
nel\/panic/s/#/ /' $rc; fi
if [ "$miscsd" -eq 1 ]; then sed -i '/KVM Tweaks
/ i\
write /sys/block/mmcblk0/bdi/read_ahead_kb '$sdtweak $rc
fi
if [ "$preics" ]; then
if [ "$scminfree" ]; then sed -i '/on bo
ot/ a\
write '$minfreefile' '$scminfree $rc
sed -i '/BEGIN OOM_MEM_Settings/
a\
setprop ro.FOREGROUND_APP_MEM '$SL1'\
setprop ro.VISIBLE_APP_MEM '$SL2'\
setprop ro.SECONDARY_SERVER_MEM '$SL3'\
setprop ro.BACKUP_APP_MEM '$SL4'\
setprop ro.HOME_APP_MEM '$SL3'\
setprop ro.HIDDEN_APP_MEM '$SL4'\
setprop 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
$sleep
echo $line
echo -n " "
if [ "$rc" = "$initrcpath" ] && [ "$init
rc" -eq 0 ]; then echo -n "/data/"
elif [ "$rc" = "$initrcpath" ]; then ech
o -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
else sed -i '/OOM_MEM_Settings/d' $rc
sed -i '/BEGIN OOM_ADJ_Settings/ a\
#\
# This ROM (Android 4.0 and greater) requires a PATCHED services.jar\
# If you don'"'"'t have it patched yet, go to http://goo.gl/IvGL1\
# The ADJ priorities that were here DO NOT work anymore!\
#' $rc
fi
done
if [ "$preics" ]; then
echo $line
echo ""
$sleep
echo " Fixing Out Of Memory (OOM) Groupings..."
echo ""
$sleep
echo " ...Fixing OOM Prioriti
es..."
echo ""
$sleep
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 '"'Fre
e 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
else
if [ "$miscsd" -eq 1 ]; then sed
-i '/END OOM_ADJ_Settings/ a\
############=##############\
# Miscellaneous Tweaks! #\
###########################\
dalvik.vm.heapgrowthlimit='$heapsize'm\
dalvik.vm.heapsize='$heapsize'm\
persist.sys.vm.heapsize='$heapsize'm\
persist.sys.purgeable_assets=1\
wifi.supplicant_scan_interval=180\
windowsmgr.max_events_per_sec=200\
pm.sleep_mode=1' $p
if [ ! "`getprop | grep
heapgrowthlimit`" ]; then sed -i '/heapgrowthlimit/d' $p; fi
if [ ! "`getprop | grep
persist.sys.vm.heapsize`" ]; then sed -i '/persist.sys.vm.heapsize/d' $p; fi
fi
if [ -f "$tc3g" ]; then sed -i '
/V6 SuperCharged/ i\
###############==#################\
# 3G TurboCharger Enhancement! #\
##################################\
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
if [ "$preics" ]; 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='$SL3'\
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
else sed -i '/OOM_MEM_Settings/d' $p
sed -i '/BEGIN OOM_ADJ_Settings/
a\
#\
# This ROM (Android 4.0 and greater) requires a PATCHED services.jar\
# If you don'"'"'t have it patched yet, go to http://goo.gl/IvGL1\
# The ADJ priorities that were here DO NOT work anymore!\
#' $p
fi
fi
done
if [ "$preics" ]; then
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 " ...It's
BULLETPROOF!"
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 & Virtual Memory Tweaks..."
echo ""
$sleep
echo -n " ";busybox sysctl -w vm.min_
free_kbytes=$MFK
echo -n " ";busybox sysctl -w vm.oom_kill_allo
cating_task=0
echo -n " ";busybox sysctl -w vm.p
anic_on_oom=0
echo -n " ";busybox sysctl -w vm.overco
mmit_memory=1
echo -n " ";busybox sysctl -w vm
.swappiness=20
if [ "$panicmode" -ne 0 ]; then
echo -n " ";busybox sysctl -w k
ernel.panic_on_oops=$kpoops
echo -n " ";busybox sys
ctl -w kernel.panic=$kpanic
fi
echo -n " ";busybox sysctl -w kernel.random.read_wakeu
p_threshold=1376
echo ""
$sleep
echo $line
echo " Note: Last one's the -=Entropy-ness Enlarger=-!"
echo $line
echo ""
$sleep
if [ "$miscsd" -eq 1 ]; then
echo " Applying Miscellaneous & SD Speed Tweaks.
.."
echo ""
$sleep
echo " ...based on the $ram MB of RAM on your d
evice!"
echo ""
$sleep
if [ "`ls /sys/devices/virtual/bdi/179*/read_ahe
ad_kb`" ]; then read_ahead=yes
for i in `ls /sys/devices/virtual/bdi/17
9*/read_ahead_kb`; do echo $sdtweak > $i; done
fi 2>/dev/null
if [ -f "/sys/block/mmcblk0/bdi/read_ahead_kb" ]
; then read_ahead=yes
echo $sdtweak > /sys/block/mmcblk0/bdi/r
ead_ahead_kb
fi
if [ -f "/sys/block/mmcblk0/queue/read_ahead_kb"
]; then read_ahead=yes
echo $sdtweak > /sys/block/mmcblk0/queue
/read_ahead_kb
fi
if [ "$read_ahead" ]; then echo " SD Car
d Read Speed Tweak = $sdtweak KB"
else
echo $line
echo " Sorry! Can't Apply SD Card Read
Speed Tweak!"
echo $line
echo ""
$sleep
fi
if [ "`getprop | grep heapgrowthlimit`" ]; then
setprop dalvik.vm.heapgrowthlimit $heaps
ize"m"
echo " dalvik.vm.heapgrowthlimit
= $heapsize MB"
fi
setprop dalvik.vm.heapsize $heapsize"m"
echo " dalvik.vm.heapsize = $heaps
ize MB"
if [ "`getprop | grep persist.sys.vm.heapsize`"
]; then
setprop persist.sys.vm.heapsize $heapsiz
e"m"
echo " persist.sys.vm.heapsize
= $heapsize MB"
fi
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
if [ "$tc3g" -eq 1 ]; then
echo " Applying 3G TurboCharger Enhancement..."
echo ""
$sleep
setprop net.dns1 8.8.8.8
setprop net.dns2 8.8.4.4
setprop net.tcp.buffersize.default 6144,87380,11
0208,6144,16384,110208
setprop net.tcp.buffersize.wifi 262144,524288,10
48576,262144,524288,1048576
setprop net.tcp.buffersize.lte 262144,524288,314
5728,262144,524288,3145728
setprop net.tcp.buffersize.hsdpa 6144,262144,104
8576,6144,262144,1048576
setprop net.tcp.buffersize.evdo_b 6144,262144,10
48576,6144,262144,1048576
setprop net.tcp.buffersize.umts 6144,87380,11020
8,6144,16384,110208
setprop net.tcp.buffersize.hspa 6144,87380,26214
4,6144,16384,262144
setprop net.tcp.buffersize.gprs 6144,8760,11680,
6144,8760,11680
setprop net.tcp.buffersize.edge 6144,26280,35040
,6144,16384,35040
echo -n " ";busybox sysctl -w net.cor
e.wmem_max=1048576
echo -n " ";busybox sysctl -w net.cor
e.rmem_max=1048576
echo -n " ";busybox sysctl -w net.core.
optmem_max=20480
echo -n " ";busybox sysctl -w net.ipv4.tcp_moder
ate_rcvbuf=1
echo -n " ";busybox sysctl -w net.ipv4.r
oute.flush=1
echo -n " ";busybox sysctl -w net.ipv4.ud
p_rmem_min=6144
echo -n " ";busybox sysctl -w net.ipv4.ud
p_wmem_min=6144
echo -n " ";busybox sysctl -w net.ipv4.t
cp_rmem='6144 87380 1048576'
echo -n " ";busybox sysctl -w net.ipv4.t
cp_wmem='6144 87380 1048576'
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=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
# SuperMinFree Calculator & MFK Calculator (for min_free_kbytes) created by zepp
elinrox also ;^]
# Entropy-ness Enlarger (sysctl tweak for kernel.random.read_wakeup_threshold th
at keeps entropy_avail full) discovered by zeppelinrox.
#
# 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_free_kb
ytes.
# See http://goo.gl/P8Bvu - How Entropy-ness Enlarger works.
# See http://goo.gl/Zc85j - Possible reasons why it may actually do something :p
#
EOF
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 items:
# a. "/data/99SuperCharger.sh"
# b. "Super" (created by your query so this doesn't mean anything)
#
# If it's not running, the output would be the last item ie. "Super" which was g
enerated by the typed command.
#
# Similar results can be had with: "busybox ps | grep Super".
#
if [ "\`pgrep -l android\`" ]; then terminate=yes;
else
if [ -f "/data/!!SuperChargerBootLoopMessage.log" ]; then
# echo " \$( date +"%m-%d-%Y %H:%M:%S" ): \$0 Detected A BootLoope
d... ABORTING..." >> /data/Ran_SuperCharger.log;
exit 69;
fi;
# echo " Delete this file to Re-Enable *99SuperCharger to run on boot..."
> /data/!!SuperChargerBootLoopMessage.log;
fi;
#
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;
#
mount -o remount,rw /data 2>/dev/null;
busybox mount -o remount,rw /data 2>/dev/null;
line=================================================;
echo "";
echo \$line;
echo " The -=V6 SuperCharger=- by -=zeppelinrox=-";
echo \$line;
echo "";
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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;
fi;
echo " To verify application of settings...";
echo "";
echo " ...check out /data/Ran_SuperCharger.log!";
echo "";
echo \$line;
echo "";
EOF
else cat >> $sc <<EOF
# DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE!
#
mount -o remount,rw /data 2>/dev/null;
busybox mount -o remount,rw /data 2>/dev/null;
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
mount -o remount,rw / 2>/dev/null;
mount -o remount,rw rootfs 2>/dev/null;
busybox mount -o remount,rw / 2>/dev/null;
busybox mount -o remount,rw rootfs 2>/dev/null;
cp -fr $initrcpath $initrcpath1;
mount -o remount,ro / 2>/dev/null;
mount -o remount,ro rootfs 2>/dev/null;
busybox mount -o remount,ro / 2>/dev/null;
busybox mount -o remount,ro rootfs 2>/dev/null;
fi 2>/dev/null; # System Integration Marker
EOF
fi
cat >> $sc <<EOF
mount -o remount,rw /system 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 [ "\`ls /system/etc/init.d/*loopy*\`" ] && [ "/system/etc/init.d/*loopy*" !=
"/system/etc/init.d/zzloopy_runs_last_so_others_do_too" ]; then
mv /system/etc/init.d/*loopy* /system/etc/init.d/zzloopy_runs_last_so_ot
hers_do_too
sed -i '1 a\
#\
# Hey you should try BulletProofing Apps from within V6 SuperCharger instead!\
#' /system/etc/init.d/zzloopy_runs_last_so_others_do_too
fi 2>/dev/null
EOF
if [ "$sc" = "/data/99SuperCharger.sh" ]
; then cat >> $sc <<EOF
if [ "\$terminate" ]; then
if [ ! "\`pgrep scriptmanager\`" ]; then
echo " Waiting 2 minutes (avoid conflicts)... then...";echo "";
echo " Gonna SuperCharge this Android... zoOM... zOOM!";
echo "";
echo \$line;
echo "";
sleep 120;
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 ] || [ "\`cat /sys/block/mmcblk0/bdi/read_ahead_kb
\`" -ne $sdtweak ]; 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=$kpoops;
# busybox sysctl -w kernel.panic=$kpanic;
busybox sysctl -w kernel.random.read_wakeup_threshold=1376; # Entropy-n
ess Enlarger - keeps entropy_avail full - MAY save battery and/or boost responsi
veness
##################################
# 3G TurboCharger Enhancement! #
#################=################
EOF
if [ "$panicmode" -ne 0 ]; then sed -i '
/^#.*kernel.panic/s/#//' $sc; fi
if [ "$tc3g" -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 t
hat 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
#########################
# SD Read Speed Tweak #
############==###########
EOF
if [ "$miscsd" -eq 1 ]; then cat >> $sc
<<EOF
if [ "\`ls /sys/devices/virtual/bdi/179*/read_ahead_kb\`" ]; then
for i in \`ls /sys/devices/virtual/bdi/179*/read_ahead_kb\`; do
echo $sdtweak > \$i; done;
fi 2>/dev/null;
echo $sdtweak > /sys/block/mmcblk0/bdi/read_ahead_kb 2>/dev/null;
echo $sdtweak > /sys/block/mmcblk0/queue/read_ahead_kb 2>/dev/null;
EOF
fi
cat >> $sc <<EOF
echo "";
echo \$line;
echo "";
fi;
currentadj=\`cat /sys/module/lowmemorykiller/parameters/adj\` 2>/dev/null;
currentminfree=\`cat /sys/module/lowmemorykiller/parameters/minfree\` 2>/dev/nul
l;
scadj=\`cat /data/V6_SuperCharger/SuperChargerAdj\`;
scminfree=\`cat /data/V6_SuperCharger/SuperChargerMinfree\`;
if [ "\$scminfree" ] && [ "\$currentminfree" != "\$scminfree" ]; then applyscmin
free=yes; fi;
if [ "\$scadj" ] && [ "\$currentadj" != "\$scadj" ]; then applyscadj=yes; fi;
if [ "\$applyscminfree" ] || [ "\$applyscadj" ]; then
###########################
# Get 50% SuperCharged! #
###########################
chmod 777 /sys/module/lowmemorykiller/parameters/adj 2>/dev/null;
chmod 777 /sys/module/lowmemorykiller/parameters/minfree 2>/dev/null;
if [ "\$scadj" ]; then echo \$scadj > /sys/module/lowmemorykiller/parame
ters/adj; fi 2>/dev/null;
if [ "\$scminfree" ]; then echo \$scminfree > /sys/module/lowmemorykille
r/parameters/minfree; fi 2>/dev/null;
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 reapply settings from
\$0!" >> /data/Ran_SuperCharger.log;
echo " SuperCharger Settings Were ALREADY Applied...";
echo "";
echo " ...there's no need to reapply them!";
fi;
echo "";
echo " \$0 Executed...";
EOF
if [ "$sc" = "/data/99SuperCharger.sh" ]
; then cat >> $sc <<EOF
echo "";
echo " ===========================";
echo " ) SuperCharge Complete! (";
echo " ===========================";
echo "";
if [ "\$terminate" ]; then
mount -o remount,ro /system 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;
stop super_service;
else
# rm /data/!!SuperChargerBootLoopMessage.log;
\$0 & exit 0;
fi;
sleep 90;
sed -i 's/# exec >/exec >/' /data/V6_SuperCharger/!FastEngineFlush.sh 2>/dev/nul
l;
sh /data/V6_SuperCharger/!FastEngineFlush.sh & sleep 2;
sed -i 's/exec >/# exec >/' /data/V6_SuperCharger/!FastEngineFlush.sh 2>/dev/nul
l;
exit 0;
EOF
else cat >> $sc <<EOF
#mount -o remount,ro /system 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;
sh /system/etc/init.d/*KickAssKernel & sleep 1;
sh /data/99SuperCharger.sh & sleep 1;
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" ] || [ "$preics" ] && [ "$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 '/#.*BootLoop/d' /data/99SuperCha
rger.sh
sed -i '/BootLoop/s/^#//' /system/etc/in
it.d/99SuperCharger
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 '/scriptmanager/ i\
# sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!FixAlignment.sh 2
>/dev/null;\
# sh /data/V6_SuperCharger/!FixAlignment.sh & sleep 2;\
# sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!FixAlignment.sh 2
>/dev/null;\
# sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!WheelAlignment.sh
2>/dev/null;\
# sh /data/V6_SuperCharger/!WheelAlignment.sh & sleep 2;\
# 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 $(b
usybox mount/ a\
for i in \`busybox ls -r /system/etc/init.d | grep -v SuperCharger\`; 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 [ "\`echo \$j | grep KickAssKernel\`" ] && [ "\$i" \\< "99SuperCharger" ] ||
[ "\$j" \\< "99SuperCharger" ]; then desiredname="/system/etc/init.d/99SuperChar
ger";\
elif [ "\`echo \$j | grep KickAssKernel\`" ] && [ "\$i" \\< "S99SuperCharger" ]
|| [ "\$j" \\< "S99SuperCharger" ]; then desiredname="/system/etc/init.d/S99Supe
rCharger";\
else desiredname="/system/etc/init.d/SS99SuperCharger";\
fi;\
echo " ...\$desiredname!";\
if [ "\$0" != "\$desiredname" ]; then\
mv \$0 \$desiredname;\
rm /data/!!SuperChargerBootLoopMessage.log;\
\$desiredname & exit;\
fi;\
echo \$line;\
echo "";' /system/etc/init.d/99SuperCharger
sed -i '/sleep 90;/ i\
sh /system/etc/init.d/*KickAssKernel & sleep 1;\
sh /data/99SuperCharger.sh & sleep 1;\
# sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2>/dev/
null;\
# sh /data/V6_SuperCharger/!FixEmissions.sh & sleep 2;\
# sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!FixEmissions.sh 2>/dev/
null;' /system/etc/init.d/99SuperCharger
sed -i '/sleep 90;/ a\
# sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/nul
l;\
# sh /data/V6_SuperCharger/!Detailing.sh & sleep 2;\
# 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 [ "$fixalign" -eq 1 ]; then sed -i '/
!FixAlignment.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 | grep -v SuperCharger`; do
if [ "$j" ]; then break; fi
if [ ! -d "$i" ]; then j=$i; fi
done
if [ "`echo $j | grep KickAssKernel`" ]
&& [ "$i" \< "99SuperCharger" ] || [ "$j" \< "99SuperCharger" ]; then desirednam
e="/system/etc/init.d/99SuperCharger"; echo -n " "
elif [ "`echo $j | grep KickAssKernel`"
] && [ "$i" \< "S99SuperCharger" ] || [ "$j" \< "S99SuperCharger" ]; then desire
dname="/system/etc/init.d/S99SuperCharger"; echo -n " "
else desiredname="/system/etc/init.d/SS9
9SuperCharger";
fi
if [ "/system/etc/init.d/99SuperCharger"
!= "$desiredname" ]; then mv /system/etc/init.d/99SuperCharger $desiredname; fi
echo " ...with $desiredname!"
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
if [ "`ls /system/etc/init.d/*loopy*`" ]; then
echo ""
echo $line
echo ""
$sleep
echo " Found `ls /system/etc/init.d/*loo
py*`..."
echo ""
$sleep
echo " ...it stops other init.d scripts
from running!"
echo ""
$sleep
echo " Renaming it to..."
echo ""
$sleep
echo " ...\"zzloopy_runs_last_so_other
s_do_too\" lol!"
echo ""
$sleep
mv /system/etc/init.d/*loopy* /system/et
c/init.d/zzloopy_runs_last_so_others_do_too
echo " But it's better to just delete it
..."
echo ""
$sleep
echo " ...and from the Driver's Co
nsole..."
echo ""
$sleep
echo " ...\"BulletProof
Apps\" instead!"
fi 2>/dev/null
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 " ...and OOM Grou
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 > $storage/SuperChargerScriptManager
Help.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 $storage/SuperChargerScriptMa
nagerHelp.html"
else
echo " ..Please ENABLE boot scripts to b
e run from..."
echo " .../system/etc/i
nit.d folder!"
echo " Easier: Script Manager can solve
everything ;)"
echo ""
$sleep
SuperChargerHelp=1
cat > $storage/SuperChargerHelp.html <<E
OF
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 $storage/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
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 items:
# a. "/data/99SuperCharger.sh"
# b. "Super" (created by your query so this doesn't mean anything)
#
# If it's not running, the output would be the last item ie. "Super" which was g
enerated by the typed command.
#
# Similar results can be had with: "busybox ps | grep Super".
#
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 " ...type \"start super_servi
ce\" and Enter."
echo " ==================
="
echo ""
$sleep
echo " To stop the SuperCharger Service.
.."
echo ""
$sleep
echo " ...type \"stop super_servi
ce\" and Enter."
echo " =================
="
echo ""
echo $line
echo ""
$sleep
echo "If the service is running and you
type..."
echo ""
$sleep
echo " ...\"cat /proc/*/cmdline
| grep Super\""
echo ""
$sleep
echo " The output would look like this:"
echo ""
$sleep
echo " /data/99SuperCharger.sh"
echo " Super"
echo ""
echo $line
echo ""
$sleep
echo " Easier: Similar results can be ha
d with..."
echo ""
$sleep
echo " ...\"busybox ps
| grep 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 " ...it makes for easy cookin
g into a ROM!"
echo ""
$sleep
echo " Just read the comments in $initrc
path :)"
echo ""
echo $line
fi
echo ""
$sleep
echo " Setting LowMemoryKiller to..."
echo ""
$sleep
echo " ...$MB1, $MB2, $MB3, $MB4, $MB5,
$MB6 MB"
echo ""
$sleep
echo "$scminfree" > $minfreefile
currentminfree=`cat $minfreefile`
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=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, 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
RAM' Is NOT Wasted RAM!"
# See http://goo.gl/4w0ba - MFK Calculator Info - explanation for vm.min_free_kb
ytes.
#
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
clear
line=================================================
cd "\${0%/*}" 2>/dev/null
echo ""
echo \$line
echo " -=PowerShift=- script by -=zeppelinrox=-"
echo \$line
echo ""
sleep 1
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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
mount -o remount,rw /system 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 , '{printf " Current Minfrees = %.0f,%.0f,%.0f,%.0f,%.0f,%.0f MB\n", \$
1/256, \$2/256, \$3/256, \$4/256, \$5/256, \$6/256}' $minfreefile
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 > $minfreefile
echo $scminfree > /data/V6_SuperCharger/SuperChargerMinfree
echo " OOM Minfree levels are now set to..."
echo ""
sleep 1
echo " ...\`cat $minfreefile\`"
echo ""
sleep 1
echo " They are also your new SuperCharger values!"
echo ""
echo \$line
echo ""
sleep 1
echo " Updating Kernel & Virtual 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 2>/dev/null
echo " ==========================="
echo " ) PowerShift Completed! ("
echo " ==========================="
echo ""
sleep 1
mount -o remount,ro /system 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
exit 0
EOF
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
if [ ! "$adjfile" ]; then adjfile="/data/V6_SuperCharger
/SuperChargerAdj"; fi
echo "$scadj" > $adjfile
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 " .../data/99SuperCharger.sh on
boot!"
echo " ...or make a Script Manager WIDGET fo
r it!"
elif [ "$opt" -le 10 ] || [ "$postics" ] || [ "$ReSuperC
harge" -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 " ...and the Launcher is we
ak..."
echo ""
$sleep
echo " ...read the Owner's G
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 ""
$sleep
echo " And I'll likely add you to my IGNORE list..."
echo ""
$sleep
echo " ...because you think it's OK to WASTE MY TIME!"
echo ""
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
if [ "$opt" -le 10 ] || [ "$ReSuperCharge" -eq 1 ] || [
"$postics" ]; then ran=1; fi
if [ -f "$initrcpath" ] && [ "$initrc" -eq 1 ]; then cp
-fr $initrcpath $initrcpath1; fi
if [ -f "/system/bin/build.prop" ]; then cp -fr /system/
build.prop /system/bin; fi
echo " Backing up refreshed files to $storage..."
echo ""
$sleep
if [ -d "/data/V6_SuperCharger" ]; then cp -fr /data/V6_
SuperCharger $storage; fi
for rc in $initrcpath $allrcpaths; do cp -fr $rc* $stora
ge/V6_SuperCharger; done
if [ -f "/data/99SuperCharger.sh" ]; then cp -fr /data/9
9SuperCharger.sh $storage/V6_SuperCharger; fi
if [ "`ls /system/etc/init.d/*SuperCharger*`" ]; then cp
-fr /system/etc/init.d/*SuperCharger* $storage/V6_SuperCharger; fi 2>/dev/null
if [ "`ls /system/build.prop*`" ]; then cp -fr /system/b
uild.prop* $storage/V6_SuperCharger; fi 2>/dev/null
if [ "`ls /data/local.prop*`" ]; then cp -fr /data/local
.prop* $storage/V6_SuperCharger; fi 2>/dev/null
if [ "`ls /system/etc/hw_config.sh*`" ]; then cp -fr /sy
stem/etc/hw_config.sh* $storage/V6_SuperCharger; fi 2>/dev/null
if [ "`ls /system/etc/ram.conf*`" ]; then cp -fr /system
/etc/ram.conf* $storage/V6_SuperCharger; fi 2>/dev/null
echo " ...Re-SuperCharger backup complete!"
echo ""
if [ "$rebulletproof" ] && [ "$allrcpaths" ]; then opt=1
6
elif [ "$newsupercharger" ] || [ "$postics" ]; then
if [ "$preics" ]; then opt=32
echo $line
echo ""
$sleep
if [ "$autoresupercharge" ] || [ "$ReSup
erCharge" -eq 1 ]; then echo " Re-SuperCharger is ALMOST done!"
else echo " I think this is your FIRST S
uperCharge..."
fi
echo ""
$sleep
elif [ "$servicesjarpatched" ] || [ "$servicesja
rinstalled" ]; then
echo $line
echo " I Scream SUPERCHARGED
!"
elif [ ! "$showedparlor" ]; then opt=25
echo $line
echo ""
$sleep
echo " Now off to the \"Jelly ISCream Pa
rlor\"..."
echo ""
$sleep
fi
autoresupercharge=
fi
fi
fi
if [ "$opt" -eq 15 ] || [ "$opt" -eq 16 ]; then
if [ "$opt" -eq 15 ]; 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 16 ] && [ ! "$rebulletproof" ] && [ "$bpapplist"
] && [ "`busybox ps | grep Bullet | wc -l`" -gt 1 ]; 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=15
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=15
break;;
x|X)echo " Ok... let's BulletPro
of something!"
break;;
*)echo " Invalid entry... P
lease try again :p"
echo $line;;
esac
done;;
*)echo " Cool Beans!";;
esac
if [ "$opt" -eq 16 ]; then
echo $line
echo ""
$sleep
fi
fi 2>/dev/null
if [ "$opt" -eq 16 ] && [ ! "$rebulletproof" ]; then
echo " This will attempt to lock an app in memory!"
echo ""
$sleep
echo " To undo, come back here to \"Un-Bulletproof\"!"
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
if [ "$vroomverifier" -eq 0 ]; then
echo " Using zOOM Stick Mode (Quick)..."; echo "
"; $sleep
echo " ADJ PID Process"
else
echo " Using vrOOM Stick Mode (Verbose)..."; ech
o ""; $sleep
echo " ADJ PID Process/Path (APK)"
fi
echo ""
echo " FOREGROUND_APP OOM GROUPING"
echo " ==========================="
if [ "$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 ] && [ -f "/proc/$i/$oom_adj" ] && [ "
`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj
| awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -gt -18 ] && [ "$adj" -lt "$oomadj1"
]; then
if [ "$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 " $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
fi 2>/dev/null
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 ] && [ -f "/proc/$i/$oom_adj" ] && [ "
`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj
| awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -eq "$oomadj1" ]; then
if [ "$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 " $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
fi 2>/dev/null
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 ] && [ -f "/proc/$i/$oom_adj"
] && [ "`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`ec
ho $adj | awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -gt "$oomadj1" ] && [ "$adj"
-lt "$oomadj2" ]; then
if [ "$adj" -eq "$HL" ] && [ "$l
name" = "`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 " $adj "
echo -n $i
if [ "$vroomverifier" -eq 0 ]; t
hen echo " $appname"
else
apkname=`su -c "LD_LIBRA
RY_PATH=/vendor/lib:/system/lib pm list packages -f $appname | sed 's/.*://' | s
ed 's/=.*//'"`
# apkname=`busybox find /
-iname "*$appname*.apk" -maxdepth 3 | tail -n 1`
if [ "$apkname" ]; then
echo -n " `cat
/proc/$i/cmdline`"
echo " ($apknam
e)"
else echo " `cat /proc/
$i/cmdline`"
fi
fi
if [ "$adj" -eq "$HL" ]; then ec
ho ""; fi
fi
fi 2>/dev/null
done
echo ""
echo " VISIBLE_APP OOM GROUPING"
echo " ========================"
for i in `ls /proc`; do
if [ "$i" -ne 0 ] && [ -f "/proc/$i/$oom_adj"
] && [ "`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`ec
ho $adj | awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -eq "$oomadj2" ]; then
appname=`cat /proc/$i/cmdline |
sed 's/.*\///'`
echo -n " $adj "
echo -n $i
if [ "$vroomverifier" -eq 0 ]; t
hen echo " $appname"
else
# apkname=`su -c "LD_LIBRA
RY_PATH=/vendor/lib:/system/lib pm list packages -f $appname | sed 's/.*://' | s
ed 's/=.*//'"`
apkname=`busybox find /
-iname "*$appname*.apk" -maxdepth 3 | tail -n 1`
if [ "$apkname" ]; then
echo -n " `cat
/proc/$i/cmdline`"
echo " ($apknam
e)"
else echo " `cat /proc/
$i/cmdline`"
fi
fi
fi
fi 2>/dev/null
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 ] && [ -f "/proc/$i/$oom_adj"
] && [ "`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`ec
ho $adj | awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -gt "$oomadj1" ] && [ "$adj"
-le "$oomadj2" ]; then
if [ "$adj" -eq "$HL" ] && [ "$l
name" = "`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 " $adj "
echo -n $i
if [ "$vroomverifier" -eq 0 ]; t
hen echo " $appname"
else
# apkname=`su -c "LD_LIBRA
RY_PATH=/vendor/lib:/system/lib pm list packages -f $appname | sed 's/.*://' | s
ed 's/=.*//'"`
apkname=`busybox find /
-iname "*$appname*.apk" -maxdepth 3 | tail -n 1`
if [ "$apkname" ]; then
echo -n " `cat
/proc/$i/cmdline`"
echo " ($apknam
e)"
else echo " `cat /proc/
$i/cmdline`"
fi
fi
fi
fi 2>/dev/null
done
fi
echo ""
echo " SECONDARY_SERVER OOM GROUPING"
echo " ============================="
if [ "$HL" -gt "$oomadj2" ] && [ "$HL" -le "$oomadj3" ];
then
echo ""
echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)"
echo ""
fi
for i in `ls /proc`; do
if [ "$i" -ne 0 ] && [ -f "/proc/$i/$oom_adj" ] && [ "
`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj
| awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -gt "$oomadj2" ] && [ "$adj" -le "$o
omadj3" ]; then
if [ "$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 " $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
fi 2>/dev/null
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 ] && [ -f "/proc/$i/$oom_adj" ] && [ "
`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj
| awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -gt "$oomadj3" ] && [ "$adj" -le "$o
omadj4" ]; then
if [ "$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 " $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
fi 2>/dev/null
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 ] && [ -f "/proc/$i/$oom_adj" ] && [ "
`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj
| awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -gt "$oomadj4" ] && [ "$adj" -le "$o
omadj5" ]; then
if [ "$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 " $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
fi 2>/dev/null
done
echo ""
echo " EMPTY_APP OOM GROUPING"
echo " ======================"
if [ "$HL" -gt "$oomadj5" ] && [ "$HL" -le "$oomadj6" ];
then
echo ""
echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)"
echo ""
fi
for i in `ls /proc`; do
if [ "$i" -ne 0 ] && [ -f "/proc/$i/$oom_adj" ] && [ "
`cat /proc/$i/cmdline`" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -eq -1000 ]; then adj=-16
elif [ "$adj" -eq 1000 ]; then adj=15
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj
| awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -gt "$oomadj5" ] && [ "$adj" -le "$o
omadj6" ]; then
if [ "$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 " $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
fi 2>/dev/null
done
echo ""
if [ "$opt" -eq 15 ]; then echo $line; echo "
zOOM Stick Complete!"
elif [ "$vroomverifier" -eq 1 ]; then echo $line; echo "
vrOOM Stick Complete!"
fi
fi
if [ "$vroomverifier" ] && [ "$opt" -eq 16 ] || [ "$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 items:
# a. "/data/97BulletProof_Apps.sh"
# b. "BulletProof_Apps_is_In_Effect!" (sleep message)
# c. "Bullet" (created by your query so this doesn't mean anything)
#
# If it's not running, the output would be the last item ie. "Bullet" which was
generated by the typed command.
#
# Similar results can be had with: "busybox ps | grep Bullet".
#
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 $storage/V6_SuperCharger
if [ "$bps" != "$initrcpath" ] && [ "$rebulletpr
oof" ] && [ "$allrcpaths" ]; then echo " ...$bps!"; $sleep; fi
done
if [ "$rebulletproof" ] && [ "$allrcpaths" ]; then
echo ""
if [ "$autoresupercharge" ] || [ "$postics" ]; t
hen
if [ "$preics" ]; then opt=32
echo $line
echo ""
$sleep
echo " Re-SuperCharger is ALMOST
done!"
echo ""
$sleep
elif [ "$servicesjarpatched" ] || [ "$se
rvicesjarinstalled" ]; then
echo $line
echo " I Scream SUPE
RCHARGED!"
elif [ ! "$showedparlor" ]; then opt=25
echo $line
echo ""
$sleep
echo " Now off to the \"Jelly IS
Cream Parlor\"..."
echo ""
$sleep
fi
else newsupercharger=; opt=24
fi
autoresupercharge=; rebulletproof=
fi
fi
if [ "$vroomverifier" ] && [ "$opt" -eq 16 ] || [ "$bpblind" ];
then
cat > /data/97BulletProof_Apps.sh <<EOF
#!/system/bin/sh
#
# BulletProof Apps Boot Script created by -=zeppelinrox=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, 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!)
#
# Important! Whether you run this with Terminal or Script Manager or widget, the
script relaunches and kills itself after 30 seconds.
# So you can close the app after 30 seconds and BulletProof Apps cont
inues in the background!
#
# To verify that it's running, type in Terminal:
# 1. "pstree | grep Bullet" - for init.d script or usage option 2 (with Terminal
)
# 2. "pstree | grep sleep" - if using the service or usage option 3 (with Script
Manager)
# 3. "cat /proc/*/cmdline | grep Bullet" - Sure-Fire method ;^]
# The 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)
# 4. "busybox ps | grep Bullet" would give similar results as 3.
#
# 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 items:
# a. "/data/97BulletProof_Apps.sh"
# b. "BulletProof_Apps_is_In_Effect!" (sleep message)
# c. "Bullet" (created by your query so this doesn't mean anything)
#
# If it's not running, the output would be the last item ie. "Bullet" which was
generated by the typed command.
#
# Similar results can be had with: "busybox ps | grep Bullet".
#
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;
#
mount -o remount,rw /data 2>/dev/null;
busybox mount -o remount,rw /data 2>/dev/null;
line=================================================;
echo "";
echo \$line;
echo " -=BulletProof Apps=- script by -=zeppelinrox=-";
echo \$line;
echo "";
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*};
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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
if [ "\`busybox ps -w | grep "/\${0##*/}" | wc -l\`" -gt 2 ] || [ "\`bus
ybox ps | grep BulletProof_Apps_is | wc -l\`" -gt 1 ]; then
echo " BulletProof Apps is already running!";
echo "";
exit 69;
fi
if [ "\`pgrep scriptmanager\`" ]; 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;
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;
echo -1000 > /proc/\$bp/oom_score_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;
cat /proc/\$bp/oom_score_adj;
echo "";
done 2>/dev/null;
else
echo " Can't find \$bpapp running...";
echo " ...so it can't be BulletProofed :(";
echo "";
fi;
done;
sh /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh;
echo " This should update every 30 seconds!" > /data/Ran_BulletProof_App
s.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 " Waiting 30 seconds to re-execute... then...";
echo "";
echo " ...Gonna BulletProof Some More!";
echo "";
echo \$line;
echo " When this happens you can close this app!";
echo \$line;
echo "";
echo " Hold on....";
echo "";
sleep 30 | grep "BulletProof_Apps_is_In_Effect!";
echo \$line;
echo " Ok done! You can close this App!";
echo \$line;
echo "";
su -c "busybox start-stop-daemon -S -b -x \$0";
else \$0 & exit 0;
fi;
EOF
chown 0.0 /data/97BulletProof_Apps.sh; chmod 777 /data/9
7BulletProof_Apps.sh
cp -fr /data/97BulletProof_Apps.sh $storage/V6_SuperChar
ger
if [ -d "/system/etc/init.d" ]; then cp -fr /data/97Bull
etProof_Apps.sh /system/etc/init.d/97BulletProof_Apps
if [ ! "`diff /data/97BulletProof_Apps.sh /syste
m/etc/init.d/97BulletProof_Apps`" ]; then
sed -i 's/clear/# clear/' /system/etc/in
it.d/97BulletProof_Apps
sed -i 's/# exec >/exec >/' /system/etc/
init.d/97BulletProof_Apps
sed -i '/bullet_service;/s/#//' /system/
etc/init.d/97BulletProof_Apps
for i in /system/etc/init.d/S*; do Sfile
s=$i;break;done
if [ "$Sfiles" != "/system/etc/init.d/S*
" ]; then mv /system/etc/init.d/97BulletProof_Apps /system/etc/init.d/S97BulletP
roof_Apps; fi
cp -fr /system/etc/init.d/*BulletProof_A
pps* $storage/V6_SuperCharger
else
echo $line
echo ""
$sleep
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`"
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 [ "$postics" ] && [ ! "$servicesjarpatched" ]
; then
echo $line
echo " POST-ICS TIP! Try BulletProofing
The Launcher!"
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_HitL
ist
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
fi 2>/dev/null
fi
if [ "$bpappname" ]; then bpappname=${bpappname%
:*}
if [ "$apprunning" ]; then
$sleep
echo " BulletProofing $bpappname
..."
echo ""
$sleep
echo "-17" > /proc/`pgrep $bpps`
/oom_adj
echo "-1000" > /proc/`pgrep $bpp
s`/oom_score_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
cat /proc/`pgrep $bpps`/oom_scor
e_adj
echo $line
fi 2>/dev/null
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 " ...
make a \"Quick Widget\" for it."
echo ""
$sleep
echo " OR, with Terminal
Emulator..."
echo ""
$sleep
echo " ...you can quickl
y run ALL \"One-Shot\" scripts!"
echo ""
$sleep
echo " Type: \"su\" and
enter..."
echo ""
$sleep
echo " \"/data/V6*/Bulle
t*/1Shot*\" and enter!"
echo ""
$sleep
echo "
THAT'S IT!"
echo ""
$sleep
echo $line
echo " NOTE: DO NOT p
ut it on a timed schedule!"
echo $line
echo ""
$sleep
echo " Just launch it...
wait 30 seconds and..."
echo ""
$sleep
echo " ...the script wi
ll relaunch then kill itself!"
echo ""
$sleep
echo " You can then clos
e Script Manager and..."
echo ""
$sleep
echo " ...the BulletPr
oof \"One-Shot\" keeps running!"
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=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
# Usage: 1. Type in Terminal: "su" and enter, "/data/V6*/Bullet*/1Shot*" and ent
er. (This runs all 1Shot scripts)
# 2. Script Manager: launch it once like any other script OR with a widge
t (DO NOT PUT IT ON A SCHEDULE!)
#
# Important! Whether you run this with Terminal or Script Manager or widget, the
script relaunches and kills itself after 30 seconds.
# So you can close the app after 30 seconds and the BulletProof "One-
Shot" continues in the background!
#
# To verify that it's running, just run the script again!
# OR you can type in Terminal:
# 1. "pstree | grep 1Shot" - for usage option 1 (with Terminal)
# 2. "pstree | grep sleep" - for usage option 2 (with Script Manager)
# 3. "cat /proc/*/cmdline | grep 1Shot" - Sure-Fire method ;^]
# The output should be 3 items:
# a. "/data/V6_SuperCharger/BulletProof_One_Shots/1Shot-$bpappname.sh"
# b. "1Shot-$bpappname_is_In_Effect!" (sleep message)
# c. "1Shot" (created by your query so this doesn't mean anything)
# 4. "busybox ps | grep 1Shot" would give similar results as 3.
#
clear
line=================================================
echo ""
echo \$line
echo " -=BulletProof=- \"One-Shot\" by -=zeppelinrox=-"
echo \$line
echo ""
sleep 1
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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 [ "\`busybox ps -w | grep "/\${0##*/}" | wc -l\`" -gt 2 ] || [ "\`busybox p
s | grep $bpappname_is | wc -l\`" -gt 1 ]; then
echo " This 1Shot is already running!";
echo "";
exit 69;
elif [ "\`pgrep $bpappname\`" ]; then
for bp in \`pgrep $bpappname\`; do
echo -17 > /proc/\$bp/oom_adj
echo -1000 > /proc/\$bp/oom_score_adj
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
cat /proc/\$bp/oom_score_adj
echo ""
done 2>/dev/null
else
echo " Can't find $bpappname running..."
echo ""
echo " ...so it can't be BulletProofed :("
echo ""
fi
sleep 1
echo " ======================================="
echo " ) BulletProof \"One-Shot\" Completed! ("
echo " ======================================="
echo ""
sleep 1
echo " Waiting 30 seconds to re-execute... then..."
echo ""
sleep 1
echo " Gonna BulletProof $bpappname again!"
echo ""
sleep 1
echo \$line
echo " When this happens you can close this app!"
echo \$line
echo ""
sleep 1
echo " Hold on...."
echo ""
sleep 30 | grep "1Shot-$bpappname_is_In_Effect!"
echo \$line
echo " Ok done! You can close this App!"
echo \$line
echo ""
su -c "busybox start-stop-daemon -S -b -x \$0"
sleep 1
EOF
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 $storage/V6_SuperCharger
echo " ...data/V6_Supe
rCharger/BulletProof_One_Shots!"
if [ ! "$bp1info" ]; t
hen
echo $line
echo ""
$sleep
echo " To see if
it's working..."
echo ""
$sleep
echo " ..
.in Terminal Emulator, you can type..."
echo ""
$sleep
echo " \"pstree
| grep 1Shot\" OR \"pstree | grep sleep\""
echo ""
$sleep
echo " OR... get
COMPLETE information with..."
echo ""
$sleep
echo " .
..\"cat /proc/*/cmdline | grep 1Shot\"!"
echo ""
$sleep
echo " The outpu
t should look like this:"
echo ""
$sleep
echo " /path/
to/1Shot-$bpappname.sh"
echo " 1Shot-
$bpappname_is_In_Effect!"
echo " 1Shot"
echo ""
echo $line
echo ""
$sleep
echo " Easier: S
imilar results can be had with..."
echo ""
$sleep
echo "
...\"busybox ps | grep 1Shot\""
echo ""
fi
bp1info=shown;;
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 " With Script Manager..."
echo ""
$sleep
echo " ...make a \"Quick Widg
et\" for..."
echo ""
$sleep
echo " ...The *97BulletProo
f_Apps Boot Script..."
echo ""
$sleep
echo " OR, for LESS overhead...
use Terminal Emulator!"
echo ""
$sleep
echo " Type: \"su\" and enter, \
"/data/97*\" and enter!"
echo ""
$sleep
echo " THAT'S I
T!"
echo ""
$sleep
echo $line
echo " NOTE: DO NOT put it on
a timed schedule!"
echo $line
echo ""
$sleep
echo " Just launch it... wait 30
seconds and..."
echo ""
$sleep
echo " ...the script will relau
nch then kill itself!"
echo ""
$sleep
echo " You can then close the ap
p and..."
echo ""
$sleep
echo " ...the BulletProof Apps
script keeps running!"
echo ""
echo $line
echo ""
$sleep
echo " Also, in the /data/V6_Sup
erCharger folder..."
echo ""
$sleep
echo " ...find BulletPro
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! ;^]"
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=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
# Use this file to "Fine Tune" App Priorities to your liking!
#
# The possible values of oom_adj range from -17 to 15.
# Newer kernels use oom_score_adj instead with values from -1000 to 1000.
# The higher the score, more likely the associated process is to be killed by OO
M-killer.
# Basically, the conversion to the new system is oldstyle*1000/17 and the decima
l is truncated.
# So if something had an ADJ of 6, it would now be 6*1000/17=352.94118... which
truncates down to 352.
#
# 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
# echo -1000 > /proc/\`pgrep *com.app.name*\`/oom_score_adj (one or the other wi
ll apply lol)
# 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
# echo 1000 > /proc/\`pgrep *com.app.name*\`/oom_score_adj (for newer kernels)
# renice 19 \`pgrep *com.app.name*\`
#
# Typically, an app's (Secondary Servers) values (when SuperCharged) are:
# echo 6 > /proc/\`pgrep *com.app.name*\`/oom_adj
# echo 352 > /proc/\`pgrep *com.app.name*\`/oom_score_adj (for newer kernels)
# renice 0 \`pgrep *com.app.name*\`
#
line=================================================;
echo \$line;
echo " -=BulletProof Apps Fine Tuner Module=-";
echo \$line;
echo "";
echo " Find this in /data/V6_SuperCharger folder...";
echo "";
echo " ...read its comments...";
echo "";
echo " ...and \"Fine Tune\" App Priorities!";
echo "";
echo \$line;
echo "";
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*};
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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;
fi
EOF
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;
echo -1000 > /proc/\$bp/oom_score_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;
cat /proc/\$bp/oom_score_adj;
echo "";
done 2>/dev/null;
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* $storage/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 ""
$sleep
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 " /pat
h/to/*97BulletProof_Apps*"
echo " Bull
etProof_Apps_is_In_Effect!"
echo " Bull
et"
echo ""
echo $line
echo ""
$sleep
echo " Easier: S
imilar results can be had with..."
echo ""
$sleep
echo "
...\"busybox ps | grep Bullet\""
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 ""
$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 " ..t
ype \"start bullet_service\" and Enter."
echo "
===================="
echo ""
echo $line
echo ""
$sleep
echo " \"cat /pr
oc/*/cmdline | grep Bullet\"..."
echo ""
$sleep
echo " ...OR
... \"busybox ps | grep Bullet\"..."
echo ""
$sleep
echo " ...will
also show if the service is running!"
echo ""
elif [ ! "$allrcpaths" ]
&& [ ! "$bpsinfo" ]; then
echo $line
$sleep
echo " BulletPro
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
if [ "`busybox ps | grep Bullet | wc -l`" -le 1
]; then
echo $line
echo " Now launching /data/97BulletProof
_Apps.sh..."
echo ""
$sleep
echo " ... and it will stay in the ba
ckground! ;^]"
echo $line
echo ""
$sleep
su -c "busybox start-stop-daemon -S -b -
x /data/97BulletProof_Apps.sh"
fi
echo $line
echo " ALL BulletProof* files backed up to $stor
age..."
elif [ "`ls /system/etc/init.d/*BulletProof_Apps*`" ]; t
hen rm /system/etc/init.d/*BulletProof_Apps*
fi 2>/dev/null
fi
fi
if [ "$opt" -eq 17 ]; then
echo " Your device may get laggy after a day or two.."
echo ""
$sleep
echo " ...or merely several hours..."
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: DO NOT put it on a timed schedule!"
echo $line
echo ""
$sleep
echo " It's better to just enable..."
echo ""
$sleep
echo $line
echo " -=Engine Flush-O-Matic=- !"
echo $line
echo ""
$sleep
echo " ...and choose how often it runs ;^]"
echo ""
$sleep
echo " The script will relaunch and kill itself..."
echo ""
$sleep
echo " ...and the new instance waits to flush again!"
echo ""
$sleep
echo " This can all be configured within the script!"
echo ""
echo $line
echo ""
$sleep
cat > /data/V6_SuperCharger/!FastEngineFlush.sh <<EOF
#!/system/bin/sh
#
# 2 in 1 Engine Flush Script created by -=zeppelinrox=-
# The 2 Modes are: -=Fast Engine Flush=- and -=Engine Flush-O-Matic=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, 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 'Free
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
#
# Note: To enable "Engine Flush-O-Matic" mode, change the "flushOmaticHours" var
iable to the number of hours you want.
# Valid values are from 1 to 24 (hours).
# If 0, or if the value is invalid or missing, "Engine Flush-O-Matic" mode
is disabled.
# Example: If you want it to run every 4 hours, make the line read "flushO
maticHours=4".
#
# Usage: 1. Type in Terminal: "su" and enter, "flush" and enter. ("flush" is ind
entical to !FastEngineFlush.sh but easier to type :p)
# 2. Script Manager: launch it once like any other script OR with a widge
t (DO NOT PUT IT ON A SCHEDULE!)
#
# Important! Whether you run this with Terminal or Script Manager or widget, the
script relaunches and kills itself after the first run.
# So let it run ONCE, close the app, and "Engine Flush-O-Matic" conti
nues in the background!
#
# To verify that it's running, just run the script again!
# OR you can type in Terminal:
# 1. "pstree | grep -i flus" - for usage option 1 (with Terminal)
# 2. "pstree | grep sleep" - for usage option 2 (with Script Manager)
# 3. "cat /proc/*/cmdline | grep -i flush" - Sure-Fire method ;^]
# The output should be 3 items:
# a. "/data/V6_SuperCharger/!FastEngineFlush.sh" OR "/system/xbin/flush"
(depending on which script you ran)
# b. "Engine_Flush-O-Matic_is_In_Effect!" (sleep message)
# c. "flush" (created by your query so this doesn't mean anything)
# 4. "busybox ps | grep -i flus" would give similar results as 3.
#
clear
#
# 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
#
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
line=================================================
cd "\${0%/*}" 2>/dev/null
echo ""
echo \$line
echo " \$( date +"%m-%d-%Y %H:%M:%S" ): Flushing Engine with \$0!" | tee /data/R
an_EngineFlush-O-Matic.log
echo \$line
echo ""
sleep 2
# To set the next line manually, see comments at the top for instuctions!
flushOmaticHours=$flushOmaticHours
if [ ! "\$flushOmaticHours" ] || [ "\`echo \$flushOmaticHours | grep "[^0-9]"\`"
] || [ "\$flushOmaticHours" -gt 24 ]; then flushOmaticHours=0; fi
intervalsecs="sleep \$((\$flushOmaticHours*60*60))"
animspeed="busybox sleep 0.125"
FOMactive=; changeoptions=
if [ "\$flushOmaticHours" -ne 0 ]; then
flushmode=" -=Engine Flush-O-Matic=- by -=zeppelinrox=-"
echo " Engine Flush-O-Matic is enabled!" >> /data/Ran_EngineFlush-O-Mati
c.log
echo " So this should update every \$flushOmaticHours hours!" >> /data/R
an_EngineFlush-O-Matic.log
else flushmode=" -=Fast Engine Flush=- by -=zeppelinrox=-"
fi
clear;sleep 1;echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo \$line;echo "";echo "";echo "";echo "";echo "";ec
ho "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";echo "";echo ""
;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo \$line;echo "\$flushmode";echo \$line;echo "";ech
o "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo "";echo \$line;echo "\$flushmode";echo \$line;ech
o "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " )_.._(";echo "";echo \$line;
echo "\$flushmode";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";e
cho "";echo "";\$animspeed
clear;echo "";echo \$line;echo " \ /";echo "
)_.._(";echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";echo "
";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo \$line;echo
"\$flushmode";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";\$ani
mspeed
clear;echo "";echo \$line;echo " || ________ -( (-";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";ech
o "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " |___| __";echo "
|| ________ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo \$line;e
cho "\$flushmode";echo \$line;echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " | |";echo " |___|
__";echo " || ________ -( (-";echo " |_
(--------) '-'";echo " \ /";echo " )_
.._(";echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";echo "";echo ""
;\$animspeed
clear;echo "";echo \$line;echo " | |";echo " | |";
echo " |___| __";echo " || ________ -( (
-";echo " |_(--------) '-'";echo " \ /";e
cho " )_.._(";echo "";echo \$line;echo "\$flushmode";echo \$l
ine;echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " | D";echo " | |";
echo " | |";echo " |___| __";echo "
|| ________ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo \$line;
echo "\$flushmode";echo \$line;echo "";\$animspeed
clear;echo "";echo \$line;echo " ___";echo " | D";e
cho " | |";echo " | |";echo " |___|
__";echo " || ________ -( (-";echo " |_
(--------) '-'";echo " \ /";echo " )_
.._(";echo "";echo \$line;echo "\$flushmode";echo \$line;\$animspeed;\$animspeed
clear;echo "";echo \$line;echo " | D";echo " | |";
echo " | |";echo " |___| __";echo "
|| ________ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo \$line;
echo "\$flushmode";echo \$line;echo "";\$animspeed
clear;echo "";echo \$line;echo " | |";echo " | |";
echo " |___| __";echo " || ________ -( (
-";echo " |_(--------) '-'";echo " \ /";e
cho " )_.._(";echo "";echo \$line;echo "\$flushmode";echo \$l
ine;echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " | |";echo " |___|
__";echo " || ________ -( (-";echo " |_
(--------) '-'";echo " \ /";echo " )_
.._(";echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";echo "";echo ""
;\$animspeed
clear;echo "";echo \$line;echo " |___| __";echo "
|| ________ -( (-";echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo \$line;e
cho "\$flushmode";echo \$line;echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " || ________ -( (-";echo "
|_(--------) '-'";echo " \ /";echo "
)_.._(";echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";ech
o "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " |_(--------) '-'";echo "
\ /";echo " )_.._(";echo "";echo \$line;echo
"\$flushmode";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";\$ani
mspeed
clear;echo "";echo \$line;echo " \ /";echo "
)_.._(";echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";echo "
";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo " )_.._(";echo "";echo \$line;
echo "\$flushmode";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";e
cho "";echo "";\$animspeed
clear;echo "";echo \$line;echo "";echo \$line;echo "\$flushmode";echo \$line;ech
o "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo \$line;echo "\$flushmode";echo \$line;echo "";ech
o "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo "";echo \$line;echo "\$flushmode";echo \$line;echo "";echo "";echo ""
;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$animspeed
clear;echo " zoom...";echo \$line;echo "
\$flushmode";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";echo ""
;echo "";echo "";echo "";echo "";\$animspeed
clear;echo " zoom...";echo \$line;echo "\$flushmod
e";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";e
cho "";echo "";echo "";\$animspeed
clear;echo " zoom...";echo \$line;echo "\$flushmode";echo \$
line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";ech
o "";echo "";\$animspeed
clear;echo " zoom...";echo \$line;echo "\$flushmode";echo \$line;echo
"";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo
"";\$animspeed
clear;echo " zoom...";echo \$line;echo "\$flushmode";echo \$line;echo "";echo ""
;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$anims
peed
clear;echo " zoom... zoom...";echo \$line;echo "\
$flushmode";echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";
echo "";echo "";echo "";echo "";\$animspeed
clear;echo " zoom... zoom...";echo \$line;echo "\$flushmode"
;echo \$line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";ech
o "";echo "";echo "";\$animspeed
clear;echo " zoom... zoom...";echo \$line;echo "\$flushmode";echo \$li
ne;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo
"";echo "";\$animspeed
clear;echo " zoom... zoom...";echo \$line;echo "\$flushmode";echo \$line;echo ""
;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo ""
;busybox sleep 0.5
clear;echo " zOOM... zOOM...";echo \$line;echo "\$flushmode";echo \$line;echo ""
;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo ""
;busybox sleep 0.5
clear;echo " zoom... zoom...";echo \$line;echo "\$flushmode";echo \$line;echo ""
;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo ""
;busybox sleep 0.5
clear;echo " zOOM... zOOM...";echo \$line;echo "\$flushmode";echo \$line;echo ""
;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo ""
;busybox sleep 1
clear;echo " zOOM... zOOM...";echo \$line;echo "\$flushmode";echo \$line;echo ""
;busybox sleep 1
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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 [ "\`busybox ps -w | grep "{.*}.*\${0##*/}" | wc -l\`" -gt 1 ] && [ "\`busy
box ps -w | grep "/\${0##*/}" | wc -l\`" -gt 2 ] || [ "\`busybox ps | grep Matic
| wc -l\`" -gt 1 ]; then
echo " -=Engine Flush-O-Matic=- is already in memory!"
echo ""
sleep 1
echo " Do you want to flush now anyway?"
echo ""
sleep 1
echo " If you do, you can access Options too..."
echo ""
sleep 1
echo " ...but you can't enter another \"Flush Cycle\"."
echo ""
sleep 1
stty -icanon min 0 time 200
echo -n " Enter Y for Yes, any key for No: "
read FOMactive
stty sane
if [ ! "\$FOMactive" ]; then echo ""; fi
echo ""
echo \$line
case \$FOMactive in
y|Y)echo " Alrighty Then!"
echo \$line
echo ""
sleep 1;;
*)echo " No Options For You!"
echo \$line
echo ""
exit 69;;
esac
fi 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 " Reported Free by most tools: \$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
busybox sync;
echo \$line
echo -n " Engine Flush In Progress... ";busybox sysctl -w vm.drop_caches=3
echo \$line
echo ""
sleep 3
busybox sysctl -w vm.drop_caches=1 1>/dev/null
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 " Reported Free by most tools: \$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 \$line
echo " ...Enjoy Your Quick Boost ;^]"
echo \$line
echo ""
sleep 1
if [ "\$flushOmaticHours" -ne 0 ]; then
echo " ====================================="
echo " ) Engine Flush-O-Matic Completed! ("
echo " ====================================="
else
echo " =================================="
echo " ) Fast Engine Flush Completed! ("
echo " =================================="
fi
echo ""
sleep 1
echo " If desired, you can change options for..."
echo ""
sleep 1
echo \$line
echo " -=Engine Flush-O-Matic=-"
echo \$line
echo ""
sleep 1
echo " Current Status..."
echo ""
sleep 1
if [ "\$flushOmaticHours" -ne 0 ]; then
echo " Engine Flush-O-Matic is ON @ \$flushOmaticHours hour intervals!"
echo " =============================================="
else
echo " Engine Flush-O-Matic is currently OFF!"
echo " ======================================"
fi
echo ""
sleep 1
echo " You can turn it on or off..."
echo ""
sleep 1
echo " ...or just change how often it runs ;^]"
echo ""
sleep 1
if [ "\`ls /system/etc/init.d/*SuperCharger*\`" ]; then
echo " Note that when it's enabled..."
echo ""
sleep 1
echo \$line
echo " -=Engine Flush-O-Matic=- on boot is AUTOMATIC!"
echo \$line
echo ""
sleep 1
echo " Since it is loaded via *99SuperCharger... heh."
echo ""
sleep 1
fi 2>/dev/null
echo " Change Options? You have 20 seconds to decide!"
echo ""
sleep 1
echo -n " Enter Y for Yes, any key for No: "
if [ "\$FOMactive" ]; then changeoptions=Y; echo \$changeoptions
else
stty -icanon min 0 time 200
read changeoptions
stty sane
if [ ! "\$changeoptions" ]; then echo ""; fi
fi
echo ""
echo \$line
case \$changeoptions in
y|Y)changedopt=yes
mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw \$(busybox mount | grep system | awk '{pri
nt \$1,\$3}' | sed -n 1p) 2>/dev/null
echo " -=Engine Flush-O-Matic=- Options"
while :; do
echo \$line
echo ""
sleep 1
echo -n " Enter E to Enable, D to Disable: "
read able
echo ""
echo \$line
case \$able in
e|E)echo " -=Engine Flush-O-Matic=- ENABLED!!"
echo \$line
echo ""
sleep 1
if [ ! "\`ls /system/etc/init.d/*SuperCharger*\`
" ]; then
echo \$line
echo " An Option from 2 - 13 still needs
to be run!"
echo \$line
echo ""
sleep 1
fi 2>/dev/null
echo " How often do you want it to flush?"
while :; do
echo ""
sleep 1
echo -n " Enter a value from 1 to 24 (ho
urs): "
read flushOmaticHours
echo ""
echo \$line
case \$flushOmaticHours in
[1-9]|1[0-9]|2[0-4])echo " Engine Flus
h-O-Matic Set To Run Every \$flushOmaticHours Hours!"
break 2;;
*)echo " Invalid entry... Please try again :p"
echo \$line;;
esac
done;;
d|D)flushOmaticHours=0
echo " -=Engine Flush-O-Matic=- DISABLED!!
"
break;;
*)echo " Invalid entry... Please try again :p";;
esac
done
sed -i 's/^flushOmaticHours=.*/flushOmaticHours='\$flushOmaticHours'/'
\$0
if [ "\$0" != "/data/V6_SuperCharger/!FastEngineFlush.sh" ]; then sed
-i 's/^flushOmaticHours=.*/flushOmaticHours='\$flushOmaticHours'/' /data/V6_Supe
rCharger/!FastEngineFlush.sh; fi 2>/dev/null
if [ "\$0" != "/system/xbin/flush" ]; then sed -i 's/^flushOmaticHours
=.*/flushOmaticHours='\$flushOmaticHours'/' /system/xbin/flush; fi 2>/dev/null
mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro \$(busybox mount | grep system | awk '{pri
nt \$1,\$3}' | sed -n 1p) 2>/dev/null;;
*)echo " No Change For You!";;
esac
echo \$line
echo ""
sleep 1
if [ "\$flushOmaticHours" -ne 0 ]; then
echo \$line
if [ "\$FOMactive" ]; then
echo " -=Engine Flush-O-Matic=- is already in memory!"
echo \$line
echo ""
exit 69
elif [ "\$changedopt" ]; then
echo ""
echo " You can change options by..."
echo ""
sleep 1
echo " ...running this script again :o)"
echo ""
echo \$line
echo ""
sleep 1
echo " After closing this app you may wonder..."
echo ""
sleep 1
echo " Is -=Engine Flush-O-Matic=- working?"
echo " ===================================="
echo ""
sleep 1
echo " Check out /data/Ran_EngineFlush-O-Matic.log!"
echo ""
sleep 1
echo " Or... in Terminal Emulator, you can type..."
echo ""
sleep 1
echo " \"pstree | grep -i flus\" OR \"pstree|grep sleep\""
echo ""
sleep 1
echo " OR... get COMPLETE information with..."
echo ""
sleep 1
echo " ...\"cat /proc/*/cmdline | grep -i flush\"!"
echo ""
sleep 1
echo " The output should look like this:"
echo ""
sleep 1
echo " /data/V6_SuperCharger/!FastEngineFlush.sh..."
echo " OR /system/xbin/flush (either script name)"
echo " Engine_Flush-O-Matic_is_In_Effect!"
echo " flush"
echo ""
sleep 1
echo " Easier: Similar results can be had with..."
echo ""
sleep 1
echo " ...\"busybox ps | grep -i flus\""
echo ""
sleep 1
echo " ...OR run this script again...I'll tell ya LOL"
echo ""
sleep 1
echo \$line
echo " Also READ THE COMMENTS inside this script!"
echo \$line
echo ""
sleep 1
echo \$line
echo " Now executing -=Engine Flush-O-Matic=-..."
echo \$line
echo ""
sleep 1
echo \$line
fi 2>/dev/null
echo " Here We Go Again... in \$flushOmaticHours hours LOL"
echo \$line
echo ""
sleep 1
echo \$line
echo " Oh Hey! You can close this App!"
echo \$line
echo ""
if [ "\`busybox ps -w | grep "{.*}.*\${0##*/}" | wc -l\`" -gt 1 ]; then
\$intervalsecs | grep "Engine_Flush-O-Matic_is_In_Effect!"
fi
sleep 1
su -c "busybox start-stop-daemon -S -b -x \$0"
fi
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 $storage/V6_Sup
erCharger
cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh $storage/V6_Sup
erCharger/flush
cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh /system/xbin/fl
ush
echo " Continue and Flush it all away?"
echo ""
$sleep
echo -n " Enter N for No, any key for Yes: "
read flush
echo ""
echo $line
case $flush in
n|N)echo " Okay... just stay full of cache then!"
echo $line
echo ""
$sleep;;
*)echo " Nice! Gonna dump some cache... flush too!"
echo $line
echo ""
sleep 2
sh /data/V6_SuperCharger/!FastEngineFlush.sh
flushOmaticHours=`grep "^flushOmaticHours=" /data/V6_S
uperCharger/!FastEngineFlush.sh | sed 's/flushOmaticHours=//'`;;
esac
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 " ...you can make a \"Quick Widget\" for it."
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 ""
echo $line
echo ""
$sleep
echo " Current Status..."
echo ""
$sleep
if [ "$flushOmaticHours" -ne 0 ]; then
echo " Engine Flush-O-Matic is ON @ $flushOmaticHours ho
ur intervals!"
echo " =============================================="
else
echo " Engine Flush-O-Matic is currently OFF!"
echo " ======================================"
fi
echo ""
$sleep
echo $line
echo " And Hey! READ THE COMMENTS inside the script!"
fi
if [ "$opt" -eq 18 ]; 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 to optimize databases) created by -=
zeppelinrox=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
# This will optimize (defrag, reindex, debloat) ALL sqlite3 databases found on y
our device.
# Resulting in faster database access and less ram usage for smoother performanc
e.
#
# Props: avgjoemomma (from XDA) for the added reindex bit :)
#
# Note: You can change the "runonbootinterval" variable to any valid value that
you want.
# Valid values are from 1 to 9 (boots).
# If 0, it won't run on boot.
# If the value is invalid or missing, it defaults to running every 3rd boo
t.
# Example: If you want it to run every 4th boot, make the line read "runon
bootinterval=4".
#
clear
#
# 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
#
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
line=================================================
cd "\${0%/*}" 2>/dev/null
echo ""
echo \$line
echo " -=Detailing=- script by -=zeppelinrox=-"
echo \$line
echo ""
sleep 2
counterfile=/data/V6_SuperCharger/!Detailing_Counter
counter1=\`cat \$counterfile | head -n 1\` 2>/dev/null
# To set the next line manually, see comments at the top for instuctions!
runonbootinterval=$detailinterval
if [ ! "\$runonbootinterval" ] || [ "\`echo \$runonbootinterval | grep "[^0-9]"\
`" ] || [ "\$runonbootinterval" -gt 9 ]; then runonbootinterval=3; fi
if [ "\`busybox ps | grep 99Super | wc -l\`" -gt 1 ]; then
if [ "\$runonbootinterval" -eq 0 ]; then exit 69; fi
if [ ! "\$counter1" ] || [ "\$counter1" -ge "\$runonbootinterval" ]; the
n counter2=1
echo "\$counter2" > \$counterfile
echo " SQLite databases are optimized at \$runonbootinterval boo
t intervals!" >> \$counterfile
echo "" >> \$counterfile
echo " Detailing ran on the most recent boot..." >> \$counterfil
e
echo " It was executed on \`date\`" >> \$counterfile
else counter2=\$((\$counter1+1))
sed -i '1s/'\$counter1'/'\$counter2'/' \$counterfile
echo "" >> \$counterfile
echo " Detailing last ran \$counter2 reboots ago..." >> \$counte
rfile
echo " It exited peacefully on \`date\`" >> \$counterfile
exit 69
fi
else
echo 1 > \$counterfile
echo " SQLite databases are optimized at \$runonbootinterval boot interv
als!" >> \$counterfile
echo "" >> \$counterfile
echo " Detailing was run manually so the counter has been reset..." >> \
$counterfile
echo " It was executed on \`date\`" >> \$counterfile
fi 2>/dev/null
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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 sqlite3\`" ]; then
sleep 1
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 -a android.inten
t.action.VIEW -n com.android.browser/.BrowserActivity -d file://$storage/!SuperC
harger.html"
echo ""
echo \$line
echo ""
sleep 3
exit 69
fi 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 ""
echo \$line
echo "" | tee -a \$LOG_FILE
sleep 1
echo " Done Optimizing \$TOTAL Databases for ALL Apps..." | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
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 ""
if [ -d "/system/etc/init.d" ]; then
sleep 1
echo " If desired, you can change Detailing options..."
echo ""
sleep 1
echo " *99SuperCharger would run Detailing.sh..."
echo ""
sleep 1
echo " ...so boot time would be unaffected!"
echo ""
sleep 1
echo " AND you can specify how often it runs..."
echo ""
sleep 1
echo " ...so if you input 4, it runs every 4th boot!"
echo ""
sleep 1
echo \$line
echo -n " Current Status: Detailing "
if [ "\$detailing" -eq 0 ]; then echo "DOES NOT Run On Boot!"
else echo "Runs Every \$detailinterval Boots!"
fi
echo \$line
echo ""
sleep 1
echo " You can also configure this in Driver Options!"
echo ""
sleep 1
echo \$line
echo " Also READ THE COMMENTS inside this script!"
echo \$line
echo ""
sleep 1
echo " Change Options? You have 20 seconds to decide!"
echo ""
sleep 1
stty -icanon min 0 time 200
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
stty sane
if [ ! "\$changeoptions" ]; then echo ""; fi
echo ""
echo \$line
case \$changeoptions in
y|Y)mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw \$(busybox mount | grep syst
em | awk '{print \$1,\$3}' | sed -n 1p) 2>/dev/null
echo ""
sleep 1
if [ "\$bootdetailing" ] && [ "\`ls /system/etc/init.d/*
SuperCharger*\`" ]; then
sed -i '/!Detailing/d' /system/etc/init.d/*Super
Charger*
sed -i '/sleep 90;/ a\
sed -i '"'s/# exec >/exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/null;
\
sh /data/V6_SuperCharger/!Detailing.sh & sleep 2;\
sed -i '"'s/exec >/# exec >/'"' /data/V6_SuperCharger/!Detailing.sh 2>/dev/null;
sleep 480;' /system/etc/init.d/*SuperCharger*
fi 2>/dev/null
echo " Run Detailing on boot?"
echo ""
sleep 1
echo -n " Enter Y for Yes, any key for No: "
read bootdetailing
echo ""
case \$bootdetailing in
y|Y)detailing=1
if [ ! "\`ls /system/etc/init.d/*SuperCharger*
\`" ]; then
echo \$line
echo " An Option from 2 - 13 still needs
to be run!"
fi 2>/dev/null
while :; do
echo \$line
echo ""
sleep 1
echo -n " How often? 1=every boot to 9=e
very 9th boot: "
read detailinterval
echo ""
echo \$line
case \$detailinterval in
[1-9])echo " Detailing Set To Ru
n Every \$detailinterval Boots!"
break;;
*)echo " Invalid entry...
Please try again :p";;
esac
done;;
*)detailing=0; detailinterval=0
sed -i '/!Detailing.sh/s/^/# /' /system/etc/in
it.d/*SuperCharger* 2>/dev/null
echo " Declined Detailing On Boot!";
;
esac
sed -i 's/^runonbootinterval=.*/runonbootinterval='\$det
ailinterval'/' \$0
if [ "\$0" != "/data/V6_SuperCharger/!Detailing.sh" ]; t
hen sed -i 's/^runonbootinterval=.*/runonbootinterval='\$detailinterval'/' /data
/V6_SuperCharger/!Detailing.sh; fi 2>/dev/null
if [ "\$0" != "/system/xbin/vac" ]; then sed -i 's/^runo
nbootinterval=.*/runonbootinterval='\$detailinterval'/' /system/xbin/vac; fi 2>/
dev/null
if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; t
hen
awk 'BEGIN{OFS=FS=","}{\$10='\$detailing',\$11='
\$detailinterval';print}' /data/V6_SuperCharger/SuperChargerOptions > /data/V6_S
uperCharger/SuperChargerOptions.tmp
mv /data/V6_SuperCharger/SuperChargerOptions.tmp
/data/V6_SuperCharger/SuperChargerOptions
fi
mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro \$(busybox mount | grep syst
em | awk '{print \$1,\$3}' | sed -n 1p) 2>/dev/null;;
*)echo " No Change For You!";;
esac
fi
echo \$line
echo ""
sleep 1
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 $storage/V6_S
uperCharger
cp -fr /data/V6_SuperCharger/!Detailing.sh $storage/V6_S
uperCharger/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 $line
echo ""
$sleep
detailingnotrun=yes;;
*)echo " Time to clean up after you! ;^]
"
echo $line
echo ""
sleep 2
sh /data/V6_SuperCharger/!Detailing.sh
detailing=`awk -F , '{print $10}' /data/V6_Sup
erCharger/SuperChargerOptions`
detailinterval=`awk -F , '{print $11}' /data/V
6_SuperCharger/SuperChargerOptions`;;
esac
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 " ...you can make a \"Quick Widget\" for it."
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 " 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 ""
if [ -d "/system/etc/init.d" ] && [ "$detailingnotrun" ]
; then
detailingnotrun=
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 unaffe
cted!"
echo ""
$sleep
echo " AND you can specify how often it runs. ;^
]"
echo ""
$sleep
echo $line
echo -n " Current Status: Detailing "
if [ "$detailing" -eq 0 ]; then echo "DOES NOT R
un On Boot!"
else echo "Runs Every $detailinterval Boots!"
fi
echo $line
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 19 ]; 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=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, 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 (POST-ICS)
# - Added support for /mnt/asec
# - Added support for more data directories ie. dbdata, datadata, etc.
# - Added debugging
# - Tweaked interface a bit ;^]
#
clear
#
# 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
#
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
line=================================================
cd "\${0%/*}" 2>/dev/null
echo ""
echo \$line
echo " -=Wheel Alignment=- script by -=zeppelinrox=-"
echo \$line
echo ""
sleep 2
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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 -a android.inten
t.action.VIEW -n com.android.browser/.BrowserActivity -d file://$storage/!SuperC
harger.html"
echo ""
echo \$line
echo ""
sleep 3
exit 69
fi 2>/dev/null
mount -o remount,rw /system 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\`)) 2>/dev/null
INCREMENT=3
PROGRESS=0
PROGRESS_BAR=""
ALIGNED=0; ALREADY=0; FAILED=0; SKIPPED=0
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>"
echo ""
echo " Processing APKs - \$PERCENT% (\$PROGRESS of \$TOTAL)"
echo ""
if [ -f "\$apk" ]; then
if [ "\$(busybox basename \$apk )" = "framework-res.apk" ] || [
"\$(busybox basename \$apk )" = "SystemUI.apk" ] || [ "\$(busybox basename \$apk
)" = "com.htc.resources.apk" ]; then
echo " NOT ZipAligning (Problematic) \$apk..." | tee -a
\$LOG_FILE
SKIPPED=\$((\$SKIPPED+1))
skippedapp="\$skippedapp\$(busybox basename \$apk ),"
else
zipalign -c 4 \$apk
ZIPCHECK=\$?
if [ "\$ZIPCHECK" -eq 1 ]; then
echo " ZipAligning \$apk..." | tee -a \$LOG_FILE
zipalign -f 4 \$apk /cache/\$(busybox basename \
$apk)
rc="\$?"
if [ "\$rc" -eq 0 ]; then
if [ -e "/cache/\$(busybox basename \$ap
k)" ]; then
busybox cp -f -p /cache/\$(busyb
ox basename \$apk) \$apk | tee -a \$LOG_FILE
ALIGNED=\$((\$ALIGNED+1))
else
echo " ZipAligning \$apk... Fail
ed (No Output File!)" | tee -a \$LOG_FILE
FAILED=\$((\$FAILED+1))
failedapp="\$failedapp\$(busybox
basename \$apk ),"
fi
else echo "ZipAligning \$apk... Failed (rc: \$rc
!)" | tee -a \$LOG_FILE
FAILED=\$((\$FAILED+1))
failedapp="\$failedapp\$(busybox basenam
e \$apk ),"
fi
if [ -e "/cache/\$(busybox basename \$apk)" ]; t
hen busybox rm /cache/\$(busybox basename \$apk); fi
else
echo " ZipAlign already completed on \$apk" | te
e -a \$LOG_FILE
ALREADY=\$((\$ALREADY+1))
fi
fi
fi
done
sync
mount -o remount,ro /system 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
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 ""
echo \$line
echo "" | tee -a \$LOG_FILE
sleep 1
echo " Done \"ZepAligning\" ALL data and system APKs..." | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
sleep 1
echo " \$ALIGNED Apps were zipaligned..." | tee -a \$LOG_FILE
echo " \$ALREADY Apps were already zipaligned..." | tee -a \$LOG_FILE
echo " \$FAILED Apps were NOT zipaligned due to error..." | tee -a \$LOG_FILE
if [ "\$failedapp" ];then echo " (\$failedapp)" | tee -a \$LOG_FILE; fi
echo " \$SKIPPED (Problematic) Apps were skipped..." | tee -a \$LOG_FILE
echo " (\$skippedapp)" | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
echo " \$TOTAL Apps were processed!" | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
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 ""
sleep 1
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 $storage
/V6_SuperCharger
cp -fr /data/V6_SuperCharger/!WheelAlignment.sh $storage
/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 2
sh /data/V6_SuperCharger/!WheelAlignment.sh
autofixemissions=yes;;
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 ""
if [ -d "/system/etc/init.d" ]; then
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 unaffe
cted!"
echo ""
$sleep
echo $line
echo " You can configure this in Driver Options!
"
fi
if [ "$autofixemissions" ]; then
echo $line
echo ""
$sleep
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)autofixemissions=
mount -o remount,rw / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw / 2>/dev/n
ull
busybox mount -o remount,rw rootfs 2>/
dev/null
mount -o remount,rw /system 2>/dev/nul
l
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 " Okay... but run it if you
get FCs!!";;
*)opt=20
echo ""
echo " ==================
==="
busybox echo " //// FIX EM
ISSIONS \\\\\\\\"
echo $line
echo ""
$sleep;;
esac
fi
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
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 " 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=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, 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 (POST-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 ;^]
#
clear
#
# 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
#
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
line=================================================
cd "\${0%/*}" 2>/dev/null
echo ""
echo \$line
echo " -=Fix Emissions=- script by -=zeppelinrox=-"
echo \$line
echo ""
sleep 2
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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
mount -o remount,rw /system 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
grep -E "^<package.*serId" /d*/system/packages.xml | while read pkgline; do
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
mount -o remount,ro /system 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
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 ""
echo \$line
echo "" | tee -a \$LOG_FILE
sleep 1
echo " FIXED Permissions For ALL \$TOTAL Apps..." | tee -a \$LOG_FILE
echo ""| tee -a \$LOG_FILE
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 details!"
echo ""
sleep 1
echo " =============================="
echo " ) Fix Emissions Completed! ("
echo " =============================="
echo ""
sleep 1
exit 0
EOF
mount -o remount,rw /system 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
chown 0.0 /data/V6_SuperCharger/!FixEmissions.sh; chmod 777 /dat
a/V6_SuperCharger/!FixEmissions.sh
cp -fr /data/V6_SuperCharger/!FixEmissions.sh $storage/V6_SuperC
harger
cp -fr /data/V6_SuperCharger/!FixEmissions.sh $storage/V6_SuperC
harger/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: "
if [ "$autofixemissions" ]; then emissions=Y; autofixemissions=;
echo $emissions
else read emissions
fi
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 2
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 21 ]; then
echo " This combines two scripts into one..."
echo ""
$sleep
echo " ...Wheel Alignment AND Fix Emissions!"
echo ""
$sleep
echo " ZipAlign optimizes all your APKs..."
echo ""
$sleep
echo " ...which means less RAM comsumption..."
echo ""
$sleep
echo " ...better battery life and a faster device!!"
echo ""
$sleep
echo " But sometimes... Force Closes can result..."
echo ""
$sleep
echo " ...so this Fixes Permissions of each app..."
echo ""
$sleep
echo " ...immediately after zipaligning it!"
echo ""
$sleep
echo " It's REALLY FAST and..."
echo ""
$sleep
echo $line
echo " It's the ONLY script of it's kind ;^]"
echo $line
echo ""
$sleep
if [ "`which zipalign`" ]; then
cat > /data/V6_SuperCharger/!FixAlignment.sh <<EOF
#!/system/bin/sh
#
# Fix Alignment Script (ZipAlign AND Fix Permissions) created by -=zeppelinrox=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
# Combines my "ZepAlign" / Wheel Alignment Script (ZipAlign) with my Fix Emissio
ns Script (Fix Permissions).
#
###############################
# Wheel Alignment Information #
###############################
# 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 ;^]
#
#############################
# Fix Emissions Information #
#############################
# 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 ;^]
#
clear
#
# For debugging, delete the # at the beginning of the following 2 lines, and che
ck /data/Log_FixAlign.log file to see what may have fubarred.
# set -x
# exec > /data/Log_FixAlign.log 2>&1
#
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
line=================================================
cd "\${0%/*}" 2>/dev/null
echo ""
echo \$line
echo " -=Fix Alignment=- script by -=zeppelinrox=-"
echo \$line
echo ""
sleep 2
zipalign="yes"
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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
zipalign=
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 -a android.inten
t.action.VIEW -n com.android.browser/.BrowserActivity -d file://\$storage/!Super
Charger.html"
echo ""
echo \$line
echo ""
sleep 3
echo \$line
echo " So... for now... can ONLY Fix Emissions!"
echo \$line
echo ""
sleep 3
fi 2>/dev/null
mount -o remount,rw /system 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
rm /data/fixaligntemp* 2>/dev/null
LOG_FILE=/data/Ran_FixAlign.log
LOG_FILE2=/data/Ran_ZepAlign.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 Alignment: \$BEGAN" > \$LOG_FILE
if [ "\$zipalign" ]; then echo " Start Wheel Alignment ( \"ZepAlign\" ): \$BEGAN
" > \$LOG_FILE2; echo "" >> \$LOG_FILE2; fi
sync
grep -E "^<package.*serId" /d*/system/packages.xml | while read pkgline; do
if [ ! -f "/data/fixaligntemp" ]; then ALIGNED=0; ALREADY=0; FAILED=0; S
KIPPED=0; fi
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 Alignment\" by -=zeppelinrox=-"
echo -n " >"
echo -e "\r \$PROGRESS_BAR>"
echo ""
echo " Processing Apps - \$PERCENT% (\$PROGRESS of \$TOTAL)"
echo "" | tee -a \$LOG_FILE
echo " Fix Aligning \$PKGNAME..." | tee -a \$LOG_FILE
echo ""
if [ -e "\$CODEPATH" ]; then
if [ "\$zipalign" ]; then
if [ "\$(busybox basename \$CODEPATH )" = "framework-res
.apk" ] || [ "\$(busybox basename \$CODEPATH )" = "SystemUI.apk" ] || [ "\$(busy
box basename \$CODEPATH )" = "com.htc.resources.apk" ]; then
echo " NOT ZipAligning (Problematic) \$CODEPATH.
.." | tee -a \$LOG_FILE \$LOG_FILE2
SKIPPED=\$((\$SKIPPED+1))
skippedapp="\$skippedapp\$(busybox basename \$CO
DEPATH ),"
else
zipalign -c 4 \$CODEPATH
ZIPCHECK=\$?
if [ "\$ZIPCHECK" -eq 1 ]; then
echo " ZipAligning \$CODEPATH..." | tee
-a \$LOG_FILE \$LOG_FILE2
zipalign -f 4 \$CODEPATH /cache/\$(busyb
ox basename \$CODEPATH )
rc="\$?"
if [ "\$rc" -eq 0 ]; then
if [ -e "/cache/\$(busybox basen
ame \$CODEPATH )" ]; then
busybox cp -f -p /cache/
\$(busybox basename \$CODEPATH ) \$CODEPATH | tee -a \$LOG_FILE \$LOG_FILE2
ALIGNED=\$((\$ALIGNED+1)
)
else
echo " ZipAligning \$COD
EPATH... Failed (No Output File!)" | tee -a \$LOG_FILE \$LOG_FILE2
FAILED=\$((\$FAILED+1))
failedapp="\$failedapp\$
(busybox basename \$CODEPATH ),"
fi
else echo "ZipAligning \$CODEPATH... Fai
led (rc: \$rc!)" | tee -a \$LOG_FILE \$LOG_FILE2
FAILED=\$((\$FAILED+1))
failedapp="\$failedapp\$(busybox
basename \$CODEPATH ),"
fi
if [ -e "/cache/\$(busybox basename \$CO
DEPATH )" ]; then busybox rm /cache/\$(busybox basename \$CODEPATH ); fi
else
echo " ZipAlign already completed on \$C
ODEPATH " | tee -a \$LOG_FILE \$LOG_FILE2
ALREADY=\$((\$ALREADY+1))
fi
echo "\$ALIGNED \$ALREADY \$FAILED \$SKIPPED" >
/data/fixaligntemp
echo "\$failedapp" > /data/fixaligntemp2
echo "\$skippedapp" > /data/fixaligntemp3
fi
fi
APPDIR=\`busybox dirname \$CODEPATH\`
if [ "\$APPDIR" = "/system/app" ] || [ "\$APPDIR" = "/vendor/app
" ] || [ "\$APPDIR" = "/system/framework" ]; then
busybox chown 0 \$CODEPATH
busybox chown :0 \$CODEPATH
busybox chmod 644 \$CODEPATH
elif [ "\$APPDIR" = "/data/app" ]; then
busybox chown 1000 \$CODEPATH
busybox chown :1000 \$CODEPATH
busybox chmod 644 \$CODEPATH
elif [ "\$APPDIR" = "/data/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
echo " Fixed Permissions..." | tee -a \$LOG_FILE
fi 2>/dev/null
done
sync
echo "" | tee -a \$LOG_FILE
echo \$line
mount -o remount,ro /system 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
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"\`
if [ "\$zipalign" ]; then
ALIGNED=\`awk '{print \$1}' /data/fixaligntemp\`
ALREADY=\`awk '{print \$2}' /data/fixaligntemp\`
FAILED=\`awk '{print \$3}' /data/fixaligntemp\`
SKIPPED=\`awk '{print \$4}' /data/fixaligntemp\`
failedapp=\`cat /data/fixaligntemp2\`
skippedapp=\`cat /data/fixaligntemp3\`
echo "" | tee -a \$LOG_FILE2
sleep 1
rm /data/fixaligntemp*
echo " Done \"ZepAligning\" ALL data and system APKs..." | tee -a \$LOG_
FILE \$LOG_FILE2
echo "" | tee -a \$LOG_FILE \$LOG_FILE2
sleep 1
echo " \$ALIGNED Apps were zipaligned..." | tee -a \$LOG_FILE \$LOG_FI
LE2
echo " \$ALREADY Apps were already zipaligned..." | tee -a \$LOG_FILE \$
LOG_FILE2
echo " \$FAILED Apps were NOT zipaligned due to error..." | tee -a \$L
OG_FILE \$LOG_FILE2
if [ "\$failedapp" ];then echo " (\$failedapp)" | tee -a \$LOG_FILE;
fi
echo " \$SKIPPED (Problematic) Apps were skipped..." | tee -a \$LOG_FI
LE \$LOG_FILE2
echo " (\$skippedapp)" | tee -a \$LOG_FILE \$LOG_FILE2
echo "" | tee -a \$LOG_FILE \$LOG_FILE2
echo " \$TOTAL Apps were processed!" | tee -a \$LOG_FILE \$LOG_FILE2
echo "" | tee -a \$LOG_FILE
sleep 1
echo " ...Say Hello To Optimized Apps!"
echo ""
echo \$line
fi
echo ""
sleep 1
echo " FIXED Permissions For ALL \$TOTAL Apps..." | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
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 details!"
echo ""
sleep 1
if [ "\$zipalign" ]; then echo " And see \$LOG_FILE2 for even more!"; fi
echo ""
sleep 1
echo " =============================="
echo " ) Fix Alignment Completed! ("
echo " =============================="
echo ""
sleep 1
exit 0
EOF
chown 0.0 /data/V6_SuperCharger/!FixAlignment.sh; chmod
777 /data/V6_SuperCharger/!FixAlignment.sh
cp -fr /data/V6_SuperCharger/!FixAlignment.sh $storage/V
6_SuperCharger
cp -fr /data/V6_SuperCharger/!FixAlignment.sh $storage/V
6_SuperCharger/fixalign
cp -fr /data/V6_SuperCharger/!FixAlignment.sh /system/xb
in/fixalign
echo " FixAlign 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 Fix Alignment? Try and drive straight!"
;;
*)echo " Gonna \"FixAlign\" in no time! ;
^]"
echo $line
echo ""
sleep 2
sh /data/V6_SuperCharger/!FixAlignment.sh;;
esac
echo $line
echo ""
$sleep
echo " For Fast 'n Furious FixAligning..."
echo ""
$sleep
echo " .../data/V6_SuperCharger/!FixAlignment.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/!FixAlignment.sh /sy
stem/xbin/fixalign`" ]; 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 \"fixalign\" 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 ""
if [ -d "/system/etc/init.d" ]; then
echo $line
echo ""
$sleep
echo " Fix Alignment can run automatically on bo
ot!"
echo ""
$sleep
echo " *99SuperCharger would run FixAlignment.sh
..."
echo ""
$sleep
echo " ...so boot time would be unaffe
cted!"
echo ""
$sleep
echo $line
echo " You can configure this in Driver Options!
"
fi
else
echo " Doh... zipalign binary was NOT found..."
echo ""
$sleep
echo $line
echo " ...No FixAligning 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 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 " ...as /syste
m/build.prop.unsuper!"
fi
fi
echo $line
cp -fr /system/build.prop $storage/V6_SuperCharg
er/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 ""
$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" ] || [ "$0" = "/system/xbin/v6" ]; then e
cho " You are already running it from system/xbin!"
else
dd if=$0 of=/system/xbin/v6 2>/dev/null
cp -fr $0 $storage/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 [ "$servicesjarpatched" ]; then
if [ ! "$UnIScream" ]; then
echo " Hey... services.jar is ALREADY SuperChar
ged!"
echo ""
echo $line
fi
if [ -f "$storage/V6_SuperCharger/services.jar.unsuper"
]; then
echo ""
$sleep
echo " A backup services.jar was found..."
echo ""
$sleep
echo " ie.$storage/V6_SuperCharger/services.jar.
unsuper"
echo ""
$sleep
echo " Do you want to restore it (with permissio
ns)?"
echo " (services.odex too, if it exi
sts)"
echo ""
$sleep
for newer in `busybox ls -lc $storage/V6_SuperCh
arger/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 $storage/V6_SuperCharger/services.j
ar.unsuper /system/framework/services.jar
cp -fr $storage/V6_SuperCharger/servic
es.odex.unsuper /system/framework/services.odex 2>/dev/null
if [ ! "`diff $storage/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!"
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
if [ "$usedwebapp" ] || [ "$newer" = "/system/bin/adb" ]
; then echo ""; fi
fi
if [ ! "$servicesjarpatched" ] || [ "$usedwebapp" ] || [ "$newer
" = "/system/bin/adb" ]; then
if [ -f "/system/framework/services.odex" ]; then odex=y
es; fi
if [ "$newsupercharger" ] && [ "$ran" -eq 1 ]; then
echo -n " Press The Enter Key... "
read enter
echo ""
echo " ============================"
busybox echo " //// JELLY ISCREAM PARLOR
\\\\\\\\"
echo $line
echo ""
$sleep
fi
if [ "$odex" ] || [ "$jb" -eq 1 ]; then
if [ "$odex" ]; then
echo " You have an ODEXED RO
M!"
echo " =====================
=="
echo ""
$sleep
fi
echo " The ICS Priority Charger WebApp WON'T wor
k..."
echo ""
$sleep
if [ "$jb" -eq 1 ]; then
echo " ...on Jelly B
ean as of yet!"
echo ""
$sleep
fi
if [ "$odex" ]; then
echo " This tool CAN install a pre-patch
ed..."
echo ""
$sleep
echo " ...services.jar and services.od
ex..."
else
echo " This tool CAN install..."
echo ""
$sleep
echo " ...a pre-patched services.jar..
."
fi
echo ""
$sleep
echo " ...from $storage to /system/framework
..."
else
echo " This will download a patched services.jar
..."
echo ""
$sleep
echo " ...OR install one from $stor
age..."
echo ""
$sleep
echo " ...to /system/framework/services.j
ar..."
fi
echo ""
$sleep
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 ""
echo $line
echo ""
$sleep
echo " BUT the BEST and EASIEST method is to use..."
echo ""
$sleep
echo " ...the -=Ultimatic Jar Patcher Tools=- ;^]"
echo ""
$sleep
echo " Choosing \"Ultimatic\" will open the XDA thread!"
echo ""
$sleep
echo $line
if [ "$odex" ]; then echo ""; echo " ODEX ROMS can only
do Manual Method for now!"
elif [ "$jb" -eq 1 ]; then echo ""; echo " Jelly Bean c
an only do Manual Method for now!"
else
if [ ! "$usedwebapp" ]; then
echo " Note: Downloaded services.jar w
ill be WEAK!"
echo $line
echo ""
$sleep
fi
echo " To get 100% SuperCharged,choose Manual Me
thod!"
echo ""
$sleep
echo " So hey, you have 2 choices!"
fi
echo ""
$sleep
echo " Automatic Transmission: Automagical Install"
$sleep
echo " OR"
$sleep
echo " Manual Method: See tools in thread to assist!"
echo ""
if [ ! "$odex" ] && [ "$jb" -eq 0 ]; then
$sleep
echo $line
echo " WARNING: Priority Charger WebApp is OUT O
F DATE"
echo $line
echo ""
$sleep
echo " It's missing the latest enhancements..."
echo ""
$sleep
echo " ...and the NEWEST MultiTasking
Mods!"
echo ""
$sleep
echo " The Launcher will still be WEAK-ish and..
."
echo ""
$sleep
echo " ...your SuperCharger Level will be reduce
d 25%!"
echo ""
$sleep
echo $line
echo " MANUAL METHOD RECOMMENDED FOR 100% SUPERC
HARGE!"
fi
while :; do
echo $line
echo ""
$sleep
echo -n " Enter (A)utomatic or (M)anual or E(X)i
t: "
if [ "$odex" ] || [ "$jb" -eq 1 ] || [ "$usedweb
app" ]; 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 Method Selec
ted!";;
x|X)break;;
*)echo " Invalid entry... Please tr
y again :p";;
esac
while [ "$autotransmit" ] || [ "$manualtransmit"
] && [ ! "$newservicesjar" ]; do
echo $line
echo ""
$sleep
echo -n " Enter (U)ltimatic, (I)nstall,
E(X)it: "
if [ "$autotransmit" ]; then servicechoi
ce=D; echo $servicechoice
elif [ "$autoinstalljar" ]; then service
choice=I; echo $servicechoice
else read servicechoice
fi
echo ""
echo $line
case $servicechoice in
d|D|u|U)echo ""
$sleep
if [ "$autotransmit" ]; then
if [ "`busybox ping -c 1
108.163.181.154 | 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 " ERROR: services.jar cannot be patched!"
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 " [$HEADER_MD5]"
echo $line
$sleep
FILE_MD5=`md5sum $TMP_DIR/tmp_output | awk '{ print $1 }'`
echo " Downloaded services.jar MD5hash is:"
echo " [$FILE_MD5]"
echo $line
echo ""
$sleep
echo $line
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 $storage/V6_SuperCharger/services_supercharged.jar
echo " Now off to Auto Install services.jar!"
else
echo " ERROR: MD5sums DO NOT Match!"
echo $line
echo ""
$sleep
echo " There is a possible download issue... :("
fi;;
esac
else
echo ""
echo $line
echo ""
$sleep
echo " FAI
L... Cannot Connect to Server :("
fi
echo ""
else
echo " Going to load the
..."
echo ""
$sleep
echo " ...Ultimatic Jar
Patcher Tools thread at XDA!"
echo ""
$sleep
echo " These tools (incl
uding MultiTasking Mods)..."
echo ""
$sleep
echo " ...can
patch and install it all..."
echo ""
$sleep
echo "
...from start to finish :o)"
echo ""
if [ ! "$odex" ]; then
$sleep
echo " But if yo
u run it and do \"Offline\" Mode..."
echo ""
$sleep
echo "
...you can patch any services.jar!"
echo ""
$sleep
echo " If you do
that... you can come back..."
echo ""
$sleep
echo $line
echo " ...
and select \"(I)nstall\" to install it!"
fi
fi
echo $line
echo ""
$sleep
echo -n " Press The Enter Key.
.. "
read enter
echo ""
if [ ! "$autotransmit" ]; then
echo $line
su -c "LD_LIBRARY_PATH=/
vendor/lib:/system/lib am start http://goo.gl/IvGL1"
fi
manualtransmit=yes;autotransmi
t=;;
i|I)echo ""
if [ "$autoinstalljar" ]; then
foundjars="$storage/V6_SuperCharger/services_supercharged.jar"
else
echo " Wait... looking
for *services*.jar on $storage!"
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\'$storage'//\' | while read l
istjars; 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 $storage/V6_SuperCharger/services.jar.unsuper /system/bin/adb
| awk '{print $9}'`; do break; done 2>/dev/null
if [ "
$newer" = "/system/bin/adb" ]; then
echo " Backing up services.jar to $storage..."
echo ""
$sleep
cp -fr /system/framework/services.jar $storage/V6_SuperCharger/services.jar.un
super
cp -fr /system/framework/services.odex $storage/V6_SuperCharger/services.odex.
unsuper 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 " I Scream SUPERCHARGED!"
echo $line
echo ""
$sleep
echo $line
else
echo " WARNING: ERROR copying to /system/framework!"
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 ""
echo $line
echo ""
$sleep
echo " Restoring original services.jar!"
echo ""
cp -fr $storage/V6_SuperCharger/services.jar.unsuper /system/framework/services.
jar
cp -fr $storage/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 $storage!"
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
showparlor=;showedparlor=yes;manualtransmit=;UnIScream=
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 -=zeppelin
rox=-
#
# When using scripting tricks, ideas, or code snippets from here, please give pr
oper credit.
# There are many things may look simple, but actually took a lot of time, trial,
and error to get perfected.
#
# This script can be used freely and can even be modified for PERSONAL USE ONLY.
# It can be freely incorporated into ROMs - provided that proper credit is given
WITH a link back to the XDA SuperCharger thread.
# If you want to share it or make a thread about it, just provide a link to the
main thread.
# - This ensures that users will always be getting the latest versions.
# Prohibited: Any modification (excluding personal use), repackaging, redistribu
tion, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
clear
line=================================================
echo ""
echo \$line
echo " -=SuperClean & ReStart=- by -=zeppelinrox=-"
echo \$line
echo ""
sleep 1
id=\$(id); id=\${id#*=}; id=\${id%%[\\( ]*}
if [ "\$id" != "0" ] && [ "\$id" != "root" ]; 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-*; 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 ""
sleep 1
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 $storage/V6_SuperCha
rger
cp -fr /data/V6_SuperCharger/!SuperClean.sh $storage/V6_SuperCha
rger/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 2>/dev/null
for cachedir in /*/dalvik-*; do rm -r $cachedir/
* 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 14 ] || [ "$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 14 ]; 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 2>/dev/n
ull
mount -o remount,ro / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 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

Vous aimerez peut-être aussi