Beispiel #1
0
    def setup_device(self, label='', passphrase=''):
        self.client.init_device()
        if not self.simulator:
            # Use interactive_get_pin
            self.client.ui.get_pin = MethodType(interactive_get_pin, self.client.ui)

        if self.client.features.initialized:
            raise DeviceAlreadyInitError('Device is already initialized. Use wipe first and try again')
        device.reset(self.client, passphrase_protection=bool(self.password))
        return {'success': True}
Beispiel #2
0
    def setup_device(self, label: str = "", passphrase: str = "") -> bool:
        self._prepare_device()
        if not self.simulator:
            # Use interactive_get_pin
            self.client.ui.get_pin = MethodType(interactive_get_pin, self.client.ui)

        if self.client.features.initialized:
            raise DeviceAlreadyInitError(
                "Device is already initialized. Use wipe first and try again"
            )
        device.reset(self.client, passphrase_protection=bool(self.password))
        return True