yashsingh1/xdaforums huggingface dataset:
[Magisk] stanlin salu:
See i have installed this Module & it was working fine for the past 2 days..

From today i noticed that its not blocking any ads??

So i ran the script again and did a reboot.. still are not blocked...

Its weired... Since the module is installed correctly...
[Magisk] guest4711:
- Have a look at /system/etc/hosts: More than 300 bytes? If not, systemless hosts activated in MagiskManager? (Re-enable it)

- Have a look at your APN settings: Is there any proxy defined? (delete proxy)

- Any VPN active? (deactivate it)

- Data compression enabled in chromium? (turn it off)
[Magisk] yo7fb:
In my case it was a proxy.

Tnx again for good tips.
[Magisk] dizM0nkey:
What is the first thing to do in troubleshooting when it appears ads are not blocked by this module? I'm not sure how to troubleshoot...

All other Magisk mods are working great, so don't think it's a Magisk install issue...

Help is appreciated!
[Magisk] guest4711:
See a few posts ago:

-Have a look at /system/etc/hosts: More than 300 bytes? If not, systemless hosts activated in MagiskManager? (Re-enable it)

- Did you download the hostfile (terminal: su -c host m)

- Have a look at your APN settings: Is there any proxy defined? (delete proxy)

- Any VPN active? (deactivate it)

- Data compression enabled in chromium? (turn it off)

Tldr; It is always a good idea to read the fine manual (rtfm) or the first posts of a thread...
[Magisk] madbat99:
Did you update the hosts and reboot?
[Magisk] dizM0nkey:
My hosts file is 0 bytes under /system/etc/hosts

I've used the APK (to do it via the app) and the command line via terminal ... what is "su -c host m" ... I used

su
hosts
m (it downloads from raw.githubuseraccount.com ... no error)
wr (results in bionic/libc/upstream-netbsd/lib/libc/regex/regerror.c:175: regerror: assertion "errbuf != NULL" failed Aborted)
q

No Proxy

No VPN

No Data Compression

Yes, updated the hosts, rebooted, still getting ads across apps and while browsing.

Thanks, guys.

diz
[Magisk] madbat99:
You have systemless host enabled in magisk? And you have your whitelist set up properly? Try without wr just to see if hosts apply
[Magisk] dizM0nkey:
Well, shoot... It definitely was my whitelist file. Had some comments (# comment comment comment) at the head of the file and that was causing the issue.

All ads now blocked after fixing. Thanks, all!
[Magisk] madbat99:
Right on. Glad you got it.
[Magisk] rabin69x:
It giving me a error in terminal. It says " Syntex error"

I toggle on systemless host too still giving me this

In unified host manager it showing me module not installed :rolleyes:

I'm using xiaomi redmi 4 prime

Anyone knows how to fix this?
[Magisk] rabin69x:
I add a screenshot with it
[Magisk] icysnowy:
Module is not installed in app and terminal show this, how to fix it?
[Magisk] Oxanp:
SOLVED!

The problem was "static busybox" module for Magisk. Removed and reinstalling solved the poblem.

Ty for support, sorry for late feedback.
[Magisk] wkwk:
Noticed that when I exit apps I still get an ad page. Is that normal?.
[Magisk] guest4711:
There is a fine FAQ regarding questions like "how to block some adds not blocked yes", " which adds can be blocked"...

If the adds are adressed using the IP address you have no chance to block these using AdAway or any other host file based blocker. Otherwise you can add the host to your blacklist. Use DNSlog feature of AdAway to get the hostnames in question.
[Magisk] smfarv:
Struggling to install this and hoping for some insight. I have magisk installed, enabled systemless hosts, and installed the module.

I've tried two ways to install:

1) the app, but just gives an " error " without installing.

2) through terminal with su hosts (seems like this may work as doesn't throw an error) but still experience ads.

Can someone help me understand if the installation process with the app requires terminal code as well? And if not, what might be triggering the error?
[Magisk] wkwk:
Try -> su -c hosts m

Then check etc/hosts file. Should have a bunch of hosts listed and not blank. This worked for me. Based on advice from poster on earlier page and instruction also provided by OP.
[Magisk] Mithias:
Anyone know of a way to get this updating using macrodroid? I can manually update the hosts file fine in my terminal emulator by doing:

su -c hosts m w

I'm trying to make it so I can schedule a shell script which macrodroid can do but can get it to find such first then run the above commands so I'm guessing it different from shell and terminal?
[Magisk] smfarv:
Tried this but getting a syntax error: 'in

When try the -c flag I get -c: not found

Tried two terminal emulators. Is it possible I'm in the wrong folder or haven't installed something prior to this?
[Magisk] puhu:
Latest version of your module making my phone bootloop. Im using Xiaomi Mi5 and Miuipro 8.2.1 ROM. If I make install your module its causing bootloop pls help me? [MENTION=6037748]Zackptg5[/MENTION]

MI 5 cihazımdan Tapatalk kullanılarak gönderildi
[Magisk] stanlin salu:
Any of you guys have issues with youtube app not recording the watch history?

---------- Post added at 08:09 PM ---------- Previous post was at 07:59 PM ----------

Nevermind figured it out...

Adding 0.0.0.0 s.youtube.com to the whitelist solves the issue ;)
[Magisk] Nevermindthelabel:
Yes, known result of applying adblock. Search thread for YouTube there are a few options for fixing the problem
[Magisk] Zackptg5:
Updated to v3.7. Fixes for EOL issues that broke script on many devices. Thanks to Simon Dellenbach @ github for the fix
[Magisk] AZImmortal:
Would you mind giving instructions on how to go about adding that to the whitelist? I created a file called "whitelist" in the root of the sdcard, and I added

0.0.0.0 s.youtube.com

to it. Afterwards, I went to terminal and ran

su
hosts
w
q

I rebooted and YouTube still doesn't add to my watch history. Is there something else that I should be doing?
[Magisk] stanlin salu:
I have created the file in the root of my internal storage, See make sure the file you created is not a text file.. it should be just a file.. now open the file using text editor and add the line to it, now open the host file app, and check the whitelist option and now click on 'Install/Update' option, then reboot..
[Magisk] AZImmortal:
I forgot that there was an app that I could use besides the terminal. Your comment also made me check my whitelist file and I realized that I accidentally had a space before the 0.0.0.0, so I removed the space and used the app to install/update, and now everything works. Thanks.
[Magisk] puhu:
3.7 version causing bootloop my Xiaomi Mi5 and Miuipro 8.2.1 ROM. Pls help me? What can i do? I tried go to fastboot mode than boot but I it didn't work for me? [MENTION=6037748]Zackptg5[/MENTION]

MI 5 cihazımdan Tapatalk kullanılarak gönderildi
[Magisk] Zackptg5:
Uninstall and reinstall magisk cause that has nothing to do with the mod but is a magisk issue
[Magisk] manlysixpacks:
My Mi4 works well with magisk 15.3,
[Magisk] abu barkat:
I want to unblock ads fram a specific website. Is that possible?
[Magisk] Zackptg5:
See whitelist instructions on op
[Magisk] lahceneamine:
I recently tried to install v3.7 on a brand new Galaxy S7 (Nougat) rooted with Magisk v16.

When it reboot, it get stuck on the splash screen (first screen) for about 30 seconds then goes back to recovery.

When I delete your module through TWRP the phone boots up normally.

Which file/log can I send you to help me ? thank you :)

Edit :

I've just seen your recommendation to boot first into download, gonna try it.
[Magisk] oroboros74:
Do most of you also have the other checkboxes selected (fakenews, social, porn, gambling)? Just wondering why they weren't selected by default.
[Magisk] Didgeridoohan:
Choices... Leave it up to the user what should be activated or not. Best approach in most cases (IMHO).

I only use the master option. Only interested in blocking ads.
[Magisk] zoel.fahmi:
I have a few questions

1. I have adaway app, should I remove the app?

2. Do I have to turn on systemless host to make this module work?
[Magisk] Didgeridoohan:
1. If you use this module you don't really need Adaway.

