refactor: 拆分主页与公共组件,扫码登录改走 WinHTTP
- 抽出 lib/core 的日期/JSON 工具,收敛各页重复解析 - 主页与音乐风险页拆成组件,风险功能共用一套运行框架 - 修复设置页作为主页页签保存时弹掉根路由导致的黑屏 - 登录对齐 Astral aimedb 协议:84 位二维码校验、签名与请求头修正, 补 GlobalSign 中间证书;Windows 改用 WinHTTP 绕过服务端对 BoringSSL 的 TLS 指纹拦截(证书校验保持开启) - 补开发预览数据与测试
This commit is contained in:
1 parent
0cb5320290
commit
e9357f5969
55 files changed
+4387
-3392
No files matched your search
@@ -14,9 +14,6 @@ class TitleServerConfig {
|
||||
final String regionName;
|
||||
final String placeName;
|
||||
final String keychipId;
|
||||
final String aimeUrl;
|
||||
final String aimeSalt;
|
||||
final String openGameID;
|
||||
|
||||
const TitleServerConfig({
|
||||
required this.titleServerUrl,
|
||||
@@ -30,14 +27,21 @@ class TitleServerConfig {
|
||||
this.regionName = '',
|
||||
this.placeName = '',
|
||||
this.keychipId = '',
|
||||
this.aimeUrl = '',
|
||||
this.aimeSalt = '',
|
||||
String? openGameID,
|
||||
}) : openGameID = openGameID ?? 'MAID';
|
||||
});
|
||||
|
||||
List<int> get aesKeyBytes => utf8.encode(aesKey);
|
||||
List<int> get aesIvBytes => utf8.encode(aesIv);
|
||||
|
||||
/// 扫码登录签的是**完整 Keychip**(`A63E-01C30471007`),游戏服务器那边才用
|
||||
/// 11 位短值。这里按 Astral 的约定补出完整形式:前 4 位 + 连字符 + 余下 + placeId,
|
||||
/// 所以只填了短值也能还原;填不满 11 位就当没配。
|
||||
String get fullKeychipId {
|
||||
final raw = keychipId.replaceAll(RegExp(r'[\s\-]'), '').toUpperCase();
|
||||
if (raw.length < 11) return '';
|
||||
final short = '${raw.substring(0, 4)}-${raw.substring(4)}';
|
||||
return raw.length == 11 ? '$short$placeId' : short;
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
'titleServerUrl': titleServerUrl,
|
||||
'aesKey': aesKey,
|
||||
@@ -50,9 +54,6 @@ class TitleServerConfig {
|
||||
'regionName': regionName,
|
||||
'placeName': placeName,
|
||||
'keychipId': keychipId,
|
||||
'aimeUrl': aimeUrl,
|
||||
'aimeSalt': aimeSalt,
|
||||
'openGameID': openGameID,
|
||||
};
|
||||
|
||||
factory TitleServerConfig.fromJson(Map<String, dynamic> json) {
|
||||
@@ -68,9 +69,6 @@ class TitleServerConfig {
|
||||
regionName: json['regionName'] as String? ?? '',
|
||||
placeName: json['placeName'] as String? ?? '',
|
||||
keychipId: json['keychipId'] as String? ?? '',
|
||||
aimeUrl: json['aimeUrl'] as String? ?? '',
|
||||
aimeSalt: json['aimeSalt'] as String? ?? '',
|
||||
openGameID: json['openGameID'] as String? ?? 'MAID',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user