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
|
|
|
|
2018-04-16 15:17:45 +00:00
|
|
|
from trezor import loop, wire, workflow, utils
|
2016-10-11 10:33:02 +00:00
|
|
|
|
2017-08-15 13:09:09 +00:00
|
|
|
# load applications
|
2018-04-16 15:17:45 +00:00
|
|
|
import apps.homescreen
|
|
|
|
import apps.management
|
|
|
|
import apps.wallet
|
|
|
|
import apps.ethereum
|
2018-04-16 20:03:04 +00:00
|
|
|
import apps.lisk
|
2018-03-09 10:37:06 +00:00
|
|
|
import apps.nem
|
2018-05-11 13:31:53 +00:00
|
|
|
import apps.stellar
|
2018-06-26 12:45:43 +00:00
|
|
|
import apps.ripple
|
2018-06-14 14:28:50 +00:00
|
|
|
import apps.cardano
|
2018-07-27 12:05:00 +00:00
|
|
|
import apps.tezos
|
2018-06-14 14:28:50 +00:00
|
|
|
|
2018-02-09 15:45:36 +00:00
|
|
|
if __debug__:
|
2018-04-16 15:17:45 +00:00
|
|
|
import apps.debug
|
2018-02-09 15:45:36 +00:00
|
|
|
else:
|
2018-04-16 15:17:45 +00:00
|
|
|
import apps.fido_u2f
|
2017-08-15 13:09:09 +00:00
|
|
|
|
|
|
|
# boot applications
|
2018-04-16 15:17:45 +00:00
|
|
|
apps.homescreen.boot()
|
|
|
|
apps.management.boot()
|
|
|
|
apps.wallet.boot()
|
|
|
|
apps.ethereum.boot()
|
2018-04-16 20:03:04 +00:00
|
|
|
apps.lisk.boot()
|
2018-03-09 10:37:06 +00:00
|
|
|
apps.nem.boot()
|
2018-05-11 13:31:53 +00:00
|
|
|
apps.stellar.boot()
|
2018-06-26 12:45:43 +00:00
|
|
|
apps.ripple.boot()
|
2018-06-14 14:28:50 +00:00
|
|
|
apps.cardano.boot()
|
2018-07-27 12:05:00 +00:00
|
|
|
apps.tezos.boot()
|
2018-02-09 15:45:36 +00:00
|
|
|
if __debug__:
|
2018-04-16 15:17:45 +00:00
|
|
|
apps.debug.boot()
|
2018-02-09 15:45:36 +00:00
|
|
|
else:
|
2018-04-16 15:17:45 +00:00
|
|
|
apps.fido_u2f.boot(usb.iface_u2f)
|
2017-08-15 13:09:09 +00:00
|
|
|
|
2017-08-21 11:22:44 +00:00
|
|
|
# initialize the wire codec and start the USB
|
2018-04-16 15:17:45 +00:00
|
|
|
wire.setup(usb.iface_wire)
|
2017-10-30 16:34:21 +00:00
|
|
|
if __debug__:
|
2018-04-16 15:17:45 +00:00
|
|
|
wire.setup(usb.iface_debug)
|
|
|
|
usb.bus.open()
|
2016-09-21 12:21:18 +00:00
|
|
|
|
2018-04-16 15:17:45 +00:00
|
|
|
# switch into unprivileged mode, as we don't need the extra permissions anymore
|
2018-02-23 19:35:05 +00:00
|
|
|
utils.set_mode_unprivileged()
|
2018-02-23 18:08:34 +00:00
|
|
|
|
2018-04-16 15:17:45 +00:00
|
|
|
# run main event loop and specify which screen is the default
|
2018-02-27 15:35:21 +00:00
|
|
|
from apps.homescreen.homescreen import homescreen
|
2018-07-03 14:20:58 +00:00
|
|
|
|
2018-02-27 15:35:21 +00:00
|
|
|
workflow.startdefault(homescreen)
|
2017-08-21 11:22:44 +00:00
|
|
|
loop.run()
|