From 298726ab2b2c012264c4f432589d4c1b7da0552a Mon Sep 17 00:00:00 2001 From: Nex Date: Wed, 29 Jun 2022 00:57:25 +0200 Subject: [PATCH] Minor style fixes --- mvt/ios/modules/usb/applications.py | 11 ++++++----- mvt/ios/modules/usb/device_info.py | 1 - mvt/ios/modules/usb/processes.py | 10 ++++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/mvt/ios/modules/usb/applications.py b/mvt/ios/modules/usb/applications.py index d010469..41b58c2 100644 --- a/mvt/ios/modules/usb/applications.py +++ b/mvt/ios/modules/usb/applications.py @@ -32,13 +32,14 @@ class Applications(IOSUSBExtraction): def run(self) -> None: user_apps = InstallationProxyService(lockdown=self.lockdown).get_apps("User") - for u in user_apps: - u["type"] = "user" + for user_app in user_apps: + user_app["type"] = "user" system_apps = InstallationProxyService(lockdown=self.lockdown).get_apps("System") - for s in system_apps: - s["type"] = "system" + for system_app in system_apps: + system_app["type"] = "system" self.results = user_apps + system_apps - self.log.info("{} applications identified on the phone".format(len(self.results))) + self.log.info("%d applications identified on the phone", + len(self.results)) diff --git a/mvt/ios/modules/usb/device_info.py b/mvt/ios/modules/usb/device_info.py index de7cafc..62c43fc 100644 --- a/mvt/ios/modules/usb/device_info.py +++ b/mvt/ios/modules/usb/device_info.py @@ -23,7 +23,6 @@ class DeviceInfo(IOSUSBExtraction): def run(self) -> None: self.results = self.lockdown.all_values - # Base64 encoding of bytes for entry in self.results: if isinstance(self.results[entry], bytes): self.results[entry] = base64.b64encode(self.results[entry]) diff --git a/mvt/ios/modules/usb/processes.py b/mvt/ios/modules/usb/processes.py index 8663da2..e2a14ec 100644 --- a/mvt/ios/modules/usb/processes.py +++ b/mvt/ios/modules/usb/processes.py @@ -12,6 +12,7 @@ from .base import IOSUSBExtraction class Processes(IOSUSBExtraction): """This class extracts all processes running on the phone.""" + def __init__(self, file_path: str = None, target_path: str = None, results_path: str = None, fast_mode: bool = False, log: logging.Logger = None, results: list = []) -> None: @@ -31,10 +32,11 @@ class Processes(IOSUSBExtraction): def run(self) -> None: processes = OsTraceService(lockdown=self.lockdown).get_pid_list().get('Payload') - for p in processes: + for pid in processes: self.results.append({ - "pid": p, - "name": processes[p]["ProcessName"] + "pid": pid, + "name": processes[pid]["ProcessName"] }) - self.log.info("{} running processes identified on the phone".format(len(self.results))) + self.log.info("%d running processes identified on the phone", + len(self.results))