mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-11-01 07:33:46 +00:00
d2a8d6105c79dc329e107e941cf4a6b4f8051023
Implements issue #71 with ADR-0020 (supersedes ADR-0019's endpoint-signature cleanup, startup cleanup, and health-gate cleanup). - New ShadowsocksX-NG2SystemProxyHelper target: app-bundled root LaunchDaemon (SMAppService.daemon, on-demand via MachServices) that mechanically applies a closed typed configuration or executes an unconditional clear. Clients are accepted by code-signing bundle identifier only; requests run serially on a shared queue (last-writer-wins). - SystemProxyConfiguration is now the closed typed apply payload (Codable over JSON XPC): explicit SOCKS/HTTP/HTTPS enable + endpoints, PAC and auto-discovery disabled with URL/JS removed, explicit simple-hostname exclusion, complete ExceptionsList. Unmodeled Proxies keys are preserved and equivalent values skip the commit. - Cleanup is a side effect of a persisted system-proxy intent on-to-off transition only: the switch itself, or the agent-off cascade (persist both intents off, clear, then stop listeners; failed cascade persistence records no transition and clears nothing). Launch with the switch off, health-gate closure, invalid targets, and passive events never clear. Failed clears are surfaced without deferred retry. - Endpoint-signature store, ownership migration, and direct Authorization Services writes are removed; old signature files stay inert. Helper unavailability or pending approval keeps an enabled intent pending and surfaces the Login Items approval path (HomeView button + menu label).
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。
Languages
Swift
95.8%
Python
2.5%
Shell
1.4%
C
0.3%