File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,15 +148,15 @@ def find_device(self, nfcInterfaceOnly=False):
148148 dev = None
149149 self .nfc_interface_only = nfcInterfaceOnly
150150 if not nfcInterfaceOnly :
151- print ("--- HID ---" )
152- print (list (CtapHidDevice .list_devices ()))
151+ # print("--- HID ---")
152+ # print(list(CtapHidDevice.list_devices()))
153153 dev = next (CtapHidDevice .list_devices (), None )
154154
155155 if not dev :
156156 from fido2 .pcsc import CtapPcscDevice
157157
158- print ("--- NFC ---" )
159- print (list (CtapPcscDevice .list_devices ()))
158+ # print("--- NFC ---")
159+ # print(list(CtapPcscDevice.list_devices()))
160160 dev = next (CtapPcscDevice .list_devices (), None )
161161 if dev :
162162 self .is_nfc = True
@@ -190,9 +190,24 @@ def reboot(self,):
190190 self .find_device (self .nfc_interface_only )
191191 return
192192
193- print ("Please reboot authenticator and hit enter" )
194- input ()
195- self .find_device (self .nfc_interface_only )
193+ if 'solokeys' in sys .argv :
194+ try :
195+ self .dev .call (0x53 ^ 0x80 ,b'' )
196+ except OSError :
197+ pass
198+
199+ print ('Rebooting..' )
200+ for _ in range (0 ,8 ):
201+ time .sleep (0.1 )
202+ try :
203+ self .find_device (self .nfc_interface_only )
204+ return
205+ except RuntimeError :
206+ pass
207+ else :
208+ print ("Please reboot authenticator and hit enter" )
209+ input ()
210+ self .find_device (self .nfc_interface_only )
196211
197212 def send_data (self , cmd , data ):
198213 if not isinstance (data , bytes ):
You can’t perform that action at this time.
0 commit comments