Defender II - updated for encrypted devices (originated by nodevel)

Your rating: None Average: 5 (18 votes)

This is the enhanced but mainly original application Defender by nodevel , see (old, deprecated!): and its repository


It was updated for devices with encrypted /home volume, on which it caused boot problems (of course it can also be used on unencrypted devices). And taken care of the new 'defaultuser'.

No more, no less (okay, here and there a bit more now ;)...


New forked repo (github) can now be found here:

And for discussions (FSO ) see here:


Application versions: 
File harbour-defender-0.4.1-1.armv7hl.rpm83.88 KB23/11/2020 - 02:10
File harbour-defender-0.4.2-1.armv7hl.rpm84.19 KB02/12/2020 - 22:12
File harbour-defender-0.4.3-1.armv7hl.rpm84.29 KB24/02/2021 - 09:54
File harbour-defender-0.5.1-1.armv7hl.rpm85.02 KB25/02/2021 - 10:14
File harbour-defender-0.5.2-1.armv7hl.rpm85.03 KB01/03/2021 - 11:03
File harbour-defender-0.5.3-1.armv7hl.rpm85.32 KB16/03/2021 - 22:17
File harbour-defender-0.5.4-1.armv7hl.rpm85.82 KB25/03/2021 - 22:24
File harbour-defender-0.5.5-1.armv7hl.rpm85.85 KB27/03/2021 - 04:27
File harbour-defender-0.5.5-1.i486.rpm85.77 KB27/03/2021 - 10:29
File harbour-defender-0.5.5-1.aarch64.rpm79.53 KB15/05/2021 - 22:04
File harbour-defender-0.5.6-1.armv7hl.rpm86.38 KB06/06/2021 - 12:28
File harbour-defender-0.5.6-1.i486.rpm86.29 KB06/06/2021 - 12:28
File harbour-defender-0.5.6-1.aarch64.rpm79.8 KB06/06/2021 - 12:28
File harbour-defender-0.5.7-1.armv7hl.rpm88.5 KB12/11/2021 - 01:55
File harbour-defender-0.5.7-1.i486.rpm82.26 KB17/11/2021 - 19:12
File harbour-defender-0.5.7-1.aarch64.rpm82.23 KB17/11/2021 - 19:12
in case you are going to encrypt your device manually (only possible for some devices (Xs and XA2s) when having flashed SFOS <=, please make sure you uninstall defender before the encryption/reboot and install again afterwards!
(deprecated as of SFOS 4.1.0.xx, fixed by Jolla),
note to myself --> remove on next OS release...
in case you upgraded from SFOS 3 to SFOS 4 having Defender already installed you might need to re-install (or uninstall and install again) to make sure you have the SFOS4 hack working to let the browser make use of the changed hosts file.



- fixed handling of exception on resolvings hosts url (leading to 'update loop')

- added functionality (and pulley menu) to show an error log, in case it exists

- added creation of special lxc extra_config file to get the (native file system) /system/etc/hosts file bound into the Android (aliendalvik container) file system

- added funtionality (and pulley menu) to restart Android Support (needed to get the updates written to native hosts file read anew into the aliendalvik container)

- added new sources from (thanks to @dry1)

i486 and aarch64 build brought to you by courtesy of @orangecat



- fixed the annoyance that sporadically the hosts file was reset to default values (caused by a cyclic update without internet connectivity, e.g. flight mode)

- added new Adware repositories of  GoodbyeAds (thanks to @orangecat), be aware that mixing repositories of bigger size may take looong time (even hours) so keep it running...



- corrected version number and URL in spec file

- added support for i486 (Jolla tablet)

- provision of aarch64 (courtesy of @orangecat / FSO)



- added version info into DocsPage

- added removal of 'update trigger' file on uninstallation

- added pulley menu for removal of 'update trigger' file
  (still a reboot or uninstall/install or `devel-su systemctl restart harbour-defender`might be needed)



- fix the update loop, e.g. for community ports (where /system is mounted RO); import UnableToWriteHost exception and catch that situation on trying to write updated hosts file(s),

- added some small error logging writing to user space file /home/$USER/.config/harbour-defender

- fix rebuild_hosts to create a new blank default hosts file and save it correctly; NOT reading/copying the default /etc/hosts entries,



- fix regarding the Disable (all) lists at once pulley menu, now the Disable functionality works and disables all lists

(small typo only which looks like was there from the early beginning ;)



- take care of changes in SFOS4

- fix reading cookies.sqlite from new file location

- hack for sailjailed browser not taking changed hosts file into account (nsswitch.conf problem)

- more secure method at install time to have systemd not bootloop [ one scenario could still cause it: if you have defender installed on a non-encrypted device, (you upgrade this and) encrypt it, defender will have old systemd WantedBy references and cause your device to bootloop. Resolution: uninstall before encrypting and reinstall ]



removed not anymore working lists from configuration



fixing the start issue of path unit which caused the infinite update loop



take over from nodevel and fixing the boot loop on encrypted devices

as well as taking care of new default user name 'defaultuser' or old 'nemo'



DrYak's picture

For the people struggling with version 0.5.7 and Sailfish OS :

ziellos's picture

It seems the latest version 0.5.7 breaks Android support on SFOS 4.3!

peterleinchen's picture

Sorry sorry sorry.

Revoked the i486 and aarch64 packages for now until clarified.

peterleinchen's picture

New RPMs out (courtesy of orangecat) :)