2. Yes.
[Magisk] zoel.fahmi:
Oh, I see.

Roger that, captain
[Magisk] jenslody:
You don't need to enable systemless host when you first use this module.

It creates the appropriate hosts file in the magisk .core-folder. And this automatically enables systemless host on next boot.
[Magisk] CCJ22:
What are you all using to close the space left by where the ads normally would show up?
[Magisk] guest4711:
In Firefox aka FennecDroid I use uBlock-origin. Blocking the hosts limits the bandwidth used while uBlock does the cosmetics...
[Magisk] Didgeridoohan:
I simply look at them and rejoice that there's no ad.
[Magisk] Neverendingxsin:
I do fakenews, porn, and gambling. Reason being is I tried to use social as well but it was causing issues with one of my social apps (cant remember which one).
[Magisk] diegoarevalo30:
It works very well from the super but I would like to be able to choose which applications to block ads and why not since I play an application and need ad
[Magisk] oroboros74:
Does blocking social also block Twitter website?
[Magisk] Didgeridoohan:
Whitelist whatever adress the app uses for it's ads.

This is from the social hosts file:

So, yes. I would say it does... :p
[Magisk] bammyman:
I have Magisk install on a Pixel

2xL and this module. How do I install the host file?
[Magisk] abacate123:
This module installs a companion app, which is the "Unified Hosts Manager.apk" (search for it on your app drawer, and it has a shield icon). You open it, give root access, apply and reboot afterwards. If you don't see the app, then something went wrong with your installation and you should try again, or reinstall magisk.
[Magisk] guest4711:
See the op:

--- snipp ---

Installation

Go to Settings in Magisk Manager and enable 'Systemless Hosts'

Flash module

Open terminal and type:

su
hosts

Then follow the prompts to install the host file of your choice.

OR

- Open terminal and type:

su -c hosts arg1 arg2 arg3

- The script will apply your arguments all at once and close. Useful for automation purposes

- For example: `su -c hosts m wr b`

- Script will apply the master filter, then your regex whitelist, then your blacklist

--- snapp ---

It's always a good idea to have a look at the first posts of a thread to know what a module or an apps can do for you and how to use it.

tldr: RTFM. :highfive:
[Magisk] yel@ch:
I've just did a complete cleaninstall on my OnePlus5 with Oxygen 5.04 (O) and Magisk16.

Addblocking from apps do not work (tapatalk and others) any idea?

Gesendet von meinem ONEPLUS A5000 mit Tapatalk
[Magisk] guest4711:
- Did you select and download a host file?

- Do you use a proxy (have a look into your apn settings)?

- Do you use a vpn?
[Magisk] mayank233:
Unified host adblock

I have installed latest magisk v 16 and trying to install unified adblock but module failed i also try with twrp but it show updater script error.
[Magisk] guest4711:
Works for me. Your recovery log would be fine to analyze the problem.
[Magisk] yel@ch:
Had that too... Just reinstall Magisk and reboot then it should work

Gesendet von meinem ONEPLUS A5000 mit Tapatalk

---------- Post added at 04:52 PM ---------- Previous post was at 04:50 PM ----------

yes. I also initiated it through terminal (su - hosts - and all options)

still seems not to work ( only google adlinks are not working)

Gesendet von meinem ONEPLUS A5000 mit Tapatalk
[Magisk] jjakajonas:
Okay.

I now got the host files to work.

Next up is the white list.

The thing is now that I have been searching the tread and also read the op...

How do I even create the file and edit it now that its a file with no file extension??
[Magisk] Didgeridoohan:
Any file explorer worth it's name can create an empty file with no file extension. I always use FX File Explorer.

When you have it created you can open it in a text editor, just like you would with any text file.
[Magisk] jjakajonas:
Okay.

I will give it a try.

Thanks for the help.
[Magisk] jjakajonas:
That did not work.

I made the file whit no file extension and made a few lines to test it.

And it can't find the list.
[Magisk] Didgeridoohan:
First, remove the asterisks at the beginning of each line.

