Releases: oldj/SwitchHosts
Releases · oldj/SwitchHosts
SwitchHosts v5.0.1
New Features
- Added “Lightweight Mode”: closing the main window can now release WebView memory, useful for users who want lower background resource usage.
- Restored custom data storage location: choose a data directory, migrate existing data, and reset back to the default location.
- Added a privileged background Helper on macOS to reduce repeated admin password prompts when writing to
/etc/hosts. (If the Helper has issues, you can open macOS “Login Items” settings directly to approve or re-enable it.) - Added a “Quit app when closing the main window” option, better matching Windows users’ expectations.
Experience Improvements
- Optimized tray window creation and destruction to reduce resource usage while running in the background.
- Long update changelogs are now scrollable instead of being truncated.
- Added a title to the Import URL dialog; modal titles are now bold globally for better readability.
- Added a default path tooltip to the data directory recovery dialog to help avoid accidental actions.
- Reordered items in General settings and improved multilingual copy.
Bug Fixes
- Fixed an issue where the Windows/Linux title-bar close button did not correctly trigger Lightweight Mode memory release.
- Fixed an issue where the tray mini window could close immediately after opening on Windows/Linux.
- Fixed an issue where the main window could still appear on macOS login even when “Hide at launch” was enabled.
- Strengthened the recovery flow for custom data directories when they are damaged, missing, or referenced by an invalid pointer.
- Fixed a brief flash of default data that could appear during data directory recovery.
- Fixed a release workflow race condition where multiple build jobs could create the draft Release concurrently.
Dependencies and Internal Improvements
- Updated multiple frontend, backend, and Rust dependencies, including Electron, Vite, Hono, Axios, Lodash, React, Mantine, Vitest, Sass, and more.
- Updated security-related indirect dependencies, including
picomatch,@xmldom/xmldom,follow-redirects,rustls-webpki,tar, and more. - Added test coverage for window lifecycle, Lightweight Mode, tray behavior, data directory recovery, and configuration update failure paths.
- Improved macOS Helper diagnostic logging, making background component issues easier to inspect through system logs.
新增功能
- 新增“轻量模式”:关闭主窗口时可释放 WebView 内存,适合希望降低后台占用的用户。
- 恢复自定义数据存储位置:可选择数据目录、迁移现有数据,并支持重置回默认位置。
- macOS 新增后台提权 Helper:写入
/etc/hosts时减少反复弹出管理员密码的情况。(Helper 异常时可直接打开 macOS “登录项”设置,便于批准或重新启用后台组件。) - 新增“关闭主窗口时退出应用”选项,兼顾 Windows 用户的使用习惯。
改进体验
- 优化托盘窗口创建与销毁逻辑,减少隐藏运行时的资源占用。
- 长更新日志弹窗现在可滚动查看,不再被截断。
- 导入 URL 弹窗新增标题;全局弹窗标题加粗,更易识别。
- 数据目录恢复弹窗增加默认路径提示,避免误操作。
- 调整“通用设置”项目顺序,并完善多语言文案。
修复问题
- 修复 Windows/Linux 标题栏关闭按钮未正确触发轻量模式释放内存的问题。
- 修复托盘迷你窗口在 Windows/Linux 上刚打开就关闭的问题。
- 修复 macOS 登录启动时,在“启动时隐藏”开启后主窗口仍可能显示的问题。
- 加强自定义数据目录损坏、丢失、无效指针等场景的恢复流程。
- 修复恢复数据目录时可能短暂显示默认数据的问题。
- 修复发布流程中多个构建任务并发创建草稿 Release 的竞态问题。
依赖与内部改进
- 更新多项前端、后端与 Rust 依赖,包括 Electron、Vite、Hono、Axios、Lodash、React、Mantine、Vitest、Sass 等。
- 更新安全相关间接依赖,包括
picomatch、@xmldom/xmldom、follow-redirects、rustls-webpki、tar等。 - 增加窗口生命周期、轻量模式、托盘行为、数据目录恢复、配置更新失败路径等测试覆盖。
- 改进 macOS Helper 诊断日志,现在可通过系统日志排查后台组件问题。
Full Changelog: v5.0.0...v5.0.1
SwitchHosts v5.0.1-beta.11
Full Changelog: v5.0.1-beta.9...v5.0.1-beta.11
SwitchHosts v5.0.1-beta.9
Full Changelog: v5.0.1-beta.8...v5.0.1-beta.9
SwitchHosts v5.0.1-beta.8
v5.0.1-beta.8
Added
- Restored custom data storage location support, with options to change or reset the data directory in Advanced settings.
- Added an option to copy existing data when changing the data directory, with a warning if the target already contains data.
- Added a startup recovery dialog when the custom data directory is missing, unavailable, or has a damaged location record.
Improved
- Update dialog changelogs now scroll instead of being truncated.
- Added a title to the import-from-URL dialog and improved modal title styling.
Fixed
- Fixed cases where SwitchHosts could accidentally fall back to the default data directory when the custom location was unavailable.
- Blocked data writes, remote refresh, HTTP API, tray mini window, and related actions from bypassing the recovery flow.
- Added stronger validation before switching data directories to avoid restarting into an unusable location.
Dependencies
- Updated Rust dependency
tarfrom0.4.45to0.4.46.
v5.0.1-beta.8
新增
- 恢复自定义数据存储位置功能,可在高级设置中更改或重置数据目录。
- 更改数据目录时支持复制现有数据,并在目标目录已有数据时提示覆盖风险。
- 当自定义数据目录丢失、不可用或记录损坏时,启动时会显示恢复对话框。
优化
- 更新弹窗的 changelog 支持滚动显示,避免长内容被截断。
- 导入 URL 弹窗新增标题,弹窗标题样式更清晰。
修复
- 修复自定义数据目录异常时可能误用默认目录的问题。
- 恢复状态下会阻止数据写入、远程刷新、HTTP API、托盘迷你窗口等操作绕过恢复流程。
- 增强数据目录切换前的可用性检查,避免保存无效目录后启动失败。
依赖
- 升级 Rust 依赖
tar:0.4.45→0.4.46。
Full Changelog: v5.0.1-beta.7...v5.0.1-beta.8
SwitchHosts v5.0.1-beta.7
Changelog
Added
- Added a macOS background helper that can write to
/etc/hostssilently after one-time authorization, reducing repeated password prompts during automatic remote hosts updates. - Added background helper management in General settings, including status, install, reinstall, and remove actions.
- Added an “Open System Settings” button to help users approve the helper in macOS Login Items.
Improved
- macOS hosts applying now tries the background helper first, then automatically falls back to the existing system authorization flow if the helper is unsupported, unavailable, or fails.
- Added safety checks to the helper write flow and restricted privileged writes to
/etc/hostsonly. - Improved macOS login startup behavior to avoid unexpectedly showing a previously hidden main window.
Fixed
- Fixed background helper XPC signature validation failures on macOS 26.
- Fixed possible concurrent helper unregister/register operations when repeatedly triggering helper repair.
- Fixed macOS universal builds failing to package the background helper binary correctly.
修改日志
新增
- 新增 macOS 后台助手,可在一次授权后静默写入系统
/etc/hosts,减少自动更新远程 hosts 时反复输入密码的情况。 - 在通用设置中新增后台助手管理入口,支持查看状态、安装、重新安装、移除。
- 新增“打开系统设置”按钮,方便用户前往 macOS“登录项”中批准后台助手。
改进
- macOS 应用 hosts 时优先使用后台助手;当后台助手不可用、不受支持或写入失败时,自动回退到原有系统授权流程。
- 后台助手写入流程增加安全校验,并固定只允许写入
/etc/hosts。 - 优化 macOS 登录启动行为,避免登录恢复时意外显示已隐藏的主窗口。
修复
- 修复 macOS 26 下后台助手 XPC 签名校验失败导致无法连接的问题。
- 修复重复点击后台助手修复操作时可能触发并发注册/注销的问题。
- 修复 macOS universal 构建中后台助手二进制未正确打包的问题。
Full Changelog: v5.0.1-beta.4...v5.0.1-beta.7
SwitchHosts v5.0.1-beta.4
What's Changed
Full Changelog: v5.0.0...v5.0.1-beta.4
SwitchHosts v5.0.0
Update List
- Core Architecture Migrated to Tauri 2: Migrated from an Electron main process to a Rust/Tauri backend, added the complete
src-tauriimplementation, and removed the old Electron main process code, packaging scripts, and electron-builder workflow. - New v5 Data Structure: Data is now stored in separate layers:
manifest.json,entries/,trashcan.json,internal/config.json, andinternal/histories/. README backup instructions were updated accordingly. - Compatible Migration, Import, and Export: Supports first-run migration from legacy PotDb data; manual import now supports v3, v4, and v5 backups; exports now use the v5 backup JSON format with timestamped filenames.
- System Hosts Writing Reworked: Switched to native system privilege flows: Security.framework on macOS,
pkexecon Linux, and UAC self-elevation on Windows. The in-app sudo password input was removed. - New/Reworked Auto Update System: Integrated Tauri updater, with background update checks, manual download/install, proxy support for update requests, and generated/published
latest.json. - Rebuilt CI and Release Pipeline: Added GitHub Actions CI and Release workflows. Releases now run the full test suite before publishing and support signed/validated builds for macOS universal/arm64/x64, Windows x64/x86/arm64, and Linux x64/arm64.
- Editor Upgraded to CodeMirror 6: Improved large-file performance, syntax highlighting, line numbers, read-only mode, history snapshot rendering, and cursor/display stability.
- Enhanced Remote Hosts Refresh: Added startup refresh support, response size limits, and CRLF/LF normalization.
- Improved System Tray Behavior: Fixed macOS focus handling, multi-monitor positioning, rounded corners, and interaction issues.
- Major Main UI Redesign: Added a left activity bar, Hosts/Trashcan view switching, resizable left and right panels, a right-side details panel, centered title bar, frameless window, and cross-platform window controls.
- Right Details Panel: Shows the current hosts type, rule count, remote URL, refresh interval, last refresh time, group contents, and folder selection mode; trashcan items can be restored or permanently deleted from the panel.
- Unified Trashcan Experience: Moved the trashcan entry to the left sidebar, with item count display, restore, permanent delete, clear, and details panel operations.
- Preferences Reworked: Split preferences into General, Commands, Proxy, and Advanced tabs. General and Advanced settings auto-save, while Commands and Proxy keep manual save status feedback.
- New Preference Options: Added system theme by default, launch at login, and refresh remote hosts on startup.
- Enhanced Proxy Support: Added
socks5proxy protocol support, and both remote hosts refresh and app updates can now use proxy settings. - Local HTTP API Preserved and Migrated: Reimplemented the
50761API with Rust/Axum, supporting/api/listand/api/toggle; when port binding fails, the setting is rolled back and the user is notified. - Localization and Copy Updates: Organized and sorted locale keys, fixed language preference fallback display, localized menus and find window text, and updated multilingual README screenshots and v5 documentation.
- Stability Fixes: Fixed concurrent config writes, HTTP API startup failure state, invisible window after hiding the Dock icon, stuck hover state after drag, titlebar/tray switch synchronization, long title truncation, loading screen lockups, and more.
- Expanded Test Coverage: Added Playwright e2e tests, Rust tests, and frontend component/model unit tests covering preferences, import/export, remote hosts, local hosts, trashcan, title bar, tree operations, find/replace, and more.
- Toolchain Upgrades: Upgraded to Vite 8, TypeScript 6, Mantine 9, Vitest 4, and Tauri 2.11, and introduced ESLint 10 with naming convention rules.
- Development and Build Command Changes: Development now uses
npm run tauri:dev; production builds usenpm run tauri:build; build artifacts are now located undersrc-tauri/target/release/bundle/. - Removed Legacy Electron Content: Removed
src/main/*, the Electron updater, old upload/packaging scripts, old main-process tests, andvite.main.config.mts.
更新列表
- 核心架构迁移到 Tauri 2:从 Electron 主进程迁移为 Rust/Tauri 后端,新增完整
src-tauri,移除 Electron 主进程代码、旧打包脚本和 electron-builder 流程。 - 全新 v5 数据结构:数据改为
manifest.json、entries/、trashcan.json、internal/config.json、internal/histories/分层存储,并更新 README 备份说明。 - 兼容迁移与导入导出:支持首次启动从旧 PotDb 数据迁移;手动导入支持 v3、v4、v5 备份;导出改为 v5 backup JSON,并支持带时间戳的备份文件名。
- 系统 hosts 写入重做:改用系统原生提权流程,macOS 使用 Security.framework,Linux 使用
pkexec,Windows 使用 UAC 自提升;移除应用内 sudo 密码输入。 - 新增/重做自动更新体系:接入 Tauri updater,支持后台检查更新、手动下载/安装、代理更新请求,并生成/发布
latest.json。 - CI/发布流水线重建:新增 GitHub Actions CI 和 Release workflow,发布前跑完整测试,支持 macOS universal/arm64/x64、Windows x64/x86/arm64、Linux x64/arm64 多平台构建、签名与校验。
- 编辑器升级为 CodeMirror 6:改善大文件性能、语法高亮、行号、只读模式、历史快照展示和光标/显示稳定性。
- 远程 hosts 刷新增强:支持启动时刷新、内容大小限制和 CRLF/LF 规范化。
- 系统托盘能力增强:并修复 macOS 焦点、多屏位置、圆角和交互问题。
- 主界面大改版:新增左侧活动栏、Hosts/回收站视图切换、可拖拽左右面板、右侧详情面板、居中标题栏、无边框窗口与跨平台窗口按钮。
- 右侧详情面板:显示当前 hosts 类型、规则数量、远程 URL、刷新周期、上次刷新、组合内容、文件夹选择模式;回收站内可恢复或彻底删除。
- 回收站体验统一:回收站入口移动到左侧栏,支持数量提示、恢复、永久删除、清空和详情面板操作。
- 偏好设置重构:常规/命令/代理/高级分栏;常规和高级项自动保存;命令与代理保留手动保存状态反馈。
- 新增偏好项:跟随系统主题默认开启、开机启动、启动时刷新远程 hosts 等。
- 代理支持增强:代理协议新增
socks5,并让远程 hosts 刷新与应用更新都能走代理。 - 本地 HTTP API 保留并迁移:基于 Rust/Axum 重写
50761端口 API,支持/api/list和/api/toggle,并在端口绑定失败时回滚配置并提示用户。 - 多语言与文案更新:整理并排序语言 key,修复语言偏好回退显示,本地化菜单和查找窗口文案,更新 README 多语言截图与 v5 说明。
- 稳定性修复集中落地:修复配置并发写入、HTTP API 开启失败状态、Dock 隐藏后窗口不可见、拖拽后 hover 残留、标题栏/托盘开关同步、长标题截断、加载失败卡住等问题。
- 测试覆盖增加:新增 Playwright e2e、Rust 测试、前端组件/模型单测,覆盖偏好设置、导入导出、远程 hosts、本地 hosts、回收站、标题栏、树操作、查找替换等。
- 工程栈升级:升级到 Vite 8、TypeScript 6、Mantine 9、Vitest 4、Tauri 2.11,并引入 ESLint 10/naming convention 规则。
- 开发/构建命令变化:开发改为
npm run tauri:dev,生产构建改为npm run tauri:build,产物路径改到src-tauri/target/release/bundle/。 - 移除旧 Electron 相关内容:删除
src/main/*、Electron 更新器、旧上传/打包脚本、旧主进程测试和vite.main.config.mts。
Full Changelog: v4.3.0...v5.0.0
SwitchHosts v5.0.0-beta.31
Full Changelog: v5.0.0-beta.30...v5.0.0-beta.31
SwitchHosts v5.0.0-beta.30
Full Changelog: v5.0.0-beta.28...v5.0.0-beta.30
SwitchHosts v5.0.0-beta.28
Full Changelog: v5.0.0-beta.26...v5.0.0-beta.28