Skip to content

feat: support attach to pin#357

Merged
guowei0105 merged 16 commits intoOneKeyHQ:mainfrom
guowei0105:merge-commits
Jul 17, 2025
Merged

feat: support attach to pin#357
guowei0105 merged 16 commits intoOneKeyHQ:mainfrom
guowei0105:merge-commits

Conversation

@guowei0105
Copy link
Copy Markdown
Contributor

@guowei0105 guowei0105 commented Jul 16, 2025

Summary by CodeRabbit

  • New Features

    • Introduced "Attach to PIN" functionality for securely linking a passphrase to a PIN.
    • Added device settings and UI screens for managing passphrase PIN attachment, including setup, confirmation, and removal.
    • Added new message types and device capabilities to query and manage passphrase and PIN states.
    • Enhanced session and unlock management to support passphrase PIN workflows.
  • Improvements

    • Updated PIN entry and validation with configurable minimum lengths and refined error handling.
    • Enhanced UI components for passphrase and PIN input with dynamic button states and contextual prompts.
    • Added device settings for passphrase PIN enablement and automatic passphrase modes.
    • Improved compatibility checks to enforce client and firmware feature support.
  • Bug Fixes

    • Improved session handling during lock/unlock, especially with passphrase PIN features.
    • Fixed fingerprint unlock and USB auto-lock flows to properly manage passphrase PIN sessions.
  • Documentation

    • Expanded user-facing messages and prompts for new features and error conditions.
  • Style

    • Updated UI layouts and visual cues for better clarity and usability in security and passphrase screens.

@guowei0105 guowei0105 requested a review from a team as a code owner July 16, 2025 10:11
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jul 16, 2025

Walkthrough

This update adds support for attaching a passphrase to a PIN, including new message types, UI screens, and backend logic. It introduces new constants, enums, and fields for PIN/passphrase management, session handling, and device unlocking. The codebase now supports querying passphrase state, managing attach-to-pin features, and handling related UI workflows.

Changes

Files/Paths Change Summary
common/protob/messages-common.proto
core/src/trezor/messages.py
Added attach-to-pin fields to passphrase messages; new enum value for ButtonRequestType.
common/protob/messages-management.proto
core/src/trezor/messages.py
Added fields and messages for passphrase state, device unlocking, and attach-to-pin capability.
common/protob/messages.proto
core/src/trezor/enums/MessageType.py
core/src/trezor/enums/init.py
Added new message types for passphrase state and device unlock.
core/embed/extmod/modtrezorconfig/modtrezorconfig.c Updated unlock/check_pin functions for new PIN type argument and result handling.
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h Added functions/constants for session type, pin-passphrase management, and test address checking.
core/embed/trezorhal/se_thd89.c
core/embed/trezorhal/se_thd89.h
Extended PIN/passphrase logic, added session type, result tracking, and space checking functions.
core/src/all_modules.py Imported new attach-to-pin and pin constants modules.
core/src/apps/base.py Added attach-to-pin capability checks, passphrase pin state logic, and new message handlers.
core/src/apps/common/passphrase.py Added passphrase pin state checks and handling for attach-to-pin flows.
core/src/apps/common/pin_constants.py New constants for PIN results, types, and attach-to-pin minimum length.
core/src/apps/common/request_pin.py Refined PIN handling, added new parameters, error handling, and PIN type support.
core/src/apps/common/seed.py Conditional passphrase retrieval based on passphrase pin state.
core/src/apps/management/change_pin.py Enhanced PIN validation and error for passphrase PIN usage.
core/src/apps/management/recovery_device/init.py Adjusted translation usage; updated PIN verification and input logic.
core/src/apps/management/wipe_device.py Specified PIN type in verification call.
core/src/apps/ur_registry/helpers.py Updated name reveal logic to consider passphrase pin state.
core/src/apps/workflow_handlers.py Added version check wrapping for address derivation handlers.
core/src/boot.py Specified PIN type in bootscreen PIN verification.
core/src/storage/cache.py Added new sessionless cache key for attach-to-pin capability.
core/src/storage/device.py Added passphrase pin/auto flags, getters/setters, and reduced max PIN attempts.
core/src/trezor/enums/ButtonRequestType.py
core/src/trezor/enums/Capability.py
core/src/trezor/enums/init.py
Added AttachPin and AttachToPin enum values.
core/src/trezor/lvglui/scrs/address.py Saved previous session ID in Cardano address flow.
core/src/trezor/lvglui/scrs/components/keyboard.py Added minimum length logic and OK button state for passphrase keyboard.
core/src/trezor/lvglui/scrs/components/listitem.py Adjusted letter spacing in list item text style.
core/src/trezor/lvglui/scrs/homescreen.py Major UI changes: attach-to-pin screens, session handling, and new CryptoScreen class.
core/src/trezor/lvglui/scrs/lockscreen.py Added debug prints for lockscreen state and tip messages.
core/src/trezor/lvglui/scrs/passphrase.py PassphraseRequest supports minimum length and updates OK button state.
core/src/trezor/lvglui/scrs/pinscreen.py InputPin/InputMainPin support min length, standy_wall_only, and passphrase PIN flows.
core/src/trezor/ui/layouts/lvgl/init.py Updated PIN/passphrase request functions for attach-to-pin and min length support.
core/src/trezor/ui/layouts/lvgl/attach_to_pin.py New module for attach-to-pin UI and logic, including confirmation flows and error handling.
core/src/trezor/wire/errors.py Added AppVersionLow error for compatibility checks.
core/src/trezor/uart.py Integrated passphrase pin session management in fingerprint, USB, and button lock flows.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 4b5743a and 6c65813.

📒 Files selected for processing (1)
  • common/protob/messages.proto (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • common/protob/messages.proto
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Defs check
  • GitHub Check: Style check

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@revan-zhang
Copy link
Copy Markdown
Contributor

revan-zhang commented Jul 16, 2025

🎉 Snyk checks have passed. No issues have been found so far.

security/snyk check is complete. No issues have been found. (View Details)

license/snyk check is complete. No issues have been found. (View Details)

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 22

🔭 Outside diff range comments (4)
core/src/trezor/lvglui/scrs/reset_device.py (1)

51-54: Remove duplicate code.

These lines duplicate lines 46-49 above.

core/src/apps/common/request_pin.py (1)

277-277: Add missing parentheses.

-        _set_last_unlock_time
+        _set_last_unlock_time()
core/src/trezor/lvglui/scrs/homescreen.py (1)

2632-2632: Fix undefined variable bug.

path_down doesn't exist.

-            self.path_down.enable_bg_color(False)
core/src/apps/workflow_handlers.py (1)

14-15: Missing docstring.

The docstring was removed from the register function.

🧹 Nitpick comments (15)
python/src/trezorlib/cli/device.py (1)

362-362: Fix typo.

"feautres" should be "features".

-# new feautres
+# new features
core/src/apps/common/pin_constants.py (1)

6-6: Fix grammar error.

PASSPHRASE_PIN_NO_MATCHED should be PASSPHRASE_PIN_NOT_MATCHED.

core/src/apps/common/request_pin.py (6)

154-154: Fix typo.

"cancle" → "cancel"


162-162: Fix typo.

"cancle" → "cancel"


181-181: Fix typo.

"cancle" → "cancel"


196-196: Fix typo.

"cancle" → "cancel"


223-223: Fix typo.

"cancle" → "cancel"


241-241: Fix debug text.

"cal cale .." → "cancel"

core/src/trezor/ui/layouts/lvgl/__init__.py (1)

1274-1279: Remove commented code

Clean up unused code.

-    # min_len = 4
-    # if attach_wall_only:
-    #     min_len = 6
-    # else:
-    #     min_len = 4
python/src/trezorlib/messages.py (1)

502-502: High field number used for button request type.

Field number 8000 is unusually high for protobuf. Standard practice uses lower numbers for efficiency.

core/src/apps/base.py (1)

710-717: Combine nested if statements.

Merge these conditions into one.

-    if (
-        fingerprints.is_available()
-        and fingerprints.is_unlocked()
-        and not config.is_unlocked()
-    ):
-        if storage.device.is_passphrase_pin_enabled():
-            storage.device.set_passphrase_pin_enabled(False)
+    if (
+        fingerprints.is_available()
+        and fingerprints.is_unlocked()
+        and not config.is_unlocked()
+        and storage.device.is_passphrase_pin_enabled()
+    ):
+        storage.device.set_passphrase_pin_enabled(False)
core/src/trezor/lvglui/scrs/homescreen.py (1)

5563-5595: Combine nested ifs.

Use and instead of nesting.

-                if target == self.attach_to_pin:
-                    global _attach_to_pin_task_running
-
-                    _attach_to_pin_task_running = True
+                if target == self.attach_to_pin and not _attach_to_pin_task_running:
+                    _attach_to_pin_task_running = True
common/protob/messages.proto (1)

124-124: Remove trailing whitespace.

core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (2)

985-985: Unclear wording in docstring.

"cover" should be "overwrite" or "replace".


1041-1041: Fix grammar in docstring.

"whether the deleted is" should be "whether the deleted item is".

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 564500f and e7b1487.

⛔ Files ignored due to path filters (8)
  • core/mocks/generated/trezorconfig.pyi is excluded by !**/generated/**
  • core/mocks/generated/trezorcrypto/se_thd89.pyi is excluded by !**/generated/**
  • core/src/trezor/lvglui/res/attach-to-pin-guide.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/attach_to_pin_display.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/attach_to_pin_dot_group.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/icon-attach-to-pin.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/nav-icon.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/pin_lock.png is excluded by !**/*.png
📒 Files selected for processing (42)
  • common/protob/messages-common.proto (3 hunks)
  • common/protob/messages-management.proto (4 hunks)
  • common/protob/messages.proto (3 hunks)
  • core/embed/extmod/modtrezorconfig/modtrezorconfig.c (1 hunks)
  • core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (5 hunks)
  • core/embed/trezorhal/se_thd89.c (10 hunks)
  • core/embed/trezorhal/se_thd89.h (4 hunks)
  • core/src/all_modules.py (2 hunks)
  • core/src/apps/base.py (10 hunks)
  • core/src/apps/common/passphrase.py (4 hunks)
  • core/src/apps/common/pin_constants.py (1 hunks)
  • core/src/apps/common/request_pin.py (8 hunks)
  • core/src/apps/common/seed.py (2 hunks)
  • core/src/apps/management/change_pin.py (3 hunks)
  • core/src/apps/management/recovery_device/__init__.py (4 hunks)
  • core/src/apps/management/wipe_device.py (1 hunks)
  • core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py (1 hunks)
  • core/src/apps/ur_registry/helpers.py (1 hunks)
  • core/src/apps/workflow_handlers.py (2 hunks)
  • core/src/boot.py (1 hunks)
  • core/src/storage/cache.py (2 hunks)
  • core/src/storage/device.py (9 hunks)
  • core/src/trezor/enums/ButtonRequestType.py (1 hunks)
  • core/src/trezor/enums/Capability.py (1 hunks)
  • core/src/trezor/enums/MessageType.py (2 hunks)
  • core/src/trezor/enums/__init__.py (3 hunks)
  • core/src/trezor/lvglui/scrs/address.py (1 hunks)
  • core/src/trezor/lvglui/scrs/components/keyboard.py (5 hunks)
  • core/src/trezor/lvglui/scrs/components/listitem.py (1 hunks)
  • core/src/trezor/lvglui/scrs/homescreen.py (19 hunks)
  • core/src/trezor/lvglui/scrs/lockscreen.py (3 hunks)
  • core/src/trezor/lvglui/scrs/passphrase.py (2 hunks)
  • core/src/trezor/lvglui/scrs/pinscreen.py (5 hunks)
  • core/src/trezor/lvglui/scrs/reset_device.py (1 hunks)
  • core/src/trezor/messages.py (6 hunks)
  • core/src/trezor/uart.py (2 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (4 hunks)
  • core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1 hunks)
  • core/src/trezor/wire/errors.py (1 hunks)
  • python/src/trezorlib/cli/device.py (2 hunks)
  • python/src/trezorlib/device.py (2 hunks)
  • python/src/trezorlib/messages.py (12 hunks)
👮 Files not reviewed due to content moderation or server errors (3)
  • core/src/trezor/lvglui/scrs/components/keyboard.py
  • core/embed/extmod/modtrezorconfig/modtrezorconfig.c
  • core/embed/trezorhal/se_thd89.h
🧰 Additional context used
🧬 Code Graph Analysis (9)
core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py (1)
core/src/apps/ur_registry/chains/__init__.py (1)
  • MismatchError (7-9)
core/src/trezor/lvglui/scrs/address.py (1)
core/src/storage/cache.py (1)
  • get_session_id (238-239)
core/src/trezor/enums/MessageType.py (2)
core/src/trezor/messages.py (4)
  • UnLockDevice (3984-3988)
  • UnLockDeviceResponse (3990-4006)
  • GetPassphraseState (3948-3964)
  • PassphraseState (3966-3982)
python/src/trezorlib/messages.py (4)
  • UnLockDevice (5566-5567)
  • UnLockDeviceResponse (5570-5587)
  • GetPassphraseState (5526-5543)
  • PassphraseState (5546-5563)
core/src/trezor/lvglui/scrs/reset_device.py (1)
core/src/trezor/lvglui/scrs/common.py (1)
  • add_nav_back (535-544)
core/src/trezor/uart.py (3)
core/src/apps/common/passphrase.py (1)
  • is_passphrase_pin_enabled (15-16)
core/src/storage/device.py (1)
  • is_passphrase_pin_enabled (1424-1432)
core/src/storage/cache.py (1)
  • end_current_session (224-235)
core/src/trezor/enums/__init__.py (2)
core/src/trezor/messages.py (4)
  • GetPassphraseState (3948-3964)
  • PassphraseState (3966-3982)
  • UnLockDevice (3984-3988)
  • UnLockDeviceResponse (3990-4006)
python/src/trezorlib/messages.py (4)
  • GetPassphraseState (5526-5543)
  • PassphraseState (5546-5563)
  • UnLockDevice (5566-5567)
  • UnLockDeviceResponse (5570-5587)
python/src/trezorlib/messages.py (3)
core/src/trezor/messages.py (4)
  • GetPassphraseState (3948-3964)
  • PassphraseState (3966-3982)
  • UnLockDevice (3984-3988)
  • UnLockDeviceResponse (3990-4006)
python/src/trezorlib/protobuf.py (2)
  • Field (148-179)
  • MessageType (189-249)
core/src/trezor/enums/__init__.py (1)
  • MessageType (27-451)
core/src/trezor/messages.py (3)
python/src/trezorlib/messages.py (5)
  • GetPassphraseState (5526-5543)
  • MessageType (36-460)
  • PassphraseState (5546-5563)
  • UnLockDevice (5566-5567)
  • UnLockDeviceResponse (5570-5587)
core/src/trezor/enums/__init__.py (1)
  • MessageType (27-451)
python/src/trezorlib/protobuf.py (1)
  • MessageType (189-249)
core/embed/trezorhal/se_thd89.c (6)
core/embed/trezorhal/se_thd89.h (9)
  • se_verifyPin (112-112)
  • session_generate_seed_percent (256-256)
  • se_set_pin_passphrase (117-118)
  • se_delete_pin_passphrase (119-119)
  • se_check_passphrase_btc_test_address (122-122)
  • se_get_pin_passphrase_space (121-121)
  • se_get_pin_result_type (116-116)
  • se_get_pin_passphrase_ret (120-120)
  • se_session_get_type (139-139)
core/embed/trezorhal/thd89.c (1)
  • thd89_last_error (590-590)
core/embed/trezorhal/thd89.h (1)
  • thd89_last_error (24-24)
core/embed/trezorhal/thd89_boot.h (1)
  • ui_callback (28-28)
core/embed/trezorhal/common.h (1)
  • hal_delay (107-107)
core/embed/trezorhal/common.c (1)
  • hal_delay (294-294)
🪛 Ruff (0.12.2)
core/src/apps/common/request_pin.py

154-154: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


160-160: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


162-162: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


181-181: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


196-196: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


223-223: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


241-241: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


305-305: Do not assert False (python -O removes these calls), raise AssertionError()

Replace assert False

(B011)

core/src/apps/base.py

710-715: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

core/src/trezor/lvglui/scrs/homescreen.py

5563-5564: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Style check
  • GitHub Check: Defs check
  • GitHub Check: Gen check
🔇 Additional comments (45)
core/src/trezor/lvglui/scrs/components/listitem.py (1)

32-32: Letter spacing adjustment looks good.

core/src/trezor/enums/ButtonRequestType.py (1)

24-24: New AttachPin enum value added correctly.

core/src/all_modules.py (2)

370-371: Module imports follow established pattern.


584-585: PIN constants module properly imported.

core/src/boot.py (1)

36-38: PIN type specification added correctly.

core/src/trezor/enums/Capability.py (1)

12-12: New AttachToPin capability added in correct sequence.

core/src/apps/management/wipe_device.py (1)

24-28: LGTM!

The PIN type specification is correctly scoped to non-debug mode and follows the expected pattern.

core/src/trezor/wire/errors.py (1)

86-88: LGTM!

The exception class follows the established pattern and uses appropriate failure type.

core/src/trezor/lvglui/scrs/address.py (1)

126-126: LGTM!

Storing the previous session ID before starting a new session supports proper session tracking.

core/src/apps/ur_registry/helpers.py (1)

75-77: LGTM!

The condition expansion properly includes passphrase PIN support while maintaining existing logic.

core/src/storage/cache.py (2)

35-35: LGTM!

The new cache key follows the established sessionless pattern.


146-146: LGTM!

The field size correctly matches the new cache key.

common/protob/messages-common.proto (1)

78-78: Verify the high field numbers (8000) are intentional.

The field numbers 8000 are unusually high for protobuf fields. Confirm this is intentional to avoid conflicts.

Also applies to: 123-123, 134-134

core/src/trezor/enums/__init__.py (1)

448-451: LGTM!

Enum values are consistent with protobuf definitions.

Also applies to: 491-491, 656-656

python/src/trezorlib/device.py (1)

446-449: LGTM!

Function correctly sends UnLockDevice message and expects proper response.

python/src/trezorlib/cli/device.py (1)

735-777: LGTM!

CLI commands properly implement the new device functions.

core/src/apps/management/change_pin.py (1)

37-66: LGTM!

PIN validation logic correctly prevents using passphrase PINs as regular PINs.

core/src/trezor/messages.py (6)

839-846: Field addition looks correct.

The new exists_attach_pin_user field follows the established pattern.


855-863: Field addition looks correct.

The new on_device_attach_pin field follows the established pattern.


2913-2923: Field additions look correct.

Both passphrase_state and is_contains_attach fields follow the established pattern.


3025-3026: Field additions look correct.

Both attach_to_pin_user and unlocked_attach_pin fields follow the established pattern.


3113-3115: Constructor parameters look correct.

Parameters match the field definitions above.


3948-4006: New message classes look correct.

All four classes follow the established stub pattern with proper type annotations and is_type_of methods.

python/src/trezorlib/messages.py (10)

457-460: LGTM - New message types properly added.

The new message type enum values follow the sequential numbering pattern.


697-697: LGTM - AttachToPin capability added.

Enum value follows the sequential pattern correctly.


1671-1671: High field number used consistently.

Field number 8000 matches the button request type. The naming and implementation are correct.

Also applies to: 1678-1678, 1681-1681


1690-1690: Field implementation follows pattern.

The on_device_attach_pin field uses the same high field number approach consistently.

Also applies to: 1699-1699, 1704-1704


4341-4342: High field numbers used for Initialize message.

Field numbers 8000 and 8001 continue the high numbering pattern. Implementation is correct.

Also applies to: 4351-4352, 4357-4358


4455-4456: Features fields properly implemented.

The attach_to_pin_user and unlocked_attach_pin fields follow correct protobuf patterns.

Also applies to: 4545-4546, 4631-4632


5526-5543: GetPassphraseState class correctly implemented.

Message wire type matches enum value. Field definitions and constructor are proper.


5546-5563: PassphraseState class correctly implemented.

All fields have proper types and the structure follows protobuf conventions.


5566-5568: UnLockDevice class correctly implemented.

Empty message class with only wire type is appropriate for this use case.


5570-5587: UnLockDeviceResponse class correctly implemented.

Field types and constructor implementation follow established patterns.

core/src/trezor/enums/MessageType.py (2)

107-108: LGTM - Message type additions look correct.

The new message types are properly numbered and don't conflict with existing ones.


428-429: LGTM - Conditional message types properly placed.

The GetPassphraseState and PassphraseState message types are correctly placed within the conditional block.

core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py (1)

78-80: LGTM - Error handling improved.

Removing debug-dependent behavior makes error handling more consistent.

core/src/trezor/uart.py (2)

215-221: LGTM - Proper session cleanup on USB lock.

The passphrase PIN session handling is correctly integrated into the USB auto-lock flow.


372-378: LGTM - Consistent session cleanup on button press.

The same session cleanup logic is properly applied to button press locking.

core/src/trezor/lvglui/scrs/passphrase.py (3)

9-9: LGTM - Minimum length parameter added.

The min_len parameter properly extends passphrase validation capabilities.


21-21: LGTM - Parameter passed to keyboard.

The min_len parameter is correctly passed to the PassphraseKeyboard constructor.


25-26: LGTM - UI state properly updated.

The button state and count tips are correctly updated when initial result is provided.

core/src/trezor/lvglui/scrs/lockscreen.py (3)

19-27: LGTM - Debug logging added.

The debug prints are properly wrapped and provide useful diagnostic information.


77-101: LGTM - Tip level debugging added.

The debug prints help track tip message changes across different levels.


126-127: LGTM - Animation debugging added.

The debug print properly tracks when fingerprint mismatch animation is triggered.

common/protob/messages-management.proto (1)

43-43: Fix field name.

"is_contains_attach" is grammatically incorrect. Use "contains_attach" or "has_attach".

Comment thread python/src/trezorlib/device.py
Comment thread core/src/apps/common/passphrase.py
Comment thread core/src/storage/device.py
Comment thread core/src/apps/common/request_pin.py
Comment thread core/src/trezor/lvglui/scrs/pinscreen.py
Comment thread core/embed/trezorhal/se_thd89.c
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread core/src/apps/management/recovery_device/__init__.py
Comment thread core/src/apps/common/seed.py
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

♻️ Duplicate comments (5)
core/src/apps/common/request_pin.py (1)

172-172: Remove debug print statement.

core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1)

244-244: Remove debug print.

-                            print("User cancelled removal")
core/embed/trezorhal/se_thd89.c (3)

1341-1341: Fix typo.

Use PIN_MAX_LEN not PIN_MAX_LENGTH.

Also applies to: 1344-1344


1417-1417: Fix typo.

Use PIN_MAX_LEN not PIN_MAX_LENGTH.


1351-1351: Fix buffer calculation.

Use PIN_MAX_LEN consistently.

-  uint8_t buf[2 * PIN_MAX_LENGTH + PASSPHRASE_MAX_LENGTH + 3];
+  uint8_t buf[2 * PIN_MAX_LEN + PASSPHRASE_MAX_LENGTH + 3];
🧹 Nitpick comments (4)
core/src/apps/base.py (1)

710-715: Combine nested if statements.

-    if (
-        fingerprints.is_available()
-        and fingerprints.is_unlocked()
-        and not config.is_unlocked()
-    ):
-        if storage.device.is_passphrase_pin_enabled():
-            storage.device.set_passphrase_pin_enabled(False)
+    if (
+        fingerprints.is_available()
+        and fingerprints.is_unlocked()
+        and not config.is_unlocked()
+        and storage.device.is_passphrase_pin_enabled()
+    ):
+        storage.device.set_passphrase_pin_enabled(False)
core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1)

53-57: Extract PIN string conversion logic.

Repeated pattern. Create helper function.

Also applies to: 72-76, 89-93, 135-142, 176-190, 202-206, 228-232

core/src/trezor/lvglui/scrs/homescreen.py (2)

5563-5564: Combine nested if statements.

-            if target == self.attach_to_pin:
-                if target == self.attach_to_pin:
+            if target == self.attach_to_pin:

5565-5595: Complex async logic in event handler.

This nested async function with global state management adds complexity. Consider extracting to a separate method.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between e7b1487 and 6c9d362.

⛔ Files ignored due to path filters (260)
  • core/mocks/generated/trezorconfig.pyi is excluded by !**/generated/**
  • core/mocks/generated/trezorcrypto/se_thd89.pyi is excluded by !**/generated/**
  • core/src/trezor/lvglui/res/attach-to-pin-guide.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/attach_to_pin_display.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/attach_to_pin_dot_group.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/icon-attach-to-pin.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/nav-icon.png is excluded by !**/*.png
  • core/src/trezor/lvglui/res/pin_lock.png is excluded by !**/*.png
  • node_modules/.bin/pyright is excluded by !**/node_modules/**
  • node_modules/.bin/pyright-langserver is excluded by !**/node_modules/**
  • node_modules/.package-lock.json is excluded by !**/node_modules/**
  • node_modules/pyright/LICENSE.txt is excluded by !**/node_modules/**
  • node_modules/pyright/README.md is excluded by !**/node_modules/**
  • node_modules/pyright/dist/pyright-internal.js is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/pyright-internal.js.map is excluded by !**/dist/**, !**/node_modules/**, !**/*.map
  • node_modules/pyright/dist/pyright-langserver.js is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/pyright-langserver.js.map is excluded by !**/dist/**, !**/node_modules/**, !**/*.map
  • node_modules/pyright/dist/pyright.js is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/pyright.js.map is excluded by !**/dist/**, !**/node_modules/**, !**/*.map
  • node_modules/pyright/dist/typeshed-fallback/LICENSE is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/README.md is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/commit.txt is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/VERSIONS is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/__future__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/__main__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_ast.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_asyncio.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_bisect.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_blake2.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_bootlocale.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_bz2.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_codecs.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_collections_abc.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_compat_pickle.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_compression.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_contextvars.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_csv.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_ctypes.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_curses.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_curses_panel.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_dbm.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_decimal.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_frozen_importlib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_frozen_importlib_external.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_gdbm.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_hashlib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_heapq.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_imp.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_interpchannels.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_interpqueues.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_interpreters.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_io.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_json.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_locale.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_lsprof.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_lzma.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_markupbase.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_msi.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_multibytecodec.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_operator.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_osx_support.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_pickle.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_py_abc.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_pydecimal.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_queue.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_random.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_sitebuiltins.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_socket.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_sqlite3.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_ssl.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_stat.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_struct.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_thread.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_threading_local.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_tkinter.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_tracemalloc.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_typeshed/README.md is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_typeshed/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_typeshed/_type_checker_internals.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_typeshed/dbapi.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_typeshed/importlib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_typeshed/wsgi.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_typeshed/xml.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_warnings.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_weakref.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_weakrefset.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_winapi.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/_zstd.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/abc.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/aifc.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/annotationlib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/antigravity.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/argparse.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/array.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ast.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asynchat.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/base_events.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/base_futures.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/base_subprocess.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/base_tasks.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/constants.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/coroutines.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/events.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/exceptions.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/format_helpers.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/futures.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/graph.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/locks.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/log.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/mixins.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/proactor_events.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/protocols.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/queues.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/runners.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/selector_events.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/sslproto.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/staggered.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/streams.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/subprocess.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/taskgroups.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/tasks.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/threads.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/timeouts.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/tools.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/transports.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/trsock.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/unix_events.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/windows_events.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncio/windows_utils.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/asyncore.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/atexit.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/audioop.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/base64.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/bdb.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/binascii.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/binhex.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/bisect.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/builtins.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/bz2.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/cProfile.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/calendar.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/cgi.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/cgitb.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/chunk.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/cmath.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/cmd.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/code.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/codecs.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/codeop.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/collections/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/collections/abc.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/colorsys.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compileall.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/_common/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/_common/_streams.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/bz2.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/gzip.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/lzma.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/zlib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/zstd/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/compression/zstd/_zstdfile.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/concurrent/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/concurrent/futures/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/concurrent/futures/_base.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/concurrent/futures/interpreter.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/concurrent/futures/process.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/concurrent/futures/thread.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/configparser.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/contextlib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/contextvars.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/copy.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/copyreg.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/crypt.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/csv.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/_endian.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/macholib/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/macholib/dyld.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/macholib/dylib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/macholib/framework.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/util.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/ctypes/wintypes.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/curses/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/curses/ascii.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/curses/has_key.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/curses/panel.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/curses/textpad.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/dataclasses.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/datetime.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/dbm/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/dbm/dumb.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/dbm/gnu.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/dbm/ndbm.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/dbm/sqlite3.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/decimal.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/difflib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/dis.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/_msvccompiler.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/archive_util.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/bcppcompiler.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/ccompiler.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/cmd.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/bdist.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/bdist_dumb.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/bdist_msi.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/bdist_packager.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/bdist_rpm.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/bdist_wininst.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/build.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/build_clib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/build_ext.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/build_py.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/build_scripts.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/check.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/clean.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/config.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/install.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/install_data.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/install_egg_info.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/install_headers.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/install_lib.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/install_scripts.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/register.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/sdist.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/command/upload.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/config.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/core.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/cygwinccompiler.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/debug.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/dep_util.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/dir_util.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/dist.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/errors.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/extension.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/fancy_getopt.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/file_util.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/filelist.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/log.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/msvccompiler.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/spawn.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/sysconfig.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/text_file.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/unixccompiler.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/util.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/distutils/version.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/doctest.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/__init__.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/_header_value_parser.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/_policybase.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/base64mime.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/charset.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/contentmanager.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/encoders.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/errors.pyi is excluded by !**/dist/**, !**/node_modules/**
  • node_modules/pyright/dist/typeshed-fallback/stdlib/email/feedparser.pyi is excluded by !**/dist/**, !**/node_modules/**
📒 Files selected for processing (40)
  • VERSION_CHECK_IMPLEMENTATION.md (1 hunks)
  • common/protob/messages-common.proto (3 hunks)
  • common/protob/messages-management.proto (4 hunks)
  • common/protob/messages.proto (3 hunks)
  • core/embed/extmod/modtrezorconfig/modtrezorconfig.c (1 hunks)
  • core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (5 hunks)
  • core/embed/trezorhal/se_thd89.c (10 hunks)
  • core/embed/trezorhal/se_thd89.h (4 hunks)
  • core/src/all_modules.py (2 hunks)
  • core/src/apps/base.py (10 hunks)
  • core/src/apps/common/passphrase.py (4 hunks)
  • core/src/apps/common/pin_constants.py (1 hunks)
  • core/src/apps/common/request_pin.py (8 hunks)
  • core/src/apps/common/seed.py (2 hunks)
  • core/src/apps/management/change_pin.py (3 hunks)
  • core/src/apps/management/recovery_device/__init__.py (4 hunks)
  • core/src/apps/management/wipe_device.py (1 hunks)
  • core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py (1 hunks)
  • core/src/apps/ur_registry/helpers.py (1 hunks)
  • core/src/apps/workflow_handlers.py (2 hunks)
  • core/src/boot.py (1 hunks)
  • core/src/storage/cache.py (2 hunks)
  • core/src/storage/device.py (9 hunks)
  • core/src/trezor/enums/ButtonRequestType.py (1 hunks)
  • core/src/trezor/enums/Capability.py (1 hunks)
  • core/src/trezor/enums/MessageType.py (2 hunks)
  • core/src/trezor/enums/__init__.py (3 hunks)
  • core/src/trezor/lvglui/scrs/address.py (1 hunks)
  • core/src/trezor/lvglui/scrs/components/keyboard.py (5 hunks)
  • core/src/trezor/lvglui/scrs/components/listitem.py (1 hunks)
  • core/src/trezor/lvglui/scrs/homescreen.py (19 hunks)
  • core/src/trezor/lvglui/scrs/lockscreen.py (3 hunks)
  • core/src/trezor/lvglui/scrs/passphrase.py (2 hunks)
  • core/src/trezor/lvglui/scrs/pinscreen.py (5 hunks)
  • core/src/trezor/lvglui/scrs/reset_device.py (1 hunks)
  • core/src/trezor/messages.py (6 hunks)
  • core/src/trezor/uart.py (2 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (4 hunks)
  • core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1 hunks)
  • core/src/trezor/wire/errors.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (33)
  • core/src/boot.py
  • core/src/trezor/lvglui/scrs/components/listitem.py
  • core/src/trezor/enums/ButtonRequestType.py
  • core/src/all_modules.py
  • core/src/trezor/enums/Capability.py
  • core/src/apps/management/wipe_device.py
  • core/src/storage/cache.py
  • core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py
  • core/src/trezor/lvglui/scrs/address.py
  • core/src/trezor/wire/errors.py
  • common/protob/messages-common.proto
  • core/src/apps/management/change_pin.py
  • core/src/apps/management/recovery_device/init.py
  • core/src/apps/ur_registry/helpers.py
  • core/src/trezor/uart.py
  • core/src/apps/common/passphrase.py
  • core/src/trezor/enums/init.py
  • core/src/apps/common/pin_constants.py
  • core/src/trezor/lvglui/scrs/lockscreen.py
  • core/src/apps/common/seed.py
  • core/src/trezor/enums/MessageType.py
  • core/src/trezor/lvglui/scrs/passphrase.py
  • core/src/storage/device.py
  • common/protob/messages.proto
  • core/embed/extmod/modtrezorconfig/modtrezorconfig.c
  • core/src/apps/workflow_handlers.py
  • core/src/trezor/lvglui/scrs/pinscreen.py
  • core/src/trezor/lvglui/scrs/components/keyboard.py
  • common/protob/messages-management.proto
  • core/src/trezor/messages.py
  • core/src/trezor/ui/layouts/lvgl/init.py
  • core/src/trezor/lvglui/scrs/reset_device.py
  • core/embed/trezorhal/se_thd89.h
🧰 Additional context used
🧬 Code Graph Analysis (3)
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (2)
core/embed/trezorhal/se_thd89.h (6)
  • se_session_get_type (139-139)
  • se_get_pin_passphrase_space (121-121)
  • se_set_pin_passphrase (117-118)
  • se_get_pin_passphrase_ret (120-120)
  • se_delete_pin_passphrase (119-119)
  • se_check_passphrase_btc_test_address (122-122)
core/embed/trezorhal/se_thd89.c (6)
  • se_session_get_type (1954-1960)
  • se_get_pin_passphrase_space (1473-1479)
  • se_set_pin_passphrase (1397-1412)
  • se_get_pin_passphrase_ret (1482-1482)
  • se_delete_pin_passphrase (1438-1450)
  • se_check_passphrase_btc_test_address (1452-1471)
core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (9)
core/src/trezor/lvglui/i18n/__init__.py (1)
  • gettext (31-32)
core/src/trezor/lvglui/lv_colors.py (1)
  • lv_colors (9-69)
core/src/trezor/lvglui/scrs/common.py (1)
  • FullSizeWindow (362-705)
core/src/trezor/lvglui/scrs/components/listitem.py (1)
  • ListItemWithLeadingCheckbox (15-108)
core/src/apps/base.py (1)
  • lock_device_if_unlocked (566-570)
core/src/apps/common/pin_constants.py (3)
  • AttachCommon (26-27)
  • PinResult (1-14)
  • PinType (17-23)
core/src/trezor/lvglui/scrs/pinscreen.py (2)
  • request_passphrase_pin_confirm (519-532)
  • request_passphrase_pin (513-516)
core/src/apps/common/request_pin.py (4)
  • request_pin (21-39)
  • error_pin_invalid (280-291)
  • request_pin_and_sd_salt (72-94)
  • error_pin_used (294-305)
core/src/trezor/wire/__init__.py (1)
  • Context (236-392)
core/embed/trezorhal/se_thd89.c (5)
core/embed/trezorhal/se_thd89.h (8)
  • se_verifyPin (112-112)
  • se_transmit_mac (64-65)
  • se_set_pin_passphrase (117-118)
  • se_delete_pin_passphrase (119-119)
  • se_get_pin_passphrase_space (121-121)
  • se_get_pin_result_type (116-116)
  • se_get_pin_passphrase_ret (120-120)
  • se_session_get_type (139-139)
core/embed/trezorhal/thd89.c (1)
  • thd89_last_error (590-590)
core/embed/trezorhal/thd89.h (1)
  • thd89_last_error (24-24)
core/embed/trezorhal/common.h (1)
  • hal_delay (107-107)
core/embed/trezorhal/common.c (1)
  • hal_delay (294-294)
🪛 Ruff (0.12.2)
core/src/apps/common/request_pin.py

154-154: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


160-160: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


162-162: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


181-181: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


196-196: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


223-223: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


241-241: Within an except clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling

(B904)


305-305: Do not assert False (python -O removes these calls), raise AssertionError()

Replace assert False

(B011)

core/src/apps/base.py

710-715: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

core/src/trezor/lvglui/scrs/homescreen.py

5563-5564: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Style check
  • GitHub Check: Defs check
🔇 Additional comments (7)
core/embed/extmod/modtrezorcrypto/modtrezorcrypto-se-thd89.h (3)

27-28: LGTM - Constants properly defined.


166-178: LGTM - Session type function correctly implemented.


964-1085: LGTM - PIN-passphrase management functions properly implemented.

Good input validation and error handling throughout.

VERSION_CHECK_IMPLEMENTATION.md (1)

1-97: LGTM - Comprehensive implementation documentation.

Well-structured documentation covering the version compatibility implementation approach.

core/src/apps/base.py (3)

15-37: LGTM - Version compatibility functions well implemented.

Good separation of concerns and clear error handling.


161-165: LGTM - AttachToPin capability properly added.


692-778: LGTM - New message handlers properly implemented.

Good error handling and proper integration with existing systems.

Comment thread core/src/apps/common/request_pin.py
Comment thread core/src/apps/common/request_pin.py
Comment thread core/src/apps/common/request_pin.py
Comment thread core/src/trezor/ui/layouts/lvgl/attach_to_pin.py
Comment thread core/embed/trezorhal/se_thd89.c
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
core/src/trezor/lvglui/scrs/homescreen.py (2)

5563-5564: Combine nested if statements.

Replace nested ifs with single condition using and.

-        if code == lv.EVENT.CLICKED:
-            if target == self.attach_to_pin:
+        if code == lv.EVENT.CLICKED and target == self.attach_to_pin:

5569-5595: Simplify attach-to-pin handler.

The try/except/finally structure is overly complex. The same screen loading logic is repeated in multiple places.

                 async def handle_attach_to_pin():
+                    def reload_screen():
+                        if hasattr(self, "prev_scr") and self.prev_scr:
+                            self.load_screen(self)
+                        else:
+                            self.load_screen(self)
+                    
                     try:
                         from trezor.ui.layouts.lvgl.attach_to_pin import (
                             show_attach_to_pin_window,
                         )
 
                         ctx = wire.DUMMY_CONTEXT
                         result = await show_attach_to_pin_window(ctx)
 
                         if result:
-                            if hasattr(self, "prev_scr") and self.prev_scr:
-                                self.load_screen(self)
-                            else:
-                                self.load_screen(self)
+                            reload_screen()
 
                         return result
                     except Exception:
-                        if hasattr(self, "prev_scr") and self.prev_scr:
-                            self.load_screen(self)
-                        else:
-                            self.load_screen(self)
+                        reload_screen()
                         return False
                     finally:
                         global _attach_to_pin_task_running
                         _attach_to_pin_task_running = False
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6c9d362 and db0878b.

📒 Files selected for processing (1)
  • core/src/trezor/lvglui/scrs/homescreen.py (88 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5563-5564: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)

998-998: Remove debug print.

Debug statements don't belong in production.

-                    print(f"prev_session_id: {self.prev_session_id}")
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between db0878b and 76a0668.

📒 Files selected for processing (2)
  • core/src/trezor/lvglui/scrs/homescreen.py (21 hunks)
  • core/src/trezor/uart.py (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/trezor/uart.py
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

4936-4937: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Socket Security: Pull Request Alerts

Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 11

♻️ Duplicate comments (2)
core/src/trezor/ui/layouts/lvgl/__init__.py (1)

1240-1240: Fix typo in parameter name.

standy_wall_only should be standby_wall_only.

Also applies to: 1261-1261

core/src/trezor/lvglui/scrs/homescreen.py (1)

1017-1017: Left-over debug print.
Delete print(f"prev_session_id: ...").

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 76a0668 and 3a3fed1.

📒 Files selected for processing (5)
  • core/src/apps/base.py (10 hunks)
  • core/src/apps/common/seed.py (2 hunks)
  • core/src/trezor/lvglui/scrs/homescreen.py (87 hunks)
  • core/src/trezor/lvglui/scrs/lockscreen.py (3 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (9 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • core/src/trezor/lvglui/scrs/lockscreen.py
  • core/src/apps/common/seed.py
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/apps/base.py

710-715: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

core/src/trezor/ui/layouts/lvgl/__init__.py

1277-1280: Use ternary operator min_len = 6 if attach_wall_only else 4 instead of if-else-block

Replace if-else-block with min_len = 6 if attach_wall_only else 4

(SIM108)


2614-2614: SyntaxError: Duplicate parameter "domain_hash"


2615-2615: SyntaxError: Duplicate parameter "message_hash"


2616-2616: SyntaxError: Duplicate parameter "safe_tx_hash"

core/src/trezor/lvglui/scrs/homescreen.py

935-935: SyntaxError: Expected an indented block after if statement


1024-1024: SyntaxError: Expected an indented block after elif clause


3062-3062: SyntaxError: Expected ',', found name


3221-3221: SyntaxError: Expected ')', found name


3584-3584: SyntaxError: Expected ',', found name


3584-3584: SyntaxError: Positional argument cannot follow keyword argument


3584-3584: SyntaxError: Duplicate keyword argument "is_haptic_feedback"


3981-3981: SyntaxError: Expected ',', found name


5327-5327: SyntaxError: Expected a statement


5327-5328: SyntaxError: Expected a statement


5839-5839: SyntaxError: Expected an indented block after if statement

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Style check
  • GitHub Check: Defs check
  • GitHub Check: Gen check

Comment thread core/src/apps/base.py
Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py Outdated
Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py Outdated
Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py Outdated
Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🔭 Outside diff range comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)

940-945: Invalid event callback signature

♻️ Duplicate comments (14)
core/src/trezor/ui/layouts/lvgl/__init__.py (6)

93-94: Remove duplicate exports.


1240-1240: Fix typo in parameter name.


1261-1266: Fix typo in parameter name.


2635-2637: Remove duplicate arguments.


2688-2688: Fix typo in parameter name.


2712-2712: Fix typo in parameter name.

core/src/trezor/lvglui/scrs/homescreen.py (8)

43-44: Global mutable state


77-79: Duplicate assignment


156-159: Duplicate assignment


556-558: Redundant list creation


615-617: Duplicate call


710-715: Redundant session logic


861-864: Duplicate assignment


1029-1030: Leftover debug print

🧹 Nitpick comments (1)
core/src/trezor/ui/layouts/lvgl/__init__.py (1)

1276-1280: Use ternary operator.

-    min_len = 4
-    if attach_wall_only:
-        min_len = 6
-    else:
-        min_len = 4
+    min_len = 6 if attach_wall_only else 4
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 3a3fed1 and e1f6cfd.

📒 Files selected for processing (2)
  • core/src/trezor/lvglui/scrs/homescreen.py (46 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (8 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5631-5632: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

core/src/trezor/ui/layouts/lvgl/__init__.py

1277-1280: Use ternary operator min_len = 6 if attach_wall_only else 4 instead of if-else-block

Replace if-else-block with min_len = 6 if attach_wall_only else 4

(SIM108)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Style check
  • GitHub Check: Gen check
  • GitHub Check: Defs check
🔇 Additional comments (5)
core/src/trezor/ui/layouts/lvgl/__init__.py (5)

1202-1202: Good addition of min_len parameter.


1210-1210: Parameter correctly passed to PassphraseRequest.


1244-1257: Good conditional button request handling.


1282-1286: Parameters correctly passed to InputPin.


1604-1604: String key updated correctly.

Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🔭 Outside diff range comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)

1968-1977: Duplicate qr_data assignment

♻️ Duplicate comments (5)
core/src/trezor/lvglui/scrs/homescreen.py (5)

43-44: Global mutable state


554-556: Redundant assignment


691-696: Repeated session logic


806-820: Duplicated initialization


1005-1005: Left-over debug print

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between e1f6cfd and 615cfa8.

📒 Files selected for processing (1)
  • core/src/trezor/lvglui/scrs/homescreen.py (26 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5584-5585: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Defs check
  • GitHub Check: Style check

Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🔭 Outside diff range comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)

808-819: Duplicate Navigation creation

🧹 Nitpick comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)

1908-1911: Unneeded conditional block

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 615cfa8 and 6a9bc0f.

📒 Files selected for processing (1)
  • core/src/trezor/lvglui/scrs/homescreen.py (21 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5572-5573: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Style check
  • GitHub Check: Gen check
  • GitHub Check: Defs check

Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (4)
core/src/trezor/ui/layouts/lvgl/__init__.py (4)

93-94: Remove duplicate exports.


1212-1213: Return empty string, not None.


1240-1240: Fix typo: standy_wall_only should be standby_wall_only.


2635-2637: Remove duplicate arguments.

🧹 Nitpick comments (1)
core/src/trezor/ui/layouts/lvgl/__init__.py (1)

1276-1280: Use ternary operator.

-    min_len = 4
-    if attach_wall_only:
-        min_len = 6
-    else:
-        min_len = 4
+    min_len = 6 if attach_wall_only else 4
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 239b455 and c88abd6.

📒 Files selected for processing (1)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (6 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/ui/layouts/lvgl/__init__.py

1277-1280: Use ternary operator min_len = 6 if attach_wall_only else 4 instead of if-else-block

Replace if-else-block with min_len = 6 if attach_wall_only else 4

(SIM108)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Style check
  • GitHub Check: Defs check
  • GitHub Check: Gen check

Comment thread core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py Outdated
Comment thread core/src/apps/workflow_handlers.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py Outdated
Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py Outdated
Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between c88abd6 and 666edf3.

📒 Files selected for processing (2)
  • core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py (1 hunks)
  • core/src/trezor/lvglui/scrs/homescreen.py (17 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5554-5555: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Defs check
  • GitHub Check: Gen check
  • GitHub Check: Style check

Comment thread core/src/trezor/lvglui/scrs/homescreen.py
@guowei0105 guowei0105 requested a review from Lu1zz July 17, 2025 01:57
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (1)
core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1)

18-249: Break down this massive function.

🧹 Nitpick comments (2)
core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (2)

247-247: Remove unused variable.

-    except Exception as e:
+    except Exception:

428-428: Fix function name typo.

-async def showr_remove_pin_success_window(ctx: wire.Context):
+async def show_remove_pin_success_window(ctx: wire.Context):
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 59823dd and 5184c1b.

📒 Files selected for processing (1)
  • core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/ui/layouts/lvgl/attach_to_pin.py

247-247: Local variable e is assigned to but never used

Remove assignment to unused variable e

(F841)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Defs check
  • GitHub Check: Style check

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (1)
core/src/trezor/lvglui/scrs/homescreen.py (1)

43-44: Still global mutable flag

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 5184c1b and 6464600.

📒 Files selected for processing (2)
  • core/src/trezor/lvglui/scrs/homescreen.py (17 hunks)
  • core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/trezor/ui/layouts/lvgl/attach_to_pin.py
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5554-5555: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Style check
  • GitHub Check: Defs check
  • GitHub Check: Gen check

Comment thread core/src/trezor/lvglui/scrs/homescreen.py
lihuanhuan
lihuanhuan previously approved these changes Jul 17, 2025
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

♻️ Duplicate comments (5)
core/src/trezor/ui/layouts/lvgl/__init__.py (3)

93-94: Remove duplicate exports.

These are already listed above.


1212-1213: Return empty string, not None.

For empty passphrase case.


1240-1240: Fix typo.

standy_wall_only should be standby_wall_only.

core/src/trezor/lvglui/scrs/homescreen.py (2)

43-44: Still using global mutable flag

Duplicate of previous review.


5557-5580: No guard against concurrent task

Flag is set but never checked before starting new task. Duplicate of earlier note.

🧹 Nitpick comments (1)
core/src/trezor/ui/layouts/lvgl/__init__.py (1)

1276-1280: Simplify with ternary operator.

-    min_len = 4
-    if attach_wall_only:
-        min_len = 6
-    else:
-        min_len = 4
+    min_len = 6 if attach_wall_only else 4
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 6464600 and a5e7af7.

📒 Files selected for processing (2)
  • core/src/trezor/lvglui/scrs/homescreen.py (17 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (5 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
core/src/trezor/lvglui/scrs/homescreen.py (8)
core/src/storage/cache.py (2)
  • start_session (178-221)
  • end_current_session (224-235)
core/src/trezor/lvglui/scrs/address.py (2)
  • AddressManager (13-408)
  • STATE (16-22)
core/src/storage/device.py (5)
  • is_passphrase_pin_enabled (1424-1432)
  • is_passphrase_enabled (909-913)
  • set_passphrase_always_on_device (1034-1037)
  • set_passphrase_enabled (916-923)
  • set_passphrase_pin_enabled (1435-1450)
core/src/trezor/lvglui/scrs/common.py (3)
  • _load_scr (162-177)
  • _load_scr (318-321)
  • Screen (207-352)
core/src/trezor/lvglui/scrs/components/button.py (4)
  • ListItemBtnWithSwitch (209-281)
  • ListItemBtn (88-206)
  • add_state (280-281)
  • clear_state (277-278)
core/src/trezor/ui/layouts/lvgl/attach_to_pin.py (1)
  • show_attach_to_pin_window (18-248)
core/src/apps/base.py (1)
  • lock_device_if_unlocked (566-570)
core/src/trezor/lvglui/scrs/components/listitem.py (1)
  • DisplayItemWithFont_30 (170-194)
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5555-5556: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

core/src/trezor/ui/layouts/lvgl/__init__.py

1277-1280: Use ternary operator min_len = 6 if attach_wall_only else 4 instead of if-else-block

Replace if-else-block with min_len = 6 if attach_wall_only else 4

(SIM108)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Style check
  • GitHub Check: Defs check

Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread common/protob/messages.proto Outdated
Comment thread core/src/apps/base.py
Comment thread core/src/apps/base.py Outdated
Comment thread core/src/apps/management/recovery_device/__init__.py
Comment thread core/src/apps/ur_registry/chains/hardware_requests/hardware_call.py Outdated
Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread core/src/trezor/lvglui/scrs/pinscreen.py Outdated
Comment thread core/src/trezor/ui/layouts/lvgl/__init__.py Outdated
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between a5e7af7 and af75ef7.

📒 Files selected for processing (1)
  • core/src/trezor/lvglui/scrs/homescreen.py (18 hunks)
🧰 Additional context used
🪛 Ruff (0.12.2)
core/src/trezor/lvglui/scrs/homescreen.py

5561-5562: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Style check
  • GitHub Check: Defs check

Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Comment thread core/src/trezor/lvglui/scrs/homescreen.py
Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (11)
core/src/trezor/lvglui/scrs/pinscreen.py (6)

189-189: Fix typo in parameter name

standy_wall_only should be standby_wall_only.


219-223: Remove duplicate subtitle text setting

Line 223 duplicates line 219.


237-238: Move import to module level

Import passphrase at the top of the file.


318-320: Fix typo in variable name and move import

standy_wall_only should be standby_wall_only. Also move import to module level.


486-486: Fix inconsistent minimum length validation

Keyboard accepts 4+ chars but validation requires 6+.

Also applies to: 561-561


573-573: Fix minimum length validation in InputMainPin

Keyboard min_len is 4 but validation requires 6. Should be consistent.

-        self.keyboard = NumberKeyboard(self, max_len=50, min_len=4)
+        self.keyboard = NumberKeyboard(self, max_len=50, min_len=6)
core/src/trezor/ui/layouts/lvgl/__init__.py (4)

1210-1211: Fix empty passphrase handling.

Should return empty string, not None.

-        if result is None and min_len == 1:
-            return None
+        if result is None and min_len == 1:
+            return ""

1238-1238: Fix typo in parameter name.

standy_wall_only should be standby_wall_only.

-    standy_wall_only: bool = False,
+    standby_wall_only: bool = False,

1261-1261: Fix typo in parameter name.

standy_wall_only should be standby_wall_only.

-        if standy_wall_only and passphrase.is_passphrase_pin_enabled():
+        if standby_wall_only and passphrase.is_passphrase_pin_enabled():

1283-1283: Fix typo in parameter name.

standy_wall_only should be standby_wall_only.

-        standy_wall_only=standy_wall_only,
+        standby_wall_only=standby_wall_only,
core/src/apps/base.py (1)

694-698: Fix orphaned comment logic.

The comment doesn't match the code below it.

🧹 Nitpick comments (3)
core/src/trezor/ui/layouts/lvgl/__init__.py (1)

1274-1278: Simplify with ternary operator.

-    min_len = 4
-    if attach_wall_only:
-        min_len = 6
-    else:
-        min_len = 4
+    min_len = 6 if attach_wall_only else 4
core/src/apps/base.py (2)

705-710: Simplify nested if statements.

Combine the nested conditions using and.

-    if (
-        fingerprints.is_available()
-        and fingerprints.is_unlocked()
-        and not config.is_unlocked()
-    ):
-        if storage.device.is_passphrase_pin_enabled():
-            storage.device.set_passphrase_pin_enabled(False)
+    if (
+        fingerprints.is_available()
+        and fingerprints.is_unlocked()
+        and not config.is_unlocked()
+        and storage.device.is_passphrase_pin_enabled()
+    ):
+        storage.device.set_passphrase_pin_enabled(False)

720-721: Remove unnecessary sleep.

The 500ms sleep seems arbitrary and could slow down the flow.

-        utime.sleep_ms(500)
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between af75ef7 and 4b5743a.

📒 Files selected for processing (4)
  • common/protob/messages.proto (3 hunks)
  • core/src/apps/base.py (10 hunks)
  • core/src/trezor/lvglui/scrs/pinscreen.py (5 hunks)
  • core/src/trezor/ui/layouts/lvgl/__init__.py (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • common/protob/messages.proto
🧰 Additional context used
🧬 Code Graph Analysis (1)
core/src/trezor/ui/layouts/lvgl/__init__.py (7)
core/src/trezor/wire/__init__.py (5)
  • GenericContext (71-87)
  • wait (86-87)
  • wait (136-137)
  • wait (213-219)
  • wait (380-386)
core/src/trezor/ui/layouts/lvgl/common.py (1)
  • button_request (19-29)
core/src/trezor/enums/__init__.py (1)
  • ButtonRequestType (470-491)
core/src/trezor/lvglui/scrs/passphrase.py (1)
  • PassphraseRequest (8-49)
core/src/apps/common/passphrase.py (1)
  • is_passphrase_pin_enabled (15-16)
core/src/storage/device.py (1)
  • is_passphrase_pin_enabled (1424-1432)
core/src/trezor/lvglui/scrs/pinscreen.py (1)
  • InputPin (167-335)
🪛 Ruff (0.12.2)
core/src/apps/base.py

705-710: Use a single if statement instead of nested if statements

Combine if statements using and

(SIM102)

core/src/trezor/ui/layouts/lvgl/__init__.py

1275-1278: Use ternary operator min_len = 6 if attach_wall_only else 4 instead of if-else-block

Replace if-else-block with min_len = 6 if attach_wall_only else 4

(SIM108)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Gen check
  • GitHub Check: Defs check
  • GitHub Check: Style check
🔇 Additional comments (14)
core/src/trezor/ui/layouts/lvgl/__init__.py (3)

1200-1200: Function signature looks good.

New min_len parameter properly added with default value.


1208-1208: Parameter correctly passed.

min_len properly passed to PassphraseRequest constructor.


1602-1602: Localized string change looks good.

Updated string key is appropriate for the context.

core/src/apps/base.py (11)

6-10: LGTM! Clean imports for new functionality.

The imports properly support the attach-to-pin feature additions.


15-16: LGTM! Simple capability check function.

Clean implementation that checks cache for attach-to-pin support.


19-27: LGTM! Good version compatibility enforcement.

Properly raises an error when client lacks attach-to-pin support but passphrase PIN is enabled.


30-36: LGTM! Clean decorator implementation.

The wrapper correctly applies version check after function execution.


164-168: LGTM! Clear PIN space logic.

The attach_to_pin_user flag logic based on PIN passphrase space is correct.


186-188: LGTM! Proper unlocked state reporting.

Correctly reports passphrase PIN state when device is unlocked.


250-275: LGTM! Robust session management logic.

The Initialize handler properly manages attach-to-pin capability caching and conditional session creation.


542-545: LGTM! Proper session cleanup on lock.

Correctly ends session when passphrase PIN is enabled during device lock.


600-641: LGTM! Enhanced unlock function.

The new parameters for PIN type and attach wall only are properly handled.


752-772: LGTM! Clean unlock device handler.

Proper unlock flow with appropriate state reporting.


789-792: LGTM! Message handler registration.

Properly registers the new message handlers in boot sequence.

Comment thread core/src/apps/base.py
@guowei0105 guowei0105 merged commit 3657f6e into OneKeyHQ:main Jul 17, 2025
9 checks passed
guowei0105 added a commit to guowei0105/firmware-pro-public that referenced this pull request Jul 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants