yashsingh1/xdaforums huggingface dataset:
[Magisk] LSS4181:
Is it similar to the case I had with www.google-analytics.com? Apparently, some pages seem to have scripts that poke and expect certain values returned from the loaded ad pages, and blocks/redirects the user if the page failed to load or by any reason returned unexpected results.

Under such circumstance it does not have to be an adblock filter/browser extension to trigger the blocking, and it can even be triggered, if you have hosts filters on your router level (doable with many custom firmwares such as OpenWrt), or if your ISP/carrier unfortunately blocked one of the ads domains themselves. The only way to avoid such would be to prevent the startup of such scripts itself. (For example, like pressing Stop loading as soon as the main contents showed up).

I had an app which did this with the in-app news pages, when google analytics failed to load, the page loading immediately aborted and redirected to a page loading error page.

However, it seems to depend on whether the system browser is capable of executing such scripts, as for the same app, same ads, same Hosts filters, the problem did not happen on an older phone of mine running 4.4 KitKat.
[Magisk] Dynos:
Might be a stupid question, but how do i "import" the automated flow?
[Magisk] deepak549:
I accidentally deleted my host file . Can anyone share their hosts file .

It is located at folder: system/etc

I am using Oneplus 3 with OOS 4.1.7 .

Thanks .
[Magisk] Bewildered Wolf:
Apply this module again. The hosts file will be back again I guess. If not then ll share mine.

//Press thanks if it helped.
[Magisk] deepak549:
Thanks for your quick reply . I have system partition back so I just restore that.

And one more thing . I am not able to use facebook and other social media sites after applying full adblock . I have even created whitelist but that is not even working .
[Magisk] Bewildered Wolf:
You don't have to apply social profile in terminal. That blocks some social apps.
[Magisk] Zackptg5:
In the automate app, tap the 3 dot menu and select import
[Magisk] Megakaban_:
Updated GUI app to v1.1 (https://xdaforums.com/showpost.php?p=73495676&postcount=485)
[Magisk] Thomas_BA:
Hi folks,

as xposed still not working for Nougat i tried to install this Magisk Module as an alternativ to MinMiniGuard.

Flashing works fine, nor errors, but even after several reboots it says in the Module section of Magisk "Module will be updated on next reboot"

Running Magsik 13.3 on Samsung Galaxy Tab S2 with LineageOS 14.1.

Any ideas?

Thanks

P. S. I uninstalled the unofficial Xposed for Nougat and Module installed wuthout problems. Very strange.
[Magisk] andriana936:
I got this message while applying blacklist

applying blacklist

segmentation fault
[Magisk] Zackptg5:
Did you grant root permissions? Can you attach your blacklist?
[Magisk] andriana936:
The problem is solved. I just reboot my phone and then the blacklisted URLs are included in hosts file inside system/etc.

Unfortunately I still GOT ping respons of URLs in the hosts file. Still don't find any solution yet for this problem. Please see the attachment for SS.
[Magisk] gargashish0901:
Installed the zip run commands in terminal but still ads are there
[Magisk] Zackptg5:
That's incredibly undescriptive. Many in-app ads are not blocked by hosts files and what ads are blocked depends on what filters you applied
[Magisk] gargashish0901:
Applied all filters mfg But getting ads in all apps
[Magisk] hitmancho:
I have a different problem now. I can't seem to be able to manually edit the "hosts" file in /system/etc. The reason I wan to edit it is so I can put in a line for using Pandora outside the US. The problem is the moment I try to save the file with the line added on anywhere I like it won't let me save the file. It just creates an identical file with the new line called "hosts(random numbers)". There's no way to rename or mess with the original hosts as well. I guess this is the way it's supposed to work seeing as how we're running an unmodded /system but how can I add this line using this app. What should I type in and where?
[Magisk] Zackptg5:
That's what the blacklist/whitelist features are for. Read the OP for how to use them. The hosts file you want to modify if you choose to do it manually is /magisk/.core/hosts, not system/etc/hosts
[Magisk] hitmancho:
Thank you, I just added the line manually and it worked. But how do I do this with the lists? The way I understand it you put things that are usually blocked but you don't want blocked into the whitelist file and run it. It worked for me. The blacklist seems to be to block things that aren't blocked by the default lists. So which one of these lists can actually do redirections like I needed for Pandora? The descriptions don't seem detailed about that and neither of the lists worked for me.
[Magisk] Zackptg5:
If you're adding a line to it (blocking new stuff), you want the blacklist. Whitelist is for removing lines (unblocking stuff). There isn't a way to modify existing lines at the moment but you could workaround that by first applying whitelist to remove the line, then run the blacklist to add the modifed one.
[Magisk] costin85:
Anyone have version 2.0 by any chance?
[MENTION=6037748]Zackptg5[/MENTION]
[Magisk] MrFlashGame:
This project looks really nice, but I have three little questions: Can I put my old hosts file, which I concerted to .txt format without any changes in the blacklist (would look like 0.0.0.0 abc.com [and so on] for example)? And can I just use my blacklist without any hosts if this mod. If not is it okay if some files conflict between these two lists? And how can I factory reset the module? Sorrry I've read the OP but I didn't really understand and I'm new to commandline stuff :/
[Magisk] Zackptg5:
You can use your old hosts file as a blacklist but you will need to remove the 0.0.0.0 prefix from all of the lines. It'll only add each line if it doesn't already exist so you don't have to worry about duplicates.

If you already have a hosts file and don't want to use unified hosts, you can enable systemless hosts in magisk manager settings and copy it to /magisk/.core and use this module only for applying blacklists/whitelists. The main takeaway here is to not touch /system/etc/hosts

To remove any hosts modifications, just disable and reenable systemless hosts in magisk manager settings
[Magisk] sleepingelf:
its does'nt work and how to unistall it ? because delete button seem not work for this module ............ module not loaded.
[Magisk] eak1080:
[MENTION=6037748]Zackptg5[/MENTION]

The below is what happens on Oreo on Nexus 5x with magisk 13.6.

I think it's how you are wget or curl "ing" the file from GitHub

Maybe it's a new Oreo cert thing?

--2017-09-03 21:48:51-- https://raw.githubusercontent.com/StevenBlack/hosts/master/alternates/fakenews/hosts

Resolving raw.githubusercontent.com... 151.101.20.133

Connecting to raw.githubusercontent.com|151.101.20.133|:443... connected.

WARNING: cannot verify raw.githubusercontent.com's certificate, issued by '/C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 High Assurance Server CA':

Unable to locally verify the issuer's authority.

HTTP request sent, awaiting response... 200 OK

Length: 1185583 (1.1M) [text/plain]

Saving to: '/magisk/.core/hosts'

100%[=========================================>] 1,185,583 4.29MB/s in 0.3s

2017-09-03 21:48:51 (4.29 MB/s) - '/magisk/.core/hosts' saved [1185583/1185583]
[Magisk] Zackptg5:
Get similar messages on nougat. That's normal
[Magisk] eak1080:
Have you tried to figure out why the cert doesn't validate? I only ask because it's not secure to modify a host file with a unsecured downloaded hostfile... Someone could MITM the traffic and add host entries to redirect valid traffic from say Google to their own server...easiest way to steal passwords...

If you follow adaway and their app/host lists they all moved to https hosts a whole back due to security
[Magisk] Zackptg5:
It already uses https but I had it set to ignore cert check because it would error out and say thst it was unable to locally certify it. I'll start to look into it
[Magisk] eak1080:
Are you using wget or curl?

I couldn't find your GitHub to look at the code
[Magisk] Zackptg5:
It's in the op :)

But here it is: https://github.com/Zackptg5/Unified-Hosts-Adblock

I'm using the same wget that was in the original unified hosts adblock by Laprasofdongle so it's an older one.

I tried switching to curl a while back but I'm not sure how to build a general one for all Android cpu types. If you know how to do that with curl or wget, that would be awesome
[Magisk] Didgeridoohan:
[MENTION=6037748]Zackptg5[/MENTION]

Could the ssl issue be because of something like this: https://jacob.hoffman-andrews.com/android/wget/

Edit: the "--without-ssl" part, that is...
[Magisk] Zackptg5:
Possibly. I don't have time to look into it now but I will when I get the chance

This won't fix the security issue though. It'll be pretty much the same as what the skip certificate check does in that it's unsecure
[Magisk] Zackptg5:
Magisk v14 is finally here!

I updated the module v2.8 which includes the needed changes for the new version (note that this will not work with older versions of magisk)

So make sure you update magisk before this module
[Magisk] HtheB:
I don't understand why people remove older versions.

Many phones still cannot run Magisk v14, like mine. I had to revert back to 13.3.

Would be nice to have the option to still install the older version (adding the older zip file to OP would be nice)
[Magisk] abdullahsabbir:
It's not blocking ads anywhere. Using adware+malware configuration with Latest Magisk (v14) and Latest Unified Hosts Adblock. Is there anything I can do to fix this?
[Magisk] Bewildered Wolf:
The answer was just one post above yours.
[Magisk] abdullahsabbir:
No, it wasn't working with the Previous version either. Tried Adaway and Unified Hosts Adblocker both. Nothing blocks ads.
[Magisk] Bewildered Wolf:
Go check if their is a hosts file in system/etc.
[Magisk] abdullahsabbir:
Yes, there is a hosts file in /system/etc.
[Magisk] TotallyAnxious:
You should be able to download the zip by veiwing the GitHub via a commit version prior to the most recent release and then downloading as a zip.

This is the most recent version from the GitHub prior to the commit for v14. https://github.com/Zackptg5/Unified.../9dd9b3f60e22e886928a8d565ea930028c01aa79.zip
[Magisk] Bewildered Wolf:
Do one thing. Delete the hosts file. Uninstall this module. And install again.

Guess this should work.
[Magisk] abdullahsabbir:
Okay, I'm trying that. Thank You!
[Magisk] Didgeridoohan:
Just in case [MENTION=8519208]abdullahsabbir[/MENTION] care about keeping his system unmodified I would advice against deleting /system/etc/hosts... If systemless hosts hasn't worked properly you might be deleting the original file. The file that matters is /magisk/.core/hosts and if it gets properly Magic Mounted.

Have you enabled systemless hosts in Magisk Manager settings and rebooted? And if you open /system/etc/hosts, do you see a lot of entries or just the one?
[Magisk] abdullahsabbir:
Yes, I have enabled Systemless Hosts from Magisk Manager and the hosts file has a lot of entries.

I've just discovered something. Does XDA android app bypasses DNS based Adblockers like this? Because almost an hour ago I tried another app (MoonReader+) and the ads were still there, then I just restarted my phone. Now I'm checking that app again and the ads are gone this time. But XDA's ads are still there.
[Magisk] Didgeridoohan:
What about if you use a web browser? Are ads still there? Many in-app ads aren't blocked by hosts based ad blocking...
[Magisk] abdullahsabbir:
Most of the ads in various websites are getting blocked, yeah. I think it's working then. Thank You!
[Magisk] HtheB:
When trying to install it, it says that it's not a magisk module...
[Magisk] TotallyAnxious:
Open it and see. Files need to be moved to root of zip. Compare to other magisk modules. Easy to troubleshoot.
[Magisk] Flying_Bear:
Seems my edited hosts file for some reason persists even after removal of the module. Anyone know why?

edit:

fixed by removing hosts file from magisk folder manually.
[Magisk] Didgeridoohan:
For future reference: You could also just toggle systemless hosts in the Manager settings.
[Magisk] Flying_Bear:
Did not work, that is why I was asking. Enabling/disabling the module did no change, even complete removal from Magisk Manager kept the hosts file.
[Magisk] Zackptg5:
I'll put 2.7 back up later today.

On my g2, I had to reboot and let it completely boot up after flashing magisk 14 for the install to complete unlike with previous magisk versions. Not sure if you're problem may be related to that
[Magisk] Didgeridoohan:
I think we're talking about different things. I mean the systemless hosts toggle in the Manager settings, not enabling/disabling the module.
[Magisk] Zackptg5:
Pushed v2.9 real quick. Fixed some typos in the template. Thanks to [MENTION=4667597]Didgeridoohan[/MENTION] for pointing them out

I also put 2.7 back on the OP for now for people having trouble with magisk v14
[Magisk] Flying_Bear:
Ah, got it, didn't see it in Settings. Much appreciated for future tinkering :)
[Magisk] morback:
Hi all!

I don't understand how to use the update flow thing

I mean, what the OP means by "importing" it? I cant flash it in recovery and I can't install it as a Magisk module.

Thanks
[Magisk] Zackptg5:
It's for users of the automate app. If you don't use automate, don't worry about it
[Magisk] morback:
Okaaaaaaaay

Thanks for explanation
[Magisk] cyan pac:
If it's possible you should add something to tell what's turned on or not. Might be useful
[Magisk] Zackptg5:
You can open the hosts file and see which one was applied at the top of it
[Magisk] nicorktr:
Hi,

I tried to install this module through the Magisk Manager app.

My problem: after rebooting at the end of the installation, the phone goes back to TWRP, instead of booting to the normal stuff.

I tried to Reboot > System but it keeps booting back to TWRP.

I tried to localize the "/magisk" folder but can't find it.

I tried to install "mount-magisk.zip" to mount it but it doesn't work and I don't know why (terminal says: "not found").

Is there a step by step way to remove/uninstall the module from the TWRP file manager? Thanks.

My phone: Samsung Galaxy S7.
[Magisk] Didgeridoohan:
If you can't flash the Mount Magisk zip to access /magisk (a recovery log can probably shed some light on why you can't flash it), your option would be to run the mount commands yourself in the TWRP terminal or use the Magisk uninstaller and start over fresh.

Edit: there's also a module uninstaller zip in the Collections thread. You could try that...
[Magisk] nicorktr:
Yeah actually I tried that, forgot to mention it, it didn't work. That's where the "not found" quote in the terminal came from btw.

I tried to avoid the "start from fresh" solution but if that's the only solution...

How can I post my log?
[Magisk] Didgeridoohan:
Ah... Too few posts for links or attachments...

Upload it to Pastebin and post the id to it.
[Magisk] nicorktr:
Here it is: Up374CBt
[Magisk] Didgeridoohan:
There's nothing in that log about flashing any kind of zip. You'll have to save the log right after you try to flash the zip from the install screen.
[Magisk] nicorktr:
Sorry, here is a new log: KLdiaHCX
[Magisk] Legendary Cryptid:
Despite being able to get the latest update flashed via TWRP, when I activate it, it doesn't work, despite having systemless hosts enabled.

Also, I made a blacklist text file on my sd card, but it keeps telling me it's not detected. Does it have to be on the external sd card?
[Magisk] Zackptg5:
The log looks normal. Host files can't block many in app ads so keep that in mind.

The blacklist has to be named "blacklist" with no extension on the end of it
[Magisk] Legendary Cryptid:
I just renamed it. It's on my external SD card, but it's still not detected.
[Magisk] Zackptg5:
Should be on internal sdcard
[Magisk] Legendary Cryptid:
Do the unified hosts include the ones added to AdAway, along with the standard 3 host sources? I ask this because AdAway blocked ads within certain apps even though they were scanned for adware.

