Skip to content

Commit 6af98d8

Browse files
committed
microphone entitlements
1 parent 1ec044b commit 6af98d8

File tree

1 file changed

+37
-9
lines changed

1 file changed

+37
-9
lines changed

rel.sh

+37-9
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ APP_EXECUTABLE_PATH="${APP_BUNDLE_PATH}/Contents/MacOS"
2424
INFO_PLIST_PATH="${APP_BUNDLE_PATH}/Contents/Info.plist"
2525
RESOURCES_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
2831
PRE_NOTARIZATION_ZIP="${OUTPUT_DIR}/${APP_NAME}-pre-notarization.zip"
2932
FINAL_ZIP="${OUTPUT_DIR}/${APP_NAME}.zip"
@@ -58,8 +61,9 @@ mkdir -p "${RESOURCES_PATH}"
5861
mv "${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"
6367
cat > "${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>
8389
EOL
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
#######################################
88112
echo "==> Cloning preset repositories"
89113
TEMP_DIR="$(mktemp -d)"
@@ -103,14 +127,15 @@ popd >/dev/null
103127
rm -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"
109133
codesign --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
#######################################
115140
echo "==> Creating zip for notarization"
116141
rm -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
#######################################
124149
echo "==> Submitting for notarization"
125150
xcrun 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
#######################################
133158
echo "==> Stapling notarization ticket to .app"
134159
xcrun 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
#######################################
139164
echo "==> Creating final zip of stapled .app"
140165
rm -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
#######################################
148173
echo "==> Verifying with spctl"
149174
spctl --assess --verbose=4 "${APP_BUNDLE_PATH}"
150175

176+
rm "${PRE_NOTARIZATION_ZIP}"
177+
rm "${ENTITLEMENTS_FILE}"
178+
151179
echo "✅ Build, sign, notarize, staple, and package completed successfully!"

0 commit comments

Comments
 (0)