@@ -24,6 +24,9 @@ APP_EXECUTABLE_PATH="${APP_BUNDLE_PATH}/Contents/MacOS"
24
24
INFO_PLIST_PATH=" ${APP_BUNDLE_PATH} /Contents/Info.plist"
25
25
RESOURCES_PATH=" ${APP_BUNDLE_PATH} /Contents/Resources"
26
26
27
+ # Entitlements file (if sandboxing is needed)
28
+ ENTITLEMENTS_FILE=" ${OUTPUT_DIR} /entitlements.plist"
29
+
27
30
# Zip paths
28
31
PRE_NOTARIZATION_ZIP=" ${OUTPUT_DIR} /${APP_NAME} -pre-notarization.zip"
29
32
FINAL_ZIP=" ${OUTPUT_DIR} /${APP_NAME} .zip"
@@ -58,8 +61,9 @@ mkdir -p "${RESOURCES_PATH}"
58
61
mv " ${UNIVERSAL_BINARY} " " ${APP_EXECUTABLE_PATH} /${APP_NAME} "
59
62
60
63
# ######################################
61
- # 4) Create Info.plist
64
+ # 4) Create Info.plist with Microphone Access
62
65
# ######################################
66
+ echo " ==> Creating Info.plist"
63
67
cat > " ${INFO_PLIST_PATH} " << EOL
64
68
<?xml version="1.0" encoding="UTF-8"?>
65
69
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
@@ -78,12 +82,32 @@ cat > "${INFO_PLIST_PATH}" <<EOL
78
82
<string>APPL</string>
79
83
<key>LSMinimumSystemVersion</key>
80
84
<string>10.12</string>
85
+ <key>NSMicrophoneUsageDescription</key>
86
+ <string>This app requires microphone access for audio input.</string>
81
87
</dict>
82
88
</plist>
83
89
EOL
84
90
85
91
# ######################################
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
87
111
# ######################################
88
112
echo " ==> Cloning preset repositories"
89
113
TEMP_DIR=" $( mktemp -d) "
@@ -103,14 +127,15 @@ popd >/dev/null
103
127
rm -rf " $TEMP_DIR "
104
128
105
129
# ######################################
106
- # 6 ) Sign the .app Bundle
130
+ # 7 ) Sign the .app Bundle with Entitlements
107
131
# ######################################
108
- echo " ==> Signing the .app with hardened runtime"
132
+ echo " ==> Signing the .app with hardened runtime and entitlements "
109
133
codesign --deep --verbose --force --options runtime \
134
+ --entitlements " ${ENTITLEMENTS_FILE} " \
110
135
--sign " ${DEVELOPER_ID} " " ${APP_BUNDLE_PATH} "
111
136
112
137
# ######################################
113
- # 7 ) Zip the Signed .app for Notarization
138
+ # 8 ) Zip the Signed .app for Notarization
114
139
# ######################################
115
140
echo " ==> Creating zip for notarization"
116
141
rm -f " ${PRE_NOTARIZATION_ZIP} "
@@ -119,7 +144,7 @@ ditto -c -k --sequesterRsrc --keepParent \
119
144
" ${PRE_NOTARIZATION_ZIP} "
120
145
121
146
# ######################################
122
- # 8 ) Submit the Zip File for Notarization
147
+ # 9 ) Submit the Zip File for Notarization
123
148
# ######################################
124
149
echo " ==> Submitting for notarization"
125
150
xcrun notarytool submit " ${PRE_NOTARIZATION_ZIP} " \
@@ -128,13 +153,13 @@ xcrun notarytool submit "${PRE_NOTARIZATION_ZIP}" \
128
153
--wait
129
154
130
155
# ######################################
131
- # 9 ) Staple the Now-Notarized .app
156
+ # 10 ) Staple the Now-Notarized .app
132
157
# ######################################
133
158
echo " ==> Stapling notarization ticket to .app"
134
159
xcrun stapler staple " ${APP_BUNDLE_PATH} "
135
160
136
161
# ######################################
137
- # 10 ) (Optional) Create Final Zip with Stapled .app
162
+ # 11 ) (Optional) Create Final Zip with Stapled .app
138
163
# ######################################
139
164
echo " ==> Creating final zip of stapled .app"
140
165
rm -f " ${FINAL_ZIP} "
@@ -143,9 +168,12 @@ ditto -c -k --sequesterRsrc --keepParent \
143
168
" ${FINAL_ZIP} "
144
169
145
170
# ######################################
146
- # 11 ) Verify with Gatekeeper
171
+ # 12 ) Verify with Gatekeeper
147
172
# ######################################
148
173
echo " ==> Verifying with spctl"
149
174
spctl --assess --verbose=4 " ${APP_BUNDLE_PATH} "
150
175
176
+ rm " ${PRE_NOTARIZATION_ZIP} "
177
+ rm " ${ENTITLEMENTS_FILE} "
178
+
151
179
echo " ✅ Build, sign, notarize, staple, and package completed successfully!"
0 commit comments