Also, if I add the 3 host sources to blacklist, will they be activated?
[Magisk] Zackptg5:
Yup. All of the sources are listed here: https://github.com/StevenBlack/hosts

Anything added to blacklist that isn't already present will be added
[Magisk] Legendary Cryptid:
I feel I wasn't specific enough. I mean, whenever AdAway has new hosts available, are those equally added to the Universal blocker?
[Magisk] Zackptg5:
The universal hosts incorporates adaway into it already so you don't need to worry about it. Basically, you don't use adaway if you're using this module
[Magisk] :
Hi. I have magisk 14. Installed the module but in terminal emulator after see the options, Whatever i choose, it gives me:

/magisk/.core/hosts : no such file or directory

If i go to root folder i see:

magisk/unifiedhostsadblock/ some files there..

What Im i doing wrong?

Should i create any directory and copy some files there?

I had AdAway installed and i uninstalled it if it has anything to do.

I have ads now.

Thanks,
[Magisk] Zackptg5:
You need to enable systemless hosts in magisk manager settings
[Magisk] :
I do, i try again terminal emulator, the same. I reboot phone, systemless host option in magisk manager is disabled again, although i had enable it..

I erase data from magisk manager, again the same, after every reboot the option is disabled again..

Anybody have any idea?

Thanks,
[Magisk] Zackptg5:
That's a magisk issue. Try uninstalling and reinstalling magisk completely. Then reinstall the module
[Magisk] :
I did both.. Still the same. In every reboot the choice is disabled.. Can't i do something for this?

Edit, i asked to magisk thread and find out from xml file that systemless host is actually enabled although it looks disabled in magisk manager..

So some other problem is that it doesn't work..

In a tablet i have, it also looks disable there but the module works without the error i have here..
[Magisk] yung40oz84:
I'm using the play store app and it just keeps saying error when applying and no ads are being blocked anywhere. 2.7 works perfectly Android O NitrogenOS Angler.
[Magisk] ipredatorv:
Yup, 2.9 doesn't work for me either, on clean flash and magisk 14. Any chance for an update? Really love this ad blocker!

Edit: just figured out that systemless hosts doesn't stick after reboot. But even if enabled the same error message comes in Terminal Emulator. This issue might be Magisk related?
[Magisk] :
Tbe module has some problems..

I couldn't sign in to Facebook app. If i used titanium backup to sign in, after running Facebook i still didn't have Internet connection.

