@capacitor-community/sqlite 6.0.1 → 6.0.2-dev.ecc62b3.1738008093
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CapacitorCommunitySqlite.podspec +1 -1
- package/README.md +71 -91
- package/android/build.gradle +9 -9
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLite.java +11 -13
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLitePlugin.java +15 -22
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java +2 -1
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/ImportExportJson/ExportToJson.java +5 -6
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/ImportExportJson/ImportFromJson.java +117 -117
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsBiometric.java +27 -31
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsDownloadFromHTTP.java +13 -12
- package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/UtilsFile.java +2 -1
- package/dist/esm/definitions.js +1 -3
- package/dist/esm/definitions.js.map +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/web.js.map +1 -1
- package/dist/plugin.cjs.js +2 -6
- package/dist/plugin.cjs.js.map +1 -1
- package/dist/plugin.js +2 -6
- package/dist/plugin.js.map +1 -1
- package/electron/dist/plugin.js +6197 -6164
- package/electron/dist/plugin.js.map +1 -1
- package/electron/{rollup.config.js → rollup.config.mjs} +1 -3
- package/ios/Plugin/CapacitorSQLite.swift +5 -5
- package/ios/Plugin/Database.swift +1 -1
- package/ios/Plugin/ImportExportJson/ExportToJson.swift +7 -7
- package/ios/Plugin/Models/KeychainServices.swift +1 -1
- package/ios/Plugin/Utils/UtilsBinding.swift +2 -2
- package/ios/Plugin/Utils/UtilsDelete.swift +4 -4
- package/ios/Plugin/Utils/UtilsDownloadFromHTTP.swift +2 -2
- package/ios/Plugin/Utils/UtilsDrop.swift +1 -1
- package/ios/Plugin/Utils/UtilsSQLCipher.swift +17 -17
- package/ios/Plugin/Utils/UtilsSQLStatement.swift +120 -121
- package/package.json +27 -25
- package/src/definitions.ts +37 -117
- package/src/index.ts +4 -8
- package/src/web.ts +59 -131
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.author = package['author']
|
|
12
12
|
s.source = { :git => package['repository']['url'], :tag => s.version.to_s }
|
|
13
13
|
s.source_files = 'ios/Plugin/**/*.{swift,h,m,c,cc,mm,cpp}'
|
|
14
|
-
s.ios.deployment_target = '
|
|
14
|
+
s.ios.deployment_target = '14.0'
|
|
15
15
|
s.dependency 'Capacitor'
|
|
16
16
|
s.dependency 'SQLCipher'
|
|
17
17
|
s.dependency 'ZIPFoundation'
|
package/README.md
CHANGED
|
@@ -2,30 +2,6 @@
|
|
|
2
2
|
<h3 align="center">SQLITE DATABASE</h3>
|
|
3
3
|
<p align="center"><strong><code>@capacitor-community/sqlite</code></strong></p>
|
|
4
4
|
<br>
|
|
5
|
-
<p align="center" style="font-size:50px;color:red"><strong>CAPACITOR 6</strong></p><br>
|
|
6
|
-
<br>
|
|
7
|
-
<!-- Note from the Owner - Start -->
|
|
8
|
-
<p align="center" style="font-size:50px;color:red"><strong>Note from the Owner</strong></p>
|
|
9
|
-
<!-- Note from the Owner - End -->
|
|
10
|
-
<br>
|
|
11
|
-
<!-- Message below Note from the Owner - Start -->
|
|
12
|
-
<p align="left" style="font-size:47px">Start --></p>
|
|
13
|
-
<br>
|
|
14
|
-
<p align="left">
|
|
15
|
-
I have been dedicated to developing and maintaining this plugin for many years since the inception of Ionic Capacitor. Now, at 73+ years old, and with my MacBook Pro becoming obsolete for running Capacitor 6 for iOS, I have made the decision to cease maintenance of the plugin. If anyone wishes to take ownership of this plugin, they are welcome to do so.
|
|
16
|
-
</p>
|
|
17
|
-
<br>
|
|
18
|
-
<p align="left">
|
|
19
|
-
It has been a great honor to be part of this development journey alongside the developer community. I am grateful to see many of you following me on this path and incorporating the plugin into your applications. Your comments and suggestions have motivated me to continuously improve it.
|
|
20
|
-
</p>
|
|
21
|
-
<br>
|
|
22
|
-
<p align="left">
|
|
23
|
-
I have made this decision due to several family-related troubles that require my full attention and time. Therefore, I will not be stepping back. Thank you to all of you for your support.
|
|
24
|
-
</p>
|
|
25
|
-
<br>
|
|
26
|
-
<p align="left" style="font-size:47px">End <--</p>
|
|
27
|
-
<!-- Message below Note from the Owner - End -->
|
|
28
|
-
<br>
|
|
29
5
|
|
|
30
6
|
<p align="center">
|
|
31
7
|
Capacitor community plugin for Native and Electron SQLite Databases.
|
|
@@ -35,8 +11,8 @@ I have made this decision due to several family-related troubles that require my
|
|
|
35
11
|
<br>
|
|
36
12
|
<p align="center">
|
|
37
13
|
<img src="https://img.shields.io/maintenance/yes/2024?style=flat-square" />
|
|
38
|
-
<a href="https://github.com/capacitor-community/sqlite/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/workflow/status/capacitor-community/sqlite/
|
|
39
|
-
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/l/@capacitor-community/sqlite?style=flat-square" /></a>
|
|
14
|
+
<a href="https://github.com/capacitor-community/sqlite/actions?query=workflow%3A%22CI%22"><img src="https://img.shields.io/github/actions/workflow/status/capacitor-community/sqlite/ci.yml?style=flat-square" /></a>
|
|
15
|
+
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/l/@capacitor-community/sqlite?branch=master&style=flat-square" /></a>
|
|
40
16
|
<br>
|
|
41
17
|
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/dw/@capacitor-community/sqlite?style=flat-square" /></a>
|
|
42
18
|
<a href="https://www.npmjs.com/package/@capacitor-community/sqlite"><img src="https://img.shields.io/npm/v/@capacitor-community/sqlite?style=flat-square" /></a>
|
|
@@ -48,9 +24,9 @@ I have made this decision due to several family-related troubles that require my
|
|
|
48
24
|
|
|
49
25
|
## Maintainers
|
|
50
26
|
|
|
51
|
-
| Maintainer
|
|
52
|
-
|
|
|
53
|
-
|
|
|
27
|
+
| Maintainer | GitHub | Social |
|
|
28
|
+
| ---------- | ----------------------------------------- | --------------------------------------------- |
|
|
29
|
+
| Robin Genz | [robingenz](https://github.com/robingenz) | [@robin_genz](https://twitter.com/robin_genz) |
|
|
54
30
|
|
|
55
31
|
To install:
|
|
56
32
|
|
|
@@ -66,7 +42,7 @@ npx cap sync
|
|
|
66
42
|
|
|
67
43
|
```
|
|
68
44
|
pnpm install --save @capacitor-community/sqlite
|
|
69
|
-
pnpm install --save
|
|
45
|
+
pnpm install --save jeep-sqlite
|
|
70
46
|
pnpm install --save sql.js
|
|
71
47
|
npx cap sync
|
|
72
48
|
```
|
|
@@ -112,7 +88,7 @@ export default config;
|
|
|
112
88
|
## More Reading:
|
|
113
89
|
|
|
114
90
|
- [Updating to Capacitor 5](https://capacitorjs.com/docs/updating/5-0)
|
|
115
|
-
- [Releases](https://github.com/capacitor-community/sqlite/blob/master/info_releases.md)
|
|
91
|
+
- [Releases](https://github.com/capacitor-community/sqlite/blob/master/docs/info_releases.md)
|
|
116
92
|
- [Changelog](https://github.com/capacitor-community/sqlite/blob/master/CHANGELOG.md)
|
|
117
93
|
- [Issues](https://github.com/capacitor-community/sqlite/issues)
|
|
118
94
|
- [Capacitor documentation](https://capacitorjs.com/docs/)
|
|
@@ -226,66 +202,66 @@ npm install --save-dev electron-builder@24.6.4
|
|
|
226
202
|
|
|
227
203
|
## Supported Methods by Platform
|
|
228
204
|
|
|
229
|
-
| Name
|
|
230
|
-
|
|
|
231
|
-
| createConnection (ReadWrite)| ✅
|
|
232
|
-
| createConnection (ReadOnly)
|
|
233
|
-
| closeConnection (ReadWrite)
|
|
234
|
-
| closeConnection (ReadOnly)
|
|
235
|
-
| isConnection (ReadWrite)
|
|
236
|
-
| isConnection (ReadOnly)
|
|
237
|
-
| open (non-encrypted DB)
|
|
238
|
-
| open (encrypted DB)
|
|
239
|
-
| close
|
|
240
|
-
| getUrl
|
|
241
|
-
| getVersion
|
|
242
|
-
| execute
|
|
243
|
-
| executeSet
|
|
244
|
-
| run
|
|
245
|
-
| query
|
|
246
|
-
| deleteDatabase
|
|
247
|
-
| importFromJson
|
|
248
|
-
| exportToJson
|
|
249
|
-
| deleteExportedRows
|
|
250
|
-
| createSyncTable
|
|
251
|
-
| setSyncDate
|
|
252
|
-
| getSyncDate
|
|
253
|
-
| isJsonValid
|
|
254
|
-
| isDBExists
|
|
255
|
-
| addUpgradeStatement
|
|
256
|
-
| copyFromAssets
|
|
257
|
-
| isDBOpen
|
|
258
|
-
| isDatabase
|
|
259
|
-
| isTableExists
|
|
260
|
-
| getTableList
|
|
261
|
-
| getDatabaseList
|
|
262
|
-
| getMigratableDbList
|
|
263
|
-
| addSQLiteSuffix
|
|
264
|
-
| deleteOldDatabases
|
|
265
|
-
| moveDatabasesAndAddSuffix
|
|
266
|
-
| checkConnectionsConsistency
|
|
267
|
-
| isSecretStored
|
|
268
|
-
| setEncryptionSecret
|
|
269
|
-
| changeEncryptionSecret
|
|
270
|
-
| clearEncryptionSecret
|
|
271
|
-
| checkEncryptionSecret
|
|
272
|
-
| initWebStore
|
|
273
|
-
| saveToStore
|
|
274
|
-
| getNCDatabasePath
|
|
275
|
-
| createNCConnection
|
|
276
|
-
| closeNCConnection
|
|
277
|
-
| isNCDatabase
|
|
278
|
-
| transaction
|
|
279
|
-
| getFromHTTPRequest
|
|
280
|
-
| isDatabaseEncrypted
|
|
281
|
-
| isInConfigEncryption
|
|
282
|
-
| isInConfigBiometricAuth
|
|
283
|
-
| getFromLocalDiskToStore
|
|
284
|
-
| saveToLocalDisk
|
|
285
|
-
| beginTransaction
|
|
286
|
-
| commitTransaction
|
|
287
|
-
| rollbackTransaction
|
|
288
|
-
| isTransactionActive
|
|
205
|
+
| Name | Android | iOS | Electron | Web |
|
|
206
|
+
| :--------------------------- | :------ | :--- | :------- | :--- |
|
|
207
|
+
| createConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
|
|
208
|
+
| createConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ | since 4.1.0-7 |
|
|
209
|
+
| closeConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
|
|
210
|
+
| closeConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ | since 4.1.0-7 |
|
|
211
|
+
| isConnection (ReadWrite) | ✅ | ✅ | ✅ | ✅ |
|
|
212
|
+
| isConnection (ReadOnly) | ✅ | ✅ | ✅ | ❌ | since 4.1.0-7 |
|
|
213
|
+
| open (non-encrypted DB) | ✅ | ✅ | ✅ | ✅ |
|
|
214
|
+
| open (encrypted DB) | ✅ | ✅ | ✅ | ❌ |
|
|
215
|
+
| close | ✅ | ✅ | ✅ | ✅ |
|
|
216
|
+
| getUrl | ✅ | ✅ | ❌ | ❌ |
|
|
217
|
+
| getVersion | ✅ | ✅ | ✅ | ✅ |
|
|
218
|
+
| execute | ✅ | ✅ | ✅ | ✅ |
|
|
219
|
+
| executeSet | ✅ | ✅ | ✅ | ✅ |
|
|
220
|
+
| run | ✅ | ✅ | ✅ | ✅ |
|
|
221
|
+
| query | ✅ | ✅ | ✅ | ✅ |
|
|
222
|
+
| deleteDatabase | ✅ | ✅ | ✅ | ✅ |
|
|
223
|
+
| importFromJson | ✅ | ✅ | ✅ | ✅ |
|
|
224
|
+
| exportToJson | ✅ | ✅ | ✅ | ✅ |
|
|
225
|
+
| deleteExportedRows | ✅ | ✅ | ✅ | ✅ |
|
|
226
|
+
| createSyncTable | ✅ | ✅ | ✅ | ✅ |
|
|
227
|
+
| setSyncDate | ✅ | ✅ | ✅ | ✅ |
|
|
228
|
+
| getSyncDate | ✅ | ✅ | ✅ | ✅ |
|
|
229
|
+
| isJsonValid | ✅ | ✅ | ✅ | ✅ |
|
|
230
|
+
| isDBExists | ✅ | ✅ | ✅ | ✅ |
|
|
231
|
+
| addUpgradeStatement | ✅ | ✅ | ✅ | ✅ | Modified 4.1.0-6 |
|
|
232
|
+
| copyFromAssets | ✅ | ✅ | ✅ | ✅ |
|
|
233
|
+
| isDBOpen | ✅ | ✅ | ✅ | ✅ |
|
|
234
|
+
| isDatabase | ✅ | ✅ | ✅ | ✅ |
|
|
235
|
+
| isTableExists | ✅ | ✅ | ✅ | ✅ |
|
|
236
|
+
| getTableList | ✅ | ✅ | ✅ | ✅ |
|
|
237
|
+
| getDatabaseList | ✅ | ✅ | ✅ | ✅ |
|
|
238
|
+
| getMigratableDbList | ✅ | ✅ | ❌ | ❌ |
|
|
239
|
+
| addSQLiteSuffix | ✅ | ✅ | ❌ | ❌ |
|
|
240
|
+
| deleteOldDatabases | ✅ | ✅ | ❌ | ❌ |
|
|
241
|
+
| moveDatabasesAndAddSuffix | ✅ | ✅ | ❌ | ❌ |
|
|
242
|
+
| checkConnectionsConsistency | ✅ | ✅ | ✅ | ✅ |
|
|
243
|
+
| isSecretStored | ✅ | ✅ | ✅ | ❌ |
|
|
244
|
+
| setEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
|
|
245
|
+
| changeEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
|
|
246
|
+
| clearEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
|
|
247
|
+
| checkEncryptionSecret | ✅ | ✅ | ✅ | ❌ |
|
|
248
|
+
| initWebStore | ❌ | ❌ | ❌ | ✅ |
|
|
249
|
+
| saveToStore | ❌ | ❌ | ❌ | ✅ |
|
|
250
|
+
| getNCDatabasePath | ✅ | ✅ | ❌ | ❌ |
|
|
251
|
+
| createNCConnection | ✅ | ✅ | ❌ | ❌ |
|
|
252
|
+
| closeNCConnection | ✅ | ✅ | ❌ | ❌ |
|
|
253
|
+
| isNCDatabase | ✅ | ✅ | ❌ | ❌ |
|
|
254
|
+
| transaction | ✅ | ✅ | ✅ | ✅ |
|
|
255
|
+
| getFromHTTPRequest | ✅ | ✅ | ✅ | ✅ | since 4.2.0 |
|
|
256
|
+
| isDatabaseEncrypted | ✅ | ✅ | ✅ | ❌ | since 4.6.2-2 |
|
|
257
|
+
| isInConfigEncryption | ✅ | ✅ | ✅ | ❌ | since 4.6.2-2 |
|
|
258
|
+
| isInConfigBiometricAuth | ✅ | ✅ | ❌ | ❌ | since 4.6.2-2 |
|
|
259
|
+
| getFromLocalDiskToStore | ❌ | ❌ | ❌ | ✅ | since 4.6.3 |
|
|
260
|
+
| saveToLocalDisk | ❌ | ❌ | ❌ | ✅ | since 4.6.3 |
|
|
261
|
+
| beginTransaction | ✅ | ✅ | ✅ | ✅ | since 5.0.7 |
|
|
262
|
+
| commitTransaction | ✅ | ✅ | ✅ | ✅ | since 5.0.7 |
|
|
263
|
+
| rollbackTransaction | ✅ | ✅ | ✅ | ✅ | since 5.0.7 |
|
|
264
|
+
| isTransactionActive | ✅ | ✅ | ✅ | ✅ | since 5.0.7 |
|
|
289
265
|
|
|
290
266
|
|
|
291
267
|
## Documentation & APIs
|
|
@@ -450,3 +426,7 @@ l1ndch"><img src="https://avatars.githubusercontent.com/u/170952278?v=4" width="
|
|
|
450
426
|
<!-- ALL-CONTRIBUTORS-LIST:END -->
|
|
451
427
|
|
|
452
428
|
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
|
|
429
|
+
|
|
430
|
+
## Credits
|
|
431
|
+
|
|
432
|
+
A big thank you to [Jean Pierre Quéau](https://github.com/jepiqueau), who maintained this plugin until version 6.0.0.
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.7.0'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.2.1'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.6.1'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -19,13 +19,13 @@ apply plugin: 'com.android.library'
|
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
21
|
namespace "com.getcapacitor.community.database.sqlite"
|
|
22
|
-
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion :
|
|
22
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 35
|
|
23
23
|
packagingOptions {
|
|
24
24
|
exclude 'build-data.properties'
|
|
25
25
|
}
|
|
26
26
|
defaultConfig {
|
|
27
|
-
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion :
|
|
28
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
27
|
+
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 23
|
|
28
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 35
|
|
29
29
|
versionCode 1
|
|
30
30
|
versionName "1.0"
|
|
31
31
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -40,8 +40,8 @@ android {
|
|
|
40
40
|
abortOnError false
|
|
41
41
|
}
|
|
42
42
|
compileOptions {
|
|
43
|
-
sourceCompatibility JavaVersion.
|
|
44
|
-
targetCompatibility JavaVersion.
|
|
43
|
+
sourceCompatibility JavaVersion.VERSION_21
|
|
44
|
+
targetCompatibility JavaVersion.VERSION_21
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -66,5 +66,5 @@ dependencies {
|
|
|
66
66
|
//security library
|
|
67
67
|
implementation "androidx.security:security-crypto:1.1.0-alpha06"
|
|
68
68
|
implementation "androidx.biometric:biometric:1.1.0"
|
|
69
|
-
annotationProcessor 'androidx.room:room-compiler:2.
|
|
69
|
+
annotationProcessor 'androidx.room:room-compiler:2.6.1'
|
|
70
70
|
}
|
package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLite.java
CHANGED
|
@@ -92,11 +92,10 @@ public class CapacitorSQLite {
|
|
|
92
92
|
ks.load(null);
|
|
93
93
|
Enumeration<String> aliases = ks.aliases();
|
|
94
94
|
if (aliases.hasMoreElements()) {
|
|
95
|
-
masterKeyAlias =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
.build();
|
|
95
|
+
masterKeyAlias = new MasterKey.Builder(context)
|
|
96
|
+
.setKeyScheme(MasterKey.KeyScheme.AES256_GCM)
|
|
97
|
+
.setUserAuthenticationRequired(true, VALIDITY_DURATION)
|
|
98
|
+
.build();
|
|
100
99
|
} else {
|
|
101
100
|
masterKeyAlias = new MasterKey.Builder(context).setKeyScheme(MasterKey.KeyScheme.AES256_GCM).build();
|
|
102
101
|
}
|
|
@@ -149,14 +148,13 @@ public class CapacitorSQLite {
|
|
|
149
148
|
private void setSharedPreferences() throws Exception {
|
|
150
149
|
try {
|
|
151
150
|
// get instance of the EncryptedSharedPreferences class
|
|
152
|
-
this.sharedPreferences =
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
);
|
|
151
|
+
this.sharedPreferences = EncryptedSharedPreferences.create(
|
|
152
|
+
context,
|
|
153
|
+
"sqlite_encrypted_shared_prefs",
|
|
154
|
+
masterKeyAlias,
|
|
155
|
+
EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV,
|
|
156
|
+
EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM
|
|
157
|
+
);
|
|
160
158
|
this.uSecret = new UtilsSecret(this.context, this.sharedPreferences);
|
|
161
159
|
} catch (Exception e) {
|
|
162
160
|
throw new Exception(e.getMessage());
|
package/android/src/main/java/com/getcapacitor/community/database/sqlite/CapacitorSQLitePlugin.java
CHANGED
|
@@ -146,17 +146,15 @@ public class CapacitorSQLitePlugin extends Plugin {
|
|
|
146
146
|
oldpassphrase = call.getString("oldpassphrase");
|
|
147
147
|
if (implementation != null) {
|
|
148
148
|
getActivity()
|
|
149
|
-
.runOnUiThread(
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
rHandler.retResult(call, null, msg);
|
|
157
|
-
}
|
|
149
|
+
.runOnUiThread(() -> {
|
|
150
|
+
try {
|
|
151
|
+
implementation.changeEncryptionSecret(call, passphrase, oldpassphrase);
|
|
152
|
+
rHandler.retResult(call, null, null);
|
|
153
|
+
} catch (Exception e) {
|
|
154
|
+
String msg = "ChangeEncryptionSecret: " + e.getMessage();
|
|
155
|
+
rHandler.retResult(call, null, msg);
|
|
158
156
|
}
|
|
159
|
-
);
|
|
157
|
+
});
|
|
160
158
|
} else {
|
|
161
159
|
rHandler.retResult(call, null, loadMessage);
|
|
162
160
|
}
|
|
@@ -1535,12 +1533,10 @@ public class CapacitorSQLitePlugin extends Plugin {
|
|
|
1535
1533
|
getActivity().runOnUiThread(() -> rHandler.retResult(call, null, null));
|
|
1536
1534
|
} catch (Exception e) {
|
|
1537
1535
|
getActivity()
|
|
1538
|
-
.runOnUiThread(
|
|
1539
|
-
()
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
}
|
|
1543
|
-
);
|
|
1536
|
+
.runOnUiThread(() -> {
|
|
1537
|
+
String msg = "GetFromHTTPRequest: " + e.getMessage();
|
|
1538
|
+
rHandler.retResult(call, null, msg);
|
|
1539
|
+
});
|
|
1544
1540
|
}
|
|
1545
1541
|
};
|
|
1546
1542
|
Thread myHttpThread = new Thread(setHTTPRunnable);
|
|
@@ -1553,8 +1549,7 @@ public class CapacitorSQLitePlugin extends Plugin {
|
|
|
1553
1549
|
}
|
|
1554
1550
|
|
|
1555
1551
|
private void AddObserversToNotificationCenter() {
|
|
1556
|
-
NotificationCenter
|
|
1557
|
-
.defaultCenter()
|
|
1552
|
+
NotificationCenter.defaultCenter()
|
|
1558
1553
|
.addMethodForNotification(
|
|
1559
1554
|
"importJsonProgress",
|
|
1560
1555
|
new MyRunnable() {
|
|
@@ -1566,8 +1561,7 @@ public class CapacitorSQLitePlugin extends Plugin {
|
|
|
1566
1561
|
}
|
|
1567
1562
|
}
|
|
1568
1563
|
);
|
|
1569
|
-
NotificationCenter
|
|
1570
|
-
.defaultCenter()
|
|
1564
|
+
NotificationCenter.defaultCenter()
|
|
1571
1565
|
.addMethodForNotification(
|
|
1572
1566
|
"exportJsonProgress",
|
|
1573
1567
|
new MyRunnable() {
|
|
@@ -1579,8 +1573,7 @@ public class CapacitorSQLitePlugin extends Plugin {
|
|
|
1579
1573
|
}
|
|
1580
1574
|
}
|
|
1581
1575
|
);
|
|
1582
|
-
NotificationCenter
|
|
1583
|
-
.defaultCenter()
|
|
1576
|
+
NotificationCenter.defaultCenter()
|
|
1584
1577
|
.addMethodForNotification(
|
|
1585
1578
|
"biometricResults",
|
|
1586
1579
|
new MyRunnable() {
|
package/android/src/main/java/com/getcapacitor/community/database/sqlite/SQLite/Database.java
CHANGED
|
@@ -763,7 +763,7 @@ public class Database {
|
|
|
763
763
|
String substring = suffix.substring(returningIndex + "returning".length());
|
|
764
764
|
String names = substring.trim();
|
|
765
765
|
retObj.put("names", getNames(names));
|
|
766
|
-
|
|
766
|
+
}
|
|
767
767
|
}
|
|
768
768
|
return retObj;
|
|
769
769
|
}
|
|
@@ -786,6 +786,7 @@ public class Database {
|
|
|
786
786
|
}
|
|
787
787
|
return input.substring(0, minIndex).trim();
|
|
788
788
|
}
|
|
789
|
+
|
|
789
790
|
private JSObject isReturning(String sqlStmt) {
|
|
790
791
|
JSObject retObj = new JSObject();
|
|
791
792
|
|
|
@@ -164,12 +164,11 @@ public class ExportToJson {
|
|
|
164
164
|
throw new Exception("No sync_table available");
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
tables =
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
};
|
|
167
|
+
tables = switch (sqlObj.getMode()) {
|
|
168
|
+
case "partial" -> getTablesPartial(db, resTables);
|
|
169
|
+
case "full" -> getTablesFull(db, resTables);
|
|
170
|
+
default -> throw new Exception("CreateExportObject: expMode " + sqlObj.getMode() + " not defined");
|
|
171
|
+
};
|
|
173
172
|
if (tables.size() > 0) {
|
|
174
173
|
retObj.setDatabase(sqlObj.getDatabase());
|
|
175
174
|
retObj.setVersion(sqlObj.getVersion());
|