From 5f3ed28591c00a68b792353b6c0a65e7e69dda7d Mon Sep 17 00:00:00 2001 From: doronz88 Date: Mon, 15 Apr 2024 08:14:18 +0300 Subject: [PATCH 1/4] activity_trace_tap: handle `` strings --- .../services/dvt/instruments/activity_trace_tap.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pymobiledevice3/services/dvt/instruments/activity_trace_tap.py b/pymobiledevice3/services/dvt/instruments/activity_trace_tap.py index 1f9d041d..4640517b 100644 --- a/pymobiledevice3/services/dvt/instruments/activity_trace_tap.py +++ b/pymobiledevice3/services/dvt/instruments/activity_trace_tap.py @@ -41,7 +41,7 @@ def ignored_null(s: bytes) -> bytes: def decode_message_format(message) -> str: s = '' for type_, data in message: - if data: + if data and isinstance(data, bytes): data = ignored_null(data) type_ = decode_str(type_) @@ -53,6 +53,8 @@ def decode_message_format(message) -> str: s += '' else: s += data.decode() + elif type_ == 'private': + s += '' elif type_.startswith('uint64'): uint64 = struct.unpack(' Date: Mon, 15 Apr 2024 08:14:48 +0300 Subject: [PATCH 2/4] exceptions: add missing to `__all__` --- pymobiledevice3/exceptions.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pymobiledevice3/exceptions.py b/pymobiledevice3/exceptions.py index 20957b19..b18dca9a 100644 --- a/pymobiledevice3/exceptions.py +++ b/pymobiledevice3/exceptions.py @@ -2,18 +2,18 @@ 'PyMobileDevice3Exception', 'DeviceVersionNotSupportedError', 'IncorrectModeError', 'NotTrustedError', 'PairingError', 'NotPairedError', 'CannotStopSessionError', 'PasswordRequiredError', 'StartServiceError', 'FatalPairingError', 'NoDeviceConnectedError', 'DeviceNotFoundError', - 'TunneldConnectionError', 'ConnectionFailedToUsbmuxdError', 'MuxException', + 'TunneldConnectionError', 'ConnectionFailedToUsbmuxdError', 'MuxException', 'InvalidConnectionError', 'MuxVersionError', 'ArgumentError', 'AfcException', 'AfcFileNotFoundError', 'DvtException', 'DvtDirListError', 'NotMountedError', 'AlreadyMountedError', 'UnsupportedCommandError', 'ExtractingStackshotError', 'ConnectionTerminatedError', 'WirError', 'WebInspectorNotEnabledError', 'RemoteAutomationNotEnabledError', 'ArbitrationError', 'InternalError', 'DeveloperModeIsNotEnabledError', 'DeviceAlreadyInUseError', 'LockdownError', 'PairingDialogResponsePendingError', 'UserDeniedPairingError', 'InvalidHostIDError', 'SetProhibitedError', 'MissingValueError', 'PasscodeRequiredError', 'AmfiError', 'DeviceHasPasscodeSetError', 'NotificationTimeoutError', - 'DeveloperModeError', 'ProfileError', 'IRecvError', 'IRecvNoDeviceConnectedError', + 'DeveloperModeError', 'ProfileError', 'IRecvError', 'IRecvNoDeviceConnectedError', 'UnrecognizedSelectorError', 'NoDeviceSelectedError', 'MessageNotSupportedError', 'InvalidServiceError', 'InspectorEvaluateError', 'LaunchingApplicationError', 'BadCommandError', 'BadDevError', 'ConnectionFailedError', 'CoreDeviceError', 'AccessDeniedError', 'RSDRequiredError', 'SysdiagnoseTimeoutError', 'GetProhibitedError', - 'FeatureNotSupportedError', 'OSNotSupportedError' + 'FeatureNotSupportedError', 'OSNotSupportedError', 'DeprecationError', 'NotEnoughDiskSpaceError' ] from typing import List, Optional From d26500f4cd469fecbee9069b7ba1f8e6b17c5405 Mon Sep 17 00:00:00 2001 From: doronz88 Date: Mon, 15 Apr 2024 08:15:11 +0300 Subject: [PATCH 3/4] lockdown: fix `create_using_remote()` docstring --- pymobiledevice3/lockdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymobiledevice3/lockdown.py b/pymobiledevice3/lockdown.py index 4d890456..b06b243d 100755 --- a/pymobiledevice3/lockdown.py +++ b/pymobiledevice3/lockdown.py @@ -766,7 +766,7 @@ def create_using_remote(service: ServiceConnection, identifier: str = None, labe """ Create a TcpLockdownClient instance over RSD - :param hostname: The target device hostname + :param service: service connection to use :param identifier: Used as an identifier to look for the device pair record :param label: lockdownd user-agent :param autopair: Attempt to pair with device (blocking) if not already paired From 255889f81b9be34a5cc1f45f3cd08b99b17bb0ad Mon Sep 17 00:00:00 2001 From: doronz88 Date: Mon, 15 Apr 2024 08:15:26 +0300 Subject: [PATCH 4/4] accessibilityaudit: fix typings --- pymobiledevice3/services/accessibilityaudit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pymobiledevice3/services/accessibilityaudit.py b/pymobiledevice3/services/accessibilityaudit.py index 73f36505..010e189b 100644 --- a/pymobiledevice3/services/accessibilityaudit.py +++ b/pymobiledevice3/services/accessibilityaudit.py @@ -11,7 +11,7 @@ class SerializedObject: - def __init__(self, fields: typing.Mapping): + def __init__(self, fields: typing.MutableMapping): self._fields = fields