Repository navigation
fix(desktop): add macOS microphone entitlement for signed builds - #99
Open
JianP-Ciallo wants to merge 1 commit into
Open
JianP-Ciallo wants to merge 1 commit into
JianP-Ciallo wants to merge 1 commit into
Conversation
electron-builder signs macOS builds with the hardened runtime by default and, without build/entitlements.mac.plist, gives the app bundle only com.apple.security.cs.allow-jit. Under the hardened runtime the app then cannot read microphone input, so the Copilot "自己" channel stays silent in Developer ID signed releases even after the user grants permission. Add build/entitlements.mac.plist (auto-detected via buildResources) with allow-jit, preserving the current default, plus device.audio-input.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
macOS 正式签名版里,Copilot 的"自己"(麦克风)一路可能始终没有声音,即使用户已经在系统设置里允许了麦克风。
electron-builder 默认给 macOS 构建开启 hardened runtime;仓库里没有
build/entitlements.mac.plist时,app bundle 只拿到com.apple.security.cs.allow-jit(见 electron-builder macOS 文档 的默认 entitlements 表)。hardened runtime 下缺少com.apple.security.device.audio-input时,应用无法读取麦克风输入(Apple Configuring the hardened runtime / Electron 代码签名文档)。electron-builder.yml里已经有NSMicrophoneUsageDescription,但那是 Info.plist 的权限说明,不能代替签名 entitlement。改动
新增
apps/desktop/build/entitlements.mac.plist(buildResources: build下 electron-builder 会自动识别):com.apple.security.cs.allow-jit(该文件会替换默认值,而不是合并)com.apple.security.device.audio-input不改 helper 的 entitlements,也不影响 Windows/Linux 构建。
验证
plistlib解析通过,内容只有上述两项。MAC_CSC_LINK等签名 secrets 的 Developer ID 签名包会触发这个问题;当前未签名包可能不受影响。建议有签名环境时用codesign -d --entitlements - TechSpar.app确认,并实测 Copilot 麦克风电平。