Skip to content

Instantly share code, notes, and snippets.

@icedraco
Created November 27, 2014 11:22
Show Gist options
  • Save icedraco/e4f18256a56d7c3380b4 to your computer and use it in GitHub Desktop.
Save icedraco/e4f18256a56d7c3380b4 to your computer and use it in GitHub Desktop.
A small bash script for Android that adds entries to the /etc/hosts file (particularly, to block Skype ads)
#!/system/xbin/bash
# This script helps block access to specific addresses via an Android phone.
# NOTE: This script must be run as root!
#
# Author: IceDragon <icedragon@quickfox.org>
hosts="
mobileads.msn.com
track.mobiyield.com
"
###--# Execution #--#############################################################
mount -o remount,rw /system
for h in $hosts; do
echo "127.0.0.1 $h" >> /etc/hosts
done
mount -o remount,ro /system
echo "OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment