yashsingh1/xdaforums huggingface dataset:
[Magisk] Zackptg5:
Weird, it works for me with magisk 12 but that would make sense. I did try using the magisk busybox version of wget instead of the included one and it didn't work (I plan on looking more into that). Ya, I include wget in the module and have it linked to system/bin

Can you try something for me? Navigate to magisk/unifiedhostsadblock/system. Make a new folder called 'xbin'. Then move the wget command from bin to there. Enable magisk busybox and reboot your phone. Then try the hosts command again. Does it work?
[Magisk] ztv--:
I did not try that but updating busybox to /system/xbin fixed the issue.
[Magisk] Zackptg5:
How did you update busybox?
[Magisk] ztv--:
Using the BusyBox App by Stephen

Update: I forgot to mention that this is only a temporary workaround since it's neither systemless nor persistent.
[Magisk] Zackptg5:
It should be persistent but is definitely not systemless. When it's not working, can you type into terminal

which wget

and post the output? This module includes its own wget that is mounted to system/bin. I'm wondering if your phone is using a different wget in xbin or something
[Magisk] II_DiE_4:
OK so I didn't know that this module is using its own wget. Why tho? Can't you call the wget from the ROM or busybox?

Either way, making a xbin folder in the module and moving the wget there works. Also the terminal shows "which wget: /system/xbin/wget" which I guess your module even overwrites the busybox? Because if I use busybox wget it show busybox 1.26.2.YDS but this one fails to connect.
[Magisk] ztv--:
I removed the newer wget from /system/xbin but hosts still works. I can't get it to not work again :confused::D

E6653:/ # which wget
/system/bin/wget
E6653:/ # busybox | head -1
BusyBox v1.23.1 (2015-02-07 04:39:23 UTC) multi-call binary.
[Magisk] Zackptg5:
If the systemless hosts option isn't working, there's not much you can do magisk-wise as that's a magisk issue (not module related).

You could open the the hosts script in /magisk/unifiedhostsadblock/system/bin and change the "HOSTS" variable to magisk/unifiedhostsadblock/system/etc/hosts

Then create a folder titled "etc" in the system folder in that module directory. This should do the same thing as systemless hosts in theory (I've never tried it myself)
[Magisk] Zackptg5:
I don't develop the app so I can't help you there. What's the output when you run the hosts script in terminal?
[Magisk] :
You are right.. I just posted it for other to know what may happen.. :)
[Magisk] Bewildered Wolf:
Can't something be done for in-app ads ?
[Magisk] puhu:
This module blocks my app's ads

MI 5 cihazımdan Tapatalk kullanılarak gönderildi
[Magisk] BIGWORM:
Same here, no issues. Are you talking about like sponsored posts like in Facebook or Instagram?
[Magisk] Bewildered Wolf:
Download games din Ketchapp. Or download Zig Zig game from ketchapp. You'll see.
[Magisk] gorman42:
Total newbie with Magisk, coming from Xposed on MM. Is it enough to enable Systemless hosts in Magisk Manager, install the module from the repo and use GUI from here: https://xdaforums.com/showpost.php?p=73495676&postcount=485 in order to use it?

Also, is it compatible with Oreo?
[Magisk] Bewildered Wolf:
Should be fine.
[Magisk] jimger:
Is there any example of whitelist?

I can't get it working. Also do we put the file on external or internal SD?

For example how can I put tinyurl.com into whitelist
[Magisk] Didgeridoohan:
Add the following in the file (named whitelist without an extension):

0.0.0.0 tinyurl.com

Place it in the root of your internal storage.
[Magisk] jimger:
Thanks. That worked. I can't understand why it needs local host but ok. Many thanks...
[Magisk] jascolli:
Thank you for the explanation. I needed to see this too.
[Magisk] gorman42:
Any help? :)
[Magisk] Zackptg5:
Haven't tried it with Oreo. If magisk is Oreo compatible, this mod should be. I don't make the app so I can't support you there but once you enable systemless hosts, you can then use the app or run it through terminal
[Magisk] razorsbk:
Is there a way to add an app to whitelist? I don't know the domain name the app tries to connect to in order to serve me ads, but I want to allow only that app. Thanks.
[Magisk] Didgeridoohan:
No, but you should be able to use AdAway to analyse where the app connects to. See here for details: https://xdaforums.com/apps/magisk/magisk-unified-hosts-adblocker-t3559019/post73481326#post73481326
[Magisk] CeozMaze:
thanks

I just cant boot, then i wipe data from the bootloader (after try to reboot many many times) then i get a bootloop xD
[Magisk] dasti555:
Hey guys. I saw here same problem "no such file or directory" but can't find solution.. What to do with this error?
[Magisk] sscheib01:
Hello,

when trying to install the module and rebooting after then I get stuck into a bootloop and TWRP is opening. Using Mount Magisk I was able to remove the module and get into the system again.

However I'd really like to use this module - is this a bug or am I missing something here?

I read that BusyBox is a requirement, so I used the module from the Magisk Manager to install BusyBox systemlessly.

I'd be glad to help and provide log files, if somebody gives me a helping hand in doing so.

I'm running Nougat v7.0 using Magisk v14 on my Samsung Galaxy S8+ with the stock ROM.

Kind Regards,

Steffen
[Magisk] oTeMpLo:
With Unified hosts adblock installed .. Settings in Tapatalk app wont open any more (just black screen).

How to fix that ?

Thanks!
[Magisk] Bewildered Wolf:
Maybe disable unified hosts adblock. Configure your settings and then turn back on unified hosts adblock ?
[Magisk] oTeMpLo:
Yes.. i know that.. but im interested​ in what cousing it as it coul have may other bad side effect in apps an system..
[Magisk] deurus619:
Just hide tapatalk in magisk.

Gesendet von meinem HTC U11 mit Tapatalk
[Magisk] oTeMpLo:
DANKE!

It works, but whts the connection, why magisk must​ be hidden from tapatalk??
[Magisk] stu5797:
Hello! I have searched this thread for over an hour and cant solve my whitelist problem. I have added the websites to the list and have put the file on the root of my SD CARD. I have attached pictures. It appears I have added the whitelist when I input "w" in the terminal but these sits still get blocked. Any help would be greatly appreciated
[Magisk] rohitdave:
Hi

Can any one say if this will help to block ads on Puffin Browser.

Tried many blockers but none can do so.
[Magisk] pinoholo:
You can't block ads in puffin because they use their own cloud server to render web pages
[Magisk] mahin.kk2:
every time I trying to open adblock , the command shows no such directory ".cache" host

what can I do? I tried systemless host on magisk module turned on, after reboot it automatically turned off ..

pls help somebody
[Magisk] ipredatorv:
I had the same bug. You can try to delete Magisk and reflash it in recovery. But it didn't work for me, I had to clean flash my ROM.
[Magisk] onliner:
Hello, I have had problems with YouTube, after seeing a video this does not appear in my history, so I researched and found a solution, add the domain "* s.youtube.com" to the whitelist, but I am having problems to do that, I created a text file in /sdcard with the domain inside, but every time I run the "w" command, a message tells me that the whitelist was applied correctly but the blocking of other pages deactivates. how can I apply it correctly?.

I'm not using the social filter, just "mfgp".

Thanks.
[Magisk] Didgeridoohan:
Put the following in your whitelist file and try again:

0.0.0.0 s.youtube.com
0.0.0.0 s2.youtube.com
[Magisk] onliner:
"Segmentation fault"
[Magisk] Didgeridoohan:
You've obviously got something wrong with your setup...

I don't know why a simple grep command would give a segfault (at least I'm assuming that's what's causing the error, because that's what gets run at that point).

Until someone who actually knows what they're doing comes around, try running the command manually and see what happens:

su
grep -Fvxf /sdcard/whitelist /magisk/.core/hosts > /cache/uhatemp
[Magisk] ahrion:
Does fakenews filter block out CNN, MSNBC, BuzzFeed, CBS, BBC, Vox, etc?
[Magisk] onliner:
The response to this command is:

1|Cheeseburger:/ #

(Cheeseburger it´s my device codename)

And when i apply the whitelist i get the same error as before "Segmentation fault", clean install of Magisk + this module doesn't solve my problem, but thanks anyway :) .
[Magisk] Zackptg5:
Nope. Not sure what all it blocks actually but all of those sites work for me with that filter applied
[Magisk] stu5797:
It blocks the only website that had even remotely accurate polls and gave us the truth... Breitbart

CNN is not blocked for some reason
[Magisk] Didgeridoohan:
That's actually the response you want... It means the command has been run without errors. Take a look in cache if you have the uhatemp file and if it contains the offending lines or not.

Actually, take a look in the hosts file after getting the segmentation fault as well. It might be that it works even with the error.

I don't think I'm the right person to help further... It's a bit outside my skill set.

[MENTION=6037748]Zackptg5[/MENTION] what could this be about?
[Magisk] Zackptg5:
Hmmm, could you send me a copy of your whitelist?

Not entirely sure but something's wonky. Maybe something is off with the whitelist?
[Magisk] onliner:
Yeah, of course:
[Magisk] Zackptg5:
Not sure what the issues is. I used this file and it worked for me. Let me know how it goes
[Magisk] stead2120:
Just setup Magisk 14.2 on Google Pixel, I have a few Modules running already, but getting this error when installing unified host adblocker in Magisk:

[IMG="Install Error:"]https://i.imgur.com/yWcNOx0.png[/IMG]

Thanks ,
[Magisk] onliner:
Same problem:
[Magisk] amplatfus:
Segmentation fault

I got also Segmentation Fault. I cannot add white list even I put the file with those two entries. I have the same output from grep command. I do not know what should I try to add white list. I am open to any ideas (please).

PS: I have also a blacklist by 4mb size and for this I have error: Argument list too long.

I like very much the idea of this how this application logic works and I want to make it works.

Thank you!
[Magisk] Mr.Hyde_91:
Hi, why the Steven hosts file block facebook.com ? I receive an "unable to contact the server" :(
[Magisk] Nevermindthelabel:
Then don't block social (s) or whitelist facebook.com
[Magisk] Mr.Hyde_91:
ahhhh, social means: block all social web page not the ads/malware/virus etc... damn :D

Ok, now I use un+fake+gambling but, gambling what are ? casinò web page ?
[Magisk] Nevermindthelabel:
yep, that's how it works. I have no idea what gambling actually blocks, but I have never gambled before and have no desire to, so I always block it lol
[Magisk] Mr.Hyde_91:
lol, ok, thanks:good:
[Magisk] ahrion:
So it's not working then?
[Magisk] Zackptg5:
It works. To find out which sites are fakenews specific, just compare the fakenews alternate to the master hosts file from Steven blacks repo (link in op)
[Magisk] pa1pa1:
Guys, the whitelisting of the two youtube URLs suggested here aren't working for me. I have confirmed that it is a hosts-adblock related issue by manually disabling adblock and checking. My whitelist file looks exactly like below : (filename 'whitelist' without any extension, placed in the root folder of my oneplus 3t) :

0.0.0.0 s.youtube.com

0.0.0.0 s2.youtube.com

What am I doing wrong? Have the URLs changed?

I even tried looking for URLs using a network monitor. Here are the IPs I found :
[Magisk] ToDream:
Try this:

*.s.youtube.com

*.s2.youtube.com
[Magisk] pa1pa1:
Thanks for the screen shots. But the result is the same. With adblock off, history works fine. With adblock on and whitelist applied successfully, history stops working. Could youtube be using different URLs for different regions? I am from India, if that makes any difference.
[Magisk] atarek:
Hello,

I faced this issue before and didn't find any mentioned fix after deep analysis and investigation i got it to work by whitelist some of below records ("can't remember exact records"). it's seems youtube behave depends on different records in some regions.

you can start minimize this list by try and error if it worked in the beginning.

please report back with results in order it might help others.

Regards,

Ahmed
[Magisk] pa1pa1:
Thanks for the suggestion. However these URLs also did not work for me. Can you have a look at the screenshots I posted about 3 posts above? They contain the IP addresses that the app connects to. However I couldn't find anything to generalize. Maybe it can make sense to you.

Thanks.
[Magisk] atarek:
Ok. i'll look for your provided info and update you with my findings.

What filter are you applying ? i'm using only "m" Master and whitelisting some sites.

Regards,

Ahmed
[Magisk] pa1pa1:
I'm also using 'm'
[Magisk] ToDream:
My Youtube history has normalized only after applying whitelist with this following:

*.

And the Adf link shrinker is no longer blocked with this follow up:

*.A d f . ly

Try again!
[Magisk] whitak3r:
I'm having the same problem with a Pixel XL running Pure Nexus 7.1.2 and Magisk 14.2...

Won't work. I don't think it will work due to how the Pixels are set up. Adaway does work though.
[Magisk] Zackptg5:
This module isn't compatible with the betas. So you'll need to either stay on the official releases, or flash 14.0, reboot, then flash this module, then upgrade to 14.2
[Magisk] pa1pa1:
This isn't working either :crying:

I think I will have to give up on this now.
[Magisk] ToDream:
Try again

And wipe Youtube cache/data!

Don't give up because its working for me.
[Magisk] onliner:
Not for me, this is strange.
[Magisk] stead2120:
Initially Adaway did not install, however, I restored it from my previous Titanium Backup and I am good to go.
[Magisk] Zackptg5:
Well this beta has been stick around longer than I anticipated. So I went ahead and updated the module for 14.2. However, I changed the template a bit as I always do to maintain support for magisk installs on cache and because 14.2 is still only a beta and many users would prefer to stay on the stable build, I maintained backwards compatibility with v14.0. So uha v3.0 is now live and is compatible with magisk version 14+

P.S. This means those weird mounting errors will be gone now :)
[Magisk] Nomelas:
This is now gone from the repo?
[Magisk] Zackptg5:
Nope, should still be there
[Magisk] Nomelas:
Weird. It's not in the list anymore in the manager app
[Magisk] Nevermindthelabel:
Are you on 14.2 or 14? On my phone I use the beta and I see it, on my wife's phone I use stable and I don't see it in the download list
[Magisk] Zackptg5:
Weird. That's why I have the zip in the op?
[Magisk] Didgeridoohan:
Have you tried clearing the repo cache (in the Manager settings) and reloading the downloads list (pull down)?
[Magisk] Nomelas:
I'm on the stable release of Magisk.
[Magisk] Jaizu:
I tried that and isn't appearing.
[Magisk] Zackptg5:
I'm wondering if it's not showing up on stable because of the new template. I'm going to change the template number back to 1400 in the module.prop and see what happens
[Magisk] Zackptg5:
Can you guys see it now? I suspect that the newer template number was preventing it from showing up
[Magisk] atarek:
Appeared now and installed flawlessly.

Thank for your effort.

Regards,

Ahmed
[Magisk] Nomelas:
That was it. Is it compatible with 14.0?
[Magisk] Zackptg5:
Yup, 14.0 - 14.2
[Magisk] diddeldaddeldu:
i always get /magisk/.core/hosts: Read-only file system

i am on huawei p9 lite with latest stock rom

maybe i missed something but i cant get it to work.
[Magisk] gorman42:
Did the whole su/hosts thing, downloaded the requested files, all went well.

I wanted to understand what was being blocked, and whenever I try to disable the "Systemless hosts" option in magisk manager, it reboots.

Nexus 6P, Oreo 8.0.0, Security patch level 5 September 2017.

Edit: does anybody have a "good" website to check whether the addon is working correctly? Nothing with truly dangerous ads, just a simple website where you are sure there are ads and where none are displayed navigating with this installed. Thanks in advance.
[Magisk] DAusRon:
Try to open any download link from andoidfilehost. It has a few ads if im not mistaken.
[Magisk] gorman42:
Don't see any ads there, so I hope it's working.

If anybody has other links to suggest for checking, I'd be grateful.

This still leaves me with the problem of being unable to deactivate systemless hosts in Magisk Manager.
[Magisk] Tkbf:
Contents of my twitter seems been blocked, I create a whitelist and added 0.0.0.0 twitter.com, but didn't work, am I missing anything?
[Magisk] Zackptg5:
Just dont use the social filter. If you want to though, you'll need to do some digging because Twitter has a lot more domains than than just Twitter.com
[Magisk] otti17:
I also got errors with magisk 14.0 or 14.3 and latest adblock 3.0. With 14.3 my xiaomi always boot into fastboot. Only stable 14.0 and adblock 2.7 is working without errors. I'm on AOSPExtended 4.6 7.1.2.
[Magisk] Zackptg5:
You'll need to get logcat and magisk log is possible and bring it up on the magisk beta thread

Can you post a recovery log?
[Magisk] Legendary Cryptid:
Any chance you can update the module for 14.3?
[Magisk] Zackptg5:
It already is. There were. I changes on the module side between 14.2 and 14.3 so it still works fine
[Magisk] Legendary Cryptid:
What changes? It says there were I changes. I don't know what that means...
[Magisk] Zackptg5:
Whoops, typo. Although there were changes to magisk itself, there weren't any for the modules
[Magisk] Legendary Cryptid:
Well, I'll reinstall the module and test it out.
[Magisk] kima09:
It doesn't seem to work on my phone anymore after v3 update.

'Unable to locally verify Issuer's Authority' message is in Terminal. Anyone know how to fix this issue?
[Magisk] Zackptg5:
It's working, that's normal
[Magisk] kima09:
But I see ads everywhere. Androidfilehost, xda, etc.
[Magisk] Didgeridoohan:
And you have enabled systemless hosts?
[Magisk] jenslody:
And rebooted ?
[Magisk] kima09:
It's working now. I reinstall 2.7 again and update to 3.0 from Magisk. Finally work again.
[Magisk] zee24:
how can i change this so it blocks ads everywhere most importantly youtube and how can i get it to not block the ads on google search? You know when u search something theres the top two links which are google ads but also theyre your search and when u click them it doesnt load the page. How do i do that?
[Magisk] Zackptg5:
The hosts file is a system wide blocker. There's no way to change that. You can change what websites are blocked by adding (blacklist) and removing (whitelist) websites from the hosts file. You'll need to research what websites the Google ads are and add them to your whitelist (instructions in op)

The hosts file isn't really effective at blocking in app ads. Some solutions are:

Minminguard (requires Xposed)

Buy YouTube red (I get it with Google play music)

Use one of the modded YouTube players on XDA that has ads removed
[Magisk] Heezy01:
i also get this error in addition that it cannot write to the hosts file. v3.0, magisk 14.0, magisk manager 5.4.0. i enabled storage permissions for terminal and magisk and enabled systemless hosts in magisk. never ran into this error before.
[Magisk] guest4711:
Thanks for your fine module, which mostly does what it should. These days I encountered a strange problem: No adblocking anymore... Looking around I noticed my hostfile was empty (0 bytes).

I restored one from backup and tested a little bit: Even if the download is not successful the original hostfile is overwritten.

I think it would be better to download into a tempfile. To verify the correct download you may check the returncode of the fetch and the new filesize (has to be .gt. 0). If all is ok the original hostfile may be deleted and replaced by the tempfile.

---------- Post added at 06:04 PM ---------- Previous post was at 05:55 PM ----------

It looks as it has no write permissions to /magisk/.core/

Please try again using "su" before calling, e.g.

su
hosts

or

su -c hosts
[Magisk] Heezy01:
tried it out, same error.

EDIT: Updated to Magisk 14.3 and now it works.
[Magisk] guest4711:
Let's have a look at your hostfile:

