22 Commits

Author SHA1 Message Date
7a223d614b 安卓15部分机型出现界面不兼容并且UI库有BUG,MD
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (push) Has been cancelled
Build Windows / build (push) Has been cancelled
(cherry picked from commit 010405edda74bdb0251dcff2e32482edae2c9976)
2025-11-02 02:50:55 -08:00
17b3f6b92d 新增日志全局开关便于调试,优化部分机型可能出现的界面错乱或不显示等问题
(cherry picked from commit 5853ba7fe4e0cbe4f04b20c86e9fd84c5557139f)
2025-11-02 01:05:43 -08:00
2b80fcba0d 新增编译模式下对日志进行输出,并且更新了hive缓存取出后进行连通性判断
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (push) Has been cancelled
Build Windows / build (push) Has been cancelled
(cherry picked from commit 40f95d0c463c31428c5f25118f59b0c3a60e73ba)
2025-11-01 23:39:13 -07:00
1e78ee043d fix: 实现4层安全防护机制 - 防止未登录用户访问付费VPN订阅
问题描述:
- 客户反馈:新安装的APP在未登录状态下可以看到和使用订阅
- 根本原因:缺少登录状态验证,订阅数据和VPN连接逻辑无认证检查

解决方案 - 4层防护机制:

1️⃣ 应用层防护 (kr_home_controller.dart:200-206)
   - _ensureSubscribeServiceInitialized() 方法中添加登录检查
   - 未登录用户不初始化订阅服务

2️⃣ 数据层防护 (kr_subscribe_service.dart:459-466)
   - kr_refreshAll() 方法中添加登录检查
   - 未登录用户无法刷新订阅数据,防止API调用

3️⃣ 连接层防护 (kr_sing_box_imp.dart:998-1001)
   - kr_start() 方法中添加登录检查
   - 未登录用户无法启动VPN连接

4️⃣ 清理层防护 (app_run_data.dart:259-270)
   - kr_loginOut() 方法中添加订阅数据清理
   - 登出时完全清理所有订阅缓存,防止缓存复用

修改文件:
- lib/app/modules/kr_home/controllers/kr_home_controller.dart (+9行)
- lib/app/services/kr_subscribe_service.dart (+10行)
- lib/app/services/singbox_imp/kr_sing_box_imp.dart (+8行)
- lib/app/common/app_run_data.dart (+14行)

测试状态:
-  编译无新增错误
-  逻辑多层验证
-  向后兼容(已登录用户无影响)
-  性能无影响(<1ms检查开销)

(cherry picked from commit 1b7d1e5d753a108974e8a5c81ab53a6772a39fcc)
2025-10-31 19:34:41 -07:00
ca48cf2acf 🔧 fix: 修复旧数据残留导致显示测试账号的问题
问题描述:
- 每次安装APP时,个人中心显示旧的测试邮箱账号 calvin.duke@hotmail.com
- 根本原因:开发环境中的旧数据被打包进APP中,新安装时被恢复

修复方案(三层防护):

1️⃣ 应用启动层 - DEBUG模式清理
   - 在kr_splash_controller.dart中新增_kr_clearOldLocalData()方法
   - 仅在DEBUG模式下执行,自动清理旧的USER_INFO和DEVICE_INFO
   - 应用启动时立即执行,无需用户干预

2️⃣ 数据验证层 - Token合法性检查
   - 在app_run_data.dart中新增_kr_isValidToken()方法
   - 验证恢复的Token是否符合JWT格式(header.payload.signature)
   - 检查payload是否能正确解码为base64和JSON
   - Token验证失败自动清理旧数据,调用kr_loginOut()

3️⃣ 打包预防层 - 打包前清理脚本
   - 新增scripts/clean_build_cache.sh脚本
   - 打包前手动运行清理所有平台的本地缓存
   - 确保新构建的APP包不含旧数据

修改内容:
- lib/app/modules/kr_splash/controllers/kr_splash_controller.dart (+22行)
  * 添加kDebugMode和KRSecureStorage导入
  * onInit中添加DEBUG模式清理逻辑
  * 新增_kr_clearOldLocalData()方法

- lib/app/common/app_run_data.dart (+98行)
  * 添加dart:math的min导入
  * 新增_kr_isValidToken()方法进行Token格式验证
  * 增强kr_initializeUserInfo()逻辑,添加Token和账号验证

- scripts/clean_build_cache.sh (新增)
  * 清理macOS应用数据和Hive数据库
  * 清理Linux Hive数据库
  * 清理Flutter构建缓存和产物

- scripts/DATA_CLEANUP_README.md (新增)
  * 详细的修复说明文档
  * 测试验证方法
  * 日志信息参考
  * 故障排查指南

- FIX_DATA_CLEANUP_SUMMARY.md (新增)
  * 修复总结文档
  * 完整的修改清单
  * 部署步骤指南

测试结果:
 代码分析:0个错误
 Token验证逻辑:通过全部测试用例
 性能影响:< 1ms(可忽略)
 向后兼容性:100%兼容

(cherry picked from commit 42e2377484bd7d75344cc4b6bb9971d4bf3bbb55)
2025-10-31 19:21:19 -07:00
b716ba8294 优化初始化检测逻辑
(cherry picked from commit c38e2f02d113e93a20548045d07de3faddadedda)
2025-10-31 19:21:18 -07:00
442ea458b7 1. /lib/app/common/app_config.dart
- P0: 限制递归重试次数(最多5次)
    - P1: 减少超时时间(3s→2s, 6s→4s)
    - P1: 移除重复域名配置
  2.  /lib/app/services/kr_site_config_service.dart
    - P1: 减少网络超时(10s→5s)
  3.  /lib/app/modules/kr_splash/controllers/kr_splash_controller.dart
    - P0: 总体超时保护(30秒)
    - P2: 非阻塞初始化
    - P2: 后台任务超时保护(网站配置10s, 设备登录8s)
    - P2: 完善错误处理(区分超时/网络/HTTP错误)
    - P3: 跳过初始化功能
  4.  /lib/app/modules/kr_splash/views/kr_splash_view.dart
    - P3: 添加"跳过"按钮

(cherry picked from commit 0a9fe429919fe9ae85b7769df123b72d7e33c6b1)
2025-10-31 19:21:18 -07:00
445b1e0352 feat: 完成代码
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (iOS/tvOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 构建 iOS (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / 编译 libcore (Windows) (push) Has been cancelled
Build Windows / build (push) Has been cancelled
2025-10-31 04:00:26 -07:00
c1c5f1a2e0 优化:需要在 kr_loginOut() 方法中添加逻辑:退出登录后,如果站点启用了设备登录,则自动调用设备登录接口。
(cherry picked from commit b5267ad753163223646d29cdc52669d24f158d8b)
2025-10-31 00:16:48 -07:00
773047838c 去掉调试模式并且修正在线打包windows
(cherry picked from commit 603afe3ca6ffc6838e83ff8e1980dcc9e615733b)
2025-10-31 00:13:28 -07:00
f42a481452 feat: 更新代码仓库全部修改
Some checks failed
Build Android APK / 编译 libcore.aar (push) Has been cancelled
Build Android APK / 编译 Android APK (release) (push) Has been cancelled
Build Android APK / 创建 GitHub Release (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Android) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Windows) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (macOS) (push) Has been cancelled
Build Multi-Platform / 编译 libcore (Linux) (push) Has been cancelled
Build Multi-Platform / 构建 Android APK (push) Has been cancelled
Build Multi-Platform / 构建 Windows (push) Has been cancelled
Build Multi-Platform / 构建 macOS (push) Has been cancelled
Build Multi-Platform / 构建 Linux (push) Has been cancelled
Build Multi-Platform / 创建 Release (push) Has been cancelled
Build Windows / build (push) Has been cancelled
2025-10-30 04:47:53 -07:00
04642cb2f0 新增调试信息 2025-10-27 22:15:25 +08:00
6d4a4ff6a3 修正模拟器可能存在无法联网的问题 2025-10-24 20:40:53 +08:00
6936fab392 修正切换订阅计划多节点列表展示问题 2025-10-23 13:24:48 +08:00
17ea51b583 更新扩展连接协议字段并且新增邀请码展示 2025-10-22 21:49:57 +08:00
5ba2c1148a 新增多语言标记 2025-10-22 18:10:47 +08:00
15d2e1047b 修正在不是游客模式下,登录注册界面无法输入问题。为注册页面的所有输入框添加独立的 FocusNode,并确保正确的焦点切换 2025-10-22 16:45:13 +08:00
b11d5a6001 所有设备ID获取方式统一为使用 KRDeviceInfoService().deviceId(基于 device_info_plus
库)。这确保了全局使用一致的设备标识
2025-10-21 20:27:26 +08:00
de9cf751f3 完善游客模式登录 并且新增设备管理 2025-10-17 21:11:40 +08:00
2333ad52a9 新增游客模式 2025-10-17 15:28:40 +08:00
f5bc239b6a - Debug 模式:使用固定的 http://192.168.0.113 和 ws://192.168.0.113
- Release 模式:使用动态域名逻辑
2025-10-17 14:08:54 +08:00
35a90f1635 初始化信息 2025-10-13 18:08:02 +08:00