From 764443e856896250687a21f1cd20a35f259cc19a Mon Sep 17 00:00:00 2001 From: mikey820 <60276187+mikey820@users.noreply.github.com> Date: Tue, 26 May 2026 10:33:33 -0400 Subject: [PATCH] Default to 0644 when IPA entries have no Unix permissions IPAs zipped on Windows store NTFS attributes in the ZIP external file attributes and leave the Unix mode bits (the high 16 bits of external_fa) unset. unzipArchiveAtURL: then derived a permission of 0 from those entries and applied it with setAttributes:, leaving the extracted files with mode 0000. Subsequent reads during signing failed, surfacing to the user as "You don't have permission". Fall back to 0644 when no Unix mode bits are present so these archives extract with readable permissions. Fixes SideStore/SideStore#447 --- AltSign/Categories/NSFileManager+Zip.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/AltSign/Categories/NSFileManager+Zip.m b/AltSign/Categories/NSFileManager+Zip.m index e901bd6..ca17970 100644 --- a/AltSign/Categories/NSFileManager+Zip.m +++ b/AltSign/Categories/NSFileManager+Zip.m @@ -220,6 +220,11 @@ - (BOOL)unzipArchiveAtURL:(NSURL *)archiveURL toDirectory:(NSURL *)directoryURL } while (result > 0); short permissions = (info.external_fa >> 16) & 0x01FF; + if (permissions == 0) { + // No Unix mode bits set -- archive was likely created on Windows. + // Use a readable default so signing can proceed. (Fixes issue #447.) + permissions = 0644; + } if (![self setAttributes:@{NSFilePosixPermissions: @(permissions)} ofItemAtPath:fileURL.path error:error]) { finish();