yashsingh1/xdaforums huggingface dataset:
[Magisk] vswami22@gmail.com:
working good but please add elements hiding rule

every page left blank spaces

or move to adguard filters for better adblocking
[Magisk] LeMoise:
I am embarrassed by how long it took me to figure out how to do that. I assumed it was like Adaway where it just starts working on a base level and those terminal commands were for high level customization. Then I tried running the commands in windows CMD while my phone was connected and then I realized I needed a terminal on my phone :eek:

I enabled fgps, if I need to disable social in the future do i just rerun that command or do I need to uninstall/reinstall the module?

Appreciate the help and patience friend.
[Magisk] Zackptg5:
Just rerun the command a it'll overwrite the hosts file with the new stuff
[Magisk] CCJ22:
Can you say this in English please. Perhaps with punctuation so I may understand and provide assistance to you.
[Magisk] Didgeridoohan:
This is just a simple hosts file updater. Nothing else... If you want more you need to combine with/use other tools.

[MENTION=4130380]CCJ22[/MENTION] No need to be condescending... It wasn't that hard to understand.
[Magisk] guest4711:
You may try AdAway. Activate the webserver there... See AdAway (Block advertisements) - https://f-droid.org/app/org.adaway
[Magisk] rohitdave:
Well said
[Magisk] vswami22@gmail.com:
Use google translate

don't post useless quotes ?
[Magisk] sangalaviral:
Is this module able to block in-app adverts like minminguard blocks?
[Magisk] Phantom Thief:
Stupid question but.. How do i even find the terminal in magisk? Can't find much
[Magisk] Nevermindthelabel:
It blocks some in-app ads

---------- Post added at 03:40 PM ---------- Previous post was at 03:39 PM ----------

You need to download one from the Play Store
[Magisk] sangalaviral:
Does this block for tapatalk?
[Magisk] guest4711:
You may have to activate it in developer's option of your ROM. If it is not included you should download one. I use Terminal-Emulator for Android (Zugang zur systemeigenen Linux-Kommandozeilen-Shell in Android) - https://f-droid.org/app/jackpal.androidterm
[Magisk] onlybob:
For the white list feature:

The OP instructions are incorrect. The program is expecting a file, not a text file. Location is correct but his instructions suggest to use whitelist.txt, not whitelist as a file with no extension. Use the file with no extension and you will be good to go.
[Magisk] Zackptg5:
Guess the instructions weren't clear enough. OP states file should be named without the extension but lots of file managers will add it on if making a text file anyways. Updated op to say make empty file so it'd be a little clearer. Thanks!
[Magisk] guest4711:
The instructions are correct for me. I'm told to create a plain textfile "whitelist", not a database. And not "whitelist.txt". (On DOS and Windows there are extensions to indicate the type of file, but it's use is not mandatory.) But a textfile keeps being a textfile, whether you call it "name.db4", "name", "name.txt", "name.text", "name.doc" or anything else...
[Magisk] onlybob:
Huh, I didn't see the note regarding not placing an extension...if I did miss that then I blame my profession as I read datasheets nearly everyday and developed a nasty habit of not reading anything in a linear fashion, lmao. Regardless ty for the mod and I appreciate your time put into it.
[Magisk] Dylansama:
Are there some other notes for using the whitelist feature? The instructions seemed fairly simple but none of the domains are being removed from my hosts file.

Image attached with all the commands I'm running plus examining the hosts file after. This should be pretty basic, correct? Just allow streamate.com and all subdomains.

http i64.tinypic.com/2uizm2b.jpg

*Can't post direct links yet.
[Magisk] kep2008:
Xiaomi mi a1, android 7.1.2. If I use wi-fi, there's no advertising in Chrome, if I include mobile data, ads appear. Can anyone know how to fix it?
[Magisk] oTeMpLo:
Disable proxy in apn settings
[Magisk] esbatulembek:
Why i keep getting this message even though i already restart the phone?
[Magisk] jenslody:
Which version of Magisk do you use ?

