-
-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wildcard filterlists support like adblockers #370
Comments
I made it so that the host module checks subdomains too. So that a host like a.b.c will check a.b.c, then b.c then c, and report the first to match (if any). That means you need to use a host file without subdomains, including for example b.c (but NOT "*.b.c" as that won't work) |
Doubt that'll be a problem. Many lists, oisd.nl's included, have a version without the wildcards. |
Actually i have a question. whats the syntax which hosts module actually uses? |
I am 95% sure it also works without the local ip before the domains. I'll still check tho and, if it works, I'll react to your comment with a thumbs up. |
The current version is checking lines with exactly two entries separated by spaces, then using the second one. This was technically wrong (tabs are also valid, and some files contain more than one host on the same line) so I fixed it and added the 'single host' variation to the mix. Now the files can be for example: 0.0.0.0 example.com
0.0.0.0 example.com
0.0.0.0 example.com # this is a tab character
0.0.0.0 example.com anotherexample.com
example.com |
Thankyou so much!
Oh i see, thankyou so much for fixing so quickly! So all the syntaxs you specified in that now be used right? Including just a main domain matching all subdomains of it too? Also, is there a reason why autoupdate for hosts module isn't a thing yet? |
yes, well, it will be on the next version...whenever that is published.
because the update will take a long time, and android freaks out when you do a lot of work on a background task. I think I need to maybe use a background service, I'm not sure. I also would like to implement a way to 'cancel' the build process...but async operations are hard and there are other more fun things to do :( |
Thankyou! :) i'm looking forward to the next release.
Ah i see, it would be cool to have but true i can relate what you mean. It's not easy also considering how many OEMs "battery optimizations" kills apps unless they use google push without going through extensive settings. I was thinking this way
Well this conversation is getting out of scope of this issue ig sorry 😅
|
I have no idea what that error is :/ But yeah, let's continue on a discussion if you don't mind. Can you create it? |
It's ok, i think my androidstudio is kinda broken. It doesnt seems like an issue with urlchecker repo only. i'm still new to all this development. i'll figure it out. |
Describe a related problem (optional)
There are some few filterlists, like https://oisd.nl, decided to drop support for the hosts file due to it not able to detect unknown sub domains. Which raises a good question.
While we can use pattern checker for asterisks when using domains, same can't be said for hosts as they only check for main domain and if we click on link which has unknown sub domain, it wont get detected by urlchecker.
Describe your suggested feature
If we can use something similar to how most adblockers do, like using a filterlists which supports wildcards, or following typical adblock syntax, it has few advantages
Describe alternatives you've considered for your suggested feature
Or simply add option to treat entries in hosts file which doesn't have a subdomain as if they are having a asterisks at beginning so they would detect all subdomains as well.
Other details
Implementing similar to how adblockers do can be hard. While we can add these filterlists on browsers like brave or firefox (with extension) easily, it would be nice to have it work in urlcheck as i use hosts labeller to prevent my normie family not get into clicking weird links and wish it supported sub domains too.
Acknowledgements
The text was updated successfully, but these errors were encountered: