mirror of
https://github.com/element-hq/element-android
synced 2024-11-23 18:05:36 +03:00
Merge pull request #7623 from vector-im/dependabot/gradle/io.gitlab.arturbosch.detekt-1.22.0
Bump io.gitlab.arturbosch.detekt from 1.21.0 to 1.22.0
This commit is contained in:
commit
ae996ae197
6 changed files with 42 additions and 53 deletions
|
@ -43,7 +43,7 @@ plugins {
|
||||||
// ktlint Plugin
|
// ktlint Plugin
|
||||||
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
|
id "org.jlleitschuh.gradle.ktlint" version "11.0.0"
|
||||||
// Detekt
|
// Detekt
|
||||||
id "io.gitlab.arturbosch.detekt" version "1.21.0"
|
id "io.gitlab.arturbosch.detekt" version "1.22.0"
|
||||||
// Ksp
|
// Ksp
|
||||||
id "com.google.devtools.ksp" version "1.7.21-1.0.8"
|
id "com.google.devtools.ksp" version "1.7.21-1.0.8"
|
||||||
|
|
||||||
|
|
|
@ -83,9 +83,7 @@ internal class CrossSigningOlm @Inject constructor(
|
||||||
val signaturesMadeByMyKey = signatures[myUserID] // Signatures made by me
|
val signaturesMadeByMyKey = signatures[myUserID] // Signatures made by me
|
||||||
?.get("ed25519:$pubKey")
|
?.get("ed25519:$pubKey")
|
||||||
|
|
||||||
if (signaturesMadeByMyKey.isNullOrBlank()) {
|
require(signaturesMadeByMyKey.orEmpty().isNotBlank()) { "Not signed with my key $type" }
|
||||||
throw IllegalArgumentException("Not signed with my key $type")
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check that Alice USK signature of Bob MSK is valid
|
// Check that Alice USK signature of Bob MSK is valid
|
||||||
olmUtility.verifyEd25519Signature(signaturesMadeByMyKey, pubKey, JsonCanonicalizer.getCanonicalJson(Map::class.java, signable))
|
olmUtility.verifyEd25519Signature(signaturesMadeByMyKey, pubKey, JsonCanonicalizer.getCanonicalJson(Map::class.java, signable))
|
||||||
|
|
|
@ -47,9 +47,8 @@ internal class DefaultEncryptEventTask @Inject constructor(
|
||||||
// don't want to wait for any query
|
// don't want to wait for any query
|
||||||
// if (!params.crypto.isRoomEncrypted(params.roomId)) return params.event
|
// if (!params.crypto.isRoomEncrypted(params.roomId)) return params.event
|
||||||
val localEvent = params.event
|
val localEvent = params.event
|
||||||
if (localEvent.eventId == null || localEvent.type == null) {
|
require(localEvent.eventId != null)
|
||||||
throw IllegalArgumentException()
|
require(localEvent.type != null)
|
||||||
}
|
|
||||||
|
|
||||||
localEchoRepository.updateSendState(localEvent.eventId, localEvent.roomId, SendState.ENCRYPTING)
|
localEchoRepository.updateSendState(localEvent.eventId, localEvent.roomId, SendState.ENCRYPTING)
|
||||||
|
|
||||||
|
|
|
@ -1140,28 +1140,25 @@ internal class DefaultVerificationService @Inject constructor(
|
||||||
override fun beginKeyVerification(method: VerificationMethod, otherUserId: String, otherDeviceId: String, transactionId: String?): String? {
|
override fun beginKeyVerification(method: VerificationMethod, otherUserId: String, otherDeviceId: String, transactionId: String?): String? {
|
||||||
val txID = transactionId?.takeIf { it.isNotEmpty() } ?: createUniqueIDForTransaction(otherUserId, otherDeviceId)
|
val txID = transactionId?.takeIf { it.isNotEmpty() } ?: createUniqueIDForTransaction(otherUserId, otherDeviceId)
|
||||||
// should check if already one (and cancel it)
|
// should check if already one (and cancel it)
|
||||||
if (method == VerificationMethod.SAS) {
|
require(method == VerificationMethod.SAS) { "Unknown verification method" }
|
||||||
val tx = DefaultOutgoingSASDefaultVerificationTransaction(
|
val tx = DefaultOutgoingSASDefaultVerificationTransaction(
|
||||||
setDeviceVerificationAction,
|
setDeviceVerificationAction,
|
||||||
userId,
|
userId,
|
||||||
deviceId,
|
deviceId,
|
||||||
cryptoStore,
|
cryptoStore,
|
||||||
crossSigningService,
|
crossSigningService,
|
||||||
outgoingKeyRequestManager,
|
outgoingKeyRequestManager,
|
||||||
secretShareManager,
|
secretShareManager,
|
||||||
myDeviceInfoHolder.get().myDevice.fingerprint()!!,
|
myDeviceInfoHolder.get().myDevice.fingerprint()!!,
|
||||||
txID,
|
txID,
|
||||||
otherUserId,
|
otherUserId,
|
||||||
otherDeviceId
|
otherDeviceId
|
||||||
)
|
)
|
||||||
tx.transport = verificationTransportToDeviceFactory.createTransport(tx)
|
tx.transport = verificationTransportToDeviceFactory.createTransport(tx)
|
||||||
addTransaction(tx)
|
addTransaction(tx)
|
||||||
|
|
||||||
tx.start()
|
tx.start()
|
||||||
return txID
|
return txID
|
||||||
} else {
|
|
||||||
throw IllegalArgumentException("Unknown verification method")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun requestKeyVerificationInDMs(
|
override fun requestKeyVerificationInDMs(
|
||||||
|
@ -1343,28 +1340,25 @@ internal class DefaultVerificationService @Inject constructor(
|
||||||
otherUserId: String,
|
otherUserId: String,
|
||||||
otherDeviceId: String
|
otherDeviceId: String
|
||||||
): String {
|
): String {
|
||||||
if (method == VerificationMethod.SAS) {
|
require(method == VerificationMethod.SAS) { "Unknown verification method" }
|
||||||
val tx = DefaultOutgoingSASDefaultVerificationTransaction(
|
val tx = DefaultOutgoingSASDefaultVerificationTransaction(
|
||||||
setDeviceVerificationAction,
|
setDeviceVerificationAction,
|
||||||
userId,
|
userId,
|
||||||
deviceId,
|
deviceId,
|
||||||
cryptoStore,
|
cryptoStore,
|
||||||
crossSigningService,
|
crossSigningService,
|
||||||
outgoingKeyRequestManager,
|
outgoingKeyRequestManager,
|
||||||
secretShareManager,
|
secretShareManager,
|
||||||
myDeviceInfoHolder.get().myDevice.fingerprint()!!,
|
myDeviceInfoHolder.get().myDevice.fingerprint()!!,
|
||||||
transactionId,
|
transactionId,
|
||||||
otherUserId,
|
otherUserId,
|
||||||
otherDeviceId
|
otherDeviceId
|
||||||
)
|
)
|
||||||
tx.transport = verificationTransportRoomMessageFactory.createTransport(roomId, tx)
|
tx.transport = verificationTransportRoomMessageFactory.createTransport(roomId, tx)
|
||||||
addTransaction(tx)
|
addTransaction(tx)
|
||||||
|
|
||||||
tx.start()
|
tx.start()
|
||||||
return transactionId
|
return transactionId
|
||||||
} else {
|
|
||||||
throw IllegalArgumentException("Unknown verification method")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun readyPendingVerificationInDMs(
|
override fun readyPendingVerificationInDMs(
|
||||||
|
|
|
@ -55,7 +55,7 @@ complexity:
|
||||||
active: false
|
active: false
|
||||||
LongParameterList:
|
LongParameterList:
|
||||||
active: false
|
active: false
|
||||||
ComplexMethod:
|
CyclomaticComplexMethod:
|
||||||
active: false
|
active: false
|
||||||
NestedBlockDepth:
|
NestedBlockDepth:
|
||||||
active: false
|
active: false
|
||||||
|
|
|
@ -37,9 +37,7 @@ class VectorViewModelFactory @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (creator == null) {
|
require(creator != null) { "Unknown model class: $modelClass" }
|
||||||
throw IllegalArgumentException("Unknown model class: $modelClass")
|
|
||||||
}
|
|
||||||
try {
|
try {
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
return creator.get() as T
|
return creator.get() as T
|
||||||
|
|
Loading…
Reference in a new issue