Skip to content

Change "Recovery Passphrase/Key" to "Security Phrase/Key" #8550

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/8550.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Change outdated term Recovery Key/Passphrase to Security Key/Phrase
140 changes: 101 additions & 39 deletions library/ui-strings/src/main/res/values/strings.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ abstract class VerificationTestBase {

// 4S is not setup so passphrase option should be hidden
Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.check(ViewAssertions.matches(CoreMatchers.not(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_cannot_access_other_session)))))
.check(ViewAssertions.matches(CoreMatchers.not(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_cannot_access_other_session_use_key)))))

Espresso.onView(ViewMatchers.withId(R.id.bottomSheetVerificationRecyclerView))
.check(ViewAssertions.matches(ViewMatchers.hasDescendant(ViewMatchers.withText(R.string.verification_verify_with_another_device))))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,12 +153,12 @@ class VerifySessionPassphraseTest : VerificationTestBase() {

// 4S is setup so passphrase option should be visible
onView(withId(R.id.bottomSheetVerificationRecyclerView))
.check(matches((hasDescendant(withText(R.string.verification_cannot_access_other_session)))))
.check(matches((hasDescendant(withText(R.string.verification_cannot_access_other_session_use_key)))))

onView(withId(R.id.bottomSheetVerificationRecyclerView))
.perform(
actionOnItem<RecyclerView.ViewHolder>(
hasDescendant(withText(R.string.verification_cannot_access_other_session)),
hasDescendant(withText(R.string.verification_cannot_access_other_session_use_key)),
click()
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class KeysBackupRestoreFromKeyFragment :
private fun onRestoreFromKey() {
val value = viewModel.recoveryCode.value
if (value.isNullOrBlank()) {
viewModel.recoveryCodeErrorText.value = context?.getString(R.string.keys_backup_recovery_code_empty_error_message)
viewModel.recoveryCodeErrorText.value = context?.getString(R.string.keys_backup_security_key_empty_error_message)
} else {
viewModel.recoverKeys(sharedViewModel)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class KeysBackupRestoreFromKeyViewModel @Inject constructor(
val recoveryKey = BackupUtils.recoveryKeyFromBase58(recoveryCode.value!!)
sharedViewModel.recoverUsingBackupRecoveryKey(recoveryKey!!)
} catch (failure: Throwable) {
recoveryCodeErrorText.postValue(stringProvider.getString(R.string.keys_backup_recovery_code_error_decrypt))
recoveryCodeErrorText.postValue(stringProvider.getString(R.string.keys_backup_security_key_error_decrypt))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class KeysBackupRestoreFromPassphraseFragment :
}

private fun spannableStringForHelperText(): SpannableString {
val clickableText = getString(R.string.keys_backup_restore_use_recovery_key)
val helperText = getString(R.string.keys_backup_restore_with_passphrase_helper_with_link, clickableText)
val clickableText = getString(R.string.keys_backup_restore_use_security_key)
val helperText = getString(R.string.keys_backup_restore_with_security_phrase_helper_with_link, clickableText)

val spanString = SpannableString(helperText)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class KeysBackupRestoreFromPassphraseViewModel @Inject constructor(
try {
sharedViewModel.recoverUsingBackupPass(passphrase.value!!)
} catch (failure: Throwable) {
passphraseErrorText.postValue(stringProvider.getString(R.string.keys_backup_passphrase_error_decrypt))
passphraseErrorText.postValue(stringProvider.getString(R.string.keys_backup_security_phrase_error_decrypt))
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class KeysBackupRestoreSharedViewModel @Inject constructor(
loadingEvent.postValue(
WaitingViewData(
stringProvider.getString(R.string.keys_backup_restoring_waiting_message) +
"\n" + stringProvider.getString(R.string.keys_backup_restoring_computing_key_waiting_message),
"\n" + stringProvider.getString(R.string.keys_backup_restoring_computing_security_key_waiting_message),
step.progress,
step.total
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class KeysBackupSettingsFragment :
activity?.let {
MaterialAlertDialogBuilder(it)
.setTitle(R.string.keys_backup_settings_delete_confirm_title)
.setMessage(R.string.keys_backup_settings_delete_confirm_message)
.setMessage(R.string.keys_backup_settings_delete_keys_confirm_message)
.setCancelable(false)
.setPositiveButton(R.string.keys_backup_settings_delete_confirm_title) { _, _ ->
viewModel.handle(KeyBackupSettingsAction.DeleteKeyBackup)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class KeysBackupSettingsRecyclerViewController @Inject constructor(
style(ItemStyle.BIG_TEXT)

if (data.keysBackupVersionTrust()?.usable == false) {
description(host.stringProvider.getString(R.string.keys_backup_settings_untrusted_backup).toEpoxyCharSequence())
description(host.stringProvider.getString(R.string.keys_backup_settings_verify_device_now).toEpoxyCharSequence())
}
}

Expand All @@ -94,7 +94,7 @@ class KeysBackupSettingsRecyclerViewController @Inject constructor(
title(host.stringProvider.getString(R.string.keys_backup_settings_status_ko).toEpoxyCharSequence())
style(ItemStyle.BIG_TEXT)
if (data.keysBackupVersionTrust()?.usable == false) {
description(host.stringProvider.getString(R.string.keys_backup_settings_untrusted_backup).toEpoxyCharSequence())
description(host.stringProvider.getString(R.string.keys_backup_settings_verify_device_now).toEpoxyCharSequence())
} else {
description(keyBackupState.toString().toEpoxyCharSequence())
}
Expand All @@ -109,7 +109,7 @@ class KeysBackupSettingsRecyclerViewController @Inject constructor(
title(host.stringProvider.getString(R.string.keys_backup_settings_status_ok).toEpoxyCharSequence())
style(ItemStyle.BIG_TEXT)
if (data.keysBackupVersionTrust()?.usable == false) {
description(host.stringProvider.getString(R.string.keys_backup_settings_untrusted_backup).toEpoxyCharSequence())
description(host.stringProvider.getString(R.string.keys_backup_settings_verify_device_now).toEpoxyCharSequence())
} else {
description(host.stringProvider.getString(R.string.keys_backup_info_keys_all_backup_up).toEpoxyCharSequence())
}
Expand All @@ -129,7 +129,7 @@ class KeysBackupSettingsRecyclerViewController @Inject constructor(
val remainingKeysToBackup = data.remainingKeysToBackup

if (data.keysBackupVersionTrust()?.usable == false) {
description(host.stringProvider.getString(R.string.keys_backup_settings_untrusted_backup).toEpoxyCharSequence())
description(host.stringProvider.getString(R.string.keys_backup_settings_verify_device_now).toEpoxyCharSequence())
} else {
description(
host.stringProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class KeysBackupSetupSharedViewModel @Inject constructor(

loadingStatus.postValue(
WaitingViewData(
context.getString(R.string.keys_backup_setup_step3_generating_key_status),
context.getString(R.string.keys_backup_setup_step3_generating_security_key_status),
progress,
total
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class KeysBackupSetupStep2Fragment :
}
else -> {
// User has entered a passphrase but want to skip this step.
viewModel.passphraseError.value = context?.getString(R.string.keys_backup_passphrase_not_empty_error_message)
viewModel.passphraseError.value = context?.getString(R.string.keys_backup_security_phrase_not_empty_error_message)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class KeysBackupSetupStep3Fragment :
viewModel.passphrase.observe(viewLifecycleOwner) {
if (it.isNullOrBlank()) {
// Recovery was generated, so show key and options to save
views.keysBackupSetupStep3Label2.text = getString(R.string.keys_backup_setup_step3_text_line2_no_passphrase)
views.keysBackupSetupStep3Label2.text = getString(R.string.keys_backup_setup_step3_key_explanation_no_passphrase)
views.keysBackupSetupStep3FinishButton.text = getString(R.string.keys_backup_setup_step3_button_title_no_passphrase)

views.keysBackupSetupStep3RecoveryKeyText.text = viewModel.recoveryKey.value!!.toBase58()
Expand All @@ -77,7 +77,7 @@ class KeysBackupSetupStep3Fragment :
}
views.keysBackupSetupStep3RecoveryKeyText.isVisible = true
} else {
views.keysBackupSetupStep3Label2.text = getString(R.string.keys_backup_setup_step3_text_line2)
views.keysBackupSetupStep3Label2.text = getString(R.string.keys_backup_setup_step3_key_explanation)
views.keysBackupSetupStep3FinishButton.text = getString(R.string.keys_backup_setup_step3_button_title)
views.keysBackupSetupStep3RecoveryKeyText.isVisible = false
}
Expand Down Expand Up @@ -137,7 +137,7 @@ class KeysBackupSetupStep3Fragment :
activity = requireActivity(),
activityResultLauncher = saveRecoveryActivityResultLauncher,
defaultFileName = "recovery-key-$userId-${timestamp}.txt",
chooserHint = getString(R.string.save_recovery_key_chooser_hint)
chooserHint = getString(R.string.save_security_key_chooser_hint)
)
dialog.dismiss()
}
Expand All @@ -146,9 +146,9 @@ class KeysBackupSetupStep3Fragment :
startSharePlainTextIntent(
context = requireContext(),
activityResultLauncher = null,
chooserTitle = context?.getString(R.string.keys_backup_setup_step3_share_intent_chooser_title),
chooserTitle = context?.getString(R.string.keys_backup_setup_step3_share_key_intent_chooser_title),
text = recoveryKey.toBase58(),
subject = context?.getString(R.string.recovery_key)
subject = context?.getString(R.string.security_key)
)
viewModel.copyHasBeenMade = true
dialog.dismiss()
Expand Down Expand Up @@ -180,7 +180,7 @@ class KeysBackupSetupStep3Fragment :
activity?.let {
MaterialAlertDialogBuilder(it)
.setTitle(R.string.dialog_title_success)
.setMessage(R.string.recovery_key_export_saved)
.setMessage(R.string.security_key_export_saved)
}
} catch (throwable: Throwable) {
activity?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,15 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
_viewEvents.post(
SharedSecureStorageViewEvent.UpdateLoadingState(
WaitingViewData(
message = stringProvider.getString(R.string.keys_backup_restoring_computing_key_waiting_message),
message = stringProvider.getString(R.string.keys_backup_restoring_computing_security_key_waiting_message),
isIndeterminate = true
)
)
)
val keySpec = RawBytesKeySpec.fromRecoveryKey(recoveryKey) ?: return@launch Unit.also {
_viewEvents.post(SharedSecureStorageViewEvent.KeyInlineError(stringProvider.getString(R.string.bootstrap_invalid_recovery_key)))
_viewEvents.post(SharedSecureStorageViewEvent.KeyInlineError(stringProvider.getString(R.string.bootstrap_invalid_security_key)))
_viewEvents.post(SharedSecureStorageViewEvent.HideModalLoading)
setState { copy(checkingSSSSAction = Fail(IllegalArgumentException(stringProvider.getString(R.string.bootstrap_invalid_recovery_key)))) }
setState { copy(checkingSSSSAction = Fail(IllegalArgumentException(stringProvider.getString(R.string.bootstrap_invalid_security_key)))) }
}
withContext(Dispatchers.IO) {
performRequest(keyInfo, keySpec, decryptedSecretMap)
Expand All @@ -268,7 +268,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
}, {
setState { copy(checkingSSSSAction = Fail(it)) }
_viewEvents.post(SharedSecureStorageViewEvent.HideModalLoading)
_viewEvents.post(SharedSecureStorageViewEvent.KeyInlineError(stringProvider.getString(R.string.keys_backup_passphrase_error_decrypt)))
_viewEvents.post(SharedSecureStorageViewEvent.KeyInlineError(stringProvider.getString(R.string.keys_backup_security_phrase_error_decrypt)))
})
}
}
Expand Down Expand Up @@ -322,7 +322,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
_viewEvents.post(
SharedSecureStorageViewEvent.UpdateLoadingState(
WaitingViewData(
message = stringProvider.getString(R.string.keys_backup_restoring_computing_key_waiting_message),
message = stringProvider.getString(R.string.keys_backup_restoring_computing_security_key_waiting_message),
isIndeterminate = true
)
)
Expand All @@ -336,7 +336,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
_viewEvents.post(
SharedSecureStorageViewEvent.UpdateLoadingState(
WaitingViewData(
message = stringProvider.getString(R.string.keys_backup_restoring_computing_key_waiting_message),
message = stringProvider.getString(R.string.keys_backup_restoring_computing_security_key_waiting_message),
isIndeterminate = false,
progress = progress,
progressTotal = total
Expand Down Expand Up @@ -364,7 +364,7 @@ class SharedSecureStorageViewModel @AssistedInject constructor(
}, {
setState { copy(checkingSSSSAction = Fail(it)) }
_viewEvents.post(SharedSecureStorageViewEvent.HideModalLoading)
_viewEvents.post(SharedSecureStorageViewEvent.InlineError(stringProvider.getString(R.string.keys_backup_passphrase_error_decrypt)))
_viewEvents.post(SharedSecureStorageViewEvent.InlineError(stringProvider.getString(R.string.keys_backup_security_phrase_error_decrypt)))
})
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SharedSecuredStorageKeyFragment :

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
views.ssssRestoreWithKeyText.text = getString(R.string.enter_secret_storage_input_key)
views.ssssRestoreWithKeyText.text = getString(R.string.enter_secret_storage_input_security_key)

views.ssssKeyEnterEdittext.editorActionEvents()
.throttleFirst(300)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class SharedSecuredStoragePassphraseFragment :
super.onViewCreated(view, savedInstanceState)

// If has passphrase
val pass = getString(R.string.recovery_passphrase)
val key = getString(R.string.recovery_key)
val pass = getString(R.string.security_phrase)
val key = getString(R.string.security_key)
views.ssssRestoreWithPassphraseWarningText.text = getString(
R.string.enter_secret_storage_passphrase_or_key,
pass,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ class BackupToQuadSMigrationTask @Inject constructor(
)
}
params.recoveryKey != null -> {
reportProgress(params, R.string.bootstrap_progress_generating_ssss_recovery)
reportProgress(params, R.string.bootstrap_progress_generating_ssss_from_key)
quadS.generateKey(
UUID.randomUUID().toString(),
extractCurveKeyFromRecoveryKey(params.recoveryKey)?.let { RawBytesKeySpec(it) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ class BootstrapConclusionFragment :

views.bootstrapConclusionText.text = getString(
R.string.bootstrap_cross_signing_success,
getString(R.string.recovery_passphrase),
getString(R.string.security_phrase),
getString(R.string.message_key)
)
.toSpannable()
.colorizeMatchingText(getString(R.string.recovery_passphrase), colorProvider.getColorFromAttribute(android.R.attr.textColorLink))
.colorizeMatchingText(getString(R.string.security_phrase), colorProvider.getColorFromAttribute(android.R.attr.textColorLink))
.colorizeMatchingText(getString(R.string.message_key), colorProvider.getColorFromAttribute(android.R.attr.textColorLink))
views.bootstrapConclusionText.giveAccessibilityFocusOnce()
}
Expand Down
Loading