Professional Documents
Culture Documents
V6 SuperCharger For Android-Update9 RC12-BlackDog-63457 Fix - SH
V6 SuperCharger For Android-Update9 RC12-BlackDog-63457 Fix - SH
/system/bin/sh
#
# V6 SuperCharger Update 9 RC12 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
#
PATH=$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin
if [ -d "/data/local/busybox*/xbin" ]; then PATH=$PATH:`ls -d /data/local/busybo
x*/xbin 2>/dev/null`; fi
line=================================================
echo ""
echo $line
echo ""
echo " Hey, Hey, Baby, SuperCharge Your Way..."
echo ""
sleep 1
echo "
...Watch Your Launcher Rip..."
echo ""
sleep 1
echo "
...Lags Keep Away!"
echo ""
sleep 1
echo $line
echo " NOTE: BUSYBOX v1.16.2 OR HIGHER IS RECOMMENDED!"
echo $line
echo ""
sleep 2
remount(){
mount -o remount,$1 / 2>/dev/null
mount -o remount,$1 rootfs 2>/dev/null
busybox mount -o remount,$1 / 2>/dev/null
busybox mount -o remount,$1 rootfs 2>/dev/null
mount -o remount,$1 /system 2>/dev/null
busybox mount -o remount,$1 /system 2>/dev/null
busybox mount -o remount,$1 $(busybox mount | awk '/system /{print $1,$3
}') 2>/dev/null
}
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
remount rw
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
storagename=`echo $storage | sed 's/.*mnt\|.*storage\|.*emulated\|.*legacy//g'`
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, you have init.d boot scripts working
and there are 3 reasons why this could happen:<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>. Also check /data/BootLog_SuperCharger.log and /dat
a/Ran_SuperCharger.log!<br>
2. You set Wheel Alignment or Fix Alignment to run on boot but you don't have th
e zipalign binary installed. Get it by installing the <a href="http://goo.gl/1JP
l8">SuperCharger Starter Kit</a>. Also check /data/BootLog_ZepAlign.log or /data
/BootLog_FixAlign.log!<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>. Also check /data/BootLog_Detailing.log!<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>
}
if [ ! -d "/sqlite_stmt_journals" ]; then FAIL=yes
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
fi
if [ "$madesqlitefolder" -eq 1 ]; then rm -r /sqlite_stmt_journals; fi 2>/dev/nu
ll
remount ro
echo $line
if [ "`echo $0 | grep "init\.d"`" ]; then sleep="sleep 4"
echo "
HAHAHAHAHAHAHAHA!!"
echo $line
echo ""
$sleep
echo " Why the hell is this in the init.d folder?!"
echo ""
$sleep
echo " This AIN'T a start up script... LOL!"
echo ""
$sleep
echo " Somebody should have read this help file..."
load_help_file
echo "
No SuperCharger For You!"
echo $line
echo ""
$sleep
exit 69
fi
echo "
Test Driving Your Android Device..."
echo $line
if [ ! "`busybox --help`" ]; then FAIL=yes; sleep="sleep 4"
echo ""
sleep 1
echo " BusyBox NOT FOUND..."
echo ""
$sleep
echo $line
echo "
...No Supe For You!!"
echo $line
echo ""
$sleep
echo " If you continue, problems can occur..."
echo ""
$sleep
echo "
...and even bootloops!"
echo ""
$sleep
echo " ...Please install BusyBox and try again..."
echo ""
$sleep
echo " Get BusyBox from the V6 SuperCharger Thread!"
echo ""
load_page qM6yR
echo $line
echo ""
$sleep
echo " I hope that helped! :^)"
echo ""
$sleep
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 $line
echo "
No SuperCharger For You!"
echo $line
echo ""
$sleep
exit 69;;
esac
else
sleep 2
if [ ! "`busybox --help | grep awk`" ]; then badbb=yes; echo " WARNING:
awk applet NOT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi
if [ ! "`busybox --help | grep sed`" ]; then badbb=yes; echo " WARNING:
sed applet NOT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi
if [ ! "`busybox --help | grep pgrep`" ]; then badbb=yes; echo " WARNING
: pgrep applet NOT FOUND... Bad BusyBox!"; echo $line; sleep 2; fi
if [ "$badbb" ]; then FAIL=yes; sleep="sleep 4"
echo ""
echo " Your BusyBox is an EPIC FAIL... :p"
echo ""
$sleep
echo " It's version does NOT even matter because..."
echo ""
$sleep
echo $line
echo "
It's MISSING basic applets and functions!"
echo $line
echo ""
$sleep
echo " If you continue, problems can occur..."
echo ""
$sleep
echo "
...and even bootloops!"
echo ""
$sleep
echo " ...Please reinstall BusyBox and try again..."
echo ""
$sleep
echo " Get BusyBox from the V6 SuperCharger Thread!"
echo ""
$sleep
echo $line
echo " And DON'T play stupid and ask me what's wrong!!"
load_page qM6yR
echo $line
echo ""
$sleep
echo " I hope that helped! :^)"
echo ""
$sleep
fi
test1=`busybox | awk 'NR==1{print $1}'`
test2=`busybox | awk 'NR==1{print $2}'`
test3=`echo 1000,2000,3000,4000,5000,6000 | awk -F , '{OFMT="%.0f";print
$1/256, $2/256, $3/256, $4/256, $5/256, $6/256}'`
echo ""
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; sleep="sleep 4"
echo " BusyBox has holes in it..."
echo ""
$sleep
echo " ...BulletProof Apps ain't gonna work..."
echo ""
$sleep
echo $line
echo "
...pgrep test FAILED!"
echo $line
fi
else FAIL=yes; sleep="sleep 4"
echo " There was an AWK error..."
echo ""
$sleep
echo $line
echo "
...what the AWK!?"
echo $line
echo ""
$sleep
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
fi
echo " If you continue, problems can occur..."
echo ""
$sleep
echo "
...and even bootloops!"
echo ""
$sleep
fi
load_options(){
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`
if [ -f "/data/99SuperCharger.sh" ]; then panicmode=`grep "^panicmode="
/data/99SuperCharger.sh | sed 's/[^0-9]//g'`
else panicmode=`awk -F , '{print $6}' /data/V6_SuperCharger/SuperCharger
Options`
fi
if [ -f "/data/99SuperCharger.sh" ]; then pyness=`grep "^pyness=" /data/
99SuperCharger.sh | sed 's/[^0-9]//g'`
else pyness=`awk -F , '{print $7}' /data/V6_SuperCharger/SuperChargerOpt
ions`
fi
propaccessories=`awk -F , '{print $8}' /data/V6_SuperCharger/SuperCharge
rOptions`
if [ -f "/data/99SuperCharger.sh" ]; then tc3g=`grep "^TCE=" /data/99Sup
erCharger.sh | sed 's/[^0-9]//g'`
else tc3g=`awk -F , '{print $9}' /data/V6_SuperCharger/SuperChargerOptio
ns`
fi
if [ -f "/data/99SuperCharger.sh" ]; then sdtweak=`grep "^sdtweak=" /dat
a/99SuperCharger.sh | sed 's/[^0-9]//g'`
else sdtweak=`awk -F , '{print $10}' /data/V6_SuperCharger/SuperChargerO
ptions`
fi
if [ -f "/data/97BulletProof_Apps.sh" ]; then bpwait=`grep "^bpwait=" /d
ata/97BulletProof_Apps.sh | sed 's/[^0-9]//g'`
else bpwait=`awk -F , '{print $11}' /data/V6_SuperCharger/SuperChargerOp
tions`
fi
if [ -f "/data/V6_SuperCharger/!Detailing.sh" ]; then detailinterval=`gr
ep "^detailinterval=" /data/V6_SuperCharger/!Detailing.sh | sed 's/[^0-9]//g'`
else detailinterval=`awk -F , '{print $12}' /data/V6_SuperCharger/SuperC
hargerOptions`
fi
if [ -f "/data/V6_SuperCharger/!WheelAlignment.sh" ]; then zepalign=`gre
p "^bootzepalign=" /data/V6_SuperCharger/!WheelAlignment.sh | sed 's/[^0-9]//g'`
else zepalign=`awk -F , '{print $13}' /data/V6_SuperCharger/SuperCharger
Options`
fi
if [ -f "/data/V6_SuperCharger/!FixEmissions.sh" ]; then fixemissions=`g
rep "^bootfixemissions=" /data/V6_SuperCharger/!FixEmissions.sh | sed 's/[^0-9]/
/g'`
else fixemissions=`awk -F , '{print $14}' /data/V6_SuperCharger/SuperCha
rgerOptions`
fi
if [ -f "/data/V6_SuperCharger/!FixAlignment.sh" ]; then fixalign=`grep
"^bootfixalign=" /data/V6_SuperCharger/!FixAlignment.sh | sed 's/[^0-9]//g'`
else fixalign=`awk -F , '{print $15}' /data/V6_SuperCharger/SuperCharger
Options`
fi
if [ -f "/data/V6_SuperCharger/!FastEngineFlush.sh" ]; then flushOmaticH
ours=`grep "^flushOmaticHours=" /data/V6_SuperCharger/!FastEngineFlush.sh | sed
's/[^\.0-9]//g'`
else flushOmaticHours=`awk -F , '{print $16}' /data/V6_SuperCharger/Supe
rChargerOptions`
fi
if [ ! "`awk -F , '{print $16}' /data/V6_SuperCharger/SuperChargerOption
s`" ]; then missingoptions=yes; animation=1; fi
sleep="sleep $speed"
if [ "$buildprop" -eq 1 ]; then prop="/system/build.prop"
else prop="/data/local.prop"
fi
default_options_check
if [ "$panicmode" -eq 3 ]; then kpanic=0; kpoops=0
elif [ "$panicmode" -eq 2 ]; then kpanic=30; kpoops=0
else kpanic=30; kpoops=1
fi
}
default_options_check(){
if [ ! "$sleep" ]; then sleep="sleep 2"; fi
if [ ! "$launcheradj" ]; then launcheradj=1; fi
if [ ! "$panicmode" ]; then panicmode=1; kpanic=30; kpoops=1; fi
if [ ! "$pyness" ]; then pyness=1; fi
if [ ! "$propaccessories" ]; then propaccessories=0; fi
if [ ! "$tc3g" ]; then tc3g=0; fi
if [ ! "$sdtweak" ] || [ "`echo $sdtweak | grep "[^0-9]"`" ] || [ "$sdtw
eak" -lt 64 ] && [ "$sdtweak" != 0 ]; then sdtweak=$(((ram/64+1)*128)); fi
if [ ! -f "/data/V6_SuperCharger/BulletProof_Apps_HitList" ] && [ ! "`gr
ep "BulletProofing" /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh`" ]; th
en bpwait=0
elif [ ! "$bpwait" ] || [ "`echo $bpwait | grep "[^0-9]"`" ]; then bpwai
t=30
fi 2>/dev/null
if [ ! "$detailinterval" ] || [ "`echo $detailinterval | grep "[^0-9]"`"
] || [ "$detailinterval" -gt 9 ]; then detailinterval=3; fi
if [ ! "$zepalign" ]; then zepalign=0; fi
if [ ! "$fixemissions" ]; then fixemissions=0; fi
if [ ! "$fixalign" ]; then fixalign=0; fi
if [ ! "$flushOmaticHours" ] || [ "`echo $flushOmaticHours | grep "[^\.0
-9]"`" ] || [ "`echo $flushOmaticHours | awk '$1>24'`" ]; then flushOmaticHours=
0
else flushOmaticHours=`echo $flushOmaticHours | awk '{print $1*1}'`
fi
}
if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; then load_options
else firstgear=yes; autoshowcalculated=yes; default_options_check
fi 2>/dev/null
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
echo " NOTE: BUSYBOX v1.16.2 OR HIGHER IS RECOMMENDED!"
echo $line
echo ""
sleep 2
fi
if [ "$smrun" ]; then echo " Touch the screen to bring up soft keyboard"
else echo " Try Script Manager... it's easier!"
fi
echo ""
echo $line
echo ""
$sleep
echo " Additional BusyBox Info:"
echo ""
$sleep
echo " $bbversion"
echo " `busybox | awk -F \( 'NR==1{print "("$2}'`"
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!"; echo ""
else
echo $line
echo -n " WARNING! Your BusyBox is "
if [ "$bbversion" \> "BusyBox v1.18.2" ] && [ "$bbversion" \< "BusyBox v
1.19.0" ]; then
he..."
echo ""
$sleep
echo $line
echo "
\\\\\\\\ Super Smart Script Re-Generat
or ////"
echo "
=====================================
=="
echo ""
$sleep
didtitle=yes
fi
if [ "$1" ] || [ ! "`grep $ver "$regen"`" ]; then
if [ "`echo "$regen" | grep "1Shot"`" ]; then
if [ ! "$did1shottitle" ]; then
echo $line
echo " Re-Generating BulletProof
One-Shot Scripts!"
echo $line
did1shottitle=yes
fi
echo " Re-Generating `basename "$regen"`
..."
Re_Generate_BulletProof_1Shot "`basename
"$regen" .sh | sed 's/.*-//'`"
elif [ "`echo "$regen" | grep "PowerShift"`" ];
then
if [ ! "$didshifttitle" ]; then
echo $line
echo " Re-Generating PowerShift
Scripts!"
echo $line
didshifttitle=yes
fi
echo " Re-Generating `basename "$regen"`
..."
Re_Generate_PowerShift_Script "`basename
"$regen"`"
else
echo " Re-Generating `basename "$regen"`
..."
Re_Generate_"`basename "$regen" .sh | se
d 's/\!//'`" echo
fi
$sleep
fi
fi
done
else
oomadj1=`awk -F , '{print $1}' $adjfile`;oomadj2=`awk -F , '{pri
nt $2}' $adjfile`;oomadj3=`awk -F , '{print $3}' $adjfile`;oomadj4=`awk -F , '{p
rint $4}' $adjfile`;oomadj5=`awk -F , '{print $5}' $adjfile`;oomadj6=`awk -F , '
{print $6}' $adjfile`
currentadj=`cat $adjfile`
fi
}
get_launcher_status(){
for launchers in `grep set.*/*.Launcher /d*/system/packages.xml | sed 's
:/*.L.*::' | sed 's/.*="//'` `grep "package name" /d*/system/packages.xml | grep
-E "adwfreak|zeam|tw3|tw4|tw5|nextgen|shell|home|trebuchet|launcher" | sed 's/.
* name="\|".*//g'` adwfreak zeam tw3 tw4 tw5 nextgen shell home trebuchet launch
er acore; do
validlauncher=`pgrep -l $launchers | awk '{print $2}' | grep -Ev
"/|notification|gowidget|downloadservice"` 2>/dev/null
if [ "$validlauncher" ] && [ ! "`echo $llist | grep $validlaunch
er`" ]; 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" -le -1000 ]; then loom_adj=-16
elif [ "$loom_adj" -ge 1000 ]; then loom_adj=15
elif [ "${loom_adj#-}" -gt 20 ]; then loom_adj=`echo $loom_adj |
awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$l" = "android.process.acore" ] && [ "$loom_adj" -lt 0 ];
then continue
elif [ ! "$HL" ] || [ "$HL" -gt "$loom_adj" ]; then
if [ "$lname" ] && [ "$lname" != "android.process.acore"
] && [ "$l" = "android.process.acore" ] && [ "$1" ]; then
echo ""
$sleep
echo " Erm... Is $lname the launcher?"
echo ""
$sleep
echo -n " Enter N for No, any key for Yes: "
read islauncher
echo ""
echo $line
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
adjs1=0; adjs3=0; adjs5=0; adjs6=0; adjs7=0
if [ -f "/system/framework/services.odex" ]; then odex=yes; fi
for i in `busybox ps | grep -v ] | awk '{print $1}'`; do
if [ -f "/proc/$i/$oom_adj" ]; then
adj=`cat /proc/$i/$oom_adj`
if [ "$adj" -le -1000 ]; then adj=-16
elif [ "$adj" -ge 1000 ]; then adj=15
ADJ=5
elif [ "$slot" ]; then SSADJ=$adj3
fi
if [ "$slot" ] && [ "$SL3" -gt 0 ]; then SSMF=$SL3
elif [ "$scminfree" ]; then SSMF=`echo $scminfree | awk -F , '{print $3}
'`
else SSMF=`awk -F , '{print $3}' $minfreefile`
fi
MFK=$(($SSMF*4/5))
}
info_free_space_error(){
echo $line
echo " WARNING: Copy ERROR to $1/$2!"
echo $line
if [ ! "$3" ]; then
echo ""
$sleep
echo " Got enough free space?"
echo ""
$sleep
echo " System Partition has `busybox df -h | awk '/% \/system$/{
print $(NF-2),"Free ("$(NF-1)" Used)"}'`"
fi
}
info_ADJs_no_worky(){
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
}
info_missing_binary(){
echo " Doh... $1 binary was NOT found..."
echo ""
$sleep
echo $line
echo "
...No $2 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 ""
load_page qM6yR
}
info_build_prop(){
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
}
info_launcher_warning(){
echo "
======================================="
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 "
...or don't know what it is..."
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!"
}
info_bb_no_nohup(){
echo " Oh wait... you don't have either busybox..."
echo ""
$sleep
echo "
...\"nohup\" or \"start-stop-daemon\" applets!"
echo ""
$sleep
echo " If I run it for you right now..."
echo ""
$sleep
echo "
...you can't be returned to this script!"
echo ""
$sleep
echo " So just do it yourself... haha... oh and..."
echo ""
$sleep
echo $line
################################
# 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: "grep -h [S]uper /proc/*/cmdline".
# The output would be "/data/99SuperCharger.sh".
#
# Similar results can be had with: "busybox ps | grep [S]uper".
#
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
}
install_bp_service(){
if [ "$1" ]; then
echo " Installing BulletProof Apps Service to..."
echo $line
echo ""
$sleep
fi
for bps in $initrcpath $allrcpaths; do
sed -i '/BulletProof_Apps_Service/,/BulletProofed_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: "grep -h [B]ullet /proc/*/cmdline".
# The output would be 2 items:
#
a. "/data/97BulletProof_Apps.sh"
#
b. "BulletProof_Apps_is_In_Effect!" (sleep message)
#
# Similar results can be had with: "busybox ps | grep [B]ullet".
#
...$bp
echo ""
$sleep
echo "
echo ""
$sleep
}
blurb_BulletProof_Apps(){
echo " This feature attempts to lock apps in memory!"
echo ""
$sleep
echo " Use it only for apps that..."
echo ""
$sleep
echo "
...you NEED to keep running all the time."
echo ""
echo $line
echo ""
$sleep
}
blurb_Detailing(){
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
}
blurb_WheelAlignment(){
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
}
blurb_FixEmissions(){
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
}
blurb_FixAlignment(){
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
}
blurb_FastEngineFlush(){
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 ""
$sleep
echo $line
echo " This Engine Flush will give you a Quick Boost!"
echo $line
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 ""
}
blurb_unsupercharge(){
echo " Out Of Memory (OOM) Groupings UnFixed..."
echo ""
$sleep
echo "
...OOM Priorities UnFixed..."
echo ""
$sleep
echo "
Weak Ass Launcher Restored :("
echo ""
$sleep
echo $line
echo "
UnSuperCharging Complete!"
echo $line
echo ""
$sleep
}
Configure_BulletProof_Apps(){
echo " Current Status..."
echo ""
$sleep
echo $line
if [ "$bpwait" -gt 0 ]; then echo " BulletProof Apps is ON @ $bpwait sec
ond intervals!"
else echo " BulletProof Apps is Currently OFF!"
fi
echo $line
echo ""
$sleep
echo " Change BulletProof Apps Options?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo $line
case $changeoptions in
y|Y)echo ""
$sleep
echo " You can turn BulletProof Apps on or off..."
echo ""
$sleep
echo "
...or just change how often it runs ;^]"
echo ""
$sleep
echo $line
echo " You can also configure this within the script!"
echo $line
echo ""
$sleep
echo " Note that if enabled, the script will exit..."
echo ""
$sleep
echo " ...if you haven't BulletProofed any apps ;^]"
echo ""
$sleep
if [ -d "/system/etc/init.d" ]; then
echo " Also note that when it's enabled..."
echo ""
$sleep
echo $line
echo " BulletProof Apps on boot is AUTOMAGIC!"
echo $line
echo ""
$sleep
echo " Just check /data/BootLog_BulletProof_Apps.log!"
echo ""
$sleep
fi
echo " Enable BulletProof Apps?"
echo " ========================"
while :; do
echo ""
$sleep
echo -n " Enter E to Enable, D to Disable: "
read bullet
echo ""
echo $line
case $bullet in
e|E)if [ ! -f "/data/97BulletProof_Apps.sh" ]; then
echo " BulletProof Apps has to run once
from the menu!"
echo $line
echo ""
$sleep
echo $line
fi
echo ""
$sleep
echo " How often do you want to BulletProof Ap
ps?"
echo ""
$sleep
echo " Note that values are in seconds..."
echo ""
$sleep
echo " Too low a value may suck battery faster
than..."
echo ""
$sleep
echo "
roid...."
echo ""
$sleep
echo "
...so don't b
e a nut!"
echo ""
$sleep
echo " btw 14s is likely the lowest you should
go..."
echo ""
$sleep
echo "
14s ;^]"
while :; do
echo ""
$sleep
echo -n " Enter any whole number (no dec
imals) over 0: "
read bpwait
echo ""
echo $line
if [ "$bpwait" ] && [ "`echo $bpwait | g
rep -v "[^0-9]"`" ] && [ "$bpwait" -gt 0 ]; then
echo " BulletProof Apps Set To R
un Every $bpwait seconds!"
break 2
fi
echo "
Invalid entry... Please try
again :p"
echo $line
done;;
d|D)bpwait=0
echo "
BulletProof Apps DISABLED!!"
break;;
*)echo "
Invalid entry... Please try again
:p"
echo $line;;
esac
done
update_options_in_scripts bulletproof
update_options;;
*)echo "
No Change For You!";;
esac
}
Configure_Detailing(){
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 [ "$detailinterval" -eq 0 ]; then echo "DOES NOT Run On Boot!"
else echo "Runs Every $detailinterval Boots!"
fi
echo $line
echo ""
$sleep
echo " Change Detailing Options?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo $line
case $changeoptions in
y|Y)echo " You can also configure this within the script!"
echo $line
echo ""
$sleep
echo " Run Detailing on boot?"
echo " ======================"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read bootdetailing
echo ""
echo $line
case $bootdetailing in
y|Y)if [ ! -f "/data/V6_SuperCharger/!Detailing.sh" ]; t
hen
echo " Detailing has to run once from th
e menu!"
echo $line
echo ""
$sleep
fi
while :; do
echo ""
$sleep
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"
echo $line;;
esac
done;;
*)detailinterval=0
echo "
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo $line
case $changeoptions in
y|Y)echo " You can also configure this within the script!"
echo $line
echo ""
$sleep
echo " Run Wheel Alignment on boot?"
echo " ============================"
echo ""
$sleep
echo " Note: If you say Yes, Fix Alignment On Boot..."
echo "
...gets disabled (avoids overlapping mods)"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read bootzepalign
echo ""
echo $line
case $bootzepalign in
y|Y)zepalign=1; fixalign=0
if [ ! -f "/data/V6_SuperCharger/!WheelAlignment
.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 Boot!
";;
*)zepalign=0
echo "
Boot Align Declined... does that rhym
e?";;
esac
update_options_in_scripts zepalign
update_options_in_scripts fixalign
update_options;;
*)echo "
No Change For You!";;
esac
}
Configure_FixEmissions(){
echo $line
echo -n " Status: Fix Emissions "
if [ "$fixemissions" -eq 1 ]; then echo "DOES Run On Boot!"
else echo "DOES NOT Run On Boot!"
fi
echo $line
echo ""
$sleep
echo " Change Fix Emissions Options?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo $line
case $changeoptions in
y|Y)echo " You can also configure this within the script!"
echo $line
echo ""
$sleep
echo " Run Fix Emissions on boot?"
echo " =========================="
echo ""
$sleep
echo " Note: If you say Yes, Fix Alignment On Boot..."
echo "
...gets disabled (avoids overlapping mods)"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read bootfixemissions
echo ""
echo $line
case $bootfixemissions in
y|Y)fixemissions=1; fixalign=0
if [ ! -f "/data/V6_SuperCharger/!FixEmissions.s
h" ]; 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!";;
esac
update_options_in_scripts fixfc
update_options_in_scripts fixalign
update_options;;
*)echo "
No Change For You!";;
esac
}
Configure_FixAlignment(){
echo $line
echo -n " Status: Fix Alignment "
if [ "$fixalign" -eq 1 ]; then echo "DOES Run On Boot!"
else echo "DOES NOT Run On Boot!"
fi
echo $line
echo ""
$sleep
echo " Change Fix Alignment Options?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo $line
case $changeoptions in
y|Y)echo " You can also configure this within the script!"
echo $line
echo ""
$sleep
echo " Run Fix Alignment on boot?"
echo " =========================="
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 [ ! -f "/data/V6_SuperCharger/!FixAlignment.s
h" ]; then
echo " Fix Alignment has to run once fro
m the menu!"
echo $line
echo ""
$sleep
echo $line
fi
echo "
*)fixalign=0
echo "
;;
yme?";;
esac
update_options_in_scripts zepalign
update_options_in_scripts fixfc
update_options_in_scripts fixalign
update_options;;
*)echo "
No Change For You!";;
esac
}
Configure_FastEngineFlush(){
echo " Current Status..."
echo ""
$sleep
echo $line
if [ "`echo $flushOmaticHours | awk '$1>0'`" ]; then echo " Engine Flush
-O-Matic is ON @ $flushOmaticHours hr intervals!"
else echo " Engine Flush-O-Matic is Currently OFF!"
fi
echo $line
echo ""
$sleep
echo " Change Engine Flush-O-Matic Options?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo $line
case $changeoptions in
y|Y)echo ""
$sleep
echo " You can turn Engine Flush-O-Matic on or off..."
echo ""
$sleep
echo "
...or just change how often it runs ;^]"
echo ""
$sleep
echo $line
echo " You can also configure this within the script!"
echo $line
echo ""
$sleep
echo " Note that if enabled, caches are dumped..."
echo ""
$sleep
echo "
...only when the screen is off!"
echo ""
$sleep
echo " This is cuz you don't want your device to..."
echo ""
$sleep
echo " ...take a big dump and flush..."
echo ""
$sleep
echo "
...when you're taking care of business!"
echo ""
$sleep
if [ -d "/system/etc/init.d" ]; then
echo " Also note that when it's enabled..."
echo ""
$sleep
echo $line
echo " -=Engine Flush-O-Matic=- on boot is AUTOMAGIC!"
echo $line
echo ""
$sleep
echo " If disabled, it will Flush once after boot up!"
echo ""
$sleep
echo " Just check /data/BootLog_FastEngineFlush.log!"
echo ""
$sleep
fi
echo " Enable Engine Flush-O-Matic?"
echo " ============================"
while :; do
echo ""
$sleep
echo -n " Enter E to Enable, D to Disable: "
read able
echo ""
echo $line
case $able in
e|E)if [ ! -f "/data/V6_SuperCharger/!FastEngineFlush.
sh" ]; then
!"
echo $line
echo ""
$sleep
echo " Note that you CAN enter a decimal value
!"
echo ""
$sleep
echo " ie. \".1\"=6 mins, \".25\"=15 mins, \"2
.5\"=2.5 hrs"
echo ""
$sleep
echo " Low values like .1 MAY benefit Gamers..
. ? :P"
echo ""
$sleep
echo " How often do you want it to flush?"
while :; do
echo ""
$sleep
echo -n " Enter a value from 1 to 24 (ho
urs): "
read
echo
echo
if [
flushOmaticHours | grep -v "[^\.0-9]"`" ] &&
1<=24'`" ]; then
flushOmaticHours
""
$line
"$flushOmaticHours" ] && [ "`echo $
[ "`echo $flushOmaticHours | awk '$
flushOmaticHours=`echo $flushOma
again :p"
echo $line
done;;
d|D)flushOmaticHours=0
echo "
-=Engine Flush-O-Matic=- DISABLED
!!"
break;;
*)echo "
:p"
echo $line;;
esac
done
update_options_in_scripts flush
update_options;;
*)echo "
No Change For You!";;
esac
}
Re_Generate_99SuperCharger(){
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=#
EOF
terms $sc
cat >> $sc <<EOF
# 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
#
# Note: To customize the SD Card read ahead cache, change the "sdtweak" variable
to the number of KB you want.
#
Valid values are from 64 and above.
#
If 0, the tweak is disabled.
#
If the value is invalid or missing, it defaults to using a value based o
n the device's RAM.
#
Example: If you want it to be 512 KB, make the line read "sdtweak=512;".
#
EOF
if [ "$sc" = "/data/99SuperCharger.sh" ]; then cat >> $s
c <<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: "grep -h [S]uper /proc/*/cmdline".
# The output would be "/data/99SuperCharger.sh".
#
# Similar results can be had with: "busybox ps | grep [S]uper".
#
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
# For debugging, delete the # at the beginning of the following 2 lines, and che
ck /data/Debug_SuperCharger.log file to see what may have fubarred.
# set -x;
# exec > /data/Debug_SuperCharger.log 2>&1;
#
PATH=\$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin;
if [ -d "/data/local/busybox*/xbin" ]; then PATH=\$PATH:\`ls -d /data/local/busy
box*/xbin 2>/dev/null\`; fi;
line=================================================;
busybox mount -o remount,rw /data 2>/dev/null;
mount -o remount,rw /data 2>/dev/null;
LOG_FILE=/data/Ran_SuperCharger.log;
bootloopcookie=/data/!!SuperChargerBootLoopMessage.log;
if [ -t 0 ]; then interactive=yes; fi;
if [ -f "\$bootloopcookie" ]; then
if [ "\`echo \$0 | grep -v "init\.d"\`" ]; then stop super_service;
else echo " \$( date +"%m-%d-%Y %H:%M:%S" ): \$0 Detected A BootLooped..
. ABORTING..." >> \$LOG_FILE;
fi;
exit 69;
elif [ "\`echo \$0 | grep "init\.d"\`" ] && [ ! "\$interactive" ]; then echo " D
elete this file to Re-Enable *99SuperCharger to run on boot..." > \$bootloopcook
ie;
fi;
ram=\$((\`free | awk '/Mem:/{print \$2}'\`/1024));
# To set the next line manually, see comments at the top for instuctions!
sdtweak=$sdtweak;
if [ ! "\$sdtweak" ] || [ "\`echo \$sdtweak | grep "[^0-9]"\`" ] || [ "\$sdtweak
" -lt 64 ] && [ "\$sdtweak" != 0 ]; then sdtweak=\$(((ram/64+1)*128)); fi;
# On the next line, "TCE=0;" will disable 3G TurboCharger Enhancement. Anything
else enables it.
TCE=$tc3g;
# On the next line, "panicmode=0;" will disable the kernel panic settings. Anyth
ing else enables them.
panicmode=$panicmode;
# On the next line, "pyness=0;" will disable the Entropy-ness Enlarger. Anything
else enables it.
pyness=$pyness;
MFK=$MFK
StartMeUp(){
echo "";
echo \$line;
echo " The -=V6 SuperCharger=- by -=zeppelinrox=-";
echo \$line;
echo "";
echo " Version: $ver";
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
echo
echo
echo
if [
rger\`; do
if [ "\$j" ]; then break; fi;
j=\$i;
done;
if [ "\`echo \$j | grep KickAssKernel\`" ] && [ "\$i" \\< "99Sup
erCharger" ] || [ "\$j" \\< "99SuperCharger" ]; then desiredname="/system/etc/in
it.d/99SuperCharger";
elif [ "\`echo \$j | grep KickAssKernel\`" ] && [ "\$i" \\< "S99
SuperCharger" ] || [ "\$j" \\< "S99SuperCharger" ]; then desiredname="/system/et
c/init.d/S99SuperCharger";
else desiredname="/system/etc/init.d/SS99SuperCharger";
fi;
fi;
};
remount(){
mount -o remount,\$1 /system 2>/dev/null;
busybox mount -o remount,\$1 /system 2>/dev/null;
busybox mount -o remount,\$1 \$(busybox mount | awk '/system /{print \$1
,\$3}') 2>/dev/null;
};
install(){
remount rw
for i in /system/etc/init.d/*; do
if [ -f "\$i" ]; then
if [ "\`grep "lowmemorykiller" "\$i"\`" ] && [ "\`echo "
\$i" | grep -Ev "SuperCharger|super|disabled"\`" ]; then
sed -i '1 a\\
#\\
# SuperCharger script disabled this script for additional optimization.\\
# To Re-Enable this script, delete the lowmemorykiller stuff in here and rename
this file.\\
#' "\$i";
mv "\$i" "\$i.disabled_due_to_lowmemorykiller Re
ad_Comment_Inside_For_Fix";
fi;
if [ "\`echo "\$i" | grep "oopy" | grep -v "zzloopy"\`"
]; then
sed -i '1 a\\
#\\
# Hey you should try BulletProofing Apps from within V6 SuperCharger instead!\\
#' "\$i";
mv "\$i" /system/etc/init.d/zzloopy_runs_last_so
_others_do_too;
fi;
fi;
done
if [ ! -f "\$1" ] && [ ! "\`grep \$ver "\$1"\`" ]; then
echo \$line;
echo "";
echo " Installing myself to \${1#*etc}";
echo "";
sleep 2;
dd if=\$0 of=\$1;
chown 0.0 \$1; chmod 777 \$1;
elif [ "\`echo \$1 | grep xbin\`" ]; then
echo \$line;
echo "";
echo " \$1 is already up to date...";
sleep 2;
fi 2>/dev/null;
if [ "\`echo \$1 | grep xbin\`" ]; then
echo "";
echo " To run, type in Terminal: \"su -c \${1##*/}\"";
sleep 2;
fi;
remount ro;
};
Smart_Rename(){
remount rw;
echo \$line;
echo "";
echo " SuperCharger to run on boot as...";
echo "";
echo \$line;
echo "
...\$desiredname!";
if [ "\$0" != "\$desiredname" ]; then
mv \$0 \$desiredname;
rm \$bootloopcookie;
\$desiredname & exit 0;
fi 2>/dev/null;
echo \$line;
echo "";
remount ro;
};
EOF
else cat >> $sc <<EOF
# DO NOT DELETE COMMENTS. DELETING COMMENTS WILL BREAK UNINSTALL ROUTINE!
#
PATH=\$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin;
if [ -d "/data/local/busybox*/xbin" ]; then PATH=\$PATH:\`ls -d /data/local/busy
box*/xbin 2>/dev/null\`; fi;
line=================================================;
busybox mount -o remount,rw /data 2>/dev/null;
mount -o remount,rw /data 2>/dev/null;
if [ -t 0 ]; then interactive=yes; fi;
ram=\$((\`free | awk '/Mem:/{print \$2}'\`/1024));
# To set the next line manually, see comments at the top for instuctions!
sdtweak=$sdtweak;
if [ ! "\$sdtweak" ] || [ "\`echo \$sdtweak | grep "[^0-9]"\`" ] || [ "\$sdtweak
" -lt 64 ] && [ "\$sdtweak" != 0 ]; then sdtweak=\$(((ram/64+1)*128)); fi;
# On the next line, "TCE=0;" will disable 3G TurboCharger Enhancement. Anything
else enables it.
TCE=$tc3g;
# On the next line, "panicmode=0;" will disable the kernel panic settings. Anyth
ing else enables them.
panicmode=$panicmode;
# On the next line, "pyness=0;" will disable the Entropy-ness Enlarger. Anything
else enables it.
pyness=$pyness;
MFK=$MFK
echo "";
EOF
fi
cat >> $sc <<EOF
KVM_Tweaks(){
if [ "\`cat /proc/sys/vm/min_free_kbytes\`" -ne \$MFK ]; then
####################################
# Kernel & Virtual Memory Tweaks #
####################################
echo \$line;
echo " Applying Kernel & Virtual Memory Tweaks...";
echo \$line;
echo -n "
";busybox sysctl -w vm.min_free_kby
tes=\$MFK;
echo -n "
";busybox sysctl -w vm.oom_kill_allocating_t
ask=0;
echo -n "
";busybox sysctl -w vm.panic_on_
oom=0;
echo -n "
";busybox sysctl -w vm.vfs_cache_press
ure=10;
echo -n "
";busybox sysctl -w vm.overcommit_mem
ory=1;
echo -n "
";busybox sysctl -w vm.swappin
ess=20;
if [ "\$panicmode" != 0 ]; then
echo -n "
";busybox sysctl -w kernel.pa
nic_on_oops=$kpoops;
echo -n "
";busybox sysctl -w k
ernel.panic=$kpanic;
fi;
if [ "\$pyness" != 0 ]; then
echo -n " ";busybox sysctl -w kernel.random.write_wakeu
p_threshold=128;
echo -n " ";busybox sysctl -w kernel.random.read_wakeu
p_threshold=1376; # Entropy-ness Enlarger - keeps entropy_avail full - MAY save
battery and/or boost responsiveness
fi;
echo "";
if [ -e "/dev/frandom" ]; then
echo \$line;
echo " Applying -=The Fentropy enForcer=-...";
echo \$line;
echo "";
chmod 666 /dev/frandom;
for dom in /dev/*random; do
if [ "\$dom" != "/dev/frandom" ] && [ ! "\`ls \$
dom.*\`" ]; then
mv \$dom \$dom.unsuper;
ln /dev/frandom \$dom;
chmod 666 \$dom;
fi 2>/dev/null;
done;
fi;
fi;
};
TCE(){
if [ "\`cat /proc/sys/net/core/rmem_max\`" -ne 1048576 ] && [ "\$TCE" !=
0 ]; then
##################################
# 3G TurboCharger Enhancement! #
##################################
echo \$line;
echo " Applying 3G TurboCharger Enhancement...";
echo \$line;
echo -n "
";busybox sysctl -w net.core.wmem_max=10485
76;
echo -n "
echo -n "
76;
;
echo -n
# Be sure
echo -n
echo -n
echo -n
echo -n
0 1048576';
echo -n "
0 1048576';
echo "";
fi;
};
SD_Speed(){
if [ "\`cat /sys/block/mmcblk0/bdi/read_ahead_kb\`" -ne \$sdtweak ] && [
"\$sdtweak" != 0 ]; then
#########################
# SD Read Speed Tweak #
#########################
echo \$line;
echo " Applying SD Read Speed Tweak...";
echo \$line;
if [ "\`ls /sys/devices/virtual/bdi/179*/read_ahead_kb\`" ]; the
n
for i in /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/nul
l;
echo \$sdtweak > /sys/block/mmcblk0/queue/read_ahead_kb 2>/dev/n
ull;
echo "";
fi;
};
SuperCharge(){
applyscminfree=; applyscadj=;
currentadj=\`cat /sys/module/lowmemorykiller/parameters/adj\` 2>/dev/nul
l;
currentminfree=\`cat /sys/module/lowmemorykiller/parameters/minfree\` 2>
/dev/null;
scadj=\`cat /data/V6_SuperCharger/SuperChargerAdj\`;
scminfree=\`cat /data/V6_SuperCharger/SuperChargerMinfree\`;
if [ "\$scminfree" ] && [ "\$currentminfree" != "\$scminfree" ]; then ap
plyscminfree=yes; fi;
if [ "\$scadj" ] && [ "\$currentadj" != "\$scadj" ]; then applyscadj=yes
; fi;
echo \$line;
if [ "\$applyscminfree" ] || [ "\$applyscadj" ]; then
###########################
echo "
echo "";
echo "
echo "";
sleep 120;
fi;
OhYeah;
if [ "\`echo \$0 | grep "init\.d"\`" ] && [ ! "\$interactive" ]; then
echo \$line;
echo "";
echo " Oh what the heck...";
echo "";
echo " ...Some kernels and apps are very stubborn...";
echo "";
echo "
...but NOT more than me...";
echo "";
echo "
...so in 6 mintues... if need be...";
echo "";
echo " ...I'm goin' for three! zooM... zoOM... zOOM!";
echo "";
sleep 360;
SuperCharge;
fi;
echo \$line;
echo "";
echo " \$0 Executed...";
echo "";
echo "
===========================";
echo "
) SuperCharge Complete! (";
echo "
===========================";
echo "";
if [ -d "/system/etc/init.d" ] && [ "\`echo \$0 | grep -v "init\.d"\`" ]
; then install \$desiredname; echo ""; fi;
if [ "\`echo \$0 | grep -v xbin\`" ]; then install /system/xbin/99super;
echo ""; fi;
if [ "\`echo \$0 | grep -v "init\.d"\`" ]; then stop super_service; fi;
};
if [ ! "\`ps | grep -m 1 [a]ndroid\`" ]; then exec > /data/BootLog_SuperCharger.
log 2>&1; fi;
StartMeUp;
if [ "\`echo \$0 | grep "init\.d"\`" ] && [ ! "\$interactive" ]; then Smart_Rena
me; OhYeah; fi;
if [ "\`ps | grep -m 1 [a]ndroid\`" ]; then HellzYeah;
else HellzYeah &
fi;
exit 0;
EOF
else cat >> $sc <<EOF
HellzYeah(){
KVM_Tweaks;
TCE;
SD_Speed;
SuperCharge;
echo \$line;
echo "";
echo " \$0 Executed...";
echo "";
};
HellzYeah &
EOF
fi
echo "# End of V6 SuperCharged Entries." >> $sc
if [ "$initrc" -eq 1 ]; then integrate_initrc $sc; fi
fi
done 2>/dev/null
chown 0.0 /data/99SuperCharger.sh; chmod 777 /data/99SuperCharger.sh
cp -fr /data/99SuperCharger.sh $storage/V6_SuperCharger/data
cp -fr /data/99SuperCharger.sh /system/xbin/99super
cp -fr /data/99SuperCharger.sh $storage/V6_SuperCharger/system/xbin/99su
per
if [ "$1" ]; then echo " Re-Generating /system/xbin/99super..."
if [ ! -f "/system/xbin/99super" ] || [ "`diff /data/99SuperChar
ger.sh /system/xbin/99super`" ]; then
checkedspace=yes
info_free_space_error /system/xbin 99super slim
fi
fi
if [ "`ls /system/etc/hw_config.sh*`" ]; then cp -fr /system/etc/hw_conf
ig.sh* $storage/V6_SuperCharger/system/etc; fi 2>/dev/null
if [ -d "/system/etc/init.d" ]; then rm -f /system/etc/init.d/*SuperChar
ger*
j=
for i in `busybox ls -r /system/etc/init.d/*`; do
if [ "$j" ]; then break; fi
j=$i
done
if [ "`echo $j | grep KickAssKernel`" ] && [ "$i" \< "99SuperCha
rger" ] || [ "$j" \< "99SuperCharger" ]; then desiredname="/system/etc/init.d/99
SuperCharger"
elif [ "`echo $j | grep KickAssKernel`" ] && [ "$i" \< "S99Super
Charger" ] || [ "$j" \< "S99SuperCharger" ]; then desiredname="/system/etc/init.
d/S99SuperCharger"
else desiredname="/system/etc/init.d/SS99SuperCharger"
fi
cp -fr /data/99SuperCharger.sh $desiredname
cp -fr $desiredname $storage/V6_SuperCharger/system/etc/init.d
if [ "$1" ]; then echo " Re-Generating `echo $desiredname | sed
's/.*etc//'`..."
if [ ! -f "$desiredname" ] || [ "`diff /data/99SuperChar
ger.sh $desiredname`" ]; then
checkedspace=yes
info_free_space_error init.d `basename $desiredn
ame` slim
fi
fi
fi
}
Re_Generate_97BulletProof_Apps(){
cat > /data/97BulletProof_Apps.sh <<EOF
#!/system/bin/sh
#
# BulletProof Apps Boot Script created by -=zeppelinrox=#
EOF
terms /data/97BulletProof_Apps.sh
cat >> /data/97BulletProof_Apps.sh <<EOF
# 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
echo "";
sleep 1;
echo " Note that values are in seconds..
.";
echo "";
sleep 1;
echo " Too low a value may suck battery
faster than...";
echo "";
sleep 1;
echo "
...an Armstrong on
echo "";
sleep 1;
echo "
...so d
a steroid....";
on't be a nut!";
echo "";
sleep 1;
echo " btw 14s is likely the lowest you
should go...";
echo "";
sleep 1;
echo "
;
mv /data/V6_SuperCharger/SuperChargerOptions.tmp /data/V
6_SuperCharger/SuperChargerOptions;
fi;
remount ro;;
*)echo "
No Change For You!";;
esac;
echo \$line;
echo "";
sleep 1;
};
install(){
if [ ! "\`grep \$ver "\$1"\`" ]; then
echo "";
echo " Installing myself to \${1#*etc}";
sleep 2;
remount rw;
dd if=\$0 of=\$1;
chown 0.0 \$1; chmod 777 \$1;
remount ro;
fi 2>/dev/null;
};
BulletProof_Apps(){
if [ "\`echo \$0 | grep -v "\.sh"\`" ] && [ "\`busybox ps\$w | grep "/da
ta/97BulletProof_Apps\.sh"\`" ]; then stop bullet_service; fi;
while [ ! "\`ps | grep -m 1 [a]ndroid\`" ]; do sleep 10; done;
if [ -d "/system/etc/init.d" ] && [ "\`echo \$0 | grep -v "init\.d"\`" ]
; then
if [ -f "/system/etc/init.d/S97BulletProof_Apps" ]; then install
/system/etc/init.d/S97BulletProof_Apps;
elif [ -f "/system/etc/init.d/97BulletProof_Apps" ] || [ "\`ls /
system/etc/init.d/*BulletProof_Apps\`" ]; then install /system/etc/init.d/97Bull
etProof_Apps;
fi 2>/dev/null;
fi;
LOG_FILE=/data/Ran_BulletProof_Apps.log;
echo "" | tee \$LOG_FILE;
echo " This should update every \$bpwait seconds!" >> \$LOG_FILE;
if [ "easyloglulz" ]; then
echo " \$( date +"%m-%d-%Y %H:%M:%S" ): BulletProofing Apps with
\$0!";
echo "";
echo \$line;
echo " -=BulletProof Apps=- script by -=zeppelinrox=-";
echo \$line;
echo "";
echo " Version: $ver";
echo "";
bpapplist=\`cat /data/V6_SuperCharger/BulletProof_Apps_HitList\`
;
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 [ "\`busybox ps | grep [B]ulletProof_Apps_is\`" ]; then
echo " BulletProof Apps is already running!";
echo "";
exit 69;
elif [ ! "\$bpapplist" ] && [ ! "\`grep "BulletProofing" /data/V
6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh\`" ]; then
echo " Uh... nothing is being bulletproofed... LOL";
echo "";
echo " Both \"BulletProof_Apps_HitList\" AND...";
echo "";
echo "
...BulletProof_Apps_Fine_Tuner.sh...";
echo "";
echo "
...are NOT configured!";
echo "";
echo \$line;
echo "
...No BulletProofing For You!!";
echo \$line;
echo "";
exit 69;
elif [ "\`pgrep scriptmanager\`" ] && [ "\$bpwait" -gt 0 ]; then
sleep 2;
echo "
DO NOT PUT THIS ON A SCHEDULE!";
echo "";
sleep 2;
echo "
It runs every \$bpwait seconds automatically!"
;
echo "
=======================================";
echo "";
sleep 2;
fi 2>/dev/null;
echo " To verify that it's working...";
echo "";
echo " ...check out \$LOG_FILE!";
echo "";
echo \$line;
echo " zOOM... zOOM...";
echo \$line;
echo "";
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 ";
if [ -f "/proc/\$bp/oom_adj" ]; then cat
/proc/\$bp/oom_adj;
else cat /proc/\$bp/oom_score_adj;
fi;
echo "";
done 2>/dev/null;
else
echo " Can't find \$bpapp running...";
echo "
...so it can't be BulletProof
ed :(";
echo "";
fi;
done;
sh /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh;
echo "
==============================";
echo "
) BulletProofing Complete! (";
echo "
==============================";
echo "";
if [ "\$interactive" ]; then Configure; fi;
if [ "\$bpwait" -eq 0 ]; then
echo " And Hey! Init.d Start Up Scripts Are Working!"
echo ""
exit 0
fi;
echo " Waiting \$bpwait 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 "";
fi | tee -a \$LOG_FILE;
\$bpinterval | grep "BulletProof_Apps_is_In_Effect!";
echo \$line;
echo "
Ok done! You can close this App!";
echo \$line;
echo "";
if [ "\`busybox --help | grep nohup\`" ] && [ ! "\`busybox ps\$w | grep
"{.*/\${0##*/}"\`" ]; then (busybox nohup \$0 > /dev/null &); exit 0;
elif [ "\`busybox --help | grep start-stop-daemon\`" ] && [ ! "\`busybox
ps\$w | grep "{.*/\${0##*/}"\`" ]; then busybox start-stop-daemon -S -b -x \$0;
exit 0;
else \$0 > /dev/null & exit 0;
fi;
}
if [ "\`ps | grep -m 1 [a]ndroid\`" ]; then BulletProof_Apps;
else exec > /data/BootLog_BulletProof_Apps.log 2>&1;
BulletProof_Apps &
fi;
exit 0;
EOF
chown 0.0 /data/97BulletProof_Apps.sh; chmod 777 /data/97BulletProof_App
s.sh
cp -fr /data/97BulletProof_Apps.sh $storage/V6_SuperCharger/data
if [ -d "/system/etc/init.d" ]; then rm -f /system/etc/init.d/*BulletPro
of_Apps*
for i in /system/etc/init.d/S*; do Sfiles=$i; break; done
if [ "$Sfiles" != "/system/etc/init.d/S*" ]; then bpname="/syste
m/etc/init.d/S97BulletProof_Apps"
else bpname="/system/etc/init.d/97BulletProof_Apps"
fi
cp -fr /data/97BulletProof_Apps.sh $bpname
cp -fr $bpname $storage/V6_SuperCharger/system/etc/init.d
if [ "$1" ]; then echo " Re-Generating `echo $bpname | sed 's/.*
etc//'`..."
if [ ! -f "$bpname" ] || [ "`diff /data/97BulletProof_Ap
echo \$line
echo "
echo \$line
echo ""
sleep 3
echo "
echo ""
echo \$line
echo ""
sleep 3
exit 69
fi
remount(){
mount -o remount,\$1 /system 2>/dev/null
busybox mount -o remount,\$1 /system 2>/dev/null
busybox mount -o remount,\$1 \$(busybox mount | awk '/system /{print \$1
,\$3}') 2>/dev/null
}
remount rw
echo " PowerShifting to a different gear!"
echo ""
sleep 1
echo \$line
awk -F , '{OFMT="%.0f"; print " Current Minfrees = "\$1/256","\$2/256","\$3/25
6","\$4/256","\$5/256","\$6/256" MB"}' /sys/module/lowmemorykiller/parameters/mi
nfree
echo \$line
echo ""
sleep 1
echo " Setting LowMemoryKiller to..."
echo ""
sleep 1
echo \$line
echo "
...$MB1, $MB2, $MB3, $MB4, $MB5, $MB6 MB"
echo \$line
echo ""
sleep 1
echo $scminfree > /sys/module/lowmemorykiller/parameters/minfree
echo $scminfree > /data/V6_SuperCharger/SuperChargerMinfree
echo " OOM Minfree levels are now set to..."
echo ""
sleep 1
echo "
...\`cat /sys/module/lowmemorykiller/parameters/minfree\`"
echo ""
sleep 1
echo " They are also your new SuperCharger values!"
echo ""
echo \$line
echo ""
sleep 1
echo " 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
for mfk in /data/99SuperCharger.sh /system/xbin/99super /system/etc/init.d/*Supe
rCharger* /system/etc/hw_config.sh; do
if [ -f "\$mfk" ]; then sed -i 's/^MFK=.*/MFK=$MFK/' \$mfk; fi
done
remount ro
echo "
==========================="
echo "
) PowerShift Completed! ("
echo "
==========================="
echo ""
sleep 1
exit 0
EOF
chown 0.0 "/data/V6_SuperCharger/PowerShift_Scripts/$1"; chmod 777 "/dat
a/V6_SuperCharger/PowerShift_Scripts/$1"
cp -fr "/data/V6_SuperCharger/PowerShift_Scripts/$1" $storage/V6_SuperCh
arger/data/V6_SuperCharger/PowerShift_Scripts
}
Re_Generate_BulletProof_1Shot(){
bpappname=$1
if [ -f "$1" ]; then bpwa1t=`grep "^bpwa1t=" $1 | sed 's/[^0-9]//g'`;fi
if [ ! "$bpwa1t" ] || [ "`echo $bpwa1t | grep "[^0-9]"`" ]; then bpwa1t=
30; fi
cat > /data/V6_SuperCharger/BulletProof_One_Shots/1Shot-$bpappname.sh <<
EOF
#!/system/bin/sh
#
# BulletProof "One-Shot" Script created by -=zeppelinrox=#
EOF
terms /data/V6_SuperCharger/BulletProof_One_Shots/1Shot-$bpappname.sh
cat >> /data/V6_SuperCharger/BulletProof_One_Shots/1Shot-$bpappname.sh <
<EOF
# 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 $bpwa1t seconds (default is 30 seconds
).
#
So you can close the app after that time and the BulletProof "One-S
hot" continues in the background!
#
# Note: To customize BulletProof frequency, change the "bpwa1t" variable to the
number of seconds you want.
#
Valid value is any whole number (no decimals) over 0.
#
If 0, it won't re-execute :P heh.
#
If the value is invalid or missing, it defaults to running every 30 seco
nds.
#
Example: If you want it to run every minute, make the line read "bpwa1t=
60;".
#
WARNING: Making it too low may suck your battery faster than an Armstron
g on a steroid. So don't be a nut.
#
14s is likely the lowest you should need to go so that nothing
ever gets killed.
#
# 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)
echo "
...Please Run as Root and try again..."
echo ""
echo \$line
echo ""
sleep 3
exit 69
elif [ "\`busybox ps | grep "$bpappname_i[s]"\`" ]; then
echo " This 1Shot is already running!"
echo ""
exit 69
else
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 ""
echo -n " $bpappname's oom score is "
cat /proc/\$bp/oom_score
echo ""
echo -n " $bpappname's oom priority is "
if [ -f "/proc/\$bp/oom_adj" ]; then cat /proc/\$bp/oom_
adj
else cat /proc/\$bp/oom_score_adj
fi
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
if [ "\$bpwa1t" -eq 0 ]; then exit 0; fi
echo " Waiting \$bpwa1t 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 ""
\$bpinterval | grep "1Shot-$bpappname_is_In_Effect!"
echo \$line
echo "
Ok done! You can close this App!"
echo \$line
echo ""
sleep 1
fi;
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
cp -fr /data/V6_SuperCharger/BulletProof_Apps* $storage/V6_SuperCharger/
data/V6_SuperCharger
}
Re_Generate_Detailing(){
cat > /data/V6_SuperCharger/!Detailing.sh <<EOF
#!/system/bin/sh
#
# Detailing Script (SQLite VACUUM & REINDEX to optimize databases) created by -=
zeppelinrox=#
EOF
terms /data/V6_SuperCharger/\!Detailing.sh
cat >> /data/V6_SuperCharger/!Detailing.sh <<EOF
# 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.
#
# Option 1. By default, this will optimize only databases which were recently ch
anged and probably need it.
#
ie. It won't bother with those that have a modification time older t
han the log file!
# Option 2. Or, when asked, you can force it to optimize all apps! (Obviously, l
ike other sqlite scripts, this takes longer).
#
# The code is HIGHLY optimized... so it's REALLY FAST!
#
# Get full stats from the log file!
#
# Note: You can change the "detailinterval" 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 "detai
linterval=4".
#
# Props: avgjoemomma (from XDA) for the added reindex bit :)
#
# For debugging, delete the # at the beginning of the following 2 lines, and che
ck /data/Debug_Detailing.log file to see what may have fubarred.
# set -x
# exec > /data/Debug_Detailing.log 2>&1
#
PATH=\$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin
if [ -d "/data/local/busybox*/xbin" ]; then PATH=\$PATH:\`ls -d /data/local/busy
box*/xbin 2>/dev/null\`; fi
line=================================================
cd "\${0%/*}" 2>/dev/null
sleep 1
echo \$line
echo " Also READ THE COMMENTS inside this script!"
echo \$line
echo ""
sleep 1
echo " Change Detailing Options?"
echo ""
sleep 1
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo \$line
case \$changeoptions in
y|Y)remount rw
echo ""
sleep 1
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)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!"
echo \$line
echo ""
sleep 1
echo " After every boot.
.."
echo ""
sleep 1
echo " ..\$counterfile w
ill be updated!"
echo ""
break;;
*)echo "
Invalid entry...
Please try again :p";;
esac
done;;
*)detailinterval=0
echo "
Declined Detailing On Boot!";
;
esac
sed -i '/^detailinterval=/s/=.*/='\$detailinterval'/' \$
0
for cav in /data/V6_SuperCharger/!Detailing.sh /system/x
bin/vac /system/etc/init.d/92vac; do
if [ "\$0" != "\$cav" ]; then sed -i '/^detailin
terval=/s/=.*/='\$detailinterval'/' \$cav; fi
done 2>/dev/null
if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; t
hen
awk 'BEGIN{OFS=FS=","}{\$12='\$detailinterval';p
rint}' /data/V6_SuperCharger/SuperChargerOptions > /data/V6_SuperCharger/SuperCh
argerOptions.tmp
mv /data/V6_SuperCharger/SuperChargerOptions.tmp
/data/V6_SuperCharger/SuperChargerOptions
fi
remount ro;;
*)echo "
No Change For You!";;
esac
echo \$line
echo ""
sleep 1
}
install(){
remount rw
for i in /system/etc/init.d/*; do
if [ -f "\$i" ] && [ "\`grep "VACUUM" "\$i"\`" ] && [ "\`echo "\
$i" | grep -Ev "etail|vac|disabled"\`" ]; then
sed -i '1 a\\
#\\
# Detailing (aka "vac") script disabled this script for additional optimization.
\\
# To Re-Enable this script, delete the sqlite VACUUM stuff in here and rename th
is file.\\
#' "\$i"
mv "\$i" "\$i.disabled_due_to_slow_VACUUM Read_Comment_I
nside_For_Fix"
fi
done
if [ ! -f "\$1" ] && [ ! "\`grep \$ver "\$1"\`" ]; then
echo ""
echo " Installing myself to \${1#*etc}"
sleep 2
dd if=\$0 of=\$1
chown 0.0 \$1; chmod 777 \$1
elif [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " \$1 is already up to date..."
sleep 2
fi 2>/dev/null
if [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " To run, type in Terminal: \"su -c \${1##*/}\""
sleep 2
fi
remount ro
}
Details_Details(){
while [ ! "\`ps | grep -m 1 [a]ndroid\`" ]; do sleep 10; done
if [ "\`echo \$0 | grep -v xbin\`" ]; then install /system/xbin/vac; fi
if [ "\`echo \$0 | grep "init\.d"\`" ] && [ ! "\$interactive" ]; then co
unter=\$((\$counter+1))
if [ "\$detailinterval" -eq 0 ]; then echo ""; title
echo " Current Status: Detailing DOES NOT Run On Boot!"
echo ""
echo " But Hey! Init.d Start Up Scripts Are Working!"
echo ""
exit 0
elif [ "\$counter" -lt "\$detailinterval" ]; then echo ""; title
sed -i 's/Counter.*/Counter: '\$counter'/' \$counterfile
echo " Current Status: Detailing Runs Every \$detailinte
rval Boots!"
echo " Detailing last ran \$counter reboots ago..." | te
e -a \$counterfile
echo " It exited peacefully on \`date\`" >> \$counterfil
e
echo "" | tee -a \$counterfile
exit 0
fi
elif [ -d "/system/etc/init.d" ]; then install /system/etc/init.d/92vac
fi
LOG_FILE=/data/Ran_Detailing.log
lastran=/data/!Detailing_Last_Ran.log
mv \$LOG_FILE \$lastran 2>/dev/null
if [ "easyloglulz" ]; then
echo "" | tee \$counterfile
title | tee -a \$counterfile
echo " Boot Counter: 0" >> \$counterfile
echo " Current Status: Detailing Runs Every \$detailinterval Boo
ts!" | tee -a \$counterfile
echo "" | tee -a \$counterfile
sleep 2
if [ "\$interactive" ]; then echo " Detailing last ran manually
- reset counter..." | tee -a \$counterfile
else echo " Detailing ran on the most recent boot..." >> \$count
erfile
fi
echo " It was executed on \`date\`" | tee -a \$counterfile
echo "" | tee -a \$counterfile
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 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.intent.action.VIEW -n com.android.browser/.BrowserActivity -d file://
$storage/!SuperCharger.html"
echo ""
echo \$line
echo ""
sleep 3
if [ -f "/data/BootLog_Detailing.log" ]; then su -c "LD_
LIBRARY_PATH=/vendor/lib:/system/lib am start -a android.intent.action.VIEW -d f
ile://data/BootLog_Detailing.log -t text/plain"; fi
echo ""
echo \$line
echo ""
sleep 3
exit 69
elif [ -f "\$lastran" ] && [ "\$interactive" ]; then
echo " Optimize ALL databases or recently changed?"
echo ""
sleep 1
echo -n " Enter (A)LL, any key for recently modified: "
stty -icanon min 0 time 200
read how
stty sane
echo ""; echo ""
case \$how in
a|A)rm \$lastran;;
*);;
esac
echo \$line
echo ""
sleep 1
fi
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
fi | tee \$LOG_FILE
sqlite3version=\`sqlite3 -version | awk '{print \$1}'\`
busybox find /*d*/ -iname "*.db" > /data/dbs.tmp
TOTAL=\`grep -c . /data/dbs.tmp\`
START=\`busybox date +%s\`
BEGAN=\`date\`
OPTIMIZED=0
INCREMENT=3
PROGRESS=0
PROGRESS_BAR=""
echo " Start Detailing: \$BEGAN" >> \$LOG_FILE
echo "" >> \$LOG_FILE
busybox sync
while read 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
echo
if [
""
"
Needed Optimizing - \$OPTIMIZED"
""
! -f "\$lastran" ] || [ "\$db" -nt "\$lastran" ]; then
OPTIMIZED=\$((\$OPTIMIZED+1))
if [ "\$sqlite3version" = 3.7.4 ] && [ "\`echo \$db | gr
ep "providers\.media" | grep "external.*\.db"\`" ]; then
echo " SKIPPING: \$db (Problematic)" | tee -a
\$LOG_FILE
else
echo " VACUUMING: \$db" | tee -a \$LOG_FILE
sqlite3 \$db 'VACUUM;' | tee -a \$LOG_FILE;
echo " REINDEXING: \$db" | tee -a \$LOG_FILE
sqlite3 \$db 'REINDEX;' | tee -a \$LOG_FILE;
fi
fi
done < /data/dbs.tmp
busybox sync
rm /data/dbs.tmp
rm \$lastran 2>/dev/null
STOP=\`busybox date +%s\`
ENDED=\`date\`
RUNTIME=\$((\$STOP-\$START))
HOURS=\$((\$RUNTIME/3600))
MINS=\$((\$RUNTIME/60%60))
SECS=\$((\$RUNTIME%60))
RUNTIME=\`busybox printf "%02d:%02d:%02d\n" "\$HOURS" "\$MINS" "\$SECS"\
`
# Detailing (aka "vac") script disabled this script for additional optimization.
\
# To Re-Enable this script, delete the sqlite VACUUM stuff in here and rename th
is file.\
#' "$i"
mv "$i" "$i.disabled_due_to_slow_VACUUM Read_Com
ment_Inside_For_Fix"
fi
done
cp -fr /data/V6_SuperCharger/!Detailing.sh /system/etc/init.d/92
vac
cp -fr /data/V6_SuperCharger/!Detailing.sh $storage/V6_SuperChar
ger/system/etc/init.d/92vac
if [ "$1" ]; then echo " Re-Generating /init.d/92vac..."
if [ ! -f "/system/etc/init.d/92vac" ] || [ "`diff /data
/V6_SuperCharger/!Detailing.sh /system/etc/init.d/92vac`" ]; then
checkedspace=yes
info_free_space_error /etc/init.d 92vac slim
fi
fi
fi
}
Re_Generate_WheelAlignment(){
cat > /data/V6_SuperCharger/!WheelAlignment.sh <<EOF
#!/system/bin/sh
#
# "ZepAlign" / Wheel Alignment Script (ZipAlign) created by -=zeppelinrox=#
EOF
terms /data/V6_SuperCharger/\!WheelAlignment.sh
cat >> /data/V6_SuperCharger/!WheelAlignment.sh <<EOF
# 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! ;^]
#
# Option 1. By default, this will check and/or zipalign only apks which were rec
ently added and may need it.
# Option 2. Or, when asked, you can force it to zipalign all apks! (Obviously, t
his takes a bit longer).
#
# The code is HIGHLY optimized... so it's REALLY FAST!
#
# Get full stats from the log file!
#
# Tweaks & Enhancements by zeppelinrox...
#
- Added BRAINS: By default, it will only check apks that were added since
last run (ie. newer than the log file!)
#
- Added support for /vendor/app (POST-ICS).
#
- Added support for /mnt/asec.
#
- Added support for more data directories ie. dbdata, datadata, etc.
#
- Added debugging.
#
- Enhanced logging!
#
- Tweaked interface... just a wittle bit ;^]
#
# Props: Automatic ZipAlign by Wes Garner (original script)
#
oknowton for the change from MD5 to zipalign -c 4
#
# For debugging, delete the # at the beginning of the following 2 lines, and che
ck /data/Debug_ZepAlign.log file to see what may have fubarred.
# set -x
echo \$line
echo ""
sleep 1
echo " Change Wheel Alignment Options?"
echo ""
sleep 1
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo \$line
case \$changeoptions in
y|Y)remount rw
echo ""
sleep 1
echo " Run Wheel Alignment on boot?"
echo ""
sleep 1
echo " Note: If you say Yes, Fix Alignment On Boot..."
echo "
...gets disabled (avoids overlapping mods)"
echo ""
sleep 1
echo -n " Enter Y for Yes, any key for No: "
read bootzepalign
echo ""
echo \$line
case \$bootzepalign in
y|Y)zepalign=1; fixalign=0
echo "
Wheel Alignment Set To Run On Boo
t!";;
*)zepalign=0
echo "
Boot Align Declined... does that rh
yme?";;
esac
sed -i '/^bootzepalign=/s/=.*/='\$zepalign'/' \$0
for ngilapez in /data/V6_SuperCharger/!WheelAlignment.sh
/system/xbin/zepalign /system/etc/init.d/93zepalign; do
if [ "\$0" != "\$ngilapez" ]; then sed -i '/^boo
tzepalign=/s/=.*/='\$zepalign'/' \$ngilapez; fi
done 2>/dev/null
if [ "\$fixalign" ]; then
for ngilaxif in /data/V6_SuperCharger/!FixAlignm
ent.sh /system/xbin/fixalign /system/etc/init.d/95fixalign; do
if [ -f "\$ngilaxif" ]; then sed -i '/^b
ootfixalign=/s/=.*/='\$fixalign'/' \$ngilaxif; fi
done
fi
if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; t
hen
if [ "\$fixalign" ]; then awk 'BEGIN{OFS=FS=","}
{\$13='\$zepalign',\$15='\$fixalign';print}' /data/V6_SuperCharger/SuperChargerO
ptions > /data/V6_SuperCharger/SuperChargerOptions.tmp
else awk 'BEGIN{OFS=FS=","}{\$13='\$zepalign';pr
int}' /data/V6_SuperCharger/SuperChargerOptions > /data/V6_SuperCharger/SuperCha
rgerOptions.tmp
fi
mv /data/V6_SuperCharger/SuperChargerOptions.tmp
/data/V6_SuperCharger/SuperChargerOptions
fi
remount ro;;
*)echo "
No Change For You!";;
esac
echo \$line
echo ""
sleep 1
}
install(){
remount rw
for i in /system/etc/init.d/*; do
if [ -f "\$i" ] && [ "\`grep "zipalign" "\$i"\`" ] && [ "\`echo
"\$i" | grep -Ev "Alignment|zepalign|fixalign|disabled"\`" ]; then
sed -i '1 a\\
#\\
# Wheel Alignment (aka "zepalign") script disabled this script for additional op
timization.\\
# To Re-Enable this script, delete the zipalign stuff in here and rename this fi
le.\\
#' "\$i"
mv "\$i" "\$i.disabled_due_to_slow_zipalign Read_Comment
_Inside_For_Fix"
fi
done
if [ ! -f "\$1" ] && [ ! "\`grep \$ver "\$1"\`" ]; then
echo ""
echo " Installing myself to \${1#*etc}"
sleep 2
dd if=\$0 of=\$1
chown 0.0 \$1; chmod 777 \$1
elif [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " \$1 is already up to date..."
sleep 2
fi 2>/dev/null
if [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " To run, type in Terminal: \"su -c \${1##*/}\""
sleep 2
fi
remount ro
}
Get_PWN (){ PWN=\`busybox stat \$1 | sed 's/ //g' | awk -F [\(\/] '/Uid/{print \
$4,\$6,substr(\$2,2,3)}'\`; }
apply_permissions(){
chown \$1:\$2 \$4
echo " chown \$1:\$2 \$4 ( was \`echo \$PWN | awk '{print \$1":"\$2}'\`
)" | tee -a \$LOG_FILE
chmod \$3 \$4
echo " chmod \$3 \$4 ( was \`echo \$PWN | awk '{print \$3}'\` )" | tee a \$LOG_FILE
echo ""
}
ZepAlign(){
while [ ! "\`ps | grep -m 1 [a]ndroid\`" ]; do sleep 10; done
if [ "\`echo \$0 | grep -v xbin\`" ]; then install /system/xbin/zepalign
; fi
if [ "\`echo \$0 | grep "init\.d"\`" ] && [ ! "\$interactive" ]; then ec
ho ""
if [ "\$bootzepalign" -ne 1 ]; then
title
echo " Current Status: Wheel Alignment DOES NOT Run On B
oot!"
echo ""
echo " But Hey! Init.d Start Up Scripts Are Working!"
echo ""
exit 0
else echo " Waiting for \`echo \$bootupdelay | awk '{print \$NF}
'\` seconds..."; \$bootupdelay
fi
elif [ -d "/system/etc/init.d" ]; then install /system/etc/init.d/93zepa
lign
fi
LOG_FILE=/data/Ran_ZepAlign.log
lastran=/data/!ZepAlign_Last_Ran.log
mv \$LOG_FILE \$lastran 2>/dev/null
if [ "easyloglulz" ]; then
echo ""
title
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.intent.action.VIEW -n com.android.browser/.BrowserActivity -d file://
$storage/!SuperCharger.html"
echo ""
echo \$line
echo ""
sleep 3
if [ -f "/data/BootLog_ZepAlign.log" ]; then su -c "LD_L
IBRARY_PATH=/vendor/lib:/system/lib am start -a android.intent.action.VIEW -d fi
le://data/BootLog_ZepAlign.log -t text/plain"; fi
echo ""
echo \$line
echo ""
sleep 3
exit 69
elif [ -f "\$lastran" ] && [ "\$interactive" ]; then
echo " ZipAlign ALL Apps or only recently installed?"
echo ""
sleep 1
echo -n " Enter (A)LL, any key for recently added: "
stty -icanon min 0 time 200
read how
stty sane
echo ""; echo ""
case \$how in
a|A)rm \$lastran;;
*);;
esac
echo \$line
echo ""
sleep 1
fi
fi | tee \$LOG_FILE
remount rw
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=""
NEW=0; ALIGNED=0; ALREADY=0; FAILED=0
echo " Start Wheel Alignment ( \"ZepAlign\" ): \$BEGAN" >> \$LOG_FILE
echo "" >> \$LOG_FILE
busybox 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 "\$lastran" ] || [ "\$apk" -nt "\$lastran" ] && [ -f "
\$apk" ]; then NEW=\$((\$NEW+1)); Get_PWN \$apk
zipalign -c 4 \$apk
ZIPCHECK=\$?
if [ "\$ZIPCHECK" -eq 1 ]; then
done
cp -fr /data/V6_SuperCharger/!WheelAlignment.sh /system/etc/init
.d/93zepalign
cp -fr /data/V6_SuperCharger/!WheelAlignment.sh $storage/V6_Supe
rCharger/system/etc/init.d/93zepalign
if [ "$1" ]; then echo " Re-Generating /init.d/93zepalign..."
if [ ! -f "/system/etc/init.d/93zepalign" ] || [ "`diff
/data/V6_SuperCharger/!WheelAlignment.sh /system/etc/init.d/93zepalign`" ]; then
checkedspace=yes
info_free_space_error /etc/init.d 93zepalign sli
m
fi
fi
fi
}
Re_Generate_FixEmissions(){
cat > /data/V6_SuperCharger/!FixEmissions.sh <<EOF
#!/system/bin/sh
#
# Fix Emissions Script (Fix Permissions) created by -=zeppelinrox=#
EOF
terms /data/V6_SuperCharger/\!FixEmissions.sh
cat >> /data/V6_SuperCharger/!FixEmissions.sh <<EOF
# Sets permissions for android data directories and apks.
# This should fix app force closes (FCs).
#
# The code is HIGHLY optimized... so it's REALLY FAST! - setting permissions for
300 apps in approximately 1 minute.
#
# Get full stats from the log file!
#
# Tweaks & Enhancements by zeppelinrox...
#
- Added BRAINS: Only applies permissions if they are not what they're sup
posed to be!
#
- Removed the usage of the "pm list packages" command - it didn't work on
boot.
#
- Added support for /vendor/app (POST-ICS).
#
- Added support for /mnt/asec.
#
- No longer excludes framework-res.apk or com.htc.resources.apk
#
- Added support for more data directories ie. dbdata, datadata, etc.
#
- Added debugging.
#
- Enhanced logging!
#
- Tweaked interface... just a wittle bit ;^]
#
# Props: Originally and MOSTLY (erm... something like 75% of it lol) by Jared Ru
mmler (JRummy16).
# However, I actually meshed together 3 different Fix Permissions scripts and ad
ded my own spices ;^]
#
# For debugging, delete the # at the beginning of the following 2 lines, and che
ck /data/Debug_FixEmissions.log file to see what may have fubarred.
# set -x
# exec > /data/Debug_FixEmissions.log 2>&1
#
PATH=\$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin
if [ -d "/data/local/busybox*/xbin" ]; then PATH=\$PATH:\`ls -d /data/local/busy
box*/xbin 2>/dev/null\`; fi
line=================================================
cd "\${0%/*}" 2>/dev/null
read
echo
echo
case
changeoptions
""
\$line
\$changeoptions in
y|Y)remount rw
echo ""
sleep 1
echo " Run Fix Emissions on boot?"
echo ""
sleep 1
echo " Note: If you say Yes, Fix Alignment On Boot..."
echo "
...gets disabled (avoids overlapping mods)"
echo ""
sleep 1
echo -n " Enter Y for Yes, any key for No: "
read bootfixemissions
echo ""
echo \$line
case \$bootfixemissions in
y|Y)fixemissions=1; fixalign=0
echo "
Fix Emissions Set To Run On Boot
!";;
*)fixemissions=0
echo "
No FCing Fix On Boot For You!"
;;
esac
sed -i '/^bootfixemissions=/s/=.*/='\$fixemissions'/' \$
0
for cfxif in /data/V6_SuperCharger/!FixEmissions.sh /sys
tem/xbin/fixfc /system/etc/init.d/94fixfc; do
if [ "\$0" != "\$cfxif" ]; then sed -i '/^bootfi
xemissions=/s/=.*/='\$fixemissions'/' \$cfxif; fi
done 2>/dev/null
if [ "\$fixalign" ]; then
for ngilaxif in /data/V6_SuperCharger/!FixAlignm
ent.sh /system/xbin/fixalign /system/etc/init.d/95fixalign; do
if [ -f "\$ngilaxif" ]; then sed -i '/^b
ootfixalign=/s/=.*/='\$fixalign'/' \$ngilaxif; fi
done
fi
if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; t
hen
if [ "\$fixalign" ]; then awk 'BEGIN{OFS=FS=","}
{\$14='\$fixemissions',\$15='\$fixalign';print}' /data/V6_SuperCharger/SuperChar
gerOptions > /data/V6_SuperCharger/SuperChargerOptions.tmp
else awk 'BEGIN{OFS=FS=","}{\$14='\$fixemissions
';print}' /data/V6_SuperCharger/SuperChargerOptions > /data/V6_SuperCharger/Supe
rChargerOptions.tmp
fi
mv /data/V6_SuperCharger/SuperChargerOptions.tmp
/data/V6_SuperCharger/SuperChargerOptions
fi
remount ro;;
*)echo "
No Change For You!";;
esac
echo \$line
echo ""
sleep 1
}
install(){
remount rw
for i in /system/etc/init.d/*; do
if [ -f "\$i" ] && [ "\`grep -E "packages\.xml|pm list packages"
"\$i"\`" ] && [ "\`grep "771" "\$i"\`" ] && [ "\`echo "\$i" | grep -Ev "Alignme
nt|Emission|fixfc|fixalign|disabled"\`" ]; then
sed -i '1 a\\
#\\
# Fix Emissions (aka "fixfc") script disabled this script for additional optimiz
ation.\\
# To Re-Enable this script, delete the fix permissions stuff in here and rename
this file.\\
#' "\$i"
mv "\$i" "\$i.disabled_due_to_slow_fix_permissions Read_
Comment_Inside_For_Fix"
fi
done
if [ ! -f "\$1" ] && [ ! "\`grep \$ver "\$1"\`" ]; then
echo ""
echo " Installing myself to \${1#*etc}"
sleep 2
dd if=\$0 of=\$1
chown 0.0 \$1; chmod 777 \$1
elif [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " \$1 is already up to date..."
sleep 2
fi 2>/dev/null
if [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " To run, type in Terminal: \"su -c \${1##*/}\""
sleep 2
fi
remount ro
}
Get_PWN (){ PWN=\`busybox stat \$1 | sed 's/ //g' | awk -F [\(\/] '/Uid/{print \
$4,\$6,substr(\$2,2,3)}'\`; }
apply_permissions(){
chown \$1:\$2 \$4
echo " chown \$1:\$2 \$4 ( was \`echo \$PWN | awk '{print \$1":"\$2}'\`
)" | tee -a \$LOG_FILE
chmod \$3 \$4
echo " chmod \$3 \$4 ( was \`echo \$PWN | awk '{print \$3}'\` )" | tee a \$LOG_FILE
echo ""
}
Fix_Emissions(){
while [ ! "\`ps | grep -m 1 [a]ndroid\`" ]; do sleep 10; done
if [ "\`echo \$0 | grep -v xbin\`" ]; then install /system/xbin/fixfc; f
i
if [ "\`echo \$0 | grep "init\.d"\`" ] && [ ! "\$interactive" ]; then ec
ho ""
if [ "\$bootfixemissions" -ne 1 ]; then
title
echo " Current Status: Fix Emissions DOES NOT Run On Boo
t!"
echo ""
echo " But Hey! Init.d Start Up Scripts Are Working!"
echo ""
exit 0
else echo " Waiting for \`echo \$bootupdelay | awk '{print \$NF}
DATAPATH=/d*/d*/\$PKGNAME
PKGID=\`echo \$pkgline | sed 's/.*serId="\|".*//g'\`
echo " Setting & Fixing Permissions For..."
echo ""
echo " ...\$PKGNAME"
echo " \$PKGNAME (\$CODEPATH)" >> \$LOG_FILE
if [ -e "\$CODEPATH" ]; then Get_PWN \$CODEPATH
APPDIR=\`busybox dirname \$CODEPATH\`
if [ "\$APPDIR" = "/system/app" ] || [ "\$APPDIR" = "/ve
ndor/app" ] || [ "\$APPDIR" = "/system/framework" ] && [ "\$PWN" != "0 0 644" ];
then apply_permissions 0 0 644 \$CODEPATH
elif [ "\$APPDIR" = /d*/app ] && [ "\$PWN" != "1000 1000
644" ]; then apply_permissions 1000 1000 644 \$CODEPATH
elif [ "\$APPDIR" = /d*/app-private ] || [ "\`echo \$APP
DIR | grep asec\`" ] && [ "\$PWN" != "1000 \$PKGID 640" ]; then apply_permission
s 1000 \$PKGID 640 \$CODEPATH
fi
if [ -d \$DATAPATH ]; then Get_PWN \$DATAPATH
if [ "\$PWN" != "\$PKGID \$PKGID 755" ]; then ap
ply_permissions \$PKGID \$PKGID 755 \$DATAPATH; fi
DIRS=\`busybox find \$DATAPATH -mindepth 1 -type
d\`
for file in \$DIRS; do Get_PWN \$file
FNAME=\`busybox basename \$file\`
FPERM=771
NEWID=\$PKGID
case \$FNAME in
lib)PERM=755; NEWID=1000
; FPERM=755;;
shared_prefs|databases)PERM=660;;
cache)PERM=600;;
files)PERM=775;;
*)PERM=771;;
esac
if [ "\$PWN" != "\$NEWID \$NEWID \$FPERM
" ]; then apply_permissions \$NEWID \$NEWID \$FPERM \$file; fi
busybox find \$file -type f -maxdepth 2
! -perm \$PERM -exec chmod \$PERM {} ';'
busybox find \$file -type f -maxdepth 1
! -user \$NEWID -exec chown \$NEWID {} ';'
busybox find \$file -type f -maxdepth 1
! -group \$NEWID -exec chown :\$NEWID {} ';'
done
fi
fi | tee -a \$LOG_FILE
done
busybox sync
remount ro
STOP=\`busybox date +%s\`
ENDED=\`date\`
RUNTIME=\$((\$STOP-\$START))
HOURS=\$((\$RUNTIME/3600))
MINS=\$((\$RUNTIME/60%60))
SECS=\$((\$RUNTIME%60))
RUNTIME=\`busybox printf "%02d:%02d:%02d\n" "\$HOURS" "\$MINS" "\$SECS"\
`
echo "" | tee -a \$LOG_FILE
echo \$line | tee -a \$LOG_FILE
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 "" | tee -a \$LOG_FILE
sleep 1
echo " See \$LOG_FILE for more details!"
echo ""
sleep 1
echo "
==============================" | tee -a \$LOG_FILE
echo "
) Fix Emissions Completed! (" | tee -a \$LOG_FILE
echo "
==============================" | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
sleep 1
if [ -d "/system/etc/init.d" ] && [ "\$interactive" ]; then Configure; f
i
}
if [ "\`ps | grep -m 1 [a]ndroid\`" ]; then Fix_Emissions
else exec > /data/BootLog_FixEmissions.log 2>&1
Fix_Emissions &
fi
exit 0
EOF
chown 0.0 /data/V6_SuperCharger/!FixEmissions.sh; chmod 777 /data/V6_Sup
erCharger/!FixEmissions.sh
cp -fr /data/V6_SuperCharger/!FixEmissions.sh $storage/V6_SuperCharger/d
ata/V6_SuperCharger
cp -fr /data/V6_SuperCharger/!FixEmissions.sh /system/xbin/fixfc
cp -fr /data/V6_SuperCharger/!FixEmissions.sh $storage/V6_SuperCharger/s
ystem/xbin/fixfc
if [ "$1" ]; then echo " Re-Generating /system/xbin/fixfc..."
if [ ! -f "/system/xbin/fixfc" ] || [ "`diff /data/V6_SuperCharg
er/!FixEmissions.sh /system/xbin/fixfc`" ]; then
checkedspace=yes
info_free_space_error /system/xbin fixfc slim
fi
fi
if [ -d "/system/etc/init.d" ]; then
for i in /system/etc/init.d/*; do
if [ -f "$i" ] && [ "`grep -E "packages\.xml|pm list pac
kages" "$i"`" ] && [ "`grep "771" "$i"`" ] && [ "`echo "$i" | grep -Ev "Alignmen
t|Emission|fixfc|fixalign|disabled"`" ]; then
sed -i '1 a\
#\
# Fix Emissions (aka "fixfc") script disabled this script for additional optimiz
ation.\
# To Re-Enable this script, delete the fix permissions stuff in here and rename
this file.\
#' "$i"
mv "$i" "$i.disabled_due_to_slow_fix_permissions
Read_Comment_Inside_For_Fix"
fi
done
cp -fr /data/V6_SuperCharger/!FixEmissions.sh /system/etc/init.d
/94fixfc
cp -fr /data/V6_SuperCharger/!FixEmissions.sh $storage/V6_SuperC
harger/system/etc/init.d/94fixfc
if [ "$1" ]; then echo " Re-Generating /init.d/94fixfc..."
if [ ! -f "/system/etc/init.d/94fixfc" ] || [ "`diff /da
ta/V6_SuperCharger/!FixEmissions.sh /system/etc/init.d/94fixfc`" ]; then
checkedspace=yes
info_free_space_error /etc/init.d 94fixfc slim
fi
fi
fi
}
Re_Generate_FixAlignment(){
cat > /data/V6_SuperCharger/!FixAlignment.sh <<EOF
#!/system/bin/sh
#
# Fix Alignment Script (ZipAlign AND Fix Permissions) created by -=zeppelinrox=#
EOF
terms /data/V6_SuperCharger/\!FixAlignment.sh
cat >> /data/V6_SuperCharger/!FixAlignment.sh <<EOF
# Combines my "ZepAlign" / Wheel Alignment Script (ZipAlign) with my Fix Emissio
ns Script (Fix Permissions).
# Due to the combining of tools and enhancements... it's STUPIDLY FAST!
#
###############################
# 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! ;^]
#
# Option 1. By default, this will check and/or zipalign only apks which were rec
ently added and may need it.
# Option 2. Or, when asked, you can force it to zipalign all apks! (Obviously, t
his takes a bit longer).
#
# The code is HIGHLY optimized... so it's REALLY FAST!
#
# Get full stats from the log file!
#
# Tweaks & Enhancements by zeppelinrox...
#
- Added BRAINS: By default, it will only check apks that were added since
last run (ie. newer than the log file!)
#
- Added support for /vendor/app (POST-ICS).
#
- Added support for /mnt/asec.
#
- Added support for more data directories ie. dbdata, datadata, etc.
#
- Added debugging.
#
- Enhanced logging!
#
- Tweaked interface... just a wittle bit ;^]
#
# Props: Automatic ZipAlign by Wes Garner (original script)
#
oknowton for the change from MD5 to zipalign -c 4
#
#############################
# Fix Emissions Information #
#############################
# Sets permissions for android data directories and apks.
done
if [ ! -f "\$1" ] && [ ! "\`grep \$ver "\$1"\`" ]; then
echo ""
echo " Installing myself to \${1#*etc}"
sleep 2
dd if=\$0 of=\$1
chown 0.0 \$1; chmod 777 \$1
elif [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " \$1 is already up to date..."
sleep 2
fi 2>/dev/null
if [ "\`echo \$1 | grep xbin\`" ]; then
echo ""
echo " To run, type in Terminal: \"su -c \${1##*/}\""
sleep 2
fi
remount ro
}
Get_PWN (){ PWN=\`busybox stat \$1 | sed 's/ //g' | awk -F [\(\/] '/Uid/{print \
$4,\$6,substr(\$2,2,3)}'\`; }
apply_permissions(){
chown \$1:\$2 \$4
echo " chown \$1:\$2 \$4 ( was \`echo \$PWN | awk '{print \$1":"\$2}'\`
)" | tee -a \$LOG_FILE
chmod \$3 \$4
echo " chmod \$3 \$4 ( was \`echo \$PWN | awk '{print \$3}'\` )" | tee a \$LOG_FILE
echo ""
}
Fix_Align(){
while [ ! "\`ps | grep -m 1 [a]ndroid\`" ]; do sleep 10; done
if [ "\`echo \$0 | grep -v xbin\`" ]; then install /system/xbin/fixalign
; fi
if [ "\`echo \$0 | grep "init\.d"\`" ] && [ ! "\$interactive" ]; then ec
ho ""
if [ "\$bootfixalign" -ne 1 ]; then
title
echo " Current Status: Fix Alignment DOES NOT Run On Boo
t!"
echo ""
echo " But Hey! Init.d Start Up Scripts Are Working!"
echo ""
exit 0
else echo " Waiting for \`echo \$bootupdelay | awk '{print \$NF}
'\` seconds..."; \$bootupdelay
fi
elif [ -d "/system/etc/init.d" ]; then install /system/etc/init.d/95fixa
lign
fi
LOG_FILE=/data/Ran_FixAlign.log
lastran=/data/!FixAlign_Last_Ran.log
if [ "\`grep "zipaligned" \$LOG_FILE\`" ]; then mv \$LOG_FILE \$lastran;
fi 2>/dev/null
zipalign="yes"
if [ "easyloglulz" ]; then
echo ""
title
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.intent.action.VIEW -n com.android.browser/.BrowserActivity -d file://
$storage/!SuperCharger.html"
echo ""
echo \$line
echo ""
sleep 3
if [ -f "/data/BootLog_FixAlign.log" ]; then su -c "LD_L
IBRARY_PATH=/vendor/lib:/system/lib am start -a android.intent.action.VIEW -d fi
le://data/BootLog_FixAlign.log -t text/plain"; fi
echo ""
echo \$line
sleep 3
echo "
So... for now... can ONLY Fix Emissions!"
echo \$line
echo ""
sleep 3
elif [ -f "\$lastran" ] && [ "\$interactive" ]; then
echo " ZipAlign ALL Apps or only recently installed?"
echo ""
sleep 1
echo -n " Enter (A)LL, any key for recently added: "
stty -icanon min 0 time 200
read how
stty sane
echo ""; echo ""
case \$how in
a|A)rm \$lastran;;
*);;
esac
echo \$line
echo ""
sleep 1
fi
fi | tee \$LOG_FILE
if [ ! "\`which zipalign\`" ]; then zipalign=; fi
remount rw
START=\`busybox date +%s\`
BEGAN=\`date\`
TOTAL=\`grep -c "package name" /d*/system/packages.xml\`
INCREMENT=3
PROGRESS=0
PROGRESS_BAR=""
NEW=0; ALIGNED=0; ALREADY=0; FAILED=0
echo " Start Fix Alignment: \$BEGAN" >> \$LOG_FILE
grep "package name" /d*/system/packages.xml > /data/pkgline.tmp
busybox sync
while read pkgline; 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 "
\"Fix Alignment\" by -=zeppelinrox=-"
echo -n "
>"
echo -e "\r
\$PROGRESS_BAR>"
echo ""
echo "
Processing Apps - \$PERCENT% (\$PROGRESS of \$TOTAL
)"
echo "" | tee -a \$LOG_FILE
PKGNAME=\`echo \$pkgline | sed 's/.* name="\|".*//g'\`
CODEPATH=\`echo \$pkgline | sed 's/.* codePath="\|".*//g'\`
DATAPATH=/d*/d*/\$PKGNAME
PKGID=\`echo \$pkgline | sed 's/.*serId="\|".*//g'\`
echo " Fix Aligning \$PKGNAME..." | tee -a \$LOG_FILE
echo ""
if [ -e "\$CODEPATH" ]; then
if [ ! -f "\$lastran" ] || [ "\$CODEPATH" -nt "\$lastran
" ] && [ "\$zipalign" ]; then NEW=\$((\$NEW+1))
zipalign -c 4 \$CODEPATH
ZIPCHECK=\$?
if [ "\$ZIPCHECK" -eq 1 ]; then
echo " ZipAligning \$CODEPATH..." | tee
-a \$LOG_FILE
zipalign -f 4 \$CODEPATH /cache/\$(busyb
ox basename \$CODEPATH)
rc="\$?"
if [ "\$rc" -eq 0 ]; then
if [ -e "/cache/\$(busybox basen
ame \$CODEPATH)" ]; then
cp -f /cache/\$(busybox
basename \$CODEPATH) \$CODEPATH | tee -a \$LOG_FILE
ALIGNED=\$((\$ALIGNED+1)
)
else
echo " ZipAligning \$COD
EPATH... Failed (No Output File!)" | tee -a \$LOG_FILE
FAILED=\$((\$FAILED+1))
failedapp=\`echo "\$fail
edapp, \$(busybox basename \$CODEPATH)" | sed 's/^, //'\`
fi
else echo " ZipAligning \$CODEPATH... Fa
iled (rc: \$rc!)" | tee -a \$LOG_FILE
FAILED=\$((\$FAILED+1))
failedapp=\`echo "\$failedapp, \
$(busybox basename \$CODEPATH)" | sed 's/^, //'\`
fi
rm /cache/\$(busybox basename \$CODEPATH
) 2>/dev/null
else
echo " ZipAlign already completed on \$C
ODEPATH" | tee -a \$LOG_FILE
ALREADY=\$((\$ALREADY+1))
fi
fi
Get_PWN \$CODEPATH
APPDIR=\`busybox dirname \$CODEPATH\`
if [ "\$APPDIR" = "/system/app" ] || [ "\$APPDIR" = "/ve
ndor/app" ] || [ "\$APPDIR" = "/system/framework" ] && [ "\$PWN" != "0 0 644" ];
then apply_permissions 0 0 644 \$CODEPATH
elif [ "\$APPDIR" = /d*/app ] && [ "\$PWN" != "1000 1000
644" ]; then apply_permissions 1000 1000 644 \$CODEPATH
elif [ "\$APPDIR" = /d*/app-private ] || [ "\`echo \$APP
DIR | grep asec\`" ] && [ "\$PWN" != "1000 \$PKGID 640" ]; then apply_permission
s 1000 \$PKGID 640 \$CODEPATH
fi
if [ -d \$DATAPATH ]; then Get_PWN \$DATAPATH
if [ "\$PWN" != "\$PKGID \$PKGID 755" ]; then ap
ply_permissions \$PKGID \$PKGID 755 \$DATAPATH; fi
DIRS=\`busybox find \$DATAPATH -mindepth 1 -type
d\`
for file in \$DIRS; do Get_PWN \$file
FNAME=\`busybox basename \$file\`
FPERM=771
NEWID=\$PKGID
case \$FNAME in
lib)PERM=755; NEWID=1000
; FPERM=755;;
shared_prefs|databases)PERM=660;;
cache)PERM=600;;
files)PERM=775;;
*)PERM=771;;
esac
if [ "\$PWN" != "\$NEWID \$NEWID \$FPERM
" ]; then apply_permissions \$NEWID \$NEWID \$FPERM \$file; fi
busybox find \$file -type f -maxdepth 2
! -perm \$PERM -exec chmod \$PERM {} ';'
busybox find \$file -type f -maxdepth 1
! -user \$NEWID -exec chown \$NEWID {} ';'
busybox find \$file -type f -maxdepth 1
! -group \$NEWID -exec chown :\$NEWID {} ';'
done
fi
echo " Fixed Permissions..." | tee -a \$LOG_FILE
fi
done < /data/pkgline.tmp
busybox sync
rm /data/pkgline.tmp
rm \$lastran 2>/dev/null
remount ro
STOP=\`busybox date +%s\`
ENDED=\`date\`
RUNTIME=\$((\$STOP-\$START))
HOURS=\$((\$RUNTIME/3600))
MINS=\$((\$RUNTIME/60%60))
SECS=\$((\$RUNTIME%60))
RUNTIME=\`busybox printf "%02d:%02d:%02d\n" "\$HOURS" "\$MINS" "\$SECS"\
`
echo "" | tee -a \$LOG_FILE
echo \$line | tee -a \$LOG_FILE
if [ "\$zipalign" ]; then
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 " \$NEW
Apps were checked (added since last run)" | tee
-a \$LOG_FILE
echo " \$ALIGNED
Apps were zipaligned" | tee -a \$LOG_FIL
E
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 "" | 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 | tee -a \$LOG_FILE
fi
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 "" | tee -a \$LOG_FILE
sleep 1
echo " See \$LOG_FILE for more details!"
echo ""
sleep 1
echo "
==============================" | tee -a \$LOG_FILE
echo "
) Fix Alignment Completed! (" | tee -a \$LOG_FILE
echo "
==============================" | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
sleep 1
if [ -d "/system/etc/init.d" ] && [ "\$interactive" ]; then Configure; f
i
}
if [ "\`ps | grep -m 1 [a]ndroid\`" ]; then Fix_Align
else exec > /data/BootLog_FixAlign.log 2>&1
Fix_Align &
fi
exit 0
EOF
chown 0.0 /data/V6_SuperCharger/!FixAlignment.sh; chmod 777 /data/V6_Sup
erCharger/!FixAlignment.sh
cp -fr /data/V6_SuperCharger/!FixAlignment.sh $storage/V6_SuperCharger/d
ata/V6_SuperCharger
cp -fr /data/V6_SuperCharger/!FixAlignment.sh /system/xbin/fixalign
cp -fr /data/V6_SuperCharger/!FixAlignment.sh $storage/V6_SuperCharger/s
ystem/xbin/fixalign
if [ "$1" ]; then echo " Re-Generating /system/xbin/fixalign..."
if [ ! -f "/system/xbin/fixalign" ] || [ "`diff /data/V6_SuperCh
arger/!FixAlignment.sh /system/xbin/fixalign`" ]; then
checkedspace=yes
info_free_space_error /system/xbin fixalign slim
fi
fi
if [ -d "/system/etc/init.d" ]; then
for i in /system/etc/init.d/*; do
if [ -f "$i" ] && [ "`grep -E "zipalign|packages\.xml|pm
list packages" "$i"`" ] && [ "`grep "771" "$i"`" ] && [ "`echo "$i" | grep -Ev
"Alignment|Emission|zepalign|fixfc|fixalign|disabled"`" ]; then
sed -i '1 a\
#\
# Fix Alignment (aka "fixalign") script disabled this script for additional opti
mization.\
# To Re-Enable this script, delete the zipalign and/or fix permissions stuff in
here and rename this file.\
#' "$i"
mv "$i" "$i.disabled_due_to_slow_zipalign_or_fix
_permissions Read_Comment_Inside_For_Fix"
fi
done
cp -fr /data/V6_SuperCharger/!FixAlignment.sh /system/etc/init.d
/95fixalign
cp -fr /data/V6_SuperCharger/!FixAlignment.sh $storage/V6_SuperC
harger/system/etc/init.d/95fixalign
if [ "$1" ]; then echo " Re-Generating /init.d/95fixalign..."
if [ ! -f "/system/etc/init.d/95fixalign" ] || [ "`diff
/data/V6_SuperCharger/!FixAlignment.sh /system/etc/init.d/95fixalign`" ]; then
checkedspace=yes
info_free_space_error /etc/init.d 95fixalign sli
m
fi
fi
fi
}
Re_Generate_FastEngineFlush(){
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=#
EOF
terms /data/V6_SuperCharger/\!FastEngineFlush.sh
cat >> /data/V6_SuperCharger/!FastEngineFlush.sh <<EOF
# 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
#
# 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!
#
# 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).
#
Decimal values ARE valid! ie. .1 = 6 minutes, .25 = 15 minutes, 2.5 = 2
hrs and 30 minutes (2.5 hrs duh).
#
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 and 30 minutes, make the li
ne read "flushOmaticHours=4.5".
#
# 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. "grep -hi [f]lush /proc/*/cmdline" - Sure-Fire method ;^]
#
The output should be 2 items:
#
a. "/data/V6_SuperCharger/!FastEngineFlush.sh" OR "/system/etc/init.d/
96superflush" OR "/system/xbin/flush"(depending on which script ran)
#
b. "Engine_Flush-O-Matic_is_In_Effect!" (sleep message)
# 4. "busybox ps | grep -i [f]lus" would give similar results as 3.
#
# For debugging, delete the # at the beginning of the following 2 lines, and che
ck /data/Debug_FastEngineFlush.log file to see what may have fubarred.
# set -x
# exec > /data/Debug_FastEngineFlush.log 2>&1
#
PATH=\$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin
if [ -d "/data/local/busybox*/xbin" ]; then PATH=\$PATH:\`ls -d /data/local/busy
box*/xbin 2>/dev/null\`; fi
line=================================================
cd "\${0%/*}" 2>/dev/null
mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
# To set the next line manually, see comments at the top for instuctions!
flushOmaticHours=$flushOmaticHours
if [ ! "\$flushOmaticHours" ] || [ "\`echo \$flushOmaticHours | grep "[^\.0-9]"\
`" ] || [ "\`echo \$flushOmaticHours | awk '\$1>24'\`" ]; then flushOmaticHours=
0
else flushOmaticHours=\`echo \$flushOmaticHours | awk '{print \$1*1}'\`
fi
intervalsecs="sleep \`echo \$flushOmaticHours | awk '{printf "%.0f\n", \$1*60*60
}'\`"
bootupminutedelay=7
bootupdelay="sleep \$((\$bootupminutedelay*60))"
if [ -t 0 ]; then interactive=yes; fi
if [ "\`busybox ps -w\`" ]; then w=" -w"; fi 2>/dev/null
LOG_FILE=/data/Ran_EngineFlush-O-Matic.log
remount(){
mount -o remount,\$1 /system 2>/dev/null
busybox mount -o remount,\$1 /system 2>/dev/null
busybox mount -o remount,\$1 \$(busybox mount | awk '/system /{print \$1
,\$3}') 2>/dev/null
}
Configure(){
echo " Engine Flush-O-Matic Options..."
echo " ==============================="
echo ""
sleep 1
echo " Current Status..."
echo ""
sleep 1
echo \$line
if [ "\`echo \$flushOmaticHours | awk '\$1>0'\`" ]; then echo " Engine F
lush-O-Matic is ON @ \$flushOmaticHours hr intervals!"
else echo " Engine Flush-O-Matic is Currently OFF!"
fi
echo \$line
echo ""
sleep 1
if [ ! "\$FOMactive" ]; then
echo " If desired, you can change options for..."
echo ""
sleep 1
echo "
...Engine Flush-O-Matic!"
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
echo \$line
echo " You can also configure this in Driver Options!"
echo \$line
echo ""
sleep 1
echo " Note that if enabled, caches are dumped..."
echo ""
sleep 1
echo "
...only when the screen is off!"
echo ""
sleep 1
echo " This is cuz you don't want your device to..."
echo ""
sleep 1
echo " ...take a big dump and flush..."
echo ""
sleep 1
echo "
...when you're taking care of business!"
echo ""
sleep 1
if [ -d "/system/etc/init.d" ]; then
echo " Also note that when it's enabled..."
echo ""
sleep 1
echo \$line
echo " -=Engine Flush-O-Matic=- on boot is AUTOMAGIC!"
echo \$line
echo ""
sleep 1
echo " If disabled, it will Flush once after boot up!"
echo ""
sleep 1
echo " Just Check /data/BootLog_FastEngineFlush.log!"
echo ""
$sleep
fi
echo \$line
echo " Also READ THE COMMENTS inside this script!"
echo \$line
echo ""
sleep 1
fi
echo " Change Engine Flush-O-Matic Options?"
echo ""
sleep 1
echo -n " Enter Y for Yes, any key for No: "
read changeoptions
echo ""
echo \$line
case \$changeoptions in
y|Y)changedopt=yes
remount rw
echo ""
sleep 1
echo " Enable Engine Flush-O-Matic?"
while :; do
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=- ENABLE
D!!"
echo \$line
echo ""
sleep 1
echo " Note that you CAN enter a decimal
value!"
echo ""
sleep 1
echo " ie. \".1\"=6 mins, \".25\"=15 min
s, \"2.5\"=2.5 hrs"
echo ""
sleep 1
echo " Low values like .1 MAY benefit Ga
mers... ? :P"
echo ""
sleep 1
echo " How often do you want it to flush
?"
while :; do
echo ""
sleep 1
echo -n " Enter a value from 1 t
o 24 (hours): "
read flushOmaticHours
echo ""
echo \$line
if [ "\$flushOmaticHours" ] && [
"\`echo \$flushOmaticHours | grep -v "[^\.0-9]"\`" ] && [ "\`echo \$flushOmatic
Hours | awk '\$1<=24'\`" ]; then
flushOmaticHours=\`echo
\$flushOmaticHours | awk '{print \$1*1}'\`
echo " Engine Flush-O-Ma
tic Set To Run Every \$flushOmaticHours Hours!"
break 2
fi
echo "
Invalid entry... Ple
ase try again :p"
echo \$line
done;;
d|D)flushOmaticHours=0
echo "
-=Engine Flush-O-Matic=- DI
SABLED!!"
break;;
*)echo "
Invalid entry... Please try agai
n :p"
echo \$line;;
esac
done
sed -i '/^flushOmaticHours=/s/=.*/='\$flushOmaticHours'/' \$0
for hsulf in /data/V6_SuperCharger/!FastEngineFlush.sh /system
/xbin/flush /system/etc/init.d/96superflush; do
if [ "\$0" != "\$hsulf" ]; then sed -i '/^flushOmaticHou
rs=/s/=.*/='\$flushOmaticHours'/' \$hsulf; fi
done 2>/dev/null
if [ -f "/data/V6_SuperCharger/SuperChargerOptions" ]; then
awk 'BEGIN{OFS=FS=","}{\$16='\$flushOmaticHours';print}'
/data/V6_SuperCharger/SuperChargerOptions > /data/V6_SuperCharger/SuperChargerO
ptions.tmp
mv /data/V6_SuperCharger/SuperChargerOptions.tmp /data/V
6_SuperCharger/SuperChargerOptions
fi
remount ro;;
*)echo "
No Change For You!";;
esac
echo \$line
echo ""
sleep 1
}
install(){
if [ ! -f "\$1" ] && [ ! "\`grep \$ver "\$1"\`" ]; then
echo " Installing myself to \${1#*etc}"
echo ""
sleep 2
remount rw
dd if=\$0 of=\$1
chown 0.0 \$1; chmod 777 \$1
remount ro
elif [ "\`echo \$1 | grep xbin\`" ]; then
echo " \$1 is already up to date..."
echo ""
sleep 3
fi 2>/dev/null
if [ "\`echo \$1 | grep xbin\`" ]; then
echo " To run, type in Terminal: \"su -c \${1##*/}\""
echo ""
sleep 3
fi
}
Flush_Engine(){
while [ ! "\`ps | grep -m 1 [a]ndroid\`" ]; do sleep 10; done
if [ "\`busybox ps | grep Flush | grep Effect\`" ]; then FOMactive=yes;
fi
echo "" | tee -a \$LOG_FILE
if [ -d "/system/etc/init.d" ] && [ "\`echo \$0 | grep -v "init\.d"\`" ]
; then install /system/etc/init.d/96superflush; fi
if [ "\`echo \$0 | grep -v xbin\`" ]; then install /system/xbin/flush; f
i
if [ "\`echo \$flushOmaticHours | awk '\$1>0'\`" ]; then
flushmode=" -=Engine Flush-O-Matic=- by -=zeppelinrox=-"
echo " Engine Flush-O-Matic is enabled!" >> \$LOG_FILE
echo "" >> \$LOG_FILE
else flushmode="
-=Fast Engine Flush=- by -=zeppelinrox=-"
fi
echo " \$( date +"%m-%d-%Y %H:%M:%S" )" | tee -a \$LOG_FILE
echo ""
animspeed="busybox sleep 0.125"
if [ -f "/data/FOMbootup" ]; then rm /data/FOMbootup
echo " Delaying First Flush for \$bootupminutedelay minutes (mak
e sure something stinks lol)" | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
\$bootupdelay | grep "Flush_On_Boot_Delay__is_In_Effect!"
elif [ -f "/data/FOMsleep" ]; then rm /data/FOMsleep
echo " Now letting stuff build up for \$flushOmaticHours hours..
. heh." | tee -a \$LOG_FILE
echo "" | tee -a \$LOG_FILE
\$intervalsecs | grep "Engine_Flush-O-Matic_is_In_Effect!"
elif [ ! "\$FOMactive" ]; then
clear;sleep 1;echo \$line;echo "";echo "";echo "";echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";\$anim
speed
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 "";ec
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.dro
p_caches=3
echo \$line
echo ""
sleep 3
busybox sysctl -w vm.drop_caches=1 1>/dev/null
ramused=\$((\`free | awk '/Mem:/{print \$3}'\`/1024))
ramkbytesfree=\`free | awk '/Mem:/{print \$4}'\`
ramkbytescached=\`awk '/^Cached:/{print \$2}' /proc/meminfo\`
ramfree2=\$((\$ramkbytesfree/1024));ramcached2=\$((\$ramkbytesca
ched/1024));ramreportedfree2=\$((\$ramfree2 + \$ramcached2))
echo \$line
echo "
...RAM Stats AFTER Engine Flush"
echo \$line
echo ""
sleep 1
echo " Total: \$ram MB Used: \$ramused MB True Free: \$ramfree
2 MB"
echo ""
sleep 1
echo " Reported Free by most tools: \$ramreportedfree2 MB Free R
AM!"
echo ""
sleep 1
echo \$line
echo " True Free \$ramfree2 MB = \"Free\" \$ramreportedfree2 - C
ached Apps \$ramcached2"
echo \$line
echo ""
sleep 1
echo " ...OR...
True Free RAM \$ramfree2"
echo "
Cached Apps + \$ramcached2"
echo "
========"
echo "
Reported \"Free\" RAM = \$ramreportedfree2 MB"
echo ""
echo \$line
echo ""
sleep 1
echo "
True Free RAM Change = \$((\$ramfree2 - \$ramfree)) M
B = \$ramfree2 - \$ramfree"
echo ""
sleep 1
echo "
Cached Apps Change = \$((\$ramcached2 - \$ramcached
)) MB = \$ramcached2 - \$ramcached"
echo ""
sleep 1
echo " Reported Free RAM Change = \$((\$ramreportedfree2 - \$ram
reportedfree)) MB = \$ramreportedfree2 - \$ramreportedfree"
echo ""
sleep 1
echo \$line
echo "
...Enjoy Your Quick Boost ;^]"
echo \$line
echo ""
sleep 1
echo " Check out \$LOG_FILE..."
echo ""
sleep 1
echo "
...for the most recent details!"
echo ""
sleep 1
echo "
====================================="
if [ "\`echo \$flushOmaticHours | awk '\$1>0'\`" ]; then echo "
) Engine Flush-O-Matic Completed! ("
else echo "
) Fast Engine Flush Completed! ("
fi
echo "
====================================="
echo ""
sleep 1
fi | tee -a \$LOG_FILE
if [ "\$interactive" ]; then Configure; fi
if [ ! "\`echo \$flushOmaticHours | awk '\$1>0'\`" ]; then
echo " And Hey! Init.d Start Up Scripts Are Working!"
echo ""
exit 0
elif [ "\$FOMactive" ] || [ "\`busybox ps | grep Flush | grep Effect\`"
]; then
echo \$line
echo " -=Engine Flush-O-Matic=- is already in memory!"
echo \$line
echo ""
sleep 1
exit 69
elif [ "\$changedopt" ]; then
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 \$LOG_FILE!"
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 "
...\"grep -hi [f]lush /proc/*/cmdline\"!"
echo ""
sleep 1
echo " The output should look like this:"
echo ""
sleep 1
echo " /data/V6_SuperCharger/!FastEngineFlush.sh..."
echo " OR /system/etc/init.d/96superflush"
echo " OR /system/xbin/flush (just one of them)"
echo " Engine_Flush-O-Matic_is_In_Effect!"
echo ""
sleep 1
echo " Easier: Similar results can be had with..."
echo ""
sleep 1
echo "
...\"busybox ps | grep -i [f]lus\""
echo ""
sleep 1
echo " ...OR run this script again...I'll tell ya LOL"
echo ""
sleep 1
echo \$line
echo " Now executing -=Engine Flush-O-Matic=-..."
echo \$line
echo ""
sleep 1
fi
echo \$line
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 ""
sleep 1
if [ "\`busybox --help | grep nohup\`" ] && [ ! "\`busybox ps\$w | grep
"{.*/\${0##*/}"\`" ]; then echo "cookie!" > /data/FOMsleep; (busybox nohup \$0 >
/dev/null &)
elif [ "\`busybox --help | grep start-stop-daemon\`" ] && [ ! "\`busybox
ps\$w | grep "{.*/\${0##*/}"\`" ]; then echo "cookie!" > /data/FOMsleep; busybo
x start-stop-daemon -S -b -x \$0
else echo "cookie!" > /data/FOMsleep; \$0 > /dev/null & exit 0
fi
}
if [ "\`ps | grep -m 1 [a]ndroid\`" ]; then Flush_Engine
else exec > /data/BootLog_FastEngineFlush.log 2>&1
echo "cookie!" > /data/FOMbootup
rm \$LOG_FILE 2>/dev/null
Flush_Engine &
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_SuperCharge
r/data/V6_SuperCharger
cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh /system/xbin/flush
cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh $storage/V6_SuperCharge
r/system/xbin/flush
if [ "$1" ]; then echo " Re-Generating /system/xbin/flush..."
if [ ! -f "/system/xbin/flush" ] || [ "`diff /data/V6_SuperCharg
er/!FastEngineFlush.sh /system/xbin/flush`" ]; then
checkedspace=yes
info_free_space_error /system/xbin flush slim
fi
fi
if [ -d "/system/etc/init.d" ]; then
cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh /system/etc/ini
t.d/96superflush
cp -fr /data/V6_SuperCharger/!FastEngineFlush.sh $storage/V6_Sup
erCharger/system/etc/init.d/96superflush
if [ "$1" ]; then echo " Re-Generating /init.d/96superflush..."
if [ ! -f "/system/etc/init.d/96superflush" ] || [ "`dif
f /data/V6_SuperCharger/!FastEngineFlush.sh /system/etc/init.d/96superflush`" ];
then
checkedspace=yes
info_free_space_error /etc/init.d 96superflush s
lim
fi
fi
fi
}
Re_Generate_SuperClean(){
cat > /data/V6_SuperCharger/!SuperClean.sh <<EOF
#!/system/bin/sh
#
# SuperClean & ReStart Script (Wipe Dalvik Cache & Reboot) created by -=zeppelin
rox=#
EOF
terms /data/V6_SuperCharger/\!SuperClean.sh
cat >> /data/V6_SuperCharger/!SuperClean.sh <<EOF
PATH=\$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin
if [ -d "/data/local/busybox*/xbin" ]; then PATH=\$PATH:\`ls -d /data/local/busy
box*/xbin 2>/dev/null\`; fi
clear
line=================================================
echo ""
echo \$line
echo " -=SuperClean & ReStart=- by -=zeppelinrox=-"
echo \$line
echo ""
sleep 1
echo " Version: $ver"
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
/xbin/zepalign /system/etc/init.d/93zepalign; do
if [ -f "$ngilapez" ]; then sed -i '/^bootzepalign=/s/=.
*/='$zepalign'/' $ngilapez; fi
done
elif [ "$1" = "fixfc" ]; then
for cfxif in /data/V6_SuperCharger/!FixEmissions.sh /system/xbin
/fixfc /system/etc/init.d/94fixfc; do
if [ -f "$cfxif" ]; then sed -i '/^bootfixemissions=/s/=
.*/='$fixemissions'/' $cfxif; fi
done
elif [ "$1" = "fixalign" ]; then
for ngilaxif in /data/V6_SuperCharger/!FixAlignment.sh /system/x
bin/fixalign /system/etc/init.d/95fixalign; do
if [ -f "$ngilaxif" ]; then sed -i '/^bootfixalign=/s/=.
*/='$fixalign'/' $ngilaxif; fi
done
elif [ "$1" = "flush" ]; then
for hsulf in /data/V6_SuperCharger/!FastEngineFlush.sh /system/x
bin/flush /system/etc/init.d/96superflush; do
if [ -f "$hsulf" ]; then sed -i '/^flushOmaticHours=/s/=
.*/='$flushOmaticHours'/' $hsulf; fi
done
fi
}
update_options(){
echo "$speed,$buildprop,$animation,$initrc,$launcheradj,$panicmode,$pyne
ss,$propaccessories,$tc3g,$sdtweak,$bpwait,$detailinterval,$zepalign,$fixemissio
ns,$fixalign,$flushOmaticHours" > /data/V6_SuperCharger/SuperChargerOptions
cp -fr /data/V6_SuperCharger/SuperChargerOptions $storage/V6_SuperCharge
r/data/V6_SuperCharger
}
show_current_options(){
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 echo " are Rock Hard!"
elif [ "$panicmode" -eq 2 ]; then echo " - Rock & Roll!"
elif [ "$panicmode" -eq 1 ]; then echo " ala Soft Rock!"
else echo " - Disco Dance!"
fi
echo $line
$sleep
echo -n "
Entropy-ness Enlarger - "
if [ "$pyness" -eq 0 ]; then echo "NO!"
Enabled @ Ev
Engine Flus
"
"
"
"
Ash(){
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
""
" :ttFFyr,"
"
.;10Z8Ft@RF;.
,
l"
"
.iH8@@@@@@@QE0Wyl.r F @Qh:i,,,:Y;"
"
.:lY1B@Q@Q@QLL@Q@Q@@@Q@Q@@"
"
, ,,:, YJ,@@,.vh0R@Q1"
"
h@@@@Q@
@Q@L"
"
SQ@Q@@@@@
@Q@"
"
@Q@Q1 UQW
@@l"
"
0@Q ..,lFEQ
@@@"
"
:FL r, ,
@@@"
"
,h
rv
Q@"
"
..LrBl ,
.@Q@:"
"
,vl@Q@QB ,@@Q0"
"
R L@Q@Q@@@Q.,hQ@8"
"
,@K :;@@QR@@Q@Q@L"
"
,. @Q@M UCHQQFR@Q@@"
"
iv,t0Q@Q@Q@0JR@,0Q@Qr"
"
.L@Cl Q@@Q@FB0ZQZ@@Q@Fl"
"
MEQ0, :@Q@0tQ@R@Q@Q@Q@@:"
"
.@0: :JQ8Q@Q@@SJ.B@Q@:"
"
i@FL v@@Q@@@QZQ@ F@@@Q."
"
;Z@QFR@Q@Q@RQQ@.KR@QQ@@"
"
i0Q@QRQYFORZ@@Q :.FQl"
}
bOOM_Stick_End_Credits(){
echo " Alright you Primitive Screwheads, listen up!"
echo ""
$sleep
echo " You see this? This... is my..."
echo ""
$sleep
if [ "$1" = "zOOM" ]; then
echo "___________________ ________ ______ ____ ___"
echo "________________/ /_
/ __ \ / __ \ / |/ /"
echo "_______________/ __ \ / / / / / / / / / /|_/ /"
echo "______________/ /_/ / / /_/ / / /_/ / / / / /"
echo "_____________/_,___/ \____/ \____/ /_/ /_/"
Ash
echo "________________________________________ _______"
echo "________/ ___/ /_ __/ / _/ / ____/ / //_/ / /"
echo "________\__ \ / /
/ / / /
/ <
/ /"
echo "__________/ / / / _/ / / /___ / /| | /_/"
echo "______/____/ /_/ /___/ \____/ /_/ |_| (_)"
elif [ "$1" = "vrOOM" ]; then
echo "________________________________________________"
echo "
__
__
_ _"
echo "
/
/
) /
) / /|"
echo "
/__
/
/ /
/ /| / |"
echo "
/ ) /
/ /
/ / |/ |"
echo "_____________(___/__(____/___(____/___/__/___|__"
Ash
echo "________________________________________________"
echo "
__ ______ __
__
_
_
/"
echo "
/
) /
/
/
) / ,'
/"
echo "
\
/
/
/
/_,'
/"
echo "
\
/
/
/
/ \
/"
echo "___(____/____/_____/____(____/___/____\___o_____"
else
echo
echo
echo
echo
echo
Ash
echo
echo
echo
echo
echo
"
__
____
____
__ ___"
"
/ /_
/ __ \ / __ \ / |/ /"
" / __ \ / / / / / / / / / /|_/ /"
" / /_/ / / /_/ / / /_/ / / / / /"
" /_,___/ \____/ \____/ /_/ /_/"
"
"
"
"
"
fi
echo ""
$sleep
echo " Too many \"Drive Me Crazy\" with lack of info..."
echo ""
$sleep
echo "
...so you have 2 versions in /data..."
echo ""
$sleep
echo "
...The RAW and the COOKED!"
echo ""
$sleep
echo $line
echo " Post them with your launcher status questions!"
echo $line
echo ""
$sleep
echo " FYI, when the launcher is Die-Hard..."
echo ""
$sleep
echo "
...it's the ONLY process with ADJ 1!"
echo ""
}
bOOM(){
adj=`echo $psinfo | awk '{print $1}'`; apkname=
pid=`echo $psinfo | awk '{print $2}'`
appname=`echo $psinfo | awk '{print $3}'`
if [ "$adj" -eq "$HL" ] && [ "$lname" = "$appname" ]; then
echo " Home Launcher is on the NEXT line! (ADJ=$HL)"
fi
if [ "$boomstick" = "vrOOM" ]; then
if [ "`echo $appname | grep -v "/"`" ] || [ "`echo $appn
ame | grep "\."`" ]; then
apkname=$(busybox find / -iname "*`basename $app
name`*.apk" -maxdepth 3 | tail -n 1)
fi
fi
if [ "$apkname" ]; then echo $adj $pid $appname $apkname | awk '
{printf "%4s %-7s %-1s\n",$1," "$2,$3" ("$4")"}'
else echo $adj $pid $appname | awk '{printf "%4s %-7s %-1s\n",$1
," "$2,$3}'
fi
if [ "$adj" -eq "$HL" ] && [ "$lname" = "$appname" ]; then echo
""; fi
}
rm -f /data/!bOOM_Stick*.tmp
echo "" | tee /data/!bOOM_Stick_COOKED.log
bOOM_Stick_Title_Sequence $boomstick
echo "" > /data/!bOOM_Stick_RAW.log
else
echo " VISIBLE_APP OOM GROUPING"
echo " ========================"
if [ "$HL" -gt "$oomadj1" ] && [ "$HL" -le "$oomadj2" ];
then
echo ""
echo " HOME LAUNCHER IS IN HERE! (ADJ=$HL)"
echo ""
fi
awk '$1>'$oomadj1' && $1<='$oomadj2 /data/!bOOM_Stick_CO
OKED.tmp | while read psinfo; do bOOM; 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
awk '$1>'$oomadj2' && $1<='$oomadj3 /data/!bOOM_Stick_COOKED.tmp
| while read psinfo; do bOOM; 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
awk '$1>'$oomadj3' && $1<='$oomadj4 /data/!bOOM_Stick_COOKED.tmp
| while read psinfo; do bOOM; 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
awk '$1>'$oomadj4' && $1<='$oomadj5 /data/!bOOM_Stick_COOKED.tmp
| while read psinfo; do bOOM; 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
awk '$1>'$oomadj5' && $1<='$oomadj6 /data/!bOOM_Stick_COOKED.tmp
| while read psinfo; do bOOM; done
echo ""
echo $line
if [ "$boomstick" = "vrOOM" ]; then echo "
vrOOM Sti
ck Complete!"
else echo "
zOOM Stick Complete!"
fi
fi >> /data/!bOOM_Stick_COOKED.log
awk '/====/,0' /data/!bOOM_Stick_COOKED.log
if [ "$boomstick" ]; then
echo $line
$sleep
get_ram_info
echo ""
$sleep
fi | tee -a /data/!bOOM_Stick_COOKED.log
if [ "$1" ]; then bOOM_Stick_End_Credits $1; fi
rm -f /data/!bOOM_Stick*.tmp
}
get_launcher_status echo
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 `busybox ps | grep -v ] | awk '{print $1}'`; do
if [ "`cat /proc/$i/$oom_adj`" -eq 1 ] || [ "`cat /proc/$i/$oom_
adj`" -eq 58 ]; then
HL=1
lname=$(basename `cat /proc/$i/cmdline`)
break
fi
done 2>/dev/null
fi
if [ "$lname" ]; then
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 "
else echo "!"
fi
else
echo ""
$sleep
echo " No home launcher detected in memory..."
echo ""
$sleep
echo "
...so it must have gotten killed already!"
fi
echo ""
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
if [ "$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
get_oomadj_info
MFK_Calculator
if [ ! -f "$storage/V6_SuperCharger/data/V6_SuperCharger/SuperChargerAdj" ]; the
n rookie=yes; fi
if [ ! "$rookie" ] && [ ! "`grep "SuperCharger" /system/build.prop`" ]; then new
supercharger=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/data/V6_SuperCharger/SuperCha
rgerMinfree
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!"
if [ "`awk -F , '{print $16}' $storage/V6_SuperCharger/d
ata/V6_SuperCharger/SuperChargerOptions`" ]; then
missingoptions=
speed=`awk -F , '{print $1}' $storage/V6_SuperCh
arger/data/V6_SuperCharger/SuperChargerOptions`
sleep="sleep $speed"
fi
autoresupercharge=indeed; firstgear=;;
*)echo " Re-SuperCharging Declined... meh..."
if [ "$firstgear" ]; then
echo $line
echo ""
$sleep
echo " Going to load Driver Options instead!"
echo ""
fi;;
esac
fi
if [ "$firstgear" ] && [ ! "$newsupercharger" ]; 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" ] && [ ! "$firstgear" ]; then
if [ "$autoresupercharge" ]; then
echo $line
echo ""
$sleep
echo $line
fi
echo "
Missing Some NEW Options!!"
echo $line
echo ""
$sleep
echo " You need to refresh them so..."
echo ""
$sleep
if [ "$autoresupercharge" ]; then
echo "
...Driver Options will be loaded..."
echo ""
$sleep
echo "
...Before Re-SuperCharging!"
else
echo "
...will make a Pit Stop in..."
echo ""
$sleep
echo "
...Driver Options!"
fi
echo ""
elif [ ! "$firstgear" ] && [ ! "$newsupercharger" ]; then
if [ ! "$crapp" ]; then script_version_check; fi
show_current_options
echo ""
$sleep
echo " All settings can be changed in Driver Options!"
echo ""
$sleep
echo $line
echo " Note: You can bake $initrcpath into your ROM!"
fi
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;restore=0;quickcharge=0;calculator
charge=0;revert=0;ReSuperCharge=0;UnSuperCharged=0;UnSuperChargerError=0;SuperCh
argerScriptManagerHelp=0;SuperChargerHelp=0;scservice=;bpservice=;slot=;backedup
=;HazEgg=
get_oomadj_info
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 $storagename/!SuperCharger.html"
echo $line
$sleep
get_launcher_status
echo " \\\\\\\\ T H E V 6 S U P E R C H A R G E R ////"
echo " ============================================"
echo "
\\\\\\\\
Driver's Console
////"
echo "
=============================="
echo ""
echo "1. SuperCharger & Launcher Status{U9RC12BD63457}"
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 , '{printf "%22s\n","{"$1/
256","$2/256","$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 "
}"
echo $line
echo "15. The bOOM Stick
{Verify OOM Groupings}"
echo $line
echo "
}"
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
echo
if [
fi
echo
echo
if [
o....
elif
3
elif
elif
3
else
fi
echo ""
echo $line
sleep 2
echo -n " SuperCharger ADJ Entries "
if [ "$servicesjarpatched" ]; then ADJs=1; scpercent=$(($scpercent+25))
echo -n "ARE Patched In"
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/data/V6_SuperCharger/S
uperChargerMinfree`" ] && [ "$ran" -eq 0 ]; then
echo " Re-SuperCharger Settings on $storagename..."
echo ""
awk -F , '{print "
"$1/256", "$2/256", "$3/256", "$4/
256", "$5/256", "$6/256" MB"}' $storage/V6_SuperCharger/data/V6_SuperCharger/Sup
erChargerMinfree
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
echo
if [
else
fi
$line
-n " BulletProof Apps Service is "
"$bpservice" ]; then echo "Installed!"
echo "NOT Installed!"
fi
echo $line
fi
if [ ! "`ls /system/etc/init.d/*BulletProof_Apps*`" ] && [ ! -f "/data/97Bullet
Proof_Apps.sh" ]; then echo "
BulletProof Apps Script is NOT Installed!"
elif [ "$bpwait" -eq 0 ]; then echo "
BulletProof Apps Script is NOT Enabled
!"
elif [ "`busybox ps$w | grep [B]ulletProof`" ]; then
for i in `busybox ps$w | grep [B]ullet`; do
if [ "`echo $i | grep Effect`" ]; then echo "
$i"; ech
o $line
elif [ "`echo $i | grep "init\.d"`" ]; then echo " `echo $i | se
d 's/.*etc//'` is Running!"; echo $line
elif [ "`echo $i | grep data`" ]; then echo "$i is Running!"; ec
ho $line
fi
done
ldone=yes
else echo "
BulletProof Apps Script is ON & NOT in RAM!"
echo $line
if [ "`ls /system/etc/init.d/*BulletProof_Apps*`" ]; then echo " `ls /sy
stem/etc/init.d/*BulletProof_Apps* | sed 's/.*etc//'` is NOT Running!"
else echo "/data/97BulletProof_Apps.sh is NOT Running!"
fi
fi 2>/dev/null
if [ "$ldone" ]; then ldone=
else echo $line
fi
if [ -f "/data/Ran_BulletProof_Apps.log" ]; then lastbulletproof=`awk -F ": " '
/BulletProofing Apps/{print $1}' /data/Ran_BulletProof_Apps.log`; fi
if [ "$lastbulletproof" ]; then
echo " Last BulletProof Time was$lastbulletproof"
echo $line
fi
if [ ! -f "/system/etc/init.d/96superflush" ] && [ ! -f "/system/xbin/flush" ]
&& [ ! -f "/data/V6_SuperCharger/!FastEngineFlush.sh" ]; then echo "
Fa
st Engine Flush is NOT Installed!"
elif [ "`echo $flushOmaticHours | awk '$1==0'`" ]; then echo "
Engine Flu
sh-O-Matic is NOT Enabled!"
elif [ "`busybox ps$w | grep -i [f]lush | grep -v ]`" ]; then
for i in `busybox ps$w | grep -i [f]lush | grep -v ]`; do
if [ "`echo $i | grep Effect`" ]; then echo "
$i"; echo $l
ine
elif [ "`echo $i | grep "init\.d"`" ]; then echo " `echo $i |
sed 's/.*system//'` is Running!"; echo $line
elif [ "`echo $i | grep xbin`" ]; then echo "
$i is Runn
ing!"; echo $line
elif [ "`echo $i | grep data`" ]; then echo "
`basename $
i` is Running!"; echo $line
fi
done
ldone=yes
else echo "
Engine Flush-O-Matic is ON & NOT in RAM!"
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
if [ "$postics" ]; then echo " Lose 25% - services.jar ADJs are
NOT Patched In"
else echo " Lose 25% - build/local.prop ADJs NOT Found"
fi
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!"
load_help_file
fi 2>/dev/null
fi
echo -n "
Please Enter Option [1 - 34]: "
if [ "$crapp" ]; then opt=69; echo "Not so fast!"; sleep 4
elif [ "$firstgear" ] || [ "$missingoptions" ]; then opt=30; echo $opt
elif [ "$autoresupercharge" ]; then opt=24; echo $opt
elif [ "$autoshowcalculated" ] && [ "$currentminfree" != "$calculatedminfree" ]
; then opt=10; echo $opt
elif [ "$postics" ] && [ "$scadj" ] && [ "$showparlor" ] && [ ! "$showedparlor"
]; then opt=26; echo $opt
elif [ "$ADJs" -eq 0 ] || [ "$oomstick" -eq 0 ] && [ ! "$showedboomstick" ] &&
[ ! "$showedparlor" ]; then opt=1; echo $opt
else read opt
fi
$sleep
echo $line
echo "
\\\\\\\\ V6 SUPERCHARGER ////"
echo "
======================="
echo ""
$sleep
if [ "$opt" -ge 1 ] && [ "$opt" -le 30 ] || [ "$opt" -eq 33 ] || [ "$crapp" ];
then didsomething=yes
remount rw
if [ -d "/sqlite_stmt_journals" ]; then madesqlitefolder=0
else mkdir /sqlite_stmt_journals; madesqlitefolder=1
fi
if [ "$opt" -ne 14 ] && [ ! "$crapp" ]; then
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
fi
echo " Input Error!
Try aga
in :p"; sleep 2
done
while :; do
echo -n "
Slot 3: "; read MB3
if [ "$MB3" = "X" ] || [ "$MB3" = "x" ]; then br
eak 2
elif [ "$MB3" -gt "$MB2" ]; then break
fi
echo " Input Error!
Try aga
in :p"; sleep 2
done
while :; do
echo -n "
4
if [ "$MB4" = "X" ] || [ "$MB4" = "x" ]; then br
eak 2
elif [ "$MB4" -gt "$MB3" ]; then break
fi
echo " Input Error!
Try aga
in :p"; sleep 2
done
while :; do
echo -n "
MB5
if [ "$MB5" = "X" ] || [ "$MB5" = "x" ]; then br
eak 2
elif [ "$MB5" -gt "$MB4" ]; then break
fi
echo " Input Error!
Try aga
in :p"; sleep 2
done
while :; do
echo -n "
d MB6
if [ "$MB6" = "X" ] || [ "$MB6" = "x" ] || [ "$M
B6" -gt "$MB5" ]; then break 2; fi
echo " Input Error!
Try aga
in :p"; sleep 2
done
done 2>/dev/null
echo ""
if [ "$MB6" -gt 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=27;;
*)echo $line
echo "
Cust-OOMizer Settings Accepted!"
;;
esac
fi
fi
if [ "$MB6" -eq 0 ]; then opt=27; 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
update_options
echo $line
echo "
Driver Options Updated!"
else
if [ "$postics" ]; then info_ADJs_no_worky
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=27
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 info_ADJs_no_worky
if [ "$servicesjarpatched" ]; then
echo " Hey your services.jar is already patched..."
echo ""
$sleep
echo "
...with a Die-Hard Launcher..."
echo ""
$sleep
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=27;;
esac;;
15)echo "
======================="
echo "
//// THE bOOM STICK! \\\\\\\\";;
16)echo "
========================"
echo "
//// BULLETPROOF APPS \\\\\\\\";;
17)if [ "`echo $flushOmaticHours | awk '$1>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;echo "
\\\\\\\\ V6 SUPERCHA
RGER ////";echo "
=======================";echo "";echo "";echo "";e
cho "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";$
animspeed
clear;echo "";echo "";echo $line;echo "
\\\\\\\\ V6 SUPERCHA
RGER ////";echo $line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";ec
ho "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo "";echo "";echo $line;echo "
\\\\\\\\ V6 SUPERCHA
RGER ////";echo "
=======================";echo $line;echo "";echo "
";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "
";$animspeed
clear;echo "";echo "";echo $line;echo "
\\\\\\\\ V6 SUPERCHA
RGER ////";echo "$flushmodebar";echo "$flushmode";echo $line;echo "";echo "";ech
R ////";echo "
=======================";echo "";echo "$flushmodebar"
;echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";echo "";echo "";ec
ho "";echo "";$animspeed
clear;echo "
======================================";echo "
zoom...";echo $line;echo "
\\\\\\\\ V6 SUPERCHARGER ////";ec
ho "
=======================";echo "";echo "$flushmodebar";echo "$fl
ushmode";echo $line;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo
"";$animspeed
clear;echo $line;echo " zoom...";echo $line;echo "
\\\\\\\\
V6 SUPERCHARGER ////";echo "
=======================";echo "";echo "
$flushmodebar";echo "$flushmode";echo $line;echo "";echo "";echo "";echo "";echo
"";echo "";echo "";echo "";$animspeed
clear;echo $line;echo " zoom...
zoom..."
;echo $line;echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo "
=======================";echo "";echo "$flushmodebar";echo "$flushmode";echo $li
ne;echo "";echo "";echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo $line;echo " zoom...
zoom...";echo $line
;echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo "
===========
============";echo "";echo "$flushmodebar";echo "$flushmode";echo $line;echo "";
echo "";echo "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo $line;echo " zoom...
zoom...";echo $line;echo "
\\\\\\\\ V6 SUPERCHARGER ////";echo "
=====================
==";echo "";echo "$flushmodebar";echo "$flushmode";echo $line;echo "";echo "";ec
ho "";echo "";echo "";echo "";echo "";echo "";$animspeed
clear;echo $line;echo " zoom... zoom...";echo $line;echo "
\
\\\\\\\ V6 SUPERCHARGER ////";echo "
=======================";echo "
";echo "$flushmodebar";echo "$flushmode";echo $line;echo "";echo "";echo "";echo
"";echo "";echo "";echo "";echo "";busybox sleep 0.5
clear;echo $line;echo " zOOM... zOOM...";echo $line;echo "
\
\\\\\\\ V6 SUPERCHARGER ////";echo "
=======================";echo "
";echo "$flushmodebar";echo "$flushmode";echo $line;echo "";echo "";echo "";echo
"";echo "";echo "";echo "";echo "";busybox sleep 0.5
clear;echo $line;echo " zoom... zoom...";echo $line;echo "
\
\\\\\\\ V6 SUPERCHARGER ////";echo "
=======================";echo "
";echo "$flushmodebar";echo "$flushmode";echo $line;echo "";echo "";echo "";echo
"";echo "";echo "";echo "";echo "";busybox sleep 0.5
clear;echo $line;echo " zOOM... zOOM...";echo $line;echo "
\
\\\\\\\ V6 SUPERCHARGER ////";echo "
=======================";echo "
";echo "$flushmodebar";echo "$flushmode";echo $line;echo "";echo "";echo "";echo
"";echo "";echo "";echo "";echo "";busybox sleep 1
clear;echo $line;echo " zOOM... zOOM...";echo $line;echo "
\
\\\\\\\ V6 SUPERCHARGER ////";echo "
=======================";echo "
";echo "$flushmodebar";echo "$flushmode";;
18)echo "
================="
echo "
//// DETAILING \\\\\\\\";;
19)echo "
======================="
echo "
//// WHEEL ALIGNMENT \\\\\\\\";;
20)echo "
====================="
echo "
//// FIX EMISSIONS \\\\\\\\";;
21)echo "
====================="
echo "
//// FIX ALIGNMENT \\\\\\\\";;
22)echo "
==========================="
echo "
//// NITRO LAG NULLIFIER \\\\\\\\";;
23)echo "
======================"
echo "
//// SYSTEM INSTALL \\\\\\\\";;
24)echo "
======================="
echo "
//// RE-SUPERCHARGER \\\\\\\\";;
25)echo "
================================="
echo "
//// SUPER SCRIPT RE-GENERATOR \\\\\\\\";;
26)echo "
============================"
echo "
//// JELLY ISCREAM PARLOR \\\\\\\\"
if [ "$preics" ]; then opt=27
echo $line
echo ""
$sleep
echo "
FAIL: This is a PRE-ICS ROM! lol"
echo ""
fi;;
27)echo "
====================="
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 "";;
28)echo "
====================="
echo "
//// Owner's Guide \\\\\\\\"
echo $line
echo ""
$sleep
echo " Loading Owner's Guide..."
load_help_file
echo ""
$sleep
echo " I hope that helped! :^)"
echo "";;
29)echo "
==================="
echo "
//// HELP CENTRE \\\\\\\\"
echo $line
echo ""
$sleep
echo " Loading web site for more help & updates..."
echo ""
load_page qM6yR
echo $line
echo ""
$sleep
echo " I hope that helped! :^)"
echo "";;
30)echo "
======================"
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
$sleep
backup_prop $p
echo ""
fi
done 2>/dev/null
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
backup_rc $rc $initrcbackup
echo ""
elif [ -f "$rc" ] && [ "$rc" != "$initrcpath1" ] && [ ! -f "$rc.
unsuper" ]; then backedup=yes
$sleep
backup_rc $rc $rc.unsuper
echo ""
fi
done 2>/dev/null
if [ "$backedup" ]; then 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 showbuildpropopt=0
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..."
info_build_prop
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
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 $line
echo ""
$sleep
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
info_launcher_warning
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 DieHard!"
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 2>/dev/nul
l
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 " The -=Entropy-ness Enlarger=- is Optional!"
echo $line
echo ""
$sleep
echo " ANYWAY...\"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
echo $line
echo "
Note: Virtual Memory Tweaks Still Apply!"
echo $line
echo ""
$sleep
for rc in $initrcpath $allrcpaths; do
sed -i '/vm\/.*oom.*/d
/vm\/.*vfs_cache_pressure.*/d
/vm\/.*overcommit_memory.*/d
/vm\/.*swappiness.*/d
/kernel\/panic.*/d
/random\/.*_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."
while :; do
echo ""
$sleep
echo ""
$sleep
echo " So the -=Fentropy enForcer=- will link it to..."
echo ""
$sleep
echo "..the much slower random, urandom and hw_random!"
echo ""
echo $line
echo ""
$sleep
fi
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/vfs_cache_pressure 10\
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/write_wakeup_threshold 128\
# write /proc/sys/kernel/random/read_wakeup_threshold 1376' $rc
if [ "$panicmode" -gt 0 ]; then sed -i '/^#.*kernel\/panic/s/#/
/' $rc; fi
if [ "$pyness" -ne 0 ]; then sed -i '/^#.*kernel\/random/s/#/ /'
$rc; fi
done
echo " Applying Kernel & Virtual Memory Tweaks..."
echo ""
$sleep
Apply_KVM_Tweaks
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
echo " System Property Accessory Tweaks..."
echo " ==================================="
echo ""
$sleep
echo " SuperCharger can apply additional tweaks..."
echo ""
$sleep
echo " ...for more performance and 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
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 = 90"
echo ""
echo $line
echo ""
$sleep
sed -i '/Accessory Tweaks/,/max_events_per_sec/s/^# //' $prop
echo " Enable System Property Accessory Tweaks?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read acc
echo ""
echo $line
case $acc in
y|Y)propaccessories=1
echo " System Property Accessory Tweaks are ENABLED!"
echo $line
echo ""
$sleep
Apply_Accessories;;
*)propaccessories=0
echo " System Property Accessory Tweaks are DISABLED!"
sed -i '/Accessory Tweaks/,/max_events_per_sec/s/^/# /
/Accessory Tweaks/,/####/s/^# //' $prop;
;
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 '/TurboCharger Enhancement/,/edge=/s/^# //' $prop
echo " Enable 3G TurboCharger Enhancement?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read acc
echo ""
echo $line
case $acc in
y|Y)tc3g=1
echo "
3G TurboCharger Enhancement is ENABLED!"
echo $line
echo ""
$sleep
Apply_3G_TCE;;
*)tc3g=0
echo "
3G TurboCharger Enhancement is DISABLED!"
sed -i '/TurboCharger Enhancement/,/edge=/s/^/# /
/TurboCharger Enhancement/,/####/s/^# //
' $prop;;
esac
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
echo " SD Read Speed Tweak..."
echo " ======================"
echo ""
$sleep
echo " You can choose the SD Card Read Ahead Cache!"
echo ""
$sleep
echo " Suggestions are calculated based on RAM..."
echo ""
$sleep
echo "
...or you can input a custom value!"
echo ""
echo $line
echo ""
$sleep
echo -n "
Current SD Read Speed Tweak = "
if [ "$sdtweak" -eq 0 ]; then echo "DISABLED"
else echo "$sdtweak KB"
fi
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 rc in $initrcpath $allrcpaths; do sed -i '/bdi\/read_ahead_kb/d' $r
c; done
echo " Enable SD Read Speed Tweak?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read sdt
echo ""
echo $line
case $sdt in
y|Y)sd1=$(((ram/64-1)*128)); sd2=$((ram/64*128)); sd3=$(((ram/64
+1)*128)); sd4=$(((ram/64+2)*128)); sd5=$(((ram/64+3)*128))
if [ "$sd1" -lt 128 ]; then sd1=128; fi
if [ "$sd1" -gt 2048 ]; then sd1=2048; fi
if [ "$sd2" -lt 128 ]; then sd2=128; fi
if [ "$sd2" -gt 2048 ]; then sd2=2048; fi
if [ "$sd3" -lt 128 ]; then sd3=128; fi
if [ "$sd3" -gt 2048 ]; then sd3=2048; fi
if [ "$sd4" -lt 128 ]; then sd4=128; fi
if [ "$sd4" -gt 2048 ]; then sd4=2048; fi
if [ "$sd5" -lt 128 ]; then sd5=128; fi
if [ "$sd5" -gt 2048 ]; then sd5=2048; fi
echo "
Okie dOkie! Choose an SD Read Speed!"
echo $line
while :; do
echo ""
$sleep
echo " Suggested values based on $ram MB of RAM.
.."
echo " Note: Suggested Values Max out at 2048 KB
"
echo ""
$sleep
echo "
1. $sd1 KB"
echo "
2. $sd2 KB"
echo "
3. $sd3 KB"
echo "
4. $sd4 KB"
echo "
5. $sd5 KB"
echo "
6. Your 2 sense lol"
while :; do
echo ""
$sleep
echo -n " Enter 1 - 5, or 6 for custom v
alue: "
read picksd
echo ""
echo $line
case $picksd in
1)sdtweak=$sd1; break 2;;
2)sdtweak=$sd2; break 2;;
3)sdtweak=$sd3; break 2;;
4)sdtweak=$sd4; break 2;;
5)sdtweak=$sd5; break 2;;
6)echo ""
$sleep
echo " A valid Custom value must
be 64 or more..."
echo " And also be a multiple of
64..."
while :; do
echo ""
$sleep
echo -n " Enter a valid
value, or X to cancel :"
read
echo
echo
if [
picksd
""
$line
"$picksd" = "x" ] |
echo $line
echo ""
$sleep
fi
Configure_FastEngineFlush
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 " Detailing On Boot..."
echo " ===================="
echo ""
$sleep
if [ ! -f "/data/V6_SuperCharger/!Detailing.sh" ]; then blurb_De
tailing; fi
blurb_boot_script "Detailing" "Detailing"
Configure_Detailing
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
echo " Fix Alignment On Boot..."
echo " ========================"
echo ""
$sleep
if [ ! -f "/data/V6_SuperCharger/!FixAlignment.sh" ]; then blurb
_FixAlignment; fi
blurb_boot_script "Fix Alignment" "FixAlign"
Configure_FixAlignment
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
if [ "$fixalign" -ne 1 ]; then
echo " Wheel Alignment On Boot..."
echo " =========================="
echo ""
$sleep
if [ ! -f "/data/V6_SuperCharger/!WheelAlignment.sh" ];
then blurb_WheelAlignment; fi
blurb_boot_script "Wheel Alignment" "ZepAlign"
Configure_WheelAlignment
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
if [ ! -f "/data/V6_SuperCharger/!FixEmissions.sh" ]; th
en blurb_FixEmissions; fi
blurb_boot_script "Fix Emissions" "FixEmissions"
Configure_FixEmissions
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
echo ""
$sleep
fi
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
echo -n " Integrate? Enter Y for Yes, any key for No: "
read bake
echo ""
echo $line
case $bake in
y|Y)initrc=1
echo "
ENABLED!";;
*)initrc=0
echo " System Integration of $initrcpath1 is
DISABLED!";;
esac
echo $line
echo ""
$sleep
else initrc=0
fi
else initrc=0; detailinterval=0; zepalign=0; fixemissions=0; fixalign=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
update_options_in_scripts supercharger
update_options
echo "
Driver Options Have Been Saved!"
echo ""
if [ "$autoresupercharge" ]; then opt=24
$sleep
echo "
======================="
echo "
//// RE-SUPERCHARGER \\\\\\\\"
else
echo $line
if [ "$missingoptions" ]; then script_version_check; fi
$sleep
echo "
Now Off To The Races!"
missingoptions=
fi
firstgear=;;
31)echo "
================="
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 ""
load_page 0dMcp;;
32)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;;
33)echo "
==================="
echo "
//// SUPERCLEAN! \\\\\\\\"
if [ "$ram1" -ne "$ram2" ]; then opt=27; fi;;
34)echo " Did you find this useful? Feedback is welcome!";;
69)if [ ! "$crapp" ]; then HazEgg=woot; remount ro
echo $line
echo "
Easter Egg!!"
echo $line
echo ""
$sleep
echo " Nothing bad will happen but you can see..."
echo ""
$sleep
echo "
...what DOES happen for those that..."
echo ""
$sleep
echo "
...have some crappy-ass app installed..."
echo ""
$sleep
echo "
...and choose the wrong answer... LOL"
echo ""
$sleep
echo -n " Press The Enter Key... for teh lulz! "
read enter
echo ""
fi
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\" :/"
echo ""
echo $line
echo ""
$sleep
echo " Say Yes to uninstall it now..."
echo ""
$sleep
echo " ...if you say No... I WILL make you Cry Hard!"
echo ""
$sleep
echo " And and don't dare say I didn't warn ya..."
echo ""
$sleep
echo -n " Enter N for No, any key for Yes: "
if [ "$HazEgg" ]; then uncrapp=N; echo $uncrapp
else read uncrapp
fi
echo ""
echo $line
case $uncrapp in
n|N)echo "
No SuperCharger For You!"
echo $line
echo ""
$sleep
echo "
======================="
echo "
//// UN-SUPERCHARGER \\\\\\\\"
sleep="sleep 0"; opt=14;;
*)echo " Good Answer! (You are SO lucky...)"
echo $line
echo ""
$sleep
echo " Ok... getting rid of that crapp..."
echo ""
$sleep
echo $line
for i in `echo $crapp`; do echo -n " "; pm uninstall $i;
done
crapp=; opt=27;;
esac;;
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 [ "$HL" -eq "$VA" ]; 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 "
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
echo $line
echo ""
$sleep
echo " Going to show The bOOM Stick..."
echo ""
$sleep
echo " ...for deeper analysis...(that's what she sed!)"
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
boomstick=bOOM
bOOM_Stick bOOM
showedboomstick=yes
elif [ "$opt" -lt 34 ]; then
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/data/V6_Super
Charger/SuperChargerMinfree
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 "$initrcpath1" ] && [ ! -f "$initrcpath"
]; then cp -r $initrcpath1 $initrcpath; fi
if [ "$allrcpaths" ]; then
install_bp_service rebulletproof
echo ""
echo $line
fi
echo " Re-SuperCharging from $storage..."
echo $line
echo ""
$sleep
if [ "`ls $storage/V6_SuperCharger/data/V6_Super
Charger/SuperCharger*`" ]; then echo "
...your Driver Options..."; $sleep;
cp -fr $storage/V6_SuperCharger/data/V6_SuperCharger/SuperCharger* /data/V6_Supe
rCharger; fi 2>/dev/null
if [ -f "$storage/V6_SuperCharger/data/99SuperCh
arger.sh" ]; then echo "
...your SuperCharger Settings..."; $sleep; cp -fr
$storage/V6_SuperCharger/data/99SuperCharger.sh /data; fi
if [ "`ls $storage/V6_SuperCharger/data/V6_Super
Charger/BulletProof_Apps*`" ]; then cp -fr $storage/V6_SuperCharger/data/V6_Supe
rCharger/BulletProof_Apps* /data/V6_SuperCharger; fi 2>/dev/null
if [ -f "$storage/V6_SuperCharger/data/97BulletP
roof_Apps.sh" ]; then echo "
...your BulletProof Apps Settings..."; $sleep;
cp -fr $storage/V6_SuperCharger/data/97BulletProof_Apps.sh /data; fi
if [ -d "$storage/V6_SuperCharger/data/V6_SuperC
harger/BulletProof_One_Shots" ]; then cp -fr $storage/V6_SuperCharger/data/V6_Su
perCharger/BulletProof_One_Shots /data/V6_SuperCharger; fi
if [ -d "$storage/V6_SuperCharger/data/V6_SuperC
harger/PowerShift_Scripts" ]; then echo "
...your PowerShift Scripts..."; $
sleep; cp -fr $storage/V6_SuperCharger/data/V6_SuperCharger/PowerShift_Scripts /
data/V6_SuperCharger; fi
if [ "`ls $storage/V6_SuperCharger/data/V6_Super
Charger/\!*.sh`" ]; then echo "
...your \"Quick Widget\" Scripts..."; $slee
p; cp -fr $storage/V6_SuperCharger/data/V6_SuperCharger/\!*.sh /data/V6_SuperCha
rger; fi 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 /data/*.sh 2>/dev/null; chmod 777 /dat
a/*.sh 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
echo "
...all \"Terminal Emulator\" Scripts
... "; $sleep; dd if=$0 of=/system/xbin/v6 2>/dev/null
chown 0.0 /system/xbin/v6 2>/dev/null; chmod 777
/system/xbin/v6 2>/dev/null
if [ "`ls $storage/V6_SuperCharger/system/xbin`"
]; then
cp -fr $storage/V6_SuperCharger/system/x
bin /data/V6_SuperCharger
chown 0.0 /data/V6_SuperCharger/xbin/*;
."
echo ""
$sleep
echo "
lled!"
echo ""
echo $line
echo ""
$sleep
echo " But this comes first... heh..."
echo ""
echo $line
echo ""
$sleep
opt=12;;
*)echo " Re-SuperCharging Declined... meh...";;
esac
fi
if [ "$opt" -le 14 ]; then
if [ ! "$HazEgg" ]; then
rm -f $storage/UnSuperCharged.html
rm -f $storage/UnSuperChargerError.html
rm -f $storage/SuperChargerScriptManagerHelp.html
rm -f $storage/SuperChargerHelp.html
fi
if [ "$opt" -le 13 ]; then
echo -n " zOOM... "; sleep 2; echo -n "zOOM..."; sleep 2
; echo ""
echo ""
if [ "$newscadj2" ]; then echo $newscadj2 > /data/V6_Sup
erCharger/SuperChargerAdj
else echo $newscadj > /data/V6_SuperCharger/SuperCharger
Adj
fi
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..."
info_build_prop
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
update_options
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
backup_prop $p
echo ""
$sleep
fi
done 2>/dev/null
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
done 2>/dev/null
for rc in $initrcpath $allrcpaths; do
sed -i '/.*V6 SuperCharger/,/.*V6 SuperCharged/d
/.*_ADJ/d' $rc
if [ "$scminfree" ]; then
sed -i '/.*_MEM/d
/write \/sys\/module\/lo
wmemorykiller/d' $rc
else sed -i '/write \/sys\/module\/lowmemorykill
er\/parameters\/adj/d' $rc
fi
sed -i '/vm\/.*min_free_kbytes*/d
/vm\/.*oom.*/d
/vm\/.*vfs_cache_pressure.*/d
/vm\/.*overcommit_memory.*/d
/vm\/.*swappiness.*/d
/kernel\/panic.*/d
/random\/.*_wakeup_threshold.*/d
/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 [ ! "`ls /system/etc/init.d/*SuperCharger*`" ] && [ !
"`ls /data/*SuperCharger*`" ] && [ ! "`ls /system/etc/init.d/*BulletProof_Apps*
`" ] && [ ! -f "$initrcpath" ] && [ ! -f "$initrcbackup" ] && [ ! "$allrcbackups
" ]; 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 $storagename/UnSuperCharged.htm for a
ssistance!"
echo $line
echo ""
$sleep
else
if [ ! "$HazEgg" ]; then rm -f $initrcpath; fi
if [ -f "$initrcbackup" ]; then
echo "
BACKUP FOUND!"
echo ""
$sleep
echo " Restoring $initrcpath1..."
echo ""
echo $line
echo ""
$sleep
if [ ! "$HazEgg" ]; then
cp -fr $initrcbackup $initrcpath
1
rm $initrcbackup
fi
fi
for rc in $allrcpaths; do
if [ -f "$rc.unsuper" ] && [ ! -s "$rc.u
nsuper" ]; then
if [ ! "$HazEgg" ]; then rm $rc;
rm $rc.unsuper; fi
continue
elif [ "`dirname $rc`" != "/"] && [ ! -f
"$rc.unsuper" ]; then
echo "
ERROR... ERROR... ER
ROR... ERROR..."
echo ""
$sleep
echo "
AN RC BACKUP WAS
NOT FOUND!"
echo ""
$sleep
echo "
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 $storagename/UnSuperC
hargerError.html for help!"
if [ "${rc##*/}" != "init.rc" ]
; then
echo $line
echo ""
sleep 4
if [ ! "$HazEgg" ]; then
sed -i '/.*V6 Su
perCharger/,/.*V6 SuperCharged/d
/SuperCharger_Service/,/SuperCharged_Service/d
/BulletProof_Apps_Service/,/BulletProofed_Apps_Service/d' $rc
fi
echo " Cleaned "$rc
echo ""
fi
else
echo "
BACKUP FO
UND!"
echo ""
$sleep
echo " Restoring ${rc##*/}..."
if [ ! "$HazEgg" ]; then mv $rc.
unsuper $rc; fi
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
if [ ! "$HazEgg" ]; then
sed -i '/.*V6 SuperCharger/,/.*V
6 SuperCharged/d
/.*_ADJ/d' $p
fi
if [ "$UnSuperCharged" -ne 1 ]; then
echo " Cleaning MEM values from
${p##*/}..."
echo ""
$sleep
fi
if [ "$scminfree" ] && [ ! "$HazEgg" ];
then sed -i '/.*_MEM/d' $p; fi
fi
fi
done 2>/dev/null
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
if [ ! "$HazEgg" ]; then rm /system/etc/init.d/*SuperCha
rger*; fi
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
if [ ! "$HazEgg" ]; then rm /data/99SuperCharger.sh; fi
fi
if [ -f "/data/local/userinit.sh" ] && [ ! "$HazEgg" ]; then sed
-i '/.*SuperCharger/d' /data/local/userinit.sh; fi
if [ -f "/system/etc/hw_config.sh" ]; then
if [ ! "$HazEgg" ]; then sed -i '/.*V6 SuperCharger/,/.*
V6 SuperCharged/d' /system/etc/hw_config.sh; fi
if [ "$UnSuperCharged" -ne 1 ] && [ ! "$newsupercharger"
]; then
echo " Cleaning Up SuperCharge from hw_config.sh
..."
echo ""
$sleep
fi
fi
if [ "$opt" -eq 14 ]; then
if [ ! "$HazEgg" ]; then
rm -fr /data/V6_SuperCharger
rm -f /data/*SuperCharger*
rm -f /data/*BulletProof_Apps*
rm -f /data/*_*\.log
rm -f /system/etc/init.d/*BulletProof_Apps*
rm -f /system/xbin/v6
rm -f /system/xbin/99super
rm -f /system/xbin/vac
rm -f /system/xbin/zepalign
rm -f /system/xbin/fixfc
rm -f /system/xbin/fixalign
rm -f /system/xbin/flush
rm -f /system/xbin/sclean
rm -f /system/etc/init.d/92vac
rm -f /system/etc/init.d/93zepalign
rm -f /system/etc/init.d/94fixfc
rm -f /system/etc/init.d/95fixalign
rm -f /system/etc/init.d/96superflush
fi
if [ "$UnSuperCharged" -ne 1 ]; then
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 , '{OFMT="%.0f"; p
rint "
Old MB = "$1/256", "$2/256", "$3/256", "$4/256", "$5/256", "$6/256" MB
"}'
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.
#
slot=3
MFK_Calculator
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
echo "
$SSADJ = Secondary Server ADJ"
echo "
$slot = 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/vfs_cache_pressure 10\
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/write_wakeup_threshold 128\
# write /proc/sys/kernel/random/read_wakeup_threshold 1376\
# write /sys/block/mmcblk0/bdi/read_ahead_kb '$sdtweak'\
# End of KVM Tweaks' $rc
if [ "$panicmode" -gt 0 ]; then sed -i '/^#.*ker
nel\/panic/s/#/ /' $rc; fi
if [ "$pyness" -ne 0 ]; then sed -i '/^#.*kernel
\/random/s/#/ /' $rc; fi
if [ "$sdtweak" -gt 1 ]; then sed -i '/^#.*bdi\/
read_ahead_kb/s/#/ /' $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
/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
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
/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 2>/dev/null
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
Apply_KVM_Tweaks
if [ "$propaccessories" -eq 1 ]; then
Apply_Accessories
echo $line
echo ""
$sleep
fi
if [ "$tc3g" -eq 1 ]; then
Apply_3G_TCE
echo $line
echo ""
$sleep
fi
if [ "$sdtweak" -gt 0 ]; then
Apply_SD_Speed
echo $line
echo ""
$sleep
fi
Re_Generate_99SuperCharger
echo $line
echo "
GEEK ALERT!!"
echo $line
echo ""
$sleep
echo " \"Start Up Script\" to be copied to /system/xbin!
"
echo " ==============="
echo ""
$sleep
echo " If need be, you can run it quick and easy..."
blurb_Terminal 99super =======
echo ""
$sleep
if [ ! -f "/system/xbin/99super" ] || [ "`diff /data/99S
uperCharger.sh /system/xbin/99super`" ]; then
info_free_space_error /system/xbin 99super
echo ""
fi
echo $line
echo ""
$sleep
if [ -f "/system/etc/hw_config.sh" ]; then
echo " SuperCharging /system/etc/hw_config.sh...
"
echo ""
echo $line
echo ""
$sleep
fi
if [ -d "/system/etc/init.d" ]; then
if [ "$rcpaths" ] && [ "$initrc" -eq 1 ]; then
echo " For Super Stickiness..."
echo ""
$sleep
fi
echo " SuperCharging /system/etc/init.d folder..
."
echo ""
$sleep
if [ ! "`diff /data/99SuperCharger.sh $desiredna
me`" ]; then
if [ "$desiredname" = "/system/etc/init.
d/99SuperCharger" ]; then echo -n " "
elif [ "$desiredname" = "/system/etc/ini
t.d/S99SuperCharger" ]; then echo -n " "
fi
echo " ...with $desiredname!"
echo ""
$sleep
echo " If it successfully runs on boot..
."
echo ""
$sleep
echo " .../data/BootLog_SuperCharger.log
is created!"
else info_free_space_error init.d `basename $des
iredname`
fi
if [ "`ls /system/etc/init.d/*oopy*`" ] && [ /sy
stem/etc/init.d/*oopy* != "/system/etc/init.d/zzloopy_runs_last_so_others_do_too
" ]; then
echo ""
echo $line
echo ""
$sleep
echo " Found `ls /system/etc/init.d/*oop
y*`..."
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/*oopy*" /system/e
tc/init.d/zzloopy_runs_last_so_others_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
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 " Stock ROM? - Additional Configuration Req
uired!"
echo ""
$sleep
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
if [ "$opt" -le 10 ]; then
echo -n " Some Changes are TEMPORARY & "
if [ "$allrcpaths" ]; then echo "MAY NOT
PERSIST!"
else echo "WON'T PERSIST!"
fi
echo ""
$sleep
echo " To enable PERSISTENT SuperCharger
settings...."
echo ""
$sleep
echo "
ping Fixes..."
else echo " To enable PERSISTENT OOM Grouping Fi
xes..."
fi
echo ""
$sleep
if [ "$allrcpaths" ]; then
echo "
...The SuperCharger Service
should work!"
echo ""
$sleep
echo " BUT if it doesn't..."
echo ""
$sleep
fi
if [ "$smrun" ]; then
SuperChargerScriptManagerHelp=1
cat > $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>
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
==================
="
echo ""
$sleep
echo " To stop the SuperCharger Service.
.."
echo ""
$sleep
echo "
=================
="
echo ""
echo $line
echo ""
$sleep
echo " If the service is running and you
type..."
echo ""
$sleep
echo "
...\"grep -h [S]uper /p
roc/*/cmdline\""
echo ""
$sleep
echo " The output would be \"/data/99Sup
erCharger.sh\""
echo ""
echo $line
echo ""
$sleep
echo " Easier: Similar results can be ha
d with..."
echo ""
$sleep
echo "
...\"busybox ps |
grep [S]uper\""
echo ""
echo $line
elif [ ! "$allrcpaths" ] && [ ! "$scsinfo" ]; th
en
echo $line
echo "
SuperCharger Service Entries I
nstalled!"
echo $line
echo ""
$sleep
echo " This won't work on this ROM but..
. "
echo ""
$sleep
echo "
g into a ROM!"
echo ""
$sleep
echo " Just read the comments in $initrc
path :)"
echo ""
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
PowerShiftScript="$CONFIG-($MB1,$MB2,$MB3,$MB4,$
MB5,$MB6)-PowerShift.sh"
Re_Generate_PowerShift_Script "$PowerShiftScript
"
echo " A PowerShift Script was saved as..."
echo ""
$sleep
echo " $PowerShiftScript!"
echo ""
$sleep
echo " Goto data/V6_SuperCharger/PowerShift_Scri
pts.."
echo ""
$sleep
echo "
r it..."
echo ""
$sleep
echo "
ings!"
echo ""
$sleep
echo " They'll also be your new SuperCharger va
lues!"
echo ""
echo $line
scsinfo=shown
fi
if [ "$adjfile" = "/sys/module/lowmemorykiller/parameter
s/adj" ]; then echo "$scadj" > $adjfile; fi
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 ""
$sleep
echo "
ak..."
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! ;^]"
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 $storagename..."
echo ""
$sleep
if [ -d "/data/V6_SuperCharger" ]; then cp -fr /data/V6_
SuperCharger $storage/V6_SuperCharger/data; fi
for rc in $initrcpath $allrcpaths; do
mkdir -p $storage/V6_SuperCharger`dirname $rc`
cp -fr $rc* $storage/V6_SuperCharger`dirname $rc
`
done
cp -fr $storage/V6_SuperCharger/data/init* $storage/V6_S
uperCharger
if [ -f "/data/local.prop" ]; then cp -fr /data/local.pr
op* $storage/V6_SuperCharger/data; fi
if [ -f "/system/build.prop" ]; then cp -fr /system/buil
d.prop* $storage/V6_SuperCharger/system; fi
if [ -f "/system/etc/ram.conf" ]; then cp -fr /system/et
c/ram.conf* $storage/V6_SuperCharger/system/etc; fi
echo "
...Re-SuperCharger backup complete!"
echo ""
if [ "$newsupercharger" ] || [ "$postics" ]; then
if [ "$preics" ]; then opt=33
echo $line
if [ "$autoresupercharge" ] || [ "$ReSup
erCharge" -eq 1 ]; then
script_version_check
echo ""
$sleep
echo " Re-SuperCharger is ALMOST
done!"
else
echo ""
$sleep
echo " I think this is your FIRS
T SuperCharge..."
fi
echo ""
$sleep
elif [ "$servicesjarpatched" ] || [ "$servicesja
rinstalled" ]; then
echo $line
echo "
I Scream SUPERCHARGED
!"
elif [ ! "$showedparlor" ]; then opt=26
echo $line
echo ""
$sleep
echo " Now off to the \"Jelly ISCream Pa
rlor\"..."
echo ""
$sleep
fi
autoresupercharge=
fi
fi
fi
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..."
boomstick=vrOOM;;
*)echo " zOOM Stick Verifier (Quick) selected..."
boomstick=zOOM;;
esac
echo $line
bOOM_Stick $boomstick
fi
if [ "$opt" -eq 16 ]; then
if [ "$bpapplist" ] && [ "`busybox ps | grep [B]ulletProof`" ];
then
echo " You are currently BulletProofing..."
echo ""
$sleep
for bpapp in $bpapplist; do echo "
$bpapp"; don
e
echo ""
echo $line
$sleep
echo " Note you can merely DISABLE this in Options..."
echo ""
$sleep
echo "
...or in the script itself!"
echo $line
echo ""
$sleep
echo " ANYWAY... if you want to..."
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)rm -f /data/V6_SuperCharger/Bullet
Proof_Apps*
rm -f /data/*BulletProof_Apps*
rm -f /system/etc/init.d/*Bull
etProof_Apps*
echo "
Un-BulletProo
*)echo "
Invalid entry... P
Cool Beans!";;
esac
if [ "$opt" -eq 16 ]; then
echo $line
echo ""
$sleep
fi
fi 2>/dev/null
if [ "$opt" -eq 16 ]; then
blurb_BulletProof_Apps
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
install_bp_service
Re_Generate_97BulletProof_Apps
Re_Generate_BulletProof_Apps_Fine_Tuner
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!"
echo $line
echo ""
$sleep;;
*)echo " Loading zOOM Stick Verifier (Quick)..."
echo $line
boomstick=zOOM
bOOM_Stick;;
esac
while :; do
bpps=;bppid=;bpappname=;apprunning=;addedtohitlist=;ad
dedtofinetuner=
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
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!"
bpappname=$bpps
else bppid=`pgrep $bpps`; apprunning=true
if [ -f "/proc/$bppid/cmdline" ]; then b
pappname=$(basename `cat /proc/$bppid/cmdline`)
else
echo ""
echo " Grrrr... there's more tha
n one match!"
echo ""
for bphit in `pgrep $bpps`; do
$sleep
if [ "`cat /proc/$bphit/
cmdline`" ]; then
bpappnametemp=$(
basename `cat /proc/$bphit/cmdline`)
echo -n " Want $
bpappnametemp? (Y)es or E(N)ter: "
read pick
case $pick in
y|Y)bpappname=
$bpappnametemp;;
*)echo "
";;
esac
fi
if [ "$bpappname" ]; the
n break; fi
done
fi 2>/dev/null
fi
echo $line
fi 2>/dev/null
if [ "`ls /data/V6_SuperCharger/BulletPr
oof_One_Shots | grep $bpappname`" ]; then
$sleep
echo " Existing \"One-Shot\" Scr
ipt To Be Updated! :o)"
echo $line
fi 2>/dev/null
echo ""
$sleep
Re_Generate_BulletProof_1Shot $bpappname
blurb_was_created " Script 1Shot-$bpappn
ame.sh in..." "..data/V6_SuperCharger/BulletProof_One_Shots..."
if [ ! "$bpwinfo" ]; then
blurb_Quick_Widget
$sleep
echo " OR, with Terminal Emulato
r..."
echo ""
$sleep
echo " ...you can quickly run AL
L \"One-Shot\" scripts!"
echo ""
$sleep
echo " Type: \"su\" and enter...
"
echo "
=="
echo ""
$sleep
echo " \"/data/V6*/Bullet*/1Shot
*\" and enter!"
echo " ========================
"
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 \"
xx\" 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 \"On
e-Shot\" keeps running!"
echo ""
$sleep
echo " You can change how often
a 1Shot script runs.."
echo ""
$sleep
echo "
...by cha
...\"grep -h [1]
Shot /proc/*/cmdline\"!"
echo ""
$sleep
echo " The output should look li
ke this:"
echo ""
$sleep
echo "
/path/to/1Shot-$bpappn
echo "
1Shot-$bpappname_is_In
ame.sh"
_Effect!"
echo ""
echo $line
echo ""
$sleep
echo " Easier: Similar results c
an be had with..."
echo ""
$sleep
echo "
...\"busy
.../data/
97BulletProof_Apps.sh!"
echo ""
$sleep
echo " Or make it load 97BulletP
roof_Apps.sh on boot!"
echo ""
$sleep
echo " OR, for LESS overhead...
use Terminal Emulator!"
echo ""
$sleep
echo " Type: \"su\" and enter, \
"/data/97*\" and enter!"
echo "
==
==
======="
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 $b
pwait 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!"
echo $line
bpainfo=shown
fi
if [ "$bpapplist" ] && [ ! "$showedbpapp
list" ]; then
echo ""
echo $line
echo ""
$sleep
echo " You are already BulletPro
ofing..."
echo ""
$sleep
for bpapp in $bpapplist; do echo
"
$bpapp"; done
showedbpapplist=
fi
echo ""
echo $line
if [ "`echo $bpapplist | grep $bpappname
`" ]; then
$sleep
echo " $bpappname's on the Hit L
ist! ;^]"
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 ""
case $bpabs in
y|Y)echo $bpappname >> /data/V
6_SuperCharger/BulletProof_Apps_HitList
echo $bpappname >> $st
orage/V6_SuperCharger/data/V6_SuperCharger/BulletProof_Apps_HitList
bpapplist=`cat /data/V
6_SuperCharger/BulletProof_Apps_HitList`
addedtohitlist=yes;;
*)echo $line
echo " Okay... maybe n
ext time!";;
esac
fi
if [ "`grep $bpappname /data/V6_SuperCha
rger/BulletProof_Apps_Fine_Tuner.sh`" ]; then
echo $line
echo ""
$sleep
echo " Overwrite your prior Fine
Tune Setting for it?"
echo ""
$sleep
echo -n " Enter Y for Yes, any k
ey for No: "
read bpaft
echo ""
case $bpaft in
y|Y)addedtofinetuner=yes;;
*);;
esac
else addedtofinetuner=yes
fi
if [ "$addedtofinetuner" ]; then
echo $line
echo ""
$sleep
echo " Updating BulletProof_Apps
_Fine_Tuner.sh..."
echo ""
Re_Generate_BulletProof_Fine_Tun
es $bpappname
fi
if [ "$addedtohitlist" ]; then
echo $line
echo ""
$sleep
echo " Here's Your Updated HitLi
st!"
echo ""
$sleep
for bpapp in $bpapplist; do echo
"
$bpapp"; done
echo ""
if [ ! "$bpsinfo" ]; then
echo $line
echo ""
$sleep
echo " BulletProof_Apps_
HitList will be loaded via..."
echo ""
$sleep
if [ -d "/system/etc/ini
t.d" ] && [ ! "`diff /data/97BulletProof_Apps.sh $bpname`" ]; then echo "
..
.$bpname"
elif [ -d "/system/etc/i
nit.d" ]; then info_free_space_error init.d `basename $bpname`
else echo "
.../data/97BulletProof_Apps.sh!"
fi
echo ""
$sleep
echo $line
echo " Is it working? Se
e /data/Ran_BulletProof_Apps!"
echo $line
echo ""
$sleep
echo " Or... in Terminal
Emulator, you can type..."
echo ""
$sleep
echo " \"pstree | grep B
ullet\" OR \"pstree | grep sleep\""
echo ""
$sleep
echo " OR... get COMPLET
E information with..."
echo ""
$sleep
echo "
...\"gre
p -h [B]ullet /proc/*/cmdline\"!"
echo ""
$sleep
echo " The output should
look like this:"
echo ""
$sleep
echo "
/path/to/*97
BulletProof_Apps*"
echo "
BulletProof_
Apps_is_In_Effect!"
echo ""
echo $line
echo ""
$sleep
echo " Easier: Similar r
esults can be had with..."
echo ""
$sleep
echo "
..
.\"busybox ps | grep [B]ullet\""
echo ""
fi
if [ "$allrcpaths" ] && [ ! "$bp
sinfo" ]; then
echo $line
echo ""
$sleep
echo " The BulletProof A
pps Service should..."
echo ""
$sleep
echo "
...automati
...$bps
!"
if [ ! "$bpservi
ce" ]; then $sleep; fi
done
echo ""
echo $line
echo ""
$sleep
echo " You can stop the
service by either..."
echo ""
$sleep
echo " ...reading comm
ents in 97BulletProof_Apps.sh"
echo ""
$sleep
echo " Or... Run Termina
l Emulator..."
echo ""
$sleep
echo "
...t
...type \"s
==
$sleep
echo " To restart the Bu
lletProof Apps Service..."
echo ""
$sleep
echo "
..type \"st
===
================="
echo ""
echo $line
echo ""
$sleep
echo " \"grep -h [B]ulle
t /proc/*/cmdline\"..."
echo ""
$sleep
echo "
...OR... \"bus
...it makes
ckground! ;^]"
echo $line
echo ""
$sleep
if [ "`busybox --help | grep nohup`" ];
then (busybox nohup /data/97BulletProof_Apps.sh > /dev/null &)
elif [ "`busybox --help | grep start-sto
p-daemon`" ]; then busybox start-stop-daemon -S -b -x /data/97BulletProof_Apps.s
h
else info_bb_no_nohup
fi
fi
Configure_BulletProof_Apps
echo $line
echo ""
$sleep
echo $line
echo " ALL BulletProof* files backed up to $stor
agename..."
fi
fi
fi
if [ "$opt" -eq 17 ]; then
if [ "`echo $flushOmaticHours | awk '$1==0'`" ]; then
blurb_FastEngineFlush
$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 ""
echo $line
echo ""
$sleep
fi
Re_Generate_FastEngineFlush
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
flushnotrun=yes;;
*)echo "
Nice! Gonna dump some cache... flush too!"
echo $line
sleep 2
if [ "`busybox --help | grep nohup`" ] || [ "`busybox
--help | grep start-stop-daemon`" ]; then
sh /data/V6_SuperCharger/!FastEngineFlush.sh
flushOmaticHours=`awk -F , '{print $16}' /data/V
6_SuperCharger/SuperChargerOptions`
else info_bb_no_nohup; flushnotrun=yes
fi;;
esac
blurb_was_created " For Fast Flushing..." " ../data/V6_SuperChar
ger/!FastEngineFlush.sh..."
blurb_Quick_Widget
echo $line
echo ""
$sleep
if [ ! "`diff /data/V6_SuperCharger/!FastEngineFlush.sh /system/
xbin/flush`" ]; then
echo " There is another copy in /system/xbin..."
blurb_Terminal flush =====
else info_free_space_error /system/xbin flush
fi
echo ""
if [ ! -f "/system/etc/init.d/96superflush" ] || [ "`diff /data/
V6_SuperCharger/!FastEngineFlush.sh /system/etc/init.d/96superflush`" ] && [ -d
"/system/etc/init.d" ]; then
echo $line
echo ""
$sleep
info_free_space_error /etc/init.d 96superflush
fi
if [ "$flushnotrun" ]; then flushnotrun=
echo $line
echo ""
$sleep
Configure_FastEngineFlush
fi 2>/dev/null
fi
if [ "$opt" -eq 18 ]; then
if [ "$detailinterval" -eq 0 ]; then blurb_Detailing; fi
if [ "`which sqlite3`" ]; then
Re_Generate_Detailing
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
sleep 2
sh /data/V6_SuperCharger/!Detailing.sh
detailinterval=`awk -F , '{print $12}' /data/V
6_SuperCharger/SuperChargerOptions`;;
esac
blurb_was_created " For Diligent Detailing..." "
..
./data/V6_SuperCharger/!Detailing.sh..."
blurb_Quick_Widget
echo $line
echo ""
$sleep
if [ ! "`diff /data/V6_SuperCharger/!Detailing.sh /syste
m/xbin/vac`" ]; then
echo " There is another copy in /system/xbin..."
blurb_Terminal vac ===
else info_free_space_error /system/xbin vac
fi
echo ""
if [ ! -f "/system/etc/init.d/92vac" ] || [ "`diff /data
/V6_SuperCharger/!Detailing.sh /system/etc/init.d/92vac`" ] && [ -d "/system/etc
/init.d" ]; then
echo $line
echo ""
$sleep
info_free_space_error /etc/init.d 92vac
elif [ "$detailingnotrun" ]; then detailingnotrun=
echo $line
echo ""
$sleep
blurb_boot_script "Detailing" "Detailing"
Configure_Detailing
fi 2>/dev/null
else info_missing_binary sqlite3 Vacuuming
fi
fi
if [ "$opt" -eq 19 ]; then
if [ "$zepalign" -ne 1 ]; then blurb_WheelAlignment; fi
if [ "`which zipalign`" ]; then
Re_Generate_WheelAlignment
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 $line
echo ""
$sleep
zepalignnotrun=yes;;
*)echo "
Gonna \"ZepAlign\" in no time! ;
^]"
echo $line
sleep 2
sh /data/V6_SuperCharger/!WheelAlignment.sh
autofixemissions=yes
zepalign=`awk -F , '{print $13}' /data/V6_Supe
rCharger/SuperChargerOptions`
fixalign=`awk -F , '{print $15}' /data/V6_Supe
rCharger/SuperChargerOptions`;;
esac
blurb_was_created " For Zippy... uhh... \"ZepAligning\".
.." " .../data/V6_SuperCharger/!WheelAlignment.sh..."
blurb_Quick_Widget
echo $line
echo ""
$sleep
if [ ! "`diff /data/V6_SuperCharger/!WheelAlignment.sh /
system/xbin/zepalign`" ]; then
echo " There is another copy in /system/xbin..."
blurb_Terminal zepalign ========
else info_free_space_error /system/xbin zepalign
fi
echo ""
if [ ! -f "/system/etc/init.d/93zepalign" ] || [ "`diff
/data/V6_SuperCharger/!WheelAlignment.sh /system/etc/init.d/93zepalign`" ] && [
-d "/system/etc/init.d" ]; then
echo $line
echo ""
$sleep
info_free_space_error /etc/init.d 93zepalign
elif [ "$zepalignnotrun" ]; then zepalignnotrun=
echo $line
echo ""
$sleep
blurb_boot_script "Wheel Alignment" "ZepAlign"
Configure_WheelAlignment
fi 2>/dev/null
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=
echo "
Okay... but run it if you
get FCs!!";;
*)opt=20
remount rw
echo ""
echo "
==================
==="
echo "
\\\\\\\\"
echo $line
echo ""
$sleep;;
esac
fi
else info_missing_binary zipalign ZepAligning
fi
fi
if [ "$opt" -eq 20 ]; then
if [ "$fixemissions" -ne 1 ]; then blurb_FixEmissions; fi
Re_Generate_FixEmissions
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 $line
echo ""
$sleep
fixemissionsnotrun=yes;;
*)echo "
Cool... This won't take too long ;^]"
echo $line
sleep 2
sh /data/V6_SuperCharger/!FixEmissions.sh
fixemissions=`awk -F , '{print $14}' /data/V6_SuperCha
rger/SuperChargerOptions`
fixalign=`awk -F , '{print $15}' /data/V6_SuperCharger
/SuperChargerOptions`;;
esac
blurb_was_created " For a Fast FCing Fix..." " .../data/V6_Sup
erCharger/!FixEmissions.sh..."
blurb_Quick_Widget
echo $line
echo ""
$sleep
if [ ! "`diff /data/V6_SuperCharger/!FixEmissions.sh /system/xbi
n/fixfc`" ]; then
echo " There is another copy in /system/xbin..."
blurb_Terminal fixfc =====
else info_free_space_error /system/xbin fixfc
fi
echo ""
if [ ! -f "/system/etc/init.d/94fixfc" ] || [ "`diff /data/V6_Su
perCharger/!FixEmissions.sh /system/etc/init.d/94fixfc`" ] && [ -d "/system/etc/
init.d" ]; then
echo $line
echo ""
$sleep
info_free_space_error /etc/init.d 94fixfc
elif [ "$fixemissionsnotrun" ]; then fixemissionsnotrun=
echo $line
echo ""
$sleep
blurb_boot_script "Fix Emissions" "FixEmissions"
Configure_FixEmissions
fi 2>/dev/null
fi
if [ "$opt" -eq 21 ]; then
if [ "$fixalign" -ne 1 ]; then blurb_FixAlignment; fi
if [ "`which zipalign`" ]; then
Re_Generate_FixAlignment
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 $line
echo ""
$sleep
fixalignnotrun=yes;;
*)echo "
Gonna \"FixAlign\" in no time! ;
^]"
echo $line
sleep 2
sh /data/V6_SuperCharger/!FixAlignment.sh
zepalign=`awk -F , '{print $13}' /data/V6_Supe
rCharger/SuperChargerOptions`
fixemissions=`awk -F , '{print $14}' /data/V6_
SuperCharger/SuperChargerOptions`
fixalign=`awk -F , '{print $15}' /data/V6_Supe
rCharger/SuperChargerOptions`;;
esac
blurb_was_created " For Fast 'n Furious FixAligning..."
" .../data/V6_SuperCharger/!FixAlignment.sh..."
blurb_Quick_Widget
echo $line
echo ""
$sleep
if [ ! "`diff /data/V6_SuperCharger/!FixAlignment.sh /sy
stem/xbin/fixalign`" ]; then
echo " There is another copy in /system/xbin..."
blurb_Terminal fixalign ========
else info_free_space_error /system/xbin fixalign
fi
echo ""
if [ ! -f "/system/etc/init.d/95fixalign" ] || [ "`diff
/data/V6_SuperCharger/!FixAlignment.sh /system/etc/init.d/95fixalign`" ] && [ -d
"/system/etc/init.d" ]; then
echo $line
echo ""
$sleep
info_free_space_error /etc/init.d 95fixalign
elif [ "$fixalignnotrun" ]; then fixalignnotrun=
echo $line
echo ""
$sleep
blurb_boot_script "Fix Alignment" "FixAlign"
Configure_FixAlignment
fi 2>/dev/null
else info_missing_binary zipalign FixAligning
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 p=/system/build.prop
backup_prop $p
echo $line
cp -fr /system/build.prop $storage/V6_SuperCharg
er/system/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"
blurb_Terminal v6 ==
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 ""
case $v6xbin in
y|Y)if [ "$0" = "v6" ] || [ "$0" = "/system/xbin/v6" ]; then e
cho $line; echo " 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/system/xbin/v
6
if [ ! "`diff $0 /system/xbin/v6`" ]; then
chown 0.0 /system/xbin/v6; chmod 777 /sy
stem/xbin/v6
echo $line
echo " FABULOUS! Installation Was A Gre
at Success!"
else
info_free_space_error /system/xbin v6
echo ""
fi
fi;;
*)echo $line; echo " Well... forget it then...";;
esac
fi
if [ "$opt" -eq 25 ]; then
echo $line
echo " This lets you update ALL V6 Generated Scripts!"
echo $line
echo ""
$sleep
echo " This includes those in system/xbin & /init.d..."
echo ""
$sleep
echo " ...BulletProof One Shots & PowerShift Scripts!"
echo ""
$sleep
echo " Literally DOZENS of scripts get updated..."
echo ""
$sleep
echo " ============================================="
echo " \\\\\\\\//// A U T O M A G I C A L L Y \\\\\\\\////"
echo "
========================================="
echo ""
$sleep
echo " All embedded settings will be retained too ;^]"
echo ""
$sleep
echo $line
echo " Only PREVIOUSLY generated scripts are updated!"
echo $line
echo ""
$sleep
echo " Why? To force you to know what the hell..."
echo ""
$sleep
echo "...they do BEFORE you EFF it all up - THATS WHY!"
echo ""
echo $line
echo ""
$sleep
echo " Re-Generate ALL splits, lickity script?"
echo ""
$sleep
echo -n " Enter Y for Yes, any key for No: "
read generate
echo ""
echo $line
case $generate in
y|Y)echo " OK... Now this is PFC - Pretty Friggin' Cool!"
echo $line
echo ""
$sleep
script_version_check force;;
*)echo "
Well that was a waste of time, eh? :P";;
esac
fi
if [ "$opt" -eq 26 ] || [ "$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.$storagename/V6_SuperCharger/services.
jar.unsupr"
echo ""
$sleep
echo " Do you want to restore it (with permissio
ns)?"
echo "
sts)"
echo ""
$sleep
if [ "`busybox stat -t /system/bin/adb | awk '{p
rint $14}'`" -gt "`busybox stat -t $storage/V6_SuperCharger/services.jar.unsuper
| awk '{print $14}'`" ]; then
adbnewer="yes"
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
else adbnewer=
fi
echo -n " Enter Y for Yes, any key for No: "
if [ "$UnIScream" ] && [ ! "$adbnewer" ]; then r
estorejar=Y; echo $restorejar
else read restorejar
fi
echo ""
case $restorejar in
y|Y)if [ ! "$HazEgg" ]; then
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
if [ ! "`diff $storage/V6_SuperCharger
/services.jar.unsuper /system/framework/services.jar`" ]; then
echo $line
echo "
Successfully restor
ed services.jar!"
echo $line
echo ""
$sleep
if [ "$UnIScream" ]; then blurb_
unsupercharge; fi
else
info_free_space_error /framework
services.jar
echo ""
$sleep
fi
echo $line;;
*);;
esac
fi
if [ "$usedwebapp" ] || [ "$adbnewer" ]; then echo ""; f
i
fi
if [ ! "$servicesjarpatched" ] || [ "$usedwebapp" ] || [ "$adbne
wer" ] && [ ! "$UnIScream" ]; then
if [ "$newsupercharger" ] && [ "$ran" -eq 1 ]; then
echo -n " Press The Enter Key... "
read enter
echo ""
echo "
============================"
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 $storagename to /system/frame
work..."
else
echo " This will download a patched services.jar
..."
echo ""
$sleep
echo "
echo ""
$sleep
echo "
...to /system/framework/services.j
agename..."
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
fi
rm -f $TMP_DIR/t
mp_header
echo $line
case $HEADER_MD5
in
$a|$b)# This i
s a legit reason, not a bad download.
echo "
echo $line
echo ""
$sleep
echo -n " Reason: It's "
if [ "$HEADER_MD5" = "$b" ]; then echo -n "a "; fi
echo "$HEADER_MD5 :p";;
*)echo
" Patched services.jar MD5hash should be:"
echo "
[$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 "
echo $line
echo ""
$sleep
mv $TMP_DIR/tmp_output $storage/V6_SuperCharger/services_supercharged.jar
echo "
else
echo "
echo $line
echo ""
$sleep
echo " There is a possible download issue... :("
fi;;
esac
else
echo ""
echo $line
echo ""
$sleep
echo "
FAI
...can
...
fi
echo $line
echo ""
$sleep
echo -n " Press The Enter Key.
.. "
read enter
echo ""
if [ ! "$autotransmit" ]; then
load_page IvGL1; fi
manualtransmit=yes;autotransmi
t=;;
i|I)echo ""
if [ "$autoinstalljar" ]; then
foundjars="$storage/V6_SuperCharger/services_supercharged.jar"
else saveIFS=$IFS; IFS=`echo en "\n\b"`
echo " Wait... looking
for *services*.jar on $storagename!"
echo ""
for searchjar in `busy
box find $storage/ -iname "*services*.jar"`; do
jarnospace=`echo
$searchjar | sed 's/ /_/g'`
if [ "$searchjar
" != "$jarnospace" ]; then
echo $li
ne
echo ""
echo " R
enaming:" /${searchjar#*/}
$sleep
echo " N
ew Name:" /${jarnospace#*/}
echo ""
$sleep
mv "$sea
rchjar" $jarnospace
fi
foundjars="$foun
djars $jarnospace"
done
IFS=$saveIFS
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:'$storage'::' | while read listja
dev/null
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
if [ !
"`diff $jar /system/framework/services.jar`" ]; then opt=33; newservicesjar=woo
hoo; servicesjarinstalled=yes
echo $line
echo "
I Scream SUPERCHARGED!"
echo $line
echo ""
$sleep
echo $line
else
info_free_space_error /framework services.jar
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 $storagename!"
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 ""
fi
showparlor=;showedparlor=yes;manualtransmit=;UnIScream=
fi
if [ "$opt" -eq 33 ]; 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 "
==================="
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
Re_Generate_SuperClean
blurb_was_created " For Speedy SuperCleaning..." "
.../data/
V6_SuperCharger/!SuperClean.sh..."
blurb_Quick_Widget
echo $line
echo ""
$sleep
if [ ! "`diff /data/V6_SuperCharger/!SuperClean.sh /system/xbin/
sclean`" ]; then
echo " There is another copy in /system/xbin..."
blurb_Terminal sclean ======
else info_free_space_error /system/xbin sclean
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 -fr /sqlit
e_stmt_journals; fi
for cachedir in /*/dalvik-*; do rm -fr $cachedir
/*; 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 34 ]; then
echo $line
echo ""
$sleep
echo " To Return to Driver's Console..."
echo ""
$sleep
echo -n "
...Press the Return or Any Key: "
if [ "$HazEgg" ] || [ "$crapp" ]; then echo " "
else read enter
fi
fi
if [ "$opt" -le 14 ] || [ "$opt" -ge 23 ] && [ "$opt" -le 26 ] || [ "$opt" -eq
34 ]; 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"
if [ "$HazEgg" ] || [ "$crapp" ]; then
echo ""
echo $line
echo ""
$sleep
echo " If there's a next time, say Yes to UnCr-app..."
echo ""
$sleep
echo " ...and SuperCharge the current minfrees... duh!"
echo ""
echo $line
echo ""
$sleep
echo " Oh... and I just deleted myself too..."
echo ""
sleep="sleep $speed"
$sleep
echo $line
echo "
!! OLE !!"
echo $line
if [ "$crapp" ]; then opt=34; rm $0
else
echo ""
$sleep
echo "
Easter Egg Complete!"
echo ""
$sleep
echo $line
echo "
MUHAHAHAHAHAHAHA!!"
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
fi
else sleep 2
fi
fi
if [ "$madesqlitefolder" -eq 1 ]; then rm -fr /sqlite_stmt_journals; fi
remount ro
if [ "$opt" -eq 34 ]; then
echo ""
$sleep
echo "
Buh Bye ;^]"
echo ""
echo $line
echo ""
$sleep
exit 0
fi
done