From 056e0adddf00cfe9df5581016f30aa716b7f10f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=8B=E7=93=9C=E4=B8=80=E5=8D=81=E9=9B=AA?= Date: Sun, 4 Aug 2024 14:39:45 +0800 Subject: [PATCH] build: 1.7.7-refactor --- src/common/utils/QQBasicInfo.ts | 7 ++++--- src/core/src/core.ts | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/utils/QQBasicInfo.ts b/src/common/utils/QQBasicInfo.ts index 87a2940c..bdcfac4a 100644 --- a/src/common/utils/QQBasicInfo.ts +++ b/src/common/utils/QQBasicInfo.ts @@ -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, diff --git a/src/core/src/core.ts b/src/core/src/core.ts index ab5108c5..24e180d3 100644 --- a/src/core/src/core.ts +++ b/src/core/src/core.ts @@ -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, },