refactor: 优化日志输出,仅在调试模式下启用

- 为所有 print 语句添加 kDebugMode 检查
- 更新 KRLogUtil 工具类,Release 模式下禁用日志输出
- 优化 18 个文件中的 335+ 条日志语句
- 提升 Release 版本性能并增强安全性

(cherry picked from commit 301f1510ba81fe94fb08e013ca80b3ca708a2e15)
This commit is contained in:
2025-11-01 05:15:34 -07:00
committed by speakeloudest
parent b3ee1cc6dc
commit 4c5763647d
18 changed files with 665 additions and 232 deletions
@@ -1,4 +1,4 @@
import 'dart:io';
import 'dart:io' as io;
import 'dart:math';
import 'dart:convert';
@@ -21,6 +21,8 @@ import '../kr_device_info_service.dart';
import '../kr_site_config_service.dart';
import '../../common/app_config.dart';
import 'package:dio/dio.dart' as dio;
import 'package:kaer_with_panels/app/services/singbox_imp/kr_sing_box_imp.dart';
import 'package:flutter/foundation.dart';
class KRAuthApi {
/// 检查账号是否已注册(仅支持邮箱)
@@ -465,17 +467,17 @@ class KRAuthApi {
}
String _kr_getUserAgent() {
if (Platform.isAndroid) {
if (io.Platform.isAndroid) {
return 'android';
} else if (Platform.isIOS) {
} else if (io.Platform.isIOS) {
return 'ios';
} else if (Platform.isMacOS) {
} else if (io.Platform.isMacOS) {
return 'mac';
} else if (Platform.isWindows) {
} else if (io.Platform.isWindows) {
return 'windows';
} else if (Platform.isLinux) {
} else if (io.Platform.isLinux) {
return 'linux';
} else if (Platform.isFuchsia) {
} else if (io.Platform.isFuchsia) {
return 'harmony';
} else {
return 'unknown';