backup fixes

This commit is contained in:
scgbckbone 2025-04-08 10:58:03 +02:00 committed by doc-hex
parent 634bb69873
commit 78fcfa56a5
2 changed files with 8 additions and 8 deletions

View File

@ -383,15 +383,17 @@ async def make_complete_backup(fname_pattern='backup.7z', write_sflash=False):
ckcc.rng_bytes(b)
pwd = bip39.b2a_words(b).rsplit(' ', num_pw_words)[0]
ch = await seed.show_words(prompt="Record this (%d word) backup file password:\n",
words=pwd.split(" "), escape='6')
ch = await seed.show_words(
prompt="Record this (%d word) backup file password:\n" % num_pw_words,
words=pwd.split(" "), escape='6'
)
if ch == '6' and not write_sflash:
if (ch == '6') and not write_sflash:
# Secret feature: plaintext mode
# - only safe for people living in faraday cages inside locked vaults.
if await ux_confirm("The file will **NOT** be encrypted and "
"anyone who finds the file will get all of your money for free!"):
words = []
pwd = []
fname_pattern = 'backup.txt'
break
continue
@ -486,11 +488,9 @@ async def write_complete_backup(pwd, fname_pattern, write_sflash=False,
except Exception as e:
# includes CardMissingError
import sys
sys.print_exception(e)
# catch any error
ch = await ux_show_story('Failed to write! Please insert formated MicroSD card, '
'and press %s to try again.\n\nX to cancel.\n\n\n' % OK +str(e))
'and press %s to try again.\n\n%s to cancel.\n\n\n%s' % (OK, X, e))
if ch == 'x': break
continue

View File

@ -142,7 +142,7 @@ def backup_system(settings_set, settings_remove, goto_home, pick_menu_item,
words = ['zoo'] * 12
else:
assert title == 'NO-TITLE'
assert 'Record this' in body
assert 'Record this (12 word)' in body
assert 'password:' in body
words = seed_story_to_words(body)