Allow MenuBarItemService XPC connection on builds without a Team Identifier#953
Open
djmango wants to merge 1 commit into
Open
Allow MenuBarItemService XPC connection on builds without a Team Identifier#953djmango wants to merge 1 commit into
djmango wants to merge 1 commit into
Conversation
…tifier The macOS 26 MenuBarItemService uses an `isFromSameTeam` requirement on both the XPC listener and client session. Ad-hoc / locally signed builds have no Team Identifier, so this requirement can never be satisfied, causing the XPC session to fail (XPCRichError Code=1). Without it, source PIDs never resolve and the menu bar item list stays empty. Gate the requirement on whether the process actually has a Team Identifier (via a new `CodeSigning` helper). Properly signed builds keep the same-team requirement; ad-hoc/local builds fall back to an unrestricted connection so they work for local development.
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.
Summary
On the
macos-26branch, the newMenuBarItemServiceenforces anisFromSameTeamrequirement on both sides of the XPC link:XPCListener(service: name, requirement: .isFromSameTeam())(MenuBarItemService/Listener.swift)session.setPeerRequirement(.isFromSameTeam())(Ice/MenuBar/MenuBarItems/MenuBarItemServiceConnection.swift)Ad-hoc / locally-signed builds have no Team Identifier, so this requirement can never be satisfied. The XPC session is rejected at activation:
Because source PIDs are never resolved on macOS 26 (item windows are owned by Control Center, so the source app is found via the XPC service), the menu bar item list stays empty and the UI is stuck on "Loading menu bar items…" indefinitely. This makes the branch unusable for anyone building locally without a Developer Team.
Changes
Shared/Utilities/CodeSigning.swift, exposingCodeSigning.teamIdentifier/hasTeamIdentifierviaSecCodeCopySigningInformation.isFromSameTeamrequirement on whether the running process actually has a Team Identifier:No-op for release builds; only relaxes the requirement when there is no team to enforce it against.
Related
This is the same class of issue as #744 / #891, and overlaps with #950 and one commit of #903 (all three independently added a team-identifier guard). Happy to consolidate toward whichever approach you prefer.
Test plan