mirror of
https://github.com/Simplxss/SignerServer.git
synced 2024-11-21 00:37:53 +08:00
64 lines
1.7 KiB
JavaScript
64 lines
1.7 KiB
JavaScript
const path = require('node:path');
|
|
const os = require('node:os');
|
|
|
|
const exePath = path.dirname(process.execPath);
|
|
|
|
let QQWrapper, appid, qua;
|
|
|
|
if (os.platform() === "win32") {
|
|
const versionConfig = require(path.join(exePath, "resources/app/versions/config.json"));
|
|
QQWrapper = require(path.join(exePath, "resources/app/versions", versionConfig.curVersion, "wrapper.node"));
|
|
appid = "537226655"; // 9.9.12-25234
|
|
qua = `V1_WIN_NQ_${versionConfig.curVersion.replace("-", "_")}_GW_B`;
|
|
} else {
|
|
const qqPkgInfo = require(path.join(exePath, "resources/app/package.json"));
|
|
QQWrapper = require(path.join(exePath, "resources/app/wrapper.node"));
|
|
appid = "537226441";
|
|
qua = qqPkgInfo.qua;
|
|
}
|
|
|
|
class GlobalAdapter {
|
|
onLog(...args) {
|
|
}
|
|
onGetSrvCalTime(...args) {
|
|
}
|
|
onShowErrUITips(...args) {
|
|
}
|
|
fixPicImgType(...args) {
|
|
}
|
|
getAppSetting(...args) {
|
|
}
|
|
onInstallFinished(...args) {
|
|
}
|
|
onUpdateGeneralFlag(...args) {
|
|
}
|
|
onGetOfflineMsg(...args) {
|
|
}
|
|
}
|
|
|
|
const dataPathGlobal = "/root"
|
|
|
|
const engine = new QQWrapper.NodeIQQNTWrapperEngine();
|
|
engine.initWithDeskTopConfig({
|
|
base_path_prefix: "",
|
|
platform_type: 3,
|
|
app_type: 4,
|
|
app_version: qqPkgInfo.version,
|
|
os_version: os.release(),
|
|
use_xlog: true,
|
|
qua: qua,
|
|
global_path_config: {
|
|
desktopGlobalPath: dataPathGlobal
|
|
},
|
|
thumb_config: { maxSide: 324, minSide: 48, longLimit: 6, density: 2 }
|
|
}, new QQWrapper.NodeIGlobalAdapter(new GlobalAdapter()));
|
|
|
|
const loginService = new QQWrapper.NodeIKernelLoginService();
|
|
loginService.initConfig({
|
|
machineId: "",
|
|
appid: appid,
|
|
platVer: os.release(),
|
|
commonPath: dataPathGlobal,
|
|
clientVer: qqPkgInfo.version,
|
|
hostName: os.hostname()
|
|
}); |