2018-07-03 12:28:17 +00:00
|
|
|
# isort:skip_file
|
|
|
|
|
2018-04-16 15:17:45 +00:00
|
|
|
# unlock the device
|
2018-02-27 02:05:15 +00:00
|
|
|
import boot # noqa: F401
|
2017-10-24 11:59:09 +00:00
|
|
|
|
2018-04-16 15:17:45 +00:00
|
|
|
# prepare the USB interfaces, but do not connect to the host yet
|
|
|
|
import usb
|
2017-08-16 13:02:03 +00:00
|
|
|
|
2019-11-07 11:51:02 +00:00
|
|
|
from trezor import loop, utils, wire, workflow
|
2017-08-15 13:09:09 +00:00
|
|
|
|
2019-07-24 12:39:14 +00:00
|
|
|
# start the USB
|
2018-04-16 15:17:45 +00:00
|
|
|
usb.bus.open()
|
2016-09-21 12:21:18 +00:00
|
|
|
|
2018-07-03 14:20:58 +00:00
|
|
|
|
2019-10-31 09:27:59 +00:00
|
|
|
def _boot_apps() -> None:
|
2019-07-11 14:52:25 +00:00
|
|
|
# load applications
|
2020-04-14 10:21:07 +00:00
|
|
|
import apps.base
|
2019-07-11 14:52:25 +00:00
|
|
|
import apps.management
|
2020-05-15 18:35:09 +00:00
|
|
|
import apps.bitcoin
|
|
|
|
import apps.misc
|
2019-08-22 18:15:16 +00:00
|
|
|
|
|
|
|
if not utils.BITCOIN_ONLY:
|
|
|
|
import apps.ethereum
|
|
|
|
import apps.lisk
|
|
|
|
import apps.monero
|
|
|
|
import apps.nem
|
|
|
|
import apps.stellar
|
|
|
|
import apps.ripple
|
|
|
|
import apps.cardano
|
|
|
|
import apps.tezos
|
|
|
|
import apps.eos
|
|
|
|
import apps.binance
|
2019-10-30 14:03:53 +00:00
|
|
|
import apps.webauthn
|
2019-07-11 14:52:25 +00:00
|
|
|
|
|
|
|
if __debug__:
|
|
|
|
import apps.debug
|
|
|
|
|
|
|
|
# boot applications
|
2020-04-14 10:21:07 +00:00
|
|
|
apps.base.boot()
|
2019-07-11 14:52:25 +00:00
|
|
|
apps.management.boot()
|
2020-05-15 18:35:09 +00:00
|
|
|
apps.bitcoin.boot()
|
|
|
|
apps.misc.boot()
|
2019-08-22 18:15:16 +00:00
|
|
|
if not utils.BITCOIN_ONLY:
|
|
|
|
apps.ethereum.boot()
|
|
|
|
apps.lisk.boot()
|
|
|
|
apps.monero.boot()
|
|
|
|
apps.nem.boot()
|
|
|
|
apps.stellar.boot()
|
|
|
|
apps.ripple.boot()
|
|
|
|
apps.cardano.boot()
|
|
|
|
apps.tezos.boot()
|
|
|
|
apps.eos.boot()
|
|
|
|
apps.binance.boot()
|
2019-10-30 14:03:53 +00:00
|
|
|
apps.webauthn.boot()
|
2019-07-11 14:52:25 +00:00
|
|
|
if __debug__:
|
|
|
|
apps.debug.boot()
|
|
|
|
|
|
|
|
# run main event loop and specify which screen is the default
|
2020-04-22 08:58:24 +00:00
|
|
|
apps.base.set_homescreen()
|
|
|
|
workflow.start_default()
|
2019-07-11 14:52:25 +00:00
|
|
|
|
|
|
|
|
2020-05-27 13:19:44 +00:00
|
|
|
_boot_apps()
|
|
|
|
|
2019-11-06 15:36:44 +00:00
|
|
|
# initialize the wire codec
|
|
|
|
wire.setup(usb.iface_wire)
|
|
|
|
if __debug__:
|
2020-05-25 13:21:45 +00:00
|
|
|
wire.setup(usb.iface_debug, use_workflow=False)
|
2019-07-24 12:39:14 +00:00
|
|
|
|
2019-11-06 15:36:44 +00:00
|
|
|
loop.run()
|
2019-07-24 12:39:14 +00:00
|
|
|
|
2019-11-06 15:36:44 +00:00
|
|
|
# loop is empty. That should not happen
|
|
|
|
utils.halt("All tasks have died.")
|