feat(V1.1.1): 软件授权(license)——MAC 绑定 .lic 校验,未授权禁用导出

- 新增 lib/license/license_service.dart:读取 exe 同级 license/*.lic,按算法由本机 MAC 计算期望授权串比对
- 算法:MAC 去分隔符 → A=01..Z=26(数字 00..09)→ 末尾加 26 → 整串倒序
- 未授权时「导出 SVG / PNG」置灰,并在导出入口二次拦截
- 关于页:显示授权状态、本机 MAC、授权申请邮箱 liuyu65@126.com,并可「提交授权申请」(唤起邮件客户端发送 MAC+发件人信息)
- 新增 license/ 目录(含说明);构建脚本把 license/ 复制到 dist/
- 新增 tools/keygen(Win32 图形界面 keygen.exe + 构建脚本)用于生成 .lic
- 版本 1.1.1+3;新增授权算法单元测试;重新构建 dist
This commit is contained in:
呆头鹅
2026-09-19 11:08:39 +08:00
parent 43c99fc4b6
commit 5d0238260f
15 changed files with 592 additions and 21 deletions
+13
View File
@@ -34,6 +34,19 @@ class AppController extends ChangeNotifier {
/// 当前主题亮度(默认浅色 / 白底)。
Brightness _brightness = Brightness.light;
/// 是否已获得有效授权(有效时才允许导出 SVG / PNG)。
bool _licensed = false;
/// 是否已授权。
bool get licensed => _licensed;
/// 设置授权状态并刷新(启动时校验 / 重新读取 .lic 后调用)。
void setLicensed(bool value) {
if (_licensed == value) return;
_licensed = value;
notifyListeners();
}
/// 当前项目对应的文件路径;null 表示尚未保存。
String? _filePath;