Last active
February 16, 2017 18:59
-
-
Save dvdfreitag/0e656d81efea291761b3ed9fd5b6ee65 to your computer and use it in GitHub Desktop.
Shell script to install the Zero Hosts hosts file to block ads.
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
# It should go without saying that this requires root. This can be run either on a host PC with | |
# the Android Debug Bridge (adb), or on the device itself in a terminal emulator (such as Termux). | |
# More information on the Zero Hosts file: http://someonewhocares.org/hosts/zero/ | |
# Uncomment if you're using adb | |
# adb shell | |
su # switch to root | |
cd /storage/emulated/0 # change directory to the internal storage | |
wget http://someonewhocares.org/hosts/hosts # download the zero hosts file | |
mount -o rw,remount /system # mount /system as read/write | |
cat hosts >> /system/etc/hosts # append the zero hosts file to the system hosts file | |
rm hosts # delete the downloaded file | |
mount -o ro,remount /system # mount /system as read only | |
exit # exit root | |
exit # exit terminal | |
# Uncomment if you're using adb | |
# exit # exit adb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment