Minor style fixes

This commit is contained in:
Nex 2022-06-29 00:57:25 +02:00
parent 7222bc82e1
commit 298726ab2b
3 changed files with 12 additions and 10 deletions

View File

@ -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))

View File

@ -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])

View File

@ -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))