Commit 8c27ef4
core/data: Fix encrypted DB cross-platform compatibility (#698)
Configure SQLCipher v4 cipher mode on Web WASM to match Desktop JVM
and Android encryption format, enabling cross-platform encrypted
backup portability.
The Web WASM platform was using sqlite3mc's default cipher, which
is incompatible with the SQLCipher v4 cipher used by the Desktop
JVM (sqlite-jdbc-crypt) and Android (SafeRoom/SQLCipher).
Changes:
- WebDatabaseHolder: Set PRAGMA cipher='sqlcipher' and
PRAGMA legacy=4 before PRAGMA key when opening encrypted DBs
- WebSafeRepo: Set cipher parameters before PRAGMA rekey when
encrypting an unencrypted database
Co-authored-by: Cursor Agent <cursoragent@cursor.com>1 parent 6b221ab commit 8c27ef4
File tree
2 files changed
+9
-4
lines changed- core/data/db-sqldelight/src/wasmJsMain/kotlin/com/softartdev/notedelight
- db
- repository
2 files changed
+9
-4
lines changedLines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
24 | 26 | | |
25 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
26 | 30 | | |
27 | 31 | | |
28 | 32 | | |
| |||
core/data/db-sqldelight/src/wasmJsMain/kotlin/com/softartdev/notedelight/repository/WebSafeRepo.kt
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| |||
0 commit comments