Harden MVP runtime and fix packaged desktop white screen

This commit is contained in:
Ryan Lancaster
2026-03-18 13:05:14 -04:00
parent 9302a88aea
commit 4a7b3061ed
14 changed files with 359 additions and 29 deletions

View File

@@ -9,7 +9,30 @@ exports.default = async function (context) {
`${context.packager.appInfo.productFilename}.app`,
);
console.log(`Ad-hoc signing: ${appPath}`);
execSync(`xattr -cr "${appPath}"`);
execSync(`codesign --force --deep --sign - "${appPath}"`);
console.log('Ad-hoc signing complete.');
// Remove Finder/iCloud metadata that can make codesign fail with
// "resource fork, Finder information, or similar detritus not allowed".
const cleanupCmds = [
`xattr -cr "${appPath}"`,
`dot_clean -m "${appPath}"`,
`find "${appPath}" -name '._*' -delete`,
`xattr -r -d com.apple.FinderInfo "${appPath}"`,
`xattr -r -d com.apple.ResourceFork "${appPath}"`,
`xattr -r -d com.apple.quarantine "${appPath}"`,
];
for (const cmd of cleanupCmds) {
try {
execSync(cmd, { stdio: 'ignore' });
} catch {
// Cleanup commands are best-effort.
}
}
try {
execSync(`codesign --force --deep --sign - "${appPath}"`, { stdio: 'inherit' });
console.log('Ad-hoc signing complete.');
} catch (err) {
console.warn('Ad-hoc signing skipped due to codesign error. Build artifacts are still usable locally.');
}
};