Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions core/src/apps/management/wipe_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from trezor import wire
from trezor.messages import Success

from ..common.request_pin import verify_user_pin
from .apply_settings import reload_settings_from_storage

if TYPE_CHECKING:
Expand All @@ -19,15 +18,6 @@ async def wipe_device(ctx: wire.GenericContext, msg: WipeDevice) -> Success:
)

await confirm_wipe_device(ctx)

from apps.common.pin_constants import PinType

await verify_user_pin(
ctx,
allow_fingerprint=False,
pin_use_type=PinType.USER_CHECK,
standy_wall_only=True,
)
# show tips
await confirm_wipe_device_tips(ctx)
storage.wipe()
Expand Down
21 changes: 16 additions & 5 deletions core/src/trezor/lvglui/scrs/pinscreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ def __init__(self, **kwargs):
)
self.subtitle.set_text(subtitle)
title_height = self.title.get_height()
subtitle_y = (16 if is_standard_wallet else 24) if title_height > 60 else 70
if is_standard_wallet:
subtitle_y = 16 if title_height <= 60 else 8
else:
subtitle_y = 24 if title_height > 60 else 70
self.subtitle.align_to(self.title, lv.ALIGN.OUT_BOTTOM_MID, 0, subtitle_y)
self.subtitle.set_text(subtitle)
self._show_fingerprint_prompt_if_necessary()
Expand All @@ -242,18 +245,26 @@ def change_subtitle(self, subtitle: str):
and passphrase.is_passphrase_pin_enabled()
):
self.subtitle.set_style_bg_color(lv_colors.BLACK, 0)
self.subtitle.align_to(self.title, lv.ALIGN.OUT_BOTTOM_MID, 0, 16)
title_height = self.title.get_height()
offset_y = 16 if title_height <= 60 else 8
self.subtitle.align_to(self.title, lv.ALIGN.OUT_BOTTOM_MID, 0, offset_y)
else:
self.subtitle.set_style_bg_color(
lv_colors.ONEKEY_RED_2 if subtitle else lv_colors.BLACK, 0
)
self.subtitle.align_to(self.title, lv.ALIGN.OUT_BOTTOM_MID, 0, 24)

self.subtitle.set_text(subtitle)

keyboard_text = self.keyboard.ta.get_text()
if keyboard_text:
if subtitle:
self.keyboard.ta.align_to(self.subtitle, lv.ALIGN.OUT_BOTTOM_MID, 0, 10)
if subtitle == _(i18n_keys.CONTENT__PIN_FOR_STANDARD_WALLET):
self.keyboard.ta.align(lv.ALIGN.TOP_MID, 0, 210)
else:
self.keyboard.ta.align_to(
self.subtitle, lv.ALIGN.OUT_BOTTOM_MID, 0, 10
)
else:
self.keyboard.ta.align(lv.ALIGN.TOP_MID, 0, 188)

Expand Down Expand Up @@ -314,11 +325,11 @@ def on_event(self, event_obj):
code = event_obj.code
if code == lv.EVENT.VALUE_CHANGED:
utils.lcd_resume()
if self.keyboard.ta.get_text() != "":
current_input = self.keyboard.ta.get_text()
if current_input != "":
from apps.common import passphrase

if self.standy_wall_only and passphrase.is_passphrase_pin_enabled():

self.change_subtitle(_(i18n_keys.CONTENT__PIN_FOR_STANDARD_WALLET))
else:
self.change_subtitle("")
Expand Down
Loading