yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] PerfectSlayer:
Hum :confused: I just made a test with the following conditions:

CM14.1,

WiFi connection (no sim on my test device),

Edition of hosts file with echo and cp,

NO use of the [MENTION=4544860]osm0sis[/MENTION]'s new script (or any command to flush DNS cache).

And when I change the hosts file then ping a host, there is no cache at all! I could change the IP of the domain then ping it immediately and the IP is the good one.

Did someone have already experience this behavior? Or at least, try to edit host file without trying the script to flush the cache?

So to answer you [MENTION=5542764]misterpyrrhuloxia[/MENTION] I can't test the script as the expected behavior works without it..!

[MENTION=4544860]osm0sis[/MENTION] If you would like to improve it, you could check the Android version with:

getprop ro.build.version.sdk

And call the commands on theirs supported versions only ;)
[Android Apps and Games] Beakhole:
It looks like you're not the only one on a Rom where the hosts file takes effect immediately:

So I guess the only people who can really test this would have to not be on CM or Lineage.

And I like your idea about getting the Android version. Let me see if I can add that in the script.
[Android Apps and Games] jcmm11:
I had version check code in the script that I posted. Also I'm on Pure Nexus 7.1.2, not Lineage or CM.
[Android Apps and Games] Beakhole:
Ok, so here's the script, modified to do a version check. I tested it on my MM device and it worked perfectly.

Can you guys with Nougat give it a try?

Here it is:

#!/system/bin/sh

version=$(getprop ro.build.version.release | cut -b 1);
sleep 2;

for i in $(ls /sys/class/net); do

if [ "$version" -le "4" ]; then
ndc resolver flushif $i; # KitKat and below
elif [ "$version" -lt "7" ] && [ "$version" -gt "4" ]; then
ndc resolver flushnet $i; # Lollipop and Marshmallow
else
# Nougat and above
case $i in
wlan*|eth*) unset pre;;
*) pre=".$i";;
esac;
if [ "$(getprop net$pre.dns1)" -o "$(getprop net$pre.dns2)" -o "$(getprop net$pre.dns3)" -o "$(getprop net$pre.dns4)" ]; then
dns1=$(getprop net$pre.dns1); dns2=$(getprop net$pre.dns2); dns3=$(getprop net$pre.dns3); dns4=$(getprop net$pre.dns4);
ndc resolver clearnetdns $i;
ndc resolver setnetdns $i "" $dns1 $dns2 $dns3 $dns4;
else
ndc resolver setnetdns $i "" 127.0.0.1 127.0.0.1;
ndc resolver clearnetdns $i;
fi;
fi;
done;
[Android Apps and Games] Beakhole:
Ok, I modified it again. This time it checks the sdk version, which is better, in my opinion.

#!/system/bin/sh

version=$(getprop ro.build.version.sdk);
sleep 2;

for i in $(ls /sys/class/net); do

if [ "$version" -le "19" ]; then
ndc resolver flushif $i; # KitKat and below
elif [ "$version" -lt "24" ] && [ "$version" -gt "19" ]; then
ndc resolver flushnet $i; # Lollipop and Marshmallow
else
# Nougat and above
case $i in
wlan*|eth*) unset pre;;
*) pre=".$i";;
esac;
if [ "$(getprop net$pre.dns1)" -o "$(getprop net$pre.dns2)" -o "$(getprop net$pre.dns3)" -o "$(getprop net$pre.dns4)" ]; then
dns1=$(getprop net$pre.dns1); dns2=$(getprop net$pre.dns2); dns3=$(getprop net$pre.dns3); dns4=$(getprop net$pre.dns4);
ndc resolver clearnetdns $i;
ndc resolver setnetdns $i "" $dns1 $dns2 $dns3 $dns4;
else
ndc resolver setnetdns $i "" 127.0.0.1 127.0.0.1;
ndc resolver clearnetdns $i;
fi;
fi;
done;
[Android Apps and Games] osm0sis:
I didn't include that purposefully​. We were seeing it not be based on version or SDK, but by branch and/or revision tag, so some of Marshmallow still has flushnet. Better to just blanket run it all since there's no harm to doing so.
[Android Apps and Games] ktmom:
I was going to test this for you, but as soon as I blocked Google and reapplied Adway, it worked. I didn't have to reboot. I'm running Pure Nexus on an N6.
[Android Apps and Games] PerfectSlayer:
Hi all,

I kept looking for DNS cache implementation in Android and I found something in a developer documentation page: https://developer.android.com/reference/java/net/InetAddress.html

So when we use ping command, I think we use libc DNS cache (like this one) but the documentation tells us there is another cache in InetAddress (in dalvik VM?).

May be we could try to play with the properties given in the documentation?

Why do you think about it? Do you have to try InetAddress in our test to check if the solution work? Is the property another way to flush the cache?
[Android Apps and Games] Beakhole:
Wow. I don't know. This is way over my head.

But now I feel like a complete idiot. I'm now beginning to wonder if this flush DNS command for MM even works because I just discovered that I have no real way to test it. Because I just tested enabling and disabling Adaway and blacklisting and whitelisting sites and testing between all those without running the script or my Tasker profile and it seems that being on PureNexus the hosts file takes effect immediately. I tested the sites in the browser and through pinging and it always takes effect immediately.

So we need people who can test this who's rom doesn't just immediately apply the hosts file without rebooting or running the commands/script.

I'm really curious about your find there, [MENTION=2822685]PerfectSlayer[/MENTION]. Does this mean that you could possibly modify the TTL to almost nothing in order to flush the cache? And what's a "security manager"?
[Android Apps and Games] PerfectSlayer:
Haha, I thought to test ping command before applying the script. That's how I found I don't have to run it to have the expected behavior.

So we (you and I) don't have a way to find if it really works! (but I'm not saying it isn't ;))

Hum, there is a mechanism in Java called SecurityManager : https://docs.oracle.com/javase/tutorial/essential/environment/security.html

But I wonder if it's the same thing in Android as the related documentation states:

and System.getSecurityManager() always return null value.

We clearly are out of bounds of the SDK. So don't expect to find an easy and reliable way to achieve a DNS cache flush :angel:
[Android Apps and Games] Rebel7022:
I know you can manually add stuff to block, but I don't know how to collect the info. Can anyone share some of their best blacklisted collection?
[Android Apps and Games] Beakhole:
Unless it's as easy as just running these commands/scripts.
[Android Apps and Games] Pkt_Lnt:
Best to get your own.

https://github.com/AdAway/AdAway/wiki/LogDNS
[Android Apps and Games] Beakhole:
I just had a thought... If I don't have to reboot or do anything at all to flush cache in PureNexus after applying Adaway, I wonder if there's anything we can learn from the source code of PureNexus? Like, do you think the rom dev modified PureNexus to have like a 1 second TTL? Because that's really the only explanation I can think of as to how Adaway takes effect immediately.

[MENTION=4395895]BeansTown106[/MENTION], do you know how it is that applying the hosts file in Adaway takes effect immediately in PureNexus?
[Android Apps and Games] Mesmurized:
Changes to the hosts file are immediate, however DNS requests are cached, so if a host is cached in memory you won't see the change until a DNS flush or a reboot.
[Android Apps and Games] shiko0:
guys im really new here i have been looking for something to block ads since im on nougat and i used to have xposed modules back in marshmallow , im on rooted note 5 with custom rom by dr katen guide me plz i got the app installed and granted superuser but it's not working , sorry for being such a noob but im really new to adaway
[Android Apps and Games] NLBeev:
Have a look in previous posts

https://xdaforums.com/showthread.php?p=71780088/
[Android Apps and Games] vinoth_raja:
How about Nougat Roms, will it work ? Im still seeing Ads while using chrome browser.
[Android Apps and Games] Ja_som:
It works, check if you have data saver enabled in Chrome, if yes, disable it...
[Android Apps and Games] vinoth_raja:
thanks i disabled data saver, but still im getting ads,pop ups while accessing some sites. does it only block ads from google adsense.?
[Android Apps and Games] githyanki:
Have you rebooted after updating hosts file?

Other things that make adaway not work are vpn, and proxy.

What site are you seeing pop ups?
[Android Apps and Games] vinoth_raja:
yea i rebooted. Its a mob site
[Android Apps and Games] githyanki:
That is a horrible site. It's whole purpose is to spew ads . I did not get any, but it tried really hard.

TPB has a Hindi movie section, possibly there's a Tamil movie area to try.
[Android Apps and Games] vinoth_raja:
yea i know its a s**ty site just wanted to check this app, thats all. thnks for ur time.
[Android Apps and Games] Folloxme:
nicee

Nice app!
[Android Apps and Games] Beakhole:
[MENTION=2822685]PerfectSlayer[/MENTION], I wonder if this would be helpful in flushing the cache? That is a really old post, though.

Also, I wonder if it'd be possible to modify networkaddress.cache.ttl linked to on that page you quoted above?

So can you guys think of a way we can get a host to cache and then try running the script or Tasker Profile to see if that cache is actually flushed without having to reboot?
[Android Apps and Games] Rebel7022:
I am trying to save my blacklist List. I select import and adaway says it saved my list to sd card, but I can't find it. Does anyone know how to export a list?
[Android Apps and Games] jcmm11:
Make sure adaway has been granted Storage privilege. It doesn't ask for it the way it should so you have to manually go and do that (settings: apps: adaway: permissions)
[Android Apps and Games] Rebel7022:
I googled it couldn't find much, what does web server do? Does it kill battery? Can someone help a noob out. Thanks
[Android Apps and Games] Pkt_Lnt:
Save waiting for blocked website requests to time out.

https://xdaforums.com/showpost.php?p=70808147&postcount=8250
[Android Apps and Games] Rebel7022:
Do you leave web server on always?
[Android Apps and Games] Pkt_Lnt:
Yes! No flippin' way I want to manually turn it on every time I use the phone and turn it off just before I stop using the phone. A 1000 times a day, no thanks. :eek:
[Android Apps and Games] cr4ck3dn:
Edit: Problem solved, in ad list was portal.fb.com , FBCDN and I put this address to white list and now it's ok.

Maybe from last week adaway blocks Facebook messenger application connection in messenger it's waiting for network message. If I disable adaway and restart devices all works ok.

I have this problem in 2 devices: Huawei g525 and Allview viper L ( Gionee elife 3 ).

How I can fix this?
[Android Apps and Games] ogisha:
One question, a little bit off topic.

I there an AdAway port for Windows that will change hosts on system level?

Thank you!
[Android Apps and Games] androcraze:
https://xdaforums.com/windows-8-rt/win-8-development/powershell-adblock-t3103598
[Android Apps and Games] xdarthanonx:
HostsMan
[Android Apps and Games] DEVILOPS 007:
Any equivalent for linux mint/ubuntu?
[Android Apps and Games] NLBeev:
Dropbox and rootexplorer: I copy system/etc/hosts to my Dropbox and on my PC 'hosts' is copied to:

C:\Windows\System32\Drivers\etc\hosts.
[Android Apps and Games] RedSkull23:
The best app in this sector imo, useful and works flawlessly. Thanks a lot.
[Android Apps and Games] :
I'm a bit confused with using Adaway and Magisk.

So I flash Magisk and enable systemless host, then install adaway and install host files?

Adaway won't enable the systemless mode in the settings though.
[Android Apps and Games] Pkt_Lnt:
Known issue, not needed since Magisk handles it, it works. :good:

https://xdaforums.com/showpost.php?p=70940479&postcount=8316
[Android Apps and Games] TogoFire:
Adaway does not work on Alcatel Pixi 4 (4) 4034.

I changed the source hots and it did not work.
[Android Apps and Games] ogisha:
Do you turn DNS Cache service off?
[Android Apps and Games] NLBeev:
No. Sometimes I flush the DNS-cache when Chrome refuses to load an updated webpage.

Mostly on my PC; hardly on my Nexus 6.
[Android Apps and Games] twowheeler:
What does adding a * or ? Do when putting something on the white or blacklist?

Verstuurd vanaf mijn A0001 met Tapatalk
[Android Apps and Games] ktmom:
They are wildcards. An * matches any number of characters. A ? Matches a single character.

a*d matches

abcd

abd

ad

a?d matches

abd

acd

but not

abcd
[Android Apps and Games] kiwigi:
If I do not re-download/re-install the host files after a normal reboot I have the ads all over the screen.

Not sure why this is so? :(
[Android Apps and Games] NLBeev:
That's not good. When a hosts file is created it should be kept, even when Adaway is uninstalled.

When you use the systemless mode it's possible a configuration issue; f.i. when

Magisk or Xposed is used o.t.l.t.
[Android Apps and Games] Rebel7022:
I exported my list to sd card, I installed adaway, granted storage permissions, but I cant import my list. I cast see it or select it in the file manager
[Android Apps and Games] kiwigi:
Yes I have Xposed. So do you know if there is a workaround? Thanks
[Android Apps and Games] NLBeev:
Xposed changes system behavior and apparently the file 'hosts' is reset/cleared after a reboot.

Could be a module. Can't help you, sorry.
[Android Apps and Games] kiwigi:
Thanks, that gives me something to work on. Very much appreciated :)
[Android Apps and Games] xdarthanonx:
Are the ads showing only in Dolphin or all apps?
[Android Apps and Games] kiwigi:
And on Tapatalk
[Android Apps and Games] xdarthanonx:
AdAway is enabled but all Ads are getting through!

Tapatalk needs to connect to a specific hostname that normally provide ads: redirect.viglink.com

Don't forget to Scan for Adware and Log DNS Requests:
[Android Apps and Games] ogisha:
Hi guys!

I would be very grateful if somebody could help me with some whitelisting. Namely, I have started to use MoaAB list which helps me a lot with blocking some sites. But it has one flaw. It also blocks Here WeGo maps. I have searched for all appearances of "here", "maps" and "wego" in hosts, but I could not find any logical entry to be whitelisted.

Thank you very much!
[Android Apps and Games] xdarthanonx:
Disable ad blocking > Log DNS requests > Launch HERE WeGo
[Android Apps and Games] drmdsadiq:
I'm having horrid ads with the latest update of mxplayer... Any way the hosts can be modified to solve this?
[Android Apps and Games] ogisha:
Thank you very much. I have finally solved it, although I had to whitelist almost ten entries. :laugh:
[Android Apps and Games] Ultramanoid:
You can ( actually should, as per forum rules ) search the thread to see the answers to all the people that have asked about that particular, popular, piece of intrusive adware.

You can also stop using and supporting adware, and pay for a player that exchanges money for proper services, as opposed to the free pernicious adware model, or enjoy for free an open source solution, which offers a clean and powerful experience in a variety of media players, such as VLC, Kodi, mpv, etc.
[Android Apps and Games] drmdsadiq:
Point well taken man!
[Android Apps and Games] newintage:
My advice is don't use them together. Let the AdAway modify your /system.

It's simple but systemless adblock is problematic (at least for me...)
[Android Apps and Games] DEVILOPS 007:
Do you have a theme for adaway? How'd you get that green tick?
[Android Apps and Games] xdarthanonx:
https://adaway.org/ ;)

(I think it's a pre-3.0 version.)
[Android Apps and Games] DEVILOPS 007:
Okay thanks. Why not use the most recent version?
[Android Apps and Games] xdarthanonx:
I am using the most recent version. But it was more convenient for me to use the screenshot from the AdAway website.
[Android Apps and Games] androcraze:
How many do you have to add to the whitelist with just the 3 default hosts?
[Android Apps and Games] ogisha:
I don't get it.

Please, rephrase your question. :eek:
[Android Apps and Games] androcraze:
AdAway pulls-down 3 default hosts files in it's initial configuration.

You're using the MOAAB hosts file, and you have to whitelist 10 servers to get your app working.

Did you get a count of the servers required to whitelist for that app with the default 3 hosts?
[Android Apps and Games] ogisha:
I did not have any problems with Here ToGo Maps until I had added MoaAB hosts file. I need MoaAB hosts file because it blocks some really annoying sites.
[Android Apps and Games] xdarthanonx:
The Log DNS Requests can also be used to blacklist sites. If the number of sites is small, it would be easier to use[highlight] no MoaAB + blacklist [/highlight]than[highlight] MoaAB + whitelist[/highlight].
[Android Apps and Games] Ultramanoid:
MoaAB is a monster.

If you want a single hosts file combining several reliable and well-maintained sources, try the one from Steven Black. Whatever it may not block, which shouldn't be much, you can always add yourself in a list as others have suggested before.

https://github.com/StevenBlack/hosts

Edit : It also has different versions adding more or less domains, depending on your needs, give it a look.
[Android Apps and Games] jcmm11:
Using that url has been problematic, as in it wasn't updating (unless fixed recently). Mirror site works just fine

http://sbc.io/hosts/hosts
[Android Apps and Games] bokkoman:
Is there a way to allow Google search link ads to be allowed? For example,

If I search for something, most of the times the first few results are ad based redirect links, but those are exactly the sites I need. But adaway blocks those results.

So can I bypass this somehow?

Thanks
[Android Apps and Games] jasonkhoo87:
Does anybody using this on note 3 stock Rom rooted?
[Android Apps and Games] MANswers:
Mine is a stock rom rooted. using adway.. works perfectly fine. Love the integration.. dont see ads at all.
[Android Apps and Games] TecknoFreak:
I been using this app for months and overall is the best ad remover I have tried. Love it

Sent from my Atrix HD using Carbon rom and XDA 4 Premium
[Android Apps and Games] spotdog14:
Seems to be working on my Nexus 5.

This app is the only reason I rooted my 5.

---------- Post added at 11:21 AM ---------- Previous post was at 11:17 AM ----------

Seems to be working on my Nexus 5.

This app is the only reason I rooted my 5.
[Android Apps and Games] trebills:
Tried on nexus 5. I get error
[Android Apps and Games] wintrxtrem:
Working on my nexus 5
[Android Apps and Games] trebills:
yea it worked just now for me. It failed 2 times earlier and then just worked. 3rd times a charm I guess
[Android Apps and Games] dazz87:
Same here worked on the 3rd time. Just wondering on my nexus 5 and tablet with this app install, when someone post a link in a thread when i click on the link chrome try to open up the page but all i get is a error. Happens when i install adblock app. Is there a work around to get app install and able to click on links without any issue?
[Android Apps and Games] J_Whit85:
The app has a whitelist feature might look into that
[Android Apps and Games] hutzdani:
Yeah god bless this app and its developer, nothing worse in this world than unwanted adverts, its amazing you come from an ADAWAY device to a non-ADAWAY and its unbelievable that so many people put up with it !
[Android Apps and Games] GJ123:
It doesnt seem to work on my Nexus 5

Edit: And now it does, strange
[Android Apps and Games] Gormsen:
Did you do anything to make it work on Nexus 5?

Mine is giving me an error message, saying that it failed to apply hosts file.
[Android Apps and Games] GJ123:
Simply try again. I had to try 3 times and checked root in between. Hope it works for you!
[Android Apps and Games] sburbol:
It failed on my Nexus 5 a few times this morning as well, but I just got it working.

I told SuperSU to forget AdAway, tried applying hosts again, and then granted access after it downloaded. This worked the first try for me.

EDIT: Prob doesn't matter, but I downloaded from F-Droid
[Android Apps and Games] Sans143:
Can confirm the second step worked for me.

" I told SuperSU to forget AdAway, tried applying hosts again, and then granted access after it downloaded. This worked the first try for me."

Now sporting Adaway on my Nexus 5.
[Android Apps and Games] spotdog14:
It was unbearable how many ads are in the apps I use. I have been using AdAway for so long I forgot. Its also crazy that most of the apps run faster and load content faster with the ads blocked as well.
[Android Apps and Games] Z_0r10n1S:
Sorry for noob question: how can I make a symbolic link for hosts file?

I tried with a su shell but says file exists. I have an old device with gingerbread and AdAway doesn't work as it does with newer Android versions.

I read that should work from recovery but don't know how.

Thank you for help.
[Android Apps and Games] hutzdani:
Don't touch SUPER USER permissions, everytime it crashes or fails just re-launch ad away it will work eventually
[Android Apps and Games] SkapyTek:
What apps u are deleted?

Gesendet von meinem GT-I9505 mit Tapatalk
[Android Apps and Games] Hugs88:
Facebook and twitter :)
[Android Apps and Games] ogisha:
Thank you. I will try without MoaAB.

Thank you guys. I am already using these hosts (the mirrored one).

I will try without MoaAB.
[Android Apps and Games] Juzman:
So you only use the one url for the list then, and untick the other 3 (adaway.org, hosts-file.net, yoyo) all have all 4 ticked?

Edit: I will only use the sbc one since it combines all. :)
[Android Apps and Games] jcmm11:
You're correct. Only the one. Left the others there but unticked them
[Android Apps and Games] Rebel7022:
Is there a list i can add that blocks pop up when I click on something. Cause every time I manually block popups other pages break
[Android Apps and Games] 5suxeN:
Hey guys,

I can't seem to get AdAway to work properly. First off I installed AdAway before realizing I had to Enable Systemless hosts in Magisk. So I uninstalled AdAway and redid everything with Systemless hosts enabled and it still doesn't work. I followed the instructions in post #8899. I tried versions 3.2 and the dev build. I disabled Data Saver in Chrome. AdAway is showing "Enabled". Running out of ideas on what to try. Any suggestions are welcomed.

Thanks.
[Android Apps and Games] NLBeev:
From what I've read in this thread.

Magisk handles the systemless stuff only, not both Magisk and AdAway.
[Android Apps and Games] 5suxeN:
To clarify what I meant, During the reinstallation, I first enabled Systemless host in Magisk and then I installed AdAway.
[Android Apps and Games] NLBeev:
In AdAway - preferences: systemless mode unchecked? Or grayed out? There's a post about this:

https://xdaforums.com/showthread.php?p=70940479/
[Android Apps and Games] admiralspeedy:
So I'm running Invisiblek's unofficial Lineage build on my Pixel XL and I also got the Lineage root addon working (had to modify the install script but it works now), and for some reason Adaway is unable to copy the hosts file, but I also can't change to systemless mode because I don't have SuperSU installed. I tested it with SuperSU and it does work in systemless mode, but SuperSU causes SafetyNet to fail (Invisiblek's ROM has a patch for it, and if I disable the Lineage root option I can pass SafetyNet fine) so I don't really want to use it.

I compared it to my Nexus 6 running Lineage as well, with Lineage root and it works fine even with systemless greyed out.
[Android Apps and Games] NLBeev:
Maybe there's no space enough in the system partition. You may try to remove not used stuff. When there is at least 30Mb free there's is a chance the hosts file can be written.

You may try first to uncheck the sources in AdAway and use only one source, so the hosts file AdAway creates will be smaller.
[Android Apps and Games] Paomamaw:
No url to download latest version.
[Android Apps and Games] Ja_som:
You can download it via XDA Labs, first post or

https://labs.xda-developers.com/store/app/org.adaway
[Android Apps and Games] Pkt_Lnt:
Both standard and dev versions in post #1. :confused:
[Android Apps and Games] admiralspeedy:
There's way more than enough space free and I'm pretty sure it would work fine if I could check off systemless. To be honest, I don't understand why the systemless option is ever greyed out. Why does the app have to detect the type of root you have before it lets you choose that option? Just let the user turn it on or off.