After disable module (disable systemless hosts in magisk manager) problem solved..
[Magisk] Zackptg5:
Sounds like user error. If you enable the social filter, it'll block social networks like Facebook. Apply different ones
[Magisk] ipredatorv:
Zack what could I try to get your awesome module working?
[Magisk] android_smater:
don't take it personally but why don't you make adblocker bit easier like other blocker means to select social etc instead use all in one using different hosts resources

some are here

https://adaway.org/hosts.txt

https://hosts-file.net/ad_servers.txt

https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
[Magisk] Zackptg5:
The most user friendly way for this would be make an app for it but I have no experience in app development. This module uses only 1 hosts source but the options you see are different variants. In terms of sources, the hosts files I chose already include all of the sources you listed. Read the op for more info :)
[Magisk] android_smater:
ok :o
[Magisk] Zackptg5:
version 1.7 released!

Added pixel support
[Magisk] ahrion:
I see what you did there. This method is still sort of bugged but I've founda better fix

:good:
[Magisk] Zackptg5:
Do elaborate :)
[Magisk] II_DiE_4:
[MENTION=6037748]Zackptg5[/MENTION] dunno why but it stoped working.. getting the error "wget: bad address raw.githubusercontent.com"
[Magisk] Zackptg5:
Still working fine on my end. That happens if you can't connect to the internet
[Magisk] II_DiE_4:
Hm... For sure i can connect :) Even ping it, traceroute it etc etc..

Also tried with VPN.. still the same.. Rly strange
[Magisk] ztv--:
Getting the same error, posting this message from my phone right now though :)
[Magisk] Zackptg5:
Can you both try reflashing the module and saving the recovery logs? Also, can you save the full output from attempting to run hosts?
[Magisk] ztv--:
>adb shell
E6653:/ $ su
E6653:/ # hosts
Unified Hosts Adblocker
wget: bad address 'raw.githubusercontent.com'
sed: treadme: No such file or directory
You can use any combination of the letters below
For example: inputting 'fps' would yield master+fakenews+porn+social
Select an option below:
--------------------------------
'm' for adware+malware
[..]
'q' to quit: m
wget: bad address 'raw.githubusercontent.com'
Select an option below:
--------------------------------
'm' for adware+malware
[..]
'q' to quit: f
wget: bad address 'raw.githubusercontent.com'
Select an option below:
--------------------------------
'm' for adware+malware
[..]
'q' to quit: q
Done!
E6653:/ #

full recovery log

I:operation_start: 'Flashing'
Installing zip file '/sdcard/Download/Unified_Hosts_Adblock_v1.7.zip'
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Update binary zip
I:Zip does not contain SELinux file_contexts file in its root.
I:Legacy property environment initialized.
Archive: /sdcard/Download/Unified_Hosts_Adblock_v1.7.zip
inflating: config.sh
Archive: /sdcard/Download/Unified_Hosts_Adblock_v1.7.zip
creating: common/
inflating: common/file_contexts_image
inflating: common/post-fs-data.sh
inflating: common/service.sh
inflating: common/system.prop
inflating: module.prop
*******************************
Unified Hosts Adblock
(Zackptg5)
*******************************
******************************
Powered by Magisk (@topjohnwu)
******************************
- Mounting /data, /cache
- /data/magisk.img detected!
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
/lost+found not found. Create? yes

Pass 4: Checking reference counts
Pass 5: Checking group summary information

/data/magisk.img: ***** FILE SYSTEM WAS MODIFIED *****
/data/magisk.img: 44/4096 files (2.3% non-contiguous), 4415/16384 blocks
- Resizing /data/magisk.img to 64M...
resize2fs 1.42.9 (28-Dec-2013)
The filesystem is already 16384 blocks long. Nothing to do!

- Mounting /data/magisk.img to /magisk
- Copying files
Archive: /sdcard/Download/Unified_Hosts_Adblock_v1.7.zip
creating: system/
creating: system/bin/
inflating: system/bin/hosts
inflating: system/bin/wget
- Setting permissions
- Unmounting partitions
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/data/magisk.img: 44/4096 files (2.3% non-contiguous), 4415/16384 blocks
- Done
I:Updater process ended with RC=0
I:Legacy property environment disabled.
I:Install took 1 second(s).
Updating partition details...
I:Data backup size is 7522MB, free: 14311MB.
I:Unable to mount '/usb-otg'
I:Actual block device: '', current file system: 'auto'
...done
I:Set page: 'flash_done'
I:operation_end - status=0
[Magisk] II_DiE_4:
Ok found the problem with the help of [MENTION=4544860]osm0sis[/MENTION].

Its a problem with busybox and magisk 12? or general newest busyboxes. Just disable the busybox and wget and ping will work.