mirror of
https://github.com/element-hq/element-android
synced 2024-11-26 19:35:42 +03:00
rust-crypto 0.3.1 , wa to fix compilation
This commit is contained in:
parent
927f7757cd
commit
bcc1ac4ac9
4 changed files with 16 additions and 11 deletions
|
@ -135,7 +135,7 @@ ext.groups = [
|
|||
'com.sun.xml.bind.mvn',
|
||||
'com.sun.xml.fastinfoset',
|
||||
'com.thoughtworks.qdox',
|
||||
// 'com.vanniktech',
|
||||
'com.vanniktech',
|
||||
'commons-cli',
|
||||
'commons-codec',
|
||||
'commons-io',
|
||||
|
|
|
@ -218,7 +218,7 @@ dependencies {
|
|||
|
||||
// rustCryptoImplementation 'org.matrix.rustcomponents:crypto-android:0.2.1-SNAPSHOT'
|
||||
// rustCryptoImplementation files('libs/matrix-rust-sdk-crypto.aar')
|
||||
rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.1.3")
|
||||
rustCryptoImplementation("org.matrix.rustcomponents:crypto-android:0.3.1")
|
||||
// rustCryptoApi project(":library:rustCrypto")
|
||||
|
||||
testImplementation libs.tests.junit
|
||||
|
|
|
@ -472,15 +472,19 @@ internal class OlmMachine @Inject constructor(
|
|||
} catch (throwable: Throwable) {
|
||||
val reThrow = when (throwable) {
|
||||
is DecryptionException.MissingRoomKey -> {
|
||||
if (throwable.withheldCode != null) {
|
||||
MXCryptoError.Base(MXCryptoError.ErrorType.KEYS_WITHHELD, throwable.withheldCode!!)
|
||||
} else {
|
||||
MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID, throwable.error)
|
||||
}
|
||||
// Revert when witheld PR merged
|
||||
// if (throwable.withheldCode != null) {
|
||||
// MXCryptoError.Base(MXCryptoError.ErrorType.KEYS_WITHHELD, throwable.withheldCode!!)
|
||||
// } else {
|
||||
// MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID, throwable.error)
|
||||
// }
|
||||
|
||||
MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_INBOUND_SESSION_ID, throwable.message.orEmpty())
|
||||
}
|
||||
is DecryptionException.Megolm -> {
|
||||
// TODO check if it's the correct binding?
|
||||
MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX, throwable.error)
|
||||
// MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX, throwable.error)
|
||||
MXCryptoError.Base(MXCryptoError.ErrorType.UNKNOWN_MESSAGE_INDEX, throwable.message.orEmpty())
|
||||
}
|
||||
is DecryptionException.Identifier -> {
|
||||
MXCryptoError.Base(MXCryptoError.ErrorType.BAD_EVENT_FORMAT, MXCryptoError.BAD_EVENT_FORMAT_TEXT_REASON)
|
||||
|
@ -504,7 +508,7 @@ internal class OlmMachine @Inject constructor(
|
|||
|
||||
private fun ShieldState.toVerificationState(): MessageVerificationState? {
|
||||
return when (this.color) {
|
||||
ShieldColor.GREEN -> MessageVerificationState.VERIFIED
|
||||
ShieldColor.NONE -> MessageVerificationState.VERIFIED
|
||||
ShieldColor.RED -> {
|
||||
when (this.message) {
|
||||
"Encrypted by an unverified device." -> MessageVerificationState.UN_SIGNED_DEVICE
|
||||
|
@ -513,10 +517,9 @@ internal class OlmMachine @Inject constructor(
|
|||
else -> MessageVerificationState.UN_SIGNED_DEVICE
|
||||
}
|
||||
}
|
||||
ShieldColor.GRAY -> {
|
||||
ShieldColor.GREY -> {
|
||||
MessageVerificationState.UNSAFE_SOURCE
|
||||
}
|
||||
ShieldColor.NONE -> null
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -102,6 +102,8 @@ internal class ExtractMigrationDataUseCase {
|
|||
trackedUsers = emptyList(),
|
||||
inboundGroupSessions = emptyList(),
|
||||
backupVersion = backupVersion,
|
||||
// TODO import room settings from legacy DB
|
||||
roomSettings = emptyMap()
|
||||
)
|
||||
// import the account asap
|
||||
importPartial(baseExtract)
|
||||
|
|
Loading…
Reference in a new issue