Skip to content

Instantly share code, notes, and snippets.

@yagop
Last active August 27, 2016 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yagop/446a6fde041c9589d061 to your computer and use it in GitHub Desktop.
Save yagop/446a6fde041c9589d061 to your computer and use it in GitHub Desktop.
Block ads in Android like a pro [Root]
#!/bin/bash
adb shell mount -o rw /dev/block/platform/msm_sdcc.1/by-name/system /system
adb shell cp /system/etc/hosts /system/etc/hosts.$(date +"%Y-%m-%d_%H:%M:%S")
wget "https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" -O /tmp/hosts
sed -i /analytics\.twitter\.com/d /tmp/hosts
adb push /tmp/hosts /system/etc/hosts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment