diff --git a/src/rpcclient/rpcclient/darwin/common.py b/src/rpcclient/rpcclient/darwin/common.py index 8e6d22a..747f6ad 100644 --- a/src/rpcclient/rpcclient/darwin/common.py +++ b/src/rpcclient/rpcclient/darwin/common.py @@ -2,4 +2,4 @@ from typing import Any, Union CfSerializable = Union[ - tuple[str, Any], list, tuple[Any, ...], str, bool, float, bytes, datetime, None] + dict[str, Any], list, tuple[Any, ...], str, bool, float, bytes, datetime, None] diff --git a/src/rpcclient/rpcclient/darwin/media.py b/src/rpcclient/rpcclient/darwin/media.py index adda9e2..9b72e03 100644 --- a/src/rpcclient/rpcclient/darwin/media.py +++ b/src/rpcclient/rpcclient/darwin/media.py @@ -138,7 +138,7 @@ def set_mode(self, mode: AVAudioSessionMode): def set_category(self, category: AVAudioSessionCategory, mode: AVAudioSessionMode = AVAudioSessionMode.Default, route_sharing_policy: AVAudioSessionRouteSharingPolicy = AVAudioSessionRouteSharingPolicy.Default, - options: AVAudioSessionCategoryOptions = 0): + options: AVAudioSessionCategoryOptions = AVAudioSessionCategoryOptions.DefaultToSpeaker) -> None: category = self._client.symbols[category.value][0] mode = self._client.symbols[mode.value][0] self._session.objc_call('setCategory:mode:routeSharingPolicy:options:error:', category, mode, diff --git a/src/rpcclient/rpcclient/darwin/symbol.py b/src/rpcclient/rpcclient/darwin/symbol.py index 107f853..f344f3e 100644 --- a/src/rpcclient/rpcclient/darwin/symbol.py +++ b/src/rpcclient/rpcclient/darwin/symbol.py @@ -49,4 +49,10 @@ def objc_symbol(self): @property def osstatus(self) -> Optional[list[ErrorCode]]: + """ Get possible translation to given error code by querying osstatus """ return get_possible_error_codes(self) + + @property + def stripped_value(self) -> 'DarwinSymbol': + """ Remove PAC upper bits """ + return self._client.symbol(self & 0xfffffffff) diff --git a/src/rpcclient/tests/test_client.py b/src/rpcclient/tests/test_client.py index deeb2aa..88f4408 100644 --- a/src/rpcclient/tests/test_client.py +++ b/src/rpcclient/tests/test_client.py @@ -81,7 +81,7 @@ def test_get_dummy_block(client): """ :param rpcclient.client.Client client: """ - assert client.get_dummy_block()[0] == client.symbols._NSConcreteGlobalBlock + client.cf([1, 2, 3]).objc_call('enumerateObjectsUsingBlock:', client.get_dummy_block()) def test_listdir(client):