Compatible with previous versions

This commit is contained in:
Alone_Monkey 2018-07-13 16:42:28 +08:00 committed by GitHub
parent 7a6b65c040
commit b48276f391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -40,6 +40,9 @@ finished = threading.Event()
def get_usb_iphone(): def get_usb_iphone():
Type = 'usb'
if frida.__version__ < 12:
Type = 'tether'
device_manager = frida.get_device_manager() device_manager = frida.get_device_manager()
changed = threading.Event() changed = threading.Event()
@ -50,7 +53,7 @@ def get_usb_iphone():
device = None device = None
while device is None: while device is None:
devices = [dev for dev in device_manager.enumerate_devices() if dev.type == 'usb'] devices = [dev for dev in device_manager.enumerate_devices() if dev.type == Type]
if len(devices) == 0: if len(devices) == 0:
print('Waiting for USB device...') print('Waiting for USB device...')
changed.wait() changed.wait()