/
V6SuperCharger
10970 lines (10970 loc) · 383 KB
/
V6SuperCharger
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/sbin/bash
#
# V6 SuperCharger Update 9 RC12 by -=zeppelinrox=-
#
# When using scripting tricks, ideas, or code snippets from here, please give proper 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, redistribution, 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 zeppelinrox also ;^]
# Entropy-ness Enlarger (sysctl tweak for kernel.random.read_wakeup_threshold that 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 Goodness 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 (Not 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_kbytes.
# 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 output 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/busybox*/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> asking redundant questions!</u>. Also check /data/BootLog_SuperCharger.log and /data/Ran_SuperCharger.log!<br>
2. You set Wheel Alignment or Fix Alignment to run on boot but you don't have the zipalign binary installed. Get it by installing the <a href="http://goo.gl/1JPl8">SuperCharger Starter Kit</a>. 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 installed. 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>
<a href="http://goo.gl/4w0ba">MFK Calculator Info</a> - explanation for <b>vm.min_free_kbytes</b><br>
<a href="http://goo.gl/P8Bvu">Entropy-ness Enlarger Info</a> - explanation for <b>kernel.random.read_wakeup_threshold</b><br>
<a href="http://goo.gl/Zc85j">Entropy-ness Enlarger Musings...</a> - Possible reasons why it may actually do something :p<br>
<br>
<u><b>Patching services.jar/odex for ALL ROMS:</b></u>: It actually has 3 Mods. See the <a href="http://goo.gl/IvGL1">-=Ultimatic Jar Patcher Tools=-</a> thread.<br>
Mod 1. "Jelly ISCream" for ICS, Jelly Bean and above. This will SuperCharge Your Home Launcher and ADJ/OOM Priorities!<br>
Mod 2. "Maximum MultiTasking Mods" for Froyo and above<br>
Mod 3. "Non-Sense App Limit" for Sense 4 and above (Not needed for Sense 3.6 and below).<br>
<br>
Ok... now be sure to have <a href="http://play.google.com/store/apps/details?id=com.jrummy.busybox.installer">BusyBox</a> installed or else the scripts won't work!<br>
Most custom roms should already have a version installed and that usually works OK.<br>
So if you need to, only install <b>BusyBox v1.16.2 or higher!</b><br>
Note that some versions above v1.18.2 and below v1.19.1 sometimes give errors so <u>PAY ATTENTION</u> to the script output!<br>
Versions above v1.19.0 should be fine though.<br>
If all else fails or if you get "<b>applet not found</b>" errors, just grab BusyBox from the <a href="http://goo.gl/qM6yR">V6 SuperCharger Thread!</a><br>
Or even better, get the <b>SuperCharger Starter Kit!</b>
<br>
A nice app for running the script is <a href="http://play.google.com/store/apps/details?id=os.tools.scriptmanager">Script Manager</a><br>
It can even load scripts on boot - on ANY ROM!<br>
Plus, it even has WIDGETS!<br>
So you can actually put a V6 SuperCharger shortcut on your desktop, launch it, and have a quick peek at your current status!<br>
<br>
But first, you need to set up Script Manager properly!<br>
In the "Config" settings, enable "Browse as Root."<br>
Then browse to where you saved the V6 SuperCharger script, select it, and in the script's properties box, be sure to select "Run as Root" ie. SuperUser!<br>
<b>Do NOT run this file at boot!</b> (You don't want to run the install on every boot, do you?)<br>
Run the V6 SuperCharger script, touch the screen to access the soft keyboard, and enter your choice :)<br>
<br>
<u><b>Stock ROMs</b></u>: After running the script, have Script Manager load the newly created <b>/data/99SuperCharger.sh</b> on boot<br>
In the "Config" settings, be sure that "Browse as Root" is enabled.<br>
Press the menu key and then Browser. Navigate up to the root, then click on the "data" folder.<br>
Click on 99SuperCharger.sh and select "Script" from the "Open As" menu.<br>
In the properties dialogue box, check "Run as root" (SuperUser) and "Run at boot" and "Save".<br>
And that's it!<br>
Script Manager will load your most recent settings on boot!<br>
If you run the script later and with different settings, you don't have to reconfigure anything.<br>
Script Manager will just load the new /data/99SuperCharger.sh on boot automagically ;^]<br>
<br>
<u><b>Custom ROMs</b></u>: If you have a custom rom that loads /system/etc/init.d boot scripts,<br>
You DON'T need to use Script Manager to load a boot script. It will all be automatic!<br>
Also, if you can run boot scripts from the /system/etc/init.d folder, there are other options.<br>
For example you can use an app like Terminal Emulator to run the script.<br>
<u>PRE-ICS ROMS</u>: If your ROM has the option, <b>DISABLE "Lock Home In Memory.</b> This takes effect immediately.<br>
Alternately, <u>if you need to free up extra ram</u>, you can use "Lock Home in Memory" as a "Saftey Lock".<br>
ie. Use it to toggle your launcher from "Bulletproof" (0) or Hard To Kill (1) to "Weak" (2) in the event that you want to make the launcher an easy kill and free up extra RAM ;)<br>
<br>
<u><b>If Settings Don't Stick:</b></u> If you have Auto Memory Manager, DISABLE SuperUser permissions and if you have AutoKiller Memory Optimizer, DISABLE the apply settings at boot option!<br>
Also, if you have a <b>Custom ROM</b>, there might be something in the init.d folder that interferes with priorities and minfrees.<br>
If you can't find the problem, a quick fix is to have Script Manager run <b>/system/etc/init.d/*99SuperCharger</b> "at boot" and "as root."<br>
<br>
Another option is to make a Script Manager widget for <b>/system/etc/init.d/*99SuperCharger</b> or <b>/data/99SuperCharger.sh</b> on your homescreen and simply launch it after each reboot.<br>
<br>
For those with a <b>Milestone</b>, I made a version for <b>Androidiani Open Recovery</b> too :D<br>
Just extract the zip to the root of $storage (it contains the directory structure), load AOR, and there will be a SuperCharger Menu on the main screen! <br>
<br>
For more SuperCharging help and info,<br>
See the <a href="http://goo.gl/qM6yR">-=V6 SuperCharger Thread=-</a><br>
Feedback is Welcome!<br>
<br>
-=zeppelinrox=- @ <a href="http://goo.gl/qM6yR">XDA</a> & <a href="http://www.droidforums.net/forum/droid-hacks/148268-script-v6-supercharger-htk-bulletproof-launchers-fix-memory-all-androids.html">Droid</a> Forums<br>
<br>
EOF
load_help_file(){
echo ""
echo $line
echo ""
$sleep
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 ""
$sleep
echo $line
}
load_page(){
echo $line
echo ""
$sleep
su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start http://goo.gl/$1"
echo ""
}
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/null
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 passed 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
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 DARE ask me to support broken shit!!"
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 awkerror
echo ""
case $awkerror in
y|Y)echo " uh... right... okay..."
echo ""
echo $line;;
*)echo $line
echo " No SuperCharger For You!"
echo $line
echo ""
$sleep
exit 69;;
esac
fi
fi 2>/dev/null
echo ""
sleep 1
id=$(id); id=${id#*=}; id=${id%%[\( ]*}
if [ "$id" = "0" ] || [ "$id" = "root" ]; then echo " Nice! You're Running as Root/SuperUser!"
else FAIL=yes; sleep="sleep 4"
echo $line
echo " You are NOT running this script as root..."
echo $line
echo ""
$sleep
echo $line
echo " ...No SuperUser For You!!"
echo $line
echo ""
$sleep
echo " ...Please Run as Root and try again..."
echo ""
$sleep
echo " Loading Owner's Guide..."
load_help_file
echo ""
$sleep
echo " I hope that helped! :^)"
echo ""
$sleep
echo " Oh... and one more thing..."
echo ""
echo $line
echo " No SuperCharger For You!"
echo $line
echo ""
$sleep
exit 69
fi
echo ""
sleep 1
echo $line
echo -n " Test Drive Report: "
if [ "$FAIL" ]; then echo "FAIL!"
else echo "PASS!"
fi
echo $line
echo ""
sleep 2
ver=V6U9RC12BlackDog63457Fix
animspeed="busybox sleep 0.2"
smrun=`pgrep scriptmanager`
bbversion=`busybox | awk 'NR==1{print $1,$2}'`
opt=0;ran=0;gb=0;preics=yes;jb=0;memory=c;a=already_modified;b=bad_jar;ram1=10970;oomstick=0;ADJs=0;OOMs=0;minfrees=0
ram=$((`free | awk '/Mem:/{print $2}'`/1024))
heapsize=$(($ram*16/100+$ram*16/100%2))
LIMIT1=0;LIMIT2=3;LIMIT3=6;LIMIT4=10;LIMIT5=12;LIMIT6=15
newscadj="$LIMIT1,$LIMIT2,$LIMIT3,$LIMIT4,$LIMIT5,$LIMIT6";oldscadj1="0,3,5,7,14,15";oldscadj2="0,2,4,7,14,15";oldscadj3="0,3,6,10,14,15";oldscadj4="0,4,8,12,14,15";scamadj1="0,2,5,7,14,15";scamadj2="0,1,2,4,6,15"
minfreefile="/sys/module/lowmemorykiller/parameters/minfree"
if [ -f "/proc/1/oom_adj" ]; then oom_adj="oom_adj"
elif [ -f "/proc/1/oom_score_adj" ]; then oom_adj="oom_score_adj"
fi
if [ "`busybox ps -w`" ]; then w=" -w"; fi 2>/dev/null
TMP_DIR="$storage/V6_SuperCharger/temp"
homeadj=`getprop ro.HOME_APP_ADJ`;FA=`getprop ro.FOREGROUND_APP_ADJ`;PA=`getprop ro.PERCEPTIBLE_APP_ADJ`;VA=`getprop ro.VISIBLE_APP_ADJ`;low=w
api="`grep ro.build.version.sdk /system/build.prop | sed 's/[^0-9]//g' | tr -d '\r'`"
if [ "$api" -ge 14 ]; then postics=yes;preics=;FA=0;PA=2
if [ "$api" -ge 16 ]; then jb=1; fi
elif [ "$PA" ]; then gb=1
fi
initrcpath1="/init.rc"
initrcpath="/data$initrcpath1"
initrcbackup=$initrcpath.unsuper
remount rw
for rc in `grep import $initrcpath1 | grep -v "#" | sed 's/.*import*.//'` `busybox find /system/ -iname "*.rc"`; do
if [ "`echo $rc | grep -Ev "goldfish|ueventd"`" ] && [ ! "`echo $allrcpaths | grep $rc`" ]; then
if [ ! -f "$rc" ]; then
echo "on early-boot" > $rc
echo "on boot" > $rc
touch $rc.unsuper
fi
chown 0.0 $rc; chmod 644 $rc
allrcpaths="$allrcpaths $rc"
if [ "`grep -ls "on boot" $rc`" ]; then rcpaths="$rcpaths $rc"; fi
fi
done
remount ro
alias echo="busybox echo"
alias rm="busybox rm"
alias mkdir="busybox mkdir"
crapp=`grep "artprojects\.RAM" /d*/system/packages.xml | sed 's/.* name="\|".*//g'`
mkdir -p /data/V6_SuperCharger
mkdir -p $storage/V6_SuperCharger/system/xbin
mkdir -p $storage/V6_SuperCharger/system/etc/init.d
mkdir -p $storage/V6_SuperCharger/data/V6_SuperCharger/PowerShift_Scripts
mkdir -p $storage/V6_SuperCharger/data/V6_SuperCharger/BulletProof_One_Shots
mkdir -p $storage/V6_SuperCharger/temp
if [ "`ls $storage/V6_SuperCharger/SuperCharger*`" ]; then mv $storage/V6_SuperCharger/SuperCharger* $storage/V6_SuperCharger/data/V6_SuperCharger; fi 2>/dev/null
if [ "`ls $storage/V6_SuperCharger/BulletProof_Apps*`" ]; then mv $storage/V6_SuperCharger/BulletProof_Apps* $storage/V6_SuperCharger/data/V6_SuperCharger; fi 2>/dev/null
if [ "`ls $storage/V6_SuperCharger/9*.sh`" ]; then mv $storage/V6_SuperCharger/9*.sh $storage/V6_SuperCharger/data; fi 2>/dev/null
if [ "`ls $storage/V6_SuperCharger/\!*.sh`" ]; then mv $storage/V6_SuperCharger/\!*.sh $storage/V6_SuperCharger/data/V6_SuperCharger; fi 2>/dev/null
if [ -d "$storage/V6_SuperCharger/BulletProof_One_Shots" ]; then
cp -fr $storage/V6_SuperCharger/BulletProof_One_Shots $storage/V6_SuperCharger/data/V6_SuperCharger
rm -r $storage/V6_SuperCharger/BulletProof_One_Shots
fi
if [ -d "$storage/V6_SuperCharger/PowerShift_Scripts" ]; then
cp -fr $storage/V6_SuperCharger/PowerShift_Scripts $storage/V6_SuperCharger/data/V6_SuperCharger
rm -r $storage/V6_SuperCharger/PowerShift_Scripts
fi
if [ -f "$storage/V6_SuperCharger/99super" ]; then mv $storage/V6_SuperCharger/99super $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/98kak" ]; then mv $storage/V6_SuperCharger/98kak $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/vac" ]; then mv $storage/V6_SuperCharger/vac $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/zepalign" ]; then mv $storage/V6_SuperCharger/zepalign $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/fixfc" ]; then mv $storage/V6_SuperCharger/fixfc $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/fixalign" ]; then mv $storage/V6_SuperCharger/fixalign $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/flush" ]; then mv $storage/V6_SuperCharger/flush $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/sclean" ]; then mv $storage/V6_SuperCharger/sclean $storage/V6_SuperCharger/system/xbin; fi
if [ -f "$storage/V6_SuperCharger/v6" ]; then mv $storage/V6_SuperCharger/v6 $storage/V6_SuperCharger/system/xbin; fi
if [ "`ls $storage/V6_SuperCharger/*9*`" ]; then mv $storage/V6_SuperCharger/*9* $storage/V6_SuperCharger/system/etc/init.d; fi 2>/dev/null
if [ -f "/data/V6_SuperCharger/SuperChargerMinfree" ]; then
cp -fr /data/V6_SuperCharger/SuperChargerMinfree /data/V6_SuperCharger/SuperChargerMinfreeOld
scminfreeold=`cat /data/V6_SuperCharger/SuperChargerMinfreeOld`
fi
load_options(){
speed=`awk -F , '{print $1}' /data/V6_SuperCharger/SuperChargerOptions`
buildprop=`awk -F , '{print $2}' /data/V6_SuperCharger/SuperChargerOptions`
animation=`awk -F , '{print $3}' /data/V6_SuperCharger/SuperChargerOptions`
initrc=`awk -F , '{print $4}' /data/V6_SuperCharger/SuperChargerOptions`
launcheradj=`awk -F , '{print $5}' /data/V6_SuperCharger/SuperChargerOptions`
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/SuperChargerOptions`
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/SuperChargerOptions`
fi
propaccessories=`awk -F , '{print $8}' /data/V6_SuperCharger/SuperChargerOptions`
if [ -f "/data/99SuperCharger.sh" ]; then tc3g=`grep "^TCE=" /data/99SuperCharger.sh | sed 's/[^0-9]//g'`
else tc3g=`awk -F , '{print $9}' /data/V6_SuperCharger/SuperChargerOptions`
fi
if [ -f "/data/99SuperCharger.sh" ]; then sdtweak=`grep "^sdtweak=" /data/99SuperCharger.sh | sed 's/[^0-9]//g'`
else sdtweak=`awk -F , '{print $10}' /data/V6_SuperCharger/SuperChargerOptions`
fi
if [ -f "/data/97BulletProof_Apps.sh" ]; then bpwait=`grep "^bpwait=" /data/97BulletProof_Apps.sh | sed 's/[^0-9]//g'`
else bpwait=`awk -F , '{print $11}' /data/V6_SuperCharger/SuperChargerOptions`
fi
if [ -f "/data/V6_SuperCharger/!Detailing.sh" ]; then detailinterval=`grep "^detailinterval=" /data/V6_SuperCharger/!Detailing.sh | sed 's/[^0-9]//g'`
else detailinterval=`awk -F , '{print $12}' /data/V6_SuperCharger/SuperChargerOptions`
fi
if [ -f "/data/V6_SuperCharger/!WheelAlignment.sh" ]; then zepalign=`grep "^bootzepalign=" /data/V6_SuperCharger/!WheelAlignment.sh | sed 's/[^0-9]//g'`
else zepalign=`awk -F , '{print $13}' /data/V6_SuperCharger/SuperChargerOptions`
fi
if [ -f "/data/V6_SuperCharger/!FixEmissions.sh" ]; then fixemissions=`grep "^bootfixemissions=" /data/V6_SuperCharger/!FixEmissions.sh | sed 's/[^0-9]//g'`
else fixemissions=`awk -F , '{print $14}' /data/V6_SuperCharger/SuperChargerOptions`
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/SuperChargerOptions`
fi
if [ -f "/data/V6_SuperCharger/!FastEngineFlush.sh" ]; then flushOmaticHours=`grep "^flushOmaticHours=" /data/V6_SuperCharger/!FastEngineFlush.sh | sed 's/[^\.0-9]//g'`
else flushOmaticHours=`awk -F , '{print $16}' /data/V6_SuperCharger/SuperChargerOptions`
fi
if [ ! "`awk -F , '{print $16}' /data/V6_SuperCharger/SuperChargerOptions`" ]; 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]"`" ] || [ "$sdtweak" -lt 64 ] && [ "$sdtweak" != 0 ]; then sdtweak=$(((ram/64+1)*128)); fi
if [ ! -f "/data/V6_SuperCharger/BulletProof_Apps_HitList" ] && [ ! "`grep "BulletProofing" /data/V6_SuperCharger/BulletProof_Apps_Fine_Tuner.sh`" ]; then bpwait=0
elif [ ! "$bpwait" ] || [ "`echo $bpwait | grep "[^0-9]"`" ]; then bpwait=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 " |/ #####";echo "";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 " || // #####";echo " ||// # #";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=-";echo " || // #####";echo " ||// # #";echo " | / # # Presented by:";echo " |/ #####";echo "";echo $line;sleep 1
clear;echo " zOOM... zOOM...";echo $line;echo "";echo " || // #####";echo " || // # #";echo " || // # -=SUPERCHARGER=-";echo " || // #####";echo " ||// # #";echo " | / # # Presented by:";echo " |/ ##### -=zeppelinrox=-";echo "";echo $line;sleep 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 fine - if it's COMPLETE!"; echo ""
else
echo $line
echo -n " WARNING! Your BusyBox is "
if [ "$bbversion" \> "BusyBox v1.18.2" ] && [ "$bbversion" \< "BusyBox v1.19.0" ]; then
echo "greater than v1.18.2"
echo ""
sleep 2
echo " ...and less that v1.19.0!"
echo $line
echo ""
sleep 2
echo " These versions can cause problems..."
else
echo "less than v1.16.2"
echo $line
echo ""
sleep 2
echo " Some commands may not even work..."
fi
echo ""
sleep 2
echo " ..and you may have issues such as bootloops..."
echo ""
sleep 2
echo " ...proceed at your own risk!!"
echo ""
sleep 2
echo " Get BusyBox from the V6 SuperCharger Thread!"
echo ""
load_page qM6yR
fi
echo $line
terms(){
cat >> "$1" <<EOF
ver=$ver
#
# When using scripting tricks, ideas, or code snippets from here, GIVE PROPER CREDIT.
# There are many things may look simple, but actually took a lot of time, trial, and error to get perfected.
# So DO NOT remove credits, put your name on top, and pretend it's your creation.
# That's called kanging and makes you a dumbass.
#
# 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, redistribution, or mirrors of my work are NOT PERMITTED.
# Thanks, zeppelinrox.
#
EOF
}
script_version_check(){
for regen in /data/99SuperCharger.sh /data/97BulletProof_Apps.sh /data/V6_SuperCharger/*\.sh /data/V6_SuperCharger/BulletProof_One_Shots/* /data/V6_SuperCharger/PowerShift_Scripts/*; do
if [ -f "$regen" ]; then
if [ ! "$1" ] && [ ! "$didtitle" ] && [ ! "`grep $ver "$regen"`" ]; then
remount rw
if [ -d "/sqlite_stmt_journals" ]; then madesqlitefolder=0
else mkdir /sqlite_stmt_journals; madesqlitefolder=1
fi
echo ""
$sleep
echo " Doh... I found outdated script thingies..."
echo ""
$sleep
echo " ...so going to run the..."
echo ""
$sleep
echo $line
echo " \\\\\\\\ Super Smart Script Re-Generator ////"
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 | sed 's/\!//'`" echo
fi
$sleep
fi
fi
done
if [ "$1" ] || [ "$didtitle" ]; then
echo ""
echo $line
if [ "$checkedspace" ]; then
echo " WARNING: There were ERRORS copying to /system!"
echo $line
echo ""
$sleep
echo " Got enough free space?"
echo ""
$sleep
echo $line
echo " System Partition has `busybox df -h | awk '/% \/system$/{print $(NF-2),"Free ("$(NF-1)" Used)"}'`"
else echo " Hey that was easy!( well... for YOU it was :P )"
fi
if [ "$didtitle" ]; then
echo $line
echo ""
$sleep
echo -n " Press The Enter Key... "
read enter
echo ""
echo $line
if [ "$madesqlitefolder" -eq 1 ]; then rm -fr /sqlite_stmt_journals; fi
remount ro
fi
fi
didtitle=; did1shottitle=; didshifttitle=; checkedspace=
}
get_oomadj_info(){
currentminfree=`cat $minfreefile`
ram2=`$low$memory "$0" | awk '{print $1}'`
if [ -f "/data/V6_SuperCharger/SuperChargerAdj" ]; then scadj=`cat /data/V6_SuperCharger/SuperChargerAdj`; fi
if [ -f "/data/V6_SuperCharger/SuperChargerMinfree" ]; then scminfree=`cat /data/V6_SuperCharger/SuperChargerMinfree`; fi
if [ -f "/data/V6_SuperCharger/SuperChargerCustomMinfree" ]; then sccminfree=`cat /data/V6_SuperCharger/SuperChargerCustomMinfree`; fi
if [ -f "/data/V6_SuperCharger/BulletProof_Apps_HitList" ]; then bpapplist=`cat /data/V6_SuperCharger/BulletProof_Apps_HitList`; fi
if [ -f "/sys/module/lowmemorykiller/parameters/adj" ] && [ "`awk -F , '$2<=1000' /sys/module/lowmemorykiller/parameters/adj`" ] && [ "`awk -F , '{print $6}' /sys/module/lowmemorykiller/parameters/adj`" ]; then adjfile="/sys/module/lowmemorykiller/parameters/adj"
elif [ -f "/data/V6_SuperCharger/SuperChargerAdj" ]; then adjfile="/data/V6_SuperCharger/SuperChargerAdj"
fi
if [ ! "$adjfile" ]; then oomadj1=0;oomadj2=1;oomadj3=2;oomadj4=4;oomadj5=9;oomadj6=15;currentadj="0,1,2,4,9,15"
elif [ "`awk -F , '$2>15' $adjfile`" ]; then
oomadj1=`awk -F , '{printf "%.0f\n", $1*17/1000}' $adjfile`;oomadj2=`awk -F , '{printf "%.0f\n", $2*17/1000}' $adjfile`;oomadj3=`awk -F , '{printf "%.0f\n", $3*17/1000}' $adjfile`;oomadj4=`awk -F , '{printf "%.0f\n", $4*17/1000}' $adjfile`;oomadj5=`awk -F , '{printf "%.0f\n", $5*17/1000}' $adjfile`;oomadj6=15
currentadj="$oomadj1,$oomadj2,$oomadj3,$oomadj4,$oomadj5,$oomadj6"
newscadj2="0,176,352,588,705,1000"
else
oomadj1=`awk -F , '{print $1}' $adjfile`;oomadj2=`awk -F , '{print $2}' $adjfile`;oomadj3=`awk -F , '{print $3}' $adjfile`;oomadj4=`awk -F , '{print $4}' $adjfile`;oomadj5=`awk -F , '{print $5}' $adjfile`;oomadj6=`awk -F , '{print $6}' $adjfile`
currentadj=`cat $adjfile`
fi
}
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 launcher acore; do
validlauncher=`pgrep -l $launchers | awk '{print $2}' | grep -Ev "/|notification|gowidget|downloadservice"` 2>/dev/null
if [ "$validlauncher" ] && [ ! "`echo $llist | grep $validlauncher`" ]; then llist="$llist $validlauncher"; fi 2>/dev/null
done
for l in $llist; do
for lpid in `pgrep $l`; do loom_adj=`cat /proc/$lpid/$oom_adj`
if [ "$loom_adj" -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
elif [ "${adj#-}" -gt 20 ]; then adj=`echo $adj | awk '{printf "%.0f\n", $1*17/1000}'`
fi
if [ "$adj" -eq 1 ]; then adjs1=$(($adjs1+1)); fi
if [ "$adj" -eq 3 ]; then adjs3=$(($adjs3+1)); fi
if [ "$adj" -eq 5 ]; then adjs5=$(($adjs5+1)); fi
if [ "$adj" -eq 6 ]; then adjs6=$(($adjs6+1)); fi
if [ "$adj" -eq 7 ]; then adjs7=$(($adjs7+1)); fi
fi
done 2>/dev/null
if [ ! "$HL" ]; then HL=6; fi
if [ "$odex" ] && [ "$adjs1" -gt 1 ]; then showparlor=yes; VA=1
elif [ "$HL" -eq 1 ] && [ "$adjs1" -eq 1 ] || [ "$adjs3" -gt 0 ]; then servicesjarpatched=hellzyeah; VA=3
elif [ "$HL" -eq 0 ] || [ "$HL" -eq 2 ] && [ "$adjs1" -eq 0 ]; then servicesjarpatched=hellzyeah; VA=3
else VA=1
if [ "$HL" -gt 2 ]; then
if [ "$adjs5" -gt 1 ] && [ "$adjs6" -gt 1 ]; then showparlor=yes
elif [ "$adjs7" -gt 0 ] || [ "$adjs5" -gt 0 ] && [ "$adjs6" -eq 1 ]; then showparlor=yes
elif [ "$adjs7" -gt 0 ] || [ "$adjs6" -gt 0 ] && [ "$adjs5" -eq 1 ]; then showparlor=yes
else servicesjarpatched=hellzyeah; usedwebapp=yes
fi
elif [ "$HL" -eq 1 ]; then servicesjarpatched=hellzyeah; usedwebapp=yes
elif [ "$adjs7" -gt 0 ] || [ "$adjs5" -gt 0 ] && [ "$adjs6" -eq 0 ]; then showparlor=yes
elif [ "$adjs7" -gt 0 ] || [ "$adjs6" -gt 0 ] && [ "$adjs5" -eq 0 ]; then showparlor=yes
else servicesjarpatched=hellzyeah; usedwebapp=yes
fi
if [ -f "$storage/ultimatic.tmp" ]; then showparlor=; rm -f $storage/ultimatic.tmp; fi
fi
fi
}
get_ram_info(){
ramkbytesfree=`free | awk '/Mem:/{print $4}'`
ramkbytescached=`awk '/^Cached:/{print $2}' /proc/meminfo`
ramfree=$(($ramkbytesfree/1024));ramcached=$(($ramkbytescached/1024));ramreportedfree=$(($ramfree + $ramcached))
echo $line
echo " True Free $ramfree MB = \"Free\" $ramreportedfree - Cached Apps $ramcached"
echo $line
}
MFK_Calculator(){
#
# MFK Calculator (for min_free_kbytes) created by zeppelinrox.
#
if [ "$slot" ] && [ "$postics" ] && [ ! "$servicesjarpatched" ]; then SSADJ=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
echo " Install a BusyBox build with MORE features!"
echo $line
echo ""
$sleep
}
Apply_KVM_Tweaks(){
echo -n " ";busybox sysctl -w vm.oom_kill_allocating_task=0
echo -n " ";busybox sysctl -w vm.panic_on_oom=0
echo -n " ";busybox sysctl -w vm.vfs_cache_pressure=10
echo -n " ";busybox sysctl -w vm.overcommit_memory=1
echo -n " ";busybox sysctl -w vm.swappiness=20
if [ "$panicmode" -gt 0 ]; then
echo -n " ";busybox sysctl -w kernel.panic_on_oops=$kpoops
echo -n " ";busybox sysctl -w kernel.panic=$kpanic
fi
if [ "$pyness" -ne 0 ]; then
echo -n " ";busybox sysctl -w kernel.random.write_wakeup_threshold=128
echo -n " ";busybox sysctl -w kernel.random.read_wakeup_threshold=1376
echo ""
$sleep
echo $line
echo " Note: Last one's the -=Entropy-ness Enlarger=-!"
echo $line
fi
echo ""
$sleep
if [ -e "/dev/frandom" ]; then 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
echo " w00t! Your kernel supports frandom(fast random)"
echo ""
$sleep
echo $line
echo " So the -=Fentropy enForcer=- was applied too!"
echo $line
echo ""
$sleep
fi
}
Apply_Accessories(){