diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index d8712a43..13fe7bdf 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -271,6 +271,12 @@ jobs:
echo "::error::CFBundleName is '${NAME}', expected 'Offband MeshCore' (#1140)."
exit 1
fi
+ codesign -d --entitlements - --xml "${APP}" > "${RUNNER_TEMP}/entitlements.plist"
+ SAVE="$(/usr/libexec/PlistBuddy -c 'Print :com.apple.security.files.user-selected.read-write' "${RUNNER_TEMP}/entitlements.plist" || true)"
+ if [ "${SAVE}" != "true" ]; then
+ echo "::error::App lacks files.user-selected.read-write; the sandbox will refuse the Save dialog (#1143)."
+ exit 1
+ fi
lipo -archs "${APP}/Contents/MacOS/Offband MeshCore" || true
ditto -c -k --keepParent "${APP}" offband-macos.zip
- name: Upload macOS build
diff --git a/.github/workflows/macos-signed.yml b/.github/workflows/macos-signed.yml
index 2c6e34e3..2e95393f 100644
--- a/.github/workflows/macos-signed.yml
+++ b/.github/workflows/macos-signed.yml
@@ -137,6 +137,12 @@ jobs:
done < <(find "${APP}/Contents/Frameworks" -depth -name '*.framework' -type d -print0)
"${SIGN[@]}" --entitlements macos/Runner/Release.entitlements "${APP}"
codesign --verify --deep --strict --verbose=2 "${APP}"
+ codesign -d --entitlements - --xml "${APP}" > "${RUNNER_TEMP}/entitlements.plist"
+ SAVE="$(/usr/libexec/PlistBuddy -c 'Print :com.apple.security.files.user-selected.read-write' "${RUNNER_TEMP}/entitlements.plist" || true)"
+ if [ "${SAVE}" != "true" ]; then
+ echo "::error::Signed app lacks files.user-selected.read-write; the sandbox will refuse the Save dialog (#1143)."
+ exit 1
+ fi
lipo -archs "${APP}/Contents/MacOS/Offband MeshCore"
# ditto, not zip: it preserves the .app bundle's symlinks (#1108). The
diff --git a/macos/Runner/DebugProfile.entitlements b/macos/Runner/DebugProfile.entitlements
index 2fcad1b4..f9e0ad11 100644
--- a/macos/Runner/DebugProfile.entitlements
+++ b/macos/Runner/DebugProfile.entitlements
@@ -22,5 +22,7 @@
com.apple.security.device.camera
+ com.apple.security.files.user-selected.read-write
+
diff --git a/macos/Runner/Release.entitlements b/macos/Runner/Release.entitlements
index 2b1c6948..73d0c856 100644
--- a/macos/Runner/Release.entitlements
+++ b/macos/Runner/Release.entitlements
@@ -18,5 +18,7 @@
com.apple.security.device.camera
+ com.apple.security.files.user-selected.read-write
+