yashsingh1/xdaforums huggingface dataset:
[Magisk] Zackptg5:
Can you post adb logcat of boot process? Before the stuff below? Thanks

Just remove the module in TWRP if yo think that's the cause. Either flash magisk mount zip and delete it in TWRP file manager, or flash magisk uninstaller, then reflashing magisk.
[Magisk] daddylonglegs:
I never used LogCat, how do I do that considering I can't boot to the app store?

I am 1000% sure it is this module because literally 4 minutes before it I had rebooted after installing the Youtube BackGround Playback module and my phone booted fine. After I flashed Unified Hosts Adblocker I restarted and my phone no longer boots.

Also how do I remove just the module in TWRP? Just find the zip file and delete it? Because I tried that and my phone still won't boot.
[Magisk] Zackptg5:
Follow the guide here: https://xdaforums.com/showthread.php?t=1726238

YouTube background playback module? Are you using Xposed?

Flash the magisk mount zip here: https://xdaforums.com/apps/magisk/collection-magisk-modules-t3445257

Then go to advanced -> file manager

Navigate to /magisk and delete the unifiedhostsadblock folder. This will remove the module (all of this is done in TWRP)
[Magisk] daddylonglegs:
I installed the magisk mount zip, rebooted into recovery, deleted the Unified Hosts Adblocker.zip, rebooted, and now I can't even get into recovery.

No, I am not using Xposed (it doesn't work on Nougat)

Edit: the only way I was finally able to get my phone to boot was getting into recovery via a .img, then reinstalling my recovery again, then deleting magisk.img, then reinstalling magisk from the recovery.
[Magisk] mrjayviper:
How do I install this module? Flash the zip via recovery?

Also, the instructions mentioned "terminal". Which one? Something like juicessh? Thanks
[Magisk] Didgeridoohan:
Install from the Magisk Manager, under Downloads. This terminal emulator works nice: https://play.google.com/store/apps/details?id=jackpal.androidterm

Edit: You can also flash in recovery, if you want.
[Magisk] Zackptg5:
Sounds like it was a magisk bug then. In terms of system modification, all this module does is add a file to system bin so it's unlikely to cause any problems. All other changes it makes are to the magisk IMG which is part of data partition
[Magisk] abhipanthi:
Sir will this module work with SuperSU? [MENTION=6037748]Zackptg5[/MENTION]
[Magisk] Zackptg5:
It's a magisk only module. If you use supersu with magisk, it should work but I've never tested it. Try it and let me know :)
[Magisk] abhipanthi:
Will do :)
[Magisk] lRagde:
I can not get the whitelist working

My device does not have support for sd and putting it in the internal memory does not work for me.
[Magisk] Mao04:
Make sure it's named "whitelist", not "wishlist.txt".
[Magisk] lRagde:
Problem solved thanks!
[Magisk] RijuSarkar:
I tried this module...this module blocks the entire website...I give command in terminal emulator for social...then facebook is not opening at all...I also gave command to porn...then pornhub is not opening...so..is it blocks ads or the entire website?
[Magisk] Didgeridoohan:
If you add the social option, social media websites won't work... If you add the porn option, porn website won't work....

If you just want to block ads, use the master (m) option.
[Magisk] RijuSarkar:
[/COLOR]

master option is taking care automaticvally..........didnt it?
[Magisk] Didgeridoohan:
Master is included in all the other options, but it's not applied automatically by just installing the module. If you only want adblocking you'll still have to run hosts and choose "m".
[Magisk] RijuSarkar:
Suppose I want to block porn...gambling..and adware and malware from every website...what will be the command...

Is it pg only...???

Because I tried with mpg and it said invalid
[Magisk] Zackptg5:
It's be 'pg' since malware is already included in it
[Magisk] RijuSarkar:
Undoubtedly the module is awesome...but I have two questions..

a)how to update the module??

b)suppose I enabled the system less hosts in Magisk settings..if i disable it then the ad blocking will not happen..so far so good...then if I reenable it then also ad blocking is not taking place. ..

c)some ads in the apps like showbox or terranium tv is still there (screenshot below)
[Magisk] Didgeridoohan:
If you disable and reenable systemless hosts in Magisk you'll have to run the hosts command in terminal again.

