From defbb74b7886f74eb52bd928de522a48969991bf Mon Sep 17 00:00:00 2001 From: doron zarhi Date: Tue, 15 Feb 2022 20:08:51 +0200 Subject: [PATCH] rpcclient: darwin: add set_airplane_mode --- src/rpcclient/rpcclient/darwin/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rpcclient/rpcclient/darwin/client.py b/src/rpcclient/rpcclient/darwin/client.py index 995b75e2..9c6f78d2 100644 --- a/src/rpcclient/rpcclient/darwin/client.py +++ b/src/rpcclient/rpcclient/darwin/client.py @@ -74,6 +74,11 @@ def uname(self): def is_idevice(self): return self.uname.machine.startswith('i') + def set_airplane_mode(self, mode: bool): + preferences = self.symbols.objc_getClass('RadiosPreferences').objc_call('new') + preferences.objc_call('setAirplaneMode:', mode) + preferences.objc_call('synchronize') + def symbol(self, symbol: int): """ at a symbol object from a given address """ return DarwinSymbol.create(symbol, self)