jfltexx:/ $ su
l s -l /magisk/.core/hosts <
-rw-r--r-- 1 root root 3342096 2017-10-21 10:05 /magisk/.core/hosts
jfltexx:/ #

What do you see at your device? Are you able to rename the file?

jfltexx:/ $ su
mv /magisk/.core/hosts /magisk/.core/hosts.old <
ls s -l /magisk/.core/host* <
-rw-r--r-- 1 root root 3342096 2017-10-21 10:05 /magisk/.core/hosts.old
jfltexx:/ #

If yes, try again with "hosts". If not, there is a problem with magisk...
[Magisk] Heezy01:
i already fixed the issue by upgrading to magisk 14.3. but this might help others who might have the same problems on magisk 14.0.
[Magisk] gitzolinick:
Great module, thanks!
[Magisk] LeMoise:
I was able to install V3 on my Pixel XL 8.0 using Magisk 14.3 without any problems.

I am not sure what app to test the adblocking capabilities on as the one I tried didn't seem effected by it (Rider by Ketchapp). Suggestions are welcome.
[Magisk] guest4711:
Try AmberHome Weather or use any browser and visit XDA-develipers.com...

If you don't see any difference try again after reboot. Make sure you don't use any proxy for surfing...
[Magisk] LeMoise:
Unfortunately it does not seem to be working. The same amount of ads are present on XDA-Developers.com with or without the Unified Host Adblocker enabled, even with multiple restarts.
[Magisk] guest4711:
Sorry, my fault. xda-developers hosts the ads itself, so blocking hosts does not help. But android file host is a good adress for testing. I don't see any ads when visiting https://androidfilehost.com/?w=files&flid=25696 for download...
[Magisk] LeMoise:
I still do not think it is working properly, for me at least. See screenshot below of androidfilehost with an ad while the adblock module is active. I've confirmed the root is working with root checkers and such.
[Magisk] guest4711:
Did you initialize the hostfile as described in post#1 ?

(Open a terminal window and type

su
hosts

and selecting a proper variant...)
[Magisk] shahfaishal:
I can't play video on fb lite app. I selected all letters in emulator app in the beginning.

Anyone tell me how to uninstall this app completely.
[Magisk] guest4711:
Simply disable or delete this module in MagiskManager - modules and reboot...
[Magisk] shahfaishal:
I did it but can't log in to fb app. The moment I press the login button it says no internet connection. I even dirty flash my rom and clear dalvic and art cache too. Still not helpful.
[Magisk] guest4711:
Then delete /system/etc/hosts or move it away...
[Magisk] shahfaishal:
No such folder named as hosts inside system.
[Magisk] guest4711:
Sorry, missing etc/: Then delete /system/etc/hosts or move it away
[Magisk] shahfaishal:
Can't delete. 'read only file system'.

But i solved the issue when i pause the adaway app (f-droid). Thanks for help.

NOTE: using these apps are a danger to life. Lol
[Magisk] guest4711:
You did not tell us that you installed two different apps which maintain the hostfile....
[Magisk] shahfaishal:
But adaway didn't cause any issue with video playing in fb lite. So I thought only unified ad app is the reason. But i guess both can be dangerous.
[Magisk] Zackptg5:
Adaway and unified hosts adblock both do the same thing: modify the hosts file. You either use one or the other cause they both overwrite the hosts file and so only one can be used at a time. Unified hosts adblock actually modifies /magisk/.core/hosts which is mounted to /system/etc/hosts while adaway modifed it directly.

Also, don't apply the social filter. It'll block social networks like Facebook
[Magisk] shahfaishal:
Okay after putting `su` and `hosts` command, i should put all alphabets only except `s` so that social site should be working? Is that all? Only 3 lines of command, ryt?
[Magisk] Zackptg5:
So for to apply all except social:

su -c hosts fgp
[Magisk] shahfaishal:
why -c?
[Magisk] jenslody:
Because that's the syntax for "su".

Without the "-c", "hosts" is taken as user-id "su" tries to switch to.

Everything after the "-c" is taken as command.