yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] Mike B.:
The webserver is optional, but it's wise to keep it enabled since it requires almost no resources and can make life much easier. All it does is basically send an "empty" response (as opposed to no response at all) when a site tries to access a blocked URL. That means that if a site tries to display an ad, you don't see an error message or an annoying placeholder. Furthermore, if a site DEMANDS to be able to access a blocked URL, that site is usually happy as long as something is returned, even if it's just a "OK, I'm here" reply. For the sites that were giving you trouble, I'm guessing that they were waiting for a response from a blocked URL, making them very sluggish or even unresponsive. As soon as you enabled the webserver, they were able to move on instantly.
[Android Apps and Games] schizoprenic:
Thanks for this!
[Android Apps and Games] sgsI9003:
I want to add some domain to whitelist but it doesn't register.

Is there an example or a template how to whitelist certain site?

This is what I added but not getting this to work.

http://www.ndtv.com/video/live/channel/ndtv24x7?pfrom=home-topnavigation2015
[Android Apps and Games] Smitecrawler:
Doesn't block all ads in app - for example not in Clean Master

Hey, I have been using AdAway for a couple months now (on my Sony Xperia Z3 Compact Tablet).

Unfortunately I realized that it doesn't block all ads in apps, for example in Clean Master.

Does someone know if there is anything wrong with my AdAway or if AdAway just let's them through?

Thank you in advance. :)
[Android Apps and Games] Mike B.:
No need for a "template":

open AdAway

Menu/Your Lists

White

hit the "+" sign and enter the hostname you wish to whitelist

click on Add

Repeat for each hostname that you want

Apply AdAway again and

reboo

t

A hostname can contain wildcards, such as "google*.com" or "*.facebook.com" but no "http://", directory, or file name. I'm not sure why you're including a News video, but if you want to whitelist the NDTV servers, you need to use "*.ndtv.com". You can't whitelist a full URL, only hostnames.

If you are using the AdAway DNS Request Log to find hosts to whitelist, then simply click on the desired host name while viewing the log, and AdAway will include that host for you.

---------- Post added at 06:37 AM ---------- Previous post was at 06:19 AM ----------

Nothing wrong with AdAway as far as we know! ;)

Perhaps you forgot to read what AdAway is and does. It allows you to conveniently redirect DNS calls any application makes. YOU decide which URLS need to be redirected. The default AdAway source files are more than sufficient for most users and you can also black/while list additional hosts if you wish. All of this is wonderful as long as your app goes through local DNS (i.e. uses the hosts file). If the app directty loads ads, nothing in the hosts file can prevent that. Use the DSN Request Log to see if your Clean Master app simply uses an ad server not included in the default files but which you could easily blacklist, or if it bypasses DNS altogether

All of this is explain numerous times in the AdAway documentation and in this thread. After a little bit of reading, you'll tame all of your apps. As far as I can tell, Clean Master does NOT show any ads in its full version, only in the "Lite" (free) version, but I don't care much for that app so I'll let you do the testing... ;)
[Android Apps and Games] Smitecrawler:
Hey,

thank you for your answer, I finally found it with the recommended DNS Request Log and added it to the blacklist afterwards.

BTW: There is just one version of Clean Master in the app store (there is another Pro version, but it is not the same programm. It's from another developer) and the app also doesn't state that this isn't a full version.
[Android Apps and Games] sgsI9003:
Thanks for the reply this is still not working

I added "*.ndtv.com" as well as *.ndtv.com with & without quote marks but it gives me error saying improperly formatted hostname, this is not a valid hostname

I then tried to open the log file & added from there but site live TV still not working.

This news site has Live TV with youtube style ads, so if ads are blocked the TV doesn't play at all so I need to find a way to watch live TV hence need to white list. Can you test it at you end & tell me the exact hostname so it works.

Regards
[Android Apps and Games] Mike B.:
Don't use quotes in host names. I can't test your configuration, service provider and location for you, sorry ;)

Before you worry about whitelisting, perhaps you should investigate why the hosts you need are blocked in the first place. At the very least, try with only the default source files and nothing more. Remember that AdAway only helps block the hosts that YOU tell it to block.

If that site embeds its ads directly without going through the hosts file, which is very likely, there's nothing AdAway or any other DNS-related tool can do.
[Android Apps and Games] sgsI9003:
I have another phone on which adaway is not installed there nothing gets blocked if I remove adaway from this phone then live TV works fine too, so I want to know who is blocking the hostname I guess adaway is doing it which is what its meant for.

I am using the default source file only I havent added anything to it except this domain which we are discussing as of now.

This Live TV shows video ads same like youtube ads & can only be skipped after 5 seconds

So is there a way to unblock the site to watch live TV on ndtv.com?
[Android Apps and Games] Mike B.:
Not quite correct. You are giving AdAway too much credit. AdAway blocks NOTHING. The entries in whatever source files you select decide what should be blocked. You'd get the very same results by entering those lines into the hosts file yourself without AdAway.

Once again, use the AdAway DNS Request Log to decide which hosts, if any, you need to whitelist. To make is a bit easier, try using only one of the default sources at a time to see which one contains the hosts you need, making sure you reboot after any change to the hosts file. Only

YOU

can do that since, as mentioned earlier, a lot depends on your configuration, location, and service provider, sorry.
[Android Apps and Games] sgsI9003:
Thanks for all the time I appreciate that.

I will try this tomorrow & see what best can be done in this situation.
[Android Apps and Games] M!tch:
i love adway and used it for a long time on various devices. unfortunately there is no root for my xperia z5c (without unlocking the bootloader) yet.

is it possible to push a edited hosts-file via adb root (which is available)?

has someone used such a way or any other idea?
[Android Apps and Games] dacorsa:
Thanks for all your great work!

see u soon
[Android Apps and Games] Mike B.:
I suppose you could have AdAway prepare a hosts file for you (on another device?) then copy that file to /system/etc/hosts if you have a way to do so (ADB? Custorm recovery?), but it doesn't seem very convenient. If you try to "manually" alter /system, make sure you have a dependable way to recover, should something go wrong. Unrooted devices are no fun at all! ;)
[Android Apps and Games] ΦDroid:
Yes, I manually copy to devices all the time with no problems.
[Android Apps and Games] alphahere:
You must be able to modify the /system partition. With a locked bootloader and no root with locked bootloader, you are out of luck. If bootloader was unlocked and there is a custom recovery for your phone you can modify /system using the recovery without having root on the phone.
[Android Apps and Games] provolinoo:
Hi guys, is AdAway compatible with latest systemless root method by chainfire?

I want to use it without modifying the /system partition (to be able to use Android Pay) so I was wondering what's the best way to do that
[Android Apps and Games] mrRobinson:
If adb root is available then you can create the symlink and point adaway to update in data
[Android Apps and Games] yogesh324:
[MENTION=3355398]mrRobinson[/MENTION] hi i cant run webserver on arm64 device (yuphoria) the icon tuns on and when i change the screen and go back the option is turned of... here is the logcat with debug
[Android Apps and Games] provolinoo:
symlink in /data partition seems to be the only way to keep /system untouched and pass the safetynet check even with adaway up and running

as [MENTION=4544860]osm0sis[/MENTION] suggested:
[Android Apps and Games] osm0sis:
Yup, not a symlink though, just bind mounting a file in place of the actual one in the live filesystem. You need to create a file at /su/etc/hosts first - maybe copy the untouched system one over - then run that command at startup in a su.d script, and then use AdAway normally with the default /system/etc/hosts target; it'll actually modify only the bound /su version. :)
[Android Apps and Games] DaveX2012:
This is f**k up.. If I use my [MENTION=5499064]gmail.com[/MENTION] work fine but when I switch to my YouTube user name won't show my search history. Don't know what the f**k wrong with YouTube.
[Android Apps and Games] Mike B.:
Oh there's plenty wrong with YouTube, but fortunately for us this has

absolutely nothing to do with AdAway

!

My guess would be that you have disabled/paused your history under one account and not under the other one but I'll let you have the pleasure of searching for answers to your

YouTube

woes... ;)
[Android Apps and Games] peanutplanters:
Hey Osm0sis, what do you name the script inside /su/su.d/ ? I dont have alot of familiarity with creating su.d scripts.
[Android Apps and Games] provolinoo:
Thanks for explaining ;)

Hope [MENTION=3355398]mrRobinson[/MENTION] can merge that in the app directly to automatize the process :D
[Android Apps and Games] mrRobinson:
Wonder if we can get this in a system less root ramdisk.
[Android Apps and Games] CrossBones3129:
Wait, you're using adblock plus filters on Adaway?
[Android Apps and Games] Mike B.:
Those things are not in the correct format and will be ignored by AdAway if found in a source file... ;)
[Android Apps and Games] CrossBones3129:
Oh the default adaway filters are too strict. When trying to watch some videos that have ads they will just never load. I've tried white listing the dns's that are used for the video but that doesnt help.
[Android Apps and Games] Mike B.:
AdAway has no "filters", it merely suggests a few

optional

source files. AdAway can't prevent a video from loading, but if

YOU

block a host needed by that video (and you don't provide an alternative with the webserver) that video probably won't load. In fact, preventing unwanted content from loading is the main reason people choose to tweak their hosts file, with or without AdAway.

As mentioned countless times, start with the default sources, enable the webserver, and if you still have trouble, see which URLs, if any,

YOU

need to whitelist. You may want to search this thread for the many references to similarly misunderstood situations.
[Android Apps and Games] CrossBones3129:
I tried for hours but couldnt soove my issue. Adaway is now uninstalled =/
[Android Apps and Games] Taomyn:
Has anyone managed this and can explain the steps? I have systemless root now running on my Nexus 6, but nervous about touching any of the files on /system
[Android Apps and Games] Mike B.:
Whether AdAway is installed or not makes NO DIFFERENCE. The only thing that matters is what is in your hosts file. Since you never gave us specifics (which videos, with which app, what errors, etc.) it's difficult to guess what your issue is, but chances are that simply enabling the AdAway webserver or adding a whitelist entry or two would have quickly solved your problem. If/when you get tired of seeing too many ads on your device, feel free to come back to AdAway and we'll try (again) to help you
[Android Apps and Games] CrossBones3129:
My hosts file is back to normal. I was having issues loading wwe network videos with the WWE app. Now they load fine. Tried whitelisting many dns servers and had webserver on and it did not help. I was able to get it unblocked but I guess it uses more than one dns server because it started not loading videos again. When you begin a new there is a video ad played. If you resume a video there is no ad.
[Android Apps and Games] mrRobinson:
Well you quoted his explanation of the steps but I can assume you need slightly more details.

go into adb shell and su to be root.

cp /system/etc/hosts /su/etc/hosts

create a file like 0000adaway.script with "mount -o bind /su/etc/hosts /system/etc/hosts;" inside.

adb push it to your device like adb push 0000adaway.script /sdcard/Download/.

go back to adb shell as root and cp /sdcard/Download/0000adaway.script /su/su.d/.

reboot

This is basically very similar to ln -s from data partition. One difference is the mount command won't persist reboots like a symlink which is why he put it in su.d
[Android Apps and Games] Mike B.:
If by "normal" you mean that you reverted your hosts file to its original (effectively empty) state, that might be overkill and doesn't help finding out which source file was giving you trouble. By quickly searching this thread, you'll see that another member had a related problem with that same WWE app but we don't know if he/she ever found a solution. The odds are that you simply need to whitelist the host where that app keeps either its ads or the scrip that fetches the ads... if you can figure out where that is. Since I see that you also posted in the YouTube Xposed module, keep in mind that your WWE app might embed its ads, just like YouTube does, and that no amount of playing with the hosts file can stop that.

Under the assumption that your "WWE app" shows the same videos as the wwe.com site, I went there with Firefox and AdAway enabled (default sources, webserver on, no whitelist), and had no trouble playing a couple of (strange!) random videos from their main page. I see a plethora of WWE-related apps on the Play Store and maybe switching to a better behaved app than the one you're struggling with might be a wise move... ;)
[Android Apps and Games] Taomyn:
Many thanks for this, yes I did mean more detailed steps.

Unfortunately it doesn't seem to work for me. The files are all there and in the correct places. I ran Adaway and changed the location for the hosts file to /su/etc before applying, but then at the end it complains about the symlink being missing. It wants to create it but I say "no", and I can see the hosts in /su/etc has been updated. Was I meant to keep the location pointing at /etc/hosts ? I wasn't sure so went for the safer option of not touching the original.

Or perhaps the script file is incorrect but I don't know if the execution of it is logged anywhere to check it.
[Android Apps and Games] mrRobinson:
Yes keep adaway at its default system etc hosts.

That's the purpose of the bind mount to get it over to su
[Android Apps and Games] wwwryan:
Make sure to chmod +x the script file as well. Mine was not running at boot until made it executable.
[Android Apps and Games] Taomyn:
Did that now, it's 0700, but still no sign of the new bind when I run "mount" after rebooting.

Could someone post their script file as an attachment? Perhaps my mistake is there.
[Android Apps and Games] corebore:
I'm not sure if it has to do with my ROMs adblocking features but adaway keeps disabling when I reboot.
[Android Apps and Games] wwwryan:
I've attached my copy of the script but it should be a simple one liner. I have the following in the mount output after reboot:

/dev/block/loop0 /system/etc/hosts ext4 rw,seclabel,noatime,data=ordered 0 0

Edit: Nvm it won't accept the attachment for some reason but here is a Dropbox link:

https://www.dropbox.com/s/hyuocy1ov7ora7i/0000adaway.script?dl=0
[Android Apps and Games] Taomyn:
Thanks for the file, I downloaded it just fine and after putting it onto my N6 all is working now :good:
[Android Apps and Games] Mike B.:
Whatever "ROM adblocking features" you have, if they interfere with basic local DNS resolution (the hosts file), DISABLE THEM (and even delete them if you can). In some ROMs, even after deletion, those things still leave all sorts of undesirable remnants, such as multiple hosts.* files that need to be deleted manually. This is a known unfortunate limitation of some custom ROMs from overzealous or misguided "cookers" but it's easy enough to fix by cleaning up those ROMs after installation.
[Android Apps and Games] osm0sis:
Your file likely had Windows line endings unless you used Notepad2 or Notepad++ and set it to only use LF. Make it on the device in a file manager/explorer next time to avoid those issues. I recommend FX. And yeah, any run-parts-esque boot script needs root:root user:group ownership and needs to be executable (755 rwxr-xr-x usually). :)
[Android Apps and Games] Taomyn:
I was using N++ but I had forgotten to set it to LF only - it was my work machine where it's all Windows so I don't normally change it. It seems to like 0700 for the permissions but if I have any issues I'll try 0755 :good:
[Android Apps and Games] IronTechmonkey:
Occasionally I check the # of lines in each of the four host sources native to Adaway. Since the subject of resource overhead sometimes arises, here are the present sizes, in # of lines, of each of the 4 sources:

hosts-file.net: 45,492

pgl.yogo.org: 2,434

winhelp2002: 13,861

adaway.org: 417

Of course those #s will change with each update, but there are a couple of interesting observations over time (the past few months).

- The native adaway source has grown in from low 300s to over 400 lines.

- The sum total of all 4 sources is now less than 60,000 lines which is a lot less than the 300,000 or so lines it once was. That difference is so extreme that I must question my own records and previous testing, but back then I did test several times to confirm that 300,000+ value. Either I did something wrong in that test or the # of lines has since been greatly reduced.

Also, I (stilll) use only the adaway source but have recently started adding some to the blacklist and must say it is so very nice to be able to add them directly from DNS request log.

Too slick. Too easy. :good:

---------- Post added at 07:07 PM ---------- Previous post was at 07:02 PM ----------

Jota Text Editor may not bad for this on the droid it's self.
[Android Apps and Games] Mike B.:
Note that the default source files are simply vague recommendations but are not directly connected to or controlled by AdAway or its maintainers. Each one is provided by different independent individuals or groups, each using different "standards" for what they feel should be blocked. It's possible that the sources providers are learning to better identify active ad servers (many public source files are full of obsolete hosts). Those four usually make for a reasonable compromise that should work for many users without putting undue stress on even fairly resource-limited devices. Let's keep in mind that AdAway's main purpose is to simplify the process of adding entries to the hosts file. It is not intended to provide a universal foolproof way to disable all ads for everyone, as some users seem to think. As pointed out before, the "AdAway" name is unfortunate when it's actually mostly a "Hosts Manager", but it's way too late to change that... ;)

The script in question is merely "mount -o bind /su/etc/hosts /system/etc/hosts;" and doesn't need a fancy editor or even vi. The file can be created trivially from any terminal/shell prompt with a simple echo command but I guess W*ndows users only know how to do things the hard way... ;)
[Android Apps and Games] IronTechmonkey:
Thanks for the clarification in re the "adaway" source. I use it because it is the smallest rather than due to any impression of association, but that's good to know. Also, to several of your points: I've been using that one small list beause it was easy and effective enough but recently a few more things started slipping through so I explored the additional black list which, as has been stated before by you and others, is more efficient than large single lists.
[Android Apps and Games] CrossBones3129:
http://www.mediafire.com/download/k2mqy9okl02n103/adaway-export

This is my whitelist. It allows the wwe network app to play videos straight up.
[Android Apps and Games] Mike B.:
Thank you for the update. Your findings may be useful as a starting place for other members having trouble with that app. I can't help notice that you apparently had to whitelist LOTS of hosts, including many that are widely used by a number of web sites and apps, and that this may result in unwanted ads showing up everywhere for you. If that happens, consider switching to a less demanding app to watch your videos.

Reminder: you can use wildcards ("*" and "?") when creating white list entries. For example, "*.wwe.com" covers all wwe.com subdomains such as www.wwe.com, ws.media.net.wwe.com, metrics.wwe.com, etc.
[Android Apps and Games] CrossBones3129:
The l.gamespot.com is not necessary for the wwe app and idk if it included the dns's I had unchecked as well when I did the export. Now the wildcard, do the * and ? mark have different functions?

I think pubads.g.doubleclick.net causes the ads. I now have tgat one unchecked and the videos load but no ads.
[Android Apps and Games] IronTechmonkey:
Do wildcards also work in blacklist? I would assume yes and will test later.

---------- Post added at 09:46 AM ---------- Previous post was at 09:38 AM ----------

Typically ? is a wildcard for 1 character and * is a wildcard for a group contiguous characters.

I found that after blacklisting pubads.g.doubleclick.net ads where it seemed to be the source were coming through because of other sources later discovered by DNS request log.
[Android Apps and Games] Mike B.:
The basic wildcards are the question mark ("?"} which stands for "any single character" and the asterisk ("*") which stands for "one or more characters".

Many of the non-wwe hosts you seemed to whitelist are common known ad providers. Now that you apparently figured out how to do it, I'll let you explore what works and doesn’t work for your specific needs and interests. ;)
[Android Apps and Games] CrossBones3129:
Ok well this is my lasted whitelist that allows wwe network vids to play without ads.

http://www.mediafire.com/download/k2mqy9okl02n103/adaway-export
[Android Apps and Games] Mike B.:
No, wildcards are only for whitelisting. Entries from the black list are merged into the hosts files "as is" and must therefore follow the correct hosts format (NO wildcards) since the Android DNS process knows nothing about wildcards. By contrast, the white list entries are used by AdAway to prevent anything from the source files that matches from getting into the hosts file, and since AdAway understands wildcards, you can use those there. It's all very simple... ;)
[Android Apps and Games] IronTechmonkey:
Certainly simple to understand once explained. Thanks. I'm really digging the blacklist.
[Android Apps and Games] Mike B.:
The black list is merely a source file that you enter manually instead of grabbing it from a remote location. No magic involved ;)
[Android Apps and Games] IronTechmonkey:
I never implied that I thought there was anything magical about it. I just like it :) (and actually had all the pertinent explaining details in my head from decades of work on PCs but it did not make the mental transfer to droids - although it might have if I had waited until after coffee to post about it - <hanging head in shame>). Also, I've been touting the blacklist because in spite of it's non magical simplicity it is, as you and others have said many times, more efficient to use it than to use that large host files with many needless entries. Thanks again.
[Android Apps and Games] saigon66:
I can't install Ad Away on my NovaStock 5.5 Final ROM. Don't know why...!!! I love this app very much. How can fix this issue? Thanks.