From 95b1117317d6cf5cefb18e5c866ad3ea9d52e3dd Mon Sep 17 00:00:00 2001 From: relikd Date: Mon, 4 Mar 2024 19:31:45 +0100 Subject: [PATCH] fix: error if IPA structure is missing Payload root --- ipa_archive.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ipa_archive.py b/ipa_archive.py index b42bd971..fc67afc3 100755 --- a/ipa_archive.py +++ b/ipa_archive.py @@ -417,9 +417,11 @@ def loadIpa(uid: int, url: str, *, app_name = None artwork = False zip_listing = zip.infolist() + has_payload_folder = False for entry in zip_listing: fn = entry.filename.lstrip('/') + has_payload_folder |= fn.startswith('Payload/') plist_match = re_info_plist.match(fn) if fn == 'iTunesArtwork': extractZipEntry(zip, entry, img_path) @@ -429,6 +431,10 @@ def loadIpa(uid: int, url: str, *, if not image_only: extractZipEntry(zip, entry, plist_path) + if not has_payload_folder: + print(f'ERROR: [{uid}] ipa has no "Payload/" root folder', + file=stderr) + # if no iTunesArtwork found, load file referenced in plist if not artwork and app_name and plist_path.exists(): with open(plist_path, 'rb') as fp: