From 3885a045603c23975c08cb806ee592ddd04ba547 Mon Sep 17 00:00:00 2001 From: Marcin Macierzanka Date: Tue, 3 Nov 2026 02:15:37 +0100 Subject: [PATCH] Set bundle id to com.mmacierzanka.seconddisplay and add in-bundle uninstall script Co-Authored-By: Claude Sonnet 5.5 --- CLAUDE.md | 1 + Resources/uninstall.sh | 16 ++++++++++++++++ build.sh | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 Resources/uninstall.sh diff --git a/CLAUDE.md b/CLAUDE.md index 4b6bedd..9dc05c7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -15,6 +15,7 @@ Aplikacja natywna na macOS, która wyświetla w oknie obraz z urządzenia przech - `Sources/main.swift` – cała aplikacja (AppKit + AVFoundation, jedna sesja `AVCaptureSession`, dźwięk przez `AVCaptureAudioPreviewOutput`). - `Resources/{en,pl}.lproj` – `Localizable.strings` i `InfoPlist.strings`. - `Resources/AppIcon.icon` – ikona w formacie Icon Composer (Liquid Glass; otwórz w Icon Composer, warstwy SVG w `Assets/`); `build.sh` kompiluje ją przez `actool`. +- `Resources/uninstall.sh` – kopiowany do bundla (`Contents/Resources/uninstall.sh`); usuwa aplikację, preferencje, cache, uprawnienia TCC. Bundle ID: `com.mmacierzanka.seconddisplay`. - `build.sh` – buduje i podpisuje (ad-hoc) `SecondDisplay.app`; uruchom `./build.sh`, potem `open SecondDisplay.app`. ## Konwencje diff --git a/Resources/uninstall.sh b/Resources/uninstall.sh new file mode 100755 index 0000000..4c155d9 --- /dev/null +++ b/Resources/uninstall.sh @@ -0,0 +1,16 @@ +#!/bin/zsh +# Removes Second Display and everything it leaves behind. Usage: run from inside the app bundle. +ID=com.mmacierzanka.seconddisplay +APP="${0:A:h:h:h}" +[[ "$APP" == *.app && "$(defaults read "$APP/Contents/Info" CFBundleIdentifier 2>/dev/null)" == "$ID" ]] || { echo "Not a Second Display bundle: $APP"; exit 1; } +read -q "?Delete $APP and all its data? [y/N] " || { echo; echo Cancelled; exit 0; } +echo +pkill -x SecondDisplay 2>/dev/null +defaults delete "$ID" 2>/dev/null +tccutil reset All "$ID" >/dev/null 2>&1 # camera / microphone permissions +L=~/Library +rm -rf "$L/Preferences/$ID.plist" "$L/Caches/$ID" "$L/HTTPStorages/$ID" "$L/Saved Application State/$ID.savedState" \ + "$L/Application Support/$ID" "$L/Containers/$ID" "$L/WebKit/$ID" "$L/Logs/$ID" +killall cfprefsd 2>/dev/null +echo "Removed. Deleting $APP" +rm -rf "$APP" diff --git a/build.sh b/build.sh index 230825b..baa5c56 100755 --- a/build.sh +++ b/build.sh @@ -11,7 +11,7 @@ cat > "$A/Contents/Info.plist" <

CFBundleDevelopmentRegionen CFBundleLocalizationsenpl CFBundleExecutableSecondDisplay -CFBundleIdentifierlocal.seconddisplay +CFBundleIdentifiercom.mmacierzanka.seconddisplay CFBundleIconFileAppIcon CFBundleIconNameAppIcon CFBundleNameSecond Display @@ -23,4 +23,5 @@ cat > "$A/Contents/Info.plist" <

/dev/null +cp Resources/uninstall.sh "$A/Contents/Resources/" codesign --force --sign - "$A"