Skip to content

Migrating to SQLDriver with Room3 #84

Closed

Description

@InputOutputZ

Hi there,

I'm not sure from where to start but I have two questions that will determine if there is a bug, documentation is not complete or this issue ticket should be a feature request.

Here is a context, I have checked the source code of Room3 and sqlcipher-android, it doesn't look like it has addressed the removal of openHelperFactory as part of SupportSQLiteOpenHelper.

If this is true, will sqlcipher-android support Room3 and when?
if this is false, is there anyone knows and can hint out how to configure sqlite database with SupportOpenHelperFactory i.e. encryption key using Room3 and allows overriding create function so encryption key can be cleared from memory after use?

Setting driver have only one option that is the name of the database file, which can be set. Also, there is only option to change password after building the database, anyone have an idea better than me?

With thanks.

Zakaria.

Refer to
https://android-developers.googleblog.com/2026/03/room-30-modernizing-room.html
https://developer.android.com/jetpack/androidx/releases/room3

Activity

  1. sjlombardo commented on Mar 15, 2026

    @sjlombardo
    Member

    Hello @InputOutputZ - we're aware of the upcoming changes in Room 3. However, SQLCipher does not support Room 3 at this time due to the changes. Since Room 3 is still in alpha status it is still on our pending list. We will work on updating the integration as Room 3 stabilizes.

  2. InputOutputZ commented on Mar 17, 2026

    @InputOutputZ
    Author

    Hello @InputOutputZ - we're aware of the upcoming changes in Room 3. However, SQLCipher does not support Room 3 at this time due to the changes. Since Room 3 is still in alpha status it is still on our pending list. We will work on updating the integration as Room 3 stabilizes.

    Thanks for clearing the confusion. Btw, I actually managed to get Room 3 working with SQLCipher, but just failed clearing the key from the initialised variable it holds, while I tried using postKey function with SQLiteDatabaseHook, but it fails decrypting database in subsequent keying calls. While it works using Room 2 and openHelperFactory method.

    Please if you can do take note of this, and I hope when SQLCipher team is going to package for Room 3 to address this issue, since it really hurts keeping the encryption key in memory loaded for as long as the database connection is needed, sometimes like all the time and this is a huge security risk.

    Zakaria.

  3. InputOutputZ commented on Mar 17, 2026

    @InputOutputZ
    Author

    Also, debugging SQLCipher encrypted database using Android Studio Database inspector, I think if you provide support for this, it would be a great feature. Please do take note of this as well,

    With thanks.

    Zakaria.

  4. mandrachek commented on Apr 1, 2026

    @mandrachek

    Kotlin Multiplatform needs this! It would be ideal if sqlcipher room 3 support was available for Android, iOS (and variants like tvOS and watchOS), and jvm/desktop (arm/intel).

    js and wasmJs are probably too much to ask for, but one can dream.

  5. b95505017 commented on Jul 24, 2026

    @b95505017
  6. developernotes commented on Jul 29, 2026

    @developernotes
    Member

    Hi @b95505017,

    We will be adding support for Room 3 in a future release of SQLCipher for Android. I don't have a timeframe to share at the moment, but we will communicate with this thread when it becomes available.

  7. erangross27 commented on Aug 7, 2026

    @erangross27

    Adding a concrete production use case waiting on this: HomeProof, a fully offline home-documentation app for Android (Kotlin, Room 3 in production, 19 locales, no network permission by design). We are shipping user-opt-in encryption at rest as a headline privacy feature — file-level encryption ships first, but encrypting the database itself is blocked solely on SQLCipher support for Room 3, since downgrading to the maintenance-only Room 2.8 line is not an option for us.

    One integration note that may help planning: Android's platform SQLite provides ICU collation (COLLATE LOCALIZED / UNICODE) that replacement builds lose. For apps shipping RTL and CJK locales, migration guidance on collation — or an ICU-enabled variant — would matter to us as much as the driver integration itself.

    Happy to beta-test the Room 3 integration on a real multi-locale production app when it's ready, and +1 to updates in this thread.

  8. developernotes commented on Aug 18, 2026

    @developernotes
    Member

    We have just released SQLCipher 4.18.0 1 which includes an update to sqlcipher-android containing support for Room 3.

    Footnotes

    1. https://www.zetetic.net/blog/2026/08/18/sqlcipher-4.18.0-release/ ↩

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions