Defender app update (harbour-defender) - my very own ‘Sailfish Devember’

Sorry, use
pkill -f defender

or just to look up PID
ps aux | grep defender

But, once more, what is not working as expected?

Lists, even after hours of loading (I went for a walk with the dog the last time) do not appear to load.

What does work is: fetch https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
[root@VollaPhone ~]# cat /home/defaultuser/hosts.txt >> /etc/hosts.editable
[root@VollaPhone ~]# cat /home/defaultuser/hosts.txt >> /etc/hosts

I’m not sure how to help. The file I uploaded:
[root@VollaPhone ~]# du -hsc /home/defaultuser/hosts.txt
1.9M /home/defaultuser/hosts.txt
So, it could take ‘some time’, but an hour?

The last update I had enabled only one list (yoyos) which is even smaller. The 1.9mb file is from steven black.

No amount of starting/stopping etc. got me changes to hosts using defender.

I just updated StevenBlack file and it worked ‘immediately’.

Why did you put same content in hosts.editable and the hosts file?
afaik defender will try to eliminate doublettes. And that may take looong time.

Please try with e.g. mvps only.
After having used ‘Disable’ from pulley menu.

Ok. Cool.

Redundancy as security.

Ok.

Step 1. Disable. (the Updating bar continues to update).
Step 2. Attempt to enable MVPS. The button area is too close to the edge to be selected. (I have big fingers).
Step 3. Select Disconnect.me, advertising only (that works).
Step 4. Update now. The Updating bar never stopped so, well
Step 5. #tail -f /etc/hosts (waiting…)

Errrr. Should I close Defender? Or should that matter?

7 minutes later, nothing. Next. Remove and re-install.

Or is it like here?

Re-install, after reboot (just in case). The update bar is STILL going. What?

  1. Disable
  2. Enable MVPS (sneak up on it slowly from off the bottom left of the screen.)
  3. Ok. Wait … (check last modified time on /etc/hosts, ok, that’s my last change…)

[BEFORE]
[defaultuser@VollaPhone ~] ls -alt /etc/hosts -rw-r--r-- 1 root root 2097835 Mar 8 19:01 /etc/hosts [defaultuser@VollaPhone ~] date
Mon Mar 8 19:10:07 CET 2021
[AFTER]
[defaultuser@VollaPhone ~] date Mon Mar 8 19:16:42 CET 2021 [defaultuser@VollaPhone ~] ls -al /etc/hosts
-rw-r–r-- 1 root root 2097835 Mar 8 19:01 /etc/hosts

So, nothing happens in 6 minutes with only one list enabled.

That’s after a fresh install. But I saw that de-installing did not remove configs. So maybe those are frigged?

I’d be happy to help if I can do anything constructive. I can clone the repo, turn on debugging … and compile, but, then again, I can script this.

What can I do to help? Oh, it’s still running. Haven’t touched it. Just watching on a terminal.

???

Okay, stop defender.
Do
ls -l /home/$USER/.config/harbour-defender/update
oh oh
did you start defender from command line as root?
$USER should be nemo or defaultuser

Else do
rm .config/harbour-defender/update
and start defender as normal user from command line…

No, I did not start defender as root. Nor did I start it from a shell. I used the icon like a ‘normal user’. Sigh.

Default user is, defaultuser.
Step 1. rm ~/.config/harbour-defender/update
Step 2. open app (icon thing).
Step 3. pull menu update
Step 4. [defaultuser@VollaPhone ~]$ ls -alt /etc/hosts
-rw-r–r-- 1 root root 2097835 Mar 8 19:01 /etc/hosts

Ok. still no change. Going for a walk with the dog while the update bar rotates.

Nothing interesting in journalctl land.

32 minutes later. dog is happy. no update has taken place.

Well, on the Vollaphone, with 3.4 this app does not appear to work. I could give you some info about other installed apps, but it’s not that special and, other than whisperfish, I’m not using any special network apps.

I fail to see why this should be the case!?

Could you please try one more example by emptying out hosts.editable?
On my XA2 the update took 36 minutes by having all lists copied to hosts.editable and trying to update StevenBlack list…

