Skip to content

Commit

Permalink
v.1.0.7
Browse files Browse the repository at this point in the history
- Fix patch applied to adblock app detection.
- Fixed pack download issue via CLI flag. (`ep -p <pack>`)
- Beautify the module scripts.
  • Loading branch information
AdroitAdorKhan committed May 22, 2020
1 parent e1cb042 commit c2443da
Show file tree
Hide file tree
Showing 7 changed files with 166 additions and 135 deletions.
7 changes: 0 additions & 7 deletions META-INF/com/google/android/update-binary
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,4 @@ $BOOTMODE || recovery_cleanup
rm -rf $TMPDIR

ui_print " - Done"
ui_print "----------------------------------"
ui_print ""
ui_print " >> Recommended Busybox: "
ui_print " > Busybox for Android NDK"
ui_print ""
ui_print " *For further assistance > ep -tg"
ui_print "=================================="
exit 0
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

<div align="center">
<!-- Version -->
<img src="https://img.shields.io/badge/Version-1.0.-blue.svg?longCache=true&style=flat-square"
<img src="https://img.shields.io/badge/Version-1.0.-blue.svg?longCache=true&style=flat-square"
alt="Version" />
<!-- Last Updated -->
<img src="https://img.shields.io/badge/Updated-May 21, 2019-orange.svg?longCache=true&style=flat-square"
<img src="https://img.shields.io/badge/Updated-May 22, 2020-orange.svg?longCache=true&style=flat-square"
alt="_time_stamp_" />
<!-- Status -->
<img src="https://img.shields.io/badge/Status-beta-yellow.svg?longCache=true&style=flat-square"
Expand Down Expand Up @@ -181,10 +181,16 @@ Uninstall

Changelog
------

v.1.0.7β
- Fix patch applied to adblock app detection.
- Fixed pack download issue via CLI flag. (`ep -p <pack>`)
- Beautify the module scripts.

v.1.0.0β
- Added CLI Flag support.
- Added Magisk 20+ compatibility.
- Added user cofig support.
- Added user config support.
- Improved blacklist, whitelist and redirectlist functions.
- Improved instant blacklist, whitelist and redirectlist functions.
- Updated download links.
Expand Down
6 changes: 6 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,12 @@ print_modname() {
ui_print " - Type ep -h & tap enter "
ui_print " - Follow on screen options. "
ui_print "----------------------------------"
ui_print ""
ui_print " >> Recommended Busybox: "
ui_print " > Busybox for Android NDK"
ui_print ""
ui_print " *For further assistance > ep -tg"
ui_print "=================================="
}

# Copy/extract your module files into $MODPATH in on_install.
Expand Down
4 changes: 2 additions & 2 deletions module.prop
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
id=energizedprotection
name=Energized Protection
version=1.0.
versionCode=200521100
version=1.0.
versionCode=200522107
author=AdroitAdorKhan
description=Let's make an annoyance free better open internet, altogether! https://energized.pro
264 changes: 145 additions & 119 deletions system/bin/energized
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ currentIP=$(grep -o -m 1 '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}
# ----------------------------------------
# Versioning & Date
# ----------------------------------------
version=$Y'1.0.'$N > /dev/null 2>&1
releaseDate=$G'May 20, 2020'$N > /dev/null 2>&1
version=$Y'1.0.'$N > /dev/null 2>&1
releaseDate=$G'May 22, 2020'$N > /dev/null 2>&1
date=$(date "+%d.%m.%Y %H:%M:%S")
# ----------------------------------------

Expand Down Expand Up @@ -224,6 +224,7 @@ checkAdblockerApp() {
adblockAppName=UHM
return 1
else
adblockAppName=''
return 0
fi
}
Expand Down Expand Up @@ -910,127 +911,152 @@ openHosts() {
}
# ----------------------------------------

# ----------------------------------------
# Aut update hosts
# ----------------------------------------
autoUpdateHosts() {
cleanupTemp;
hostsURL="https://block.energized.pro/$DIR"
wget --no-check-certificate -q -U "$userAgent" -O $hostsGZ "$hostsURL"
gzip -d -c $hostsGZ > $hosts
}
# ----------------------------------------

# ----------------------------------------
# Download pack
# ----------------------------------------
downloadPack() {
setupFilesMin;
currentIP=$(grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} watchdog.energized.pro' "$hosts" | sed 's/ watchdog.energized.pro//')
if [ -z "$currentIP" ]; then
currentIP=$(grep ' watchdog.energized.pro' "$hosts" | sed 's/ watchdog.energized.pro//')
fi
case "$2" in
spark|Spark|SPARK|blugo|Blugo|bluGo|BLUGO|blu|Blu|BLU|basic|Basic|BASIC|porn|Porn|PORN|ultimate|Ultimate|ULTIMATE|unified|Unified|UNIFIED|porn-lite|pornlite|Porn-lite|PORN-LITE|xtreme|Xtreme|XTREME|regional|Regional|REGIONAL|social|Social|SOCIAL)
if [[ "$2" == "spark" || "$2" == "Spark" || "$2" == "SPARK" ]]; then
pack="spark"
epPack="Spark Protection"
elif [[ "$2" == "blu" || "$2" == "Blu" || "$2" == "BLU" ]]; then
pack="blu"
epPack="Blu Protection"
elif [[ "$2" == "blugo" || "$2" == "bluGo" || "$2" == "Blugo" || "$2" == "BluGo" || "$2" == "BLUGO" ]]; then
pack="bluGo"
epPack="BluGo Protection"
elif [[ "$2" == "basic" || "$2" == "Basic" || "$2" == "BASIC" ]]; then
pack="basic"
epPack="Basic Protection"
elif [[ "$2" == "porn" || "$2" == "Porn" || "$2" == "PORN" ]]; then
pack="porn"
epPack="Porn Protection"
elif [[ "$2" == "ultimate" || "$2" == "Ultimate" || "$2" == "ULTIMATE" ]]; then
pack="ultimate"
epPack="Ultimate Protection"
elif [[ "$2" == "unified" || "$2" == "Unified" || "$2" == "UNIFIED" ]]; then
pack="unified"
epPack="Unified Protection"
elif [[ "$2" == "xtreme" || "$2" == "Xtreme" || "$2" == "XTREME" ]]; then
pack="extensions/xtreme"
echo -e "$R""\n[-] $2 - only extension can't be applied.\n""$N"
exit
elif [[ "$2" == "porn-lite" || "$2" == "pornlite" || "$2" == "Porn-lite" || "$2" == "Pornlite" || "$2" == "PORN-LITE" || "$2" == "PORNLITE" ]]; then
pack="extensions/porn-lite"
echo -e "$R""\n[-] $2 - only extension can't be applied.\n""$N"
exit
elif [[ "$2" == "regional" || "$2" == "Regional" || "$2" == "REGIONAL" ]]; then
pack="extensions/regional"
echo -e "$R""\n[-] $2 - only extension can't be applied.\n""$N"
exit
elif [[ "$2" == "social" || "$2" == "Social" || "$2" == "SOCIAL" ]]; then
pack="extensions/social"
echo -e "$R""\n[-] $2 - only extension can't be applied.\n""$N"
exit
fi
hostsURL=https://block.energized.pro/$pack/formats/hosts.gz
wget --no-check-certificate -U "$userAgent" -q -T "3" -O $hostsGZ $hostsURL & pid=$!
if [ -f $hostsGZ ]; then
#if [ ! -s $hostsGZ ]; then
#truncate -s 0 $hosts
gzip -d -c $hostsGZ > "$hosts"

#fi
else
echo -e "$R""\n[-] Something went wrong. Try again.\n""$N"
exit
fi
echo
rm -f $hostsGZ
echo '';
size=$(ls -lah "$hosts" | awk '{print $5}')
spinPID "Pack: Downloading";
echo -en "$W""\r[""$N""$Y""""$N""$W""] Pack: ""$N""$Y""$epPack\n""$N"
echo -e "$W""[+] Size: ""$N""$Y""$size""$N"
case "$3" in
-e|--extension) shift
for i in "$@"
do
# Applying extension
if [[ "$i" == "porn" || "$i" == "Porn" || "$i" == "PORN" ]]; then
autoUpdateExtension "porn" & pid=$!
spinPID "Porn Extension: Downloading"
echo -en "$W""\r[""$N""$Y""""$N""$W""] Porn Extension: ""$N""$Y""Applied successfully.\n""$N"; sleep 0.1;
fi
if [[ "$i" == "porn-lite" || "$i" == "pornlite" || "$i" == "Porn-lite" || "$i" == "Pornlite" || "$i" == "PORN-LITE" || "$i" == "PORNLITE" ]]; then
autoUpdateExtension "porn-lite" & pid=$!
spinPID "Porn-Lite Extension: Downloading"
echo -en "$W""\r[""$N""$Y""""$N""$W""] Porn-lite Extension: ""$N""$Y""Applied successfully.\n""$N"; sleep 0.1;
fi
if [[ "$i" == "regional" || "$i" == "Regional" || "$i" == "REGIONAL" ]]; then
autoUpdateExtension "regional" & pid=$!
spinPID "Regional Extension: Downloading"
echo -en "$W""\r[""$N""$Y""""$N""$W""] Regional Extension: ""$N""$Y""Applied successfully.\n""$N"; sleep 0.1;
fi
if [[ "$i" == "social" || "$i" == "Social" || "$i" == "SOCIAL" ]]; then
autoUpdateExtension "social" & pid=$!
spinPID "Social Extension: Downloading"
echo -en "$W""\r[""$N""$Y""""$N""$W""] Social Extension: ""$N""$Y""Applied successfully.\n""$N"; sleep 0.1;
fi
if [[ "$i" == "xtreme" || "$i" == "Xtreme" || "$i" == "XTREME" ]]; then
autoUpdateExtension "xtreme" & pid=$!
spinPID "Xtreme Extension: Downloading"
echo -en "$W""\r[""$N""$Y""""$N""$W""] Xtreme Extension: ""$N""$Y""Applied successfully.\n""$N"; sleep 0.1;
fi

done

# Change redirection IP
if [ "$currentIP" != "0.0.0.0" ]; then
changeRedirectionIP "$currentIP" & pid=$!
spinPID "Redirection IP: Changing to $currentIP"
echo -en "$W""\r[""$N""$Y""""$N""$W""] Redirection IP: ""$N""$Y""Updated to $currentIP\n""$N"; sleep 0.1;
fi
;;

*) echo -e "$W""[*] No extension applied.""$N"
;;
esac
setFilter & pid=$!
cleanupTemp;
spinPID "Filter: Updating";
echo -en "$W""\r[""$N""$Y""""$N""$W""] Filter: ""$N""$Y""Updated \n\n""$N"
printDonate;
;;
*) echo -e "$R""\n[-] $2 invalid input.\n""$N"
;;
esac
echo ''
case "$2" in
spark|Spark|SPARK|blugo|Blugo|bluGo|BLUGO|blu|Blu|BLU|basic|Basic|BASIC|porn|Porn|PORN|ultimate|Ultimate|ULTIMATE|unified|Unified|UNIFIED|porn-lite|pornlite|Porn-lite|PORN-LITE|xtreme|Xtreme|XTREME|regional|Regional|REGIONAL|social|Social|SOCIAL)
if [[ "$2" == "spark" || "$2" == "Spark" || "$2" == "SPARK" ]]; then
pack="spark"
epPack="Spark Protection"
DIR="/spark/formats/hosts.gz"
autoUpdateHosts "$DIR" & pid=$!
spinPID "Pack: Downloading";
echo -en $W"\r["$N$Y""$N$W"] Pack: "$N$Y"$epPack\n"$N
elif [[ "$2" == "blu" || "$2" == "Blu" || "$2" == "BLU" ]]; then
pack="blu"
epPack="Blu Protection"
DIR="/blu/formats/hosts.gz"
autoUpdateHosts "$DIR" & pid=$!
spinPID "Pack: Downloading";
echo -en $W"\r["$N$Y""$N$W"] Pack: "$N$Y"$epPack\n"$N
elif [[ "$2" == "blugo" || "$2" == "bluGo" || "$2" == "Blugo" || "$2" == "BluGo" || "$2" == "BLUGO" ]]; then
pack="bluGo"
epPack="BluGo Protection"
DIR="/bluGo/formats/hosts.gz"
autoUpdateHosts "$DIR" & pid=$!
spinPID "Pack: Downloading";
echo -en $W"\r["$N$Y""$N$W"] Pack: "$N$Y"$epPack\n"$N
elif [[ "$2" == "basic" || "$2" == "Basic" || "$2" == "BASIC" ]]; then
pack="basic"
epPack="Basic Protection"
DIR="/basic/formats/hosts.gz"
autoUpdateHosts "$DIR" & pid=$!
spinPID "Pack: Downloading";
echo -en $W"\r["$N$Y""$N$W"] Pack: "$N$Y"$epPack\n"$N
elif [[ "$2" == "porn" || "$2" == "Porn" || "$2" == "PORN" ]]; then
pack="porn"
epPack="Porn Protection"
DIR="/porn/formats/hosts.gz"
autoUpdateHosts "$DIR" & pid=$!
spinPID "Pack: Downloading";
echo -en $W"\r["$N$Y""$N$W"] Pack: "$N$Y"$epPack\n"$N
elif [[ "$2" == "ultimate" || "$2" == "Ultimate" || "$2" == "ULTIMATE" ]]; then
pack="ultimate"
epPack="Ultimate Protection"
DIR="/ultimate/formats/hosts.gz"
autoUpdateHosts "$DIR" & pid=$!
spinPID "Pack: Downloading";
echo -en $W"\r["$N$Y""$N$W"] Pack: "$N$Y"$epPack\n"$N
elif [[ "$2" == "unified" || "$2" == "Unified" || "$2" == "UNIFIED" ]]; then
pack="unified"
epPack="Unified Protection"
DIR="/unified/formats/hosts.gz"
autoUpdateHosts "$DIR" & pid=$!
spinPID "Pack: Downloading";
echo -en $W"\r["$N$Y""$N$W"] Pack: "$N$Y"$epPack\n"$N
elif [[ "$2" == "xtreme" || "$2" == "Xtreme" || "$2" == "XTREME" ]]; then
pack="extensions/xtreme"
echo -e $R"[-] $2 - only extension can't be applied.\n"$N
exit
elif [[ "$2" == "porn-lite" || "$2" == "pornlite" || "$2" == "Porn-lite" || "$2" == "Pornlite" || "$2" == "PORN-LITE" || "$2" == "PORNLITE" ]]; then
pack="extensions/porn-lite"
echo -e $R"[-] $2 - only extension can't be applied.\n"$N
exit
elif [[ "$2" == "regional" || "$2" == "Regional" || "$2" == "REGIONAL" ]]; then
pack="extensions/regional"
echo -e $R"[-] $2 - only extension can't be applied.\n"$N
exit
elif [[ "$2" == "social" || "$2" == "Social" || "$2" == "SOCIAL" ]]; then
pack="extensions/social"
echo -e $R"[-] $2 - only extension can't be applied.\n"$N
exit
fi
currentIP=$(grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\} watchdog.energized.pro' $hosts | sed 's/ watchdog.energized.pro//')
if [ -z "$currentIP" ]; then
currentIP=$(grep ' watchdog.energized.pro' $hosts | sed 's/ watchdog.energized.pro//')
fi

rm -f $hostsGZ

case "$3" in
-e|--extension) shift
for i in $@
do
# Applying extension
if [[ "$i" == "porn" || "$i" == "Porn" || "$i" == "PORN" ]]; then
autoUpdateExtension "porn" & pid=$!
spinPID "Porn Extension: Downloading"
echo -en $W"\r["$N$Y""$N$W"] Porn Extension: "$N$Y"Applied successfully.\n"$N; sleep 0.1;
fi
if [[ "$i" == "porn-lite" || "$i" == "pornlite" || "$i" == "Porn-lite" || "$i" == "Pornlite" || "$i" == "PORN-LITE" || "$i" == "PORNLITE" ]]; then
autoUpdateExtension "porn-lite" & pid=$!
spinPID "Porn-Lite Extension: Downloading"
echo -en $W"\r["$N$Y""$N$W"] Porn-lite Extension: "$N$Y"Applied successfully.\n"$N; sleep 0.1;
fi
if [[ "$i" == "regional" || "$i" == "Regional" || "$i" == "REGIONAL" ]]; then
autoUpdateExtension "regional" & pid=$!
spinPID "Regional Extension: Downloading"
echo -en $W"\r["$N$Y""$N$W"] Regional Extension: "$N$Y"Applied successfully.\n"$N; sleep 0.1;
fi
if [[ "$i" == "social" || "$i" == "Social" || "$i" == "SOCIAL" ]]; then
autoUpdateExtension "social" & pid=$!
spinPID "Social Extension: Downloading"
echo -en $W"\r["$N$Y""$N$W"] Social Extension: "$N$Y"Applied successfully.\n"$N; sleep 0.1;
fi
if [[ "$i" == "xtreme" || "$i" == "Xtreme" || "$i" == "XTREME" ]]; then
autoUpdateExtension "xtreme" & pid=$!
spinPID "Xtreme Extension: Downloading"
echo -en $W"\r["$N$Y""$N$W"] Xtreme Extension: "$N$Y"Applied successfully.\n"$N; sleep 0.1;
fi

done

# Change redirection IP
if [ "$currentIP" != "0.0.0.0" ]; then
changeRedirectionIP "$currentIP" & pid=$!
spinPID "Redirection IP: Changing to $currentIP"
echo -en $W"\r["$N$Y""$N$W"] Redirection IP: "$N$Y"Updated to $currentIP\n"$N; sleep 0.1;
fi
;;

*) echo -e $W"[*] No extension applied."$N
;;
esac
size=`ls -lah $hosts | awk '{print $5}'`
echo -e $W"[+] Size: "$N$Y"$size"$N
setFilter & pid=$!
cleanupTemp;
spinPID "Filter: Updating";
echo -en $W"\r["$N$Y""$N$W"] Filter: "$N$Y"Updated \n\n"$N
printDonate;
;;
*) echo -e $R"[-] $2 invalid input.\n"$N
;;
esac
}
# ----------------------------------------

Expand Down
6 changes: 3 additions & 3 deletions system/bin/mainMenu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ showInfo() {
# Check Energized Protection
checkAdblockerApp & pid=$!
spinPID "Adblocker App: Checking"
if [[ checkAdblockerApp == 0 ]]; then
if [[ -z "$adblockAppName" ]]; then
echo -en $G"\r[✓] Adblocker App: No confliction.\n"$N
else
echo -en $R"\r[×] Adblocker App: $adblockAppName detected.\n - Disable to avoid conflict.\n"$N
Expand Down Expand Up @@ -154,7 +154,7 @@ compatibilityInfo() {
# Check Energized Protection
checkAdblockerApp & pid=$!
spinPID "Adblocker App: Checking"
if [[ checkAdblockerApp == 0 ]]; then
if [[ -z "$adblockAppName" ]]; then
echo -en $G"\r[✓] Adblocker App: No confliction.\n"$N
else
echo -en $R"\r[×] Adblocker App: $adblockAppName detected.\n - Disable to avoid conflict.\n"$N
Expand Down Expand Up @@ -200,7 +200,7 @@ showMenu() {
echo ''
echo -e $Y" P R O T E C T I O N"$N; sleep 0.05;
echo -e $W"$divider"$N; sleep 0.05;
echo " Version: $version | Updated: $releaseDate"; sleep 0.05;
echo " Version: $version | Updated: $releaseDate"; sleep 0.05;
echo -e $W"$divider"$N; sleep 0.05;
echo ""; sleep 0.05;
echo -e $Y' energized.pro'$N; sleep 0.05;
Expand Down
2 changes: 1 addition & 1 deletion system/bin/strings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Website: https://energized.pro
Github: https://github.com/EnergizedProtection/block
Copyright (c) 2018-2020, Energized Protection
License: CC-BY-NC-SA 4.0
Version: 1.0.0
Version: 1.0.7
Symlinks: <energized|Energized|ep|EP|epro>
>> Use any of the symlinks to run Energized Protection module.
Expand Down

0 comments on commit c2443da

Please sign in to comment.