Skip to content

Fix macOS 15 'access data from other apps' prompt from the FDA check; show the menu in every folder - #126

Merged
wflixu merged 2 commits into
wflixu:mainfrom
shoal-rat:fix/tcc-prompt-and-whole-disk
Jul 10, 2026
Merged

Fix macOS 15 'access data from other apps' prompt from the FDA check; show the menu in every folder#126
wflixu merged 2 commits into
wflixu:mainfrom
shoal-rat:fix/tcc-prompt-and-whole-disk

Conversation

@shoal-rat

Copy link
Copy Markdown
Contributor

Two small, independent fixes (one commit each). 中文摘要在最后。

1. PermissionChecker: stop probing Mail/Messages/Safari

PermissionChecker.hasFullDiskAccess() reads ~/Library/Mail, ~/Library/Messages and ~/Library/Safari. On macOS 15+ each of those reads goes through the TCC App Data class, so the "RClick" would like to access data from other apps dialog appears at app launch — and reappears on later launches, because answers for that consent class are not persisted reliably.

This PR probes ~/Library/Application Support/com.apple.TCC instead. That directory is protected by Full Disk Access itself (kTCCServiceSystemPolicyAllFiles), which macOS denies silently — so the check keeps its accuracy with zero prompts. The POSIX access() fast path is removed because the probe directory is owner-readable at the POSIX level, which would have reported FDA as granted when it is not.

2. FinderSyncExt: observe / so the menu appears everywhere

setupObservingDirectories() currently observes /Users/ plus external volumes, so any folder elsewhere on the system volume (/Applications, /opt, /tmp, …) silently shows the plain Finder menu — even though the method's own comment says 全盘监听. Observing / covers everything, including volumes mounted under /Volumes. (FileProvider-backed locations such as iCloud Drive remain excluded by macOS for all FinderSync extensions.)

Testing

Verified on an Apple-silicon Mac running macOS 15+: with the extension rebuilt from this branch, the context menu renders in /Applications and other system-volume folders, and no App Data prompt appears at launch or after Finder restarts.

Related note (not part of this PR)

The extension itself can also trigger the same App Data prompt on every fresh extension process, because it reads UserDefaults(suiteName: "group.cn.wflixu.RClick") at first menu build and macOS 15 expects app-group ids to be team-ID-prefixed on macOS. Renaming the group to 4L3563XCBN.cn.wflixu.RClick (entitlements + Constants.suitName + AppLocalization/StringExtension/ModelContainer) would remove that prompt too, but it needs a data-migration decision for existing users' SwiftData store, so it is left out of this PR.


中文摘要:

  1. PermissionChecker 不再探测 Mail/Messages/Safari(这在 macOS 15 上每次启动都会触发"访问其他 App 数据"弹窗),改为探测 TCC 数据库目录——它受完全磁盘访问保护、被系统静默拒绝,检测依然准确但零弹窗。
  2. FinderSync 扩展改为监听 /,使 /Applications/opt 等系统卷目录也显示右键菜单(与注释"全盘监听"一致)。
  3. 另注:扩展读取非 Team-ID 前缀的 App Group 也会触发同类弹窗,建议将 group id 改为 4L3563XCBN.cn.wflixu.RClick(涉及数据迁移,未包含在本 PR 中)。

🤖 Generated with Claude Code

shoal-rat and others added 2 commits July 6, 2026 18:32
Reading ~/Library/Mail, ~/Library/Messages and ~/Library/Safari fires the
macOS 15 TCC "App Data" consent ("RClick" would like to access data from
other apps) on every app launch. Probe the user TCC store instead: it is
gated by Full Disk Access itself (kTCCServiceSystemPolicyAllFiles), which
macOS denies silently, so the check stays accurate without ever prompting.

Also drop the POSIX access() fast path: the probe directory is owned by
the current user, so access(R_OK) succeeds on POSIX permissions alone and
would report FDA as granted when it is not.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The observed set (/Users/ plus external volumes) left everything else on
the system volume - /Applications, /opt, /tmp, ... - without the RClick
context menu, although the method comment says whole-disk observation.
Observing the root covers all of it, including external and network
volumes mounted under /Volumes. FileProvider-backed locations (iCloud
Drive, synced Desktop & Documents) remain excluded by macOS itself.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wflixu
wflixu merged commit 66e3884 into wflixu:main Jul 10, 2026
1 check passed
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.

2 participants