-
Notifications
You must be signed in to change notification settings - Fork 24
/
L_Speed_OLD
6428 lines (5896 loc) · 226 KB
/
L_Speed_OLD
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
#!/system/bin/sh
# Copyright (C) 2016 Paget96
# Big thanks for our legend zeppelinrox
# Thanks to Google, xda and to all users who contribute
#
# L SPEED V4.3.3 VECTOR by Paget96
#
ver="4.3.3"
#
# 11-JAN-2016
#
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
if [ -e /system/bin/busybox ]; then
busybox chmod 111 /system/bin/busybox
elif [ -e /system/xbin/busybox ]; then
busybox chmod 111 /system/xbin/busybox
fi
if [ ! -d "/data/local/busybox*/xbin" ]; then export "PATH"=$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin
else export "PATH"=$PATH:/system/xbin:/sbin:/vendor/bin:/system/sbin:/system/bin:$(busybox ls -d /data/local/busybox*/xbin 2>/dev/null)
fi 2>/dev/null
divider="==============================================="
timeblast="0.1"
timeshorter="0.5"
timeshort="1"
timelong="2"
timelonger="5"
init="/system/etc/init.d" 2>/dev/null
core="/system/L_SPEED" 2>/dev/null
backup="/sdcard/LS_backup" 2>/dev/null
bb1="/system/bin/busybox" 2>/dev/null
bb2="/system/xbin/busybox" 2>/dev/null
bb_down="https://play.google.com/store/apps/details?id=stericson.busybox"
bb_down_flash="http://forum.xda-developers.com/showthread.php?t=3219431"
thread="http://forum.xda-developers.com/android/software-hacking/tweak-l-speed-v1-0-02-02-2015-t3020138"
donation="http://forum.xda-developers.com/donatetome.php?u=5514152"
bbver=$(busybox | busybox head -n 1 | busybox awk '{print $1,$2}') 2>/dev/null
sestat=$(getenforce) 2>/dev/null
id="$(id)"; id="${id#*=}"; id="${id%%\(*}"; id="${id%% *}"
if [ "$id" != "0" ] && [ "$id" != "root" ]; then
busybox sleep $timeshort
busybox echo ""
busybox echo ""
busybox echo " You don't have ROOT..."
busybox echo " Please type su first (terminal emulator)"
busybox echo " Enable run as ROOT (script manager)"
busybox echo ""
busybox sleep $timeshort
exit
fi
busybox clear
busybox echo ""
busybox echo ""
busybox echo ""
busybox echo " Welcome"
busybox sleep $timeshort
busybox echo " to L SPEED"
busybox sleep $timeshorter
busybox echo " VECTOR"
busybox sleep $timeshorter
busybox echo " by Paget96"
busybox echo ""
busybox echo ""
busybox echo ""
busybox sleep $timeshorter
busybox echo ""
busybox sleep $timeshorter
busybox echo ""
busybox echo " Hell yeah!!!"
busybox echo ""
busybox sleep $timelong
busybox clear
busybox echo ""
busybox echo ""
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
if [ ! -d "/sqlite_stmt_journals" ]; then
busybox mkdir -p /sqlite_stmt_journals;
fi
if [ ! -d /system/su.d ]; then
busybox mkdir -p /system/su.d/
busybox chmod 755 /system/su.d/
fi
busybox echo "Checking busybox"
busybox sleep $timeshort
busybox echo ""
busybox echo ""
if [ -e $bb1 ]; then
busybox echo "Awesome, you have $bbver"
busybox echo ""
elif [ -e $bb2 ]; then
busybox echo "Awesome, you have $bbver"
busybox echo ""
else
busybox echo "You don't have busybox"
busybox sleep $timeshorter
busybox echo "Do you want to download it now??"
busybox sleep $timeshorter
busybox echo "[ 1 = Download now | 2 = I will do that later ]:"
read -r option
if [ "$option" -eq 1 ]; then
busybox echo "Choose source :"
busybox sleep $timeshorter
busybox echo "[ 1 = App from play store | 2 = Flashable zip by me]"
read -r option
if [ "$option" -eq 1 ]; then
su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start $bb_down"
busybox clear
exit
elif [ "$option" -eq 2 ]; then
su -c "LD_LIBRARY_PATH=/vendor/lib:/system/lib am start $bb_down_flash"
busybox clear
exit
fi
else
busybox echo " When you have a time, download it"
busybox sleep $timeshort
busybox echo " Then come back here ^~^"
busybox sleep $timeshort
busybox echo " Good luck!!!"
busybox sleep $timelong
busybox clear
exit
fi
fi
busybox echo ""
busybox sleep $timelong
busybox echo "Checking init.d support"
busybox echo ""
busybox sleep $timeshort
if [ -e $init ]; then
busybox echo "GOOD!!! You have init.d support"
busybox sleep $timelong
else
busybox echo "Baad :( Please enable init.d support"
busybox sleep $timeshort
busybox echo " Installer will now create"
busybox sleep $timeshort
busybox echo "only init.d folder"
busybox sleep $timeshort
busybox echo "You need to enable init.d support later"
busybox echo "from L SPEED WIZARD"
busybox sleep $timelong
busybox mkdir -p $init/
busybox chmod 755 $init/
busybox chown 0:0 $init/
fi
if [ ! -d $core ]; then
busybox mkdir -p $core
busybox chmod 755 $core
busybox mkdir -p $core/LOGS
busybox chmod 755 $core/LOGS
touch $core/LOGS/dummy_file
fi
for file in $core/LS00*
do
busybox rm -rf $file 2>/dev/null
done
#
#
# Init.d enabler
#
#
#
busybox cat >> $core/LS00Init_d.sh <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
/system/xbin/sysinit
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Init_d.sh
busybox chown 0:0 $core/LS00Init_d.sh
if [ -f /system/su.d/LS00init_d.sh ]; then
busybox rm -rf /system/su.d/LS00init_d.sh
busybox cp -f $core/LS00Init_d.sh /system/su.d/LS00init_d.sh
busybox chmod 755 /system/su.d/LS00init_d.sh
busybox chown 0:2000 /system/su.d/LS00init_d.sh
elif [ -f /system/etc/install-recovery-2.sh ]; then
busybox rm -rf /system/etc/install-recovery-2.sh
busybox cp -f $core/LS00Init_d.sh /system/etc/install-recovery-2.sh
busybox chmod 755 /system/etc/install-recovery-2.sh
busybox chown 0:2000 /system/etc/install-recovery-2.sh
fi
#
#
# Sysinit file (init.d trigger)
#
#
#
busybox cat >> $core/LS00Sysinit <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
busybox sleep 60
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
busybox run-parts /system/etc/init.d/
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Sysinit
busybox chown 0:0 $core/LS00Sysinit
if [ -f /system/xbin/sysinit ]; then
busybox rm -rf /system/xbin/sysinit
busybox cp -f $core/LS00Sysinit /system/xbin/sysinit
busybox chmod 755 /system/xbin/sysinit
busybox chown 0:0 /system/xbin/sysinit
fi
#
#
# LSPEED Status
#
#
#
busybox cat >> $core/LS00LSPEED <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
busybox mkdir -p /tmp
busybox chmod 755 /tmp
LS=/tmp/LSPEED.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox touch \$LS
busybox echo "L SPEED dummy file" | busybox tee -a \$LS
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00LSPEED
busybox chown 0:0 $core/LS00LSPEED
#
#
# MCPS
#
#
#
busybox cat >> $core/LS00MCPS <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
LS=/system/L_SPEED/LOGS/LS00MCPS.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox echo "# L Speed log" | busybox tee -a \$LS
busybox echo "" | busybox tee -a \$LS
busybox echo "CPU multicore power save is running..." | busybox tee -a \$LS
# MCPS
if [ -f "/sys/devices/system/cpu/sched_mc_power_savings" ]; then
busybox echo "2" > /sys/devices/system/cpu/sched_mc_power_savings;
fi;
if busybox grep 2 /sys/devices/system/cpu/sched_mc_power_savings; then
busybox echo "Feature enabled" | busybox tee -a \$LS; else
busybox echo "This feature is not avaible for you, because your device is not multi core or your CPU doesn't support it" | busybox tee -a \$LS
fi
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00MCPS
busybox chown 0:0 $core/LS00MCPS
#
#
# CPU Optimizer
#
#
#
busybox cat >> $core/LS00CPU_Optimizer <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
LS=/system/L_SPEED/LOGS/LS00CPU_Optimizer.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox echo "# L Speed log" | busybox tee -a \$LS
busybox echo "" | busybox tee -a \$LS
busybox echo "Optimizing CPU.." | busybox tee -a \$LS
# CPU_Optimizer
if [ -e /dev/cpuctl/cpu.shares ]; then
busybox echo "1024" > /dev/cpuctl/cpu.shares
fi;
if [ -e /dev/cpuctl/cpu.rt_runtime_us ]; then
busybox echo "800000" > /dev/cpuctl/cpu.rt_runtime_us
fi;
if [ -e /dev/cpuctl/cpu.rt_period_us ]; then
busybox echo "1000000" > /dev/cpuctl/cpu.rt_period_us
fi;
# 6.0%
if [ -e /dev/cpuctl/bg_non_interactive/cpu.shares ]; then
busybox echo "62" > /dev/cpuctl/bg_non_interactive/cpu.shares
fi;
if [ -e /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us ]; then
busybox echo "700000" > /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us
fi;
if [ -e /dev/cpuctl/bg_non_interactive/cpu.rt_runtime_us ]; then
busybox echo "1000000" > /dev/cpuctl/bg_non_interactive/cpu.rt_period_us
fi;
busybox echo "" | busybox tee -a \$LS
busybox echo "CPU is optimized" | busybox tee -a \$LS
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00CPU_Optimizer
busybox chown 0:0 $core/LS00CPU_Optimizer
#
#
# Selinux enforce
#
#
#
busybox cat >> $core/LS00Selinux_Enforce <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
busybox chmod 666 /sys/fs/selinux/enforce
setenforce 1
busybox echo "1" > /sys/fs/selinux/enforce
busybox chmod 444 /sys/fs/selinux/enforce
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Selinux_Enforce
busybox chown 0:0 $core/LS00Selinux_Enforce
#
#
# Selinux permissive
#
#
#
busybox cat >> $core/LS00Selinux_Permissive <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
busybox chmod 666 /sys/fs/selinux/enforce
setenforce 0
busybox echo "0" > /sys/fs/selinux/enforce
busybox chmod 444 /sys/fs/selinux/enforce
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Selinux_Permissive
busybox chown 0:0 $core/LS00Selinux_Permissive
#
#
# Cleaner
#
#
#
busybox cat >> $core/LS00Cleaner <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
mount -o remount,rw /data 2>/dev/null
mount -o remount,rw /cache 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw /data 2>/dev/null
busybox mount -o remount,rw /cache 2>/dev/null
LS=/system/L_SPEED/LOGS/LS00Cleaner.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox echo "# L Speed log" | busybox tee -a \$LS
busybox echo "" | busybox tee -a \$LS
busybox echo "Cleaner script is running..." | busybox tee -a \$LS
busybox rm -f /cache/*.apk 2>/dev/null
busybox rm -f /cache/*.tmp 2>/dev/null
busybox rm -f /cache/*.log 2>/dev/null
busybox rm -f /cache/*.txt 2>/dev/null
busybox rm -f /cache/recovery/* 2>/dev/null
busybox rm -f /data/*.log 2>/dev/null
busybox rm -f /data/*.txt 2>/dev/null
busybox rm -f /data/anr/*.log 2>/dev/null
busybox rm -f /data/anr/*.txt 2>/dev/null
busybox rm -f /data/backup/pending/*.tmp 2>/dev/null
busybox rm -f /data/cache/*.* 2>/dev/null
busybox rm -f /data/dalvik-cache/*.apk 2>/dev/null
busybox rm -f /data/dalvik-cache/*.tmp 2>/dev/null
busybox rm -f /data/dalvik-cache/*.log 2>/dev/null
busybox rm -f /data/dalvik-cache/*.txt 2>/dev/null
busybox rm -f /data/data/*.log 2>/dev/null
busybox rm -f /data/data/*.txt 2>/dev/null
busybox rm -f /data/log/*.log 2>/dev/null
busybox rm -f /data/log/*.txt 2>/dev/null
busybox rm -f /data/local/*.apk 2>/dev/null
busybox rm -f /data/local/*.log 2>/dev/null
busybox rm -f /data/local/*.txt 2>/dev/null
busybox rm -f /data/local/tmp/*.log 2>/dev/null
busybox rm -f /data/local/tmp/*.txt 2>/dev/null
busybox rm -f /data/last_alog/*.log 2>/dev/null
busybox rm -f /data/last_alog/*.txt 2>/dev/null
busybox rm -f /data/last_kmsg/*.log 2>/dev/null
busybox rm -f /data/last_kmsg/*.txt 2>/dev/null
busybox rm -f /data/mlog/* 2>/dev/null
busybox rm -f /data/tombstones/*.log 2>/dev/null
busybox rm -f /data/tombstones/*.txt 2>/dev/null
busybox rm -f /data/system/*.log 2>/dev/null
busybox rm -f /data/system/*.txt 2>/dev/null
busybox rm -f /data/system/dropbox/*.log 2>/dev/null
busybox rm -f /data/system/dropbox/*.txt 2>/dev/null
busybox rm -f /data/system/usagestats/*.log 2>/dev/null
busybox rm -f /data/system/usagestats/*.txt 2>/dev/null
export sampling_rate=10000
export up_threshold=80
busybox echo "memory cleaner--------[OK]" | busybox tee -a \$LS
for file in /data/anr/*.*
do
if [ -e "\$file" ]
then
busybox echo "-anr not cleaned" | busybox tee -a \$LS
else
busybox echo "-anr cleaned" | busybox tee -a \$LS
fi
done
for file in /data/local/tmp/*.*
do
if [ -e "\$file" ]
then
busybox echo "-local/tmp not cleaned" | busybox tee -a \$LS
else
busybox echo "-local/tmp cleaned" | busybox tee -a \$LS
fi
done
for file in /data/cache/*.*
do
if [ -e "\$file" ]
then
busybox echo "-cache not cleaned" | busybox tee -a \$LS
else
busybox echo "-cache cleaned" | busybox tee -a \$LS
fi
done
for file in /data/last_log/*.*
do
if [ -e "\$file" ]
then
busybox echo "-log not cleaned" | busybox tee -a \$LS
else
busybox echo "-log cleaned" | busybox tee -a \$LS
fi
done
for file in /data/tombstones/*.*
do
if [ -e "\$file" ]
then
busybox echo "-tombstones not cleaned" | busybox tee -a \$LS
else
busybox echo "-tombstones cleaned" | busybox tee -a \$LS
fi
done
busybox echo "" | busybox tee -a \$LS
busybox echo "All junk directories are now cleaned" | busybox tee -a \$LS
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Cleaner
busybox chown 0:0 $core/LS00Cleaner
#
#
# Seeder Light
#
#
#
busybox cat >> $core/LS00Seeder_Light <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
LS=/system/L_SPEED/LOGS/LS00Seeder.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox echo "# L Speed log" | busybox tee -a \$LS
busybox echo "" | busybox tee -a \$LS
busybox echo "Activating light seeder profile.." | busybox tee -a \$LS
busybox sysctl -e -w kernel.random.read_wakeup_threshold=128
busybox sysctl -e -w kernel.random.write_wakeup_threshold=256
busybox sleep 1
if grep "128" proc/sys/kernel/random/read_wakeup_threshold; then
busybox echo "Light seeder profile is activated.." | busybox tee -a \$LS
else
busybox echo "Light seeder profile is not activated.." | busybox tee -a \$LS
fi
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Seeder_Light
busybox chown 0:0 $core/LS00Seeder_Light
#
#
# Seeder Enlarger
#
#
#
busybox cat >> $core/LS00Seeder_Enlarger <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
LS=/system/L_SPEED/LOGS/LS00Seeder.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox echo "# L Speed log" | busybox tee -a \$LS
busybox echo "" | busybox tee -a \$LS
busybox echo "Activating enlarger seeder profile.." | busybox tee -a \$LS
busybox sysctl -e -w kernel.random.read_wakeup_threshold=64
busybox sysctl -e -w kernel.random.write_wakeup_threshold=896
busybox sleep 1
if grep "64" /proc/sys/kernel/random/read_wakeup_threshold; then
busybox echo "Enlarger seeder profile is activated.." | busybox tee -a \$LS
else
busybox echo "Enlarger seeder profile is not activated.." | busybox tee -a \$LS
fi
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Seeder_Enlarger
busybox chown 0:0 $core/LS00Seeder_Enlarger
#
#
# Seeder Moderate
#
#
#
busybox cat >> $core/LS00Seeder_Moderate <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
LS=/system/L_SPEED/LOGS/LS00Seeder.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox echo "# L Speed log" | busybox tee -a \$LS
busybox echo "" | busybox tee -a \$LS
busybox echo "Activating moderate seeder profile.." | busybox tee -a \$LS
busybox sysctl -e -w kernel.random.read_wakeup_threshold=1366
busybox sysctl -e -w kernel.random.write_wakeup_threshold=2048
busybox sleep 1
if grep "1366" /proc/sys/kernel/random/read_wakeup_threshold; then
busybox echo "Moderate seeder profile is activated.." | busybox tee -a \$LS
else
busybox echo "Moderate seeder profile is not activated.." | busybox tee -a \$LS
fi
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null
mount -o remount,ro rootfs 2>/dev/null
mount -o remount,ro /system 2>/dev/null
mount -o remount,ro /system /system 2>/dev/null
busybox mount -o remount,ro / 2>/dev/null
busybox mount -o remount,ro / / 2>/dev/null
busybox mount -o remount,ro rootfs 2>/dev/null
busybox mount -o remount,ro /system 2>/dev/null
busybox mount -o remount,ro /system /system 2>/dev/null
EOF
busybox chmod 755 $core/LS00Seeder_Moderate
busybox chown 0:0 $core/LS00Seeder_Moderate
#
#
# Seeder Aggressive
#
#
#
busybox cat >> $core/LS00Seeder_Aggressive <<EOF
#!/system/bin/sh
# Copyright (C) 2016 Paget96
#=======================================================================#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
#=======================================================================#
mount -o remount,rw / 2>/dev/null
mount -o remount,rw / / 2>/dev/null
mount -o remount,rw rootfs 2>/dev/null
mount -o remount,rw /system 2>/dev/null
mount -o remount,rw /system /system 2>/dev/null
busybox mount -o remount,rw / 2>/dev/null
busybox mount -o remount,rw / / 2>/dev/null
busybox mount -o remount,rw rootfs 2>/dev/null
busybox mount -o remount,rw /system 2>/dev/null
busybox mount -o remount,rw /system /system 2>/dev/null
LS=/system/L_SPEED/LOGS/LS00Seeder.log
if [ -f \$LS ]; then
busybox rm \$LS;
fi;
busybox echo "# L Speed log" | busybox tee -a \$LS
busybox echo "" | busybox tee -a \$LS
busybox echo "Activating aggressive seeder profile.." | busybox tee -a \$LS
busybox sysctl -e -w kernel.random.read_wakeup_threshold=1708
busybox sysctl -e -w kernel.random.write_wakeup_threshold=2048
busybox sleep 1
if grep "1708" /proc/sys/kernel/random/read_wakeup_threshold; then
busybox echo "Aggressive seeder profile is activated.." | busybox tee -a \$LS
else
busybox echo "Aggressive seeder profile is not activated.." | busybox tee -a \$LS
fi
mount -o remount,ro / 2>/dev/null
mount -o remount,ro / / 2>/dev/null