diff --git a/core/SConscript.firmware b/core/SConscript.firmware index aaaf836e682..340a4002eee 100644 --- a/core/SConscript.firmware +++ b/core/SConscript.firmware @@ -662,9 +662,10 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/NEM*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py')) + if PYOPT == '0': + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py')) + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py')) + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/ripple/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Ripple*.py')) diff --git a/core/SConscript.unix b/core/SConscript.unix index 9e75b5eebfe..bd3cf297503 100644 --- a/core/SConscript.unix +++ b/core/SConscript.unix @@ -720,9 +720,10 @@ if FROZEN: SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nem/*/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/NEM*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py')) - SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py')) + if PYOPT == '0': + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*.py')) + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/nostr/*/*.py')) + SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Nostr*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'apps/ripple/*.py')) SOURCE_PY.extend(Glob(SOURCE_PY_DIR + 'trezor/enums/Ripple*.py')) diff --git a/core/src/apps/workflow_handlers.py b/core/src/apps/workflow_handlers.py index af8460791bd..c7ff7ba4772 100644 --- a/core/src/apps/workflow_handlers.py +++ b/core/src/apps/workflow_handlers.py @@ -106,11 +106,15 @@ def _find_message_handler_module(msg_type: int) -> str: if msg_type == MessageType.GetFirmwareHash: return "apps.misc.get_firmware_hash" - # nostr - if msg_type == MessageType.NostrGetPubkey: - return "apps.nostr.get_pubkey" - if msg_type == MessageType.NostrSignEvent: - return "apps.nostr.sign_event" + # When promoting the Nostr app to production-level + # and removing the "if" guard don't forget to also remove + # the corresponding guards (PYOPT == '0') in Sconscript.* + if __debug__: + # nostr + if msg_type == MessageType.NostrGetPubkey: + return "apps.nostr.get_pubkey" + if msg_type == MessageType.NostrSignEvent: + return "apps.nostr.sign_event" if not utils.BITCOIN_ONLY: if msg_type == MessageType.SetU2FCounter: