@@ -38,16 +38,13 @@ import uniffi.matrix_sdk_crypto.DecryptionSettings
3838import uniffi.matrix_sdk_crypto.FfiConverterTypeCollectStrategy
3939import uniffi.matrix_sdk_crypto.FfiConverterTypeDecryptionSettings
4040import uniffi.matrix_sdk_crypto.FfiConverterTypeLocalTrust
41- import uniffi.matrix_sdk_crypto.FfiConverterTypeSecretsBundle
4241import uniffi.matrix_sdk_crypto.FfiConverterTypeSignatureState
4342import uniffi.matrix_sdk_crypto.LocalTrust
44- import uniffi.matrix_sdk_crypto.SecretsBundle
4543import uniffi.matrix_sdk_crypto.SignatureState
4644import uniffi.matrix_sdk_common.RustBuffer as RustBufferShieldStateCode
4745import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferCollectStrategy
4846import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferDecryptionSettings
4947import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferLocalTrust
50- import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferSecretsBundle
5148import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferSignatureState
5249
5350// This is a helper for safely working with byte buffers returned from the Rust code.
@@ -99,7 +96,7 @@ open class RustBuffer : Structure() {
9996
10097 @Suppress("TooGenericExceptionThrown")
10198 fun asByteBuffer() =
102- this.data?.getByteBuffer(0, this.len.toLong() )?.also {
99+ this.data?.getByteBuffer(0, this.len)?.also {
103100 it.order(ByteOrder.BIG_ENDIAN)
104101 }
105102}
@@ -1166,7 +1163,7 @@ external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_cross_sign
11661163external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_room_keys(`ptr`: Long,`passphrase`: RustBuffer.ByValue,`rounds`: Int,uniffi_out_err: UniffiRustCallStatus,
11671164): RustBuffer.ByValue
11681165external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_secrets_bundle(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
1169- ): Long
1166+ ): RustBuffer.ByValue
11701167external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_get_backup_keys(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
11711168): RustBuffer.ByValue
11721169external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_get_device(`ptr`: Long,`userId`: RustBuffer.ByValue,`deviceId`: RustBuffer.ByValue,`timeout`: Int,uniffi_out_err: UniffiRustCallStatus,
@@ -1613,7 +1610,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
16131610 if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_export_room_keys() != 48778.toShort()) {
16141611 throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
16151612 }
1616- if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_export_secrets_bundle() != 55212 .toShort()) {
1613+ if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_export_secrets_bundle() != 61345 .toShort()) {
16171614 throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
16181615 }
16191616 if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_get_backup_keys() != 30940.toShort()) {
@@ -1817,7 +1814,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
18171814 if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_room_id() != 19270.toShort()) {
18181815 throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
18191816 }
1820- if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_set_changes_listener() != 45584 .toShort()) {
1817+ if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_set_changes_listener() != 53319 .toShort()) {
18211818 throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
18221819 }
18231820 if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_state() != 23775.toShort()) {
@@ -3854,7 +3851,8 @@ public interface OlmMachineInterface {
38543851 fun `exportRoomKeys`(`passphrase`: kotlin.String, `rounds`: kotlin.Int): kotlin.String
38553852
38563853 /**
3857- * Export all the secrets we have in the store into a [`SecretsBundle`].
3854+ * Export all the secrets we have in the store into a serialized
3855+ * SecretsBundle.
38583856 *
38593857 * This method will export all the private cross-signing keys and, if
38603858 * available, the private part of a backup key and its accompanying
@@ -3866,7 +3864,7 @@ public interface OlmMachineInterface {
38663864 * **Warning**: Only export this and share it with a trusted recipient,
38673865 * i.e. if an existing device is sharing this with a new device.
38683866 */
3869- fun `exportSecretsBundle`(): SecretsBundle
3867+ fun `exportSecretsBundle`(): kotlin.String
38703868
38713869 /**
38723870 * Get the backup keys we have saved in our crypto store.
@@ -4857,7 +4855,8 @@ open class OlmMachine: Disposable, AutoCloseable, OlmMachineInterface
48574855
48584856
48594857 /**
4860- * Export all the secrets we have in the store into a [`SecretsBundle`].
4858+ * Export all the secrets we have in the store into a serialized
4859+ * SecretsBundle.
48614860 *
48624861 * This method will export all the private cross-signing keys and, if
48634862 * available, the private part of a backup key and its accompanying
@@ -4869,8 +4868,8 @@ open class OlmMachine: Disposable, AutoCloseable, OlmMachineInterface
48694868 * **Warning**: Only export this and share it with a trusted recipient,
48704869 * i.e. if an existing device is sharing this with a new device.
48714870 */
4872- @Throws(SecretsBundleExportException::class)override fun `exportSecretsBundle`(): SecretsBundle {
4873- return FfiConverterTypeSecretsBundle .lift(
4871+ @Throws(SecretsBundleExportException::class)override fun `exportSecretsBundle`(): kotlin.String {
4872+ return FfiConverterString .lift(
48744873 callWithHandle {
48754874 uniffiRustCallWithError(SecretsBundleExportException) { _status ->
48764875 UniffiLib.uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_secrets_bundle(
@@ -7268,7 +7267,7 @@ public interface SasInterface {
72687267 *
72697268 * # Flowchart
72707269 *
7271- * The flow of the verification process is pictured bellow . Please note
7270+ * The flow of the verification process is pictured below . Please note
72727271 * that the process can be cancelled at each step of the process.
72737272 * Either side can cancel the process.
72747273 *
@@ -7611,7 +7610,7 @@ open class Sas: Disposable, AutoCloseable, SasInterface
76117610 *
76127611 * # Flowchart
76137612 *
7614- * The flow of the verification process is pictured bellow . Please note
7613+ * The flow of the verification process is pictured below . Please note
76157614 * that the process can be cancelled at each step of the process.
76167615 * Either side can cancel the process.
76177616 *
@@ -12273,6 +12272,14 @@ sealed class SecretsBundleExportException: kotlin.Exception() {
1227312272 get() = ""
1227412273 }
1227512274
12275+ class Serialization(
12276+
12277+ val `error`: kotlin.String
12278+ ) : SecretsBundleExportException() {
12279+ override val message
12280+ get() = "error=${ `error` }"
12281+ }
12282+
1227612283
1227712284
1227812285
@@ -12297,6 +12304,9 @@ public object FfiConverterTypeSecretsBundleExportError : FfiConverterRustBuffer<
1229712304 )
1229812305 2 -> SecretsBundleExportException.MissingCrossSigningKeys()
1229912306 3 -> SecretsBundleExportException.MissingBackupVersion()
12307+ 4 -> SecretsBundleExportException.Serialization(
12308+ FfiConverterString.read(buf),
12309+ )
1230012310 else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
1230112311 }
1230212312 }
@@ -12316,6 +12326,11 @@ public object FfiConverterTypeSecretsBundleExportError : FfiConverterRustBuffer<
1231612326 // Add the size for the Int that specifies the variant plus the size needed for all fields
1231712327 4UL
1231812328 )
12329+ is SecretsBundleExportException.Serialization -> (
12330+ // Add the size for the Int that specifies the variant plus the size needed for all fields
12331+ 4UL
12332+ + FfiConverterString.allocationSize(value.`error`)
12333+ )
1231912334 }
1232012335 }
1232112336
@@ -12334,6 +12349,11 @@ public object FfiConverterTypeSecretsBundleExportError : FfiConverterRustBuffer<
1233412349 buf.putInt(3)
1233512350 Unit
1233612351 }
12352+ is SecretsBundleExportException.Serialization -> {
12353+ buf.putInt(4)
12354+ FfiConverterString.write(value.`error`, buf)
12355+ Unit
12356+ }
1233712357 }.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
1233812358 }
1233912359
@@ -14397,8 +14417,6 @@ public object FfiConverterMapStringMapStringSequenceString: FfiConverterRustBuff
1439714417
1439814418
1439914419
14400-
14401-
1440214420 /**
1440314421 * Migrate a libolm based setup to a vodozemac based setup stored in a SQLite
1440414422 * store.
0 commit comments