Skip to content

Commit c010b30

Browse files
committed
fix: re-sign VS Code app bundle after LSUIElement patch
macOS kills apps whose code signature is invalidated. Adding LSUIElement to Info.plist breaks the signature, so re-sign with ad-hoc identity after patching. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
1 parent 197cadd commit c010b30

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

scripts/hide-test-vscode.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ for plist in \
3030
fi
3131

3232
plutil -insert LSUIElement -bool true "$plist"
33+
34+
# Re-sign the .app bundle after modifying Info.plist.
35+
# macOS kills apps whose code signature no longer matches.
36+
app_bundle="${plist%/Contents/Info.plist}"
37+
codesign --force --deep --sign - "$app_bundle" 2>/dev/null || true
38+
3339
patched=$((patched + 1))
3440
echo "Patched: $plist"
3541
done

0 commit comments

Comments
 (0)