Seven_of_nine's picture

Defender removes successfully annoying overlays from websites.
Thank you so much Peter!

nthn's picture

Hello, could you provide a 64-bit version? Thanks!

peterleinchen's picture

Most probably not :(


I do the 'programming', package (re-)building on device. I already tried to cross-compile the 64bit  elf and the package on device but stumbled about a

BuildRequires:  pkgconfig(Qt5Quick)

tried to solve via 'devel-su pkcon install qt5-qtdeclarative-qtquick-devel'

which would pull in a lot of dependencies breaking my device! :(


I stopped here and as I got (almost) no sufficient answer for this question I did not yet ask for above...

adel's picture

I just compiled the app for aarch64 with Sailfish IDE, and copied the rpm to X10ii. Installs quite fine.

What problems do you have to compile on the IDE? I had to extract defender.conf from one of your rpms, and copy it to qml/python and rename it to defender_default.conf, for the build to work.

peterleinchen's picture

As said above, I do it all on device, no IDE (maybe at some point I really should try the IDE way...)

And struggled with BuildRequires(QtQuick, QtGui). But somehow got it cross-compiled and packaged for aarch64 and was just about to ask for a 'guinea pig' that would like to test my rpm.


So anyone feeling brave enoug enough just PM me on FSO or TMO with his e-mail and I will send it to you.

tkoham's picture

Hi, just wanna say, many thanks for getting.this working again. Any word on 4.1 compat yet? I know the changes from 4.0 to 4.1 aren'nt nearly as drastic, just wondering.if anyone's tried it yet

peterleinchen's picture

I did not expect any incompabilities and did not not encounter any after just upgrading my X to

Please see also

ddobrev's picture

Your work is so outstanding that I'd like to make it even better. :) I have some bug reports for you, what's the best way to send them? You seem to have disabled issues at github.

peterleinchen's picture

Thanks. TBH I did not really think to take over maintainership, just wanted to get it working again (even I still use an unencrypted device).

I did not think about issues on github, standard forking was done.

Preferably you might report issues via a PR! ;)

But meanwhile you could use FSO for exchange.

mak_rev's picture

Hi, thank you for your work.
I have an issue with the sources. The sources don't get updated. The process never stops. Any one has noticed the same issue?

ferlanero's picture

Same here on a XA2 with an oficial SailfishOS 4.0.1 installed

peterleinchen's picture

Cannot reproduce with XA2 (3.2.1) nor with X nor Tablet (4.0.1).

If you select several sources the update (checking for duplicates) can take quite long. Maybe just give it enough time, could be up to 15 minutes or even longer..


Pldase check your user dir .config/harbour-update/ for any err.log file or start harbour-defender from console and look for any logging...

peterleinchen's picture

A 'bit' more info would be nice.



Using latest 0.5.3 version?

Device? SFOS version? Community port, free/paid license? Using Android?


What exactly are the steps you take?


rm ~/.config/harbour-defender/update

or see

from to

mak_rev's picture

I have a Xx with SFOS 4. 

It was 0.5.3. Now its 0.5.5

I just go on "update now"
Sources: Yoyos;; MVPS

I have removed rm ~/.config/harbour-defender/update. It didnt help

peterleinchen's picture

As said, I cannot reproduce this on XA2 (3.2.1), X (4.0.1), tablet (3.4.0).


Did you modify /etc/hosts manually and possibly screwed permissions?

ls -al /etc/hosts* /system/etc/hosts*

Should be for all: -rw-r--r-- 1 root root

as already was the case in the FSO thread.


Please check also for .config/harbour-defender/err.log or let me know some more details, console output...

ferlanero's picture

Could you packge an i486 version for the tablet, please? This program is so useful to navigate without interruptions! Thank you in advance.

peterleinchen's picture

And here we go (i486)...

ferlanero's picture

Thank you very much for adding the i486 support!!

peterleinchen's picture

Let's see...


As there are now also quite a few bug fixes involved I may think about supporting the tablet as well.

But meanwhile all tablet users are safe with using nodevel's original version.



damoleon's picture

hello, can I install 0.5.2 directly on sf ? when pressing "install" it says "problem with installing".



peterleinchen's picture

Yes, definitely.

Are you installing via Storeman? Tap fly-in banner and it will rwveal some more details.

Or via cli: devel-su pkcon install harbour-defender

damoleon's picture

I've downloaded the rpm from this same page :/


from terminal, if I run devel-su pkcon install harbour-defender, it says : "no packages were found"



peterleinchen's picture

Okay, this will not work.

Either use storeman (by osetr) and enable my repository.

Or download from here and use

devel-su pkcon install-local harbour-defender-0.5.2-1.armv7hl.rpm

damoleon's picture

Thanks ! I have the message though : fatal error : harbour-defender-0.5.2-1.armv7hl.rpm conflicts with sailfishos-hosts-adblock provided by sailfishos-hosts-adblock-0.4-1noarch

I probably tried a different adblocker previously a long time ago but cannot recall how to remove  it. Thanks for yourtime if you have a hint :)

Have a nice day

peterleinchen's picture

devel-su pkcon remove sailfishos-hosts-adblocker noadshosts

damoleon's picture

thanks you very much !! I managed to install it.