@@ -24,6 +24,9 @@ APP_EXECUTABLE_PATH="${APP_BUNDLE_PATH}/Contents/MacOS"
2424INFO_PLIST_PATH=" ${APP_BUNDLE_PATH} /Contents/Info.plist"
2525RESOURCES_PATH=" ${APP_BUNDLE_PATH} /Contents/Resources"
2626
27+ # Entitlements file (if sandboxing is needed)
28+ ENTITLEMENTS_FILE=" ${OUTPUT_DIR} /entitlements.plist"
29+
2730# Zip paths
2831PRE_NOTARIZATION_ZIP=" ${OUTPUT_DIR} /${APP_NAME} -pre-notarization.zip"
2932FINAL_ZIP=" ${OUTPUT_DIR} /${APP_NAME} .zip"
@@ -58,8 +61,9 @@ mkdir -p "${RESOURCES_PATH}"
5861mv " ${UNIVERSAL_BINARY} " " ${APP_EXECUTABLE_PATH} /${APP_NAME} "
5962
6063# ######################################
61- # 4) Create Info.plist
64+ # 4) Create Info.plist with Microphone Access
6265# ######################################
66+ echo " ==> Creating Info.plist"
6367cat > " ${INFO_PLIST_PATH} " << EOL
6468<?xml version="1.0" encoding="UTF-8"?>
6569<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
@@ -78,12 +82,32 @@ cat > "${INFO_PLIST_PATH}" <<EOL
7882 <string>APPL</string>
7983 <key>LSMinimumSystemVersion</key>
8084 <string>10.12</string>
85+ <key>NSMicrophoneUsageDescription</key>
86+ <string>This app requires microphone access for audio input.</string>
8187</dict>
8288</plist>
8389EOL
8490
8591# ######################################
86- # 5) Clone and Copy Presets/Textures
92+ # 5) (Optional) Create Entitlements File for Sandboxing
93+ # ######################################
94+ echo " ==> Creating entitlements file for sandboxing (optional)"
95+ cat > " ${ENTITLEMENTS_FILE} " << EOL
96+ <?xml version="1.0" encoding="UTF-8"?>
97+ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
98+ "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
99+ <plist version="1.0">
100+ <dict>
101+ <key>com.apple.security.app-sandbox</key>
102+ <true/>
103+ <key>com.apple.security.device.audio-input</key>
104+ <true/>
105+ </dict>
106+ </plist>
107+ EOL
108+
109+ # ######################################
110+ # 6) Clone and Copy Presets/Textures
87111# ######################################
88112echo " ==> Cloning preset repositories"
89113TEMP_DIR=" $( mktemp -d) "
@@ -103,14 +127,15 @@ popd >/dev/null
103127rm -rf " $TEMP_DIR "
104128
105129# ######################################
106- # 6 ) Sign the .app Bundle
130+ # 7 ) Sign the .app Bundle with Entitlements
107131# ######################################
108- echo " ==> Signing the .app with hardened runtime"
132+ echo " ==> Signing the .app with hardened runtime and entitlements "
109133codesign --deep --verbose --force --options runtime \
134+ --entitlements " ${ENTITLEMENTS_FILE} " \
110135 --sign " ${DEVELOPER_ID} " " ${APP_BUNDLE_PATH} "
111136
112137# ######################################
113- # 7 ) Zip the Signed .app for Notarization
138+ # 8 ) Zip the Signed .app for Notarization
114139# ######################################
115140echo " ==> Creating zip for notarization"
116141rm -f " ${PRE_NOTARIZATION_ZIP} "
@@ -119,7 +144,7 @@ ditto -c -k --sequesterRsrc --keepParent \
119144 " ${PRE_NOTARIZATION_ZIP} "
120145
121146# ######################################
122- # 8 ) Submit the Zip File for Notarization
147+ # 9 ) Submit the Zip File for Notarization
123148# ######################################
124149echo " ==> Submitting for notarization"
125150xcrun notarytool submit " ${PRE_NOTARIZATION_ZIP} " \
@@ -128,13 +153,13 @@ xcrun notarytool submit "${PRE_NOTARIZATION_ZIP}" \
128153 --wait
129154
130155# ######################################
131- # 9 ) Staple the Now-Notarized .app
156+ # 10 ) Staple the Now-Notarized .app
132157# ######################################
133158echo " ==> Stapling notarization ticket to .app"
134159xcrun stapler staple " ${APP_BUNDLE_PATH} "
135160
136161# ######################################
137- # 10 ) (Optional) Create Final Zip with Stapled .app
162+ # 11 ) (Optional) Create Final Zip with Stapled .app
138163# ######################################
139164echo " ==> Creating final zip of stapled .app"
140165rm -f " ${FINAL_ZIP} "
@@ -143,9 +168,12 @@ ditto -c -k --sequesterRsrc --keepParent \
143168 " ${FINAL_ZIP} "
144169
145170# ######################################
146- # 11 ) Verify with Gatekeeper
171+ # 12 ) Verify with Gatekeeper
147172# ######################################
148173echo " ==> Verifying with spctl"
149174spctl --assess --verbose=4 " ${APP_BUNDLE_PATH} "
150175
176+ rm " ${PRE_NOTARIZATION_ZIP} "
177+ rm " ${ENTITLEMENTS_FILE} "
178+
151179echo " ✅ Build, sign, notarize, staple, and package completed successfully!"
0 commit comments