mirror of
https://github.com/element-hq/element-android
synced 2024-11-24 10:25:35 +03:00
klint
This commit is contained in:
parent
bf5ba99653
commit
2f237cf17b
15 changed files with 4 additions and 29 deletions
|
@ -35,7 +35,6 @@ import im.vector.matrix.android.internal.di.UserId
|
|||
import im.vector.matrix.android.internal.task.Task
|
||||
import timber.log.Timber
|
||||
import java.util.ArrayList
|
||||
import java.util.UUID
|
||||
import javax.inject.Inject
|
||||
|
||||
internal interface RoomVerificationUpdateTask : Task<RoomVerificationUpdateTask.Params, Unit> {
|
||||
|
|
|
@ -54,7 +54,6 @@ class BottomSheetActionButton @JvmOverloads constructor(
|
|||
|
||||
@BindView(R.id.itemVerificationClickableZone)
|
||||
lateinit var clickableView: View
|
||||
|
||||
|
||||
var title: String? = null
|
||||
set(value) {
|
||||
|
|
|
@ -83,7 +83,7 @@ class BootstrapAccountPasswordFragment @Inject constructor(
|
|||
}
|
||||
.disposeOnDestroyView()
|
||||
|
||||
withState(sharedViewModel) {state ->
|
||||
withState(sharedViewModel) { state ->
|
||||
(state.step as? BootstrapStep.AccountPassword)?.failure?.let {
|
||||
bootstrapAccountPasswordTil.error = it
|
||||
}
|
||||
|
@ -111,6 +111,5 @@ class BootstrapAccountPasswordFragment @Inject constructor(
|
|||
bootstrapAccountPasswordEditText.showPassword(isPasswordVisible, updateCursor = false)
|
||||
ssss_view_show_password.setImageResource(if (isPasswordVisible) R.drawable.ic_eye_closed_black else R.drawable.ic_eye_black)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,7 +29,6 @@ sealed class BootstrapActions : VectorViewModelAction {
|
|||
object GoToCompleted : BootstrapActions()
|
||||
object GoToEnterAccountPassword : BootstrapActions()
|
||||
|
||||
|
||||
data class DoInitialize(val passphrase: String, val auth: UserPasswordAuth? = null) : BootstrapActions()
|
||||
object TogglePasswordVisibility : BootstrapActions()
|
||||
data class UpdateCandidatePassphrase(val pass: String) : BootstrapActions()
|
||||
|
|
|
@ -28,10 +28,8 @@ import androidx.core.content.ContextCompat
|
|||
import androidx.fragment.app.Fragment
|
||||
import com.airbnb.mvrx.fragmentViewModel
|
||||
import com.airbnb.mvrx.withState
|
||||
import im.vector.matrix.android.internal.crypto.model.rest.UserPasswordAuth
|
||||
import im.vector.riotx.R
|
||||
import im.vector.riotx.core.di.ScreenComponent
|
||||
import im.vector.riotx.core.dialogs.PromptPasswordDialog
|
||||
import im.vector.riotx.core.extensions.commitTransaction
|
||||
import im.vector.riotx.core.platform.VectorBaseBottomSheetDialogFragment
|
||||
import kotlinx.android.synthetic.main.bottom_sheet_bootstrap.*
|
||||
|
|
|
@ -58,6 +58,5 @@ class BootstrapConclusionFragment @Inject constructor(
|
|||
.toSpannable()
|
||||
.colorizeMatchingText(getString(R.string.recovery_passphrase), colorProvider.getColorFromAttribute(android.R.attr.textColorLink))
|
||||
.colorizeMatchingText(getString(R.string.message_key), colorProvider.getColorFromAttribute(android.R.attr.textColorLink))
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -120,6 +120,5 @@ class BootstrapConfirmPassphraseFragment @Inject constructor(
|
|||
ssss_passphrase_enter_edittext.showPassword(isPasswordVisible, updateCursor = false)
|
||||
ssss_view_show_password.setImageResource(if (isPasswordVisible) R.drawable.ic_eye_closed_black else R.drawable.ic_eye_black)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -82,7 +82,6 @@ class BootstrapCrossSigningTask @Inject constructor(
|
|||
}
|
||||
|
||||
suspend fun execute(params: Params): BootstrapResult {
|
||||
|
||||
params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_initializing), isIndeterminate = true))
|
||||
val crossSigningService = session.cryptoService().crossSigningService()
|
||||
|
||||
|
@ -98,7 +97,6 @@ class BootstrapCrossSigningTask @Inject constructor(
|
|||
|
||||
val ssssService = session.sharedSecretStorageService
|
||||
|
||||
|
||||
params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_pbkdf2), isIndeterminate = true))
|
||||
try {
|
||||
keyInfo = awaitCallback {
|
||||
|
@ -115,7 +113,6 @@ class BootstrapCrossSigningTask @Inject constructor(
|
|||
return BootstrapResult.FailedToCreateSSSSKey(failure)
|
||||
}
|
||||
|
||||
|
||||
params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_default_key), isIndeterminate = true))
|
||||
try {
|
||||
awaitCallback<Unit> {
|
||||
|
@ -132,7 +129,6 @@ class BootstrapCrossSigningTask @Inject constructor(
|
|||
val uskPrivateKey = xKeys.user ?: return BootstrapResult.MissingPrivateKey
|
||||
|
||||
try {
|
||||
|
||||
params.progressListener?.onProgress(WaitingViewData(stringProvider.getString(R.string.bootstrap_crosssigning_progress_save_msk), isIndeterminate = true))
|
||||
awaitCallback<Unit> {
|
||||
ssssService.storeSecret(MASTER_KEY_SSSS_NAME, mskPrivateKey, listOf(SharedSecretStorageService.KeyRef(keyInfo.keyId, keyInfo.keySpec)), it)
|
||||
|
|
|
@ -130,6 +130,5 @@ class BootstrapEnterPassphraseFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,6 @@ class BootstrapSaveRecoveryKeyFragment @Inject constructor(
|
|||
requireActivity().toast(R.string.error_no_external_application_found)
|
||||
sharedViewModel.handle(BootstrapActions.SaveReqFailed)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
|
@ -127,9 +126,7 @@ class BootstrapSaveRecoveryKeyFragment @Inject constructor(
|
|||
startSharePlainTextIntent(this,
|
||||
context?.getString(R.string.keys_backup_setup_step3_share_intent_chooser_title),
|
||||
recoveryKey,
|
||||
context?.getString(R.string.recovery_key)
|
||||
, REQUEST_CODE_COPY)
|
||||
|
||||
context?.getString(R.string.recovery_key), REQUEST_CODE_COPY)
|
||||
}
|
||||
|
||||
override fun invalidate() = withState(sharedViewModel) { state ->
|
||||
|
|
|
@ -214,12 +214,10 @@ class BootstrapSharedViewModel @AssistedInject constructor(
|
|||
copy(recoverySaveFileProcess = Fail(it))
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun startInitializeFlow(auth: UserPasswordAuth?) {
|
||||
|
||||
setState {
|
||||
copy(step = BootstrapStep.Initializing)
|
||||
}
|
||||
|
@ -234,7 +232,6 @@ class BootstrapSharedViewModel @AssistedInject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
withState { state ->
|
||||
viewModelScope.launch {
|
||||
bootstrapTask.invoke(this, Params(
|
||||
|
@ -277,7 +274,6 @@ class BootstrapSharedViewModel @AssistedInject constructor(
|
|||
if (it is BootstrapResult.GenericError
|
||||
&& it.failure is im.vector.matrix.android.api.failure.Failure.OtherServerError
|
||||
&& it.failure.httpCode == 401) {
|
||||
|
||||
} else {
|
||||
_viewEvents.post(BootstrapViewEvents.ModalError(it.error ?: stringProvider.getString(R.string.matrix_error)))
|
||||
setState {
|
||||
|
@ -300,7 +296,6 @@ class BootstrapSharedViewModel @AssistedInject constructor(
|
|||
private fun queryBack() = withState { state ->
|
||||
when (state.step) {
|
||||
is BootstrapStep.SetupPassphrase -> {
|
||||
|
||||
}
|
||||
is BootstrapStep.ConfirmPassphrase -> {
|
||||
setState {
|
||||
|
@ -311,7 +306,6 @@ class BootstrapSharedViewModel @AssistedInject constructor(
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -34,4 +34,3 @@ sealed class BootstrapViewEvents : VectorViewEvents {
|
|||
// val transactionId: String?
|
||||
// ) : DevicesViewEvents()
|
||||
}
|
||||
|
||||
|
|
|
@ -351,11 +351,11 @@ class VerificationBottomSheet : VectorBaseBottomSheetDialogFragment() {
|
|||
}
|
||||
}
|
||||
|
||||
//fun View.getParentCoordinatorLayout(): CoordinatorLayout? {
|
||||
// fun View.getParentCoordinatorLayout(): CoordinatorLayout? {
|
||||
// var current = this as? View
|
||||
// while (current != null) {
|
||||
// if (current is CoordinatorLayout) return current
|
||||
// current = current.parent as? View
|
||||
// }
|
||||
// return null
|
||||
//}
|
||||
// }
|
||||
|
|
|
@ -42,7 +42,6 @@ import im.vector.riotx.core.platform.VectorBaseActivity
|
|||
import im.vector.riotx.core.pushers.PushersManager
|
||||
import im.vector.riotx.features.crypto.recover.BootstrapBottomSheet
|
||||
import im.vector.riotx.features.disclaimer.showDisclaimerDialog
|
||||
import im.vector.riotx.features.login.LoginAction
|
||||
import im.vector.riotx.features.notifications.NotificationDrawerManager
|
||||
import im.vector.riotx.features.popup.PopupAlertManager
|
||||
import im.vector.riotx.features.popup.VerificationVectorAlert
|
||||
|
|
|
@ -23,7 +23,6 @@ import im.vector.matrix.android.api.session.events.model.RelationType
|
|||
import im.vector.matrix.android.api.session.events.model.toModel
|
||||
import im.vector.matrix.android.api.session.room.model.message.MessageRelationContent
|
||||
import im.vector.matrix.android.api.session.room.model.message.MessageVerificationCancelContent
|
||||
import im.vector.matrix.android.api.session.room.model.message.MessageVerificationRequestContent
|
||||
import im.vector.matrix.android.api.session.room.timeline.TimelineEvent
|
||||
import im.vector.matrix.android.internal.session.room.VerificationState
|
||||
import im.vector.riotx.core.epoxy.VectorEpoxyModel
|
||||
|
|
Loading…
Reference in a new issue