[Solved?] Hide my contacts to AlienDalvik (instead of cloning ALL the SFOS contacts)?

I’d like to try AlienDalvik and some android apps like Whatsapp, Signal and so on.
To use them, I have to share my contacts.
I would like not to share all my contacts but only contacts from people I’ll talk with in these apps.

It seems to me that AlienDalvik syncs the SFOS contacts DB /home/defaultuser/.local/share/system/privileged/Contacts/qtcontacts-sqlite/contacts.db with the android DB /home/.android/data/data/com.android.providers.contacts/databases/contacts2.db when starting (and maybe again after some delay/signal…).

Can I avoid AlienDalvik looking into SF contacts DB?
or otherways said
What is the program that imports contacts from SFOS to Android one?

I have been trying to see what program is opening the SFOS contacts DB with audit but could not add a rule.
Subsidary question: do someone know how to use audit in SFOS?

At least triplicated subject with:

I noticed that if I modify the first or last name of an contact, it doesn’t carry over to the Android side.

This is interesting.
We could create a huge dummy db, sync it by starting AD and then replace all the contacts with real ones. Big effort and a bit risky though.

These workarounds are sad. Jolla has created this problem when ported AD to lxc and didn’t even create a knob to control this awful behavior.
So much for ‘privacy’ OS.

PS If going down this slippery slope, chmod -r and then chattr -i on that android db might work.

I know, it is dirty.
But having read all the threads* asking to separate cleanly SF form Android since so long, it’s time to find something by ourselves.
I tried such things like what you say but the app I used to test, Google Contacts, stayed frozen on the first screen.

I also tried to play with the SF db, change some flags…no way, it imports.

But I think I found a dirty workaround to not reveal my contacts to Android.
To check wether it was working, I installed Google Contacts and Whatsapp.
I Started Android support and couldn’t find my contacts in Google Contacts or Whatsapp neither.

Would someone try this so I can tag as [Dirty Solved]?

I noticed that contacts were synced during the starting phase of Android Support.
So I added a line into one of the starting scripts to change the owner of the contacts db to root.
And at the beginning of an end-starting script, I added to change it back to normal owner.

Works for me so long.
The remaining question is:
Does AD sync the contacts from time to time while it is on?
I should wait some days with AD on before to post but…you know, too exited.

as root, edit /usr/sbin/start-aliendalvik.sh and at the beginning, insert:

chown root:root /home/defaultuser/.local/share/system/privileged/Contacts/qtcontacts-sqlite/contacts.db*

Then, edit /usr/sbin/alien-post-startup.sh and at the beginning, insert:

chown defaultuser:996 /home/defaultuser/.local/share/system/privileged/Contacts/qtcontacts-sqlite/contacts.db*

To test, one can add a new contact then start AD to check if it is seen in the Android contacts side.

‘*’ threads found after creating this one…well sorry

… and yet, in a delicious ironic twist, SFOS native apps can’t access the contactsdb…

1 Like

My guess is nephros is talking about an issue with native apps in sfos (sandboxing).

I just flashed the on an XA2.
It seems to me that this trick also works on 4.4

Before the workaround applied (normal conditions):

  • AD is off
  • Open SF People app, add contacts.
  • Launch AD
  • Open an android Contacts app
  • See contacts from SF imported
  • Add a contact into SF Peoples app
  • See the new contact imported on the fly into android
  • Turn AD off

Apply the trick

  • Open People app, add contacts.
  • Launch AD
  • See new contacts not imported from SF.
  • Add a new contact in People app
  • See new contacts not imported from SF.
  • SF Phone app has access contacts
  • SF Messages app has access to contacts

Limitations so far:
-I suppose it is better to have the People app closed while AD starts, hence, it is not possible to add contacts while AD starts.
-No phone calls or messages can be made/sent while AD starts as the db is not accessible.
-Not possible to select whether a contact will be seen or not from the Android side. It is a block lock.
-Not sure yet AD will not try to access the contacts db after some time, days…

The surprising thing is that even if permissions are set back to normal when AD has started, added contacts into SF People app while SD is ON are not imported on the fly any more into the Android side.
Like if AD would remember it is not possible after having failed while starting.

Jolla won’t pass or sell our data to other companies - they say. But contacts are leaking to Google apps…


No I am talking about the fact that there is no official way or API got access contacts when writing a SailfishOS app.

Which leads to the inability of apps like Fernschreiber (telegram) or s1p (VoIP) to access contacts properly without resorting to hacks.

Oops, sorry, thought irony was about my post… Gonna delete my un-useful answer then
But this not ideal trick works for hiding contacts to Android, doesn’t it?
I mean, It was a relief for me. Maybe useful to others.
So I could mark as solved in the meantime we have a more official solution,
and also link this “solution” in the numerous other threads where people ask for hiding contacts to Android.