From 8cd205ee7e12a2b46d6beff6e5a6434c4862af24 Mon Sep 17 00:00:00 2001
From: Ariver <shanghai3168@gmail.com>
Date: Fri, 05 Jun 2026 02:38:06 +0800
Subject: [PATCH] Strip quarantine attributes from App Store package
---
privatevoice.src/app.go | 2 +-
privatevoice.src/scripts/build-macappstore-pkg-macos.sh | 25 +++++++++++++++++++++++++
privatevoice.src/build/darwin/Info.plist | 2 +-
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/privatevoice.src/app.go b/privatevoice.src/app.go
index 05a781a..030bea4 100755
--- a/privatevoice.src/app.go
+++ b/privatevoice.src/app.go
@@ -28,7 +28,7 @@
const (
appVersion = "2.1.28"
- appBuild = "20260605.0216"
+ appBuild = "20260605.0236"
appDisplayVersion = appVersion + " (build " + appBuild + ")"
appName = "PrivateVoice Dictation"
diff --git a/privatevoice.src/build/darwin/Info.plist b/privatevoice.src/build/darwin/Info.plist
index cb55672..f062020 100755
--- a/privatevoice.src/build/darwin/Info.plist
+++ b/privatevoice.src/build/darwin/Info.plist
@@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>2.1.28</string>
<key>CFBundleVersion</key>
- <string>20260605.0216</string>
+ <string>20260605.0236</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.productivity</string>
<key>LSMinimumSystemVersion</key>
diff --git a/privatevoice.src/scripts/build-macappstore-pkg-macos.sh b/privatevoice.src/scripts/build-macappstore-pkg-macos.sh
index 888f559..cfa9cd5 100755
--- a/privatevoice.src/scripts/build-macappstore-pkg-macos.sh
+++ b/privatevoice.src/scripts/build-macappstore-pkg-macos.sh
@@ -129,6 +129,23 @@
/usr/libexec/PlistBuddy -c "Add :$key string $value" "$plist"
}
+strip_extended_attributes() {
+ local item="$1"
+ if command -v xattr >/dev/null; then
+ xattr -cr "$item" 2>/dev/null || true
+ fi
+}
+
+assert_no_quarantine_attributes() {
+ local item="$1"
+ if command -v xattr >/dev/null; then
+ local found
+ found="$(xattr -lr "$item" 2>/dev/null | grep -F "com.apple.quarantine" | head -n 20 || true)"
+ [[ -z "$found" ]] || fail "com.apple.quarantine attributes remain under $item:
+$found"
+ fi
+}
+
TARGET_ARCH="${1:-$(uname -m)}"
resolve_arch "$TARGET_ARCH"
@@ -210,6 +227,10 @@
cp "$SHERPA_LIB_DIR/libsherpa-onnx-c-api.dylib" "$APP_BUNDLE/Contents/Frameworks/"
cp "$ONNXRUNTIME_DYLIB" "$APP_BUNDLE/Contents/Frameworks/"
+step "Removing extended attributes from app bundle"
+strip_extended_attributes "$APP_BUNDLE"
+assert_no_quarantine_attributes "$APP_BUNDLE"
+
step "Fixing rpaths"
install_name_tool -add_rpath @executable_path/../Frameworks \
"$APP_BUNDLE/Contents/MacOS/$APP_NAME" 2>/dev/null || true
@@ -224,6 +245,10 @@
sign_sandboxed "$APP_BUNDLE/Contents/MacOS/$APP_NAME"
sign_sandboxed "$APP_BUNDLE"
+step "Removing extended attributes after signing"
+strip_extended_attributes "$APP_BUNDLE"
+assert_no_quarantine_attributes "$APP_BUNDLE"
+
step "Verifying app signature and entitlements"
codesign -vvv --deep --strict "$APP_BUNDLE"
codesign -d --entitlements :- "$APP_BUNDLE"
--
Gitblit v1.9.3