Compatible with previous versions

This commit is contained in:
Alone_Monkey 2018-07-13 16:41:48 +08:00 committed by GitHub
parent e53e81ecc3
commit 71499f4d91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -43,6 +43,10 @@ finished = threading.Event()
def get_usb_iphone():
Type = 'usb'
if frida.__version__ < 12:
Type = 'tether'
device_manager = frida.get_device_manager()
changed = threading.Event()
@ -53,7 +57,7 @@ def get_usb_iphone():
device = 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:
print 'Waiting for USB device...'
changed.wait()