Skip to content

Commit

Permalink
Merge pull request #6 from qtacore/feature/ios13
Browse files Browse the repository at this point in the history
Feature/ios13
  • Loading branch information
JerryGinger authored Apr 7, 2020
2 parents f35d697 + eebe67d commit e3c67db
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 97 deletions.
20 changes: 13 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
language: python
matrix:
include:
- os: osx
- os: linux
python: '2.7'
language: generic
- os: osx
dist: xenial
- os: linux
python: '3.6'
language: generic
dist: xenial
install:
- pip install -r requirements.txt
- sudo mkdir /usr/local/man
- sudo chmod a+w /usr/local/man
- pip install -r requirements.txt --user
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
pip install m2crypto --user;
sudo apt-get install -y usbmuxd;
fi
script:
- python test/__init__.py
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
python test/__init__.py;
fi
before_deploy:
- echo $TRAVIS_TAG > version.txt
- export PATH=/Users/travis/Library/Python/2.7/bin:$PATH
Expand All @@ -23,7 +29,7 @@ deploy:
user: qta
password:
secure: tzAoq5UnwaqQGHcH4qSnN0hfFop7f/Gjgf3DTWrblpn+vBIOBk4umJIAAF2u5tUHuhxm14UmDEuDciQM9j6DEoy+7VPhe8KY8cVhBjIYpEIBjYr4WeRsl2rhDPlYnp5wDHdsY4bsJgtOSjVCbdKZ9VhV0cjUegKU3oEX5k1qu/XPDNbiZhWs/zjyXwKAbnTBqcJlcdZphVeEgC9E8DMCQRRTfNXtqSmZj8EkjSwlbIAldZflqX7/Xg7/pFPaKjwQW1BvIaPUqvvwQLGvyqr4zovF4SQ8UpUPHMuhYY/0jJijgRe0VkI9SsCXbWFmMZrgkyfvjOmGLc3dYaaINh1jf6zoVWddtgeRW9mNs0GzcPz9PefefeNgIQ9yyM99Uv0nqrAdARO87SrtGCQ4CNrAOwaXJElzKcTJOfpbrLedbnqczzC5wa5LZYsMZudiULpiPOEK6MZ4spOnt8D2/8tSIOQMfY3BF5vUXYBEM+uuj38lKfZGXT2Ox9XzMZZPjkV5F5ky73oAdMEPTBJWUAI2xXeESBMSfh7NP0019kTloKOpDsgFknGQdLfGWdcONWmJWP1yreavcz9fLEWJXz+mdTzUcVKg2JLouUmhAdKtlU9oS6n9R3T0OZ0QlltLqnkp+IC0KouaTLrIBZ16IoYjnxJ3/pc/+FN8lV3nY/XFsnY=
distributions: "sdist bdist_wheel bdist_egg"
distributions: "sdist"
on:
tags: true
branch: master
Expand Down
10 changes: 8 additions & 2 deletions pymobiledevice/afc.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def dispatch_packet(self, operation, data, this_length=0):


def receive_data(self):
res = self.service.recv(40)
res = self.service.recv_exact(40)
status = AFC_E_SUCCESS
data = ""
if res:
Expand Down Expand Up @@ -442,7 +442,10 @@ def _complete(self, text, line, begidx, endidx):


def do_ls(self, p):
d = self.afc.read_directory(self.curdir + "/" + p)
dirname = self.curdir + "/" + p
if self.curdir.endswith("/"):
dirname = self.curdir + p
d = self.afc.read_directory(dirname)
if d:
for dd in d:
print(dd)
Expand Down Expand Up @@ -496,6 +499,9 @@ def do_pull(self, user_args):
z = parsePlist(data)
plistlib.writePlist(z, out_path)
else:
out_dir = os.path.dirname(out_path)
if not os.path.exists(out_dir):
os.makedirs(out_dir, MODEMASK)
with open(out_path, 'wb+') as f:
f.write(data)

Expand Down
25 changes: 14 additions & 11 deletions pymobiledevice/house_arrest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,30 @@

class HouseArrestClient(AFCClient):

def __init__(self, lockdown=None,serviceName="com.apple.mobile.house_arrest", service=None):
self.serviceName = serviceName
self.lockdown = lockdown if lockdown else LockdownClient()
self.service = service if service else self.lockdown.startService(self.serviceName)
def __init__(self, udid=None):
lockdownClient = LockdownClient(udid)
serviceName = "com.apple.mobile.house_arrest"
super(HouseArrestClient, self).__init__(lockdownClient, serviceName)


def stop_session(self):
print("Disconecting...")
self.service.close()

def send_command(self, applicationId, cmd="VendDocuments"):
def send_command(self, applicationId, cmd="VendContainer"):
self.service.sendPlist({"Command": cmd, "Identifier": applicationId})
res = self.service.recvPlist()

if res.get("Error"):
print(res["Error"])
return None
return False
else:
return True

def shell(self,applicationId,cmd="VendDocuments"):
res = self.send_command(applicationId, cmd="VendDocuments")
def shell(self, applicationId, cmd="VendContainer"):
res = self.send_command(applicationId, cmd)
if res:
AFCShell(client=self.service).cmdloop()
AFCShell(client=self).cmdloop()


if __name__ == "__main__":
Expand All @@ -63,9 +66,9 @@ def shell(self,applicationId,cmd="VendDocuments"):
(options, args) = parser.parse_args()
h = HouseArrestClient()
if options.cmd:
h.shell(options.applicationId)
else:
h.shell(options.applicationId, cmd=options.cmd)
else:
h.shell(options.applicationId)



Expand Down
Loading

0 comments on commit e3c67db

Please sign in to comment.