Skip to content

Commit 56ea316

Browse files
authored
Merge pull request #8488 from vector-im/feature/bca/bump_crypto_sdk_0.3.8
bump crypto sdk to 0.3.9
2 parents 7f8a19f + 91f507e commit 56ea316

File tree

6 files changed

+12
-9
lines changed

6 files changed

+12
-9
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ buildscript {
2626
classpath libs.gradle.hiltPlugin
2727
classpath 'com.google.firebase:firebase-appdistribution-gradle:4.0.0'
2828
classpath 'com.google.gms:google-services:4.3.15'
29-
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.2.0.3129'
29+
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929'
3030
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.6'
3131
classpath "com.likethesalad.android:stem-plugin:2.4.1"
3232
classpath 'org.owasp:dependency-check-gradle:8.2.1'

changelog.d/8488.feature

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated rust crypto SDK to version 0.3.9

matrix-sdk-android/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ dependencies {
216216

217217
implementation libs.google.phonenumber
218218

219-
rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.7")
220-
// rustCryptoApi project(":library:rustCrypto")
219+
rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.9")
220+
// rustCryptoApi project(":library:rustCrypto")
221221

222222
testImplementation libs.tests.junit
223223
// Note: version sticks to 1.9.2 due to https://github.com/mockk/mockk/issues/281

matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/RustCryptoService.kt

+2-1
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ internal class RustCryptoService @Inject constructor(
183183

184184
override fun getCryptoVersion(context: Context, longFormat: Boolean): String {
185185
val version = org.matrix.rustcomponents.sdk.crypto.version()
186+
val gitHash = org.matrix.rustcomponents.sdk.crypto.versionInfo().gitSha
186187
val vodozemac = org.matrix.rustcomponents.sdk.crypto.vodozemacVersion()
187-
return if (longFormat) "Rust SDK $version, Vodozemac $vodozemac" else version
188+
return if (longFormat) "Rust SDK $version ($gitHash), Vodozemac $vodozemac" else version
188189
}
189190

190191
override suspend fun getMyCryptoDevice(): CryptoDeviceInfo = withContext(coroutineDispatchers.io) {

matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/RustVerificationService.kt

+3-2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_QR_
3636
import org.matrix.android.sdk.internal.crypto.model.rest.VERIFICATION_METHOD_RECIPROCATE
3737
import org.matrix.android.sdk.internal.crypto.model.rest.toValue
3838
import org.matrix.android.sdk.internal.session.SessionScope
39+
import org.matrix.rustcomponents.sdk.crypto.VerificationRequestState
3940
import timber.log.Timber
4041
import javax.inject.Inject
4142

@@ -165,7 +166,7 @@ internal class RustVerificationService @Inject constructor(
165166
// If this is a SAS verification originating from a `m.key.verification.request`
166167
// event, we auto-accept here considering that we either initiated the request or
167168
// accepted the request. If it's a QR code verification, just dispatch an update.
168-
if (request.isReady() && transaction is SasVerification) {
169+
if (request.innerState() is VerificationRequestState.Ready && transaction is SasVerification) {
169170
// accept() will dispatch an update, no need to do it twice.
170171
Timber.d("## Verification: Auto accepting SAS verification with $sender")
171172
transaction.accept()
@@ -308,7 +309,7 @@ internal class RustVerificationService @Inject constructor(
308309
return if (request != null) {
309310
request.acceptWithMethods(methods)
310311
request.startQrCode()
311-
request.isReady()
312+
request.innerState() is VerificationRequestState.Ready
312313
} else {
313314
false
314315
}

matrix-sdk-android/src/rustCrypto/java/org/matrix/android/sdk/internal/crypto/verification/VerificationRequest.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,9 @@ internal class VerificationRequest @AssistedInject constructor(
136136
* concrete verification flow, i.e. we can show/scan a QR code or start emoji
137137
* verification.
138138
*/
139-
internal fun isReady(): Boolean {
140-
return innerVerificationRequest.isReady()
141-
}
139+
// internal fun isReady(): Boolean {
140+
// return innerVerificationRequest.isReady()
141+
// }
142142

143143
/** Did we advertise that we're able to scan QR codes */
144144
internal fun canScanQrCodes(): Boolean {

0 commit comments

Comments
 (0)