mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-11-01 15:43:45 +00:00
c50470dc89aee964628a2670498da6c8dc3c3c42
Migrate SilentLaunchStore from its versioned JSON file to the app's standard defaults domain (key `silentLaunch`), the platform's canonical home for GUI-scalar preferences, so the GUI preference category stops growing one file per item. Reads stay safe-side strict: a missing key or a value not bridgeable to Bool loads as not silent (plain bool(forKey:) would coerce "yes" to true). The file-form persistence-failure naming path is dropped — UserDefaults.set reports no failure — so SilentLaunchController keeps its persist-then-flip seam while errorMessage and its SettingsView presentation go away. The legacy file never shipped in any release; migrateLegacyFileIfPresent runs in the production composition root only, preserves the value on developer machines, and deletes the file (no-op when absent). The test composition uses a dedicated suite cleared at assembly; unit tests use per-test suites with removePersistentDomain teardown, never the standard domain. ADR-0017 carries a dated amendment (Status plus the affected consequence line); the settings.json separation rationale stands unchanged.
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%