From b601380332d39eb07d89d4539317d31a38aa50cb Mon Sep 17 00:00:00 2001 From: bjd Date: Sat, 12 Apr 2025 14:29:41 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0rekey=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bjd --- api/@ohos.data.relationalStore.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/api/@ohos.data.relationalStore.d.ts b/api/@ohos.data.relationalStore.d.ts index a47fbcfabc..6e483ced25 100644 --- a/api/@ohos.data.relationalStore.d.ts +++ b/api/@ohos.data.relationalStore.d.ts @@ -4333,6 +4333,23 @@ declare namespace relationalStore { */ batchInsertWithConflictResolutionSync(table: string, values: Array, conflict: ConflictResolution): number; + /** + * Change the encrypted database key. + * + * @param { CryptoParam } cryptoParam - Indicates the crypto parameters. + * @returns { number } The number of values that were inserted if the operation is successful. returns -1 otherwise. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; + *
2. Incorrect parameter types. + * @throws { BusinessError } 801 - Capability not supported. + * @throws { BusinessError } 14800000 - Inner error. + * @throws { BusinessError } 14800014 - Already closed. + * @throws { BusinessError } 14800015 - The database does not respond. + * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core + * @crossplatform + * @since 20 + */ + rekey(cryptoParam: CryptoParam): number; + /** * Updates data in the database based on a specified instance object of RdbPredicates. * -- Gitee From 9f1b52c62d6051789a181593364bcf501738a52a Mon Sep 17 00:00:00 2001 From: bjd Date: Sat, 12 Apr 2025 14:44:18 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0rekey=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bjd --- api/@ohos.data.relationalStore.d.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/api/@ohos.data.relationalStore.d.ts b/api/@ohos.data.relationalStore.d.ts index 6e483ced25..b20e09c6ae 100644 --- a/api/@ohos.data.relationalStore.d.ts +++ b/api/@ohos.data.relationalStore.d.ts @@ -4337,18 +4337,32 @@ declare namespace relationalStore { * Change the encrypted database key. * * @param { CryptoParam } cryptoParam - Indicates the crypto parameters. - * @returns { number } The number of values that were inserted if the operation is successful. returns -1 otherwise. + * @returns { Promise } -The promise returned by the function. * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; *
2. Incorrect parameter types. * @throws { BusinessError } 801 - Capability not supported. * @throws { BusinessError } 14800000 - Inner error. * @throws { BusinessError } 14800014 - Already closed. * @throws { BusinessError } 14800015 - The database does not respond. + * @throws { BusinessError } 14800021 - SQLite: Generic error. + * @throws { BusinessError } 14800022 - SQLite: Callback routine requested an abort. + * @throws { BusinessError } 14800023 - SQLite: Access permission denied. + * @throws { BusinessError } 14800024 - SQLite: The database file is locked. + * @throws { BusinessError } 14800025 - SQLite: A table in the database is locked. + * @throws { BusinessError } 14800026 - SQLite: The database is out of memory. + * @throws { BusinessError } 14800027 - SQLite: Attempt to write a readonly database. + * @throws { BusinessError } 14800028 - SQLite: Some kind of disk I/O error occurred. + * @throws { BusinessError } 14800029 - SQLite: The database is full. + * @throws { BusinessError } 14800030 - SQLite: Unable to open the database file. + * @throws { BusinessError } 14800031 - SQLite: TEXT or BLOB exceeds size limit. + * @throws { BusinessError } 14800032 - SQLite: Abort due to constraint violation. + * @throws { BusinessError } 14800033 - SQLite: Data type mismatch. + * @throws { BusinessError } 14800034 - SQLite: Library used incorrectly. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @crossplatform * @since 20 */ - rekey(cryptoParam: CryptoParam): number; + rekey(cryptoParam: CryptoParam): Promise; /** * Updates data in the database based on a specified instance object of RdbPredicates. -- Gitee From cfef362f3c6667b0960f0719539769ad0f73b0f9 Mon Sep 17 00:00:00 2001 From: bjd Date: Sat, 12 Apr 2025 16:04:39 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0rekey=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bjd --- api/@ohos.data.relationalStore.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.data.relationalStore.d.ts b/api/@ohos.data.relationalStore.d.ts index b20e09c6ae..7292898b66 100644 --- a/api/@ohos.data.relationalStore.d.ts +++ b/api/@ohos.data.relationalStore.d.ts @@ -4362,7 +4362,7 @@ declare namespace relationalStore { * @crossplatform * @since 20 */ - rekey(cryptoParam: CryptoParam): Promise; + rekey(cryptoParam?: CryptoParam): Promise; /** * Updates data in the database based on a specified instance object of RdbPredicates. -- Gitee From 0b472de6f3a099f7f90a4b09b97a27be15bee5bc Mon Sep 17 00:00:00 2001 From: bjd Date: Wed, 23 Apr 2025 22:25:53 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=89=8B=E5=8A=A8rekey=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: bjd --- api/@ohos.data.relationalStore.d.ts | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/api/@ohos.data.relationalStore.d.ts b/api/@ohos.data.relationalStore.d.ts index 7292898b66..e616360be8 100644 --- a/api/@ohos.data.relationalStore.d.ts +++ b/api/@ohos.data.relationalStore.d.ts @@ -4334,30 +4334,21 @@ declare namespace relationalStore { batchInsertWithConflictResolutionSync(table: string, values: Array, conflict: ConflictResolution): number; /** - * Change the encrypted database key. + * Changes the key used to encrypt the database. * - * @param { CryptoParam } cryptoParam - Indicates the crypto parameters. - * @returns { Promise } -The promise returned by the function. - * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; - *
2. Incorrect parameter types. + * @param { CryptoParam } cryptoParam - Crypto parameters. + * @returns { Promise } - Promise that returns no value. * @throws { BusinessError } 801 - Capability not supported. - * @throws { BusinessError } 14800000 - Inner error. + * @throws { BusinessError } 14800011 - Database corrupted. * @throws { BusinessError } 14800014 - Already closed. * @throws { BusinessError } 14800015 - The database does not respond. * @throws { BusinessError } 14800021 - SQLite: Generic error. - * @throws { BusinessError } 14800022 - SQLite: Callback routine requested an abort. * @throws { BusinessError } 14800023 - SQLite: Access permission denied. * @throws { BusinessError } 14800024 - SQLite: The database file is locked. - * @throws { BusinessError } 14800025 - SQLite: A table in the database is locked. * @throws { BusinessError } 14800026 - SQLite: The database is out of memory. * @throws { BusinessError } 14800027 - SQLite: Attempt to write a readonly database. * @throws { BusinessError } 14800028 - SQLite: Some kind of disk I/O error occurred. * @throws { BusinessError } 14800029 - SQLite: The database is full. - * @throws { BusinessError } 14800030 - SQLite: Unable to open the database file. - * @throws { BusinessError } 14800031 - SQLite: TEXT or BLOB exceeds size limit. - * @throws { BusinessError } 14800032 - SQLite: Abort due to constraint violation. - * @throws { BusinessError } 14800033 - SQLite: Data type mismatch. - * @throws { BusinessError } 14800034 - SQLite: Library used incorrectly. * @syscap SystemCapability.DistributedDataManager.RelationalStore.Core * @crossplatform * @since 20 -- Gitee