From 6e03370863c0d76b3375467597faea862ddfc61d Mon Sep 17 00:00:00 2001 From: "Ajin.Abraham" Date: Tue, 5 Dec 2023 20:55:29 -0800 Subject: [PATCH] QA --- mobsf/DynamicAnalyzer/views/ios/frida_core.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mobsf/DynamicAnalyzer/views/ios/frida_core.py b/mobsf/DynamicAnalyzer/views/ios/frida_core.py index acdb605bd0..ca5098a50b 100644 --- a/mobsf/DynamicAnalyzer/views/ios/frida_core.py +++ b/mobsf/DynamicAnalyzer/views/ios/frida_core.py @@ -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.""" @@ -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() @@ -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, @@ -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') @@ -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):