Plug your phone in, open up terminal, and open the shell
adb shell
Now execute the following. Pro tip: $ = non root, # root. If root, 'exit' to go back to non-root.
angler:/ $ su
angler:/data/data # rm /data/su/binds
angler:/data/data # exit
angler:/ $ su --bind --ls
angler:/ $ su --bind /data/hosts:/system/etc/hosts
angler:/ $ su --bind --ls
2000 /data/hosts => /system/etc/hosts
Double check to see if you have two hosts files
angler:/ $ su
angler:/data/data # ls -l /data/data/hosts /data/hosts /system/etc/hosts /su
ls: /su: No such file or directory
-rw-r--r-- 1 root root 2109504 2016-10-25 13:38 /data/data/hosts
-rw-r--r-- 1 root root 2109504 2016-10-25 13:37 /data/hosts
-rw-r--r-- 1 root root 56 2009-01-01 00:00 /system/etc/hosts
Remove the second hosts file
angler:/ $ su --bind '!system/etc/hosts'
Go to AdAway, Preferences, target location, select /data/hosts
Apply AdBlocking, do not create symlink.
Reboot.
Open up AdAway, it should be enabled.
Sources:
- https://www.reddit.com/r/Nexus6P/comments/528mfs/help_with_adaway_on_android_n/d7js3sj/?context=10000
- https://www.reddit.com/r/Nexus6P/comments/59cm1u/how_do_you_get_adaway_to_update_the_hosts_file_on/