flutter_sing_box 1.2.0 copy "flutter_sing_box: ^1.2.0" to clipboard
flutter_sing_box: ^1.2.0 copied to clipboard

A Flutter plugin for sing-box, supporting remote profile import, Clash API, and VPN service management for Android and iOS.

1.2.0 #

🎉 里程碑:Windows 平台正式支持 #

自 1.1.5 的"开发中"状态转入正式可用:桌面端以系统服务方式托管 sing-box 进程,并支持系统代理设置与 Clash API 实时日志。

⚠️ 重要变更(Breaking Changes) #

  • 最低环境要求提升:Dart SDK ^3.11.0 → ^3.12.0,Flutter >=3.41.0 → >=3.44.0

Features #

  • Windows 平台正式支持:
    • 新增 SystemProxyService:通过 Windows FFI 设置/清除系统代理
    • 新增 ProxyMode 枚举与 defaultMixedPort 常量;CsSettingsStorage 新增 proxyMode / mixedPort / systemProxyActive 配置项
    • emitProxyState 与系统代理开/关联动;init 增加崩溃自愈逻辑
    • 新增 Clash API 实时日志订阅(logStream):基于 WebSocket 连接 /logs 端点,支持断线自动重连与自定义 API 端口
  • 资源释放机制增强:改为在内存中比对资源与目标文件的 SHA256,避免临时文件写入与清理;针对 Windows 下运行中的 exe 被独占锁定(errno 32)的问题,实现旧文件重命名为 .old 后再写入新文件的降级策略
  • 网络层 DioClient 新增 allowBadCertificates 开关,运行时动态控制证书校验,解决 Windows 桌面端因订阅站点证书链不完整导致的请求失败问题

Fixes #

  • 修复 Windows 端 Clash 日志级别映射错误(warning → warn)
  • 修复 Windows 平台服务操作(状态检查、安装、卸载、启动、停止)及资源复制方法中缺失 await 的异步调用

Improvements #

  • Android 构建脚本由 Groovy(build.gradle)迁移至 Kotlin DSL(build.gradle.kts),要求 AGP 9.0.1 / Kotlin 2.3.20 / Java 17
  • 移除 Android 端不必要的权限
  • 简化 pubspec.yaml 中的 Windows 平台资源配置
  • example 示例:升级 Android 构建工具链(Gradle / AGP / Kotlin / SDK),UI 层由 flutter/material 迁移至 material_ui

Dependencies #

  • 升级 sing-box 内核(Android libbox / Windows sing-box.exe):1.13.15 → 1.13.21
  • 升级 MMKV:2.4.1 → 2.4.2(2.4.1 存在 Windows 端 MSVC cbridge 崩溃问题)
  • 升级 dio:→ ^5.11.1
  • 移除 path_provider 依赖

1.1.5 #

Features #

  • 新增 Windows 平台支持(开发中,桌面端以系统服务方式托管 sing-box 进程,弥补桌面平台缺少 VPN Service 的能力):
    • 新增服务管理接口:installService / uninstallService / queryServiceStatus,基于 PowerShell runas 提权安装并轮询状态判定结果
    • 实现 Windows 平台的 VPN 控制与代理状态监听(proxyStateStream)
    • 新增 HelperCli,封装 clash_sing_helper.exe 的全部 CLI 子命令(status / stop / install / uninstall / start)
  • Windows 端 Clash API 支持:
    • 新增 Clash 配置模型与 HTTP 客户端
    • 实现 Clash 模式读取与切换(clashModeStream、setClashMode)
    • 实现代理组数据获取、出站节点切换与 URL 延迟测试
  • 存储层新增 Clash API 端口与测试 URL 配置项

Improvements #

  • 升级 Android 端 libbox(sing-box 内核):1.13.14 → 1.13.15
  • 升级 Windows 端 sing-box.exe 至 1.13.15
  • Clash API 端口支持动态适配变化
  • 移除 Android 端未使用的位置权限

Fixes #

  • 修复 Windows 端 Clash HTTP 客户端代理类型映射错误
  • 修正 Windows 端 Clash 代理组解析与类型转换逻辑

Refactoring #

  • 重构服务安装接口:参数收敛为 HelperConfig 对象,硬编码路径提取为常量
  • 将服务管理能力(uninstall / start / stop)上升到平台抽象层与门面
  • 优化代理状态流控制器初始化与状态分发逻辑
  • FlutterSingBoxWindows 委托 HelperCli,移除已迁移的辅助方法

Dependencies #

  • 升级 dio:→ ^5.10.0

1.1.4 #

Dependencies #

  • 升级 Android 端 libbox(sing-box 内核):1.13.12 → 1.13.14

1.1.3 #

Features #

  • 新增 naive 协议出站类型支持
  • 新增独立的 TLS 配置模型(tls.dart)
  • 为 Outbound 模型新增 domainResolver 字段
  • DNS Server 模型新增 domain_resolver 与 tls 字段

Fixes #

  • 修正 DNS Server 模型 path 字段类型:List<String> → String

Improvements #

  • 移除 sing-box 模板配置中的 sniff_override_destination 选项

1.1.2 #

Documentation #

  • 全面补全公开 API 的英文 dartdoc 注释,覆盖 constants、providers、services、network、storage 等模块,提升 pub.dev 文档覆盖率评分

Dependencies #

  • 升级 device_info_plus:^12.2.0 → ^13.1.0
  • 升级 package_info_plus:^9.0.0 → ^10.1.0

1.1.0 #

⚠️ 重要变更(Breaking Changes) #

  • 最低环境要求提升:Dart SDK ^3.9.0 → ^3.11.0,Flutter >=3.3.0 → >=3.41.0
  • 修正 Android 插件包名拼写:com.clashsiing.flutter_sing_box → com.clashsing.flutter_sing_box(如有原生层引用或 consumer-rules 配置,请同步更新)
  • 引入 freezed 代码生成框架,新增 freezed 与 freezed_annotation 依赖

Features #

  • 新增 Rule Set(规则集)配置支持,并优化 sing-box 配置模板结构
  • 支持自定义订阅请求的 User-Agent,并内置默认 User-Agent 生成工具
  • 大幅扩展 sing-box 配置模型字段:Outbound 新增 username、quic 等出站配置;DNS / Route 模型补充多项字段
  • 新增独立 storage 存储模块,引入 KeyValueStorage 抽象接口(支持 MMKV / Memory 等实现)
  • 新增 CsSettingsStorage,用于管理按应用代理设置
  • 新增 ClientLog 数据模型
  • Profile 新增 outboundsCount 出站数量统计字段,并支持获取所有 Profile ID
  • 新增 defaultTestUrl 常量

Improvements #

  • 缓存 sing-box 版本号,避免重复获取(性能优化)
  • 为模型添加 explicitToJson 配置,修复嵌套模型的 JSON 序列化问题
  • 重构 VPN 服务启动逻辑,缓存事件流状态
  • 升级 JSON 序列化依赖:json_annotation → 4.12.0、json_serializable → 6.14.0
  • 移除 VpnService 的 android:process=":remote" 属性

Fixes #

  • 修复 VPN 服务重启功能
  • 修复 Clash 模式设置与连接管理问题
  • 修复 Android 端关闭服务的逻辑
  • appendLogs 方法增加 logSink 空值保护,避免空指针异常

Refactoring #

  • 重构存储层:ProfileManager 重命名为 ProfileStorage,以 KeyValueStorage 抽象接口替代 MMKV 直接调用
  • ClientGroupItem / ClientGroup 迁移至 freezed 数据类
  • 将 Route 与 RuleSet 部分必填字段改为可选,提升配置灵活性
  • 重构 Android 服务实现并更新依赖
  • 清理废弃的 custom 模块及调试代码

1.0.12 #

Features #

  • 新增应用级代理模式功能(禁用/排除/包含三种模式)
  • 支持按应用列表配置代理规则

Improvements #

  • 更新 MMKV 依赖至 2.4.0
  • 优化应用列表存储方式(使用 JSON 数组格式)
  • 更新 Android 构建环境(Kotlin 2.3.20, Gradle 8.14.4)

Refactoring #

  • 移除 Inbound 模型中的 sniff 字段
  • 重构应用列表数据结构(List 与 Set 转换优化)

1.0.11 #

  • Update sing-box dependency to 1.12.25 for Android.

1.0.10 #

  • Route Rule: Added IP CIDR and port filtering support
    • New fields: ip_cidr, source_ip_cidr, port, port_range, source_port, source_port_range
    • Enhanced traffic matching with IP and port-based routing
    • Full JSON serialization support with backward compatibility

1.0.9 #

Features #

  • Add DNS rule action configuration and new domain matching fields
  • Add RuleAction constants for routing rules

Improvements #

  • Optimize proxy configuration template and simplify DNS/route rules
  • Adjust default log level from trace to info
  • Update User-Agent string for better compatibility

Refactoring #

  • Remove remote rule set configuration (geoip-cn, geosite-cn)
  • Simplify configuration structure and improve performance
  • Make Route fields optional for flexibility

1.0.8 #

  • Update sing-box dependency to 1.12.24 for Android.

1.0.7 #

  • Update sing-box dependency to 1.12.23 for Android.

1.0.6 #

  • Update sing-box dependency to 1.12.22 for Android.

1.0.5 #

  • Update sing-box dependency to 1.12.20 for Android.

1.0.4 #

  • Update libbox dependency to 1.12.19 for Android.
  • Update documentation and project links in README.
  • Bump version to 1.0.4.

1.0.3 #

  • Add getSingBoxVersion() API to retrieve the underlying sing-box core version.
  • Optimize memory usage and stability for long-running VPN services.
  • Improve error handling during remote profile synchronization.
  • Update dependencies to latest versions (dio, mmkv, package_info_plus, etc.).
  • Minor bug fixes and performance improvements.

1.0.2 #

  • Improve package description and API documentation coverage to increase pub score.
  • Add comprehensive README with features, platform support, and basic usage.
  • Add Chinese documentation (README_CN.md).
  • Showcase projects using this plugin (clash_sing_app).

1.0.0 #

  • Initial release of the flutter_sing_box plugin.
  • Support for sing-box as a VPN service.
  • Ability to import remote profiles.
  • Clash API support for managing proxies and groups.
  • UI for managing profiles and viewing connection status.
  • Support for various protocols like Hysteria, TUIC, etc.
  • Core functionalities like network service, profile management, and custom logging.
  • Many bug fixes and performance improvements.
4
likes
0
points
1.06k
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for sing-box, supporting remote profile import, Clash API, and VPN service management for Android and iOS.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

collection, crypto, device_info_plus, dio, ffi, flutter, freezed_annotation, json_annotation, material_ui, mmkv, package_info_plus, path, path_provider, plugin_platform_interface, win32, yaml

More

Packages that depend on flutter_sing_box

Packages that implement flutter_sing_box