-
Notifications
You must be signed in to change notification settings - Fork 11
/
energized.sh
executable file
·1511 lines (1490 loc) · 42.1 KB
/
energized.sh
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
#!/bin/bash
# ======================================================================
# Module: Energized Protection
# License: CC BY-NC-SA 4.0; https://nenergized.pro/license
# Copyright (C) 2018 Energized Protection ϟ All Rights Reserved.
# ======================================================================
# Script Begins -
# ========================================
# Colors
# ----------------------------------------
BL='\e[01;90m' > /dev/null 2>&1; # Black
R='\e[01;91m' > /dev/null 2>&1; # Red
G='\e[01;92m' > /dev/null 2>&1; # Green
Y='\e[01;93m' > /dev/null 2>&1; # Yellow
B='\e[01;94m' > /dev/null 2>&1; # Blue
P='\e[01;95m' > /dev/null 2>&1; # Purple
C='\e[01;96m' > /dev/null 2>&1; # Cyan
W='\e[01;97m' > /dev/null 2>&1; # White
LG='\e[01;37m' > /dev/null 2>&1; # Light Gray
N='\e[0m' > /dev/null 2>&1; # Null
# ----------------------------------------
# Define Energized Protection Directory
# ----------------------------------------
DIRECTORY=EnergizedProtection
rm -f $DIRECTORY/filter
# Deletes Unnecessary stuffs
# ----------------------------------------
DREADME=$DIRECTORY/cache/deltaReadme
DFILTER=$DIRECTORY/cache/deltaFilter
if [ -f $DREADME ]; then
rm -f $DREADME
rm -f $DFILTER
rm -f $DIRECTORY/deltaFilter
rm -f $DIRECTORY/deltaReadme
fi
# Divider
# ----------------------------------------
divider="-------------------------------------------------"
# Create Energized Protection Directory
# ----------------------------------------
if [ ! -d $DIRECTORY ]; then
mkdir -p $DIRECTORY;
fi
# Versioning & Date
# ----------------------------------------
version=$Y'flaky'$N > /dev/null 2>&1
released=$G'Dec 09, 2018'$N > /dev/null 2>&1
saythanks='https://saythanks.io/to/AdroitAdorKhan' > /dev/null 2>&1
date=$(date "+%d.%m.%Y %H:%M:%S")
# Start Echos
# ----------------------------------------
clear
echo ''
echo -e $Y" _____ _________ _____________ _______ "$N
echo -e $Y" / __/ |/ / __/ _ \/ ___/ _/_ / / __/ _ \ "$N
echo -e $Y" / _// / _// , _/ (_ // / / /_/ _// // / "$N
echo -e $Y" /___/_/|_/___/_/|_|\___/___/ /___/___/____/ "$N
echo ''
echo -e $Y' P R O T E C T I O N'$N
sleep 0.1
echo "$divider"
echo -e " Version: $version | Updated: $released"
sleep 0.1
echo "$divider"
sleep 0.1
echo ""
sleep 0.1
echo -e $Y' energized.pro'$N
echo ""
sleep 0.1
echo " CC BY-NC-SA 4.0"
echo ''
sleep 0.5
echo -n -e $Y' •'$N; sleep 0.2;
echo -n -e $Y'•'$N; sleep 0.3;
echo -n -e $Y'•'$N; sleep 0.2;
sleep 2
clear
# Disclaimer
# ----------------------------------------
echo -e $R"$divider"$N
echo -e $R'D I S C L A I M E R'$N
echo -e $R"$divider"$N
echo -e $R"THIS IS SIMPLY A MODULE TO CHANGE YOUR MACHINE's"$N
echo -e $R"HOSTS FILE. IF YOU DON'T KNOW WHAT YOU ARE DOING,"$N
echo -e $R"THEN PLEASE DON'T PROCEED. I WON'T BE RESPONSIBLE"$N
echo -e $R"FOR THE MESS YOU CREATE."$N
echo -e $R"$divider"$N
echo ''
echo -e $Y"$divider"$N
echo -e $Y'W A R N I N G'$N
echo -e $Y"$divider"$N
echo -e $Y"BASIC, PORN, ULTIMATE & UNIFIED PACKS ARE BIGGER"$N
echo -e $Y"IN SIZE. USE THEM, IF YOUR DEVICE CAN HANDLE"$N
echo -e $Y"THE LOAD."$N
echo -e $Y"$divider"$N
echo ''
echo -e $P"$divider"$N
echo -e $P'S U P P O R T D E V E L O P M E N T'$N
echo -e $P"$divider"$N
echo -e $P"IF YOU LOVED OUR WORK, CONSIDER DONATING; TO"$N
echo -e $P"KEEP THE PROJECT ALIVE AND RUNNING."$N
echo -e $P"$divider"$N
curl -sf http://go.energized.pro/web > /dev/null
sleep 2
# Check Energized Directory
# ----------------------------------------
clear
echo "[+] Checking Energized Directory."; sleep 0.1; clear
echo "[+] Checking Energized Directory.."; sleep 0.2; clear
echo "[+] Checking Energized Directory..."; sleep 0.1; clear
# Create Cache Directory
# ----------------------------------------
if [ ! -d $DIRECTORY/cache ]; then
mkdir -p $DIRECTORY/cache;
echo "[+] Setting up working cache directory.";
fi
# Check Whitelist
# ----------------------------------------
if [ ! -f $DIRECTORY/blacklist ]; then
clear
echo "[+] Creating Blacklist.";
touch $DIRECTORY/blacklist
sleep 0.2
fi
# Check Blacklist
# ----------------------------------------
if [ ! -f $DIRECTORY/whitelist ]; then
clear
echo "[+] Creating Whitelist.";
touch $DIRECTORY/whitelist
sleep 0.2
fi
# Check Redirectlist
# ----------------------------------------
if [ ! -f $DIRECTORY/redirectlist ]; then
clear
echo "[+] Creating Redirectlist.";
touch $DIRECTORY/redirectlist
sleep 0.2
fi
# Check Temp
# ----------------------------------------
if [ ! -f $DIRECTORY/cache/temp ]; then
clear
echo "[+] Creating temporary cache...";
touch $DIRECTORY/cache/temp
sleep 0.2
fi
# Check Porn Temp
# ----------------------------------------
if [ ! -f $DIRECTORY/cache/ptemp ]; then
clear
echo "[+] Creating Temp...";
touch $DIRECTORY/cache/ptemp
sleep 0.2
fi
# Check Social Temp
# ----------------------------------------
if [ ! -f $DIRECTORY/cache/stemp ]; then
clear
echo "[+] Creating Temp...";
touch $DIRECTORY/cache/stemp
sleep 0.2
fi
# TIP 1
# ----------------------------------------
clear
echo -e $G"$divider"$N
echo -e $G"T I P s"$N
echo -e $G"$divider"$N
echo ''
echo -e $W'~ NOT SURE WHAT YOU ARE DOING?\n- MAKE BACKUP & THEN RESTORE! ;)'$N
sleep 0.1
echo ''
echo -e $W'~ NEED MORE INFO?\n- TYPE TG AND JOIN US! B)'$N
sleep 0.1
echo ''
echo -e $W'~ WANT TO GO TO MAGISK DIRECTLY FROM\nTHE SCRIPT? - TYPE MAGISK & HIT ENTER! :D'$N
sleep 2
# Features & Main Parts
# ----------------------------------------
while true
do
# Aliases, Grep, Wget Variables
# ----------------------------------------
HOST=/etc/hosts
SHOST=$DIRECTORY/hosts.gz
TREADME=$DIRECTORY/cache/readme
BREADME=$DIRECTORY/cache/readme-backup
DREADME=$DIRECTORY/cache/deltaReadme
FILTER=$DIRECTORY/cache/filter
BFILTER=$DIRECTORY/cache/filter-backup
WHITELIST=$DIRECTORY/whitelist
BLACKLIST=$DIRECTORY/blacklist
REDIRECTLIST=$DIRECTORY/redirectlist
TEMP=$DIRECTORY/cache/temp
LTEMP=$DIRECTORY/cache/ltemp
PTEMP=$DIRECTORY/cache/ptemp
STEMP=$DIRECTORY/cache/stemp
HBP=$DIRECTORY/hosts-backup.gz
curip=$(grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} ads.nayemador.com' $HOST | sed 's/ads.nayemador.com//')
COUNT=1
# Check Energized Pack
# ----------------------------------------
[ -f /system/etc/hosts ];
if busybox grep -q "E84S1C-P" $HOST; then
echeck="Basic Protection"
autopack="basic"
elif busybox grep -q "E5P4RK-P" $HOST; then
echeck="Spark Protection"
autopack="spark"
elif busybox grep -q "E8LU-P" $HOST; then
echeck="Blu Protection"
autopack="blu"
elif busybox grep -q "E8LUG0-P" $HOST; then
echeck="Blu Go Protection"
autopack="bluGo"
elif busybox grep -q "EP0R9-P" $HOST; then
echeck="Porn Protection"
autopack="porn"
elif busybox grep -q "EUL71M473-P" $HOST; then
echeck="Ultimate Protection"
autopack="ultimate"
elif busybox grep -q "EU91F13D-P" $HOST; then
echeck="Unified Protection"
autopack="unified"
else
echeck="No Pack Detected!"
autopack="null"
fi
# Check Root
# ----------------------------------------
id="$(id)"; id="${id#*=}"; id="${id%%\(*}"; id="${id%% *}"
if [ "$id" != "0" ] && [ "$id" != "root" ]; then
root="[×]"
else
root=$G"[✓]"$N
fi
# Other Variables
# ----------------------------------------
update=$C"`date -r $HOST "+%a, %d %b %y %H:%M:%S"`"$N
size=$P"`ls -lah $HOST | awk '{print $5}'`"$N
# Check Adblocker
# ----------------------------------------
[ -f $HOST ];
if busybox grep -q ads $HOST; then
adblocker=$G"[✓]"$N
else
adblocker="[×]"
fi
# Check Energized
# ----------------------------------------
[ -f $HOST ];
if busybox grep -q watchdog.energized.pro $HOST; then
eonoff=$G"[✓]"$N
else
eonoff=$R"[×]"$N
fi
# TIP 2
# ----------------------------------------
clear
echo -e $Y"$divider"$N
echo -e $Y"T I P s"$N
echo -e $Y"$divider"$N
echo ''
echo -e $W'~ TO DISABLE, JUST TOGGLE THE SYSTEMLESS HOSTS\nIN MAGISK MANAGER. (≤17.3)'$N
sleep 0.1
echo ''
echo -e $W'~ GOT ANY ISSUE?\n - SUBMIT ISSUE VIA WEB APP.'$N
sleep 0.1
echo ''
echo -e $W'~ WANT TO UNINSTALL?\n - TYPE C & DONE!(≥17.4)'$N
sleep 0.1
echo ''
echo -e $W'~ FEELING THANKFUL? ^_^\n - TYPE THX & YOU ARE MOST WELCOME! <3'$N
sleep 1.5
# Check Hosts Update
# ----------------------------------------
if [ "$autopack" != "null" ]; then
clear
echo "[+] Checking Update"; sleep 0.1; clear
echo "[+] Checking Update."; sleep 0.15; clear
echo "[+] Checking Update.."; sleep 0.18; clear
echo "[+] Checking Update..."; sleep 0.2;
wget --no-check-certificate -q -O $TREADME https://raw.githubusercontent.com/EnergizedProtection/block/master/VERSION.md
grep -q "Version Code" $TREADME
cp $TREADME $BREADME
if [ -f $FILTER ]; then
CURRENT=$(grep "Version Code" $TREADME)
LAST_UPDATED=$(sed '1q;d' $FILTER)
if [ "$LAST_UPDATED" != "$CURRENT" ]; then
if [ "$(grep "watchdog.energized.pro" $HOST)" ]; then
eupdate=$G'[ϟ] UPDATE AVAILABLE!'$N
fi
else
eupdate=$W'[✓] UP-TO-DATE!'$N
fi
else
touch $FILTER
eupdate="[+] APPLY PACK FIRST!"
fi
clear
echo "[+] Checking Update.."; sleep 0.18; clear
echo "[+] Checking Update."; sleep 0.15; clear
echo "[+] Checking Update"; sleep 0.1; clear
else
eupdate="[+] APPLY PACK FIRST!"
fi
# Input
# ----------------------------------------
INPUT=$(eval "echo \$$COUNT")
if [ ! "$INPUT" ]; then
if [ "$1" ]; then
rm -f $TREADME
exit 0
fi
# Starts Screen Echos
# ----------------------------------------
clear
echo ''
echo -e $Y" _____ _________ _____________ _______ "$N; sleep 0.1;
echo -e $Y" / __/ |/ / __/ _ \/ ___/ _/_ / / __/ _ \ "$N; sleep 0.1;
echo -e $Y" / _// / _// , _/ (_ // / / /_/ _// // / "$N; sleep 0.1;
echo -e $Y" /___/_/|_/___/_/|_|\___/___/ /___/___/____/ "$N; sleep 0.1;
echo ''
sleep 0.1
echo -e $Y' P R O T E C T I O N'$N
echo -e " v.$version"
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'ϟ B A S I C I N F O -'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $root$W" ROOT "$N$W"[+] BUSYBOX: $bboxname"$N
sleep 0.1
echo -e $eonoff$W" ENERGIZED "$N$W"[+] PACK: "$N$B"$echeck"$N
sleep 0.1
echo -e $adblocker$W" ADBLOCKING "$N$W"[+] SIZE: $size"$N
sleep 0.1
echo -e $W"[+] LAST UPDATED: $update"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
# Packs
# ----------------------------------------
echo -e $Y"ϟ P A C K s - $eupdate"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W"[1] Spark [3] Blu [5] Ultimate"$N
sleep 0.1
echo -e $W"[2] Blu Go [4] Basic [6] Unified"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y"ϟ E X T E N S I O N s -"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W"[p] Porn [rl] Regional [x] Xtreme"$N
sleep 0.1
echo -e $W"[pl] Porn Lite [s] Social"$N
sleep 0.1
# Options
# ----------------------------------------
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'ϟ O P T I O N s -'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W'[o] Open Hosts File [ip] Redirection IP'$N
sleep 0.1
echo -e $W'[w] Apply Whitelist [iw] Instant Whitelist'$N
sleep 0.1
echo -e $W'[b] Apply Blacklist [ib] Instant Blacklist'$N
sleep 0.1
echo -e $W'[r] Redirect Domains [ir] Instant Redirect'$N
sleep 0.1
# Misc
# ----------------------------------------
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'ϟ M I S C -'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W'[bp] Backup [rs] Restore [ck] Check'$N
sleep 0.1
echo -e $W'[u] Update H&WB [in] Instructions [i] Info'$N
sleep 0.1
echo -e $R'[c] Clear Hosts '$N$G'[si] Submit Issue '$N$R'[q] Quit.'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
# Read Input
# ----------------------------------------
echo -n -e $Y"[+] Your Input - "$N
read -r INPUT
if [ "$INPUT" != "m" ]; then
INPUT="$(echo "$INPUT" | sed 's/m//g')"
clear
fi
DIR=""
fi
case "$INPUT" in
# Spark Protection
1|spark|Spark|SPARK) DIR="spark"
clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] Applying Energized Spark Protection'$N
;;
# Blu Go Protection
2|blugo|BluGo|bluGo|BLUGO) DIR="bluGo"
clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] Applying Energized Blu Go Protection'$N
echo -e $Y"$divider"$N
;;
# Blu Protection
3|blu|Blu|BLU) DIR="blu"
clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] Applying Energized Blu Protection'$N
echo -e $Y"$divider"$N
;;
# Basic Protection
4|basic|Basic|BASIC) clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y"Hold on a sec!"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W"Energized Basic is more than 12MB in size, and"$N
sleep 0.1
echo -e $W"may slow down your browsing experience (If your"$N
sleep 0.1
echo -e $W"device can't handle the load.)"$N
echo ''
sleep 0.1
echo -n -e $W'[+] PROCEED?'$N $Y'[Y/N]'$N: $G"$answer"$N
read answer
if [[ "$answer" == "Y" || "$answer" == "y" ]]; then
echo "[+] Applying Energized Basic..."
DIR="basic"
clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] Applying Energized Basic Protection'$N
echo -e $Y"$divider"$N
sleep 0.3
else
clear
echo -n -e $W'[+] RETURNING '$N
echo -n -e $Y'•'$N; sleep 0.2;
echo -n -e $Y'•'$N; sleep 0.3;
echo -n -e $Y'•'$N; sleep 0.2;
sleep 0.1
fi
;;
# Ultimate Protection
5|ultimate|Ultimate|ULTIMATE) clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y"Hold on a sec!"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W"Energized Ultimate is more than 17MB in size, and"$N
sleep 0.1
echo -e $W"may slow down your browsing experience (If your"$N
sleep 0.1
echo -e $W"device can't handle the load.)"$N
echo ''
sleep 0.1
echo -n -e $W'[+] PROCEED?'$N $Y'[Y/N]'$N: $G"$answer"$N
read answer
if [[ "$answer" == "Y" || "$answer" == "y" ]]; then
echo "[+] Applying Energized Ultimate..."
DIR="ultimate"
clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] Applying Energized Ultimate Protection'$N
echo -e $Y"$divider"$N
sleep 0.3
else
clear
echo -n -e $W'[+] RETURNING '$N
echo -n -e $Y'•'$N; sleep 0.2;
echo -n -e $Y'•'$N; sleep 0.3;
echo -n -e $Y'•'$N; sleep 0.2;
sleep 0.1
fi
;;
# Unified Protection
6|unified|Unified|UNIFIED) clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y"Hold on a sec!"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W"Energized Unified is more than 30MB in size, and"$N
sleep 0.1
echo -e $W"may slow down your browsing experience (If your"$N
sleep 0.1
echo -e $W"device can't handle the load.)"$N
echo ''
sleep 0.1
echo -n -e $W'[+] PROCEED?'$N $Y'[Y/N]'$N: $G"$answer"$N
read answer
if [[ "$answer" == "Y" || "$answer" == "y" ]]; then
echo "[+] Applying Energized Unified..."
DIR="unified"
clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] Applying Energized Unified Protection'$N
echo -e $Y"$divider"$N
sleep 0.3
else
clear
echo -n -e $W'[+] RETURNING '$N
echo -n -e $Y'•'$N; sleep 0.2;
echo -n -e $Y'•'$N; sleep 0.3;
echo -n -e $Y'•'$N; sleep 0.2;
sleep 0.1
fi
;;
# Porn Extension
# ----------------------------------------
p|porn|Porn|PORN) clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y"Hold on a sec!"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W"Energized Porn is more than 15MB in size, and"$N
sleep 0.1
echo -e $W"may slow down your browsing experience (If your"$N
sleep 0.1
echo -e $W"device can't handle the load.)"$N
echo ''
sleep 0.1
echo -n -e $W'[+] PROCEED?'$N $Y'[Y/N]'$N: $G"$answer"$N
read answer
if [[ "$answer" == "Y" || "$answer" == "y" ]]; then
clear
echo -e $Y"$divider"$N
echo -e $Y'[+] PORN HOSTS EXTENSION'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo "Adds Porn Blocking Pack to current hosts."
echo -e $Y"$divider"$N
echo ""
wget --no-check-certificate -O $SHOST https://block.energized.pro/porn/formats/hosts.gz
echo "[+] Applying Porn Hosts to current hosts."
gzip -d -c $SHOST > $PTEMP
mv $HOST $TEMP
rm -f $HOST
cat $TEMP $PTEMP > $HOST
awk '!a[$0]++' $HOST > $PTEMP && mv -f $PTEMP $HOST
rm -f $TEMP $PTEMP $SHOST
echo -e $G'[+] Done!'$N
echo "[+] Returning..."
else
clear
echo -n -e $W'[+] RETURNING '$N
echo -n -e $Y'•'$N; sleep 0.2;
echo -n -e $Y'•'$N; sleep 0.3;
echo -n -e $Y'•'$N; sleep 0.2;
sleep 0.1
fi
;;
# Porn Lite Extension
# ----------------------------------------
pl) clear
echo -e $Y"$divider"$N
echo -e $Y'[+] PORN LITE HOSTS EXTENSION'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo "Adds Porn Lite Blocking Pack to current hosts."
echo -e $Y"$divider"$N
echo ""
wget --no-check-certificate -O $SHOST https://block.energized.pro/extensions/porn-lite/formats/hosts.gz
echo "[+] Applying Porn Lite Hosts to current hosts."
gzip -d -c $SHOST > $PTEMP
mv $HOST $TEMP
rm -f $HOST
cat $TEMP $PTEMP > $HOST
awk '!a[$0]++' $HOST > $PTEMP && mv -f $PTEMP $HOST
rm -f $TEMP $PTEMP $SHOST
echo -e $G'[+] Done!'$N
echo "[+] Returning..."
;;
# Regional Extension
# ----------------------------------------
rl|rg|regional|Regional|REGIONAL|REG|reg) clear
echo -e $Y"$divider"$N
echo -e $Y'[+] REGIONAL HOSTS EXTENSION'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo "Adds Regional Blocking Pack to current hosts."
echo -e $Y"$divider"$N
echo ""
wget --no-check-certificate -O $SHOST https://block.energized.pro/extensions/regional/formats/hosts.gz
echo "[+] Applying Regional Hosts to current hosts."
gzip -d -c $SHOST > $STEMP
mv $HOST $TEMP
cat $TEMP $STEMP > $HOST
awk '!a[$0]++' $HOST > $STEMP && mv -f $STEMP $HOST
rm -f $TEMP $STEMP $SHOST
echo -e $G'[+] Done!'$N
echo "[+] Returning..."
;;
# Social Extension
# ----------------------------------------
s|social|Social|SOCIAL) clear
echo -e $Y"$divider"$N
echo -e $Y'[+] SOCIAL HOSTS EXTENSION'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo "Adds Social Blocking Pack to current hosts."
echo -e $Y"$divider"$N
echo ""
wget --no-check-certificate -O $SHOST https://block.energized.pro/extensions/social/formats/hosts.gz
echo "[+] Applying Social Hosts to current hosts."
gzip -d -c $SHOST > $STEMP
mv $HOST $TEMP
cat $TEMP $STEMP > $HOST
awk '!a[$0]++' $HOST > $STEMP && mv -f $STEMP $HOST
rm -f $TEMP $STEMP $SHOST
echo -e $G'[+] Done!'$N
echo "[+] Returning..."
;;
# Xtreme Extension
# ----------------------------------------
x|X|xtreme|XTRM|xtrm|Xtrm|Xtreme) clear
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y"Hold on a sec!"$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e $W"Energized Xtreme Extension strictly blocks every"$N
sleep 0.1
echo -e $W"annoyance out there. Which may break app(s) and"$N
sleep 0.1
echo -e $W"website(s)."$N
echo ''
sleep 0.1
echo -n -e $W'[+] PROCEED?'$N $Y'[Y/N]'$N: $G"$answer"$N
read answer
if [[ "$answer" == "Y" || "$answer" == "y" ]]; then
clear
echo -e $Y"$divider"$N
echo -e $Y'[+] XTREME HOSTS EXTENSION'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo "Adds Xtreme Blocking Pack to current hosts."
echo -e $Y"$divider"$N
echo ""
wget --no-check-certificate -O $SHOST https://block.energized.pro/extensions/xtreme/formats/hosts.gz
echo "[+] Applying Xtreme Hosts to current hosts."
gzip -d -c $SHOST > $PTEMP
mv $HOST $TEMP
rm -f $HOST
cat $TEMP $PTEMP > $HOST
awk '!a[$0]++' $HOST > $PTEMP && mv -f $PTEMP $HOST
rm -f $TEMP $PTEMP $SHOST
echo -e $G'[+] Done!'$N
echo "[+] Returning..."
else
clear
echo -n -e $W'[+] RETURNING '$N
echo -n -e $Y'•'$N; sleep 0.2;
echo -n -e $Y'•'$N; sleep 0.3;
echo -n -e $Y'•'$N; sleep 0.2;
sleep 0.1
fi
;;
# Update H&WB
# ----------------------------------------
u) clear
if [ "$autopack" == "null" ]; then
echo -e $R"[-] No Energized Pack Applied Yet!"$N
sleep 3
else
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y"[+] Applying $echeck"$N
sleep 0.1
echo -e $Y"$divider"$N
echo ''
wget --no-check-certificate -O $SHOST https://block.energized.pro/$autopack/formats/hosts.gz
gzip -d -c $SHOST > $HOST
rm -f $SHOST
echo -e $G"[+] Done Applying!"$N
sleep 1
echo -e $Y"$divider"$N
grep "Version Code" $TREADME > $FILTER
sleep 0.3
# Whitelisting
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] WHITELISTING'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
# Begins
if [ ! -f $WHITELIST ]; then
echo ""
echo -e $R'[-] No Whitelist Detected!'$N
sleep 0.5
echo -e $W'[+] Copy your whilelist to'$N $Y'EnergizedProtection/whitelist'$N
sleep 2
else
if [ -f "$HOST" ]; then
if [ -s $WHITELIST ]; then
echo -e $G'[+] Whitelist Found!'$N
echo -e $W'[+] Applying Whitelist'$N
sleep 0.3
grep -Fvxf $WHITELIST $HOST > $TEMP
rm -f $HOST
mv -f $TEMP $HOST
sleep 0.5
grep -Fvf $WHITELIST $HOST > $TEMP
rm -f $HOST
mv -f $TEMP $HOST
sleep 0.5
grep -vxf $WHITELIST $HOST > $TEMP
rm -f $HOST
mv -f $TEMP $HOST
sleep 0.1
echo -e $G'[+] Done'$N
echo -e $W'[+] Make sure to reboot once after applying.'$N
sleep 1
fi
else
echo ""
echo -e $R'[-] No hosts file detected!'$N
sleep 1
echo -e $Y'[+] Apply a hosts file first'$N
sleep 2
fi
fi
sleep 0.1
echo -e $Y"$divider"$N
# Blacklisting
echo -e $Y"$divider"$N
sleep 0.1
echo -e $Y'[+] BLACKLISTING'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
# Begins
if [ ! -f $BLACKLIST ]; then
echo ""
echo -e $R'[-] No Blacklist detected!'$N
echo -e $W'[+] Copy your blacklist to'$N $Y'EnergizedProtection/blacklist'$N
else
if [ -f "$HOST" ]; then
if [ -s $BLACKLIST ]; then
echo -e $G'[+] Blacklist Found!'$N
echo -e $W'[+] Applying Blacklist...'$N
sleep 0.1
echo -e $W'[+] May take a while, depending on hosts size.'$N
sleep 0.1
echo -e $C'[+] Blacklist Log -'$N
sleep 0.1
rm -f $TEMP $STEMP $PTEMP $LTEMP
sed 's/^ *//; s/ *$//; /^$/d; /^#/ d' $BLACKLIST > $LTEMP
sort -u $LTEMP > $TEMP
NEWFILTERS="$(cat $TEMP)"
echo -e "\n# Applied on - $date" >> $HOST
printf '%s\n' "$NEWFILTERS" | while IFS= read -r linenew
do
if [ ! "$(grep -x "$curip$linenew" $HOST)" ]; then
echo -e "$curip$linenew" >> $HOST
echo -e $Y"$linenew "$N$W"- blacklisted."$N
else
echo -e $R"$linenew "$N$W"- already blacklisted."$N
fi
done
rm -f $TEMP $STEMP $PTEMP $LTEMP
echo -e $G'[+] Done'$N
echo -e $W'[+] Make sure to reboot once after applying.'$N
sleep 0.5
echo "[+] Returning..."
sleep 1
else
echo -e $R'[-] Blacklist file is empty!'$N
sleep 1
echo -e $R'[-] NO NEW FILTER ADDED!'$N
echo -e $W'[+] Returning...'$N
sleep 2
fi
else
echo ""
echo -e $R'[-] No hosts file detected!'$N
sleep 1
echo -e $Y'[+] Apply a hosts file first'$N
sleep 2
fi
fi
fi
;;
# Whitelist
# ----------------------------------------
w) clear
echo -e $Y"$divider"$N
echo -e $Y'ϟ W H I T E L I S T I N G'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo ""
# Begins
if [ ! -f $WHITELIST ]; then
echo ""
echo -e $R'[-] No Whitelist Detected!'$N
sleep 0.5
echo -e $W'[+] Copy your whilelist to'$N $Y'$DIRECTORY'$N
sleep 2
else
if [ -f "$HOST" ]; then
echo -e $G'[+] Whitelist Found!'$N
echo -e $W'[+] Applying Whitelist'$N
echo -e $W'[+] May take a while, depending on hosts size.'$N
NEWFILTERS="$(cat $WHITELIST)"
printf '%s\n' "$NEWFILTERS" | while IFS= read -r linenew
do
if [ ! "$(grep -x "$curip$linenew" $HOST)" ]; then
echo -e $G"$linenew "$N$W"- already whitelisted."$N
else
echo -e $Y"$linenew "$N$W"- whitelisted."$N
fi
done
sleep 0.3
grep -Fvxf $WHITELIST $HOST > $TEMP
rm -f $HOST
mv -f $TEMP $HOST
sleep 0.5
grep -Fvf $WHITELIST $HOST > $TEMP
rm -f $HOST
mv -f $TEMP $HOST
sleep 0.5
grep -vxf $WHITELIST $HOST > $TEMP
rm -f $HOST
mv -f $TEMP $HOST
sleep 1
echo -e $G'[+] Done'$N
echo -e $W'[+] Make sure to reboot once after applying.'$N
sleep 0.5
echo "[+] Returning..."
sleep 1.5
else
echo ""
echo -e $R'[-] No hosts file detected!'$N
sleep 1
echo -e $Y'[+] Apply a hosts file first'$N
sleep 2
fi
fi
;;
# Instant Whitelist
# ----------------------------------------
iw) while true
do
clear
echo -e $Y"$divider"$N
echo -e $Y'ϟ I N S T A N T W H I T E L I S T'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo -e "Instant whitelist will let you add a domain at a\ntime to add to your hosts as whitelisted.\nNote. To Whitelist more domains, use 'w' method."
echo -e $Y"$divider"$N
echo ""
echo -n -e $W'[+] Enter Domain Name Only:'$N $iw
read iw
echo -e $W'[+] Your Domain'$N $Y"$iw"$N
echo -n -e $W'[+] Are you sure?'$N $Y'[Y/N]'$N: $G"$answer"$N
read answer
if [ "$answer" == "Y" ]; then
echo "[+] Applying $iw as whitelist..."
grep -Fvx "$curip$iw" $HOST > $TEMP
rm -f $HOST
mv -f $TEMP $HOST
echo "$iw" >> $WHITELIST
echo -e $W'[+] Done'$N
echo -e $W'[+] Make sure to reboot once after applying.'$N
sleep 0.5
echo -e $W'[+] Returning...'$N
sleep 1
echo -n -e $W'[+] Whitelist Another Domain?'$N $Y'[y/n]'$N: $G"$answer"$N
read answer
if [[ "$answer" == "N" || "$answer" == "n" ]]; then
break
fi
else
clear
echo -n -e $W'[+] Whitelist Another Domain?'$N $Y'[y/n]'$N: $G"$answer"$N
read answer
if [[ "$answer" == "N" || "$answer" == "n" ]]; then
break
fi
echo -n -e $W'[+] RETURNING '$N
echo -n -e $Y'•'$N; sleep 0.2;
echo -n -e $Y'•'$N; sleep 0.3;
echo -n -e $Y'•'$N; sleep 0.2;
sleep 0.3
fi
done
;;
# Blacklist
# ----------------------------------------
b) clear
echo -e $Y"$divider"$N
echo -e $Y'ϟ B L A C K L I S T I N G'$N
sleep 0.1
echo -e $Y"$divider"$N
sleep 0.1
echo ""
# Begins
if [ ! -f $BLACKLIST ]; then
echo ""
echo -e $R'[-] No Blacklist detected!'$N
echo -e $W'[+] Copy your blacklist to'$N $Y'$DIRECTORY'$N
else
if [ -f "$HOST" ]; then
if [ -s $BLACKLIST ]; then
echo -e $G'[+] Blacklist Found!'$N
echo -e $W'[+] Applying Blacklist...'$N
sleep 0.1
echo -e $W'[+] May take a while, depending on hosts size.'$N
sleep 0.1
echo -e $C'[+] Blacklist Log -'$N
sleep 0.1
rm -f $TEMP $STEMP $PTEMP $LTEMP
sed 's/^ *//; s/ *$//; /^$/d; /^#/ d' $BLACKLIST > $LTEMP
sort -u $LTEMP > $TEMP
NEWFILTERS="$(cat $TEMP)"
echo -e "\n# Applied on - $date" >> $HOST
printf '%s\n' "$NEWFILTERS" | while IFS= read -r linenew
do
if [ ! "$(grep -x "$curip$linenew" $HOST)" ]; then
echo -e "$curip$linenew" >> $HOST
echo -e $Y"$linenew "$N$W"- blacklisted."$N
else
echo -e $R"$linenew "$N$W"- already blacklisted."$N
fi
done
rm -f $TEMP $STEMP $PTEMP $LTEMP
echo -e $G'[+] Done'$N
echo -e $W'[+] Make sure to reboot once after applying.'$N
sleep 0.5
echo "[+] Returning..."
sleep 1
else
echo -e $R'[-] Blacklist file is empty!'$N
sleep 1
echo -e $R'[-] NO NEW FILTER ADDED!'$N
echo "[+] Returning..."
sleep 2
fi
else