fix: error if IPA structure is missing Payload root

This commit is contained in:
relikd
2024-03-04 19:31:45 +01:00
parent 0ee572226c
commit 95b1117317

View File

@@ -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: