-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 38f19cf
Showing
14 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/sbin/sh | ||
|
||
################# | ||
# Initialization | ||
################# | ||
|
||
umask 022 | ||
|
||
# echo before loading util_functions | ||
ui_print() { echo "$1"; } | ||
|
||
require_new_magisk() { | ||
ui_print "*******************************" | ||
ui_print " Please install Magisk v20.4+! " | ||
ui_print "*******************************" | ||
exit 1 | ||
} | ||
|
||
######################### | ||
# Load util_functions.sh | ||
######################### | ||
|
||
OUTFD=$2 | ||
ZIPFILE=$3 | ||
|
||
mount /data 2>/dev/null | ||
|
||
[ -f /data/adb/magisk/util_functions.sh ] || require_new_magisk | ||
. /data/adb/magisk/util_functions.sh | ||
[ $MAGISK_VER_CODE -lt 20400 ] && require_new_magisk | ||
|
||
install_module | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#MAGISK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Systemless Adblocker | ||
|
||
--- | ||
## Overview: | ||
- The ultimate ad blocker, with no user interface | ||
- Added key-selector to choose from different hosts | ||
- Automatically downloads the lastest unified-hosts from [@StevenBlack](https://github.com/StevenBlack/hosts) hosts sources | ||
- Support Magisk & KernelSU | ||
|
||
## Added hosts: | ||
- Unified Hosts | ||
- Unified hosts + fakenews + gambling + social | ||
- Unified hosts + fakenews + gambling + porn + social | ||
- more will be added soon.... | ||
|
||
--- | ||
## Credits: | ||
- [@topjohnwu](https://github.com/topjohnwu) / Magisk - Magisk Module Template | ||
- [@StevenBlack](https://github.com/StevenBlack) / Base hosts sources | ||
- [@JumbomanXDA](https://github.com/JumbomanXDA) / Custom installation script | ||
- [@gloeyisk](https://github.com/gloeyisk/systemless-hosts) / Original source |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# External Tools | ||
chmod -R 0755 $MODPATH/addon/Volume-Key-Selector/tools | ||
|
||
chooseport_legacy() { | ||
[ "$1" ] && local delay=$1 || local delay=3 | ||
local error=false | ||
while true; do | ||
timeout 0 $MODPATH/addon/Volume-Key-Selector/tools/$ARCH32/keycheck | ||
timeout $delay $MODPATH/addon/Volume-Key-Selector/tools/$ARCH32/keycheck | ||
local sel=$? | ||
if [ $sel -eq 42 ]; then | ||
return 0 | ||
elif [ $sel -eq 41 ]; then | ||
return 1 | ||
elif $error; then | ||
abort " No version selected, please restart installation" | ||
else | ||
error=true | ||
fi | ||
done | ||
} | ||
|
||
chooseport() { | ||
[ "$1" ] && local delay=$1 || local delay=3 | ||
local error=false | ||
while true; do | ||
local count=0 | ||
while true; do | ||
timeout $delay /system/bin/getevent -lqc 1 2>&1 > $TMPDIR/events & | ||
sleep 0.5; count=$((count + 1)) | ||
if (`grep -q 'KEY_VOLUMEUP *DOWN' $TMPDIR/events`); then | ||
return 0 | ||
elif (`grep -q 'KEY_VOLUMEDOWN *DOWN' $TMPDIR/events`); then | ||
return 1 | ||
fi | ||
[ $count -gt 30 ] && break | ||
done | ||
if $error; then | ||
export chooseport=chooseport_legacy VKSEL=chooseport_legacy | ||
chooseport_legacy $delay | ||
return $? | ||
else | ||
error=true | ||
echo " " | ||
echo " Volume key not detected, try again" | ||
echo " " | ||
fi | ||
done | ||
} | ||
|
||
VKSEL=chooseport |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
## v1.1 [ Release | 20240506 ] | ||
- Simplified the main script logic. | ||
- Made a separate dir for the host installer scripts. | ||
|
||
## v1.0 [ Release | 20240506 ] | ||
- Added key-selector to switch between different hosts | ||
### Below are the currently supported hosts: | ||
- Unified Hosts. | ||
- Unified hosts + fakenews + gambling + social. | ||
- Unified hosts + fakenews + gambling + porn + social. | ||
- more will be added soon... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/system/bin/sh | ||
|
||
# Systemless Hosts by the open source loving GL-DP and all contributors; | ||
# Consolidating and extending hosts files from several well-curated sources | ||
|
||
install_hosts() { | ||
. $MODPATH/addon/install.sh | ||
ui_print " Install Unified Hosts (UH)?" | ||
ui_print " " | ||
ui_print " Vol+ = Yes" | ||
ui_print " Vol- = No" | ||
ui_print " " | ||
if chooseport; then | ||
. $MODPATH/host-installer/uh.sh | ||
else | ||
ui_print " Install UH + fakenews + gambling + social ?" | ||
ui_print " " | ||
ui_print " Vol+ = Yes" | ||
ui_print " Vol- = No" | ||
ui_print " " | ||
if chooseport; then | ||
. $MODPATH/host-installer/uhfgs.sh | ||
else | ||
ui_print " Install Unified hosts + fakenews + gambling + porn + social?" | ||
ui_print " " | ||
ui_print " Vol+ = Yes" | ||
ui_print " Vol- = No" | ||
ui_print " " | ||
if chooseport; then | ||
. $MODPATH/host-installer/uhfgps.sh | ||
else | ||
ui_print "- Exiting" | ||
fi | ||
fi | ||
fi | ||
} | ||
|
||
patch_hosts() { | ||
PATH=/system/etc | ||
ui_print "- Patching hosts file" | ||
mkdir -p $MODPATH$PATH | ||
mv -f $MODPATH/hosts $MODPATH$PATH | ||
} | ||
|
||
cleanup() { | ||
rm -rf $MODPATH/LICENSE | ||
rm -rf $MODPATH/addon 2>/dev/null | ||
rm -f $MODPATH/install.sh 2>/dev/null | ||
} | ||
|
||
run_install() { | ||
unzip -o "$ZIPFILE" -x 'META-INF/*' -d $MODPATH >&2 | ||
ui_print " " | ||
ui_print "- Installing & patching hosts" | ||
install_hosts | ||
patch_hosts | ||
ui_print " " | ||
ui_print "- Cleaning up" | ||
cleanup | ||
ui_print " " | ||
} | ||
|
||
run_install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ui_print "- Unified Hosts Selected" | ||
HOSTS_URL="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" | ||
GIT_URL="https://github.com/StevenBlack/hosts" | ||
ui_print "- Downloading latest hosts file from $GIT_URL" | ||
curl -o $MODPATH/hosts $HOSTS_URL | ||
if [ $? -ne 0 ]; then | ||
ui_print "Error: Failed to download hosts file." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ui_print "- Unified hosts + fakenews + gambling + porn + social Selected" | ||
HOSTS_URL="https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-porn-social/hosts" | ||
GIT_URL="https://github.com/StevenBlack/hosts" | ||
ui_print "- Downloading latest hosts file from $GIT_URL" | ||
curl -o $MODPATH/hosts $HOSTS_URL | ||
if [ $? -ne 0 ]; then | ||
ui_print "Error: Failed to download hosts file." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ui_print "- Unified hosts + fakenews + gambling + social Selected" | ||
HOSTS_URL="https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews-gambling-social/hosts" | ||
GIT_URL="https://github.com/StevenBlack/hosts" | ||
ui_print "- Downloading latest hosts file from $GIT_URL" | ||
curl -o $MODPATH/hosts $HOSTS_URL | ||
if [ $? -ne 0 ]; then | ||
ui_print "Error: Failed to download hosts file." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# This is a dummy host file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
id=systemless_adblocker | ||
name=Systemless Adblocker - Ultimate | ||
version=1.1 | ||
versionCode=16 | ||
author=burhanverse | ||
description=An efficient ad blocker based on @gloeyisk's systemless-host module with no user interface & the lastest hosts from github@StevenBlack |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"version": 1.1, | ||
"versionCode": 16, | ||
"zipUrl": https://github.com/Burhanverse/systemless-adblocker/releases/download/1.1/Systemless_Adblocker-Ult_V1.1.zip, | ||
"changelog": https://github.com/Burhanverse/systemless-adblocker/blob/main/changelog.md | ||
} |