build: 1.7.7-refactor

This commit is contained in:
手瓜一十雪 2024-08-04 14:39:45 +08:00
parent b36388200d
commit 056e0adddf
2 changed files with 6 additions and 5 deletions

View File

@ -11,7 +11,7 @@ export let QQPackageInfoPath: string = path.join(path.dirname(QQMainPath), 'reso
export let QQVersionConfigPath: string | undefined = getQQVersionConfigPath(QQMainPath);
//基础信息获取 无快更则启用默认模板填充
export let QQVersionAppid: string = getAppidV2().appid;
export let { appid: QQVersionAppid, qua: QQVersionQua } = getAppidV2();
export let isQuickUpdate: boolean = !!QQVersionConfigPath;
export let QQVersionConfig: QQVersionConfigType = isQuickUpdate ? JSON.parse(fs.readFileSync(QQVersionConfigPath!).toString()) : getDefaultQQVersionConfigInfo();
export let QQPackageInfo: QQPackageInfoType = JSON.parse(fs.readFileSync(QQPackageInfoPath).toString());
@ -26,7 +26,8 @@ export function getFullQQVesion() {
export function requireMinNTQQBuild(buildStr: string) {
return parseInt(getQQBuildStr()) >= parseInt(buildStr);
}
export function getQUA() {
//此方法不要直接使用
export function getQUAInternal() {
return systemPlatform === 'linux' ? `V1_LNX_NQ_${getFullQQVesion()}_${getQQBuildStr()}_GW_B` : `V1_WIN_NQ_${getFullQQVesion()}_${getQQBuildStr()}_GW_B`;
}
export function getAppidV2(): { appid: string, qua: string } {
@ -41,7 +42,7 @@ export function getAppidV2(): { appid: string, qua: string } {
logNotice('[QQ版本兼容性检测] 版本兼容性不佳,可能会导致一些功能无法正常使用');
}
// 以下是兜底措施
return { appid: systemPlatform === 'linux' ? '537237950' : '537237765', qua: getQUA() };
return { appid: systemPlatform === 'linux' ? '537237950' : '537237765', qua: getQUAInternal() };
}
// platform_type: 3,
// app_type: 4,

View File

@ -15,7 +15,7 @@ import { DependsAdapter, DispatcherAdapter, GlobalAdapter, NodeIGlobalAdapter }
import path from 'node:path';
import os from 'node:os';
import fs from 'node:fs';
import { getFullQQVesion, getQUA, QQVersionAppid } from '@/common/utils/QQBasicInfo';
import { getFullQQVesion, QQVersionAppid, QQVersionQua } from '@/common/utils/QQBasicInfo';
import { hostname, systemVersion } from '@/common/utils/system';
import { genSessionConfig } from '@/core/sessionConfig';
import { sleep } from '@/common/utils/helper';
@ -142,7 +142,7 @@ export class NapCatCore {
app_version: getFullQQVesion(),
os_version: 'Windows 10 Pro',
use_xlog: true,
qua: getQUA(),
qua: QQVersionQua,
global_path_config: {
desktopGlobalPath: this.dataPathGlobal,
},