Skip to content

Commit

Permalink
darwin: bugfix: seperate roots for ios and macos
Browse files Browse the repository at this point in the history
  • Loading branch information
doronz88 committed Feb 19, 2022
1 parent 23b7ca8 commit 6f69227
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/rpcclient/rpcclient/darwin/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ def is_idevice(self):
@property
def roots(self) -> typing.List[str]:
""" get a list of all accessible darwin roots when used for lookup of files/preferences/... """
result = ['/']
for username in self.fs.scandir('/Users'):
if not username.is_dir() or not self.fs.accessible(username.path):
continue
result.append(username.path)
return result
return ['/', '/var/root']

def set_airplane_mode(self, mode: bool):
""" set whether the device should enter airplane mode (turns off baseband, bt, etc...) """
Expand Down
7 changes: 6 additions & 1 deletion src/rpcclient/rpcclient/ios/client.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import typing

from rpcclient.darwin.client import DarwinClient


class IosClient(DarwinClient):
pass
@property
def roots(self) -> typing.List[str]:
""" get a list of all accessible darwin roots when used for lookup of files/preferences/... """
return super().roots + ['/var/mobile']
13 changes: 13 additions & 0 deletions src/rpcclient/rpcclient/macos/client.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import typing

from rpcclient.darwin.client import DarwinClient
from rpcclient.macos.bluetooth import Bluetooth
from rpcclient.darwin.reports import Reports
Expand All @@ -11,3 +13,14 @@ def __init__(self, sock, sysname: str, hostname: str, port: int = None):
super().__init__(sock, sysname, hostname, port)
self.bluetooth = Bluetooth(self)
self.reports = Reports(self, CRASH_REPORTS_DIR)

@property
def roots(self) -> typing.List[str]:
""" get a list of all accessible darwin roots when used for lookup of files/preferences/... """

result = super().roots
for username in self.fs.scandir('/Users'):
if not username.is_dir() or not self.fs.accessible(username.path):
continue
result.append(username.path)
return result

0 comments on commit 6f69227

Please sign in to comment.