Qiu Yuzhou 53c84384a4 fix(system-proxy): skip write when applied values already match desired
System proxy convergence runs after every successful deploy (activation,
mode change, settings saves, health convergence, launch resync), and each
apply locked SCPreferences and rewrote every owned service even when the
projected dictionaries were semantically equal to what macOS already
applies — so the admin authorization prompt fired on every redeploy while
intent was on, including server switches and GUI relaunches that cannot
change the system proxy dictionary at all.

New SystemProxyPlanner (Domain, pure) decides per service by comparing the
desired Proxies dictionary with the live value: equal services are not
written, and an all-equal apply returns .unchanged without locking or
committing, so no authorization is requested. A foreign change that
coincidentally equals the desired values (or an unowned service already at
them) is adopted into ownership with the recorded original preserved
instead of reported as a conflict. Owned services keep their recorded
original verbatim — nil stays nil — fixing a latent restore bug where a
second real change on a service originally taken over with no proxies
dictionary recorded 2.0's own previous values as the restore point. Real
value changes still write and authorize once.

SystemProxyControlling.apply returns written/unchanged; the gate emits a
systemProxyUnchanged event line (diagnostic log view and redacted report)
so it is observable why no prompt appeared. SystemProxyError moves to
Domain with the planner. CONTEXT.md invariant extended; decision table and
test points in issue #70. Closes #70.
2026-09-29 09:34:10 +08:00
2017-01-13 13:08:32 +08:00

ShadowsocksX-NG

🚧 重新实现进行中 —— 本仓库正在使用现代技术栈重写 ShadowsocksX-NG macOS 客户端。

新工程不再通过 git 子模块在仓库内构建依赖,而是直接复制上游项目发布好的可执行文件,以简化构建流程。

目录结构

.
├── ShadowsocksX-NG2/   # 新工程:现代化重写版本(开发中)
└── Legacy/             # 旧版工程完整源码,仅供参考,不保证可构建

旧版工程的功能说明与使用文档见 Legacy/README.md。

开发钩子

新 clone 后,在仓库根目录启用 Git hooks:

git config core.hooksPath .githooks

启用后,pre-commit 只检查暂存区中 ShadowsocksX-NG2/ 下的 .swift 文件:swift format 的结果写回暂存区、不修改工作区;SwiftLint 的 error 级违规拒绝提交,warning 仅提示。Legacy/ 和其他文件跳过;没有 NG2 Swift 文件时直接放行。含有 NG2 Swift 文件但缺少工具时,提交检查失败。工具安装与版本见 ShadowsocksX-NG2/README.md。

S
Description
No description provided
Readme GPL-3.0
84 MiB
Languages
Swift 95.8%
Python 2.5%
Shell 1.4%
C 0.3%