Contextkit not working when sailjail is activated

REPRODUCIBILITY (% or how often): 100%
BUILD ID = OS VERSION (Settings > About product): 4.3.0.12
HARDWARE (XA2, X10, X10 II, …): XA2 Plus Dual SIM
UI LANGUAGE: en_GB
REGRESSION: (compared to previous public release: Yes, No, ?): No

DESCRIPTION:

As I am checking for an internet connection via contextProperty with the key Internet.NetworkState, I noticed it does not work anymore as soon as sailjail is active. No matter if I grant all permissions.

The journal log suggest it can no longer read the related contextkit file:

Nov 10 22:58:14 Sailfish harbour-welkweer[2272]: [W] unknown:-1 - file:///usr/share/contextkit/providers/Internet.qml: File not found
Nov 10 22:58:14 Sailfish harbour-welkweer[2272]: [D] onStatusChanged:68 - Error: unable to load context object at file:///usr/share/contextkit/providers/Internet.qml for namespace 'Internet' from key 'Internet.NetworkState'

But the file is in place and readable for the user. As soon as I start without sailjail I get a proper “connected” answer as a result, as expected.

PRECONDITIONS:

Sailjail activated

STEPS TO REPRODUCE:

  1. activate sailjail via app desktop file or global (/etc/sailjail/config/50-enable-sandboxing.conf)
  2. start app
  3. grant sailjail access

EXPECTED RESULT:

Internet connection state can be retrieved

ACTUAL RESULT:

No internet connection state can be retrieved

ADDITIONAL INFORMATION:

(Please ALWAYS attach relevant data such as logs, screenshots, etc…)

1 Like

Thanks, I filed this in our internal bug tracker. Could you provide a simple test case which we could use for reproducing the bug? I understand you encountered this while testing your Welkweer app, but it’s always easier to debug if you have a reduced the code to minimal which still reproduces the bug.

This should do it https://github.com/sailfishos/sailjail-permissions/pull/112

1 Like

@adekker perhaps you can verify the fix? Unfortunately it’s too late to fix this for 4.3.0, but the fix should be there in 4.4.0.

Yep, adding contextkit to the whitelist seems to fix this problem!

1 Like