|
|
|
@ -417,7 +417,7 @@ def wipe_device(connect, bootloader):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command(help="Load custom configuration to the device.")
|
|
|
|
|
@click.option("-m", "--mnemonic")
|
|
|
|
|
@click.option("-m", "--mnemonic", multiple=True)
|
|
|
|
|
@click.option("-e", "--expand", is_flag=True)
|
|
|
|
|
@click.option("-x", "--xprv")
|
|
|
|
|
@click.option("-p", "--pin", default="")
|
|
|
|
@ -437,31 +437,31 @@ def load_device(
|
|
|
|
|
ignore_checksum,
|
|
|
|
|
slip0014,
|
|
|
|
|
):
|
|
|
|
|
if not mnemonic and not xprv and not slip0014:
|
|
|
|
|
raise tools.CallException(
|
|
|
|
|
proto.FailureType.DataError, "Please provide mnemonic or xprv"
|
|
|
|
|
)
|
|
|
|
|
n_args = sum(bool(a) for a in (mnemonic, xprv, slip0014))
|
|
|
|
|
if n_args == 0:
|
|
|
|
|
raise click.ClickException("Please provide a mnemonic or xprv")
|
|
|
|
|
if n_args > 1:
|
|
|
|
|
raise click.ClickException("Cannot use mnemonic and xprv together")
|
|
|
|
|
|
|
|
|
|
client = connect()
|
|
|
|
|
if mnemonic:
|
|
|
|
|
return debuglink.load_device_by_mnemonic(
|
|
|
|
|
client,
|
|
|
|
|
mnemonic,
|
|
|
|
|
pin,
|
|
|
|
|
passphrase_protection,
|
|
|
|
|
label,
|
|
|
|
|
"english",
|
|
|
|
|
ignore_checksum,
|
|
|
|
|
expand,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if xprv:
|
|
|
|
|
return debuglink.load_device_by_xprv(
|
|
|
|
|
client, xprv, pin, passphrase_protection, label, "english"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
if slip0014:
|
|
|
|
|
return debuglink.load_device_by_mnemonic(
|
|
|
|
|
client, " ".join(["all"] * 12), pin, passphrase_protection, "SLIP-0014"
|
|
|
|
|
)
|
|
|
|
|
mnemonic = [" ".join(["all"] * 12)]
|
|
|
|
|
|
|
|
|
|
return debuglink.load_device_by_mnemonic(
|
|
|
|
|
client,
|
|
|
|
|
list(mnemonic),
|
|
|
|
|
pin,
|
|
|
|
|
passphrase_protection,
|
|
|
|
|
label,
|
|
|
|
|
"english",
|
|
|
|
|
ignore_checksum,
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@cli.command(help="Start safe recovery workflow.")
|
|
|
|
|