mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-12 05:41:37 +08:00
@@ -2,18 +2,15 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:PiliPlus/http/api.dart';
|
||||
import 'package:PiliPlus/http/constants.dart';
|
||||
import 'package:PiliPlus/http/loading_state.dart';
|
||||
import 'package:PiliPlus/http/retry_interceptor.dart';
|
||||
import 'package:PiliPlus/http/user.dart';
|
||||
import 'package:PiliPlus/utils/accounts.dart';
|
||||
import 'package:PiliPlus/utils/accounts/account.dart';
|
||||
import 'package:PiliPlus/utils/accounts/account_manager/account_mgr.dart';
|
||||
import 'package:PiliPlus/utils/global_data.dart';
|
||||
import 'package:PiliPlus/utils/login_utils.dart';
|
||||
import 'package:PiliPlus/utils/storage_pref.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:archive/archive.dart';
|
||||
import 'package:brotli/brotli.dart';
|
||||
import 'package:dio/dio.dart';
|
||||
@@ -57,46 +54,46 @@ class Request {
|
||||
}
|
||||
}
|
||||
|
||||
static Future<void> buvidActive(Account account) async {
|
||||
// 这样线程不安全, 但仍按预期进行
|
||||
if (account.activated) return;
|
||||
account.activated = true;
|
||||
try {
|
||||
// final html = await Request().get(Api.dynamicSpmPrefix,
|
||||
// options: Options(extra: {'account': account}));
|
||||
// final String spmPrefix = _spmPrefixExp.firstMatch(html.data)!.group(1)!;
|
||||
final String randPngEnd = base64.encode([
|
||||
...Iterable<int>.generate(32, (_) => Utils.random.nextInt(256)),
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
73,
|
||||
69,
|
||||
78,
|
||||
68,
|
||||
...Iterable<int>.generate(4, (_) => Utils.random.nextInt(256)),
|
||||
]);
|
||||
|
||||
final jsonData = json.encode({
|
||||
'3064': 1,
|
||||
'39c8': '333.1387.fp.risk',
|
||||
'3c43': {
|
||||
'adca': 'Linux',
|
||||
'bfe9': randPngEnd.substring(randPngEnd.length - 50),
|
||||
},
|
||||
});
|
||||
|
||||
await Request().post(
|
||||
Api.activateBuvidApi,
|
||||
data: {'payload': jsonData},
|
||||
options: Options(
|
||||
extra: {'account': account},
|
||||
contentType: Headers.jsonContentType,
|
||||
),
|
||||
);
|
||||
} catch (_) {}
|
||||
}
|
||||
// static Future<void> buvidActive(Account account) async {
|
||||
// // 这样线程不安全, 但仍按预期进行
|
||||
// if (account.activated) return;
|
||||
// account.activated = true;
|
||||
// try {
|
||||
// // final html = await Request().get(Api.dynamicSpmPrefix,
|
||||
// // options: Options(extra: {'account': account}));
|
||||
// // final String spmPrefix = _spmPrefixExp.firstMatch(html.data)!.group(1)!;
|
||||
// final String randPngEnd = base64.encode([
|
||||
// ...Iterable<int>.generate(32, (_) => Utils.random.nextInt(256)),
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 0,
|
||||
// 73,
|
||||
// 69,
|
||||
// 78,
|
||||
// 68,
|
||||
// ...Iterable<int>.generate(4, (_) => Utils.random.nextInt(256)),
|
||||
// ]);
|
||||
//
|
||||
// final jsonData = json.encode({
|
||||
// '3064': 1,
|
||||
// '39c8': '333.1387.fp.risk',
|
||||
// '3c43': {
|
||||
// 'adca': 'Linux',
|
||||
// 'bfe9': randPngEnd.substring(randPngEnd.length - 50),
|
||||
// },
|
||||
// });
|
||||
//
|
||||
// await Request().post(
|
||||
// Api.activateBuvidApi,
|
||||
// data: {'payload': jsonData},
|
||||
// options: Options(
|
||||
// extra: {'account': account},
|
||||
// contentType: Headers.jsonContentType,
|
||||
// ),
|
||||
// );
|
||||
// } catch (_) {}
|
||||
// }
|
||||
|
||||
static Dio _cloneHttp11Dio() {
|
||||
final h11 = dio.clone(
|
||||
|
||||
Reference in New Issue
Block a user