Many ads in apps can't be removed with a hosts based adblocker.
[Magisk] k2828:
done. still doent work. i just want to FB :((((((((((

does disabling works for you?
[Magisk] Zackptg5:
Facebook works fine for me. Just don't use the social filter. Rerun the hosts script and choose something that doesn't use the social filter. The old hosts file will be overwritten and you can use Facebook again
[Magisk] k2828:
Guys my withlist does still not work and i cant figure out why. here is what i do:

-i go to my internal sd.

-create a file call "whitelist"

-i enter line by line which website i do not want to be blocked.

my withelist

-i save this

-i open terminal

-enter "su"

-enter "hosts"

-enter "w"(whitelist gets applied)

-enter "q"

still the whitelist does not work.....where is my error?
[Magisk] davidcd13:
If I install on magisk v13 beta, safetynet check fail. No problem with V12.
[Magisk] Zackptg5:
There's been an update to safetynet that will cause it to fail if a module mount anything to system is installed (like this one). Topjohnwu is working on a fix
[Magisk] davidcd13:
OK thank you
[Magisk] Zackptg5:
As a workaround for now, with any root file manager:

Navigate to /magisk/unifiedhostsadblock

Delete the auto_mount file

This will prevent automounting of the hosts script file in system/bin. Assuming you don't have any other modules that are mounting files, you'll pass safetynet for the time being.

Now to run the hosts script, since It's no longer mounted to /system/bin, you have to point to it's directory. So the command to run it would be:

Su -c /magisk/unifiedhostsadblock/system/bin/hosts

At this point, you may just want to move the hosts script somewhere else for the time being such as /magisk
[Magisk] davidcd13:
In the meantime, i use adaway app and it works. Thank you for all those informations.
[Magisk] Refi150R:
My Device won't show up the home screen. I mean, after RR Logo It's Stuck with black screen.:eek::eek:
[Magisk] Zackptg5:
That would be a magisk issue. Uninstall magisk, then reinstall it. What other modules did you have installed?
[Magisk] D3vile3n:
if you have any substratum theme applied, flash the substratum rescue zip from substratum folder
[Magisk] Refi150R:
I have Substratum theme and 2 modules of magisk which is Android O NotoColorEmoji Replacer and Enable Doze on Google Play Services.
[Magisk] D3vile3n:
Have you tried flashing the substratum Rescue.zip
[Magisk] Refi150R:
Nope, where can I found this item?.

I rather flash new RR with the latest version. ???
[Magisk] k2828:
any solution?
[Magisk] Zackptg5:
Can you post your whitelist and hosts file?
[Magisk] RijuSarkar:
Today I have given the commands fgp...but the pornsites like pornhub,xvideos are not blocking...they are opening
[Magisk] Zackptg5:
Did you enable systemless hosts in magisk manager before running the hosts script?
[Magisk] RijuSarkar:
Sorry....totally forgotten
[Magisk] Zackptg5:
No problem :)
[Magisk] k2828:
see attachment
[Magisk] Zackptg5:
I mean the hosts file modified by the script (/magisk/.core/hosts)

Edit, nevermind, I don't need it. I see the problem:

If you look at the hosts file after running the script, you'll see all entries are preceded by 0.0.0.0

So just add that before your entries. The regular whitelist feature looks for exact matches. So your whitelist should contain:

0.0.0.0 facebook.com

0.0.0.0 s.youtube.com

0.0.0.0 s2.youtube.com

However, you may want to look into using regex instead (specifically grep regex). With regex, you can whitelist all Facebook and YouTube domains with wildcards instead. Search around and try various combinations until you get it the way you want it (use the wr option if using regex).

So for example, if you want to whitelist all Facebook.com and YouTube.com domains, change your whitelist to the following:

.*facebook.com

.*youtube.com

Then use the wr option in the script
[Magisk] k2828:
both are not working.

u sure it is .* and not *. ?

do u have a noob frindly explenation link of what regex espacialy wildcards are? if i enter wr it just applies the whitelist no additional options which i expect with the term wildcards. sounds a bit like gambling lol.

maybe i upload u the host file? i couldnt find the foulder u mentiont. where is it exaxtly
[Magisk] Zackptg5:
. Indicates any character and * indicates and number of th3 character preceding it so it's .*

There isn't really a noob friendly guide for this. I tested it out myself and does work. Searching the hosts file would verify that all Facebook.com entries are gone.

However there are more domains involved in the Facebook website you would need to whitelist such as fbcn so that would involve some investigation of your own (try using something like ublock origin in your webrowser to see what domains you need to whitelist)

.core is a hidden folder so you need to make those visible in your file explorer
[Magisk] _litz:
Had an issue with this module on a Nexus 9 ...

Module installed without error, but the hosts file ended up mapped to /system/bin/hosts instead of /system/etc/hosts (as expected).

Had to rename 'bin' to 'etc' in the module's magisk folder, then reboot to fix.
[Magisk] Zackptg5:
Haha, you have the hosts stuff mixed up (supposed I could've named the script to something else - whoops).

You'll need to change it back to bin or it won't work. Here's how it works:

The bin/hosts file you see is not a premade hosts file but is a shell script file. It's in bin so you can run it from terminal. When you run the script, it'll then download and apply the hosts file of your choice to /magisk/.core/hosts which is automounted to /system/etc/hosts. It's kind of convoluted
[Magisk] _litz:
That's ... well ... 'convoluted' is one way out putting it ...

Does make a kind of sense though ...
[Magisk] parikhgoyal:
not working in RR 5.8.2 Rom

i have installed and rebooted the device but it but still it's not working. Ads still in youtube and other apps.

It is showing under installed in downloads.

systemless host is enabled in settings.

Do i have flash the downloaded zip file(unified_hosts_adblock-v2.0.zip) in recovery?

Sorry if it's a stupid question
[Magisk] Zackptg5:
Read the OP for usage :)
[Magisk] k2828:
i changed my phone to s5 g906k and wanted to give another shot. unfortunatly when i enter:

"hosts" i get the messge: /system/bin/sh: hosts: not found

modul is active on magisk.

also cann you give me think to the wildcard section you refering to in the OP. i couldnt find it.
[Magisk] Nevermindthelabel:
Do you have systemless hosts enabled in Magisk settings?
[Magisk] k2828:
yes
[Magisk] Didgeridoohan:
Are you running the command as su? Have you tried rebooting a second time after installing the module? Have you checked the log that the module is actually loading properly? Have you tried uninstalling and reinstalling the module?

About wildcards: I believe he's using grep wildcards for the whitelist file, so just Google that...
[Magisk] Zackptg5:
As [MENTION=4667597]Didgeridoohan[/MENTION] said, I'm just using grep regex for it :)

The error your getting makes it sound like magisk isn't automounting the module. Look through your magisk log to verify its working correctly. You can just hardcore the path for the script in the mean time:

su -c /magisk/unifiedhostsadblock/system/bin/hosts
[Magisk] lover:
I loved this module it is very effective.

Although after su, hosts command. If i select m list with others like mfgs it does nothing so first i selected m and it updated then i have selected the rest together and it updated... anyway after rebooting i dont see ads so i guess it worked!

Some other questions: for future updates i should reboot for changes to be applied? Does this module support magisk v13?
[Magisk] Nevermindthelabel:
All of the options in the list will install m(aster) so fgs is the same as m and then fgs. I'm using this module on v13 on my OP3 and Flo and it works awesome
[Magisk] k2828:
thx had accidentally clicked on the core option. now in terminal it works but i still have ads. would you mind to have a look at the log?
[Magisk] Zackptg5:
Log looks good. Unfortunately, hosts files can't block many in-app ads :/
[Magisk] k2828:
i have adds everywhere even in chrome :D it seems that no ads where removed.

the reason i tried this again is because, adfree, adblock etc didnt do the trickeither. could the problem lie somewhere else?if yes what would be your guess?
[Magisk] atarek:
Hello,

I've note 3 n9005 with magisk v 13 latest build.

I noticed that when this module is installed no new videos added into youtube watch history.

So i searched that issue i found it's related to add block.

I didn't found anything in this thread related to this issue. Also in another Adblock app thread i noticed people talking about that issue and tried to add S.youtube.com in whitelist but nothing changed.

So if any one here could advise or clarify that behavior it will be appreciated.
[Magisk] Zackptg5:
Those ads likely aren't blocked, not sure really

The youtube issue is related to the social filter. Just don't apply it and you'll be fine. Never heard of any issues with watch history
[Magisk] ovizii:
Got a similar problem, magisk working and get when I type su in a terminal I get that no su binary was found.

Any ideas?

---------- Post added at 07:41 PM ---------- Previous post was at 07:38 PM ----------

And yes, systemless hosts are enabled.
[Magisk] parikhgoyal:
How to access the terminal

hello noob here

wondering how to access terminal to write the code su hosts

can anybody help?:confused::confused:
[Magisk] Nevermindthelabel:
Well, you need to have one. I'd recommend https://play.google.com/store/apps/details?id=jackpal.androidterm open it and enter appropriate commands

---------- Post added at 12:15 PM ---------- Previous post was at 12:13 PM ----------

Sounds like you aren't rooted. Is Magisk installed properly? Might need to flash it again
[Magisk] ovizii:
Magisk seems to be working fine, apps ask for root right and magisk let's me decide so all seems well.

Just wondering but isn't magisk supposed to hoffe the su binary on purpose to hide the fact that the system is rooted?

BTW. Using magisk 13 beta.

---------- Post added at 09:24 PM ---------- Previous post was at 09:18 PM ----------

Very weird, I just used a different terminal emulator and it worked. I saw some lines complaining about the certificates from github but things seem to have worked.
[Magisk] parikhgoyal:
Thanks mate it worked but ads are still popping up in youtube and other apps.

i have chosen m and s filter in the command and rebooted the device afterwards.
[Magisk] Nevermindthelabel:
For blocking YouTube you will need a special app, there are a few on the forms. Some adds are blocked in apps, but mainly works for me with browsing
[Magisk] Axel85:
Hi can someone help me to find why I can't get it to work? I downloaded the plugin from magisk and installed ,activated systemless hosts, rebooted , open terminal as root and activated fgps hosts . After the download , quit , reboot , but I continue to see ads . This is the same on every device I have ,galaxy Nexus on dirty unicorns 7.1.2 , nexus 10 on resurrection remix 7.1.2 and nexus 6 on pure nexus 7.1.1. What I'm missing?
[Magisk] Didgeridoohan:
You can verify if the module is working by navigating to /system/etc and see if the hosts file has the expected data. It's gonna be pretty much empty if it doesn't work.

In-app ads will still show up most of the time.
[Magisk] lover:
this one work just fine for me and its also very cool terminal that gives you geeky feeling with its floating transparent look

https://play.google.com/store/apps/details?id=com.myboyfriendisageek.airterm
[Magisk] parikhgoyal:
well that definitely looks geeky:cool::cool::svetius:
[Magisk] Axel85:
Looks like is working for almost everything on both devices. Is it normal that the host file on tablet is populated of 0.0.0.0 and addresses , but on the smartphone is 127.0.0.1 and addresses?
[Magisk] Didgeridoohan:
That's normal.

Although, the hosts file this module uses only use 0.0.0.0 as the IP. You must be getting the phone hosts file from somewhere else.
[Magisk] Moaz.Magdy:
HELP!

I installed the module without enabling systemless hosts in magisk setting

I then rebooted the phone to complete the installation

when the phone booted, every app crashes and I have to re enter my WiFi password with every boot

tried opening magisk to uninstall it but the app crashes before loading then the phone entered a bootloop till I switched it off then on again

now every app crashes before opening. I don't know what to do. Any help?
[Magisk] Zackptg5:
Sounds like a magisk issue. Flash magisk uninstaller zip in TWRP. Then flash magisk installer and try again
[Magisk] Moaz.Magdy:
Tried flashing the uninstaller but it didn't work. I got an error saying that I cannot uninstall this version using this uninstaller

ended up doing a hard reset because I needed to use my phone. Thanks anyway :)
[Magisk] shangostar:
Is it possible to whitelist a single website using whitelist?

Would I just create text file called whitelist with content

(Web address)

Then

su

Hosts

W

?
[Magisk] Zackptg5:
Yes it is, that's what it's for :)

Just put 0.0.0.0 in front of it. So for example, whitelisting google.com (google isn't blocked, this is just for example purposes), your whitelist file would read:

0.0.0.0 google.com

And you have commands right, but the capital letter isn't needed. The easiest thing to do is to apply a filter with the hosts script. Then search the hosts file for the website you want to block and just copy and paste it into your whitelist file
[Magisk] shangostar:
Thanks, can't seem to get it working though.

Ive created file 'Whitelist' at sd root, added the text

0.0.0.0 avforums.com

then opened terminal and typed

'su'

'hosts'

then 'w'

it says "applying whitelist system/bin/hosts 120 can't create sdcard/temp, is a directory at sdcard/temp"

Cant find any mention of

avforums.com

in my hosts file (is it system/bin/hosts?) and ads are still blocked on said website.

I don't understand fully the 2nd part of your post if I'm honest.

Could you maybe elaborate on this 2nd part?

There are a number of sites I want to support and whitelist

Thank you
[Magisk] Zackptg5:
The error your getting means that the whitelist isn't being applied. Do you have a folder named 'temp' on your sdcard? Try moving it off of /sdcard and trying again. The other time errors like that show up is if you don't have root permissions so is root working for you?

Whitelisting something removes it from the host file. So if avforums isn't in the host file before applying the whitelist, that means that it isn't being blocked. That's not surprising since most ads are from their own domains (not that of the actual website you're on). A common one is doubleclick.net. Many websites such as facebook display some ads using doubleclick.net (it's a google service). So if you block doubleclick.net, many of the ads will go away.

An easy way to figure out what the ad domain is is to use an adblocker such as ublock origin (my favorite) with your desktop browser and selectively unblock the listed domains until the ads appear. Then you can add that domain to the whitelist

So the trick is finding the domain for the ad server
[Magisk] klaberte:
ERROR 503 Backend is unhealthy

Installed Terminal Emulator for Android, ran su, then hosts, got the list of options. Typed 'm' and return, result was Warning: cannot verify raw.githubusercontent.com's certificate....

ERROR 503: Backend is unhealthy

Can anyone help me?
[Magisk] Shafwan7:
does this tweak have uninstaller? now my system are bad after flash this mod. lost root and crash eveey second.

tried delete from system/magisk but seem like not clean remove
[Magisk] Nevermindthelabel:
You can uninstall from the magisk app or turn off systemless hosts. Or flash mountmagisk in recovery and delete files
[Magisk] Didgeridoohan:
That's probably just a timeout when trying to connect. Try again.
[Magisk] Zackptg5:
That's a magisk issue, not an issue with this mod. Uninstall and reinstall magisk (see magisk thread for zips to do this)
[Magisk] klaberte:
Yep, seemed to work this time.
[Magisk] core720:
sorry, how enable adblock???

Test Type SU....ok

Host..... dont found
[Magisk] Nevermindthelabel:
Need to type hosts not Hosts. Lowercase h
[Magisk] rik99:
Xiaomi redmi 2: camera crashes after installing this module
[Magisk] Zackptg5:
Logs? Thats also unrelated to this module. Probably a magisk issue
[Magisk] exodius48:
Why i can't enter "mps" ? but can enter "fps"??
[Magisk] skdubg:
? option "m" is master
[Magisk] Didgeridoohan:
And "m" is already include in all other options...
[Magisk] rik99:
07-09 00:15:37.826 F/libc (8606): CANNOT LINK EXECUTABLE "/system/bin/mm-qcamera-daemon": cannot locate symbol "_ZN7android13SensorManagerC1Ev" referenced by "/system/vendor/lib/libmmcamera2_stats_modules.so"...

07-09 00:15:32.654 F/DEBUG (8597): pid: 8596, tid: 8596, name: mm-qcamera-daem >>> /system/bin/mm-qcamera-daemon <<<

07-09 00:15:12.877 F/libc (8540): Fatal signal 6 (SIGABRT), code -6 in tid 8540 (mm-qcamera-daem)

07-09 00:10:08.900 E/AndroidRuntime(6192): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.cyanogenmod.snap/com.android.camera.CameraActivity}: java.lang.ArrayIndexOutOfBoundsException: length=0; index=0

07-09 00:10:08.900 E/AndroidRuntime(6192):	at com.android.camera.util.CameraUtil.isCamera2Supported(CameraUtil.java:386)

07-09 00:10:08.900 E/AndroidRuntime(6192):	at com.android.camera.CameraActivity.onCreate(CameraActivity.java:1507)
[Magisk] exodius48:
But on TE show 'm' as adware+malware not a 'master'? :confused:
[Magisk] Didgeridoohan:
It is the master option. Hence "m"...
[Magisk] Zackptg5:
Try clearing dalvik cache. If that doesn't work, try uninstalling and reinstalling magisk
[Magisk] klaberte:
This is perhaps more a Magisk question than a specific UHA question. I find that my phone only passes SafetyNet if I enable Magisk Core Only Mode. However, in that mode, it seems that I cannot update the hosts file using the terminal emulator. But, I believe that the hosts file created is still in effect, and ads are still blocked. That makes sense; while the hosts file is not updated, the system still consults the existing hosts file created by this module, as long as the Systemless hosts option is checked in Magisk Manager settings.

Can someone give me a quick tutorial (or pointer) on how this all Systemless hosts thing works? How does Magisk force the Android system to consult a hosts file at /magisk/.core/hosts instead of the normal hosts file in the Android system?

Am I correct that in Core Only Mode, the magisk host file is still consulted, but cannot be updated?

What specifically does the Systemless hosts option in Magsisk Manager do?

Many thanks!
[Magisk] Didgeridoohan:
Slight OT, yes...

If you're using Magisk v12.0 you'll only pass SafetyNet with Core Only Mode enabled, or possibly with the Universal SafetyNet fix module. That's because of an update to SafetyNet a few weeks ago. In Core Only Mode no modules will be loaded and that's why you can't update the hosts file. MagiskSU (root), Magisk Hide and Systemless hosts are still active. But this is kind of explained already in the settings... :p

At boot, Magisk uses it's Magic Mount to replace the system hosts file (system/etc/hosts) with it's own (magisk/.core/hosts). That's what Magisk does... Systemlessly mounting files and folders to /system. They Systemless hosts option just tells Magisk to mount it's own hosts file to /system...