small cleanup

This commit is contained in:
Benoit Marty 2020-10-06 12:26:18 +02:00
parent 74cae47902
commit 72a412904d
5 changed files with 6 additions and 6 deletions

View File

@ -371,7 +371,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
callback.onFailure(SharedSecretStorageError.BadKeyFormat) callback.onFailure(SharedSecretStorageError.BadKeyFormat)
} }
cryptoCoroutineScope.launch(coroutineDispatchers.main) { cryptoCoroutineScope.launch(coroutineDispatchers.main) {
kotlin.runCatching { runCatching {
// decrypt from recovery key // decrypt from recovery key
withOlmDecryption { olmPkDecryption -> withOlmDecryption { olmPkDecryption ->
olmPkDecryption.setPrivateKey(keySpec.privateKey) olmPkDecryption.setPrivateKey(keySpec.privateKey)
@ -390,7 +390,7 @@ internal class DefaultSharedSecretStorageService @Inject constructor(
callback.onFailure(SharedSecretStorageError.BadKeyFormat) callback.onFailure(SharedSecretStorageError.BadKeyFormat)
} }
cryptoCoroutineScope.launch(coroutineDispatchers.main) { cryptoCoroutineScope.launch(coroutineDispatchers.main) {
kotlin.runCatching { runCatching {
decryptAesHmacSha2(keySpec, name, secretContent) decryptAesHmacSha2(keySpec, name, secretContent)
}.foldToCallback(callback) }.foldToCallback(callback)
} }

View File

@ -126,7 +126,7 @@ class KeyRequestHandler @Inject constructor(
// can we get more info on this device? // can we get more info on this device?
session?.cryptoService()?.getMyDevicesInfo()?.firstOrNull { it.deviceId == deviceId }?.let { session?.cryptoService()?.getMyDevicesInfo()?.firstOrNull { it.deviceId == deviceId }?.let {
postAlert(context, userId, deviceId, true, deviceInfo, it) postAlert(context, userId, deviceId, true, deviceInfo, it)
} ?: kotlin.run { } ?: run {
postAlert(context, userId, deviceId, true, deviceInfo) postAlert(context, userId, deviceId, true, deviceInfo)
} }
} else { } else {

View File

@ -139,7 +139,7 @@ class BootstrapCrossSigningTask @Inject constructor(
null, null,
it it
) )
} ?: kotlin.run { } ?: run {
ssssService.generateKey( ssssService.generateKey(
UUID.randomUUID().toString(), UUID.randomUUID().toString(),
params.keySpec, params.keySpec,

View File

@ -301,7 +301,7 @@ class BootstrapSharedViewModel @AssistedInject constructor(
// ======================================= // =======================================
private fun saveRecoveryKeyToUri(os: OutputStream) = withState { state -> private fun saveRecoveryKeyToUri(os: OutputStream) = withState { state ->
viewModelScope.launch(Dispatchers.IO) { viewModelScope.launch(Dispatchers.IO) {
kotlin.runCatching { runCatching {
os.use { os.use {
os.write((state.recoveryKeyCreationInfo?.recoveryKey?.formatRecoveryKey() ?: "").toByteArray()) os.write((state.recoveryKeyCreationInfo?.recoveryKey?.formatRecoveryKey() ?: "").toByteArray())
} }

View File

@ -72,7 +72,7 @@ abstract class BottomSheetVerificationEmojisItem : VectorEpoxyModel<BottomSheetV
view.findViewById<TextView>(R.id.item_emoji_tv).isVisible = false view.findViewById<TextView>(R.id.item_emoji_tv).isVisible = false
view.findViewById<ImageView>(R.id.item_emoji_image).isVisible = true view.findViewById<ImageView>(R.id.item_emoji_image).isVisible = true
view.findViewById<ImageView>(R.id.item_emoji_image).setImageDrawable(ContextCompat.getDrawable(view.context, it)) view.findViewById<ImageView>(R.id.item_emoji_image).setImageDrawable(ContextCompat.getDrawable(view.context, it))
} ?: kotlin.run { } ?: run {
view.findViewById<TextView>(R.id.item_emoji_tv).isVisible = true view.findViewById<TextView>(R.id.item_emoji_tv).isVisible = true
view.findViewById<ImageView>(R.id.item_emoji_image).isVisible = false view.findViewById<ImageView>(R.id.item_emoji_image).isVisible = false
view.findViewById<TextView>(R.id.item_emoji_tv).text = rep.emoji view.findViewById<TextView>(R.id.item_emoji_tv).text = rep.emoji