diff --git a/services/root-keys/locales/i18n.json b/services/root-keys/locales/i18n.json index a80e9882d..c297ddcdf 100644 --- a/services/root-keys/locales/i18n.json +++ b/services/root-keys/locales/i18n.json @@ -12,10 +12,10 @@ "en-tts": "Would you like to verify that you wrote the backup key down correctly by re-entering it now?" }, "rootkeys.backup_badpass": { - "en": "Password incorrect. Aborting backup!", + "en": "Password incorrect.\n\nPlease try again, or reboot by inserting a paperclip in the hard reset hole.", "ja": "正しくないパスワード。 バックアップを中止します!", "zh": "密码错误。 中止备份!", - "en-tts": "Password incorrect. Aborting backup!" + "en-tts": "Password incorrect.\n\nPlease try again, or reboot by inserting a paperclip in the hard reset hole." }, "rootkeys.restore_badpass": { "en": "BIP-39 entry was not valid. Aborting restore!", diff --git a/services/root-keys/src/main.rs b/services/root-keys/src/main.rs index 0df3ad7ac..3864ea999 100644 --- a/services/root-keys/src/main.rs +++ b/services/root-keys/src/main.rs @@ -1411,6 +1411,7 @@ fn main() -> ! { continue; } checksums = ipc.checksums; + keys.set_ux_password_type(Some(PasswordType::Update)); password_action.set_action_opcode(Opcode::UxCreateBackupPwReturn.to_u32().unwrap()); rootkeys_modal.modify( @@ -1491,6 +1492,20 @@ fn main() -> ! { } } else { modals.show_notification(t!("rootkeys.backup_badpass", xous::LANG), None).ok(); + // Prompt the user again for the password. It will do this until a correct password is entered. + // maybe it would be thoughtful to add a yes/no box for rebooting in case someone decides they + // don't want to run the backup right now. But I think this is an edge case that few will run into. + keys.set_ux_password_type(Some(PasswordType::Update)); + password_action.set_action_opcode(Opcode::UxCreateBackupPwReturn.to_u32().unwrap()); + rootkeys_modal.modify( + Some(ActionType::TextEntry(password_action.clone())), + Some(t!("rootkeys.get_update_password_backup", xous::LANG)), false, + None, true, None + ); + #[cfg(feature="tts")] + tts.tts_blocking(t!("rootkeys.get_update_password_backup", xous::LANG)).unwrap(); + log::info!("{}ROOTKEY.UPDPW,{}", xous::BOOKEND_START, xous::BOOKEND_END); + rootkeys_modal.activate(); } } Some(Opcode::DoRestore) => { diff --git a/services/status/locales/i18n.json b/services/status/locales/i18n.json index d1dc1a7aa..a3ec05fef 100644 --- a/services/status/locales/i18n.json +++ b/services/status/locales/i18n.json @@ -29,6 +29,12 @@ "zh": "无法卸载 PDDB 以准备备份。 备份中止。", "en-tts": "Couldn't unmount PDDB in preparation for backup. Backup aborted." }, + "backup.confirm": { + "ja": "PDDB とルート キーのバックアップの準備をしますか?\n\nプロセスは、いったん開始すると中止できません。", + "en": "Prepare for PDDB and root key backup?\n\nThe process cannot be aborted once started.", + "zh": "准备 PDDB 和根密钥备份吗?\n\n进程一旦启动就不能中止。", + "en-tts": "Prepare for PDDB and root key backup?\n\nThe process cannot be aborted once started." + }, "ecup.invalid": { "ja": "ECファームウェアパッケージが破損しているか無効です: ", "en": "EC firmware package is corrupted or invalid: ", diff --git a/services/status/src/main.rs b/services/status/src/main.rs index 6ff6eba04..6e9db124b 100644 --- a/services/status/src/main.rs +++ b/services/status/src/main.rs @@ -1061,6 +1061,21 @@ fn wrapped_main() -> ! { com.set_backlight(0, 0).expect("cannot set backlight off"); }, Some(StatusOpcode::PrepareBackup) => { + log::info!("{}BACKUP.CONFIRM,{}", xous::BOOKEND_START, xous::BOOKEND_END); + modals.add_list_item(t!("rootkeys.gwup.yes", xous::LANG)).expect("couldn't build radio item list"); + modals.add_list_item(t!("rootkeys.gwup.no", xous::LANG)).expect("couldn't build radio item list"); + match modals.get_radiobutton(t!("backup.confirm", xous::LANG)) { + Ok(response) => { + if response.as_str() == t!("rootkeys.gwup.yes", xous::LANG) { + {} + } else { + // abort the flow now by returning to the main dispatch handler + continue; + } + } + _ => (), + } + // disconnect from the network, so that incoming network packets don't trigger any processes that // could write to the PDDB. netmgr.connection_manager_wifi_off_and_stop().ok();