Skip to content

fix(updates): enable macOS self-update by dropping the App Sandbox#97

Merged
krazyjakee merged 1 commit into
masterfrom
fix/macos-self-update-sandbox
Jun 9, 2026
Merged

fix(updates): enable macOS self-update by dropping the App Sandbox#97
krazyjakee merged 1 commit into
masterfrom
fix/macos-self-update-sandbox

Conversation

@krazyjakee

Copy link
Copy Markdown
Contributor

What

Makes the in-place self-updater actually work on macOS by removing the App Sandbox from the macOS build, and adds the camera/mic usage strings that become required once the sandbox is gone.

Why

On macOS, "Download & install" downloaded and verified the DMG, then silently did nothing — no swap, no relaunch. The updater code was fully wired (installer, .dmg asset matching, release DMG all present), but the app was built sandboxed.

A sandboxed app fundamentally can't do what _installMacOs needs:

  • spawn hdiutil / bash / chmod / open via Process (arbitrary exec is denied), nor
  • write outside its container — so swapping /Applications/Daccord.app is denied.

So the apply step died at hdiutil attach; Windows/Linux work because those builds aren't sandboxed. The sandbox is only required for Mac App Store distribution — this app ships as a DMG via GitHub Releases, so dropping it is the right call (the same posture Sparkle-based self-updating Mac apps take).

Changes

  • Release.entitlements / DebugProfile.entitlements — remove com.apple.security.app-sandbox. Debug too, so the updater can be exercised in local builds.
  • Info.plist — add NSCameraUsageDescription + NSMicrophoneUsageDescription. With the sandbox off, camera/mic are governed by TCC instead of the device.* entitlements; without these strings the app would crash on device access, breaking voice/video (a hard project requirement).
  • project.pbxproj — flip the Xcode com.apple.Sandbox capability flag to 0 so the UI stays in sync and won't silently re-add the entitlement.

Reviewer notes

  • Verified statically: plutil -lint passes on all three plists; the app-sandbox key is gone from both entitlement files; both usage strings are present; no other sandbox injection exists in the macos tree/Podfile; the Release config's CODE_SIGN_ENTITLEMENTS points at the edited Release.entitlements. Since CI builds unsigned, codesign embeds that file verbatim, so the produced bundle will not be sandboxed.
  • Not verifiable locally: the build couldn't run on the dev machine (macOS 13 < the Flutter beta's required macOS 14). Two things to confirm on the CI macos-15 runner or a macOS 14+ Mac:
    1. codesign -d --entitlements - build/macos/Build/Products/Release/Daccord.app shows no app-sandbox and the usage strings.
    2. The actual swap (needs two releases — update from a build carrying this fix to a newer one).
  • Rollout: takes effect from the next tagged release forward. The shipped v0.2.1 DMG is still sandboxed and can't self-apply regardless.

🤖 Generated with Claude Code

The in-place self-updater never applied on macOS: "Download & install"
downloaded and verified the DMG, then silently did nothing. Root cause is
the App Sandbox — a sandboxed app can't spawn the swap helper
(hdiutil/bash/chmod/open) via Process, nor write over
/Applications/Daccord.app, so _installMacOs died at hdiutil attach while
Windows/Linux (unsandboxed) worked.

The sandbox is only required for Mac App Store distribution; this app ships
as a DMG via GitHub Releases, so drop it (the same posture Sparkle-based
self-updating Mac apps use):

- Remove com.apple.security.app-sandbox from Release + Debug entitlements
  (Debug too, so the updater is exercisable in local builds).
- Add NSCameraUsageDescription / NSMicrophoneUsageDescription to Info.plist.
  With the sandbox off, camera/mic are governed by TCC instead of the
  device.* entitlements; without these strings the app would crash on
  device access, breaking voice/video.
- Flip the Xcode com.apple.Sandbox capability flag to 0 so the UI stays in
  sync and won't re-add the entitlement.

Takes effect from the next tagged release forward; the shipped v0.2.1 DMG
is still sandboxed and can't self-apply.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@krazyjakee krazyjakee merged commit 5763e29 into master Jun 9, 2026
1 check passed
@krazyjakee krazyjakee deleted the fix/macos-self-update-sandbox branch June 9, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant