feat: 保存配置
This commit is contained in:
@@ -225,17 +225,21 @@ class KRDeviceInfoService {
|
||||
}
|
||||
|
||||
/// Windows设备ID - 使用机器GUID
|
||||
/// 🔧 修复:不使用 flutter_udid,因为它会调用 wmic 命令弹出黑窗口
|
||||
Future<String> _getWindowsDeviceId() async {
|
||||
try {
|
||||
final windowsInfo = await _deviceInfo.windowsInfo;
|
||||
|
||||
// 优先使用 flutter_udid
|
||||
String udid = await FlutterUdid.consistentUdid;
|
||||
// 🔧 修复:不使用 FlutterUdid.consistentUdid
|
||||
// 因为它在 Windows 上会调用 "cmd.exe /c wmic csproduct get UUID"
|
||||
// 这个调用没有使用 CREATE_NO_WINDOW 标志,会弹出黑色命令行窗口
|
||||
|
||||
// 直接使用 device_info_plus 提供的信息构建唯一标识
|
||||
// windowsInfo.deviceId 已经是一个稳定的设备标识
|
||||
|
||||
// 构建多因子字符串
|
||||
final factors = [
|
||||
udid,
|
||||
windowsInfo.deviceId, // 设备ID
|
||||
windowsInfo.deviceId, // 设备ID (最稳定,来自注册表 MachineGuid)
|
||||
windowsInfo.computerName, // 计算机名
|
||||
windowsInfo.productName, // 产品名
|
||||
windowsInfo.numberOfCores.toString(), // CPU核心数
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user