Does the module work in general, e.g. do you have the "hosts" command in a terminal (as root) or via "adb shell" (also as root) ?
[Magisk] esbatulembek:
14

Yes everything works except this

No it doesn't work i wonder why

Edit: it's fine now i just have to reinstall the module
[Magisk] kaihansen2001:
I must be kind of retard because I cannot make whitelist to work. Can anyone share a sample file of how it is composed please? Thanks.
[Magisk] Zackptg5:
v3.1 has been released. See OP for changelog (bug fixes)
[Magisk] fusk:
I can't get the module to work, download, installs and activates fine. But doesn't actually do anything. Not sure if this is magisk or the module, so i reported the issue in the magisk thread. Used both 14 and 14.3.
[Magisk] Zackptg5:
Did you apply a filter? Instructions on OP.

XDA is a good site to test ironically
[Magisk] Dylansama:
Ain't that the truth :D

Could you check my post a page back or so? Please see the image link at bottom of that post.

I'm just trying to use the regex whitelist... but I'm not seeing what I'm missing.

streamate\.com
.*\.streamate\.com

Are both absolutely valid regex'es last I checked. Yet they are matching nothing when I check /etc/hosts.

Just updated to 3.1 and it's the same.
[Magisk] fusk:
I installed and rebooted the phone, it didn't ask me to apply anything so i just assumed it was working. But i just had a look at the OP and saw that installing the module isn't enough, you have to do some cmd line as well. In magisk i just read the description and hit install.
[Magisk] Zackptg5:
I'll add some examples to the OP cause it is confusing. For regex, you don't need the backslashes. Also, 0.0.0.0 needs to precede every entry or just use wildcard:

.*streamate.com

Not sure the full domains your trying to unblock but if you want all streamate domains unblocked:

.*streamate.*
[Magisk] Dylansama:
Oh that's exactly what it was. I was only thinking about matching the domain, not a line in the hosts file.

Also is there a list of any regex stuff that isn't supported? I noticed that simple things like ? and + quantifiers didn't seem to work.
[Magisk] Zackptg5:
The script just uses grep regex. So whatever is supported with Android grep works with it
[Magisk] Kevin Fung:
After using this module, my facebook messenger app couldn't connect to the internet.

(which showing cannot connect to the internet, tell you to check your internet problem)

fix: just open your terminal and refresh your hosts again, but you shouldn't apply 's' which would block your messenger.

su
hosts
mfgp
q
[Magisk] guest4711:
The "s" stands for blocking social networks. So if you want to use them, don't block them... (But for those not using them it is good to block them. Otherwise facebook and Co will be notified about most sites you visit because the icon and some scripts are loaded from their servers...)
[Magisk] Kevin Fung:
Well I do misunderstanding the meaning.

I thought it was mean to block the ad about social media apps.(e.g. tumblr
[Magisk] LotosHans:
Tried to install the Module in Magisk and it just said "failed".

Flashing it in Recovery gives me "Error 255"

Any idea of what's going wrong?

HTC 10 running Oreo, Buysbox is installed...
[Magisk] Didgeridoohan:
Logs dude... Logs. A recovery log saved after flashing would show what that error is actually about.
[Magisk] LotosHans:
Oh i'm sorry I forgot them.

Logs are now attached, thanks for your help!

Edit: I downloaded and installed it now with the built-in Magisk "store" and it's working. Not sure what the problem was, I downloaded it twice from your link so a corrupt file is not really possible...
[Magisk] mm1rza:
it's basically same app with adaway?
[Magisk] guest4711:
The basic functionality is the same: Replacing the default host file with a blacklist.

But the implementation is different. And AdAway has a few advantages: It has an GUI, it can automatically update the blacklist if the source files are modified, it can merge several sources, it has a webserver answering to blocked (aka redirected) requests, it has an integrated scanner for maleware.
[Magisk] nvlinh.kaitoukid:
Help me Error"No Whitelist Detected"
[Magisk] guest4711:
If you want to whitelist or blacklist some hosts, follow the instructions in first post:

Whitelist Instructions:

Create an empty file on sdcard card called "whitelist"
means "/sdcard/whitelist"

Either add exact lines you want remove to it -> Run hosts script and choose whitelist option

For example:

0.0.0.0 facebook.com

Will unblock facebook.com

Or add regex for lines you want removed -> Run hosts script and choose whitelist regex option

For example:

.*facebook.*

Will unblock all domains with "facebook" in them

Blacklist Instructions:

Create an empty file on sdcard card called "blacklist"
means "/sdcard/blacklist"

Add exact lines you want to remove it (do not include the 0.0.0.0 -> so for example: "facebook.com")

Run hosts script and choose blacklist option

For example:

google-analytics.com

Will block the google-analytics.com domain (it will add the entry "0.0.0.0 google-analytics.com" to the hosts file - note the lack of the 0's here. The script takes care of it automatically for the blacklist feature)
[Magisk] R324D:
Just a few questions..

So if I applied options "fgps", it should blocked facebook.com, right? So, adding line on whitelist with "0.0.0.0 *facebook.com*", and applied the whitelist, it should unblock facebook.com, so I can still access the Facebook.

But I don't quite understand with the blacklist. Why should we need blacklist if it's already blocked by applying "fgps".

Btw, thanks for your quick explanation, you save my time.

TIA
[Magisk] guest4711:
Yes, but it could be better to use the regular expression *. facebook.com

If you want to block individual hosts not in the predefined list you could do so by creating a personal blacklist which will be merged in.
[Magisk] nvlinh.kaitoukid:
Bro i called whitelist sdcard/whitelist.txt
[Magisk] Didgeridoohan:
And there's your problem... The OP states:

Not ".txt" extension.
[Magisk] YakuzaNeko:
I've downloaded Renovate Ice rom, latest for my s8+

When trying to install the dual speaker mod through magisk, I'm getting notified that it's failed and there's an installation error.

I need to install Magisk V13.1+! and also /data/magisk isn't set up properly.

I am running Magisk 14.3

I have latest magisk manager

I have busybox

please help
[Magisk] Zackptg5:
On the wrong thread :)

That mod needs updated to the latest magisk template
[Magisk] danthecoolboy:
What happens if you do everything yet forget to tick the 'enable systemless hosts' in magisk?
[Magisk] Zackptg5:
I've never actually tried it to be honest with you but my guess would be that nothing would happen since enabling that is what signals magisk to mount the /magisk/.core/hosts file to /system/etc/hosts. So if it's not ticked, the .core/hosts file won't be mounted and so nothing will happen. Or, since that option isn't ticked, the .core/hosts file may never have been created in the first place and in that case, they script will exit with a message saying that
[Magisk] onliner:
The option is activated automatically when the hosts are applied.
[Magisk] jenslody:
If the "[MAGISK_MOUNTPOINT]/.core/hosts" exists, the switch will automatically be enabled at next boot.

On the other hand, if you explicitely disable the switch, "[MAGISK_MOUNTPOINT]/.core/hosts" will be unmounted and deleted immediately.

In any case you have to reboot to be sure that the new (or old/restored) hosts file is used by the system.
[Magisk] Dorisnov:
I don't know if someone has the same problem, but some in app ads that usually were blocked now are not. Any idea?
[Magisk] sxHeavy:
Is everything up to date? I personally use the Play Store App "Unified Host Adblocker" to see if hosts got updates.
[Magisk] Dorisnov:
My hosts are up to date. Also thanks, I got that app.
[Magisk] Neverendingxsin:
Just came here to say it's really nice to have an adblock that doesn't block the redirect links on slickdeals.
[Magisk] nvlinh.kaitoukid:
It does not work
[Magisk] guest4711:
Did you reboot after applying your blacklist?
[Magisk] Dorisnov:
Can't make the module work. Marked the 'Systemless hosts', installed the module from Downloads in Magisk Manager (can't install from recovery, error 255), reboot, applied the hosts and rebooted again. Still having adds everywhere.

