mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-17 11:58:13 +00:00
apps/management/reset_device: fix display clear, move pin request
This commit is contained in:
parent
a7f011d59e
commit
5f76dc714a
@ -37,17 +37,17 @@ async def reset_device(ctx, msg):
|
|||||||
FailureType.UnexpectedMessage,
|
FailureType.UnexpectedMessage,
|
||||||
'Already initialized')
|
'Already initialized')
|
||||||
|
|
||||||
# generate and display internal entropy
|
|
||||||
internal_entropy = random.bytes(32)
|
|
||||||
if msg.display_random:
|
|
||||||
await show_entropy(ctx, internal_entropy)
|
|
||||||
|
|
||||||
# request new PIN
|
# request new PIN
|
||||||
if msg.pin_protection:
|
if msg.pin_protection:
|
||||||
newpin = await request_pin_confirm(ctx)
|
newpin = await request_pin_confirm(ctx)
|
||||||
else:
|
else:
|
||||||
newpin = ''
|
newpin = ''
|
||||||
|
|
||||||
|
# generate and display internal entropy
|
||||||
|
internal_entropy = random.bytes(32)
|
||||||
|
if msg.display_random:
|
||||||
|
await show_entropy(ctx, internal_entropy)
|
||||||
|
|
||||||
# request external entropy and compute mnemonic
|
# request external entropy and compute mnemonic
|
||||||
ext_ack = await ctx.call(EntropyRequest(), wire_types.EntropyAck)
|
ext_ack = await ctx.call(EntropyRequest(), wire_types.EntropyAck)
|
||||||
mnemonic = generate_mnemonic(
|
mnemonic = generate_mnemonic(
|
||||||
@ -160,11 +160,11 @@ async def show_mnemonic_page(page: int, page_count: int, pages: list):
|
|||||||
lines = ['%d. %s' % (wi + 1, word) for wi, word in pages[page]]
|
lines = ['%d. %s' % (wi + 1, word) for wi, word in pages[page]]
|
||||||
content = Text('Recovery seed', ui.ICON_RESET, ui.MONO, *lines)
|
content = Text('Recovery seed', ui.ICON_RESET, ui.MONO, *lines)
|
||||||
content = Scrollpage(content, page, page_count)
|
content = Scrollpage(content, page, page_count)
|
||||||
|
ui.display.clear()
|
||||||
|
|
||||||
if page + 1 == page_count:
|
if page + 1 == page_count:
|
||||||
await HoldToConfirmDialog(content)
|
await HoldToConfirmDialog(content)
|
||||||
else:
|
else:
|
||||||
ui.display.clear()
|
|
||||||
content.render()
|
content.render()
|
||||||
await animate_swipe()
|
await animate_swipe()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user