Fix macOS TCC permissions for apps launched from integrated terminal#441
Fix macOS TCC permissions for apps launched from integrated terminal#441mikaelweiss wants to merge 1 commit into
Conversation
Re-sign the patched Electron dev bundle with an ad-hoc signature so macOS TCC can bind the Info.plist and show privacy permission prompts (microphone, camera, etc.) for child processes. For production builds, ad-hoc sign unsigned Mac builds (identity: "-", hardenedRuntime: false) and inject NSMicrophoneUsageDescription and NSCameraUsageDescription via extendInfo. Signed/notarized builds use entitlements with hardened runtime instead.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Oh, I guess I should explain the issue. I have a TTS and STT electron app that uses the microphone and other permissions When I run I open the dir for that worktree and run it in Ghostty and it works just fine. This is a fix for that. |
| <key>com.apple.security.device.audio-input</key> | ||
| <true/> | ||
| </dict> |
There was a problem hiding this comment.
🔴 Critical resources/entitlements.mac.plist:9
The entitlements file includes com.apple.security.device.audio-input for microphone access but is missing com.apple.security.device.camera, so camera access will be silently denied on signed builds with hardened runtime enabled despite the NSCameraUsageDescription being present in Info.plist. Consider adding the camera entitlement to match the intended TCC permissions fix.
<key>com.apple.security.device.audio-input</key>
<true/>
+ <key>com.apple.security.device.camera</key>
+ <true/>
</dict>🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file apps/desktop/resources/entitlements.mac.plist around lines 9-11:
The entitlements file includes `com.apple.security.device.audio-input` for microphone access but is missing `com.apple.security.device.camera`, so camera access will be silently denied on signed builds with hardened runtime enabled despite the `NSCameraUsageDescription` being present in Info.plist. Consider adding the camera entitlement to match the intended TCC permissions fix.
|
Was this fixed? |
|
I just saw that "Contributing" documentation was added. My assumption is that this issue was auto closed without being looked at. Since this makes the app really difficult for me to use for my specific projects, I'll be opening an issue so that hopefully it's looked at. |
Re-sign the patched Electron dev bundle with an ad-hoc signature so macOS TCC can bind the Info.plist and show privacy permission prompts (microphone, camera, etc.) for child processes.
For production builds, ad-hoc sign unsigned Mac builds (identity: "-", hardenedRuntime: false) and inject NSMicrophoneUsageDescription and NSCameraUsageDescription via extendInfo. Signed/notarized builds use entitlements with hardened runtime instead.
Note: I wasn't able to test with production build signing. I don't have that all set up yet, so I'm just trusting that Claude did the prod build signing correctly. I did test the dev build
bun run dist:desktop:dmg:arm64and it worked.Note
Add macOS TCC permissions for terminal-launched apps by introducing hardened runtime entitlements and ad‑hoc re‑signing in electron-launcher.mjs
Add an entitlements plist with JIT, unsigned executable memory, and microphone access; ad‑hoc re‑sign the mac app bundle during launcher build; include mac privacy usage descriptions and adjust mac signing config for signed vs. unsigned builds.
📍Where to Start
Start with
buildMacLauncherandresignAppBundlein electron-launcher.mjs.📊 Macroscope summarized dc66007. 3 files reviewed, 2 issues evaluated, 1 issue filtered, 1 comment posted
🗂️ Filtered Issues
apps/desktop/scripts/electron-launcher.mjs — 0 comments posted, 1 evaluated, 1 filtered
resignAppBundlestep was added. The metadata check compareslauncherVersion, butLAUNCHER_VERSIONat line 22 was not incremented as part of this change. Users with existing cached bundles will have invalid code signatures since the previous builds modified plist files without re-signing, and this change won't fix their cached copies. [ Out of scope ]