| File was renamed from VoiceSnapGo/scripts/build-local-macos.sh |
| | |
| | | #!/usr/bin/env bash |
| | | # |
| | | # build-local-macos.sh - Build a locally signed macOS app and DMG for VoiceSnap. |
| | | # build-local-macos.sh - Build a locally signed macOS app and DMG for PrivateVoice Input. |
| | | # |
| | | # This script intentionally does not notarize. It creates or reuses a stable |
| | | # local Code Signing identity so macOS TCC permissions, such as Accessibility, |
| | |
| | | # |
| | | set -euo pipefail |
| | | |
| | | APP_NAME="VoiceSnap" |
| | | LOCAL_IDENTITY="${VOICESNAP_LOCAL_SIGN_IDENTITY:-VoiceSnap Local Code Signing}" |
| | | KEYCHAIN="${VOICESNAP_LOCAL_KEYCHAIN:-$HOME/Library/Keychains/login.keychain-db}" |
| | | APP_NAME="PrivateVoice Input" |
| | | DEFAULT_LOCAL_IDENTITY="PrivateVoice Local Code Signing" |
| | | LEGACY_LOCAL_IDENTITY="VoiceSnap Local Code Signing" |
| | | LOCAL_IDENTITY="${PRIVATEVOICE_LOCAL_SIGN_IDENTITY:-${VOICESNAP_LOCAL_SIGN_IDENTITY:-}}" |
| | | KEYCHAIN="${PRIVATEVOICE_LOCAL_KEYCHAIN:-${VOICESNAP_LOCAL_KEYCHAIN:-$HOME/Library/Keychains/login.keychain-db}}" |
| | | |
| | | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" |
| | | PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" |
| | |
| | | SHERPA_LIB_DIR="$GOMODCACHE/github.com/k2-fsa/sherpa-onnx-go-macos@v1.12.24/lib/$SHERPA_ARCH" |
| | | |
| | | ensure_local_identity() { |
| | | if [[ -z "$LOCAL_IDENTITY" ]]; then |
| | | if security find-identity -v -p codesigning "$KEYCHAIN" | grep -Fq "$DEFAULT_LOCAL_IDENTITY"; then |
| | | LOCAL_IDENTITY="$DEFAULT_LOCAL_IDENTITY" |
| | | elif security find-identity -v -p codesigning "$KEYCHAIN" | grep -Fq "$LEGACY_LOCAL_IDENTITY"; then |
| | | LOCAL_IDENTITY="$LEGACY_LOCAL_IDENTITY" |
| | | else |
| | | LOCAL_IDENTITY="$DEFAULT_LOCAL_IDENTITY" |
| | | fi |
| | | fi |
| | | |
| | | if security find-identity -v -p codesigning "$KEYCHAIN" | grep -Fq "$LOCAL_IDENTITY"; then |
| | | echo "Using existing local signing identity: $LOCAL_IDENTITY" |
| | | return |
| | |
| | | |
| | | [dn] |
| | | CN = $LOCAL_IDENTITY |
| | | O = VoiceSnap Local |
| | | O = PrivateVoice Local |
| | | |
| | | [v3_codesign] |
| | | basicConstraints = critical, CA:true |