feat: Plan A — Gatekeeper defense hardening + user guidance (#198) - #199
Merged
Conversation
- update_manager: ditto --noqtn prevents quarantine propagation in auto-update - update_manager: xattr -dr before open -n clears any residual quarantine - deploy.sh: produce macOS ZIP alongside DMG - release.yml: add macOS ZIP artifact + release body warning note - README.md: friendly step-by-step first-launch guide for macOS & Windows - Closes t-20260630065614045136-37761-0 Co-authored-by: DeepSeek <noreply@deepseek.com>
pyproject.toml was bumped to 0.1.1 in a prior release cycle but this test was not updated. CI-only failure (Linux), unrelated to #198 changes. Co-authored-by: DeepSeek <noreply@deepseek.com>
Owner
Author
|
VERIFIED Evidence
[Stage 1 - correctness]
|
Owner
Author
Review Verdict: ✅ VERIFIEDReview Scope
Stage 1 — Correctness ✅
發現:
|
| 檢查項 | 結果 |
|---|---|
ditto --noqtn + xattr -dr 雙層 |
✅ 互補設計,單層失效仍有備援 |
try/except pass 最佳努力 |
✅ 正確,不因 quarantine 清除失敗阻塞更新 |
ditto -c -k --sequesterRsrc ZIP 參數 |
✅ macOS 標準 ZIP 參數 |
append_body: true + generate_release_notes: true 相容性 |
✅ action v3 兩者皆支援,無衝突 |
| Release body 含跨語系連結 | ✅ 中文 README 段落正確引用 |
| CI 通過 | ✅ Lint & Test 綠燈 |
Evidence
ran: rg '^(<<<<<<<)' -g '!*.md' -g '!docs/**'→ no output ✅ran: gh pr checks 199 --repo cheerc/simple-edge-tts → Lint & Test: SUCCESS✅ran: echo "解碼 anchor" && python3 -c "from urllib.parse import unquote; print(unquote('%E2%9A%A0%EF%B8%8F-%E9%A6%96%E6%AC%A1%E5%9F%B7%E8%A1%8C%E5%AE%89%E5%85%A8%E6%80%A7%E8%AA%AA%E6%98%8E'))"→⚠️-首次執行安全性說明(old heading) ✅cited: git show main:README.md | grep "首次"→⚠️ 首次執行安全性說明(old)cited: .github/workflows/release.ymlline anchor →#⚠️-首次執行安全性說明(old, mismatched)cited: README.md→## ⚠️ 首次開啟說明(new)
注意:僅靜態審查 D1 depth,未跑 runtime(CI 已驗證建置流程)。
This was referenced Jun 30, 2026
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.
What
執行方案 A(零成本防禦性加固 + 使用者引導):
How
Code
src/update_manager.py:ditto加--noqtnflag(防止 quarantine 從 DMG 傳播到新 .app);_macos_restart()中open -n前用xattr -dr清除殘餘 quarantine(雙重保險)deploy.sh: DMG 建立後額外產出simple-edge-tts-macos.zip(ZIP quarantine 行為比 DMG 更可預測).github/workflows/release.yml: CI 新增 macOS ZIP 步驟 + 上傳 + Release body 提示連結 READMEDocs
README.md: 改寫「首次開啟說明」章節 — 解釋為什麼會看到提示、方法一右鍵開啟、方法二終端機指令(含如何開 Terminal)、Windows SmartScreen 步驟Scope
follows spec — 僅方案 A 範圍(無 codesign/notarization/Apple Developer)。
Lessons
ditto --qtn自 macOS 10.5 起為預設值,這是 research task [research] macOS Gatekeeper「已損毀」+ Windows SmartScreen 首次下載封鎖問題 — 調研與方案 #197 發現的核心風險 — auto-update 原本靠 urllib 不下 quarantine 僥倖正常,加上--noqtn後成為顯式防禦TestMacOSCopyInPlace測試用@patch("subprocess.run")全 mock,因此 ditto arg 變更不觸發測試失敗 — test-adapt 實際上不需要Closes #198
refs #197