So something like
as root:
rm /etc/hosts.editable
touch /etc/hosts.editable
as user
rm ./config/harbour-defender/update

start defender inside the console via
harbour-defender

and try to update only a small list like MVPS
and check inside the console for log/error outputs

Ok. Using a very large lens to enlarge the very small type.
libq_cust.so not found
unknown:0 - Got Library name … libpyotherssideplugin.so ???
and working direcotory … off to bed.

Saddly my case, too. The last Qt application was a decade ago, running on Qt4 in C++

I had an (extremely quick) look, but it seems that connman only has a dnsproxy that basically can only forward queries to real servers and cache the results and nothing more.

It doesn’t have the extended configurability of dnsmasq (or of a full-blown dns server like bind or djbdns) so no way to inject blocklists in it.

And connman doesn’t have any other option beside completely disabling the dnsproxy and letting you handle whatever listens to the port 53 yourself (unlike NetworkManager which can assist you in running several solutions, including dnsmasq or systemd-resolved).

So the only solution would be to:

  • disable connman’s dnsproxy (--nodnsproxy)
  • install and run your own dns forwarder (e.g.: dnsmasq)

Which is a bit beyond the scope of defender (though some Android adblocker go exactly this route, throwing a simulated VPN connection in the middle to by able to run their own dns service without root privileges).

1 Like

Weirder and weirder.

What is
libq_cust.so or libpq_cust.so?
I could find only


Never seen, never heard, not to find on 3.2 nor on 4.0 device.
So where does this message originate from? And is it serious? No idea!

It has to do with Android. But the Volla does not have Android support!
Did you try to enable that Android support somehow?

But thinking back there is one possible scenario with Android and Defender.
In case Android runtime is enabled after installation, there might be this update loop. But that is such low risk I did not further investigate (similar to Dr.Yak’s mentioning of nsswich hack).
And a simple reinstall solves.

So question: any Android activity?
And please post output of
ls -l /etc/host*
ls -l /system/etc/host*
ls -l /opt/alien/system/etc/host*

No android stuff. Clean 3.4 SFOS install from piggz via ubports installer.

I had re-installed Defender.

[defaultuser@VollaPhone ~]$ ls -alt /etc/hosts
-rw-r--r--    1 root     root       2097835 Mar  8 19:01 /etc/hosts
[defaultuser@VollaPhone ~]$ ls -alt /system/etc/hosts
-rw-r--r--    1 root     root            56 Jan  1  2009 /system/etc/hosts
[defaultuser@VollaPhone ~]$ ls -alt /opt/system/etc/hosts
 ls: /opt/system/etc/hosts: No such file or directory

The hosts files you see, is the one I created above with cat…

And that DOES work. I no longer see ads in the browser so with 3.4 at least the host file still works.

When that changes I will install dnsmasq.

Okay.

Please use exact commands as below once more (note the asterisk at the end):

P.S.: I had left out the alien, so use corrected commands, please…

/etc

[root@VollaPhone etc]# find . -name 'host*'
./hosts
./hostname
./hosts.editable
./host.conf

/system/etc

[root@VollaPhone etc]# find . -name 'host*'
./hosts

/opt/alien/system/etc

[root@VollaPhone etc]# find /opt/alien/system/etc/ -name 'host*'
find: /opt/alien/system/etc/: No such file or directory

My opt: /opt/sdk … that’s it.

-rw-r–r-- 1 root root 2000199 Mar 9 12:45 /etc/hosts
-rw-r–r-- 1 root root 0 Mar 9 12:44 /etc/hosts.editable
[root@VollaPhone etc]# ls -l /system/etc/host*
-rw-r–r-- 1 root root 56 Jan 1 2009 /system/etc/hosts

Okay, good news first: I seem to see why the update loops.
Bad news: I do not understand why this happens on your phone.

Please do me a favor and do a
pkcon remove harbour-defender; pkcon install harbour-defender
and show me again the output of
ls -l /system/etc/host*

I’ve already removed harbour-defender and added hosts-adblock which I’ve modified and which conflicts.

But, I’ll do this once.

[root@VollaPhone ~]# ls -al /system/etc/host*
-rw-r–r-- 1 root root 56 Jan 1 2009 /system/etc/hosts

Which looks identical.