diff --git a/core/src/apps/misc/get_firmware.py b/core/src/apps/misc/get_firmware.py index 115d67c1f..eabcb6822 100644 --- a/core/src/apps/misc/get_firmware.py +++ b/core/src/apps/misc/get_firmware.py @@ -23,12 +23,12 @@ async def get_firmware(ctx: Context, _msg: GetFirmware) -> Success: action="Do you want to extract device firmware?", description="Your seed will not be revealed.", ) - if not utils.DISABLE_ANIMATION: - workflow.close_others() - draw_simple_text("Please wait") - sector_buffer = bytearray(CHUNK_SIZE) packet = FirmwareChunk(chunk=sector_buffer) + + workflow.close_others() + draw_simple_text("Please wait") + progress = 0 _render_progress(progress, PROGRESS_TOTAL) for i in range(utils.FIRMWARE_SECTORS_COUNT): diff --git a/core/src/apps/misc/get_firmware_hash.py b/core/src/apps/misc/get_firmware_hash.py index a59c7c05c..ecc197ceb 100644 --- a/core/src/apps/misc/get_firmware_hash.py +++ b/core/src/apps/misc/get_firmware_hash.py @@ -10,14 +10,11 @@ if TYPE_CHECKING: async def get_firmware_hash(ctx: Context, msg: GetFirmwareHash) -> FirmwareHash: - render_func = None - if not DISABLE_ANIMATION: - workflow.close_others() - draw_simple_text("Please wait") - render_func = _render_progress + workflow.close_others() + draw_simple_text("Please wait") try: - hash = firmware_hash(msg.challenge, render_func) + hash = firmware_hash(msg.challenge, _render_progress) except ValueError as e: raise wire.DataError(str(e)) @@ -25,6 +22,7 @@ async def get_firmware_hash(ctx: Context, msg: GetFirmwareHash) -> FirmwareHash: def _render_progress(progress: int, total: int) -> None: - p = 1000 * progress // total - ui.display.loader(p, False, 18, ui.WHITE, ui.BG) - ui.refresh() + if not DISABLE_ANIMATION: + p = 1000 * progress // total + ui.display.loader(p, False, 18, ui.WHITE, ui.BG) + ui.refresh()