Defender - a privacy guard for SailfishOS.
As an alternative/replacement to the Hosts Adblock, Defender uses the /etc/hosts approach - a proven way of blocking ads, banners, 3rd party cookies, 3rd party page counters etc. by adding blocking rules to the /etc/hosts system file. Bundled with a simple cookie manager, it allows to choose from multiple sources, either from a safe GUI (which does not require root access), or by editing the configuration files.
This allows to easily enable and disable different sources, while still keeping your system in non-root environment.
This app uses a modified version of the python-hosts library.
Sources of ad/spyware blocking rules and their websites are to be found in the application itself. Do not forget to thank/donate to their creators.
Mind that the app is still in an early version, so use with caution, as damage may occur. You have been warned. Please let me know if you experience any problems.
Data costs may apply, so check the WLAN only option to be safe from the data cost from your provider. Updating may take a long time, depending on the size of the sources.
Also, it is unlikely that the third party sources available in the app may compromise your device, but it may happen (that is why none are enabled by default). Enable only sources you trust - I am not responsible for their contents.
If you like this app, please consider a small donation:
Attachment | Size | Date |
---|---|---|
harbour-defender-0.1-2.armv7hl.rpm | 82.54 KB | 01/02/2017 - 01:38 |
harbour-defender-0.1-2.i486.rpm | 82.56 KB | 01/02/2017 - 01:38 |
harbour-defender-0.2-1.i486.rpm | 82.61 KB | 01/02/2017 - 01:49 |
harbour-defender-0.2-1.armv7hl.rpm | 82.55 KB | 01/02/2017 - 01:49 |
harbour-defender-0.3-1.armv7hl.rpm | 73.08 KB | 02/02/2017 - 01:23 |
harbour-defender-0.3-1.i486.rpm | 73.06 KB | 02/02/2017 - 01:23 |
harbour-defender-0.4.0-1.i486.rpm | 73.41 KB | 03/02/2017 - 01:45 |
harbour-defender-0.4.0-1.armv7hl.rpm | 73.4 KB | 03/02/2017 - 01:45 |
0.4
0.3
0.2
0.1
Comments
eson
Thu, 2017/02/02 - 10:57
Permalink
Can't make it work. App says "Updating", but nothing more happens. No hosts generated and "Updating" is stuck on screen. Tried reinstall but it did not help. Can't even find a way to kill the "Updating".
SFOS 2.0.5.6 @ Jolla C
<code>
,---
| SailfishOS 2.0.5.6 (Haapajoki) (armv7hl)
'---
[nemo@Sailfish ~]$ harbour-defender
[D] QWaylandEglClientBufferIntegration::QWaylandEglClientBufferIntegration:62 - Using Wayland-EGL
[W] unknown:24 - file:///usr/share/harbour-defender/qml/pages/components/CookiesMenuItem.qml:24: TypeError: Cannot read property 'cookies_count' of undefined
[W] unknown:29 - file:///usr/share/harbour-defender/qml/pages/components/CookiesMenuItem.qml:29: TypeError: Cannot read property 'domains_count' of undefined
[W] unknown:24 - file:///usr/share/harbour-defender/qml/pages/components/SourcesMenuItem.qml:24: TypeError: Cannot read property 'hosts_lines' of undefined
[W] unknown:29 - file:///usr/share/harbour-defender/qml/pages/components/SourcesMenuItem.qml:29: TypeError: Cannot read property 'sources_enabled_count' of undefined
[D] :49 - Working directory: /home/nemo
</code>
nodevel
Thu, 2017/02/02 - 11:19
Permalink
Hi,
thanks for the feedback. First, there's nothing wrong with the output you attached, just a normally working app.
Second, which version do you have installed? Is it 0.3?
Finally, updating can take a long time to finish, depending on the number of sources you have enabled. You cannot kill the update from the app and that is by design, as it would require root privileges and could compromise your device.
If you want to check if the update is running, you can launch top from the terminal and see if there's a python3 process with high CPU usage, if there is, then that's probably it. You can kill it from there, but you need to make sure to remove the following files afterwards:
If there is no such process, then try selecting Update now from the app again and see if it appears.
I will consider adding an option to Settings to delete these two files in case the update has failed without deleting them.
eson
Thu, 2017/02/02 - 12:20
Permalink
Yes, it's v0.3. No python3 process and I can start it again. Had it running for a moment, but it seemed to kill it self.
I'll clean up and start it all over again. Hope this time it goes better. I missed the /tmp/hosts last time.
Edit:
Seems like update went ok, because there is a full /tmp/hosts, but the app gui still says "Updating", and the /etc/hosts is still empty. I only have one list so far (MVPS Hosts).
giskard
Thu, 2017/02/02 - 18:33
Permalink
I can confirm the exact same issue. SF 2.0.5 on Jolla 1.
/tmp/hosts is created, but not copied to /etc/hosts
No python process listed on top
nodevel
Thu, 2017/02/02 - 22:57
Permalink
Thanks for feedback! I will try to investigate the issue, as it works fine here.
I already have some ideas - do you have AlienDalvik installed and if you do, are the following directories present in the filesystem?
eson
Fri, 2017/02/03 - 00:09
Permalink
No AlienDalvik here. Never used it.
nodevel
Fri, 2017/02/03 - 01:48
Permalink
Funny thing is that I almost never used it, but have it installed just in case, so this problem escaped me.
It should be fixed in the 0.4 version. Thanks for your patience.
eson
Fri, 2017/02/03 - 10:36
Permalink
Yes, thanks! Loading lists in 0.4 is working. All this testing caused other errors, however.
Defender frontpage doesn't show blocked, lists, cookies or domains anymore. Also my cookie handeling is gone. Cookies seem to be locked, no matter what settings. Browser don't save cookies no more. Problem resist also when I remove Defender.
I locked cookies ones in Defender 0.3, but unlocked it again almost immediately. That's when this issue appeared.
My scenario was:
...and this issue was a fact.
babba22
Sun, 2017/02/12 - 17:37
Permalink
Same for me, I followed exactly the same steps as eson and now defender can't access cookies database anymore
giskard
Thu, 2017/02/02 - 23:16
Permalink
No aliendalvik in my case (but I installed and removed it some time ago). I have also restored the default /etc/hosts which was manually substituted by a version with the MPV blocklist.
/etc/hosts permissions are -rw-r--r-- and is owned by root:root
I have /system/etc but not /opt/alien/system/etc
nodevel
Fri, 2017/02/03 - 01:47
Permalink
Thanks! It was the problem I suspected - I did not test it without AlienDalvik, which I should have. Version 0.4 should be up with a fix for your scenario, together with other fixes.
Thanks for the patience.
giskard
Fri, 2017/03/03 - 18:47
Permalink
I don't know why, but it looks like it's happening again. Defender can't update my hosts file. Last time it was changed was 2017-02-08. I can't even disable it and meke it restore my previous hosts file.
EDIT: Apparently resolved by reinstalling Defender.
giskard
Fri, 2017/02/03 - 11:03
Permalink
I can confirm that now it can download lists and update /etc/hosts :)
lkdhf
Thu, 2017/02/02 - 02:23
Permalink
Wonderful, thank you!
bomo
Wed, 2017/02/01 - 15:08
Permalink
Maybe a stupid question, but how to enable a certain hosts provider ? Normal and long press just open their info page.
nodevel
Thu, 2017/02/02 - 01:26
Permalink
That's not a stupid question at all, thanks for asking!
You need to tap the indicator on the left. I thought about bringing another indicator to the info page, so I can consider it for a future update.
Either way, please update to 0.3 which fixes the main functionality (generating /etc/hosts file).
eson
Wed, 2017/02/01 - 08:20
Permalink
Thanks! Great app.
nodevel
Thu, 2017/02/02 - 01:29
Permalink
I'm glad you like it!
PS: Please update to 0.3 which brings an important fix to the functionality.
DarkTuring
Wed, 2017/02/01 - 07:12
Permalink
Fantastic app, one question, how do you whitlist a cookie, when long pressing a cookie i can only remove or lock it from pulley menu, but the white listing selection is missing.
SFOS 2.0.5.6 Intex Aquafish.
Alternatively in documentation could you provide a simple example of whitelisting two hosts?
nodevel
Thu, 2017/02/02 - 01:29
Permalink
Thanks for the feedback.
Currently you can only whitelist/blacklist a whole domain (by pressing the section header). Whitelisting/blacklisting individual cookies may come in a future update if there's enough demand for it.
I'll try to improve the documentation, thanks for the suggestion.
By the way, please update to 0.3 which fixes the main functionality (generating /etc/hosts file).
DarkTuring
Thu, 2017/02/02 - 05:55
Permalink
Thanks for the clarification, i upgraded.
Inidvidual cookie blooking could be interesting! Not sure this has ever been attempted, but i love the idea and your app gives great visibility of them.
Pages