Duplicate of #163, already fixed. Fix will be included in next release.
Location of calendar settings storage on LineageOS 14.1 with Davdroid 1.11.4.1-ose?
-
Hi, here is the nearly automated the process of :
- Listing of all (but the one attached to the gmail account-) calendars in a google account .
- Entering them into Davdroid.
However one still needs to press the plus-symbol in Davdroid and hit
<enter>
after every calendar, so I think I can do better by just generating the settings data directly in excel, and transporting that data to the correct location on my (Android) phone.Hence, I was curious if anyone could tell me where for example the “base-url” would be stored by Davdroid? (And/or if it is encrypted in storage).
Kind regards!
-
@unrel said in Location of calendar settings storage on LineageOS 14.1 with Davdroid 1.11.4.1-ose?:
Hence, I was curious if anyone could tell me where for example the “base-url” would be stored by Davdroid? (And/or if it is encrypted in storage).
- The detected services and their URLs can be found in the service database:
https://gitlab.com/bitfireAT/davdroid/blob/c0ff8f61f9e86955d5e6f0e6833477a779ee2973/app/src/main/java/at/bitfire/davdroid/model/ServiceDB.kt (you can see a dump of these data in DAVdroid debug info). You can write to this database directly, but of course wrong entries can cause erroneous behavior. - Other information like the URL of a specific calendar is stored in those calendar’s sync fields, for instance
NAME
for the URL. See https://gitlab.com/bitfireAT/davdroid/blob/c0ff8f61f9e86955d5e6f0e6833477a779ee2973/app/src/main/java/at/bitfire/davdroid/resource/LocalCalendar.kt for more information.
Does that help?
- The detected services and their URLs can be found in the service database:
-
@rfc2822 Wow thank you so much for your quick and elaborate response!
It helps a lot and it even made me aware of 2 critical notions:
-
Perhaps, even though I manually can add the entry of a calendar in the 1st file, there is a counter or non-activated reference to that “calendar” somewhere else.
-
The potential erroneous behaviour can work it’s way back up into my actual calenders in the (google) server. Hence I should make a proper backup before engaging my attempts at a solution.
Thank you very much! If I am able to automatically add the calendars into the required files (before transfering those files {back} to the phone) I will Indicate it here. (Could be a few weeks.)
Kind regards!
-
-
Dear @rfc2822,
The calendar copy process linked in the above github, is now automated for Davdroid V2.x (requiring 1 click, still contains 2 bugs). Therefore I will not use the files anymore to copy the calendars to Davdroid.
Bug 1: The calendar attached to gmail is not copied.
Bug 2: The last calendar of the list contains an error in its link or description. -
In an attempt to make the synchronization a bit more fluent, I am trying to write the calendar settings directly into davdroid. However, I am unable to find the “ServiceDB.kt” file on my phone in LineageOS 14.1.
Now I can imagine that is because the ServicesDB.kt is compiled into the app. That would mean it does not itself contain the calendar settings, but I should be able to derive from that, where the calendar settings are stored. If that is true, I have yet been unable to derive that location.
Would anyone perhaps know the explicit file location in which the calendar settings of Davdroid are stored?
-
@unrel said in Location of calendar settings storage on LineageOS 14.1 with Davdroid 1.11.4.1-ose?:
Now I can imagine that is because the ServicesDB.kt is compiled into the app. That would mean it does not itself contain the calendar settings, but I should be able to derive from that, where the calendar settings are stored. If that is true, I have yet been unable to derive that location.
ServiceDB uses Android’s SQLiteOpenHelper with a file called
services.db
. SQLiteOpenHelper usesContext.getDatabasePath()
, so you can use that function to determine where your path is. In most times, it’s/data/data/<app>/databases/services.db
or something like that. But it may depend on your firmware. -
@rfc2822 said in Location of calendar settings storage on LineageOS 14.1 with Davdroid 1.11.4.1-ose?:
@unrel said in Location of calendar settings storage on LineageOS 14.1 with Davdroid 1.11.4.1-ose?:
Now I can imagine that is because the ServicesDB.kt is compiled into the app. That would mean it does not itself contain the calendar settings, but I should be able to derive from that, where the calendar settings are stored. If that is true, I have yet been unable to derive that location.
ServiceDB uses Android’s SQLiteOpenHelper with a file called services.db. SQLiteOpenHelper uses Context.getDatabasePath(), so you can use that function to determine where your path is. In most times, it’s /data/data/<app>/databases/services.db or something like that. But it may depend
Dear rfc2822, thank you once more for your quick response. Thanks to your tips I have been able to:
- Find the services.db file relative to the root of my devices as:
/data/data/at.bitfire.davdroid/databases/services.db
- Export and visually inspect the database with SQlite studio to determine which tables the services.db contain.
- That allows for conversion of the services.db to a .csv file according to: http://www.sqlitetutorial.net/sqlite-tutorial/sqlite-export-csv/.
- According to https://forums.bitfire.at/topic/264/view-changes-properties-of-an-existing-davdroid-account/21 the passwords are stored in
/data/system/users/0/accounts.db
. I have not yet been able to find that database but I will look into it in more detail. - If I can read and write those passwords back, I think it should be sufficient to use a single file containing all the calendars to setup Davdroid automatically.
Thank you very much for your suggestions, once again, if I complete the automation process I will report it back here.
- Find the services.db file relative to the root of my devices as: