You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trezor-firmware/core/src/apps/management/wipe_device.py

30 lines
827 B

import storage
from trezor import ui
from trezor.messages import ButtonRequestType
from trezor.messages.Success import Success
from trezor.ui.button import ButtonCancel
from trezor.ui.loader import LoaderDanger
from trezor.ui.text import Text
from apps.common.confirm import require_hold_to_confirm
from .apply_settings import reload_settings_from_storage
async def wipe_device(ctx, msg):
text = Text("Wipe device", ui.ICON_WIPE, ui.RED)
text.normal("Do you really want to", "wipe the device?", "")
text.bold("All data will be lost.")
await require_hold_to_confirm(
ctx,
text,
ButtonRequestType.WipeDevice,
confirm_style=ButtonCancel,
loader_style=LoaderDanger,
)
storage.wipe()
reload_settings_from_storage()
return Success(message="Device wiped")