Skip to content

Commit

Permalink
Merge pull request #1261 from doronz88/bugfix/no-applications-in-info…
Browse files Browse the repository at this point in the history
…-plist

mobilebackup2: fix handling no applications in `Info.plist`
  • Loading branch information
doronz88 authored Oct 23, 2024
2 parents 5b64a02 + 86c20b4 commit a4bc6be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pymobiledevice3/services/mobilebackup2.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,10 @@ def restore(self, backup_directory='.', system: bool = False, reboot: bool = Tru
# Write /iTunesRestore/RestoreApplications.plist so that the device will start
# restoring applications once the rest of the restore process is finished
info_plist_path = backup_directory / source / 'Info.plist'
applications = plistlib.loads(info_plist_path.read_bytes())['Applications']
afc.makedirs('/iTunesRestore')
afc.set_file_contents('/iTunesRestore/RestoreApplications.plist', plistlib.dumps(applications))
applications = plistlib.loads(info_plist_path.read_bytes()).get('Applications')
if applications is not None:
afc.makedirs('/iTunesRestore')
afc.set_file_contents('/iTunesRestore/RestoreApplications.plist', plistlib.dumps(applications))

dl.dl_loop(progress_callback)

Expand Down

0 comments on commit a4bc6be

Please sign in to comment.