Skip to content

Commit

Permalink
Merge pull request #1262 from doronz88/bugfix/publicstaging-makedirs
Browse files Browse the repository at this point in the history
installation_proxy: make sure `/PublicStaging` exists on device
  • Loading branch information
doronz88 authored Oct 24, 2024
2 parents a4bc6be + 764a76f commit eb571aa
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pymobiledevice3/services/installation_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@

GET_APPS_ADDITIONAL_INFO = {'ReturnAttributes': ['CFBundleIdentifier', 'StaticDiskUsage', 'DynamicDiskUsage']}

TEMP_REMOTE_IPA_FILE = '/PublicStaging/pymobiledevice3.ipa'

TEMP_REMOTE_IPCC_FOLDER = '/PublicStaging/pymobiledevice3.ipcc'
TEMP_REMOTE_BASEDIR = '/PublicStaging'
TEMP_REMOTE_IPA_FILE = f'{TEMP_REMOTE_BASEDIR}/pymobiledevice3.ipa'
TEMP_REMOTE_IPCC_FOLDER = f'{TEMP_REMOTE_BASEDIR}/pymobiledevice3.ipcc'


def create_ipa_contents_from_directory(directory: str) -> bytes:
Expand Down Expand Up @@ -118,6 +118,7 @@ def install_from_local(self, package_path: Path, cmd: str = 'Install', options:

with AfcService(self.lockdown) as afc:
if not ipcc_mode:
afc.makedirs(TEMP_REMOTE_BASEDIR)
afc.set_file_contents(TEMP_REMOTE_IPA_FILE, ipa_contents)

else:
Expand Down Expand Up @@ -147,7 +148,7 @@ def upload_ipcc_as_folder(self, file: Path, afc_client: AfcService) -> None:

with file_zip.open(file_name) as inside_file_zip:
file_data = inside_file_zip.read()

afc_client.makedirs(TEMP_REMOTE_BASEDIR)
afc_client.set_file_contents(f'{TEMP_REMOTE_IPCC_FOLDER}/{file_name}', file_data)

self.logger.info('Upload complete.')
Expand Down

0 comments on commit eb571aa

Please sign in to comment.