Second, make sure that the file is placed directly in the root of your internal storage (/sdcard).
[Magisk] jjakajonas:
By asterisks do you, mean the *?

By move the file from external SD to internal storage did something in the right direction to work.

The last of it do still not work.

But will it work if I block social media and put the few once that I use in the whitelist file?

Because that's the last thing there won't work right now.
[Magisk] Didgeridoohan:
Yes, I mean the *.

I don't use the social filter myself, but that's how it should work. You might have to take a look in the hosts file (search for "# Facebook" and "# Instagram") to see what's actually being blocked and needs to be added to the whitelist.
[Magisk] jjakajonas:
Okay.

I will give it a in depths look a little later and return with my findings.

Thanks for the help.

Now I have to test me further to a end point to my likeings.

But the " *."webpage domain"."country code"* " will put a page on the whitelist and allow it even though it's blocked in the installed host file.

But I will return with my findings on a later point because lately I have been loseing the WiFi signal in the progress of installing the new host file...

A reboot will fix it. But I still need to find the reson for why it happens and fix it if I can.
[Magisk] guest4711:
Please name your file in lowercase letters ("whitelist", not " WHITELIST").
[Magisk] jjakajonas:
It is in lowercase as you can see on the last photo from the file manager.

The problem was the location. That one is fixed so it sees the file now.

The only part now I can't get to work is my lines in the file.

I have sat a host file to block social media and are making a list of the few once I use to allow them on the whitelist. But I can't get it to accept my lines from the file.
[Magisk] jjakajonas:
I have now been searching in the social host file and fund all the lines for twitter and Instagram witch I have copied in to my whitelist and activated the social host and my whitelist but I can't still not use twitter and Instagram.

As it looks now is it not passable to revoke specific lines in the host file with the help from the whitelist.

Or maybe I have made an error somewhere in my file.

Here is my whitelist file.

0.0.0.0 www.facebook.com

:: www.facebook.com

# Twitter

0.0.0.0 www.twitter.com

0.0.0.0 twitter.com

0.0.0.0 pbs.twimg.com

0.0.0.0 abs.twimg.com

0.0.0.0 syndication.twitter.com

0.0.0.0 0.twitter.com

0.0.0.0 about.twitter.com

0.0.0.0 access.twitter.com

0.0.0.0 api-test.twitter.com

0.0.0.0 api.twitter.com

0.0.0.0 api2.twitter.com

0.0.0.0 api4.twitter.com

0.0.0.0 apps.twitter.com

0.0.0.0 blog.twitter.com

0.0.0.0 brand.twitter.com

0.0.0.0 business.twitter.com

0.0.0.0 calendar.twitter.com

0.0.0.0 cards-dev.twitter.com

0.0.0.0 cards.twitter.com

0.0.0.0 content.twitter.com

0.0.0.0 dev-about.twitter.com

0.0.0.0 dev-blog.twitter.com

0.0.0.0 dev-brand.twitter.com

0.0.0.0 dev-business.twitter.com

0.0.0.0 dev-horizon.twitter.com

0.0.0.0 dev-jobs.twitter.com

0.0.0.0 dev-marketing.twitter.com

0.0.0.0 dev.twitter.com

0.0.0.0 download.twitter.com

0.0.0.0 election.twitter.com

0.0.0.0 eng.twitter.com

0.0.0.0 events.twitter.com

0.0.0.0 horizon.twitter.com

0.0.0.0 info.twitter.com

0.0.0.0 jobs.twitter.com

0.0.0.0 m.twitter.com

0.0.0.0 mail.twitter.com

0.0.0.0 marketing.twitter.com

0.0.0.0 mobile.twitter.com

0.0.0.0 mux.twitter.com

0.0.0.0 mx.twitter.com

0.0.0.0 mx1.twitter.com

0.0.0.0 mx2.twitter.com

0.0.0.0 mx3.twitter.com

0.0.0.0 mx4.twitter.com

0.0.0.0 pulse.twitter.com

0.0.0.0 s.twitter.com

0.0.0.0 search.twitter.com

0.0.0.0 search2.twitter.com

