Compare commits

..

3 Commits

Author SHA1 Message Date
sepakeloudest 62d1af8517 feat: 修改接口方式
Build Windows / 编译 libcore (Windows) (20.15.1) (push) Successful in 20m26s
Build Windows / build (push) Has been cancelled
2025-11-20 18:11:29 -08:00
sepakeloudest 3b05d4ff72 feat: 修改国家选择匹配问题 2025-11-20 09:08:23 -08:00
sepakeloudest bcb4d17236 feat: ai修改win 名称信息 2025-11-20 09:07:40 -08:00
11 changed files with 64 additions and 33 deletions
+5 -5
View File
@@ -4,12 +4,12 @@ echo 📋 复制 libcore 文件...
:: 创建目标目录
mkdir libcore\bin >nul 2>&1
:: 查找并复制 HiddifyCli.exe,重命名为 BearVPNCli.exe
:: 查找并复制 HiddifyCli.exe,重命名为 CLI 可执行文件
for /r %%f in (HiddifyCli.exe) do (
if exist "%%f" (
echo ✅ 找到 HiddifyCli.exe: %%f
echo 📝 复制并重命名为 BearVPNCli.exe
copy "%%f" libcore\bin\BearVPNCli.exe
echo 📝 复制并重命名为 HiFastVPNCli.exe
copy "%%f" libcore\bin\HiFastVPNCli.exe
echo ✅ 重命名完成
goto :dll
)
@@ -32,7 +32,7 @@ echo.
echo 📄 验证文件:
if exist libcore\bin (
dir libcore\bin
if exist libcore\bin\BearVPNCli.exe (
if exist libcore\bin\HiFastVPNCli.exe (
if exist libcore\bin\libcore.dll (
echo ✅ 验证成功:所有文件已正确复制
exit /b 0
@@ -41,7 +41,7 @@ if exist libcore\bin (
exit /b 1
)
) else (
echo ❌ 验证失败:BearVPNCli.exe 不存在
echo ❌ 验证失败:HiFastVPNCli.exe 不存在
exit /b 1
)
) else (
@@ -59,6 +59,8 @@ class UserInfoCard extends StatelessWidget {
children: [
Text(
'ID: $userId',
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: TextStyle(
color: Colors.white,
fontSize: 14.sp,
@@ -298,7 +298,7 @@ class KRAuthApi {
BaseResponse<dynamic> baseResponse = await HttpUtil.getInstance()
.request<dynamic>(Api.kr_deleteAccount, data,
method: HttpMethod.DELETE, isShowLoading: true);
method: HttpMethod.POST, isShowLoading: true);
if (!baseResponse.isSuccess) {
return left(
HttpError(msg: baseResponse.retMsg, code: baseResponse.retCode));
+2 -2
View File
@@ -309,7 +309,7 @@ class KRSubscribeService {
// 保存配置
KRSingBoxImp.instance.kr_saveOutbounds(listModel.configJsonList);
KRSingBoxImp.instance.kr_saveAllOutbounds(listModel.configJsonList);
KRSingBoxImp.instance.kr_saveAllOutbounds(listModel.countryOutboundList);
// 更新试用和订阅状态
_kr_updateSubscribeStatus();
@@ -662,7 +662,7 @@ class KRSubscribeService {
// 保存配置
KRSingBoxImp.instance.kr_saveOutbounds(listModel.configJsonList);
KRSingBoxImp.instance.kr_saveAllOutbounds(listModel.configJsonList);
KRSingBoxImp.instance.kr_saveAllOutbounds(listModel.countryOutboundList);
// 更新试用和订阅状态
_kr_updateSubscribeStatus();
@@ -19,6 +19,8 @@ import '../../../singbox/model/singbox_config_option.dart';
import '../../../singbox/model/singbox_outbound.dart';
import '../../../singbox/model/singbox_stats.dart';
import '../../../singbox/model/singbox_status.dart';
import '../../model/business/kr_group_outbound_list.dart';
import '../../model/business/kr_outbound_item.dart';
import '../../utils/kr_country_util.dart';
import '../../utils/kr_log_util.dart';
import '../../utils/kr_secure_storage.dart';
@@ -66,7 +68,7 @@ class KRSingBoxImp {
Map<String, dynamic> kr_configOption = {};
List<Map<String, dynamic>> kr_outbounds = [];
List<Map<String, dynamic>> Kr_allOutbounds = [];
List<KRCountryOutboundList> Kr_allOutbounds = [];
/// 首次启动
RxBool kr_isFristStart = false.obs;
@@ -1202,8 +1204,13 @@ class KRSingBoxImp {
// print("错误堆栈: $stack");
// }
// }
void kr_saveAllOutbounds(List<Map<String, dynamic>> outbounds) {
void kr_saveAllOutbounds(List<KRCountryOutboundList> outbounds) {
Kr_allOutbounds = outbounds;
KRLogUtil.kr_i('📊 保存国家分组: ${Kr_allOutbounds.length}', tag: 'SingBox');
for (int i = 0; i < Kr_allOutbounds.length; i++) {
final c = Kr_allOutbounds[i];
KRLogUtil.kr_i(' group[$i] country="${c.country}" outbounds=${c.outboundList.length}', tag: 'SingBox');
}
}
/// 保存配置文件
void kr_saveOutbounds(List<Map<String, dynamic>> outbounds) async {
@@ -1457,18 +1464,40 @@ class KRSingBoxImp {
if (kr_outbounds.isNotEmpty) {
KRLogUtil.kr_i('🔄 启动前强制重新生成配置文件...', tag: 'SingBox');
final selectedNode = await KRSecureStorage().kr_readData(key: _keySelectedNode);
var toSave = Kr_allOutbounds;
KRLogUtil.kr_i('📊 国家分组数量: ${Kr_allOutbounds.length}', tag: 'SingBox');
for (int i = 0; i < Kr_allOutbounds.length; i++) {
final g = Kr_allOutbounds[i];
KRLogUtil.kr_i('Kr_allOutbounds[$i] country="${g.country}" outbounds=${g.outboundList.length}', tag: 'SingBox');
}
List<Map<String, dynamic>> toSave = [];
if (selectedNode != null && selectedNode.endsWith('-auto')) {
KRLogUtil.kr_i('🤖 检测到自动国家节点: $selectedNode', tag: 'SingBox');
final selectedCountry = selectedNode.replaceAll(RegExp(r'-auto$'), '');
toSave = Kr_allOutbounds.where((o) {
final country = o['country']?.toString() ?? '';
if (country.isNotEmpty) return country == selectedCountry;
final tag = o['tag']?.toString() ?? '';
if (tag == selectedNode) return true;
return tag.toLowerCase().contains(selectedCountry.toLowerCase());
}).toList();
KRLogUtil.kr_i('✅ 自动国家过滤: ${toSave.length}/${Kr_allOutbounds.length}', tag: 'SingBox');
String selectedCountry = selectedNode.replaceAll(RegExp(r'-auto$'), '');
final selectedCountryLower = selectedCountry.toLowerCase();
final matchedGroup = Kr_allOutbounds.firstWhere(
(g) => g.country.toLowerCase() == selectedCountryLower,
orElse: () => KRCountryOutboundList(country: '', outboundList: []),
);
if (matchedGroup.country.isNotEmpty) {
KRLogUtil.kr_i('🎯 命中分组: ${matchedGroup.country}, 节点数: ${matchedGroup.outboundList.length}', tag: 'SingBox');
toSave = matchedGroup.outboundList.map((it) => it.config).toList();
} else {
for (final g in Kr_allOutbounds) {
for (final it in g.outboundList) {
final tagLower = it.tag.toLowerCase();
if (tagLower == selectedNode.toLowerCase() || tagLower.contains(selectedCountryLower)) {
toSave.add(it.config);
}
}
}
}
KRLogUtil.kr_i('✅ 自动国家过滤: ${toSave.length}', tag: 'SingBox');
} else {
for (final g in Kr_allOutbounds) {
for (final it in g.outboundList) {
toSave.add(it.config);
}
}
}
kr_saveOutbounds(toSave);
await Future.delayed(const Duration(milliseconds: 100));
+1 -1
View File
@@ -114,7 +114,7 @@ install(FILES "../libcore/bin/lib/libcore.so" DESTINATION "${INSTALL_BUNDLE_LIB_
install(
FILES "../libcore/bin/HiddifyCli"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime RENAME BearVPNCli
COMPONENT Runtime RENAME HiFastVPNCli
)
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
+3 -3
View File
@@ -7,7 +7,7 @@ export LD_LIBRARY_PATH=usr/lib
show_help() {
cat << EOF
Usage: ${0##*/} ...
start Hiddify or BearVPNCli, when no parameter is given, Hiddify is executed.
start Hiddify or HiFastVPNCli, when no parameter is given, Hiddify is executed.
-v show version
EOF
}
@@ -30,8 +30,8 @@ else
# processing arguments
case $1 in
BearVPNCli)
exec ./BearVPNCli ${@:3}
HiFastVPNCli)
exec ./HiFastVPNCli ${@:3}
exit 0
;;
h)
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# BearVPN macOS 公证脚本
# HiFastVPN macOS 公证脚本
# 作者: AI Assistant
set -e
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# BearVPN macOS 签名、公证和打包脚本
# HiFastVPN macOS 签名、公证和打包脚本
# 作者: AI Assistant
# 日期: $(date)
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/bash
# BearVPN macOS 签名和打包脚本
# HiFastVPN macOS 签名和打包脚本
# 作者: AI Assistant
# 日期: $(date)
+6 -6
View File
@@ -100,7 +100,7 @@ endif()
set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data")
set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}")
# CLI 工具目录(用于存放 BearVPNCli.exe
# CLI 工具目录(用于存放 HiFastVPNCli.exe
set(INSTALL_BUNDLE_CLI_DIR "${CMAKE_INSTALL_PREFIX}/cli")
install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}"
@@ -112,16 +112,16 @@ install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}
install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime)
# 安装 libcore.dll 到可执行文件目录(与 BearVPN.exe 同级)
# 安装 libcore.dll 到可执行文件目录(与 HiFastVPN.exe 同级)
install(FILES "../libcore/bin/libcore.dll"
DESTINATION "${INSTALL_BUNDLE_LIB_DIR}"
COMPONENT Runtime
OPTIONAL)
# 安装 BearVPNCli.exe(从 libcore/bin 复制并重命名)
# 注意:libcore 编译的是 HiddifyCli.exe,打包脚本会自动重命名为 BearVPNCli.exe
# 这里需要安装 BearVPNCli.exe,因为它已经被重命名了
install(FILES "../libcore/bin/BearVPNCli.exe"
# 安装 HiFastVPNCli.exe(从 libcore/bin 复制并重命名)
# 注意:libcore 编译的是 HiddifyCli.exe,打包脚本会重命名为HiFastVPNCli.exe
# 这里需要安装 HiFastVPNCli.exe,因为它已经被重命名了
install(FILES "../libcore/bin/HiFastVPNCli.exe"
DESTINATION "${CMAKE_INSTALL_PREFIX}"
COMPONENT Runtime
OPTIONAL)