From 1eda0872330f822cda78b65f32a83002477cd167 Mon Sep 17 00:00:00 2001 From: valere Date: Wed, 31 May 2023 15:02:43 +0200 Subject: [PATCH 1/6] bump crypto sdk to 0.3.8 --- matrix-sdk-android/build.gradle | 2 +- .../matrix/android/sdk/internal/crypto/RustCryptoService.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 6328c1ceac..04271e17e2 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -216,7 +216,7 @@ dependencies { implementation libs.google.phonenumber - rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.7") + rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.8") // rustCryptoApi project(":library:rustCrypto") testImplementation libs.tests.junit diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt index 33fc13e728..57f81ef592 100755 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt @@ -183,8 +183,9 @@ internal class RustCryptoService @Inject constructor( override fun getCryptoVersion(context: Context, longFormat: Boolean): String { val version = org.matrix.rustcomponents.sdk.crypto.version() + val gitHash = org.matrix.rustcomponents.sdk.crypto.versionInfo().gitSha val vodozemac = org.matrix.rustcomponents.sdk.crypto.vodozemacVersion() - return if (longFormat) "Rust SDK $version, Vodozemac $vodozemac" else version + return if (longFormat) "Rust SDK $version ($gitHash), Vodozemac $vodozemac" else version } override suspend fun getMyCryptoDevice(): CryptoDeviceInfo = withContext(coroutineDispatchers.io) { From 99b6c887d28f0faeefdc0ffdad335ec5822b6842 Mon Sep 17 00:00:00 2001 From: valere Date: Wed, 31 May 2023 15:04:34 +0200 Subject: [PATCH 2/6] Add change log --- changelog.d/8488.feature | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/8488.feature diff --git a/changelog.d/8488.feature b/changelog.d/8488.feature new file mode 100644 index 0000000000..f95014e80f --- /dev/null +++ b/changelog.d/8488.feature @@ -0,0 +1 @@ +Updated rust crypto SDK to version 0.3.8 From be8f2269489560a9a667e9830df05fd698cb04e8 Mon Sep 17 00:00:00 2001 From: valere Date: Thu, 1 Jun 2023 16:16:56 +0200 Subject: [PATCH 3/6] bump to 0.3.9 --- matrix-sdk-android/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/matrix-sdk-android/build.gradle b/matrix-sdk-android/build.gradle index 04271e17e2..420b24ab5a 100644 --- a/matrix-sdk-android/build.gradle +++ b/matrix-sdk-android/build.gradle @@ -216,8 +216,8 @@ dependencies { implementation libs.google.phonenumber - rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.8") - // rustCryptoApi project(":library:rustCrypto") + rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.9") +// rustCryptoApi project(":library:rustCrypto") testImplementation libs.tests.junit // Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281 From 688ae7d25936c6c9787af9ba4f657e519fae1590 Mon Sep 17 00:00:00 2001 From: valere Date: Thu, 1 Jun 2023 16:45:26 +0200 Subject: [PATCH 4/6] update change log --- changelog.d/8488.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog.d/8488.feature b/changelog.d/8488.feature index f95014e80f..97729b0a89 100644 --- a/changelog.d/8488.feature +++ b/changelog.d/8488.feature @@ -1 +1 @@ -Updated rust crypto SDK to version 0.3.8 +Updated rust crypto SDK to version 0.3.9 From ada85398982ae23ef0e4926604c6b0c2fd1339f0 Mon Sep 17 00:00:00 2001 From: valere Date: Thu, 1 Jun 2023 19:53:36 +0200 Subject: [PATCH 5/6] Fix remove deprecated isReady() call --- .../internal/crypto/verification/RustVerificationService.kt | 5 +++-- .../sdk/internal/crypto/verification/VerificationRequest.kt | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt index 8cb6618a18..35965d6f2e 100644 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt @@ -36,6 +36,7 @@ import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_QR_ import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_RECIPROCATE import org.matrix.android.sdk.internal.crypto.model.rest.toValue import org.matrix.android.sdk.internal.session.SessionScope +import org.matrix.rustcomponents.sdk.crypto.VerificationRequestState import timber.log.Timber import javax.inject.Inject @@ -165,7 +166,7 @@ internal class RustVerificationService @Inject constructor( // If this is a SAS verification originating from a `m.key.verification.request` // event, we auto-accept here considering that we either initiated the request or // accepted the request. If it's a QR code verification, just dispatch an update. - if (request.isReady() && transaction is SasVerification) { + if (request.innerState() is VerificationRequestState.Ready && transaction is SasVerification) { // accept() will dispatch an update, no need to do it twice. Timber.d("## Verification: Auto accepting SAS verification with $sender") transaction.accept() @@ -308,7 +309,7 @@ internal class RustVerificationService @Inject constructor( return if (request != null) { request.acceptWithMethods(methods) request.startQrCode() - request.isReady() + request.innerState() is VerificationRequestState.Ready } else { false } diff --git a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt index 8d1b3392aa..641bf66c12 100644 --- a/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt +++ b/matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt @@ -136,9 +136,9 @@ internal class VerificationRequest @AssistedInject constructor( * concrete verification flow, i.e. we can show/scan a QR code or start emoji * verification. */ - internal fun isReady(): Boolean { - return innerVerificationRequest.isReady() - } +// internal fun isReady(): Boolean { +// return innerVerificationRequest.isReady() +// } /** Did we advertise that we're able to scan QR codes */ internal fun canScanQrCodes(): Boolean { From 91f507e6c406103036f2d53c02dc01de702e33c3 Mon Sep 17 00:00:00 2001 From: valere Date: Fri, 2 Jun 2023 14:27:57 +0200 Subject: [PATCH 6/6] revert sonarqube gradle plugin version --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 532e6d8016..a70b54a833 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ buildscript { classpath libs.gradle.hiltPlugin classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.0' classpath 'com.google.gms:google-services:4.3.15' - classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.2.0.3129' + classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929' classpath 'com.google.android.gms:oss-licenses-plugin:0.10.6' classpath "com.likethesalad.android:stem-plugin:2.4.1" classpath 'org.owasp:dependency-check-gradle:8.2.1'