Skip to content

Commit

Permalink
fix(python): do not take legacy snapshots on PinRequest and Passphras…
Browse files Browse the repository at this point in the history
…eRequest

legacy < 1.11.0 will never answer those because PinRequest and
PassphraseRequest block waiting for PinAck / PassphraseAck over wirelink
and ignore debuglink
  • Loading branch information
matejcik committed Nov 12, 2024
1 parent aec8794 commit 6b8585b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions python/src/trezorlib/debuglink.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ def has_global_layout(self) -> bool:
"""Differences in waiting for Global Layout objects."""
return self.version >= (2, 8, 6)

@property
def responds_to_debuglink_in_usb_tiny(self) -> bool:
"""Whether a Trezor One can respond to DebugLinkGetState while waiting
for a Button/Pin/Passphrase Ack."""
return self.version >= (1, 11, 0)

@property
def layout_type(self) -> LayoutType:
assert self.model is not None
Expand Down Expand Up @@ -790,6 +796,9 @@ def snapshot_legacy(self) -> None:
if self.model is not models.T1B1:
return

if not self.responds_to_debuglink_in_usb_tiny:
return

state = self.state()
if state.layout is not None:
self._save_screenshot_t1(state.layout)
Expand Down

0 comments on commit 6b8585b

Please sign in to comment.