https://redmine.stoutner.com/https://redmine.stoutner.com/favicon.ico?16699090422018-05-09T01:26:23ZStoutner - RedminePrivacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=6732018-05-09T01:26:23ZSoren Stoutnersoren@stoutner.com
<ul><li><strong>Subject</strong> changed from <i>All users to manually or automatically update the ad block list</i> to <i>Allow users to manually or automatically update the ad block list</i></li></ul> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=8432018-10-16T02:44:53ZSoren Stoutnersoren@stoutner.com
<ul><li><strong>Subject</strong> changed from <i>Allow users to manually or automatically update the ad block list</i> to <i>Allow users to manually or automatically update the blocklists</i></li><li><strong>Description</strong> updated (<a title="View differences" href="/journals/843/diff?detail_id=730">diff</a>)</li></ul> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=28452023-04-27T18:33:49ZSoren Stoutnersoren@stoutner.com
<ul><li><strong>Subject</strong> changed from <i>Allow users to manually or automatically update the blocklists</i> to <i>Allow users to manually or automatically update the filter lists</i></li></ul> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=28462023-04-27T18:34:25ZSoren Stoutnersoren@stoutner.com
<ul><li><strong>Description</strong> updated (<a title="View differences" href="/journals/2846/diff?detail_id=2230">diff</a>)</li></ul> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30712023-08-12T06:16:55Zask low
<ul></ul><p>I think shipping the lists through browser is a bad idea. One way to circumvent this, is to get all the lists on the first launch of the application, from easylist, and fanboylist websites, as they're just text files. Typically, storing those lists as data files either in user config directory, or data directory. And update them in a certain timespan. Usually 4 days.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30732023-08-12T20:20:59ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>Yes, but it ends up being a much more complicated procedure than might be initially apparent.</p>
<p>For example, you need to pause all resource requests while new lists are being loaded. Otherwise, traffic that should be blocked by one of the lists could periodically pass through, which would be an unacceptable experience.</p>
<p>You need to design a recovery mechanism that can detect lists being only partially downloaded or parsed if the process gets interrupted by the Android Activity Lifecycle.</p>
<p><a class="external" href="https://developer.android.com/guide/components/activities/activity-lifecycle">https://developer.android.com/guide/components/activities/activity-lifecycle</a></p>
<p>You need you handle problems with entries in the lists that are either malformed for Privacy Browser's implementation or written in such a way that they cause Privacy Browser to crash. A few years ago there was an entry in one of the lists that caused the browser to crash. Because I test and modify the lists before shipping them, I was able to remove the problematic entry (it was eventually removed upstream). But if the browser is fetching the lists themselves, users could end up in a scenario where the only way to fix the crashing browser is to remove all their settings, which can lease to a lot of user dissatisfaction. For a bit of context on this, I would recommend you read the following links.</p>
<p><a class="external" href="https://www.stoutner.com/privacy-browser-android/filter-lists/">https://www.stoutner.com/privacy-browser-android/filter-lists/</a><br /><a class="external" href="https://www.stoutner.com/privacy-browser-android/filter-lists/easylist/">https://www.stoutner.com/privacy-browser-android/filter-lists/easylist/</a><br /><a class="external" href="https://www.stoutner.com/privacy-browser-android/filter-lists/easyprivacy/">https://www.stoutner.com/privacy-browser-android/filter-lists/easyprivacy/</a></p>
<p>All of these are difficulties that can be designed around, but it does make this a very difficult and time consuming feature to implement.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30752023-08-13T01:46:37Zask low
<ul></ul><p>I know a Chinese browser that keeps the list files in user directory (<code>Internal-Storage/Android/data/<package></code>) and it replaces those existing lists in a specific period of time. The replacement itself doesn't cause the blocklists to leak out, since the updation happens immediately.</p>
<p>If there are malfunctioned lists, make sure that you're updating the lists in such a time when the upstream fixes already in place.</p>
<p>Or instead of removing those lists, it might be better to think why it happens in the first place. Caz other browsers might not have behaved the same way.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30762023-08-13T01:49:37ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>This is a planned feature and it will be implemented at the appropriate time.</p>
<p>"since the updation happens immediately"</p>
<p>The above statement makes me think that you don't understand how computers work.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30772023-08-13T02:04:50Zask low
<ul></ul><p>I think you misunderstood me. "The updation happens immediately" I meant that the lists that are kept local, can be replaced by the new pair, at the time when we aren't browsing.</p>
<p>I know that this is just a discussion of the idea, so I don't think anyone rushing about the implementation is gonna help us. At the end of the day, <br /> it's you sir, who'll make the decisions, according to what's possible to you ;P</p>
<p>I do know how computers work but only hardware, just not the coding & software engineering. As a FOSS friendly user, I think I should only focus on the proper usage & debugging. I do daily drive arch on i3wm/sway, not to geek out, but only to be productive & for the sake of minimalism. So I have very little knowledge & time to focus on the inner workings though.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30792023-08-13T05:19:22ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>For reference, the second link in comment 6 above has some benchmark data about how long it takes to read the filter lists from storage and parse them into the array lists in memory.</p>
<p>"Android stores all assets (like the filter list data) in compressed files in the APK. On a Pixel 5, decompressing and parsing the filter lists when Privacy Browser starts takes about half a second. Checking a resource URL against the lists takes about 20-50 milliseconds."</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30802023-08-13T06:13:20Zask low
<ul></ul><p>Isn't it possible to store the lists outside the application package ? I've used some other browsers that download lists directly into the userdata & then parse through them. But most of those are closed source btw.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30812023-08-13T06:27:37ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>Yes. Anything downloaded after the APK is installed could be stored in the app's private data folder. In the case of Privacy Browser that is something like <code>/data/user/0/com.stoutner.privacybrowser.standard</code>. However, parsing the lists from that location will take about the same amount of time as parsing them from the APK.</p>
<p>This is mostly because the way the lists are stored in text files is substantially different than how they are stored in nested array lists in RAM, and parsing them is a very CPU intensive experience. In my design, I have worked really hard to minimize the CPU hit, with a particular focus on minimizing how long it takes to check an individual URL against the lists. Most websites will load dozens or even hundreds of resource requests for a single page. I feel pretty happy that I was able to get things down 20-50 milliseconds per check. I wish I could get the parsing of the lists down to less than 500 milliseconds, but so far that is the best I have been able to do.</p>
<p>For some reference, this is the code that parses the filter lists.</p>
<p><a class="external" href="https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blob;f=app/src/main/java/com/stoutner/privacybrowser/helpers/ParseFilterListHelper.kt;hb=HEAD">https://gitweb.stoutner.com/?p=PrivacyBrowserAndroid.git;a=blob;f=app/src/main/java/com/stoutner/privacybrowser/helpers/ParseFilterListHelper.kt;hb=HEAD</a></p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30822023-08-13T06:43:31Zask low
<ul></ul><p>Nice. That's already sorted, but the focus of this issue tracker is to allow users to manually update the existing filter lists. To achieve that, there should be an interface within the browser, or an automated sub daemon inside API that can trigger list updates in a specific period & in a specific working condition. That can be challenging as you said, caz there are lot of tasks to manage like properly downloading them, updating periodically & without interrupting userspace.</p>
<p>I think the best way, is manual updation by users. Like providing a trigger button to update local lists, & provide causion beneath it whether the lists are upto date or not.</p>
<p>Right now, users have no choice but to wait until the next browser update. It's at least better than nothing isn't it...</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30832023-08-13T06:51:22ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>Actually, the most difficult issues are the other ones I mentioned in comment 6. Pausing the loading of all resource requests while new filter lists are being loaded is by far the easiest of all the issues to address.</p>
<p>One of my core design philosophies is that I am not going to intentionally release a half-baked feature that has the potential to cause massive frustration for users.</p>
<p>As such, this feature will be released when it is ready. But it will require significant effort to make it work correctly and there are many other things that are more important and hence earlier in line.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=30842023-08-13T06:53:16Zask low
<ul></ul><p>Wise decision. Is there any beta branch you're maintaining? I'd love to participate if it exists !</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=31022023-08-14T15:38:48ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>I don't currently have a beta branch, but that is something I might do in the future.</p>
<p>If you want you can always download the code and build it yourself. The cloning syntax is available at <a class="external" href="https://www.stoutner.com/privacy-browser-android/">https://www.stoutner.com/privacy-browser-android/</a>.</p>
<p>At least one person has done this to receive updated filter lists faster than official releases, as can be seen at <a class="issue tracker-1 status-5 priority-4 priority-low2 closed" title="Bug: Updating Easylist.txt to latest available Crash PrivacyBrowser (Closed)" href="https://redmine.stoutner.com/issues/566">#566</a>.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32782023-09-09T03:19:54Zask low
<ul></ul><p>Can I ask if there's any other possible way to update lists except through recompilation ?<br />Some news sites slip through ads & couple of banners, which doesn't happen on updated lists (in other browsers).<br />There's a fork of pb called <code>Monocles</code> (which updated recently, didn't show any ads on the same site btw), which also confirms this.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32792023-09-09T16:37:41ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>Not currently. Although I should note that Privacy Browser is very easy to compile yourself. Basically, just download Android Studio, do the basic setup, clone Privacy Browser from the instructions on the main website, open it up, and build it.</p>
<p><a class="external" href="https://developer.android.com/studio">https://developer.android.com/studio</a></p>
<p><a class="external" href="https://www.stoutner.com/privacy-browser-android/">https://www.stoutner.com/privacy-browser-android/</a></p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32822023-09-09T20:04:26ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>An recent example of how automatically updating the filter lists can introduce problems can be found at:</p>
<p><a class="external" href="https://github.com/easylist/easylist/issues/17295">https://github.com/easylist/easylist/issues/17295</a></p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32832023-09-09T20:21:52ZSoren Stoutnersoren@stoutner.com
<ul><li><strong>Priority</strong> changed from <i>3.x</i> to <i>4.x</i></li></ul><p>For stability reasons, I think I am going to put this off until <a class="issue tracker-2 status-1 priority-10 priority-highest" title="Status: New" href="https://redmine.stoutner.com/issues/1081">Feature #1081: Expose detailed resource request types in Privacy WebView</a> is implemented.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32862023-09-10T00:50:44Zask low
<ul></ul><p>But I'm not sure how other webviewless browsers were able to handle those strings without any breakages. Unfortunately, they're closed source.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32872023-09-10T04:06:22ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>If they aren't based on WebView, then they are operating under a different set of constraints.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32902023-09-10T04:18:30Zask low
<ul></ul><p><code>webviewless</code> I meant the browsers that don't come bundled with a webview, means the ones that rely on system's default webview.<br />Anyways, I hope privacy webview's ready sooner. Can't wait for it ;P</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32932023-09-10T04:30:14ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>I am not aware of any other browser that uses Android System WebView processes the AdBlock syntax used by EasyList.</p>
<p>Lightning uses a hosts file.<br />FOSS Browser uses a hosts file.<br />jQuarks uses a list from pgl.yoyo.org, which is simply a list of domains that doesn't look at any other part of the URL.</p>
<p>All of these are fairly simple (and prone to miss things) compared to what Privacy Browser has implemented.</p>
<p>Which browser do you think is based on Android System WebView that has managed to implement something more sophisticated that what Privacy Browser currently offers?</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32942023-09-10T04:36:04Zask low
<ul></ul><p>Oh. I've said closed source one, not FOSS. It's unfortunately a chinese browser (<a class="external" href="https://play.google.com/store/apps/details?id=mark.via.gp">https://play.google.com/store/apps/details?id=mark.via.gp</a>). It does have hosts files config. Has ability to even add new ones in it btw.<br />I do take some precautions to run these shady apps securely.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32952023-09-10T04:45:12ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>If all they have is a hosts file, then it isn't very sophisticated (or very good at protecting your privacy).</p>
<p>For example, in the example linked to from <a href="#note-19">#note-19</a>, the entry is designed to block HTTP pings, but only if they are third-party requests. Nothing about a hosts.txt file would even notice that is happening.</p>
<p>So, Privacy Browser uses filter lists that are much more sophisticated than what these other browsers are using, but because of limitations in Android System WebView, sometimes the upstream lists need to be modified before they will function correctly. Shipping the lists with Privacy Browser allows me to make those modifications. Automatically updating those lists could result in undesirable behavior for users.</p>
<p>However, with the advent of Privacy WebView in the 4.x series, it will be possible to more fully implement the AdBlock format (used by EasyList), meaning it will be safer to allow auto-updating of the lists.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32962023-09-10T04:47:57Zask low
<ul></ul><p>Is it possible to modify hosts file by a browser function through regexes, & then store it locally ? Maybe via could be doing the same thing.<br />When I hit update in Via's hosts config, it processes the text file first (for couple of seconds), then stores in my Android/data directory.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=32992023-09-11T15:02:47ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>Host files, by definition, only apply to hosts (which is another way of saying domain names).</p>
<p>The domain name part of a URL provides a little bit of informaiton, but, especially in relation to privacy invasions, often doesn't provide enough information to know if something should be blocked. For that, a deeper analysis of the URL that comes after the host is often needed.</p>
<p>Reading over the AdBlockPlus documentation can provide some sense of the nuance of information that can be checked once you move beyond just dealing with host files.</p>
<p><a class="external" href="https://help.adblockplus.org/hc/en-us/articles/360062733293">https://help.adblockplus.org/hc/en-us/articles/360062733293</a></p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33142023-09-12T11:28:53Zstein chen
<ul></ul><p>@ask low Maybe "https://github.com/Slion/Fulguris", which is FOSS and available at F-Droid would be worth checking out? It has the ability to add your own abp-syntax-lists.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33152023-09-12T17:25:44ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>That's an interesting browser. I will have to take a look at it.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33682023-10-15T11:08:24Zask low
<ul></ul><p>Current workaround. I've been using personalDNSfilter (<a class="external" href="https://github.com/IngoZenz/personaldnsfilter">https://github.com/IngoZenz/personaldnsfilter</a>) on rooted mode (without VPN) which is a systemwide implementation of local DNS. It supports custom filter lists, as well as auto updation period too.<br />With this, I disable PB's host files altogether. Works perfectly.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33772023-10-16T17:22:08ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>You might want to run Privacy Browser's filter lists in addition to a DNS filter, as DNS is basically the same as host files. It only looks at the domain name and can't filter based on anything else in the URL.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33822023-10-16T22:45:25Zask low
<ul></ul><p>I do understand the difference between host based filtering and query based filtering. But I don't think one can achieve a better result than the other. You can easily convert Easylist into hosts and use it as it is.<br /><a class="external" href="https://github.com/ProgramComputer/Easylist_adservers_hosts">https://github.com/ProgramComputer/Easylist_adservers_hosts</a><br />The above is only for Easylist Adservers. The same applies for EasyPrivacy, EasyCookies & Annoyances. I did request for it though.<br /><a class="external" href="https://github.com/ProgramComputer/Easylist_adservers_hosts/issues/4">https://github.com/ProgramComputer/Easylist_adservers_hosts/issues/4</a><br />Not sure if it'll be done. For now, I disabled the primary Easylist from PBA, & kept the rest enabled.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33852023-10-17T01:37:02ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>But, by converting them, all you do is strip out the extra information and only consider the domain name. And for entries that don't even have a domain name, how would you convert them? For example:</p>
<code>/getads/*</code>
<p>Or, something like this:</p>
<code>/googleadservices/*</code>
<p>Or, something like this:</p>
<code>/track_click?</code>
<p>These are examples from EasyList and EasyPrivacy.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33882023-10-17T01:45:50Zask low
<ul></ul><p>I haven't thought of that. That is why some reddit posts claim that DNS adblocking is not as effective as dedicated browser content blocking. I didn't take them seriously.</p> Privacy Browser Android - Feature #182: Allow users to manually or automatically update the filter listshttps://redmine.stoutner.com/issues/182?journal_id=33892023-10-17T01:48:08ZSoren Stoutnersoren@stoutner.com
<ul></ul><p>There should be no problem enabling all of Privacy Browser's filter lists as well as using a DNS filter that you can update yourself. You get all the benefits of both worlds.</p>