Tryed also adaway and doesn't work. I'll try to reinstall the ROM.
[Magisk] guest4711:
Do you get the adds on WiFi and on mobile data?

If you get them only when on mobile data you probably use a proxy defined by your carrier. See the APN settings.

If not there's possible a vpn running so the host file is ignored. Or an "optimizing feature" for speed or data usage is routing all requests...
[Magisk] Dorisnov:
This problem started suddenly. I think is related to the latest Magisk Beta, because it happens since I updated to 14.5 (even if I went back to stable 14.0). I'll go back to a previous twrp backup and check.

Any idea for the 255 error installing from ZIP but no error installing from Magisk Manager?

Thanks you!
[Magisk] Didgeridoohan:
No-one will know unless you provide the recovery log from the failed installation.

Edit: and preferably also the log from the Manager installation (you can save an installation log right after installing).
[Magisk] nvlinh.kaitoukid:
Yes reboot
[Magisk] Dorisnov:
Sorry, you're right. Here are the logs.
[Magisk] sic0048:
I seem to have some slickdeal redirect links blocked. Can you tell me what you are doing to make it work?

First, I'm using the SD apps. Second, not all links in the app are redirects, and so some links work but it seems some of the redirect links do not. Third, I have whitelisted "0.0.0.0 slickdeals.net" and I am blocking master, fakenews, gambling and porn sites.

Are you having to whitelist every redirect link that slickdeals uses? Here are some redirect links that don't work for me...... go.redirectingat.com, ojrq.net,

Thanks!
[Magisk] Dorisnov:
Well, I just installed everything in my device from zero and now everything works great but the Unified Hosts Adblock. Now I have 3 scenarios:

1. Adds load normally:
[Magisk] sic0048:
Did you use the terminal commands to set the ad blocking choices? That is commonly skipped. In other words, simply loading the module in Magisk isn't enough. You need to use a terminal emulator and enter a few commands for it to work. See post #1 for more details. Even if you have done this, I would do it again and then reboot. Make sure the host lists are downloaded and applied when you run your choice in the terminal program. If you don't see it working, double check for an error. The most common error is placing spaces between the selections.

(Sorry if this is too basic, but we should start at the beginning....)
[Magisk] Dorisnov:
I set the blocking categories using a terminal. It installed well (even is blocking some adds). Maybe its related to the 255 error while installing from TWRP (post #771, I have an error while installing from recovery. No error from MagiskManager).

Can anyone try to install MangaDLR from the XDA app and try?
[Magisk] Neverendingxsin:
I only applied master, fakenews, gambling, and porn. So far have had no issues but only briefly tested it out, will test more and see if it did infact miss something :)
[Magisk] Neverendingxsin:
I spoke too soon with my latest reply, how would one go about whitelisting all the redirect links on Slickdeals?

Specifically in the Slickdeals app.
[Magisk] Sivaadithya:
I am newbie here. Can anyone tell. How to add whitelist to these program
[Magisk] Didgeridoohan:
The instructions in the OP are pretty clear... How about you tell us what's causing you issues instead?
[Magisk] R324D:
I think whitelist isn't working here, apkmirror still detect that I'm still using an adblocker. I also attached my whitelist.

I'm using

su -c hosts fgp wr

To apply.

Any idea?

EDIT: here are my whitelist

0.0.0.0 *.apkmirror.com
[Magisk] osm0sis:
It's all busyboxes ever, actually. On Android the default nameserver is set to (null) localhost 127.0.0.1, (see `nslookup www.google.com`), and there is often no /system/etc/resolv.conf to override this so all dns resolver functions are broken.

The workaround options are to use IPs only, or add /system/etc/resolv.conf containing at least "nameserver 8.8.8.8" (Google's own) to override localhost.

I'll look into a patch to default to 8.8.8.8 instead of 127.0.0.1, but it's from the toolchain's _res (resolv) functionality so I'm not sure how far I can get trying to override that.
[Magisk] II_DiE_4:
Good catch.. Working with IPS. Tried to change the nameserver but still doesn't work. Hm..

Edit OK. Seems like I made a mistake(typo) to DNS. Its working now with Google's one
[Magisk] osm0sis:
My NDK builds (patched with dietlibc's resolver) seem to default to 127.0.0.1 if __BIONIC__ isn't defined; I'm not sure why it's not defined since the NDK toolchain should do that, but I'll attempt a new compile with that explicitly set and see what happens. Might be able to set the default there too if that doesn't work.

uClibc toolchain busybox compiles have it default to 0.0.0.0 and that's buried in the toolchain, most likely in libc/inet/resolv.c.
[Magisk] Zackptg5:
The wget included in my rom (BusyBox v1.22.1) doesn't work with my hosts script. It says invalid http or ftp address so I'm assuming it isn't https compatible. I'm afraid to update BusyBox cause I don't know if it'll break safety net.

The wget I included with the module was also part of laprasofdongle's original one so I have no idea where it came from. All I know is that everything works with it [MENTION=4544860]osm0sis[/MENTION]

Would it be beneficial to switch to using curl? Also, shouldn't any file in bin supercede one in xbin?
[Magisk] osm0sis:
Busybox shouldn't break SafetyNet, not if it's already there and doesn't seem to affect anything.

A dynamically linked NDK busybox (I grabbed the one from my hammerhead recovery.img) seems to work properly. Shows 0.0.0.0 in nslookup yet still seems to resolve fine.

Not sure if curl would make any difference. And yes, bin is higher in the path than xbin.
[Magisk] Zackptg5:
The hosts and wget files are actually located in magisk/unifiedhostsadblock and are remounted at boot. I've never had issues with the wget included with the module
[Magisk] sakun-ice:
Error?
[Magisk] Didgeridoohan:
This has been discussed repeatedly throughout the later parts of this thread. Read...
[Magisk] Zackptg5:
version 1.8 released! See OP for changelog. Autoupdate is still WIP (turns out to be much more difficult than I imagined and wget issue is still being looked into)

Also, this is now on the magisk repo! You can now just download/install it through magisk manager
[Magisk] ahrion:
Pixel support is actually much more difficult then I thought it would be. I'm currently working with someone else to see what exactly I can do. So far I got it to detect pixel properly, but since magisk doesn't officially support pixel it is causing bootloops. So now I have to find a workaround for detecting + file placement (for magisk only because system should already work).

As always, will keep you posted.
[Magisk] Zackptg5:
[MENTION=732716]II_DiE_4[/MENTION] [MENTION=7341180]ztv--[/MENTION] [MENTION=4945380]sakun-ice[/MENTION] and any other users having issues with wget:

Can you try this one which uses curl?

Nevermind. There are other issues with curl that showed up. It's easier just to stick with wget. Note that I include wget in this module (mounted to /system/bin) so there's no need to install wget through a busybox package
[Magisk] II_DiE_4:
Works just tried. The one with curl
[Magisk] Zackptg5:
Ya, I'm scratching it though (you can keep using it if you want). I found that it was architecture dependent (the wget included originally appeared to not be). I found both arm64 and arm ones but only the arm64 one worked
[Magisk] II_DiE_4:
Hm... Are you talking about curl? Cause I'm using Nexus 6 which is 32bit and worked just fine.
[Magisk] Zackptg5:
Ya. Weird, I got a weird error on my g2. The big issue with it though is the architecture dependent part. Any part of BusyBox (like wget) should be architecture independent and so will work on any device
[Magisk] UtsavNS:
Blocking Social (s)

Blocking 'master+social' breaks Facebook and it is unable to load feed and log in. Other social media like Snapchat and Instagram work fine. Tested on Oneplus 3T running TWRP on stock OOS 4.1.1.
[Magisk] rignfool:
I just have to say Duh!

Block social...

Hmmmmmmm
[Magisk] Kapil Tapsi:
Does it work. I am using Zenfone 2 and followed every step. but it stuck at boot logo. Am I missing something.
[Magisk] Zackptg5:
It should be

.*apkmirror.com
[Magisk] HamsterHam:
I'm doing exactly what OP says but applying whitelist allows all ads. Any idea what I'm doing wrong?

I'm applying wr after m with this whitelist file.
[Magisk] guest4711:
Try *.apkmirror.com

(exchange the positions of star and dot)
[Magisk] HamsterHam:
Tried that just now. All ads are unblocked.
[Magisk] guest4711:
Take a look onto your host file (/system/etc/hosts). Are there hundreds of entries?

If not, there is no blocking active. Try again using

su -c hosts m wr

If yes, there is some proxy or dns optimizer active which does not use your host file...
[Magisk] HamsterHam:
That's not the correct location it's /magisk/.core but yes I've checked and it's blank.

Hmm.
[Magisk] guest4711:
And /magisk/.core/hosts should be mounted as /system/etc/hosts ...

But if it is blank your download did not work. Do you use a firewall like afwall+ and did not allow terminal to access internet?
[Magisk] HamsterHam:
It's fine without applying whitelist.
[Magisk] HamsterHam:
You can see file size without and with applying whitelist.
[Magisk] guest4711:
Did you try using

su -c hosts m wr

(all in one step)?
[Magisk] HamsterHam:
Yes, it clears the host file list for some reason.
[Magisk] guest4711:
So there is an error in your whitelist.. Try with one simple entry like

apkmirror.com

. If that works try

*apkmirror.com
[Magisk] Zackptg5:
That's cause this is the proper syntax:

.*apkmirror.com

Not this:

*.apkmirror.com

The wildcard character matches any number of the previous character (the dot signifies any character). Most websites have more than a single domain that would need whitelisting. To find all of these, use adaway's log DNS requests feature (it's in the 3 dot menu)
[Magisk] HamsterHam:
I tried that syntax (see above) and same issue. If I used adaway I wouldn't even bother with this module. Was trying to use one less app.

Someone share me their whitelist file. I can test it.
[Magisk] HamsterHam:
Ah so I've realised I'm using v3.0. I can't install 3.1 as it fails.
[Magisk] Zackptg5:
Woah. That's some weird stuff. Did you try redownloading it?
[Magisk] HamsterHam:
Yes loads.
[Magisk] Zackptg5:
Is this in magisk manager or TWRP? Try TWRP if you haven't already
[Magisk] HamsterHam:
Tried both ways. Doesn't work. I can install 3.0 fine just not 3.1.
[Magisk] Zackptg5:
What version of magisk are you on?
[Magisk] HamsterHam:
14.5.2.
[Magisk] Zackptg5:
Hmm, thats v1456 right? I haven't tested any non official releases/support them. Do you have a /data/magisk/util_functions.sh? This module pretty much follows the magisk module template so the kind of errors in your log would be something with magisk itself
[Magisk] HamsterHam:
Yeah I've got util_functions.sh. well 1456 is v14.5. My other modules work on 14.5.2. I'll quickly flash 14.5 and test.
[Magisk] Zackptg5:
V1456 should work, I mean anything newer. Can you try it TWRP and attach the full recovery log from it?
[Magisk] HamsterHam:
No joy on 1456.
[Magisk] Zackptg5:
Did you get the zip from magisk manager or the OP?
[Magisk] HamsterHam:
OP but I tried from magisk manager. Same outcome.
[Magisk] Mike Foxtrot:
Guys whenever I try to update host eg. by putting f for fakenews or g for gambling I get this line in the terminal

/magical/ .core/hosts: No such file or directory

What is it that I'm doing wrong

Magical v 14.0 , magisk manager v5.4.3, Android Oreo (nitrogen is) Kenzo

Any help would be appreciated