Update: 2026-07-26 02:51:53
This commit is contained in:
@@ -8,6 +8,7 @@ import 'package:jailbreak_root_detection/jailbreak_root_detection.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import '../../main.dart';
|
||||
import '../../print.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
|
||||
class DeviceHelper {
|
||||
static Future<String> getDeviceFingerprint() async {
|
||||
@@ -15,11 +16,15 @@ class DeviceHelper {
|
||||
Map<String, dynamic> deviceData;
|
||||
|
||||
try {
|
||||
if (kIsWeb) {
|
||||
WebBrowserInfo webInfo = await deviceInfoPlugin.webBrowserInfo;
|
||||
return '${webInfo.vendor}_${webInfo.browserName.name}';
|
||||
}
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
// Fetch Android-specific device information
|
||||
AndroidDeviceInfo androidInfo = await deviceInfoPlugin.androidInfo;
|
||||
deviceData = androidInfo.toMap(); // Convert to a map for easier access
|
||||
// Log.print('deviceData: ${jsonEncode(deviceData)}');
|
||||
} else if (Platform.isIOS) {
|
||||
// Fetch iOS-specific device information
|
||||
IosDeviceInfo iosInfo = await deviceInfoPlugin.iosInfo;
|
||||
@@ -29,7 +34,7 @@ class DeviceHelper {
|
||||
MacOsDeviceInfo macInfo = await deviceInfoPlugin.macOsInfo;
|
||||
deviceData = macInfo.toMap();
|
||||
} else {
|
||||
throw UnsupportedError('Unsupported platform');
|
||||
return 'unknown_platform';
|
||||
}
|
||||
|
||||
String deviceId = 'unknown';
|
||||
|
||||
Reference in New Issue
Block a user