Commit e10ad80
committed
feat: Enable SQLCipher encryption for Desktop JVM
This commit introduces database encryption support for the Desktop JVM target using SQLCipher, achieving feature parity with the Android and iOS versions. This was accomplished by replacing the standard `sqlite-jdbc` driver with `sqlite-jdbc-crypt`, a fork that bundles SQLCipher.
Key changes include:
- **feat(db-sqldelight):**
- Added `sqlite-jdbc-crypt` as the JDBC driver for the `jvmMain` source set.
- Updated `JdbcDatabaseHolder` to construct an encrypted JDBC URL with SQLCipher parameters (`cipher=sqlcipher`, `legacy=4`, and `key`) when a password is provided.
- Implemented `JvmCipherUtils` to handle the encryption and decryption of the database file by leveraging SQLCipher's `ATTACH` and `sqlcipher_export` functionalities.
- Added `JvmCipherUtilsEncryptionTest` to provide robust testing for the encryption/decryption logic.
- **test(desktop):**
- Enabled previously ignored encryption-related UI tests for the desktop module (`flowAfterCryptTest`, `settingPasswordTest`).
- Improved the reliability of UI tests by adding descriptive logging, explicit waits, and ensuring `requireNotNull` checks in the navigation router for better error reporting.
- **refactor(ui-test):**
- Enhanced UI test helpers (`waitUntilDisplayed`, `waitAssert`, etc.) with descriptions for better debugging and logging.
- Added logging to UI test cases (`SettingPasswordTestCase`, `FlowAfterCryptTestCase`) to trace test execution flow.
- **chore(deps):**
- Bumped various dependencies, including AGP, Firebase, Compose, and SQLCipher.
- Updated package versions for Android, iOS, and Desktop to `8.4.8`.
- **docs:**
- Updated `README.md` and `ARCHITECTURE.md` files to reflect that encryption is now supported on the Desktop JVM platform.
- **fix(android):**
- Configured the Crashlytics log writer to capture logs from `Debug` severity and higher in release builds to improve remote diagnostics.1 parent 7eb17dc commit e10ad80
File tree
35 files changed
+835
-274
lines changed- app
- android
- src/main/java/com/softartdev/notedelight
- desktop
- src/jvmTest/kotlin/com/softartdev/notedelight/ui
- iosApp
- iosApp.xcodeproj
- iosApp.xcworkspace/xcuserdata/artur.xcuserdatad
- iosApp
- core/data/db-sqldelight
- src
- jvmMain/kotlin/com/softartdev/notedelight
- db
- repository
- jvmTest/kotlin/com/softartdev/notedelight/db
- docs
- gradle
- ui
- test-jvm/src/main/kotlin/com/softartdev/notedelight
- ui
- cases
- screen
35 files changed
+835
-274
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
| 27 | + | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| 55 | + | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
59 | 65 | | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
| 70 | + | |
64 | 71 | | |
65 | 72 | | |
66 | 73 | | |
| |||
82 | 89 | | |
83 | 90 | | |
84 | 91 | | |
85 | | - | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
89 | | - | |
90 | 95 | | |
91 | 96 | | |
92 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
478 | | - | |
| 478 | + | |
479 | 479 | | |
480 | 480 | | |
481 | 481 | | |
| |||
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
520 | | - | |
| 520 | + | |
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
| |||
Binary file not shown.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
0 commit comments