Fixed the order of frida calls to avoid problems with slow launching
apps
This commit is contained in:
parent
8197901475
commit
43ff89b186
11
dump.py
11
dump.py
|
@ -250,18 +250,17 @@ def open_target_app(device, name_or_bundleid):
|
|||
|
||||
try:
|
||||
pid = device.spawn([bundle_identifier])
|
||||
session = device.attach(pid)
|
||||
device.resume(pid)
|
||||
time.sleep(1)
|
||||
except Exception as e:
|
||||
print e
|
||||
|
||||
return pid, display_name, bundle_identifier
|
||||
return session, display_name, bundle_identifier
|
||||
|
||||
|
||||
def start_dump(device, pid, ipa_name):
|
||||
def start_dump(session, ipa_name):
|
||||
print 'Dumping {} to {}'.format(display_name, TEMP_DIR)
|
||||
|
||||
session = device.attach(pid)
|
||||
script = load_js_file(session, DUMP_JS)
|
||||
script.post('dump')
|
||||
finished.wait()
|
||||
|
@ -295,11 +294,11 @@ if __name__ == '__main__':
|
|||
ssh.connect(Host, port=Port, username=User, password=Password)
|
||||
|
||||
create_dir(PAYLOAD_PATH)
|
||||
(pid, display_name, bundle_identifier) = open_target_app(device, name_or_bundleid)
|
||||
(session, display_name, bundle_identifier) = open_target_app(device, name_or_bundleid)
|
||||
if output_ipa is None:
|
||||
output_ipa = display_name
|
||||
output_ipa = re.sub('\.ipa$', '', output_ipa)
|
||||
start_dump(device, pid, output_ipa)
|
||||
start_dump(session, output_ipa)
|
||||
except paramiko.ssh_exception.NoValidConnectionsError as e:
|
||||
print e
|
||||
exit_code = 1
|
||||
|
|
Loading…
Reference in New Issue