mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-04-24 12:32:40 +08:00
committed by
GitHub
parent
3897efd82f
commit
349a4dfc0b
@@ -1,6 +1,5 @@
|
||||
import 'dart:async' show FutureOr;
|
||||
import 'dart:io' show Platform;
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:PiliPlus/grpc/grpc_req.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
@@ -21,13 +20,12 @@ import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/request_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter_inappwebview/flutter_inappwebview.dart' as web;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
abstract class LoginUtils {
|
||||
static final random = Random();
|
||||
|
||||
static FutureOr setWebCookie([Account? account]) {
|
||||
if (Platform.isWindows) {
|
||||
return null;
|
||||
@@ -163,7 +161,7 @@ abstract class LoginUtils {
|
||||
static String generateBuvid() {
|
||||
var md5Str = Iterable.generate(
|
||||
32,
|
||||
(_) => random.nextInt(16).toRadixString(16),
|
||||
(_) => Utils.random.nextInt(16).toRadixString(16),
|
||||
).join().toUpperCase();
|
||||
return 'XY${md5Str[2]}${md5Str[12]}${md5Str[22]}$md5Str';
|
||||
}
|
||||
@@ -188,11 +186,11 @@ abstract class LoginUtils {
|
||||
|
||||
final String randomHex32 = List.generate(
|
||||
32,
|
||||
(index) => random.nextInt(16).toRadixString(16),
|
||||
(index) => Utils.random.nextInt(16).toRadixString(16),
|
||||
).join();
|
||||
final String randomHex16 = List.generate(
|
||||
16,
|
||||
(index) => random.nextInt(16).toRadixString(16),
|
||||
(index) => Utils.random.nextInt(16).toRadixString(16),
|
||||
).join();
|
||||
|
||||
final String deviceID = randomHex32 + yyyyMMddHHmmss + randomHex16;
|
||||
|
||||
Reference in New Issue
Block a user