Skip to content

Commit

Permalink
Merge pull request #8488 from vector-im/feature/bca/bump_crypto_sdk_0…
Browse files Browse the repository at this point in the history
….3.8

bump crypto sdk to 0.3.9
  • Loading branch information
BillCarsonFr committed Jun 2, 2023
2 parents 7f8a19f + 91f507e commit 56ea316
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions changelog.d/8488.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Updated rust crypto SDK to version 0.3.9
4 changes: 2 additions & 2 deletions matrix-sdk-android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ dependencies {

implementation libs.google.phonenumber

rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.7")
// 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 56ea316

Please sign in to comment.