yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] Mike B.:
You can certainly keep a copy of the generated /system/etc/hosts file in a safe place if you wish, or restore it from your most recent backup. I suppose you could also upload copies of whatever source files you use for safekeeping, but that might defeat the purpose of launching AdAway to get the latest version and seems like a lot of work for no real benefit. Remember that most source files are not updated very often and that there's no compelling reason to try to constantly find a "fresh" version. At least for the common source files, if their web site is temporarily offline, retrying a little while later typically works. Realistically you probably wouldn't notice much of a difference if a source file vanished since there is a lot of overlap between all the common ones... ;)
[Android Apps and Games] Dbj.Dhaval:
Yes the adds are blocked with wifi but not with Mobile network..

Can you please guide me, how to remove APN PROXY and will it affect my mobile network.. Bcoz I dunno what it is
[Android Apps and Games] Mike B.:
You may want to do a little bit of research to fully understand what a proxy is and does, but basically it's a server that stands between you and the rest of the internet. Some ISPs (Internet Service Providers) go through a proxy by default for all sorts of reasons (seldom very good ones), such as controlling traffic. The problem is that the proxy takes over DNS, rendering the local hosts file effectively useless. A proxy is almost NEVER required.

Go to your Android settings under "mobile networks" or whatever it's called on your device, find "Access Point Names" or "APN", select the APN you use (if there is more than one listed) and edit it. The third or fourth entry is probably "Proxy". Delete any URL listed in there until it's either blank or just says "not set". Save your changes and reboot. You're done.

Remember to make sure that the proxy doesn't reappear after any system OTA or SIM change. Some ISPs are sneaky that way... ;)
[Android Apps and Games] JesusHomeTree:
AdAway versus Yahoo Weather

There was a post earlier in this thread that determined blacklisting s(dot)yimg(dot)com was useful for blocking the ads in the Yahoo weather app. Unfortunately (I guess they are getting smarter?) text-based ads now show up where the images used to appear:

(since I can't post links) imgur(dot)com/gallery/V6nLxuH/new

Following the advice of that previous post, I logged DNS requests (after clearing the app's cache and cold-starting it). Nothing. Then I fired up CatLog, messed around with the app, and found the source of the problem (I think):

imgur(dot)com/gallery/7tKVKnS/new

You can see the s(dot)yimg(dot)com link. This is successfully blocked. But following the "|" symbol, we find our culprit. The text content differs from my above example, but the form of the ad is the same: some message followed by a link address in a format I've never seen before. How can I block these?

PS - as you guys can tell, I'm a new member. I did my best to search this thread for answers (which is how I arrived at all of the above), but not knowing how to formulate the above in terms of a good keyword search, I might have missed something.
[Android Apps and Games] Mike B.:
Your post is a bit difficult to follow but thanks for at least providing enough so that we can view the screenshots to which you refer.

The log fragment you post simply tells us that the "AdView" framework apparently used by your app to push apps was unable to read the jpg image it was looking for on "s.yimg.com". Before you spend more time on this, make sure that the AdAway

webserver

is enabled (then reboot). The way the error message is formatted in the log is simply how the stubborn ad provider is trying to push its message, even when the picture is somehow unavailable. It's their sneaky version of a "file not found" error.

If the webserver doesn't help, let us know. Oh, and welcome to XDA! ;)
[Android Apps and Games] JesusHomeTree:
I enabled webserver and still get the same form of the ad (text only). But, now I see more entries in the logged DNS requests:

beap(dot)gemini(dot)yahoo(dot)com

msb-mobile(dot)m(dot)yahoo(dot)com

I believe the former has appeared in the past (and when blacklisting, I lost the map functionality of the app). I just tried blocking the latter, and the ads still appear. Ultimately, it's much better than the full-image ads though. Thanks for you reply btw!
[Android Apps and Games] Mike B.:
I'm not familiar with that particular app except that it has been mentioned here before, but in general and as you might have seen while searching this thread, Yahoo tends to be rather pushy and you may want to consider simply switching to a friendlier weather app/widget. The best way to fight unwanted content is to avoid apps that use unwanted content! ;)
[Android Apps and Games] mrRobinson:
already been marked as an enhancement in the github: https://github.com/Free-Software-for-Android/AdAway/issues/549

edit: and [MENTION=4343728]Mike B.[/MENTION] answer is why it isn't a top priority. You really don't need daily updates of your hosts file. if you check once a week and one of your sources is down just don't update and try again the next day. No huge deal. I agree though, it'd be cool if the app could use a cached copy of a previous host and just be smarter about it but I have other things I'd update in adaway first before even caring about that. And I haven't gotten to those things yet so.... we can always hope another dev steps in one day too to help contribute.
[Android Apps and Games] mrRobinson:
which is why we use the mount bind command to use storage in data and not system. so problem solved.

I think you guys are missing the point of the mount bind command. if used as I described in an older post you are mounting /su/etc/hosts and binding it to /system/etc/hosts

with that done, you do NOT edit the hosts location in adaway. Leave it at its default in /system/etc/hosts when it "writes" there the mount bind will actually write it to /su/etc/hosts which is an image extracted that is using /data storage (per the systemless root method).

So adaway stays pointed to /system/etc/hosts but is actually writing to /su/etc/hosts that is using /data partition storage. Get it? Slightly confusing but if you edit the location of where Adaway writes the hosts you are negating the benefit of the mount bind you did.

Maybe what I'll do just to keep steps very simple for people is I'll create a flashable zip and put in the OP. the zip will do all the mount bind and startup script stuff so your steps will be flash your rom, flash supersu 2.6.1 or 2.6.2 (whatever latest), flash the zip i put in OP that makes /system/etc/host direct to /su/etc/hosts, then when you boot use adaway normally with its defaults.

sound good?
[Android Apps and Games] szale9001:
No that makes sense, and in fact, until 6.0.1, that's what I was doing. But with the system changes in 6.0.1, Adaway fails even with the bind script saying that system has no free space. So having it point to a custom location was the only way to get it to write to the file. That was the impetus for my previous request.
[Android Apps and Games] mrRobinson:
I'm on 6.0.1, with the mount bind set up and supersu 2.6.1 and adaway working great. for adaway to say no free space it must be looking at /system. you sure your mount bind is good? I can no longer edit/create the mount booted to android, have to do it from recovery so ensure you are checking it using adb in recovery mode.
[Android Apps and Games] szale9001:
Hmm, that's odd. Maybe I am missing something? The mount shows up in my terminal (when typing in 'mount' command). Here is the simple script I am using. Placed it in /su/su.d

# Bind hosts file for AdAway
mount -o bind /su/etc/hosts /system/etc/hosts;

Is there another method I should be using/a better way? Thanks for the help btw...
[Android Apps and Games] mrRobinson:
does a file exist in /su/etc/hosts? show output of the mount command too.
[Android Apps and Games] szale9001:
Sure thing, here's what I get. And it does seem to be showing up...

root@shamu:/ # mount
mount
rootfs / rootfs ro,seclabel,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,size=1513760k,nr_inodes=176030,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
none /dev/cpuset cgroup rw,relatime,cpuset,noprefix,release_agent=/sbin/cpuset_release_agent 0 0
adb /dev/usb-ffs/adb functionfs rw,relatime 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,seclabel,relatime 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,size=1513760k,nr_inodes=176030,mode=750,gid=1000 0 0
pstore /sys/fs/pstore pstore rw,seclabel,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt tmpfs rw,seclabel,relatime,size=1513760k,nr_inodes=176030,mode=755,gid=1000 0 0
/dev/fuse /mnt/runtime/default/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allo
ther 0 0
/dev/fuse /mnt/runtime/read/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_o
r 0 0
/dev/fuse /mnt/runtime/write/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_
er 0 0
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime,data=ordered 0 0
[COLOR="Red"]/dev/block/loop0 /system/etc/hosts ext4 rw,seclabel,noatime,data=ordered 0 0[/COLOR]
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,seclabel,nosuid,nodev,noatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware ext4 ro,context=u:object_r:firmware_file:s0,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 rw,seclabel,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/mdm1m9kefs3 /fsg ext4 ro,context=u:object_r:fsg_file:s0,nosuid,nodev,relatime 0 0
tmpfs /storage tmpfs rw,seclabel,relatime,size=1513760k,nr_inodes=176030,mode=755,gid=1000 0 0
/dev/fuse /storage/emulated fuse rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/dm-0 /data ext4 rw,seclabel,nosuid,nodev,noatime,nodiratime,nobarrier,noauto_da_alloc,data=ordered 0 0
/dev/block/loop0 /su ext4 rw,seclabel,noatime,data=ordered 0 0
[Android Apps and Games] gammaxgoblin:
Ideas why ads within the yahoo fantasy app are no linger blocked by this app or any other ad blocker, exposed, etc...???

They used to be blocked, but various updates to the yahoo fantasy app have managed to be blind to ad blockers web of glorious adfreeness.
[Android Apps and Games] mrRobinson:
ok now show output of

ls -l /su/etc/hosts

ls -l /system/etc/hosts
[Android Apps and Games] szale9001:
root@shamu:/system/etc # ls -l /su/etc/hosts
ls -l /su/etc/hosts
-rw-r--r-- root root 2087694 2015-12-08 17:01 hosts
root@shamu:/system/etc # ls -l /system/etc/hosts
ls -l /system/etc/hosts
-rw-r--r-- root root 2087694 2015-12-08 17:01 hosts
[Android Apps and Games] mrRobinson:
okay... looks good there. so you tell adaway to use /system/etc/hosts and tells you no space? I have the nexus 6p with this exact setup and working fine.

what does a 'df' output show?

edit: and how did you go to 6.0.1? did you full wipe or upgrade?
[Android Apps and Games] mrRobinson:
I use this same app and have no ads. Have you turned on the IPv6 option in preferences and the webserver? turn those on and re-apply adaway and reboot and see.
[Android Apps and Games] szale9001:
Gotcha, I'm running N6. df shows the following

root@shamu:/ # df
df
Filesystem Size Used Free Blksize
/dev 1.4G 56.0K 1.4G 4096
/sys/fs/cgroup 1.4G 12.0K 1.4G 4096
/mnt 1.4G 0.0K 1.4G 4096
/mnt/runtime/default/emulated 23.0G 10.5G 12.6G 4096
/mnt/runtime/read/emulated 23.0G 10.5G 12.6G 4096
/mnt/runtime/write/emulated 23.0G 10.5G 12.6G 4096
/system 1.9G 1.9G 14.9M 4096
/system/etc/hosts 27.5M 2.6M 24.9M 4096
/cache 248.0M 156.0K 247.8M 4096
/firmware 106.2M 60.2M 46.1M 4096
/persist 928.0K 280.0K 648.0K 4096
/fsg 797.0K 793.0K 4.0K 1024
/storage 1.4G 0.0K 1.4G 4096
/storage/emulated 23.0G 10.5G 12.6G 4096
/data 23.0G 10.5G 12.6G 4096
/su 27.5M 2.6M 24.9M 4096

Worth mentioning is this post you probably saw: http://xdaforums.com/showpost.php?p=64208563&postcount=3393

I ran df using adb shell, but it looks like system space is truly used up on the N6. Not sure about N6p...
[Android Apps and Games] MatVekk:
Ok in Nexus 5 Android 6.0.1 and supersu 2.62

Inviato dal mio Nexus 5 Cataclysm 6.0
[Android Apps and Games] Taomyn:
Yup, the N6 is different to the N6P and also the N9, for some inexplicably reason Google made system for 6.0.1 have zero bytes free, whereas the others still have a small amount. For the moment whenever AdAway on my N6 complains after an auto check, I push a copy off my N9 to it and overwrite the old version in /su/etc manually.
[Android Apps and Games] szale9001:
Also, to answer your other question, I dirty flashed 6.0.1 (formated and flashed system, formatted cache, no data wipe), but clean flashed when I went from 5.1 to 6.0
[Android Apps and Games] gammaxgoblin:
Just did and no luck... Still seeing the banner sponsor ad
[Android Apps and Games] mrRobinson:
saw it. just thought it wouldn't report 0bytes but rather the 14mb or so which should be enough.

try this: https://www.androidfilehost.com/?fid=24269982087015610

report back.
[Android Apps and Games] szale9001:
Very Nice!! It applied just fine. No error. Just outta curiosity, what did you change?
[Android Apps and Games] mrRobinson:
as [MENTION=631273]Chainfire[/MENTION] stated "DEVS Immediate hunch is that the difference is explained by usage of struct statfs's bfree vs bavail member."

AdAway was using statfs's bavail. which is correct as its the available blocks for the application. whereas bfree is the blocks free including reserved blocks (ie not avail for applications).

So adaway was correct to use bavail as that is what is avail for an application but since you are technically writing elsewhere (/su/etc/hosts) I changed it to use bfree so it is reporting more space and then worked for you.

I consider this a hack so i'll have to think on it more....

if you have a moment to run one test for me:

remove your su.d script so you lose your mount -o bind.

change adaway target to /su/etc/hosts and create the symlink

ln -s /su/etc/hosts /system/etc/hosts

does adaway apply then? if it does pleaase try the version of adaway in the OP as well.
[Android Apps and Games] mrRobinson:
i forgot i have my own hosts list on my own server so i think i'm blocking it myself.

add this to your blacklist in adaway to get rid of ads in yahoo

soundwave.mobile.yahoo.com
[Android Apps and Games] gammaxgoblin:
Perfect! 14 goats and chariot to you sir!
[Android Apps and Games] szale9001:
If i do that though, won't that count as a modifying the system? Right now, I am trying to avoid that so I can use Android Pay.
[Android Apps and Games] mrRobinson:
Yes but the existence of a symlink won't trip pay. I think twrp touches system still.
[Android Apps and Games] szale9001:
I don't recall seeing that about TWRP and also the later versions of TWRP have block device support for system to make OTA's easier so I wouldn't suspect them messing with system. Also, I have read in numerous places that SafetyNet can get tripped when you mod the system in any way (which then trips Pay).

I understand what you are saying though. That method of checking for free space is a total band-aid. If I have time tomorrow, I can still try this for you if you'd like, but in the long run I'd definitely rather keep system untouched.
[Android Apps and Games] sallizy:
only rooted phone can use this app right?
[Android Apps and Games] 2WhiteWolves:
Read posts by @ Mike B

Pg 355 post 3547

Pg 358 post 3573 or search unrooted, you will find the posts.
[Android Apps and Games] Taomyn:
But will prevent OTAs, not that I worry about that as I always flash factory images, but others may well do.

Depends on what version, the latest of TWRP for the N6 and N9 have an option that keeps /system as "read-only", so it doesn't attempt any changes to it.
[Android Apps and Games] mrRobinson:
the non stock boot.img is preventing ota's too. if you have twrp, that will as well. you can revert those but you can also just flash from google factory images since we are talking nexus, just leave off the '-w' and nothing is wiped all your data is left.
[Android Apps and Games] szale9001:
Ok, I ran a couple tests for you so let me explain what I did.

First, I removed my bind mount. Then I went to create the symlink for my hosts file using the ln -s command. Obviously that wasn't going to work without removing the existing /system/etc/hosts file, so I mounted system as rw and did that. Using the /su/etc/hosts as a custom target, both versions of Adaway (your newest one for me and the OP one) were able to download the hosts file and symlink it to system without error.

Just to be sure, I ran a second test. I reflashed /system to get the original hosts back and then used the OP Adaway to try and download hosts to my custom location (/su/etc) and then accepted its offer to create a symlink. I wanted to see if it would succeed in its symlink attempt without manual deletion of the original hosts file and it seemed to do that just fine. Though it did hang for a good bit, prompting Android to ask to FC it. I waited it out and it seemed to eventually work

So all that said, it seems that the symlink generation works. But I would certainly rather some way to do this without modifying system. Maybe there is a way to safely implement that hack of yours without negatively affecting anyone else? I would definitely appreciate it. Sure other would too. In any case, thanks a bunch for taking the time to help. Its much appreciated :D
[Android Apps and Games] mrRobinson:
yea I have some ideas. Thanks for the tests.
[Android Apps and Games] Mike B.:
Ideally it would be nice if your "hack" were separate from mainstream AdAway, perhaps as a standalone app or script. After all, /system/etc/hosts is far from being the only file users may want/need to manipulate, and AdAway should probably be those users' least worry. As an optimist, I'd like to believe that all this brouhaha about the systemless 6.x limitations on recent Nexus devices will eventually die after a proper root magically appears as it has for most all devices and Android versions in the past. I'd hate to see AdAway carry extra weight only relevant for a few months to a very small number of users. As a lazy man, I'd hate even more having to compile my own AdAway builds again... ;)
[Android Apps and Games] mrRobinson:
I completely agree. The systemless root options are in the SuperSu WIP thread which is pre-beta. I would def do nothing until it had a stable release. And whatever I add to AdAway I'd ensure flows with those who don't need. For now, that's why I have added the flashable zip into the OP so those with systemless can now just flash the supersu and then that zip and use Adaway normally.

Just as adaway added options to support those with S-On I see this being the same thing. I'd simply add a preference in Adaway that a user could check to tell Adaway to be systemless. It would then do what that flashable zip in the OP does (just as it today will try making a symlink) and then function as normal. For the space issue, I'd only need that hack potentially if someone has that preference checked. So I could easily flag on that. Those are my current thoughts. If you don't hit that preference you got AdAway exactly as it is today. Hit that check box and it'll deal with the new systemless stuff. All that said, I wouldn't look to execute any of that until the systemless stuff is mature or is def the future (hence for now we have a separate flashable zip in the OP for those taking this new path). :good:
[Android Apps and Games] rahul8040:
PLease can anyone tell me how to whitelist my own website! thanks i can't see my ads!
[Android Apps and Games] whtvr:
I seem to have a similar problem, actually... I'm on Nexus 6P and after updating the host file I'm stuck on a boot loop. I tried flashing the boot.img that came with my ROM (latest Cataclysm) but when I do that the device boots as normal, prompts for the encryption PIN then continues booting for a while and after that I simply get a black screen and after few minutes I get the boot animation again and it pretty much just stays there.

Any ideas what's going on?
[Android Apps and Games] mrRobinson:
I tested it but just to confirm if anyone used that systemless zip in the OP with no issues please let me know. Just a few people so i know it works. I tested on Nexus 5X, 6.0.1 aosp, and supersu 2.6.2.
[Android Apps and Games] ManHands:
Worked on N6 with stock 6.0.1 and SuperSU 2.6.2-3. But only with the apk you posted a couple pages back.
[Android Apps and Games] Tanveerul:
Adaway not blocking ad - Marshmallow 6.0.1

Recently rooted my Nexus 6P with version - 6.0.1 and flashed the zip file (for systemless root) present on the main page of this thread. Then, installed adaway but still i see ad coming up in app and chrome browser.

Please suggest me what is the correct way of installing it or configuring it to block ads.
[Android Apps and Games] aavvaallooss:
Disable 'Data Saver' in Chrome Settings
[Android Apps and Games] Gill Android:
Even after disabling Data Saver ads appear in Chrome
[Android Apps and Games] Mike B.:
Which device, ROM, root method, and AdAway version? Did you remember to reboot after installing/applying AdAway? Do you see ads everywhere or only in Chrome? Is it only on mobile data or also on WiFi?
[Android Apps and Games] Gill Android:
Device is Note II N7100, ROM is CM 12.1 Unofficial, rooted using CF Auto root+Odin, Adaway version is the latest from OP V3.1. Yes I always reboot after installing/applying AdAway. Normally Adaway works just fine on all the apps except Chrome where I see ads, not pop-ups but banner ads on the bottom of the page with a X button on top right to close that ad. And it happens on both Mobile data and WiFi so we can safely say there is no proxy involved.

And thanks for checking it Mike you are doing a great job guiding people like us :)
[Android Apps and Games] shaqman89:
Is it only on specific sites? Have you tried logging DNS calls and adding it to the blacklist manually for those specific sites?
[Android Apps and Games] mondohow:
CM 12.1 seems to be problematic with Adaway (or in general). I've seen it mentioned again and again in this thread alone.

Have you tried this? http://xdaforums.com/showpost.php?p=61641612&postcount=3592

Updating to the latest SuperSu fixed it for at least one person in the past as well.
[Android Apps and Games] Mike B.:
If your trouble is only with Chrome, you can effectively rule out any problem with your device, ROM, root, or APN, but please verify that you do NOT have Chrome's "Data Saver" enabled and that you have cleared its cache since you disabled it. Try the vary same site with another browser. If it shows no ads, then you can be positive it's a Chrome problem (most likely the "data saver" internal proxy).
[Android Apps and Games] JagDave:
You have compressed data on, or whatever chrome calls it. Turn that off and you will block ads.

My bad, you've already answered. Hadn't scrolled to the end of the thread.
[Android Apps and Games] watz_up:
Can someone help me, I have a HTC One m8, rooted, s-on,created symlink, I finally got it to work right, but the ads are not blocked via games, Dolphin browser, twitch and more..

I used ES file Explorer to look at the hosts file myself to see if it actually applied... And it did... I tried restarting my device too

Edit: I'm also on wifi not cellular data, I'm on airplane mode

Using data data hosts location