Skip to content

Commit

Permalink
QA
Browse files Browse the repository at this point in the history
  • Loading branch information
ajinabraham committed Dec 6, 2023
1 parent c086781 commit 6e03370
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions mobsf/DynamicAnalyzer/views/ios/frida_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ def __init__(
self.frida_log = self.ipa_dir / 'mobsf_frida_out.txt'
self.dump_file = self.ipa_dir / 'mobsf_dump_file.txt'
self.container_file = self.ipa_dir / 'mobsf_app_container_path.txt'
self.not_supported_text = (
'Failed to instrument the app with Frida.'
'This app is not supported by Frida.'
'Are you able to run the app on '
'this device?')

def get_scripts(self, script_type, selected_scripts):
"""Get Frida Scripts."""
Expand Down Expand Up @@ -159,7 +164,7 @@ def spawn(self):
self.clean_up()
_PID = frida.get_remote_device().spawn([self.bundle_id])
except frida.NotSupportedError:
logger.exception('Not Supported Error')
logger.error(self.not_supported_text)
return
except frida.ServerNotRunningError:
self.frida_ssh_forward()
Expand All @@ -170,7 +175,7 @@ def spawn(self):
except frida.TimedOutError:
logger.error('Timed out while waiting for device to appear')
except frida.NotSupportedError:
logger.exception('Not Supported Error')
logger.error(self.not_supported_text)
return
except (frida.ProcessNotFoundError,
frida.TransportError,
Expand All @@ -197,7 +202,7 @@ def session(self, pid, bundle_id):
# pid is the fornt most app
session = device.attach(_PID)
except frida.NotSupportedError:
logger.exception('Not Supported Error')
logger.error(self.not_supported_text)
return
except Exception:
logger.warning('Cannot attach to pid, spawning again')
Expand All @@ -215,7 +220,7 @@ def session(self, pid, bundle_id):
script.unload()
session.detach()
except frida.NotSupportedError:
logger.exception('Not Supported Error')
logger.error(self.not_supported_text)
except (frida.ProcessNotFoundError,
frida.TransportError,
frida.InvalidOperationError):
Expand Down

0 comments on commit 6e03370

Please sign in to comment.