Skip to content

fix(macos): 仅在签名要求变化时重置 TCC 授权 - #1245

Open
DragonNameLeo wants to merge 1 commit into
Open-Less:betafrom
DragonNameLeo:fix/macos-tcc-reset-on-signing-change
Open

DragonNameLeo wants to merge 1 commit into
Open-Less:betafrom
DragonNameLeo:fix/macos-tcc-reset-on-signing-change

Conversation

@DragonNameLeo

Copy link
Copy Markdown

摘要

无对应 issue。

build-mac.sh 以 INSTALL=1 安装时每次都会 tccutil reset 辅助功能和麦克风授权。ad-hoc 签名的 designated requirement 绑定 cdhash,每次构建都会变化,所以重置是必要的;但使用固定签名证书(APPLE_SIGNING_IDENTITY)时 requirement 不变,授权本可以保留,现在却每次重装都要重新授权。

修复 / 新增 / 改进

  • 安装前比较 /Applications/OpenLess.app 与新构建产物的 codesign -d -r-,只有不一致(或取不到新的 requirement)时才重置授权
  • ad-hoc 构建:requirement 每次变化,仍然每次重置(行为不变)
  • 固定证书构建:requirement 不变则保留授权;首次安装或更换证书时照常重置

兼容

  • 不包含:其他脚本、CI、发布流程
  • 对现有用户 / 本地环境 / 构建流程的影响:只影响本地 INSTALL=1 的安装步骤

测试计划

  • 命令:bash -n openless-all/app/scripts/build-mac.sh
  • 结果:通过
  • 命令:同样的判断逻辑用于本地并存构建的安装脚本,在 macOS 上用固定的自签名证书重新构建并覆盖安装
  • 结果:新旧产物的 designated requirement 一致,未执行 tccutil reset,原有授权得以保留
  • 证据路径:无(本地手动验证)

备注:prettier --check scripts/build-mac.sh 在 beta 上本来就有一处与本 PR 无关的格式提示(第 110 行),本 PR 未改动。

🤖 Generated with Claude Code

https://claude.ai/code/session_01Abbfv5hvANpC7Sku5KEXJ3

Ad-hoc builds still reset Accessibility / Microphone on every install, since
their cdhash-based requirement changes each build. A stable signing identity
keeps the same designated requirement, so its grants now survive reinstalls.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YJvDYNu6QoSEhJ4yGSuRqk
@H-Chris233 H-Chris233 added area:ux UX area bug Something isn't working needs-review Needs review P2 Medium priority platform:macos macOS-specific labels Oct 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ux UX area bug Something isn't working needs-review Needs review P2 Medium priority platform:macos macOS-specific

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants