修复安卓bug
Build Windows / build (push) Has been cancelled

This commit is contained in:
2025-10-03 15:20:49 +08:00
parent 866938abab
commit d87c58ac26
3 changed files with 213 additions and 3 deletions
@@ -430,7 +430,7 @@ class KRSingBoxImp {
KRLogUtil.kr_i('🚀 开始启动 SingBox...', tag: 'SingBox');
KRLogUtil.kr_i('📁 配置文件路径: $_cutPath', tag: 'SingBox');
KRLogUtil.kr_i('📝 配置名称: $kr_configName', tag: 'SingBox');
// 检查配置文件是否存在
final configFile = File(_cutPath);
if (await configFile.exists()) {
@@ -440,20 +440,26 @@ class KRSingBoxImp {
} else {
KRLogUtil.kr_w('⚠️ 配置文件不存在: $_cutPath', tag: 'SingBox');
}
await kr_singBox.start(_cutPath, kr_configName, false).map(
(r) {
KRLogUtil.kr_i('✅ SingBox 启动成功', tag: 'SingBox');
},
).mapLeft((err) {
KRLogUtil.kr_e('❌ SingBox 启动失败: $err', tag: 'SingBox');
// 确保状态重置为Stopped,触发UI更新
kr_status.value = SingboxStopped();
// 强制刷新状态以触发观察者
kr_status.refresh();
throw err;
}).run();
} catch (e, stackTrace) {
KRLogUtil.kr_e('💥 SingBox 启动异常: $e', tag: 'SingBox');
KRLogUtil.kr_e('📚 错误堆栈: $stackTrace', tag: 'SingBox');
// 确保状态重置为Stopped,触发UI更新
kr_status.value = SingboxStopped();
// 强制刷新状态以触发观察者
kr_status.refresh();
rethrow;
}
}