From e1bcb4e3470f05983b3b063ec94eadfabd92274a Mon Sep 17 00:00:00 2001 From: grdddj Date: Fri, 31 Mar 2023 12:37:02 +0200 Subject: [PATCH] TR-common/protob: add ShowDeviceTutorial message --- common/protob/messages-management.proto | 8 ++++++++ common/protob/messages.proto | 1 + core/src/trezor/enums/MessageType.py | 1 + core/src/trezor/enums/__init__.py | 1 + core/src/trezor/messages.py | 6 ++++++ legacy/firmware/protob/Makefile | 2 +- python/src/trezorlib/messages.py | 5 +++++ 7 files changed, 23 insertions(+), 1 deletion(-) diff --git a/common/protob/messages-management.proto b/common/protob/messages-management.proto index cc87c9338..e31e67362 100644 --- a/common/protob/messages-management.proto +++ b/common/protob/messages-management.proto @@ -502,3 +502,11 @@ message UnlockPath { message UnlockedPathRequest { optional bytes mac = 1; // authentication code for future UnlockPath calls } + +/** + * Request: Show tutorial screens on the device + * @start + * @next Success + */ +message ShowDeviceTutorial { +} diff --git a/common/protob/messages.proto b/common/protob/messages.proto index c0ea0ff75..b2e1a4af3 100644 --- a/common/protob/messages.proto +++ b/common/protob/messages.proto @@ -120,6 +120,7 @@ enum MessageType { reserved 90 to 92; MessageType_UnlockPath = 93 [(bitcoin_only) = true, (wire_in) = true]; MessageType_UnlockedPathRequest = 94 [(bitcoin_only) = true, (wire_out) = true]; + MessageType_ShowDeviceTutorial = 95 [(bitcoin_only) = true, (wire_in) = true]; MessageType_SetU2FCounter = 63 [(wire_in) = true]; MessageType_GetNextU2FCounter = 80 [(wire_in) = true]; diff --git a/core/src/trezor/enums/MessageType.py b/core/src/trezor/enums/MessageType.py index c245a903b..b6b120dd7 100644 --- a/core/src/trezor/enums/MessageType.py +++ b/core/src/trezor/enums/MessageType.py @@ -46,6 +46,7 @@ GetFirmwareHash = 88 FirmwareHash = 89 UnlockPath = 93 UnlockedPathRequest = 94 +ShowDeviceTutorial = 95 FirmwareErase = 6 FirmwareUpload = 7 FirmwareRequest = 8 diff --git a/core/src/trezor/enums/__init__.py b/core/src/trezor/enums/__init__.py index c701dad56..cc3300328 100644 --- a/core/src/trezor/enums/__init__.py +++ b/core/src/trezor/enums/__init__.py @@ -63,6 +63,7 @@ if TYPE_CHECKING: FirmwareHash = 89 UnlockPath = 93 UnlockedPathRequest = 94 + ShowDeviceTutorial = 95 SetU2FCounter = 63 GetNextU2FCounter = 80 NextU2FCounter = 81 diff --git a/core/src/trezor/messages.py b/core/src/trezor/messages.py index 78809b2f6..7baf92a83 100644 --- a/core/src/trezor/messages.py +++ b/core/src/trezor/messages.py @@ -2612,6 +2612,12 @@ if TYPE_CHECKING: def is_type_of(cls, msg: Any) -> TypeGuard["UnlockedPathRequest"]: return isinstance(msg, cls) + class ShowDeviceTutorial(protobuf.MessageType): + + @classmethod + def is_type_of(cls, msg: Any) -> TypeGuard["ShowDeviceTutorial"]: + return isinstance(msg, cls) + class DebugLinkDecision(protobuf.MessageType): button: "DebugButton | None" swipe: "DebugSwipeDirection | None" diff --git a/legacy/firmware/protob/Makefile b/legacy/firmware/protob/Makefile index 8b1f36139..a9c2121ec 100644 --- a/legacy/firmware/protob/Makefile +++ b/legacy/firmware/protob/Makefile @@ -7,7 +7,7 @@ SKIPPED_MESSAGES := Binance Cardano DebugMonero Eos Monero Ontology Ripple SdPro DebugLinkLayout GetNonce \ TxAckInput TxAckOutput TxAckPrev TxAckPaymentRequest \ EthereumSignTypedData EthereumTypedDataStructRequest EthereumTypedDataStructAck \ - EthereumTypedDataValueRequest EthereumTypedDataValueAck + EthereumTypedDataValueRequest EthereumTypedDataValueAck ShowDeviceTutorial ifeq ($(BITCOIN_ONLY), 1) SKIPPED_MESSAGES += Ethereum NEM Stellar diff --git a/python/src/trezorlib/messages.py b/python/src/trezorlib/messages.py index 227a27dea..3704754c2 100644 --- a/python/src/trezorlib/messages.py +++ b/python/src/trezorlib/messages.py @@ -71,6 +71,7 @@ class MessageType(IntEnum): FirmwareHash = 89 UnlockPath = 93 UnlockedPathRequest = 94 + ShowDeviceTutorial = 95 SetU2FCounter = 63 GetNextU2FCounter = 80 NextU2FCounter = 81 @@ -3715,6 +3716,10 @@ class UnlockedPathRequest(protobuf.MessageType): self.mac = mac +class ShowDeviceTutorial(protobuf.MessageType): + MESSAGE_WIRE_TYPE = 95 + + class DebugLinkDecision(protobuf.MessageType): MESSAGE_WIRE_TYPE = 100 FIELDS = {