0.0.0.0 sites.twitter.com

0.0.0.0 sms.twitter.com

0.0.0.0 static.twitter.com

0.0.0.0 support.twitter.com

0.0.0.0 td.twitter.com

0.0.0.0 upload.twitter.com

0.0.0.0 video.twitter.com

0.0.0.0 www2.twitter.com

0.0.0.0 www4.twitter.com

# Instagram

0.0.0.0 scontent-ams3-1.cdninstagram.com

0.0.0.0 scontent-amt2-1.cdninstagram.com

0.0.0.0 scontent-arn2-1.cdninstagram.com

0.0.0.0 scontent-atl3-1.cdninstagram.com

0.0.0.0 scontent-dft4-1.cdninstagram.com

0.0.0.0 scontent-dft4-2.cdninstagram.com

0.0.0.0 scontent-fra3-1.cdninstagram.com

0.0.0.0 scontent-frt3-1.cdninstagram.com

0.0.0.0 scontent-kul1-1.cdninstagram.com

0.0.0.0 scontent-mia1-1.cdninstagram.com

0.0.0.0 scontent-ort2-1.cdninstagram.com

0.0.0.0 scontent-ort2-2.cdninstagram.com

0.0.0.0 scontent-sea1-1.cdninstagram.com

0.0.0.0 scontent-sit4-1.cdninstagram.com

0.0.0.0 scontent-sjc2-1.cdninstagram.com

0.0.0.0 scontent-syd2-1.cdninstagram.com

All the lines (except the 2 facebook lines) are an exact copy from the social host file that I want to revoke to allow Insted of block them.
[Magisk] Didgeridoohan:
And after applying the whitelist file (either in terminal or the app) do you see any difference in /system/etc/hosts or /sbin/.core/img/.core/hosts (as in: are the relevant lines removed)?

Edit: I use the whitelist function without issue.
[Magisk] jjakajonas:
The app I use can't show the full host file.

And just to test it to answer your question I cleared the host file back to stock aka empty and only activated the social function and the whitelist and with only those 2 settings the host file get too long to I can check if it apply the whitelist.
[Magisk] Didgeridoohan:
Then you look for an app that can...

Example:

https://play.google.com/store/apps/details?id=jp.sblo.pandora.jota.plus
[Magisk] jjakajonas:
That one don't seem to find the host file.
[Magisk] Didgeridoohan:
It can, but you probably have to use a file explorer to navigate to the hosts file and then from there open it with Jota+. If you want a different app, just do a web search for Android apps that can edit large text files.

That was the last of my spoon feeding for today. :laugh: I'm off to bed...
[Magisk] jjakajonas:
I got it open now and there's no sign of the lines from the whitelist.

Both with or without the social setting.

But all the lines from the host files got added to the big host file if activated in the app.

Also if I make a blacklist file does it not get in to the host file and I can still open the page that I blacklisted in the file.

--------------UPDATE-------------

Out of nowhere do my blacklist now work but my whitelist are still not working...
[Magisk] urbanboymne:
Afther reflashing Magisk v16 (because one module chause my phone to stay in boot-loop) this modele dosent want to work anymore... Only says Error. Any help? Did i set something wrong in Magisk settings?

I delete AdAway but dosent help, rebnot phone, wipe cache/dalvik...
[Magisk] urbanboymne:
When i open AdBlocker says is not Installed...
[Magisk] jjakajonas:
Okay.

I now tryed to deactivate the whitelist and activate social media host and went in to the host file to get all the lines for the apps I use (facebook, twitter and Instagram) then I mad a exact copy of all those lines and listed them in my whitelist, activated it again, rebooted my device and still no luck in success to use those 3 apps whit the rest blocked...
[Magisk] jjakajonas:
I fund my error in my whitelist (or at least I think I did)

When I made the copy / past move from host file to whitelist file it was all in one line.

After separation to lines I forgot to check if the lines was valid as explain in this tread.

They was not valid. In the end of every line was there a space.

After removing the space of the end of every line I now can see the lines disappear in my host file for every test save I make.

