From 8a1e333aa790b976bfbc7f2a289c5ccef678825c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jorge=20Mart=C3=ADn?= Date: Wed, 14 Aug 2024 16:53:50 +0200 Subject: [PATCH] Fix most review comments --- .../impl/reset/ResetIdentityFlowManager.kt | 7 ++- .../impl/reset/ResetIdentityFlowNode.kt | 48 +++++++++++-------- .../password/ResetIdentityPasswordNode.kt | 10 ++-- .../ResetIdentityPasswordStateProvider.kt | 38 +++++++++++++++ .../password/ResetIdentityPasswordView.kt | 40 +++++++++------- .../impl/reset/root/ResetIdentityRootView.kt | 19 ++++---- .../impl/src/main/res/values/localazy.xml | 13 +++++ .../password/ResetIdentityPasswordViewTest.kt | 4 +- .../reset/root/ResetIdentityRootViewTest.kt | 3 +- .../test/encryption/FakeEncryptionService.kt | 3 +- libraries/oidc/api/build.gradle.kts | 2 +- libraries/oidc/impl/build.gradle.kts | 10 +--- .../src/main/res/values/localazy.xml | 12 ----- tools/localazy/config.json | 5 +- 14 files changed, 136 insertions(+), 78 deletions(-) create mode 100644 features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordStateProvider.kt diff --git a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowManager.kt b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowManager.kt index 3425ca90be..16850890a7 100644 --- a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowManager.kt +++ b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowManager.kt @@ -23,6 +23,7 @@ import io.element.android.libraries.matrix.api.encryption.IdentityResetHandle import io.element.android.libraries.matrix.api.verification.SessionVerificationService import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.filterIsInstance @@ -37,9 +38,10 @@ class ResetIdentityFlowManager @Inject constructor( ) { private val resetHandleFlow: MutableStateFlow> = MutableStateFlow(AsyncData.Uninitialized) val currentHandleFlow: StateFlow> = resetHandleFlow + private var whenResetIsDoneWaitingJob: Job? = null fun whenResetIsDone(block: () -> Unit) { - sessionCoroutineScope.launch { + whenResetIsDoneWaitingJob = sessionCoroutineScope.launch { sessionVerificationService.sessionVerifiedStatus.filterIsInstance().first() block() } @@ -70,5 +72,8 @@ class ResetIdentityFlowManager @Inject constructor( suspend fun cancel() { currentHandleFlow.value.dataOrNull()?.cancel() resetHandleFlow.value = AsyncData.Uninitialized + + whenResetIsDoneWaitingJob?.cancel() + whenResetIsDoneWaitingJob = null } } diff --git a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowNode.kt b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowNode.kt index be538a8665..50dcc2dd12 100644 --- a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowNode.kt +++ b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/ResetIdentityFlowNode.kt @@ -23,6 +23,7 @@ import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalContext +import androidx.compose.ui.window.DialogProperties import androidx.lifecycle.DefaultLifecycleObserver import androidx.lifecycle.LifecycleOwner import com.bumble.appyx.core.modality.BuildContext @@ -45,14 +46,13 @@ import io.element.android.libraries.designsystem.components.ProgressDialog import io.element.android.libraries.di.SessionScope import io.element.android.libraries.matrix.api.encryption.IdentityOidcResetHandle import io.element.android.libraries.matrix.api.encryption.IdentityPasswordResetHandle -import io.element.android.libraries.matrix.api.encryption.IdentityResetHandle import io.element.android.libraries.oidc.api.OidcEntryPoint import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Job -import kotlinx.coroutines.flow.filterIsInstance -import kotlinx.coroutines.flow.first +import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import kotlinx.parcelize.Parcelize +import timber.log.Timber @ContributesNode(SessionScope::class) class ResetIdentityFlowNode @AssistedInject constructor( @@ -94,7 +94,7 @@ class ResetIdentityFlowNode @AssistedInject constructor( lifecycle.addObserver(object : DefaultLifecycleObserver { override fun onStart(owner: LifecycleOwner) { // If the custom tab was opened, we need to cancel the reset job - // when we come back to the node if it the reset wasn't successful + // when we come back to the node if the reset wasn't successful cancelResetJob() } @@ -129,22 +129,29 @@ class ResetIdentityFlowNode @AssistedInject constructor( } private fun CoroutineScope.startReset() = launch { - val handle = resetIdentityFlowManager.getResetHandle() - .filterIsInstance>() - .first() - .data - - when (handle) { - is IdentityOidcResetHandle -> { - if (oidcEntryPoint.canUseCustomTab()) { - activity.openUrlInChromeCustomTab(null, false, handle.url) - } else { - backstack.push(NavTarget.ResetOidc(handle.url)) + resetIdentityFlowManager.getResetHandle() + .collectLatest { state -> + when (state) { + is AsyncData.Failure -> { + cancelResetJob() + Timber.e(state.error, "Could not load the reset identity handle.") + } + is AsyncData.Success -> { + when (val handle = state.data) { + is IdentityOidcResetHandle -> { + if (oidcEntryPoint.canUseCustomTab()) { + activity.openUrlInChromeCustomTab(null, false, handle.url) + } else { + backstack.push(NavTarget.ResetOidc(handle.url)) + } + resetJob = launch { handle.resetOidc() } + } + is IdentityPasswordResetHandle -> backstack.push(NavTarget.ResetPassword) + } + } + else -> Unit } - resetJob = launch { handle.resetOidc() } } - is IdentityPasswordResetHandle -> backstack.push(NavTarget.ResetPassword) - } } private fun cancelResetJob() { @@ -162,7 +169,10 @@ class ResetIdentityFlowNode @AssistedInject constructor( val startResetState by resetIdentityFlowManager.currentHandleFlow.collectAsState() if (startResetState.isLoading()) { - ProgressDialog() + ProgressDialog( + properties = DialogProperties(dismissOnBackPress = true, dismissOnClickOutside = true), + onDismissRequest = { cancelResetJob() } + ) } BackstackView(modifier) diff --git a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordNode.kt b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordNode.kt index 0f158e04c2..75d487d00e 100644 --- a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordNode.kt +++ b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordNode.kt @@ -34,14 +34,14 @@ import io.element.android.libraries.matrix.api.encryption.IdentityPasswordResetH class ResetIdentityPasswordNode @AssistedInject constructor( @Assisted buildContext: BuildContext, @Assisted plugins: List, - private val coroutineDispatchers: CoroutineDispatchers, + coroutineDispatchers: CoroutineDispatchers, ) : Node(buildContext, plugins = plugins) { data class Inputs(val handle: IdentityPasswordResetHandle) : NodeInputs - private val presenter by lazy { - val inputs = inputs() - ResetIdentityPasswordPresenter(inputs.handle, dispatchers = coroutineDispatchers) - } + private val presenter = ResetIdentityPasswordPresenter( + identityPasswordResetHandle = inputs().handle, + dispatchers = coroutineDispatchers + ) @Composable override fun View(modifier: Modifier) { diff --git a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordStateProvider.kt b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordStateProvider.kt new file mode 100644 index 0000000000..1a1e768426 --- /dev/null +++ b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordStateProvider.kt @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2024 New Vector Ltd + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package io.element.android.features.securebackup.impl.reset.password + +import androidx.compose.ui.tooling.preview.PreviewParameterProvider +import io.element.android.libraries.architecture.AsyncAction + +class ResetIdentityPasswordStateProvider : PreviewParameterProvider { + override val values: Sequence + get() = sequenceOf( + aResetIdentityPasswordState(), + aResetIdentityPasswordState(resetAction = AsyncAction.Loading), + aResetIdentityPasswordState(resetAction = AsyncAction.Success(Unit)), + aResetIdentityPasswordState(resetAction = AsyncAction.Failure(IllegalStateException("Failed"))), + ) +} + +private fun aResetIdentityPasswordState( + resetAction: AsyncAction = AsyncAction.Uninitialized, + eventSink: (ResetIdentityPasswordEvent) -> Unit = {}, +) = ResetIdentityPasswordState( + resetAction = resetAction, + eventSink = eventSink, +) diff --git a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordView.kt b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordView.kt index a43ff8092f..074752ddea 100644 --- a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordView.kt +++ b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordView.kt @@ -27,12 +27,12 @@ import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.text.input.VisualTransformation +import androidx.compose.ui.tooling.preview.PreviewParameter import io.element.android.compound.tokens.generated.CompoundIcons -import io.element.android.libraries.architecture.AsyncAction +import io.element.android.features.securebackup.impl.R import io.element.android.libraries.designsystem.atomic.pages.FlowStepPage import io.element.android.libraries.designsystem.components.BigIcon import io.element.android.libraries.designsystem.components.ProgressDialog -import io.element.android.libraries.designsystem.components.dialogs.ErrorDialog import io.element.android.libraries.designsystem.components.form.textFieldState import io.element.android.libraries.designsystem.preview.ElementPreview import io.element.android.libraries.designsystem.preview.PreviewsDayNight @@ -54,13 +54,19 @@ fun ResetIdentityPasswordView( FlowStepPage( modifier = modifier, iconStyle = BigIcon.Style.Default(CompoundIcons.LockSolid()), - title = stringResource(CommonStrings.screen_reset_encryption_password_title), - subTitle = stringResource(CommonStrings.screen_reset_encryption_password_subtitle), + title = stringResource(R.string.screen_reset_encryption_password_title), + subTitle = stringResource(R.string.screen_reset_encryption_password_subtitle), onBackClick = onBack, content = { Content( text = passwordState.value, - onTextChange = { passwordState.value = it } + onTextChange = { newText -> + if (state.resetAction.isFailure()) { + state.eventSink(ResetIdentityPasswordEvent.DismissError) + } + passwordState.value = newText + }, + hasError = state.resetAction.isFailure(), ) }, buttons = { @@ -69,22 +75,19 @@ fun ResetIdentityPasswordView( text = stringResource(CommonStrings.action_reset_identity), onClick = { state.eventSink(ResetIdentityPasswordEvent.Reset(passwordState.value)) }, destructive = true, + enabled = passwordState.value.isNotEmpty(), ) } ) + // On success we need to wait until the screen is automatically dismissed, so we keep the progress dialog if (state.resetAction.isLoading() || state.resetAction.isSuccess()) { ProgressDialog() - } else if (state.resetAction.isFailure()) { - ErrorDialog( - content = stringResource(CommonStrings.error_unknown), - onDismiss = { state.eventSink(ResetIdentityPasswordEvent.DismissError) } - ) } } @Composable -private fun Content(text: String, onTextChange: (String) -> Unit) { +private fun Content(text: String, onTextChange: (String) -> Unit, hasError: Boolean) { var showPassword by remember { mutableStateOf(false) } OutlinedTextField( modifier = Modifier @@ -93,7 +96,7 @@ private fun Content(text: String, onTextChange: (String) -> Unit) { value = text, onValueChange = onTextChange, label = { Text(stringResource(CommonStrings.common_password)) }, - placeholder = { Text(stringResource(CommonStrings.screen_reset_encryption_password_placeholder)) }, + placeholder = { Text(stringResource(R.string.screen_reset_encryption_password_placeholder)) }, singleLine = true, visualTransformation = if (showPassword) VisualTransformation.None else PasswordVisualTransformation(), trailingIcon = { @@ -105,19 +108,22 @@ private fun Content(text: String, onTextChange: (String) -> Unit) { IconButton(onClick = { showPassword = !showPassword }) { Icon(imageVector = image, description) } + }, + isError = hasError, + supportingText = if (hasError) { + { Text(stringResource(R.string.screen_reset_encryption_password_error)) } + } else { + null } ) } @PreviewsDayNight @Composable -internal fun ResetIdentityPasswordViewPreview() { +internal fun ResetIdentityPasswordViewPreview(@PreviewParameter(ResetIdentityPasswordStateProvider::class) state: ResetIdentityPasswordState) { ElementPreview { ResetIdentityPasswordView( - state = ResetIdentityPasswordState( - resetAction = AsyncAction.Uninitialized, - eventSink = {} - ), + state = state, onBack = {} ) } diff --git a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootView.kt b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootView.kt index 4e0457836f..9983f06b44 100644 --- a/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootView.kt +++ b/features/securebackup/impl/src/main/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootView.kt @@ -29,6 +29,7 @@ import androidx.compose.ui.tooling.preview.PreviewParameter import androidx.compose.ui.unit.dp import io.element.android.compound.theme.ElementTheme import io.element.android.compound.tokens.generated.CompoundIcons +import io.element.android.features.securebackup.impl.R import io.element.android.libraries.designsystem.atomic.organisms.InfoListItem import io.element.android.libraries.designsystem.atomic.organisms.InfoListOrganism import io.element.android.libraries.designsystem.atomic.pages.FlowStepPage @@ -52,8 +53,8 @@ fun ResetIdentityRootView( FlowStepPage( modifier = modifier, iconStyle = BigIcon.Style.AlertSolid, - title = stringResource(io.element.android.libraries.ui.strings.R.string.screen_encryption_reset_title), - subTitle = stringResource(io.element.android.libraries.ui.strings.R.string.screen_encryption_reset_subtitle), + title = stringResource(R.string.screen_encryption_reset_title), + subTitle = stringResource(R.string.screen_encryption_reset_subtitle), isScrollable = true, content = { Content() }, buttons = { @@ -69,9 +70,9 @@ fun ResetIdentityRootView( if (state.displayConfirmationDialog) { ConfirmationDialog( - title = stringResource(CommonStrings.screen_reset_encryption_confirmation_alert_title), - content = stringResource(CommonStrings.screen_reset_encryption_confirmation_alert_subtitle), - submitText = stringResource(CommonStrings.screen_reset_encryption_confirmation_alert_action), + title = stringResource(R.string.screen_reset_encryption_confirmation_alert_title), + content = stringResource(R.string.screen_reset_encryption_confirmation_alert_subtitle), + submitText = stringResource(R.string.screen_reset_encryption_confirmation_alert_action), onSubmitClick = { state.eventSink(ResetIdentityRootEvent.DismissDialog) onContinue() @@ -92,7 +93,7 @@ private fun Content() { modifier = Modifier.fillMaxWidth(), items = persistentListOf( InfoListItem( - message = stringResource(CommonStrings.screen_encryption_reset_bullet_1), + message = stringResource(R.string.screen_encryption_reset_bullet_1), iconComposable = { Icon( modifier = Modifier.size(20.dp), @@ -103,7 +104,7 @@ private fun Content() { }, ), InfoListItem( - message = stringResource(CommonStrings.screen_encryption_reset_bullet_2), + message = stringResource(R.string.screen_encryption_reset_bullet_2), iconComposable = { Icon( modifier = Modifier.size(20.dp), @@ -114,7 +115,7 @@ private fun Content() { }, ), InfoListItem( - message = stringResource(CommonStrings.screen_encryption_reset_bullet_3), + message = stringResource(R.string.screen_encryption_reset_bullet_3), iconComposable = { Icon( modifier = Modifier.size(20.dp), @@ -130,7 +131,7 @@ private fun Content() { Text( modifier = Modifier.fillMaxWidth(), - text = stringResource(CommonStrings.screen_encryption_reset_footer), + text = stringResource(R.string.screen_encryption_reset_footer), style = ElementTheme.typography.fontBodyMdMedium, color = ElementTheme.colors.textActionPrimary, textAlign = TextAlign.Center, diff --git a/features/securebackup/impl/src/main/res/values/localazy.xml b/features/securebackup/impl/src/main/res/values/localazy.xml index e1159031a2..85e801fce1 100644 --- a/features/securebackup/impl/src/main/res/values/localazy.xml +++ b/features/securebackup/impl/src/main/res/values/localazy.xml @@ -16,6 +16,12 @@ "Follow the instructions to create a new recovery key" "Save your new recovery key in a password manager or encrypted note" "Reset the encryption for your account using another device" + "Your account details, contacts, preferences, and chat list will be kept" + "You will lose your existing message history" + "You will need to verify all your existing devices and contacts again" + "Only reset your identity if you don’t have access to another signed-in device and you’ve lost your recovery key." + "If you’re not signed in to any other devices and you’ve lost your recovery key, then you’ll need to reset your identity to continue using the app. " + "Reset your identity in case you can’t confirm another way" "Turn off" "You will lose your encrypted messages if you are signed out of all devices." "Are you sure you want to turn off backup?" @@ -51,4 +57,11 @@ "Make sure you can store your recovery key somewhere safe" "Recovery setup successful" "Set up recovery" + "Yes, reset now" + "This process is irreversible." + "Are you sure you want to reset your encryption?" + "An unknown error happened. Please check your account password is correct and try again." + "Enter…" + "Confirm that you want to reset your encryption." + "Enter your account password to continue" diff --git a/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordViewTest.kt b/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordViewTest.kt index 17029452db..2449146399 100644 --- a/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordViewTest.kt +++ b/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/password/ResetIdentityPasswordViewTest.kt @@ -76,12 +76,12 @@ class ResetIdentityPasswordViewTest { } @Test - fun `clicking OK dismisses the error dialog`() { + fun `modifying the password dismisses the error state`() { val eventsRecorder = EventsRecorder() rule.setResetPasswordView( ResetIdentityPasswordState(resetAction = AsyncAction.Failure(IllegalStateException("A failure")), eventSink = eventsRecorder), ) - rule.clickOn(CommonStrings.action_ok) + rule.onNodeWithText("Password").performTextInput("A password") eventsRecorder.assertSingle(ResetIdentityPasswordEvent.DismissError) } diff --git a/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootViewTest.kt b/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootViewTest.kt index 8d14618fe8..da7f11ba42 100644 --- a/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootViewTest.kt +++ b/features/securebackup/impl/src/test/kotlin/io/element/android/features/securebackup/impl/reset/root/ResetIdentityRootViewTest.kt @@ -20,6 +20,7 @@ import androidx.activity.ComponentActivity import androidx.compose.ui.test.junit4.AndroidComposeTestRule import androidx.compose.ui.test.junit4.createAndroidComposeRule import androidx.test.ext.junit.runners.AndroidJUnit4 +import io.element.android.features.securebackup.impl.R import io.element.android.libraries.ui.strings.CommonStrings import io.element.android.tests.testutils.EnsureNeverCalled import io.element.android.tests.testutils.EventsRecorder @@ -80,7 +81,7 @@ class ResetIdentityRootViewTest { ResetIdentityRootState(displayConfirmationDialog = true, eventSink = {}), onContinue = it, ) - rule.clickOn(CommonStrings.screen_reset_encryption_confirmation_alert_action) + rule.clickOn(R.string.screen_reset_encryption_confirmation_alert_action) } } diff --git a/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt index fa301e402e..82ab5e251f 100644 --- a/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt +++ b/libraries/matrix/test/src/main/kotlin/io/element/android/libraries/matrix/test/encryption/FakeEncryptionService.kt @@ -22,13 +22,14 @@ import io.element.android.libraries.matrix.api.encryption.EnableRecoveryProgress import io.element.android.libraries.matrix.api.encryption.EncryptionService import io.element.android.libraries.matrix.api.encryption.IdentityResetHandle import io.element.android.libraries.matrix.api.encryption.RecoveryState +import io.element.android.tests.testutils.lambda.lambdaError import io.element.android.tests.testutils.simulateLongTask import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.flowOf class FakeEncryptionService( - var startIdentityResetLambda: () -> Result = { error("Not implemented") }, + var startIdentityResetLambda: () -> Result = { lambdaError() }, ) : EncryptionService { private var disableRecoveryFailure: Exception? = null override val backupStateStateFlow: MutableStateFlow = MutableStateFlow(BackupState.UNKNOWN) diff --git a/libraries/oidc/api/build.gradle.kts b/libraries/oidc/api/build.gradle.kts index 874c3ddbd4..4e01547d2c 100644 --- a/libraries/oidc/api/build.gradle.kts +++ b/libraries/oidc/api/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2023 New Vector Ltd + * Copyright (c) 2024 New Vector Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/libraries/oidc/impl/build.gradle.kts b/libraries/oidc/impl/build.gradle.kts index be4181e169..db1cdf8d0a 100644 --- a/libraries/oidc/impl/build.gradle.kts +++ b/libraries/oidc/impl/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 New Vector Ltd + * Copyright (c) 2024 New Vector Ltd * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,13 +43,8 @@ dependencies { implementation(projects.libraries.androidutils) implementation(projects.libraries.architecture) implementation(projects.libraries.matrix.api) - implementation(projects.libraries.matrix.api) - implementation(projects.libraries.network) implementation(projects.libraries.designsystem) - implementation(projects.libraries.testtags) implementation(projects.libraries.uiStrings) - implementation(projects.libraries.permissions.api) - implementation(projects.libraries.qrcode) implementation(libs.androidx.browser) implementation(platform(libs.network.retrofit.bom)) implementation(libs.network.retrofit) @@ -57,15 +52,12 @@ dependencies { api(projects.libraries.oidc.api) testImplementation(libs.test.junit) - testImplementation(libs.androidx.compose.ui.test.junit) testImplementation(libs.androidx.test.ext.junit) testImplementation(libs.coroutines.test) testImplementation(libs.molecule.runtime) - testImplementation(libs.test.robolectric) testImplementation(libs.test.truth) testImplementation(libs.test.turbine) testImplementation(projects.libraries.matrix.test) testImplementation(projects.libraries.permissions.test) testImplementation(projects.tests.testutils) - testReleaseImplementation(libs.androidx.compose.ui.test.manifest) } diff --git a/libraries/ui-strings/src/main/res/values/localazy.xml b/libraries/ui-strings/src/main/res/values/localazy.xml index ef997755dd..730afa291e 100644 --- a/libraries/ui-strings/src/main/res/values/localazy.xml +++ b/libraries/ui-strings/src/main/res/values/localazy.xml @@ -268,12 +268,6 @@ Reason: %1$s." "Hey, talk to me on %1$s: %2$s" "%1$s Android" "Rageshake to report bug" - "Your account details, contacts, preferences, and chat list will be kept" - "You will lose your existing message history" - "You will need to verify all your existing devices and contacts again" - "Only reset your identity if you don’t have access to another signed-in device and you’ve lost your recovery key." - "If you’re not signed in to any other devices and you’ve lost your recovery key, then you’ll need to reset your identity to continue using the app. " - "Reset your identity in case you can’t confirm another way" "Failed selecting media, please try again." "Failed processing media to upload, please try again." "Failed uploading media, please try again." @@ -284,12 +278,6 @@ Reason: %1$s." "%1$d Pinned messages" "Pinned messages" - "Yes, reset now" - "This process is irreversible." - "Are you sure you want to reset your encryption?" - "Enter…" - "Confirm that you want to reset your encryption." - "Enter your account password to continue" "Pinned messages" "Failed processing media to upload, please try again." "Could not retrieve user details" diff --git a/tools/localazy/config.json b/tools/localazy/config.json index 47ef2c1c51..82fb4f2277 100644 --- a/tools/localazy/config.json +++ b/tools/localazy/config.json @@ -210,7 +210,10 @@ "screen_chat_backup_.*", "screen_key_backup_disable_.*", "screen_recovery_key_.*", - "screen_create_new_recovery_key_.*" + "screen_create_new_recovery_key_.*", + "screen_encryption_reset.*", + "screen_reset_encryption.*", + "screen\\.reset_encryption.*" ] }, {