And already now can I use twitter with the social media host enabled.

Now the next part is to be done with the facebook portion of the lines and maybe do some clean up in the lines so facebook, instagram and WhatsApp have there own part and see if there's some lines I can remove from my list so the adblock part still works and only the essentials of social media works ?
[Magisk] rabin69x:
Not working on my device xiaomi redmi 4 prime
[Magisk] litemaster:
Can you check with the latest version (3.7)?

This bug should be fixed since then.
[Magisk] songokujames:
I have failed safetynet after install this module. After I disable it, I can pass again safetynet. Do you guy have this problem?
[Magisk] LithiumAce:
For me it work's fine.

Verstuurd vanaf mijn ONEPLUS A5000 met Tapatalk
[Magisk] jed84:
Could you please let me know if there any advantages of using AdAway now?

I switched to Unified Hosts Adblocker awhile ago as thought that AdAway was a bit an abandoned project.

What's best solution for ad-blocking in your opinion?
[Magisk] Didgeridoohan:
Both Unified Hosts Adblocker and AdAway do the same thing. Modifies the hosts file. Personally I prefer the Magisk module. And it can easily be automated by using arguments (see tree OP).
[Magisk] oroboros74:
I'm wondering the same although I've been using Adaway 3.3 which seems to work fine. It seems to do more updates (UHA only has manual ones?), and UI is a little more friendly, but I'm curious what others are doing.
[Magisk] guest4711:
AdAway still has some advantages:

- It eliminates duplicate host entries. So I can use multiple sources for better filtering without loose of performance or memory.

- It (optionaly) redirects requests to its local server. So no waiting for timeouts.

- It has good diagnostic tools included to optimize the black- and whitelists (dnslog).
[Magisk] Zackptg5:
Unified hosts in their nature have no duplicate entries, they're well maintained lists. It uses 0.0.0.0 which doesn't have much of any time out either. The original source page for unified hosts explains is all in detail: https://github.com/StevenBlack/hosts/blob/master/readme.md

The adaway app though has lots of nice features like the tcpdump tool though so you could use the adaway app with unified hosts by copying the URL of the raw hosts file (just get the URL from the hosts scripts). Just note that the unified hosts files already contain adaway sources
[Magisk] lfom:
Hello. Thanks for this nice module, it works really fine and I love it. Can I suggest to link in the OP to old versions? I had a problem with upgrading Magisk and I cannot upgrade to versions past v14.0 and I have to reinstall the module but the current one does not support Magisk < 15.0.

Thank you!
[Magisk] Antonito19_:
I'm following the steps for whitelist and doesn't work for me. Can anyone help me?

Enviado desde mi Mi A1 mediante Tapatalk
[Magisk] dgml14:
What happens if I don't have an sdcard and want to use whitelist?
[Magisk] Didgeridoohan:
Not unless you give more details as to what you've done, your expected outcome and actual result.

Sdcard does not mean an external memory card. It's the internal storage on Android
[Magisk] TCoreXxx:
Generally error

Hello, as you can see in the pictures, it works for your app, but it blocks those pages The question is why the configuration does not work in the terminal, see photos, so that reliably blocks Have already uninstalled and reinstalled, but no success.Ask for yours Use Magisk 6.2
[Magisk] spectkiller:
hey [MENTION=6037748]Zackptg5[/MENTION] i got too much battery drain from unified adblock ??

And please i am unable to whitelist anything ,,, can anuybody please elaborate it step by step plz?
[Magisk] Didgeridoohan:
What do you mean "it works for your app"? The app screenshot clearly shows "Error"...

From the terminal screenshot, it looks like your Magisk image is read-only. What's the output of this command:

mount | grep /sbin/.core/img

The steps to whitelist are quite simple and are outlined in the OP. What have you tried, and what is it that doesn't work?
[Magisk] spectkiller:
I make blank folder named as whitelist but unable to add lines .... i'm confuse is line should be add as text form ??:confused:
[Magisk] Didgeridoohan:
From the instructions in the OP:
[Magisk] spectkiller:
so i have to create text file in sdcard?