mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
35 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f1e8ef1cf6 | ||
![]() |
5e5ac0162e | ||
![]() |
0c013820f0 | ||
![]() |
4b3a9e5847 | ||
![]() |
e4982256a4 | ||
![]() |
babc4927a8 | ||
![]() |
6dd84cf469 | ||
![]() |
a8800e3899 | ||
![]() |
5f03496046 | ||
![]() |
41500c17a2 | ||
![]() |
2dcfde8b9a | ||
![]() |
5c3305d8fa | ||
![]() |
0d1fe99f53 | ||
![]() |
4c03ffeec7 | ||
![]() |
8101d17482 | ||
![]() |
bc7b4dcc2a | ||
![]() |
3db8b9078d | ||
![]() |
943dbbefd3 | ||
![]() |
480abcb853 | ||
![]() |
60aaaff58e | ||
![]() |
e3b889bbe8 | ||
![]() |
ac5506a43b | ||
![]() |
b29f533a3b | ||
![]() |
a8ee86b09e | ||
![]() |
0238c53302 | ||
![]() |
665e3c806f | ||
![]() |
8c96838441 | ||
![]() |
4a722daec6 | ||
![]() |
4e0cdbcb91 | ||
![]() |
08976624cd | ||
![]() |
fdeba94653 | ||
![]() |
d3b100b7e5 | ||
![]() |
1de3e18b08 | ||
![]() |
d5c3c95682 | ||
![]() |
dabe1e29ed |
@@ -1,9 +1,10 @@
|
||||
module.exports = {
|
||||
'env': {
|
||||
'browser': true,
|
||||
'es2021': true,
|
||||
'node': true
|
||||
},
|
||||
'ignorePatterns': ['src/core/', 'src/core.lib/'],
|
||||
'ignorePatterns': ['src/core/', 'src/core.lib/','src/proto/'],
|
||||
'extends': [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/recommended'
|
||||
|
15
docs/changelogs/CHANGELOG.v1.3.8.md
Normal file
15
docs/changelogs/CHANGELOG.v1.3.8.md
Normal file
@@ -0,0 +1,15 @@
|
||||
# v1.3.8
|
||||
|
||||
QQ Version: Windows 9.9.9-23873 / Linux 3.2.7-23361
|
||||
|
||||
## 修复与优化
|
||||
* 优化打包后体积问题
|
||||
* 修复QQ等级获取
|
||||
* 兼容 9.7.x 版本换行符 统一为 \n
|
||||
* 修复处理加群请求 字段异常情况
|
||||
* 修复退群通知问题
|
||||
|
||||
## 新增与调整
|
||||
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
11
docs/changelogs/CHANGELOG.v1.3.9.md
Normal file
11
docs/changelogs/CHANGELOG.v1.3.9.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# v1.3.9
|
||||
|
||||
QQ Version: Windows 9.9.9-23873 / Linux 3.2.7-23361
|
||||
|
||||
## 修复与优化
|
||||
* 修复QQ等级获取与兼容性问题
|
||||
|
||||
## 新增与调整
|
||||
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "1.3.6",
|
||||
"version": "1.3.9",
|
||||
"scripts": {
|
||||
"watch:dev": "vite --mode development",
|
||||
"watch:prod": "vite --mode production",
|
||||
@@ -19,7 +19,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@log4js-node/log4js-api": "^1.0.2",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@rollup/plugin-typescript": "^11.1.6",
|
||||
"@types/cors": "^2.8.17",
|
||||
@@ -44,10 +43,10 @@
|
||||
"vite": "^5.2.6",
|
||||
"vite-plugin-cp": "^4.0.8",
|
||||
"vite-plugin-dts": "^3.8.2",
|
||||
"vite-tsconfig-paths": "^4.3.2"
|
||||
"vite-tsconfig-paths": "^4.3.2",
|
||||
"@protobuf-ts/plugin": "^2.9.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"@protobuf-ts/plugin": "^2.9.4",
|
||||
"ajv": "^8.13.0",
|
||||
"commander": "^12.0.0",
|
||||
"cors": "^2.8.5",
|
||||
|
@@ -15,4 +15,4 @@ for %%a in ("!RetString!") do (
|
||||
set "QQPath=!pathWithoutUninstall!QQ.exe"
|
||||
set ELECTRON_RUN_AS_NODE=1
|
||||
echo !QQPath!
|
||||
"!QQPath!" ./napcat.cjs %*
|
||||
"!QQPath!" ./napcat.mjs %*
|
||||
|
@@ -37,7 +37,7 @@ if (!(Test-Path $QQpath)) {
|
||||
throw "provided QQ path is invalid: $QQpath"
|
||||
}
|
||||
|
||||
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
|
||||
$Bootfile = Join-Path $PSScriptRoot "napcat.mjs"
|
||||
$env:ELECTRON_RUN_AS_NODE = 1
|
||||
$commandInfo = Get-Command $QQpath -ErrorAction Stop
|
||||
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' $Bootfile $params}"
|
@@ -14,4 +14,4 @@ for %%a in ("!RetString!") do (
|
||||
set "QQPath=!pathWithoutUninstall!QQ.exe"
|
||||
set ELECTRON_RUN_AS_NODE=1
|
||||
echo !QQPath!
|
||||
"!QQPath!" ./napcat.cjs %*
|
||||
"!QQPath!" ./napcat.mjs %*
|
||||
|
@@ -37,7 +37,7 @@ if (!(Test-Path $QQpath)) {
|
||||
throw "provided QQ path is invalid: $QQpath"
|
||||
}
|
||||
|
||||
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
|
||||
$Bootfile = Join-Path $PSScriptRoot "napcat.mjs"
|
||||
$env:ELECTRON_RUN_AS_NODE = 1
|
||||
$commandInfo = Get-Command $QQpath -ErrorAction Stop
|
||||
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$($commandInfo.Path)' $Bootfile $params}"
|
@@ -18,4 +18,4 @@ if ! [ -x /opt/QQ/qq ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
/opt/QQ/qq "${SCRIPT_DIR}/napcat.cjs" "$@"
|
||||
/opt/QQ/qq "${SCRIPT_DIR}/napcat.mjs" "$@"
|
||||
|
@@ -1,6 +1,12 @@
|
||||
import path from 'node:path';
|
||||
import fs from 'node:fs';
|
||||
import { log, logDebug, logError } from '@/common/utils/log';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const configDir = path.resolve(__dirname, 'config');
|
||||
fs.mkdirSync(configDir, { recursive: true });
|
||||
|
@@ -55,7 +55,7 @@ if (fs.existsSync(configVersionInfoPath)) {
|
||||
|
||||
export const qqVersionConfigInfo: QQVersionConfigInfo = _qqVersionConfigInfo;
|
||||
|
||||
export const qqPkgInfo: QQPkgInfo = require(pkgInfoPath);
|
||||
export const qqPkgInfo: QQPkgInfo = JSON.parse(fs.readFileSync(pkgInfoPath).toString());
|
||||
// platform_type: 3,
|
||||
// app_type: 4,
|
||||
// app_version: '9.9.9-23159',
|
||||
|
@@ -1,7 +1,12 @@
|
||||
import * as os from 'os';
|
||||
import path from 'node:path';
|
||||
import fs from 'fs';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
export function getModuleWithArchName(moduleName: string) {
|
||||
const systemPlatform = os.platform();
|
||||
const cpuArch = os.arch();
|
||||
@@ -14,6 +19,6 @@ export function cpModule(moduleName: string) {
|
||||
try {
|
||||
fs.copyFileSync(path.join(currentDir, fileName), path.join(currentDir, `${moduleName}.node`));
|
||||
} catch (e) {
|
||||
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
@@ -2,6 +2,12 @@ import crypto from 'node:crypto';
|
||||
import path from 'node:path';
|
||||
import fs from 'fs/promises';
|
||||
import { log, logDebug } from './log';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
export function sleep(ms: number): Promise<void> {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
@@ -147,12 +153,27 @@ export async function UpdateConfig() {
|
||||
const configFiles = await fs.readdir(path.join(__dirname, 'config'));
|
||||
for (const file of configFiles) {
|
||||
if (file.match(/^onebot11_\d+.json$/)) {
|
||||
let CurrentConfig = JSON.parse(await fs.readFile(path.join(__dirname, 'config', file), 'utf8'));
|
||||
const CurrentConfig = JSON.parse(await fs.readFile(path.join(__dirname, 'config', file), 'utf8'));
|
||||
if (isValidOldConfig(CurrentConfig)) {
|
||||
log("正在迁移旧配置到新配置 File:", file);
|
||||
let NewConfig = migrateConfig(CurrentConfig);
|
||||
log('正在迁移旧配置到新配置 File:', file);
|
||||
const NewConfig = migrateConfig(CurrentConfig);
|
||||
await fs.writeFile(path.join(__dirname, 'config', file), JSON.stringify(NewConfig, null, 2));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
export function isEqual(obj1: any, obj2: any) {
|
||||
if (obj1 === obj2) return true;
|
||||
if (obj1 == null || obj2 == null) return false;
|
||||
if (typeof obj1 !== 'object' || typeof obj2 !== 'object') return obj1 === obj2;
|
||||
|
||||
const keys1 = Object.keys(obj1);
|
||||
const keys2 = Object.keys(obj2);
|
||||
|
||||
if (keys1.length !== keys2.length) return false;
|
||||
|
||||
for (const key of keys1) {
|
||||
if (!isEqual(obj1[key], obj2[key])) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
@@ -2,6 +2,12 @@ import log4js, { Configuration } from 'log4js';
|
||||
import { truncateString } from '@/common/utils/helper';
|
||||
import path from 'node:path';
|
||||
import { SelfInfo } from '@/core';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
export enum LogLevel {
|
||||
DEBUG = 'debug',
|
||||
|
@@ -1,37 +1,44 @@
|
||||
import { resolve } from "node:path";
|
||||
import { spawn } from "node:child_process";
|
||||
import { resolve } from 'node:path';
|
||||
import { spawn } from 'node:child_process';
|
||||
import { pid, ppid, exit } from 'node:process';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
export async function rebootWithQuickLogin(uin: string) {
|
||||
let batScript = resolve(__dirname, './napcat.bat');
|
||||
let batUtf8Script = resolve(__dirname, './napcat-utf8.bat');
|
||||
let bashScript = resolve(__dirname, './napcat.sh');
|
||||
if (process.platform === 'win32') {
|
||||
const subProcess = spawn(`start ${batUtf8Script} -q ${uin}`, { detached: true, windowsHide: false, env: process.env, shell: true, stdio: 'ignore' });
|
||||
subProcess.unref();
|
||||
// 子父进程一起送走 有点效果
|
||||
spawn('cmd /c taskkill /t /f /pid ' + pid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
spawn('cmd /c taskkill /t /f /pid ' + ppid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
} else if (process.platform === 'linux') {
|
||||
const subProcess = spawn(`${bashScript} -q ${uin}`, { detached: true, windowsHide: false, env: process.env, shell: true, stdio: 'ignore' });
|
||||
//还没兼容
|
||||
subProcess.unref();
|
||||
exit(0);
|
||||
}
|
||||
//exit(0);
|
||||
const batScript = resolve(__dirname, './napcat.bat');
|
||||
const batUtf8Script = resolve(__dirname, './napcat-utf8.bat');
|
||||
const bashScript = resolve(__dirname, './napcat.sh');
|
||||
if (process.platform === 'win32') {
|
||||
const subProcess = spawn(`start ${batUtf8Script} -q ${uin}`, { detached: true, windowsHide: false, env: process.env, shell: true, stdio: 'ignore' });
|
||||
subProcess.unref();
|
||||
// 子父进程一起送走 有点效果
|
||||
spawn('cmd /c taskkill /t /f /pid ' + pid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
spawn('cmd /c taskkill /t /f /pid ' + ppid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
} else if (process.platform === 'linux') {
|
||||
const subProcess = spawn(`${bashScript} -q ${uin}`, { detached: true, windowsHide: false, env: process.env, shell: true, stdio: 'ignore' });
|
||||
//还没兼容
|
||||
subProcess.unref();
|
||||
exit(0);
|
||||
}
|
||||
//exit(0);
|
||||
}
|
||||
export async function rebootWithNormolLogin() {
|
||||
let batScript = resolve(__dirname, './napcat.bat');
|
||||
let batUtf8Script = resolve(__dirname, './napcat-utf8.bat');
|
||||
let bashScript = resolve(__dirname, './napcat.sh');
|
||||
if (process.platform === 'win32') {
|
||||
const subProcess = spawn(`start ${batUtf8Script} `, { detached: true, windowsHide: false, env: process.env, shell: true, stdio: 'ignore' });
|
||||
subProcess.unref();
|
||||
// 子父进程一起送走 有点效果
|
||||
spawn('cmd /c taskkill /t /f /pid ' + pid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
spawn('cmd /c taskkill /t /f /pid ' + ppid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
} else if (process.platform === 'linux') {
|
||||
const subProcess = spawn(`${bashScript}`, { detached: true, windowsHide: false, env: process.env, shell: true });
|
||||
subProcess.unref();
|
||||
exit(0);
|
||||
}
|
||||
const batScript = resolve(__dirname, './napcat.bat');
|
||||
const batUtf8Script = resolve(__dirname, './napcat-utf8.bat');
|
||||
const bashScript = resolve(__dirname, './napcat.sh');
|
||||
if (process.platform === 'win32') {
|
||||
const subProcess = spawn(`start ${batUtf8Script} `, { detached: true, windowsHide: false, env: process.env, shell: true, stdio: 'ignore' });
|
||||
subProcess.unref();
|
||||
// 子父进程一起送走 有点效果
|
||||
spawn('cmd /c taskkill /t /f /pid ' + pid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
spawn('cmd /c taskkill /t /f /pid ' + ppid.toString(), { detached: true, shell: true, stdio: 'ignore' });
|
||||
} else if (process.platform === 'linux') {
|
||||
const subProcess = spawn(`${bashScript}`, { detached: true, windowsHide: false, env: process.env, shell: true });
|
||||
subProcess.unref();
|
||||
exit(0);
|
||||
}
|
||||
}
|
@@ -31,7 +31,7 @@ export class RequestUtil {
|
||||
|
||||
// 请求和回复都是JSON data传原始内容 自动编码json
|
||||
static async HttpGetJson<T>(url: string, method: string = 'GET', data?: any, headers: Record<string, string> = {}, isJsonRet: boolean = true, isArgJson: boolean = true): Promise<T> {
|
||||
let option = new URL(url);
|
||||
const option = new URL(url);
|
||||
const protocol = url.startsWith('https://') ? https : http;
|
||||
const options = {
|
||||
hostname: option.hostname,
|
||||
|
@@ -2,30 +2,30 @@
|
||||
* 运行时类型转换与检查类
|
||||
*/
|
||||
export class TypeCheck {
|
||||
static isEmpty(value: any): boolean {
|
||||
return value === null || value === undefined || value === '' ||
|
||||
static isEmpty(value: any): boolean {
|
||||
return value === null || value === undefined || value === '' ||
|
||||
(Array.isArray(value) && value.length === 0) || (typeof value === 'object' && Object.keys(value).length === 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export class TypeConvert {
|
||||
static toNumber(value: any): number {
|
||||
const num = Number(value);
|
||||
if (isNaN(num)) {
|
||||
throw new Error(`无法将输入转换为数字: ${value}`);
|
||||
}
|
||||
return num;
|
||||
static toNumber(value: any): number {
|
||||
const num = Number(value);
|
||||
if (isNaN(num)) {
|
||||
throw new Error(`无法将输入转换为数字: ${value}`);
|
||||
}
|
||||
return num;
|
||||
}
|
||||
|
||||
static toString(value: any): string {
|
||||
return String(value);
|
||||
}
|
||||
static toString(value: any): string {
|
||||
return String(value);
|
||||
}
|
||||
|
||||
static toBoolean(value: any): boolean {
|
||||
return Boolean(value);
|
||||
}
|
||||
static toBoolean(value: any): boolean {
|
||||
return Boolean(value);
|
||||
}
|
||||
|
||||
static toArray(value: any): any[] {
|
||||
return Array.isArray(value) ? value : [value];
|
||||
}
|
||||
static toArray(value: any): any[] {
|
||||
return Array.isArray(value) ? value : [value];
|
||||
}
|
||||
}
|
2
src/core
2
src/core
Submodule src/core updated: 00d059a88e...5572791869
@@ -1 +1 @@
|
||||
var _0x312801=_0x226a;(function(_0x2467bd,_0x1ea46c){var _0x55b3b9=_0x226a,_0xc5a225=_0x2467bd();while(!![]){try{var _0x37ca7d=-parseInt(_0x55b3b9(0xb8))/0x1*(-parseInt(_0x55b3b9(0xb7))/0x2)+parseInt(_0x55b3b9(0xbe))/0x3*(-parseInt(_0x55b3b9(0xb6))/0x4)+-parseInt(_0x55b3b9(0xba))/0x5*(parseInt(_0x55b3b9(0xbd))/0x6)+parseInt(_0x55b3b9(0xbf))/0x7+-parseInt(_0x55b3b9(0xbb))/0x8+-parseInt(_0x55b3b9(0xc0))/0x9+-parseInt(_0x55b3b9(0xbc))/0xa*(-parseInt(_0x55b3b9(0xb9))/0xb);if(_0x37ca7d===_0x1ea46c)break;else _0xc5a225['push'](_0xc5a225['shift']());}catch(_0x37c00a){_0xc5a225['push'](_0xc5a225['shift']());}}}(_0x3f33,0xa7262));function _0x226a(_0x147607,_0x4d8036){var _0x3f3311=_0x3f33();return _0x226a=function(_0x226afb,_0x3c304e){_0x226afb=_0x226afb-0xb5;var _0x4481fe=_0x3f3311[_0x226afb];return _0x4481fe;},_0x226a(_0x147607,_0x4d8036);}function _0x3f33(){var _0x49480f=['109615yGGBGb','417840uZphAj','6916336dArrkB','3280WaNFfO','84tMzoBS','2219037UDDDKL','8472464uELZIr','11638368bueewF','onMSFStatusChange','getGroupCode','4vhGRRP','546190CcHtON','1ZYSbWg'];_0x3f33=function(){return _0x49480f;};return _0x3f33();}export class DependsAdapter{[_0x312801(0xc1)](_0x1bb24c,_0x487012){}['onMSFSsoError'](_0x41a22e){}[_0x312801(0xb5)](_0x487b3b){}}
|
||||
function _0x3ffb(_0x1c9d40,_0x5c0f27){var _0x3f6fc1=_0x3f6f();return _0x3ffb=function(_0x3ffb38,_0x271006){_0x3ffb38=_0x3ffb38-0x106;var _0x4276a5=_0x3f6fc1[_0x3ffb38];return _0x4276a5;},_0x3ffb(_0x1c9d40,_0x5c0f27);}function _0x3f6f(){var _0x424618=['getGroupCode','1741044ILxECp','9UQYNaS','onMSFStatusChange','2991672SkTikU','1460KsUXQA','4776496veTTGZ','12661LifKnO','onMSFSsoError','129RqxIOj','5YyHkMs','445732NKyeiU','17092eYzbuN','2609103PKGyhk'];_0x3f6f=function(){return _0x424618;};return _0x3f6f();}var _0x4b3ca7=_0x3ffb;(function(_0x33ead7,_0x3bd86f){var _0x32553b=_0x3ffb,_0x4adca9=_0x33ead7();while(!![]){try{var _0x3ec3d5=parseInt(_0x32553b(0x108))/0x1+parseInt(_0x32553b(0x10c))/0x2+parseInt(_0x32553b(0x106))/0x3*(-parseInt(_0x32553b(0x109))/0x4)+parseInt(_0x32553b(0x107))/0x5*(parseInt(_0x32553b(0x10f))/0x6)+-parseInt(_0x32553b(0x10a))/0x7+-parseInt(_0x32553b(0x111))/0x8*(parseInt(_0x32553b(0x10d))/0x9)+parseInt(_0x32553b(0x110))/0xa*(-parseInt(_0x32553b(0x112))/0xb);if(_0x3ec3d5===_0x3bd86f)break;else _0x4adca9['push'](_0x4adca9['shift']());}catch(_0x38a67f){_0x4adca9['push'](_0x4adca9['shift']());}}}(_0x3f6f,0x786ea));export class DependsAdapter{[_0x4b3ca7(0x10e)](_0x3c085d,_0x69bfec){}[_0x4b3ca7(0x113)](_0x37eb86){}[_0x4b3ca7(0x10b)](_0x115358){}}
|
@@ -1 +1 @@
|
||||
function _0xd918(_0x41483d,_0x889907){var _0x58bf19=_0x58bf();return _0xd918=function(_0xd918d8,_0x1ca855){_0xd918d8=_0xd918d8-0x1a8;var _0x922fac=_0x58bf19[_0xd918d8];return _0x922fac;},_0xd918(_0x41483d,_0x889907);}var _0x2ff274=_0xd918;(function(_0x4e51bb,_0x3ea197){var _0x37f53a=_0xd918,_0x443375=_0x4e51bb();while(!![]){try{var _0x1e5344=-parseInt(_0x37f53a(0x1ad))/0x1+parseInt(_0x37f53a(0x1af))/0x2+parseInt(_0x37f53a(0x1ac))/0x3*(parseInt(_0x37f53a(0x1b0))/0x4)+-parseInt(_0x37f53a(0x1b4))/0x5*(parseInt(_0x37f53a(0x1ae))/0x6)+parseInt(_0x37f53a(0x1a9))/0x7*(-parseInt(_0x37f53a(0x1ab))/0x8)+-parseInt(_0x37f53a(0x1aa))/0x9+parseInt(_0x37f53a(0x1b2))/0xa;if(_0x1e5344===_0x3ea197)break;else _0x443375['push'](_0x443375['shift']());}catch(_0x35dc93){_0x443375['push'](_0x443375['shift']());}}}(_0x58bf,0x469fd));export class DispatcherAdapter{[_0x2ff274(0x1b3)](_0x1d95f2){}[_0x2ff274(0x1a8)](_0x3ea26c){}[_0x2ff274(0x1b1)](_0x10acdf){}}function _0x58bf(){var _0x4f3322=['dispatchRequest','2046670cXvFGX','dispatchCall','21STBWCf','2445264sDyRrR','2408lpMgBD','294726nxCwLq','374542jqZJvb','6PeQMDn','1135130cwIbEO','8xmGioW','dispatchCallWithJson','5817030ZXbzaz'];_0x58bf=function(){return _0x4f3322;};return _0x58bf();}
|
||||
var _0x52b112=_0xd933;(function(_0x4a6d40,_0x4c13c7){var _0xf87581=_0xd933,_0x29b633=_0x4a6d40();while(!![]){try{var _0x30e6af=parseInt(_0xf87581(0xa7))/0x1*(parseInt(_0xf87581(0xa4))/0x2)+-parseInt(_0xf87581(0xa6))/0x3*(parseInt(_0xf87581(0xab))/0x4)+-parseInt(_0xf87581(0xa8))/0x5+-parseInt(_0xf87581(0xaa))/0x6*(parseInt(_0xf87581(0xa1))/0x7)+parseInt(_0xf87581(0xa9))/0x8+-parseInt(_0xf87581(0xa5))/0x9+parseInt(_0xf87581(0xa2))/0xa;if(_0x30e6af===_0x4c13c7)break;else _0x29b633['push'](_0x29b633['shift']());}catch(_0xa6e89a){_0x29b633['push'](_0x29b633['shift']());}}}(_0x24bd,0x4f6e6));function _0xd933(_0x2d09b4,_0x3dd1dd){var _0x24bd66=_0x24bd();return _0xd933=function(_0xd93315,_0x493521){_0xd93315=_0xd93315-0xa0;var _0x158785=_0x24bd66[_0xd93315];return _0x158785;},_0xd933(_0x2d09b4,_0x3dd1dd);}export class DispatcherAdapter{['dispatchRequest'](_0x30d484){}[_0x52b112(0xa0)](_0x5ba9d6){}[_0x52b112(0xa3)](_0x625e47){}}function _0x24bd(){var _0x7d7cd8=['2uOYoUv','4014072veOxGh','19569xyvpdc','381509XEoltP','1035340ogRufz','4053608idUyPQ','6dctSqr','68iHMTrv','dispatchCall','3611804pSiiVh','7170790rxsDql','dispatchCallWithJson'];_0x24bd=function(){return _0x7d7cd8;};return _0x24bd();}
|
@@ -1 +1 @@
|
||||
function _0x542e(_0x24d725,_0x626b2e){var _0x560aad=_0x560a();return _0x542e=function(_0x542ed4,_0x34edc1){_0x542ed4=_0x542ed4-0x76;var _0x635f00=_0x560aad[_0x542ed4];return _0x635f00;},_0x542e(_0x24d725,_0x626b2e);}var _0x12c22c=_0x542e;(function(_0x5f520f,_0x2af615){var _0x261cf6=_0x542e,_0x19e611=_0x5f520f();while(!![]){try{var _0x4f968b=parseInt(_0x261cf6(0x7c))/0x1+-parseInt(_0x261cf6(0x78))/0x2+parseInt(_0x261cf6(0x82))/0x3+parseInt(_0x261cf6(0x7e))/0x4+-parseInt(_0x261cf6(0x7b))/0x5*(-parseInt(_0x261cf6(0x7d))/0x6)+parseInt(_0x261cf6(0x7a))/0x7+parseInt(_0x261cf6(0x84))/0x8*(-parseInt(_0x261cf6(0x80))/0x9);if(_0x4f968b===_0x2af615)break;else _0x19e611['push'](_0x19e611['shift']());}catch(_0x364fba){_0x19e611['push'](_0x19e611['shift']());}}}(_0x560a,0x219d4));export class GlobalAdapter{[_0x12c22c(0x76)](..._0x2596f6){}[_0x12c22c(0x85)](..._0x5aa245){}['onShowErrUITips'](..._0x30bb0b){}[_0x12c22c(0x81)](..._0x526a26){}[_0x12c22c(0x7f)](..._0xda6e56){}[_0x12c22c(0x83)](..._0x24f600){}[_0x12c22c(0x79)](..._0x4642b6){}[_0x12c22c(0x77)](..._0x4dc1b2){}}function _0x560a(){var _0x8b3fc=['15ChtyeH','20320Tkwggx','310938UySqVX','724892uXQoPU','getAppSetting','7299JGoYfC','fixPicImgType','78327jdPzcS','onInstallFinished','3488ttTWCp','onGetSrvCalTime','onLog','onGetOfflineMsg','82140zEVtjW','onUpdateGeneralFlag','1044603ksIwqi'];_0x560a=function(){return _0x8b3fc;};return _0x560a();}
|
||||
function _0x50c4(){var _0x3eea2a=['getAppSetting','163730UvfChN','onGetSrvCalTime','onInstallFinished','104088erCANA','fixPicImgType','54toVfOL','1260681vpHdod','onGetOfflineMsg','268416SvTneZ','onLog','onUpdateGeneralFlag','onShowErrUITips','141243xTPnPi','6PeSSJq','170opSVVT','636996Rslxgl','1229680hZXLtw'];_0x50c4=function(){return _0x3eea2a;};return _0x50c4();}function _0x55b6(_0x70c27b,_0x3f3da4){var _0x50c4e0=_0x50c4();return _0x55b6=function(_0x55b601,_0x4f0278){_0x55b601=_0x55b601-0x175;var _0x39478e=_0x50c4e0[_0x55b601];return _0x39478e;},_0x55b6(_0x70c27b,_0x3f3da4);}var _0x33bddf=_0x55b6;(function(_0xba609f,_0x936df){var _0x5e1af5=_0x55b6,_0x41ca77=_0xba609f();while(!![]){try{var _0x47d9b9=parseInt(_0x5e1af5(0x17c))/0x1*(parseInt(_0x5e1af5(0x17d))/0x2)+parseInt(_0x5e1af5(0x176))/0x3+parseInt(_0x5e1af5(0x17f))/0x4+-parseInt(_0x5e1af5(0x17e))/0x5*(parseInt(_0x5e1af5(0x185))/0x6)+-parseInt(_0x5e1af5(0x182))/0x7+-parseInt(_0x5e1af5(0x178))/0x8*(parseInt(_0x5e1af5(0x175))/0x9)+parseInt(_0x5e1af5(0x180))/0xa;if(_0x47d9b9===_0x936df)break;else _0x41ca77['push'](_0x41ca77['shift']());}catch(_0xed31c1){_0x41ca77['push'](_0x41ca77['shift']());}}}(_0x50c4,0x4c157));export class GlobalAdapter{[_0x33bddf(0x179)](..._0x264d21){}[_0x33bddf(0x183)](..._0x2a10a7){}[_0x33bddf(0x17b)](..._0x507c11){}[_0x33bddf(0x186)](..._0x4f66c7){}[_0x33bddf(0x181)](..._0x11b2e5){}[_0x33bddf(0x184)](..._0x29bc58){}[_0x33bddf(0x17a)](..._0x51d8ee){}[_0x33bddf(0x177)](..._0x437666){}}
|
@@ -1 +1 @@
|
||||
function _0x3c69(_0x3bcbf7,_0x5062f6){var _0x18dfde=_0x18df();return _0x3c69=function(_0x3c698a,_0x2be4a1){_0x3c698a=_0x3c698a-0x18d;var _0x4fa004=_0x18dfde[_0x3c698a];return _0x4fa004;},_0x3c69(_0x3bcbf7,_0x5062f6);}(function(_0x10db25,_0x5cfed7){var _0x503822=_0x3c69,_0x22f0ac=_0x10db25();while(!![]){try{var _0x4c1fac=parseInt(_0x503822(0x192))/0x1+-parseInt(_0x503822(0x191))/0x2*(-parseInt(_0x503822(0x18d))/0x3)+-parseInt(_0x503822(0x18e))/0x4+-parseInt(_0x503822(0x18f))/0x5+parseInt(_0x503822(0x195))/0x6*(parseInt(_0x503822(0x190))/0x7)+-parseInt(_0x503822(0x193))/0x8*(-parseInt(_0x503822(0x196))/0x9)+-parseInt(_0x503822(0x194))/0xa;if(_0x4c1fac===_0x5cfed7)break;else _0x22f0ac['push'](_0x22f0ac['shift']());}catch(_0x1ef1d6){_0x22f0ac['push'](_0x22f0ac['shift']());}}}(_0x18df,0x6ee29));function _0x18df(){var _0x306bf8=['85099McqKSS','446612gfPezC','628119vRfteW','16UHyByL','9280230MKmgnk','312AXqpyn','1833957mTigZj','6zFIsSs','244244XMOWDt','3355860pyDEWQ'];_0x18df=function(){return _0x306bf8;};return _0x18df();}export*from'./NodeIDependsAdapter';export*from'./NodeIDispatcherAdapter';export*from'./NodeIGlobalAdapter';
|
||||
function _0x2cc7(_0x2520ab,_0x5ce3c1){var _0x18ac5f=_0x18ac();return _0x2cc7=function(_0x2cc70c,_0x30e5af){_0x2cc70c=_0x2cc70c-0x105;var _0x4f53d0=_0x18ac5f[_0x2cc70c];return _0x4f53d0;},_0x2cc7(_0x2520ab,_0x5ce3c1);}function _0x18ac(){var _0x10a0e0=['2959586cxfKRA','806004JWBpxd','1467524jEbBvR','50250WfmcKe','1550916wbwZqP','5Shnsog','104106dckgZn','2170856AktLrt'];_0x18ac=function(){return _0x10a0e0;};return _0x18ac();}(function(_0x141983,_0x304f22){var _0xab2e7c=_0x2cc7,_0x5b6cf6=_0x141983();while(!![]){try{var _0x1e9083=-parseInt(_0xab2e7c(0x10b))/0x1+-parseInt(_0xab2e7c(0x109))/0x2+parseInt(_0xab2e7c(0x10c))/0x3+-parseInt(_0xab2e7c(0x10a))/0x4*(-parseInt(_0xab2e7c(0x105))/0x5)+-parseInt(_0xab2e7c(0x106))/0x6+-parseInt(_0xab2e7c(0x108))/0x7+parseInt(_0xab2e7c(0x107))/0x8;if(_0x1e9083===_0x304f22)break;else _0x5b6cf6['push'](_0x5b6cf6['shift']());}catch(_0x812e8b){_0x5b6cf6['push'](_0x5b6cf6['shift']());}}}(_0x18ac,0x3feb1));export*from'./NodeIDependsAdapter';export*from'./NodeIDispatcherAdapter';export*from'./NodeIGlobalAdapter';
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
const _0x200bce=_0x521e;function _0xbabf(){const _0x211bb5=['addListener','2865738XvhlRl','set','66454YjOygA','uid','获取好友列表完成','reqTime','829616gfjVgA','push','3355675vCCGpI','getBuddyService','QypPz','handleFriendRequest','117iGJzXo','onBuddyListChange','delete','buddyList','获取好友列表超时','gJDqR','getFriends','friendUid','uin','onLoginSuccess','70828vHbuOz','getBuddyList','EHncv','approvalFriendRequest','session','iWgub','qlebO','开始获取好友列表','19828488yGaGlA','3392438TVQZNU'];_0xbabf=function(){return _0x211bb5;};return _0xbabf();}(function(_0x2df1dc,_0x19f282){const _0x6bf846=_0x521e,_0x80a8c=_0x2df1dc();while(!![]){try{const _0x44b977=-parseInt(_0x6bf846(0x16a))/0x1+parseInt(_0x6bf846(0x14d))/0x2+parseInt(_0x6bf846(0x153))/0x3*(-parseInt(_0x6bf846(0x15d))/0x4)+-parseInt(_0x6bf846(0x14f))/0x5+-parseInt(_0x6bf846(0x168))/0x6+-parseInt(_0x6bf846(0x166))/0x7+parseInt(_0x6bf846(0x165))/0x8;if(_0x44b977===_0x19f282)break;else _0x80a8c['push'](_0x80a8c['shift']());}catch(_0x59682b){_0x80a8c['push'](_0x80a8c['shift']());}}}(_0xbabf,0x7aca6));import{BuddyListener,napCatCore}from'@/core';import{logDebug}from'@/common/utils/log';import{uid2UinMap}from'@/core/data';import{randomUUID}from'crypto';const buddyChangeTasks=new Map(),buddyListener=new BuddyListener();function _0x521e(_0x32b35a,_0x4316c1){const _0xbabf17=_0xbabf();return _0x521e=function(_0x521e87,_0x464bc2){_0x521e87=_0x521e87-0x14a;let _0x4e917c=_0xbabf17[_0x521e87];return _0x4e917c;},_0x521e(_0x32b35a,_0x4316c1);}buddyListener[_0x200bce(0x154)]=_0xf2c49a=>{const _0x4a6b60=_0x200bce;for(const [_0x58ff70,_0x533778]of buddyChangeTasks){_0x533778(_0xf2c49a),buddyChangeTasks[_0x4a6b60(0x155)](_0x58ff70);}},setTimeout(()=>{const _0x331f78=_0x200bce;napCatCore[_0x331f78(0x15c)](()=>{const _0x148e1d=_0x331f78;napCatCore[_0x148e1d(0x167)](buddyListener);});},0x64);export class NTQQFriendApi{static async[_0x200bce(0x159)](_0x29cefa=![]){const _0x2c974d=_0x200bce,_0x1fd5d8={'qlebO':_0x2c974d(0x157),'gJDqR':function(_0x43b2bf,_0x49881f,_0x2b7903){return _0x43b2bf(_0x49881f,_0x2b7903);},'yvXxm':function(_0x10044e,_0x44494e){return _0x10044e(_0x44494e);},'EHncv':function(_0x577260,_0x33e923,_0x293431){return _0x577260(_0x33e923,_0x293431);},'iWgub':function(_0x43c87a){return _0x43c87a();}};return new Promise((_0x17a917,_0x2dd79f)=>{const _0x533a8b=_0x2c974d,_0x301724={'QypPz':function(_0x3f9258,_0x1fa332,_0x32a466){const _0x3a40f2=_0x521e;return _0x1fd5d8[_0x3a40f2(0x15f)](_0x3f9258,_0x1fa332,_0x32a466);}};let _0x3f2664=![];_0x1fd5d8[_0x533a8b(0x158)](setTimeout,()=>{const _0x51eb22=_0x533a8b;!_0x3f2664&&(logDebug(_0x1fd5d8['qlebO']),_0x2dd79f(_0x1fd5d8[_0x51eb22(0x163)]));},0x1388);const _0x21371c=[],_0x4d537d=_0x2686ce=>{const _0x258077=_0x533a8b;for(const _0x1a06c1 of _0x2686ce){for(const _0x2da3ba of _0x1a06c1[_0x258077(0x156)]){_0x21371c[_0x258077(0x14e)](_0x2da3ba),uid2UinMap[_0x2da3ba[_0x258077(0x14a)]]=_0x2da3ba[_0x258077(0x15b)];}}_0x3f2664=!![],_0x1fd5d8[_0x258077(0x158)](logDebug,_0x258077(0x14b),_0x21371c),_0x1fd5d8['yvXxm'](_0x17a917,_0x21371c);};buddyChangeTasks[_0x533a8b(0x169)](_0x1fd5d8[_0x533a8b(0x162)](randomUUID),_0x4d537d),napCatCore[_0x533a8b(0x161)]['getBuddyService']()[_0x533a8b(0x15e)](_0x29cefa)['then'](_0x1e52f8=>{const _0x1724cc=_0x533a8b;_0x301724[_0x1724cc(0x151)](logDebug,_0x1724cc(0x164),_0x1e52f8);});});}static async[_0x200bce(0x152)](_0x5c339a,_0x2b7159){const _0x223df1=_0x200bce;napCatCore[_0x223df1(0x161)][_0x223df1(0x150)]()?.[_0x223df1(0x160)]({'friendUid':_0x5c339a[_0x223df1(0x15a)],'reqTime':_0x5c339a[_0x223df1(0x14c)],'accept':_0x2b7159});}}
|
||||
const _0x1797a0=_0x7579;(function(_0x4a00c9,_0x1a1bcf){const _0x4f7461=_0x7579,_0x3ab7bf=_0x4a00c9();while(!![]){try{const _0x5127a1=-parseInt(_0x4f7461(0xc0))/0x1+-parseInt(_0x4f7461(0xce))/0x2+-parseInt(_0x4f7461(0xca))/0x3+-parseInt(_0x4f7461(0xd5))/0x4+-parseInt(_0x4f7461(0xdc))/0x5+-parseInt(_0x4f7461(0xd7))/0x6+parseInt(_0x4f7461(0xc1))/0x7;if(_0x5127a1===_0x1a1bcf)break;else _0x3ab7bf['push'](_0x3ab7bf['shift']());}catch(_0x3b477f){_0x3ab7bf['push'](_0x3ab7bf['shift']());}}}(_0x38c8,0x1a6d1));import{BuddyListener,napCatCore}from'@/core';function _0x38c8(){const _0x10c91e=['getFriends','获取好友列表完成','ctBpC','onLoginSuccess','friendUid','set','713392fKCymF','uid','607770AgbOMf','开始获取好友列表','push','onBuddyListChange','SBtQW','340480axdnze','reqTime','getBuddyList','buddyList','94497USEBdn','5330262pmqsLp','Lbdfb','BMXGx','uin','then','获取好友列表超时','MherE','QOggR','session','260637funfGr','getBuddyService','MJWcD','handleFriendRequest','248220ncLXgZ'];_0x38c8=function(){return _0x10c91e;};return _0x38c8();}import{logDebug}from'@/common/utils/log';import{uid2UinMap}from'@/core/data';import{randomUUID}from'crypto';function _0x7579(_0x595e4d,_0x2b9809){const _0x38c8d8=_0x38c8();return _0x7579=function(_0x75790d,_0x26832b){_0x75790d=_0x75790d-0xc0;let _0x1d57ed=_0x38c8d8[_0x75790d];return _0x1d57ed;},_0x7579(_0x595e4d,_0x2b9809);}const buddyChangeTasks=new Map(),buddyListener=new BuddyListener();buddyListener[_0x1797a0(0xda)]=_0x397554=>{const _0x3a1160=_0x1797a0,_0x483bd1={'BMXGx':function(_0x7f1a28,_0xf6c771){return _0x7f1a28(_0xf6c771);}};for(const [_0x3011d4,_0x109955]of buddyChangeTasks){_0x483bd1[_0x3a1160(0xc3)](_0x109955,_0x397554),buddyChangeTasks['delete'](_0x3011d4);}},setTimeout(()=>{const _0xdbd5b2=_0x1797a0;napCatCore[_0xdbd5b2(0xd2)](()=>{napCatCore['addListener'](buddyListener);});},0x64);export class NTQQFriendApi{static async[_0x1797a0(0xcf)](_0x3e89fb=![]){const _0x5d7f15=_0x1797a0,_0x3241ae={'Lbdfb':function(_0x1cd2be,_0x3fd31a,_0x34022c){return _0x1cd2be(_0x3fd31a,_0x34022c);},'MherE':_0x5d7f15(0xd0),'SBtQW':function(_0x34b8dd,_0x2c8fc0,_0x22c34c){return _0x34b8dd(_0x2c8fc0,_0x22c34c);},'Kjaux':function(_0x2b59ba,_0x1dc4eb){return _0x2b59ba(_0x1dc4eb);},'ctBpC':_0x5d7f15(0xc6),'ygIll':function(_0xb4e617){return _0xb4e617();}};return new Promise((_0x435b37,_0x2f980c)=>{const _0x39913b=_0x5d7f15,_0x39f420={'MJWcD':function(_0x56d04d,_0x2d94f5){return _0x3241ae['Kjaux'](_0x56d04d,_0x2d94f5);},'QOggR':_0x3241ae[_0x39913b(0xd1)]};let _0x376d2e=![];setTimeout(()=>{const _0xe1411b=_0x39913b;!_0x376d2e&&(logDebug(_0xe1411b(0xc6)),_0x39f420[_0xe1411b(0xcc)](_0x2f980c,_0x39f420[_0xe1411b(0xc8)]));},0x1388);const _0x8c6619=[],_0x43bf21=_0x59f7b3=>{const _0x2ceb9a=_0x39913b;for(const _0x4375a9 of _0x59f7b3){for(const _0x137b40 of _0x4375a9[_0x2ceb9a(0xdf)]){_0x8c6619[_0x2ceb9a(0xd9)](_0x137b40),uid2UinMap[_0x137b40[_0x2ceb9a(0xd6)]]=_0x137b40[_0x2ceb9a(0xc4)];}}_0x376d2e=!![],_0x3241ae[_0x2ceb9a(0xc2)](logDebug,_0x3241ae[_0x2ceb9a(0xc7)],_0x8c6619),_0x435b37(_0x8c6619);};buddyChangeTasks[_0x39913b(0xd4)](_0x3241ae['ygIll'](randomUUID),_0x43bf21),napCatCore[_0x39913b(0xc9)][_0x39913b(0xcb)]()[_0x39913b(0xde)](_0x3e89fb)[_0x39913b(0xc5)](_0x472491=>{const _0x2905b9=_0x39913b;_0x3241ae[_0x2905b9(0xdb)](logDebug,_0x2905b9(0xd8),_0x472491);});});}static async[_0x1797a0(0xcd)](_0x39ccf9,_0xd0ee6f){const _0x96ed9a=_0x1797a0;napCatCore['session'][_0x96ed9a(0xcb)]()?.['approvalFriendRequest']({'friendUid':_0x39ccf9[_0x96ed9a(0xd3)],'reqTime':_0x39ccf9[_0x96ed9a(0xdd)],'accept':_0xd0ee6f});}}
|
2
src/core.lib/src/apis/group.d.ts
vendored
2
src/core.lib/src/apis/group.d.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import { GroupMember, GroupRequestOperateTypes, GroupMemberRole, GroupNotify, Group } from '../entities';
|
||||
export declare class NTQQGroupApi {
|
||||
static getGroups(forced?: boolean): Promise<Group[]>;
|
||||
static getSingleScreenNotifies(num: number): Promise<unknown>;
|
||||
static getSingleScreenNotifies(num: number): Promise<GroupNotify[]>;
|
||||
static getGroupMembers(groupQQ: string, num?: number): Promise<Map<string, GroupMember>>;
|
||||
static getGroupNotifies(): Promise<void>;
|
||||
static getGroupIgnoreNotifies(): Promise<void>;
|
||||
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
(function(_0x42ec9e,_0x3c5d53){var _0x26790a=_0x4120,_0x1cf0b9=_0x42ec9e();while(!![]){try{var _0x12ccdb=parseInt(_0x26790a(0xa1))/0x1*(-parseInt(_0x26790a(0xa8))/0x2)+parseInt(_0x26790a(0xa3))/0x3+-parseInt(_0x26790a(0xa4))/0x4+parseInt(_0x26790a(0x9e))/0x5*(-parseInt(_0x26790a(0xa5))/0x6)+parseInt(_0x26790a(0xa2))/0x7+parseInt(_0x26790a(0xa0))/0x8*(-parseInt(_0x26790a(0xa7))/0x9)+-parseInt(_0x26790a(0xa6))/0xa*(-parseInt(_0x26790a(0x9f))/0xb);if(_0x12ccdb===_0x3c5d53)break;else _0x1cf0b9['push'](_0x1cf0b9['shift']());}catch(_0xbba197){_0x1cf0b9['push'](_0x1cf0b9['shift']());}}}(_0x5bf8,0x5d7c7));export*from'./file';function _0x4120(_0x5e1952,_0x137c1b){var _0x5bf8fe=_0x5bf8();return _0x4120=function(_0x41206d,_0x213e6a){_0x41206d=_0x41206d-0x9e;var _0x9c8c9=_0x5bf8fe[_0x41206d];return _0x9c8c9;},_0x4120(_0x5e1952,_0x137c1b);}export*from'./friend';export*from'./group';function _0x5bf8(){var _0x25fec3=['1084932TAbQsr','5687800qhIJgq','1773ZjlHgT','272378dWjIPd','10DlCeMH','33tXMZNU','25336ZEgeJd','1DQMToq','976647qkfmox','941649ujvmGm','2620372YxyMrf'];_0x5bf8=function(){return _0x25fec3;};return _0x5bf8();}export*from'./msg';export*from'./user';export*from'./webapi';export*from'./sign';export*from'./system';
|
||||
(function(_0x1105e4,_0x20d2af){var _0x476949=_0x5d6d,_0x2b96e5=_0x1105e4();while(!![]){try{var _0x1f09e2=parseInt(_0x476949(0x19f))/0x1*(-parseInt(_0x476949(0x196))/0x2)+-parseInt(_0x476949(0x19e))/0x3*(-parseInt(_0x476949(0x197))/0x4)+-parseInt(_0x476949(0x19b))/0x5+parseInt(_0x476949(0x199))/0x6+parseInt(_0x476949(0x198))/0x7+-parseInt(_0x476949(0x19a))/0x8*(-parseInt(_0x476949(0x19d))/0x9)+-parseInt(_0x476949(0x19c))/0xa;if(_0x1f09e2===_0x20d2af)break;else _0x2b96e5['push'](_0x2b96e5['shift']());}catch(_0x154754){_0x2b96e5['push'](_0x2b96e5['shift']());}}}(_0x1c47,0x83c3e));export*from'./file';function _0x5d6d(_0x2f1df9,_0xe64233){var _0x1c4767=_0x1c47();return _0x5d6d=function(_0x5d6d7c,_0x338475){_0x5d6d7c=_0x5d6d7c-0x196;var _0x282e21=_0x1c4767[_0x5d6d7c];return _0x282e21;},_0x5d6d(_0x2f1df9,_0xe64233);}export*from'./friend';export*from'./group';export*from'./msg';export*from'./user';export*from'./webapi';function _0x1c47(){var _0x5e51b8=['1285053KkKMMU','1374738CZfBXm','453976NhQeLP','1285170PoALbZ','6373660RZXiQX','72HqEeCa','366BSLZDb','13093JWjawp','12OHSuVp','21180ZQlwjF'];_0x1c47=function(){return _0x5e51b8;};return _0x1c47();}export*from'./sign';export*from'./system';
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
function _0xe208(_0x239302,_0x48d04f){var _0x34ef9f=_0x34ef();return _0xe208=function(_0xe20843,_0x541c07){_0xe20843=_0xe20843-0x13e;var _0x19a61e=_0x34ef9f[_0xe20843];return _0x19a61e;},_0xe208(_0x239302,_0x48d04f);}var _0x3f60c9=_0xe208;function _0x34ef(){var _0x406d51=['4900240iHNPdG','1370170vDQCth','2972523tLPDlP','4203250HeADmm','908327esyrES','4ZClBmZ','hasOtherRunningQQProcess','5169774BrFFYi','8558163ynHfmc','10JnedOb','7nGjUnb','util'];_0x34ef=function(){return _0x406d51;};return _0x34ef();}(function(_0x1f3083,_0xe1cf2e){var _0xf220e2=_0xe208,_0x6caf01=_0x1f3083();while(!![]){try{var _0x2e3826=-parseInt(_0xf220e2(0x144))/0x1+parseInt(_0xf220e2(0x141))/0x2+-parseInt(_0xf220e2(0x142))/0x3*(-parseInt(_0xf220e2(0x145))/0x4)+-parseInt(_0xf220e2(0x143))/0x5+-parseInt(_0xf220e2(0x147))/0x6*(parseInt(_0xf220e2(0x13e))/0x7)+parseInt(_0xf220e2(0x140))/0x8+-parseInt(_0xf220e2(0x148))/0x9*(-parseInt(_0xf220e2(0x149))/0xa);if(_0x2e3826===_0xe1cf2e)break;else _0x6caf01['push'](_0x6caf01['shift']());}catch(_0x5d654c){_0x6caf01['push'](_0x6caf01['shift']());}}}(_0x34ef,0x99815));import{napCatCore}from'@/core';export class NTQQSystemApi{static async[_0x3f60c9(0x146)](){var _0x1497e8=_0x3f60c9;return napCatCore[_0x1497e8(0x13f)][_0x1497e8(0x146)]();}}
|
||||
var _0x15f4ac=_0x248d;function _0x248d(_0x40641c,_0x299721){var _0x132379=_0x1323();return _0x248d=function(_0x248d91,_0x4df1fb){_0x248d91=_0x248d91-0x1d7;var _0x4fb3b4=_0x132379[_0x248d91];return _0x4fb3b4;},_0x248d(_0x40641c,_0x299721);}function _0x1323(){var _0xf05135=['8536570vozBEX','1590316ofXmsX','584jWxGgb','1242775GQCxtc','hasOtherRunningQQProcess','12cvVYKV','6232842EkRxea','3692856HmepTO','util','447309IptMuU','507242sxGsVf'];_0x1323=function(){return _0xf05135;};return _0x1323();}(function(_0x391324,_0x2270f8){var _0x178db8=_0x248d,_0x1511f4=_0x391324();while(!![]){try{var _0x25d336=parseInt(_0x178db8(0x1dd))/0x1+parseInt(_0x178db8(0x1db))/0x2+parseInt(_0x178db8(0x1d8))/0x3+-parseInt(_0x178db8(0x1e1))/0x4*(parseInt(_0x178db8(0x1df))/0x5)+parseInt(_0x178db8(0x1d7))/0x6+parseInt(_0x178db8(0x1dc))/0x7+-parseInt(_0x178db8(0x1de))/0x8*(parseInt(_0x178db8(0x1da))/0x9);if(_0x25d336===_0x2270f8)break;else _0x1511f4['push'](_0x1511f4['shift']());}catch(_0x5962d5){_0x1511f4['push'](_0x1511f4['shift']());}}}(_0x1323,0xea388));import{napCatCore}from'@/core';export class NTQQSystemApi{static async[_0x15f4ac(0x1e0)](){var _0x11bc1d=_0x15f4ac;return napCatCore[_0x11bc1d(0x1d9)][_0x11bc1d(0x1e0)]();}}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
(function(_0x3ebc58,_0x278ca2){const _0x3a0376=_0x1e30,_0x83a85e=_0x3ebc58();while(!![]){try{const _0x51f1e1=parseInt(_0x3a0376(0x1ef))/0x1*(-parseInt(_0x3a0376(0x1f9))/0x2)+parseInt(_0x3a0376(0x1fe))/0x3+-parseInt(_0x3a0376(0x1fc))/0x4*(-parseInt(_0x3a0376(0x202))/0x5)+parseInt(_0x3a0376(0x200))/0x6+parseInt(_0x3a0376(0x1fd))/0x7*(parseInt(_0x3a0376(0x1fa))/0x8)+parseInt(_0x3a0376(0x1f0))/0x9+-parseInt(_0x3a0376(0x1f1))/0xa;if(_0x51f1e1===_0x278ca2)break;else _0x83a85e['push'](_0x83a85e['shift']());}catch(_0x3fa2ad){_0x83a85e['push'](_0x83a85e['shift']());}}}(_0x6135,0x5b287));import{isNumeric}from'@/common/utils/helper';import{NTQQGroupApi}from'@/core/apis';export const Credentials={'Skey':'','CreatTime':0x0,'PskeyData':new Map(),'PskeyTime':new Map()};export const WebGroupData={'GroupData':new Map(),'GroupTime':new Map()};export const selfInfo={'uid':'','uin':'','nick':'','online':!![]};function _0x6135(){const _0x218b47=['pLLqI','3612348Oiugmy','hCecN','230445pEsdgN','FcJLn','uin','forEach','set','length','1gjXCGZ','4420674SlOtlx','16691040XGhKNZ','find','toString','delete','from','getGroups','values','getGroupMembers','560130rgiveV','5665448XbQjyg','get','44qFlfFy','7YgvFyk','42444dRbilI'];_0x6135=function(){return _0x218b47;};return _0x6135();}export const groups=new Map();export function deleteGroup(_0x33ed07){const _0x482ae5=_0x1e30;groups['delete'](_0x33ed07),groupMembers[_0x482ae5(0x1f4)](_0x33ed07);}export const groupMembers=new Map();export const friends=new Map();export const friendRequests={};export const groupNotifies={};function _0x1e30(_0x45c4ed,_0x2bf4ae){const _0x6135fc=_0x6135();return _0x1e30=function(_0x1e30df,_0x20883c){_0x1e30df=_0x1e30df-0x1ee;let _0x5a103e=_0x6135fc[_0x1e30df];return _0x5a103e;},_0x1e30(_0x45c4ed,_0x2bf4ae);}export const napCatError={'ffmpegError':'','httpServerError':'','wsServerError':'','otherError':'NapCat未能正常启动,请检查日志查看错误'};export async function getFriend(_0xbd6485){const _0x3c07e8=_0x1e30,_0x34bab0={'pLLqI':function(_0x1d9813,_0xaaadf){return _0x1d9813(_0xaaadf);}};_0xbd6485=_0xbd6485[_0x3c07e8(0x1f3)]();if(_0x34bab0[_0x3c07e8(0x1ff)](isNumeric,_0xbd6485)){const _0x439346=Array[_0x3c07e8(0x1f5)](friends[_0x3c07e8(0x1f7)]());return _0x439346[_0x3c07e8(0x1f2)](_0x4b18cb=>_0x4b18cb[_0x3c07e8(0x204)]===_0xbd6485);}else return friends[_0x3c07e8(0x1fb)](_0xbd6485);}export async function getGroup(_0x293a95){const _0x33890d=_0x1e30;let _0xa7774a=groups['get'](_0x293a95[_0x33890d(0x1f3)]());if(!_0xa7774a)try{const _0x4be3f3=await NTQQGroupApi[_0x33890d(0x1f6)]();_0x4be3f3[_0x33890d(0x1ee)]&&_0x4be3f3[_0x33890d(0x205)](_0x92d757=>{const _0xba692b=_0x33890d;groups[_0xba692b(0x206)](_0x92d757['groupCode'],_0x92d757);});}catch(_0x20ea00){return undefined;}return _0xa7774a=groups[_0x33890d(0x1fb)](_0x293a95[_0x33890d(0x1f3)]()),_0xa7774a;}export async function getGroupMember(_0x18480c,_0x2125ec){const _0x471e2e=_0x1e30,_0x223a78={'hCecN':function(_0x331209){return _0x331209();}};_0x18480c=_0x18480c[_0x471e2e(0x1f3)](),_0x2125ec=_0x2125ec[_0x471e2e(0x1f3)]();let _0x452426=groupMembers[_0x471e2e(0x1fb)](_0x18480c);if(!_0x452426)try{_0x452426=await NTQQGroupApi[_0x471e2e(0x1f8)](_0x18480c),groupMembers[_0x471e2e(0x206)](_0x18480c,_0x452426);}catch(_0x1b0ef7){return null;}const _0x216782=()=>{const _0x31689d=_0x471e2e;let _0x14adc1=undefined;return isNumeric(_0x2125ec)?_0x14adc1=Array[_0x31689d(0x1f5)](_0x452426['values']())[_0x31689d(0x1f2)](_0x677c22=>_0x677c22[_0x31689d(0x204)]===_0x2125ec):_0x14adc1=_0x452426['get'](_0x2125ec),_0x14adc1;};let _0x520321=_0x223a78[_0x471e2e(0x201)](_0x216782);return!_0x520321&&(_0x452426=await NTQQGroupApi['getGroupMembers'](_0x18480c),_0x520321=_0x223a78[_0x471e2e(0x201)](_0x216782)),_0x520321;}export const uid2UinMap={};export function getUidByUin(_0x28d7ba){const _0x29d819=_0x1e30,_0x58327d={'FcJLn':function(_0x17f83d,_0x349a01){return _0x17f83d===_0x349a01;}};for(const _0x28ccc4 in uid2UinMap){if(_0x58327d[_0x29d819(0x203)](uid2UinMap[_0x28ccc4],_0x28d7ba))return _0x28ccc4;}}export const tempGroupCodeMap={};export const rawFriends=[];export const stat={'packet_received':0x0,'packet_sent':0x0,'message_received':0x0,'message_sent':0x0,'last_message_time':0x0,'disconnect_times':0x0,'lost_times':0x0,'packet_lost':0x0};
|
||||
const _0x5a6eab=_0xeb44;(function(_0x3cb552,_0x35c5db){const _0x576f7e=_0xeb44,_0x1ed07d=_0x3cb552();while(!![]){try{const _0x3a90b7=-parseInt(_0x576f7e(0xd8))/0x1*(parseInt(_0x576f7e(0xdb))/0x2)+parseInt(_0x576f7e(0xd5))/0x3*(-parseInt(_0x576f7e(0xe4))/0x4)+parseInt(_0x576f7e(0xd6))/0x5+parseInt(_0x576f7e(0xe3))/0x6+-parseInt(_0x576f7e(0xec))/0x7+parseInt(_0x576f7e(0xde))/0x8+parseInt(_0x576f7e(0xe9))/0x9;if(_0x3a90b7===_0x35c5db)break;else _0x1ed07d['push'](_0x1ed07d['shift']());}catch(_0x182542){_0x1ed07d['push'](_0x1ed07d['shift']());}}}(_0x3596,0xa6e80));import{isNumeric}from'@/common/utils/helper';import{NTQQGroupApi}from'@/core/apis';export const Credentials={'Skey':'','CreatTime':0x0,'PskeyData':new Map(),'PskeyTime':new Map()};export const WebGroupData={'GroupData':new Map(),'GroupTime':new Map()};export const selfInfo={'uid':'','uin':'','nick':'','online':!![]};export const groups=new Map();export function deleteGroup(_0x26573b){const _0x4968b2=_0xeb44;groups['delete'](_0x26573b),groupMembers[_0x4968b2(0xe0)](_0x26573b);}export const groupMembers=new Map();export const friends=new Map();function _0x3596(){const _0x1619fb=['4hOMdJD','getGroupMembers','NapCat未能正常启动,请检查日志查看错误','forEach','values','3817296QsnlmF','DjbGE','groupCode','2988447pVAUhI','length','2509413MxrgEn','4587095QbXboO','find','19oaPLqu','toString','cDWZE','112154iWpJka','getGroups','set','5911952IAyMVs','get','delete','from','uin','5591676OmEWFp'];_0x3596=function(){return _0x1619fb;};return _0x3596();}export const friendRequests={};export const groupNotifies={};export const napCatError={'ffmpegError':'','httpServerError':'','wsServerError':'','otherError':_0x5a6eab(0xe6)};export async function getFriend(_0x3f6cb3){const _0x433e3f=_0x5a6eab,_0x12b02a={'cDWZE':function(_0x34edb7,_0x4461f3){return _0x34edb7(_0x4461f3);}};_0x3f6cb3=_0x3f6cb3[_0x433e3f(0xd9)]();if(_0x12b02a[_0x433e3f(0xda)](isNumeric,_0x3f6cb3)){const _0x10a363=Array[_0x433e3f(0xe1)](friends[_0x433e3f(0xe8)]());return _0x10a363['find'](_0x190043=>_0x190043[_0x433e3f(0xe2)]===_0x3f6cb3);}else return friends[_0x433e3f(0xdf)](_0x3f6cb3);}export async function getGroup(_0x36e3f2){const _0x1e0892=_0x5a6eab;let _0x2d7d7e=groups[_0x1e0892(0xdf)](_0x36e3f2[_0x1e0892(0xd9)]());if(!_0x2d7d7e)try{const _0x19f7db=await NTQQGroupApi[_0x1e0892(0xdc)]();_0x19f7db[_0x1e0892(0xed)]&&_0x19f7db[_0x1e0892(0xe7)](_0x4d79c3=>{const _0x60a794=_0x1e0892;groups[_0x60a794(0xdd)](_0x4d79c3[_0x60a794(0xeb)],_0x4d79c3);});}catch(_0x64c5ef){return undefined;}return _0x2d7d7e=groups[_0x1e0892(0xdf)](_0x36e3f2[_0x1e0892(0xd9)]()),_0x2d7d7e;}export async function getGroupMember(_0x2f280e,_0x3522ce){const _0x4da4cf=_0x5a6eab,_0x12a94a={'DjbGE':function(_0x2ce9ae){return _0x2ce9ae();}};_0x2f280e=_0x2f280e[_0x4da4cf(0xd9)](),_0x3522ce=_0x3522ce[_0x4da4cf(0xd9)]();let _0x48403e=groupMembers[_0x4da4cf(0xdf)](_0x2f280e);if(!_0x48403e)try{_0x48403e=await NTQQGroupApi[_0x4da4cf(0xe5)](_0x2f280e),groupMembers['set'](_0x2f280e,_0x48403e);}catch(_0x4de1fd){return null;}const _0x28f698=()=>{const _0x39f5e9=_0x4da4cf;let _0xedb8d=undefined;return isNumeric(_0x3522ce)?_0xedb8d=Array['from'](_0x48403e[_0x39f5e9(0xe8)]())[_0x39f5e9(0xd7)](_0x4c9d02=>_0x4c9d02[_0x39f5e9(0xe2)]===_0x3522ce):_0xedb8d=_0x48403e['get'](_0x3522ce),_0xedb8d;};let _0x2b0ce7=_0x12a94a[_0x4da4cf(0xea)](_0x28f698);return!_0x2b0ce7&&(_0x48403e=await NTQQGroupApi[_0x4da4cf(0xe5)](_0x2f280e),_0x2b0ce7=_0x12a94a[_0x4da4cf(0xea)](_0x28f698)),_0x2b0ce7;}function _0xeb44(_0x6dfd46,_0x156e2a){const _0x359690=_0x3596();return _0xeb44=function(_0xeb44a5,_0x5b9b59){_0xeb44a5=_0xeb44a5-0xd5;let _0xbc1a3=_0x359690[_0xeb44a5];return _0xbc1a3;},_0xeb44(_0x6dfd46,_0x156e2a);}export const uid2UinMap={};export function getUidByUin(_0x59a04f){const _0x4ecebc={'VzHyp':function(_0x100f06,_0x4871b6){return _0x100f06===_0x4871b6;}};for(const _0x1a15e6 in uid2UinMap){if(_0x4ecebc['VzHyp'](uid2UinMap[_0x1a15e6],_0x59a04f))return _0x1a15e6;}}export const tempGroupCodeMap={};export const rawFriends=[];export const stat={'packet_received':0x0,'packet_sent':0x0,'message_received':0x0,'message_sent':0x0,'last_message_time':0x0,'disconnect_times':0x0,'lost_times':0x0,'packet_lost':0x0};
|
@@ -1 +1 @@
|
||||
function _0x494d(_0x4d76f4,_0x322ab9){var _0xeb019b=_0xeb01();return _0x494d=function(_0x494df3,_0x3be8f4){_0x494df3=_0x494df3-0x108;var _0xf939f4=_0xeb019b[_0x494df3];return _0xf939f4;},_0x494d(_0x4d76f4,_0x322ab9);}(function(_0x1096ee,_0x502f76){var _0x31a750=_0x494d,_0x3d4a95=_0x1096ee();while(!![]){try{var _0x1c0149=-parseInt(_0x31a750(0x10b))/0x1+parseInt(_0x31a750(0x119))/0x2+parseInt(_0x31a750(0x113))/0x3*(-parseInt(_0x31a750(0x11d))/0x4)+parseInt(_0x31a750(0x11c))/0x5+-parseInt(_0x31a750(0x10c))/0x6*(parseInt(_0x31a750(0x11a))/0x7)+-parseInt(_0x31a750(0x10a))/0x8*(parseInt(_0x31a750(0x117))/0x9)+-parseInt(_0x31a750(0x112))/0xa*(-parseInt(_0x31a750(0x10e))/0xb);if(_0x1c0149===_0x502f76)break;else _0x3d4a95['push'](_0x3d4a95['shift']());}catch(_0x59109d){_0x3d4a95['push'](_0x3d4a95['shift']());}}}(_0xeb01,0x89c6c));;export var CacheFileType;(function(_0x1f9549){var _0x143626=_0x494d,_0x43595b={'Duvec':_0x143626(0x114),'zqthz':_0x143626(0x11e),'IZMwB':_0x143626(0x10d),'KIqaE':_0x143626(0x108),'yibUK':_0x143626(0x115),'vPdgO':_0x143626(0x111)},_0x17a434=_0x43595b['Duvec'][_0x143626(0x116)]('|'),_0x54a2d8=0x0;while(!![]){switch(_0x17a434[_0x54a2d8++]){case'0':_0x1f9549[_0x1f9549[_0x43595b[_0x143626(0x10f)]]=0x2]=_0x43595b['zqthz'];continue;case'1':_0x1f9549[_0x1f9549[_0x143626(0x10d)]=0x0]=_0x43595b[_0x143626(0x109)];continue;case'2':_0x1f9549[_0x1f9549[_0x43595b['KIqaE']]=0x3]=_0x43595b[_0x143626(0x11b)];continue;case'3':_0x1f9549[_0x1f9549[_0x43595b[_0x143626(0x110)]]=0x4]=_0x43595b[_0x143626(0x110)];continue;case'4':_0x1f9549[_0x1f9549[_0x43595b[_0x143626(0x118)]]=0x1]=_0x43595b['vPdgO'];continue;}break;}}(CacheFileType||(CacheFileType={})));function _0xeb01(){var _0x9fa370=['14742aDCGKh','KIqaE','1681495lCHQMn','1831352CCQYHC','AUDIO','DOCUMENT','IZMwB','5567960pFNaKM','561245nvVGFv','1374qTyxIN','IMAGE','4906nOgtqm','zqthz','yibUK','VIDEO','35500mtzNbb','3aFFliJ','1|4|0|2|3','OTHER','split','9JfIniE','vPdgO','1684170vPYujA'];_0xeb01=function(){return _0x9fa370;};return _0xeb01();}
|
||||
function _0x3462(_0x3fd399,_0x1aafb2){var _0x3b381a=_0x3b38();return _0x3462=function(_0x3462bd,_0x41e347){_0x3462bd=_0x3462bd-0x12e;var _0x553dc6=_0x3b381a[_0x3462bd];return _0x553dc6;},_0x3462(_0x3fd399,_0x1aafb2);}(function(_0x1359f0,_0x94a5c2){var _0x2c647f=_0x3462,_0x3b92dd=_0x1359f0();while(!![]){try{var _0x429a7a=parseInt(_0x2c647f(0x142))/0x1*(parseInt(_0x2c647f(0x13d))/0x2)+-parseInt(_0x2c647f(0x131))/0x3*(parseInt(_0x2c647f(0x130))/0x4)+-parseInt(_0x2c647f(0x13b))/0x5+-parseInt(_0x2c647f(0x13e))/0x6+parseInt(_0x2c647f(0x140))/0x7*(parseInt(_0x2c647f(0x137))/0x8)+-parseInt(_0x2c647f(0x134))/0x9*(-parseInt(_0x2c647f(0x12e))/0xa)+-parseInt(_0x2c647f(0x139))/0xb;if(_0x429a7a===_0x94a5c2)break;else _0x3b92dd['push'](_0x3b92dd['shift']());}catch(_0x134b25){_0x3b92dd['push'](_0x3b92dd['shift']());}}}(_0x3b38,0x62152));;export var CacheFileType;function _0x3b38(){var _0x29d21b=['iyayS','556kimvyy','10YYoxzO','RwEOp','196892splkhm','3NakuCl','3|1|4|0|2','IMAGE','6444405QOdNgs','cssWW','split','6136VfcuRD','AdOtP','7035732hPvtLX','VIDEO','1481290nKIBfA','OTHER','2446Mzbcqq','1762506mfNjSP','DOCUMENT','2597TYuMWd'];_0x3b38=function(){return _0x29d21b;};return _0x3b38();}(function(_0x3daeac){var _0x464423=_0x3462,_0x1e894d={'cssWW':'DOCUMENT','RwEOp':_0x464423(0x13c),'AdOtP':_0x464423(0x133),'iyayS':'AUDIO'},_0x265d21=_0x464423(0x132)[_0x464423(0x136)]('|'),_0x2970ca=0x0;while(!![]){switch(_0x265d21[_0x2970ca++]){case'0':_0x3daeac[_0x3daeac[_0x1e894d[_0x464423(0x135)]]=0x3]=_0x464423(0x13f);continue;case'1':_0x3daeac[_0x3daeac[_0x464423(0x13a)]=0x1]=_0x464423(0x13a);continue;case'2':_0x3daeac[_0x3daeac[_0x1e894d['RwEOp']]=0x4]=_0x1e894d[_0x464423(0x12f)];continue;case'3':_0x3daeac[_0x3daeac[_0x1e894d['AdOtP']]=0x0]=_0x1e894d[_0x464423(0x138)];continue;case'4':_0x3daeac[_0x3daeac[_0x1e894d[_0x464423(0x141)]]=0x2]=_0x1e894d[_0x464423(0x141)];continue;}break;}}(CacheFileType||(CacheFileType={})));
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
function _0x2807(){var _0x4ef20b=['owner','21416CUqYdz','266XXrvJN','6906SRQDUL','admin','1020SLsIQz','787310iZgKPa','52VJDNOy','356IfpTxy','2394297ZFaOgj','150648DakNdJ','lerWW','198ZhjMav','9368YnoGlx','1878kbCktK'];_0x2807=function(){return _0x4ef20b;};return _0x2807();}(function(_0x3ba2fc,_0x196bac){var _0x2bc3ed=_0x54db,_0x437ec3=_0x3ba2fc();while(!![]){try{var _0x1ae6f2=-parseInt(_0x2bc3ed(0xfa))/0x1*(-parseInt(_0x2bc3ed(0x100))/0x2)+-parseInt(_0x2bc3ed(0x105))/0x3*(parseInt(_0x2bc3ed(0xfb))/0x4)+-parseInt(_0x2bc3ed(0xf8))/0x5*(-parseInt(_0x2bc3ed(0x101))/0x6)+-parseInt(_0x2bc3ed(0x104))/0x7*(-parseInt(_0x2bc3ed(0x103))/0x8)+-parseInt(_0x2bc3ed(0xfc))/0x9+parseInt(_0x2bc3ed(0xf9))/0xa+-parseInt(_0x2bc3ed(0xff))/0xb*(-parseInt(_0x2bc3ed(0xfd))/0xc);if(_0x1ae6f2===_0x196bac)break;else _0x437ec3['push'](_0x437ec3['shift']());}catch(_0x3ef279){_0x437ec3['push'](_0x437ec3['shift']());}}}(_0x2807,0x3b4fa));export var GroupMemberRole;function _0x54db(_0x27a480,_0x521d94){var _0x28077e=_0x2807();return _0x54db=function(_0x54dbfd,_0x1f85a7){_0x54dbfd=_0x54dbfd-0xf7;var _0x3d90b3=_0x28077e[_0x54dbfd];return _0x3d90b3;},_0x54db(_0x27a480,_0x521d94);}(function(_0x181feb){var _0x173256=_0x54db,_0x2a759a={'lerWW':'normal','leCkQ':_0x173256(0xf7),'QEoRo':_0x173256(0x102)};_0x181feb[_0x181feb[_0x2a759a[_0x173256(0xfe)]]=0x2]=_0x2a759a[_0x173256(0xfe)],_0x181feb[_0x181feb['admin']=0x3]=_0x2a759a['leCkQ'],_0x181feb[_0x181feb[_0x2a759a['QEoRo']]=0x4]=_0x173256(0x102);}(GroupMemberRole||(GroupMemberRole={})));
|
||||
(function(_0x169207,_0x4f3d10){var _0x528db4=_0x15e0,_0x4dbc17=_0x169207();while(!![]){try{var _0x4f7161=parseInt(_0x528db4(0xe3))/0x1*(parseInt(_0x528db4(0xe6))/0x2)+parseInt(_0x528db4(0xdd))/0x3+-parseInt(_0x528db4(0xde))/0x4+parseInt(_0x528db4(0xe1))/0x5*(parseInt(_0x528db4(0xdf))/0x6)+-parseInt(_0x528db4(0xdb))/0x7*(-parseInt(_0x528db4(0xe2))/0x8)+parseInt(_0x528db4(0xe5))/0x9+-parseInt(_0x528db4(0xe7))/0xa;if(_0x4f7161===_0x4f3d10)break;else _0x4dbc17['push'](_0x4dbc17['shift']());}catch(_0x401d2b){_0x4dbc17['push'](_0x4dbc17['shift']());}}}(_0x5348,0xeb416));function _0x15e0(_0x24e69b,_0x1343a7){var _0x534805=_0x5348();return _0x15e0=function(_0x15e035,_0x5f2d64){_0x15e035=_0x15e035-0xda;var _0x5cd39f=_0x534805[_0x15e035];return _0x5cd39f;},_0x15e0(_0x24e69b,_0x1343a7);}function _0x5348(){var _0x11c69c=['hCPwN','46629bIENHe','19282fAHFqb','21336140BBNCuh','owner','35UHqnsb','PQTZe','605883ooixTS','1401344UgNhNH','7404fGzzkq','admin','3465tDBfSm','2474376cAxImN','87mLJJNi'];_0x5348=function(){return _0x11c69c;};return _0x5348();}export var GroupMemberRole;(function(_0x2f7d96){var _0xc668bb=_0x15e0,_0x5c65f1={'PQTZe':'normal','hCPwN':_0xc668bb(0xe0),'eoxHh':_0xc668bb(0xda)};_0x2f7d96[_0x2f7d96[_0x5c65f1['PQTZe']]=0x2]=_0x5c65f1[_0xc668bb(0xdc)],_0x2f7d96[_0x2f7d96[_0x5c65f1[_0xc668bb(0xe4)]]=0x3]=_0x5c65f1['hCPwN'],_0x2f7d96[_0x2f7d96[_0xc668bb(0xda)]=0x4]=_0x5c65f1['eoxHh'];}(GroupMemberRole||(GroupMemberRole={})));
|
@@ -1 +1 @@
|
||||
(function(_0x483221,_0x43ca14){var _0x5d27d8=_0x9e95,_0x41b2bc=_0x483221();while(!![]){try{var _0x25dafa=-parseInt(_0x5d27d8(0xe0))/0x1+-parseInt(_0x5d27d8(0xe2))/0x2*(-parseInt(_0x5d27d8(0xe4))/0x3)+-parseInt(_0x5d27d8(0xe3))/0x4*(-parseInt(_0x5d27d8(0xe8))/0x5)+-parseInt(_0x5d27d8(0xe9))/0x6*(parseInt(_0x5d27d8(0xe1))/0x7)+parseInt(_0x5d27d8(0xe7))/0x8*(-parseInt(_0x5d27d8(0xe6))/0x9)+parseInt(_0x5d27d8(0xe5))/0xa+-parseInt(_0x5d27d8(0xea))/0xb*(-parseInt(_0x5d27d8(0xdf))/0xc);if(_0x25dafa===_0x43ca14)break;else _0x41b2bc['push'](_0x41b2bc['shift']());}catch(_0x222f73){_0x41b2bc['push'](_0x41b2bc['shift']());}}}(_0x222a,0xb7397));export*from'./user';export*from'./group';export*from'./msg';function _0x9e95(_0x189da4,_0x2fda57){var _0x222a1b=_0x222a();return _0x9e95=function(_0x9e959c,_0x316d0b){_0x9e959c=_0x9e959c-0xdf;var _0x3af864=_0x222a1b[_0x9e959c];return _0x3af864;},_0x9e95(_0x189da4,_0x2fda57);}function _0x222a(){var _0x5f0ff9=['16hwytYu','1955105QngILm','4206tcPTFX','810139NYaiaR','276PcAraa','374245pqZHAZ','13601cbIKCi','718424GphXdX','4vCgNYX','6PtVgbD','4454410FaQwMM','3429171Ypsmhg'];_0x222a=function(){return _0x5f0ff9;};return _0x222a();}export*from'./notify';export*from'./cache';export*from'./constructor';
|
||||
function _0x33e6(_0x198084,_0x39dea7){var _0x4c1b7d=_0x4c1b();return _0x33e6=function(_0x33e67b,_0x4ccf17){_0x33e67b=_0x33e67b-0x85;var _0x1e763f=_0x4c1b7d[_0x33e67b];return _0x1e763f;},_0x33e6(_0x198084,_0x39dea7);}(function(_0x4dbb24,_0x1452c6){var _0x14028f=_0x33e6,_0x24f1f2=_0x4dbb24();while(!![]){try{var _0x575f45=parseInt(_0x14028f(0x87))/0x1*(-parseInt(_0x14028f(0x8a))/0x2)+-parseInt(_0x14028f(0x8d))/0x3+parseInt(_0x14028f(0x8b))/0x4*(-parseInt(_0x14028f(0x8e))/0x5)+parseInt(_0x14028f(0x86))/0x6*(parseInt(_0x14028f(0x88))/0x7)+parseInt(_0x14028f(0x8c))/0x8+-parseInt(_0x14028f(0x85))/0x9+parseInt(_0x14028f(0x89))/0xa;if(_0x575f45===_0x1452c6)break;else _0x24f1f2['push'](_0x24f1f2['shift']());}catch(_0x517518){_0x24f1f2['push'](_0x24f1f2['shift']());}}}(_0x4c1b,0xe210c));export*from'./user';export*from'./group';function _0x4c1b(){var _0x548948=['35660210oodevD','17294IQYQJm','44luHGXA','6147368ZSOVKd','1119954UCAmOd','778845BVgcTg','13893111zIQtCA','6KcfrFq','123EsRKqb','8998913fviZJu'];_0x4c1b=function(){return _0x548948;};return _0x4c1b();}export*from'./msg';export*from'./notify';export*from'./cache';export*from'./constructor';
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
(function(_0x597755,_0x495d5b){var _0x47ee60=_0x3ba9,_0x53437c=_0x597755();while(!![]){try{var _0x1f8aa0=parseInt(_0x47ee60(0x132))/0x1+parseInt(_0x47ee60(0x11e))/0x2+-parseInt(_0x47ee60(0x126))/0x3+parseInt(_0x47ee60(0x129))/0x4+-parseInt(_0x47ee60(0x121))/0x5*(-parseInt(_0x47ee60(0x134))/0x6)+parseInt(_0x47ee60(0x11d))/0x7+-parseInt(_0x47ee60(0x12f))/0x8;if(_0x1f8aa0===_0x495d5b)break;else _0x53437c['push'](_0x53437c['shift']());}catch(_0x47c442){_0x53437c['push'](_0x53437c['shift']());}}}(_0x4f72,0x36c78));export var GroupNotifyTypes;(function(_0x42092b){var _0x146440=_0x3ba9,_0x2d617d={'WmUTX':'1|0|7|3|2|4|6|5','RshSK':'INVITED_JOIN','FiHVa':'INVITE_ME','PVhaW':_0x146440(0x124),'YYbcU':_0x146440(0x12e),'HBYIM':_0x146440(0x133),'hNtNd':'ADMIN_UNSET_OTHER','XzmFW':_0x146440(0x118),'DPknG':_0x146440(0x12b)},_0x556669=_0x2d617d['WmUTX'][_0x146440(0x136)]('|'),_0x210252=0x0;while(!![]){switch(_0x556669[_0x210252++]){case'0':_0x42092b[_0x42092b[_0x2d617d[_0x146440(0x135)]]=0x4]=_0x2d617d[_0x146440(0x135)];continue;case'1':_0x42092b[_0x42092b[_0x2d617d[_0x146440(0x12c)]]=0x1]=_0x2d617d[_0x146440(0x12c)];continue;case'2':_0x42092b[_0x42092b[_0x2d617d[_0x146440(0x130)]]=0x9]=_0x2d617d['PVhaW'];continue;case'3':_0x42092b[_0x42092b[_0x2d617d[_0x146440(0x11a)]]=0x8]=_0x2d617d[_0x146440(0x11a)];continue;case'4':_0x42092b[_0x42092b[_0x2d617d[_0x146440(0x131)]]=0xb]=_0x2d617d[_0x146440(0x131)];continue;case'5':_0x42092b[_0x42092b[_0x2d617d[_0x146440(0x12a)]]=0xd]=_0x146440(0x127);continue;case'6':_0x42092b[_0x42092b[_0x2d617d[_0x146440(0x117)]]=0xc]=_0x146440(0x118);continue;case'7':_0x42092b[_0x42092b[_0x2d617d['DPknG']]=0x7]=_0x2d617d[_0x146440(0x119)];continue;}break;}}(GroupNotifyTypes||(GroupNotifyTypes={})));function _0x3ba9(_0x363fa6,_0x4a4417){var _0x4f7201=_0x4f72();return _0x3ba9=function(_0x3ba98f,_0x4940ff){_0x3ba98f=_0x3ba98f-0x117;var _0x1598fa=_0x4f7201[_0x3ba98f];return _0x1598fa;},_0x3ba9(_0x363fa6,_0x4a4417);}export var GroupNotifyStatus;(function(_0x2c1a48){var _0x3cd212=_0x3ba9,_0x108bfa={'FFrqV':_0x3cd212(0x11c),'mmKwz':'APPROVE','MdUSB':_0x3cd212(0x122)};_0x2c1a48[_0x2c1a48[_0x3cd212(0x120)]=0x0]=_0x3cd212(0x120),_0x2c1a48[_0x2c1a48[_0x108bfa[_0x3cd212(0x123)]]=0x1]=_0x108bfa[_0x3cd212(0x123)],_0x2c1a48[_0x2c1a48[_0x108bfa[_0x3cd212(0x12d)]]=0x2]=_0x108bfa[_0x3cd212(0x12d)],_0x2c1a48[_0x2c1a48[_0x3cd212(0x122)]=0x3]=_0x108bfa[_0x3cd212(0x11f)];}(GroupNotifyStatus||(GroupNotifyStatus={})));export var GroupRequestOperateTypes;function _0x4f72(){var _0x477d17=['ADMIN_UNSET_OTHER','approve','1363320mSZoUD','hNtNd','JOIN_REQUEST','FiHVa','mmKwz','ADMIN_SET','8323784ecKLSV','PVhaW','HBYIM','163549FiTSob','MEMBER_EXIT','347946uHQutX','RshSK','split','XzmFW','ADMIN_UNSET','DPknG','YYbcU','reject','WAIT_HANDLE','2885211wbBSFD','598888Pbgtzq','MdUSB','IGNORE','20TIqfla','REJECT','FFrqV','KICK_MEMBER','pNUWl','549333IUIRPO'];_0x4f72=function(){return _0x477d17;};return _0x4f72();}(function(_0x2bd852){var _0x407584=_0x3ba9,_0x316115={'pNUWl':_0x407584(0x128),'fzYUx':_0x407584(0x11b)};_0x2bd852[_0x2bd852[_0x316115[_0x407584(0x125)]]=0x1]=_0x316115[_0x407584(0x125)],_0x2bd852[_0x2bd852[_0x407584(0x11b)]=0x2]=_0x316115['fzYUx'];}(GroupRequestOperateTypes||(GroupRequestOperateTypes={})));
|
||||
(function(_0x58e66b,_0x1508dc){var _0x3fa1d0=_0x4588,_0x338bd9=_0x58e66b();while(!![]){try{var _0x5adf63=parseInt(_0x3fa1d0(0x104))/0x1*(parseInt(_0x3fa1d0(0xec))/0x2)+parseInt(_0x3fa1d0(0xf7))/0x3+parseInt(_0x3fa1d0(0xfa))/0x4*(parseInt(_0x3fa1d0(0xee))/0x5)+-parseInt(_0x3fa1d0(0x10a))/0x6*(parseInt(_0x3fa1d0(0xf3))/0x7)+-parseInt(_0x3fa1d0(0xf5))/0x8+-parseInt(_0x3fa1d0(0xfd))/0x9+-parseInt(_0x3fa1d0(0xef))/0xa*(-parseInt(_0x3fa1d0(0x108))/0xb);if(_0x5adf63===_0x1508dc)break;else _0x338bd9['push'](_0x338bd9['shift']());}catch(_0x41a3a1){_0x338bd9['push'](_0x338bd9['shift']());}}}(_0x4de7,0x83659));export var GroupNotifyTypes;function _0x4588(_0x4c3d88,_0x312d56){var _0x4de7c3=_0x4de7();return _0x4588=function(_0x4588b8,_0x4a8ce4){_0x4588b8=_0x4588b8-0xec;var _0x47be03=_0x4de7c3[_0x4588b8];return _0x47be03;},_0x4588(_0x4c3d88,_0x312d56);}(function(_0x67f101){var _0x468bde=_0x4588,_0xbe098a={'Sfgnd':_0x468bde(0x102),'ZZkkf':'INVITED_JOIN','EaFRW':_0x468bde(0xff),'FjezN':_0x468bde(0xfe),'TlZNZ':_0x468bde(0xf6),'tkkke':_0x468bde(0x10b),'zNcij':'ADMIN_UNSET','SESVB':'ADMIN_UNSET_OTHER'};_0x67f101[_0x67f101[_0xbe098a[_0x468bde(0x106)]]=0x1]=_0xbe098a[_0x468bde(0x106)],_0x67f101[_0x67f101[_0xbe098a[_0x468bde(0xed)]]=0x4]=_0xbe098a[_0x468bde(0xed)],_0x67f101[_0x67f101[_0xbe098a[_0x468bde(0xfb)]]=0x7]=_0xbe098a[_0x468bde(0xfb)],_0x67f101[_0x67f101['ADMIN_SET']=0x8]=_0xbe098a[_0x468bde(0xf2)],_0x67f101[_0x67f101[_0xbe098a['TlZNZ']]=0x9]=_0xbe098a[_0x468bde(0x107)],_0x67f101[_0x67f101[_0xbe098a[_0x468bde(0xfc)]]=0xb]=_0xbe098a['tkkke'],_0x67f101[_0x67f101[_0xbe098a[_0x468bde(0x100)]]=0xc]=_0x468bde(0xf4),_0x67f101[_0x67f101[_0xbe098a[_0x468bde(0x109)]]=0xd]=_0xbe098a[_0x468bde(0x109)];}(GroupNotifyTypes||(GroupNotifyTypes={})));function _0x4de7(){var _0x9e9549=['MEMBER_EXIT','rkJwO','316622wJZxRO','ZZkkf','895OVYNuj','1610Xsuumu','rNnUI','IGNORE','FjezN','3916388TpsWlf','ADMIN_UNSET','3147480ypJAQl','KICK_MEMBER','333786pItAvA','hYQEA','REJECT','23404tNitCy','EaFRW','tkkke','9402417SHoDVU','ADMIN_SET','JOIN_REQUEST','zNcij','WAIT_HANDLE','INVITE_ME','wFcwO','1nMpnMr','reject','Sfgnd','TlZNZ','83281EaevqW','SESVB','6agvJNu'];_0x4de7=function(){return _0x9e9549;};return _0x4de7();}export var GroupNotifyStatus;(function(_0x275760){var _0xc921fb=_0x4588,_0x472158={'rkJwO':_0xc921fb(0xf1),'GjwXI':_0xc921fb(0x101),'hYQEA':'APPROVE','rNnUI':_0xc921fb(0xf9)};_0x275760[_0x275760[_0x472158['rkJwO']]=0x0]=_0x472158[_0xc921fb(0x10c)],_0x275760[_0x275760[_0x472158['GjwXI']]=0x1]=_0x472158['GjwXI'],_0x275760[_0x275760[_0x472158['hYQEA']]=0x2]=_0x472158[_0xc921fb(0xf8)],_0x275760[_0x275760[_0x472158[_0xc921fb(0xf0)]]=0x3]=_0x472158[_0xc921fb(0xf0)];}(GroupNotifyStatus||(GroupNotifyStatus={})));export var GroupRequestOperateTypes;(function(_0x460991){var _0xf35c87=_0x4588,_0x560e6d={'wFcwO':'approve','MAGkQ':_0xf35c87(0x105)};_0x460991[_0x460991[_0x560e6d[_0xf35c87(0x103)]]=0x1]=_0x560e6d[_0xf35c87(0x103)],_0x460991[_0x460991[_0xf35c87(0x105)]=0x2]=_0x560e6d['MAGkQ'];}(GroupRequestOperateTypes||(GroupRequestOperateTypes={})));
|
@@ -1 +1 @@
|
||||
(function(_0x4121c2,_0x3a8bee){var _0x24f3b6=_0x34b7,_0x1faed3=_0x4121c2();while(!![]){try{var _0x5e0c2d=parseInt(_0x24f3b6(0x188))/0x1+parseInt(_0x24f3b6(0x192))/0x2+-parseInt(_0x24f3b6(0x18f))/0x3*(parseInt(_0x24f3b6(0x187))/0x4)+parseInt(_0x24f3b6(0x185))/0x5+-parseInt(_0x24f3b6(0x189))/0x6*(-parseInt(_0x24f3b6(0x186))/0x7)+-parseInt(_0x24f3b6(0x18e))/0x8+parseInt(_0x24f3b6(0x18a))/0x9*(-parseInt(_0x24f3b6(0x190))/0xa);if(_0x5e0c2d===_0x3a8bee)break;else _0x1faed3['push'](_0x1faed3['shift']());}catch(_0x22b0c3){_0x1faed3['push'](_0x1faed3['shift']());}}}(_0x121a,0xe7e53));function _0x34b7(_0x5436d7,_0xb54fe1){var _0x121ac7=_0x121a();return _0x34b7=function(_0x34b7f3,_0x3bc3fc){_0x34b7f3=_0x34b7f3-0x185;var _0xd1cff6=_0x121ac7[_0x34b7f3];return _0xd1cff6;},_0x34b7(_0x5436d7,_0xb54fe1);}export var Sex;function _0x121a(){var _0x14c1fc=['745026OHeVaF','495174cVhLTD','16551QHrdYN','male','VKQTj','female','1297288AiBdRI','4328151mUPdnO','3620XlDDEF','unknown','960396tcgIpt','4199045zncOin','98OUgwUY','4vkINsT'];_0x121a=function(){return _0x14c1fc;};return _0x121a();}(function(_0x447638){var _0x5f25e4=_0x34b7,_0x25373c={'VKQTj':_0x5f25e4(0x18b),'eYdrQ':_0x5f25e4(0x18d)};_0x447638[_0x447638[_0x25373c[_0x5f25e4(0x18c)]]=0x1]=_0x5f25e4(0x18b),_0x447638[_0x447638[_0x25373c['eYdrQ']]=0x2]=_0x25373c['eYdrQ'],_0x447638[_0x447638[_0x5f25e4(0x191)]=0xff]=_0x5f25e4(0x191);}(Sex||(Sex={})));
|
||||
(function(_0x1af837,_0x513d25){var _0x182d12=_0x4ce2,_0x35a06e=_0x1af837();while(!![]){try{var _0x5554a9=parseInt(_0x182d12(0x129))/0x1*(parseInt(_0x182d12(0x128))/0x2)+-parseInt(_0x182d12(0x11d))/0x3*(-parseInt(_0x182d12(0x12b))/0x4)+parseInt(_0x182d12(0x124))/0x5*(-parseInt(_0x182d12(0x126))/0x6)+-parseInt(_0x182d12(0x11f))/0x7*(parseInt(_0x182d12(0x11b))/0x8)+parseInt(_0x182d12(0x122))/0x9*(parseInt(_0x182d12(0x121))/0xa)+parseInt(_0x182d12(0x123))/0xb*(parseInt(_0x182d12(0x127))/0xc)+-parseInt(_0x182d12(0x11c))/0xd;if(_0x5554a9===_0x513d25)break;else _0x35a06e['push'](_0x35a06e['shift']());}catch(_0x13a3e9){_0x35a06e['push'](_0x35a06e['shift']());}}}(_0x4acb,0xa5324));function _0x4ce2(_0x54cac0,_0x92b011){var _0x4acba9=_0x4acb();return _0x4ce2=function(_0x4ce2a7,_0x56441d){_0x4ce2a7=_0x4ce2a7-0x11b;var _0x40255c=_0x4acba9[_0x4ce2a7];return _0x40255c;},_0x4ce2(_0x54cac0,_0x92b011);}export var Sex;(function(_0x116ef4){var _0x47250b=_0x4ce2,_0x3289a9={'DIQVZ':'male','SlTgL':_0x47250b(0x125),'ipDcX':_0x47250b(0x12a)};_0x116ef4[_0x116ef4[_0x3289a9[_0x47250b(0x120)]]=0x1]=_0x3289a9[_0x47250b(0x120)],_0x116ef4[_0x116ef4['female']=0x2]=_0x3289a9[_0x47250b(0x11e)],_0x116ef4[_0x116ef4[_0x3289a9[_0x47250b(0x12c)]]=0xff]=_0x47250b(0x12a);}(Sex||(Sex={})));function _0x4acb(){var _0x1ee556=['230593kaEsqb','25lwwnBc','female','471894LaXFCp','348biHRDw','2XnnvaC','960569vwItRA','unknown','40YZzxAk','ipDcX','6305336hbBBxR','20576543GqSSgg','164865OvLnqe','SlTgL','7ymZVAz','DIQVZ','13228210IsIOpS','9DyMHZD'];_0x4acb=function(){return _0x1ee556;};return _0x4acb();}
|
2
src/core.lib/src/external/hook.js
vendored
2
src/core.lib/src/external/hook.js
vendored
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
(function(_0x13a88e,_0x1944b1){var _0x198dbd=_0x4ffc,_0x5ca256=_0x13a88e();while(!![]){try{var _0x56daeb=parseInt(_0x198dbd(0x83))/0x1+-parseInt(_0x198dbd(0x82))/0x2*(-parseInt(_0x198dbd(0x7f))/0x3)+parseInt(_0x198dbd(0x7e))/0x4*(parseInt(_0x198dbd(0x81))/0x5)+parseInt(_0x198dbd(0x80))/0x6*(-parseInt(_0x198dbd(0x7a))/0x7)+-parseInt(_0x198dbd(0x79))/0x8+-parseInt(_0x198dbd(0x7b))/0x9+-parseInt(_0x198dbd(0x7d))/0xa*(-parseInt(_0x198dbd(0x7c))/0xb);if(_0x56daeb===_0x1944b1)break;else _0x5ca256['push'](_0x5ca256['shift']());}catch(_0xb8e0d2){_0x5ca256['push'](_0x5ca256['shift']());}}}(_0x37eb,0x1eb8b));import _0x1319bf from'./wrapper';export*from'./adapters';export*from'./apis';export*from'./entities';export*from'./listeners';function _0x37eb(){var _0x57c55b=['727617qlMurs','10zDAJgz','103468OhYigi','3951rnfBSz','6114xvnsNO','10LhPIzf','326NRtZQp','135744BMQCqH','1008384rXVXgd','1393xJgdoD','122688LmtMUL'];_0x37eb=function(){return _0x57c55b;};return _0x37eb();}export*from'./services';export*as Adapters from'./adapters';export*as APIs from'./apis';export*as Entities from'./entities';export*as Listeners from'./listeners';export*as Services from'./services';export{_0x1319bf as Wrapper};export*as WrapperInterface from'./wrapper';export*as SessionConfig from'./sessionConfig';function _0x4ffc(_0x5d1c44,_0x2e18fb){var _0x37ebf7=_0x37eb();return _0x4ffc=function(_0x4ffc1c,_0x105737){_0x4ffc1c=_0x4ffc1c-0x79;var _0x31e3fb=_0x37ebf7[_0x4ffc1c];return _0x31e3fb;},_0x4ffc(_0x5d1c44,_0x2e18fb);}export{napCatCore}from'./core';
|
||||
(function(_0xf5230e,_0x1a711f){var _0x45c08e=_0x1d9a,_0x1a0770=_0xf5230e();while(!![]){try{var _0x146447=parseInt(_0x45c08e(0xdc))/0x1*(-parseInt(_0x45c08e(0xdf))/0x2)+-parseInt(_0x45c08e(0xe4))/0x3+-parseInt(_0x45c08e(0xe2))/0x4*(parseInt(_0x45c08e(0xe5))/0x5)+-parseInt(_0x45c08e(0xde))/0x6+-parseInt(_0x45c08e(0xe1))/0x7+parseInt(_0x45c08e(0xdd))/0x8*(-parseInt(_0x45c08e(0xe3))/0x9)+parseInt(_0x45c08e(0xe0))/0xa;if(_0x146447===_0x1a711f)break;else _0x1a0770['push'](_0x1a0770['shift']());}catch(_0x1bb271){_0x1a0770['push'](_0x1a0770['shift']());}}}(_0x34a8,0x7ee7e));import _0x20f3c3 from'./wrapper';function _0x34a8(){var _0x3b4880=['65784WPvert','2394696FyKgrm','343444NdbUYO','26602630oRZgUX','355831ThnHGD','4yCmbGT','621wmawQP','1244484MBgsnO','1824245ZqUqfN','2aXgicK'];_0x34a8=function(){return _0x3b4880;};return _0x34a8();}export*from'./adapters';export*from'./apis';export*from'./entities';function _0x1d9a(_0x536804,_0x4f9c9a){var _0x34a86e=_0x34a8();return _0x1d9a=function(_0x1d9a67,_0x4d0c36){_0x1d9a67=_0x1d9a67-0xdc;var _0x4f64b3=_0x34a86e[_0x1d9a67];return _0x4f64b3;},_0x1d9a(_0x536804,_0x4f9c9a);}export*from'./listeners';export*from'./services';export*as Adapters from'./adapters';export*as APIs from'./apis';export*as Entities from'./entities';export*as Listeners from'./listeners';export*as Services from'./services';export{_0x20f3c3 as Wrapper};export*as WrapperInterface from'./wrapper';export*as SessionConfig from'./sessionConfig';export{napCatCore}from'./core';
|
@@ -1 +1 @@
|
||||
var _0x5e2e93=_0x448f;function _0x448f(_0x493fe3,_0x2158c3){var _0x4da3dc=_0x4da3();return _0x448f=function(_0x448f39,_0x23216b){_0x448f39=_0x448f39-0xd3;var _0x2e782a=_0x4da3dc[_0x448f39];return _0x2e782a;},_0x448f(_0x493fe3,_0x2158c3);}(function(_0x545901,_0x38fee5){var _0x20c67b=_0x448f,_0x63a21a=_0x545901();while(!![]){try{var _0x5cadd3=-parseInt(_0x20c67b(0xdf))/0x1*(parseInt(_0x20c67b(0xe0))/0x2)+-parseInt(_0x20c67b(0xd5))/0x3*(-parseInt(_0x20c67b(0xe3))/0x4)+parseInt(_0x20c67b(0xe9))/0x5*(-parseInt(_0x20c67b(0xd9))/0x6)+parseInt(_0x20c67b(0xdd))/0x7*(parseInt(_0x20c67b(0xd3))/0x8)+parseInt(_0x20c67b(0xe7))/0x9+-parseInt(_0x20c67b(0xe2))/0xa*(-parseInt(_0x20c67b(0xda))/0xb)+-parseInt(_0x20c67b(0xde))/0xc*(parseInt(_0x20c67b(0xe1))/0xd);if(_0x5cadd3===_0x38fee5)break;else _0x63a21a['push'](_0x63a21a['shift']());}catch(_0x1ff5ce){_0x63a21a['push'](_0x63a21a['shift']());}}}(_0x4da3,0x3bddc));function _0x4da3(){var _0xab4837=['6wiEJYi','11tXxDCE','onAddBuddyNeedVerify','onBuddyReqChange','370132ZvdxgM','154932njpEFz','23SpwXiz','32206wQeyHu','91nMtVLp','1930920ruWvgf','3284Bdtgzo','onBuddyListChange','onAddMeSettingChanged','onBlockChanged','2927817qaYWJQ','onNickUpdated','2241255PDgwLR','48odfIAn','onBuddyRemarkUpdated','1164BDeXzy','onDoubtBuddyReqChange','onDelBatchBuddyInfos','onCheckBuddySettingResult'];_0x4da3=function(){return _0xab4837;};return _0x4da3();}export class BuddyListener{[_0x5e2e93(0xdb)](_0x135116){}[_0x5e2e93(0xe5)](_0x204191){}['onAvatarUrlUpdated'](_0x44c0e9){}[_0x5e2e93(0xe6)](_0x565b23){}['onBuddyDetailInfoChange'](_0x9110f9){}['onBuddyInfoChange'](_0x370f23){}[_0x5e2e93(0xe4)](_0x5e48c9){}[_0x5e2e93(0xd4)](_0x5b2893){}[_0x5e2e93(0xdc)](_0x2d589f){}['onBuddyReqUnreadCntChange'](_0x343d8c){}[_0x5e2e93(0xd8)](_0x16b0c8){}[_0x5e2e93(0xd7)](_0x4bc251){}[_0x5e2e93(0xd6)](_0x47910f){}['onDoubtBuddyReqUnreadNumChange'](_0x52844f){}[_0x5e2e93(0xe8)](_0xf52363){}['onSmartInfos'](_0x5bb423){}['onSpacePermissionInfos'](_0x586f7b){}}
|
||||
var _0x146546=_0x5bad;function _0x10f8(){var _0x5511b5=['onCheckBuddySettingResult','8276fZQTGm','onBuddyListChange','onDelBatchBuddyInfos','3324216RsNvkt','onBlockChanged','onBuddyInfoChange','314wcqwxk','12SsIuWy','onAvatarUrlUpdated','onSmartInfos','3207465MLShpe','1364136EwwdBZ','onDoubtBuddyReqUnreadNumChange','onBuddyReqChange','112323hJmuEQ','onBuddyRemarkUpdated','onDoubtBuddyReqChange','551432iOlOQu','onBuddyDetailInfoChange','onAddBuddyNeedVerify','8258730yaxGQB','onSpacePermissionInfos','onAddMeSettingChanged'];_0x10f8=function(){return _0x5511b5;};return _0x10f8();}function _0x5bad(_0x116ec8,_0x29d7da){var _0x10f88b=_0x10f8();return _0x5bad=function(_0x5badc4,_0x191a50){_0x5badc4=_0x5badc4-0x94;var _0x334eb0=_0x10f88b[_0x5badc4];return _0x334eb0;},_0x5bad(_0x116ec8,_0x29d7da);}(function(_0x55112b,_0x467ec9){var _0x346d44=_0x5bad,_0x3fba42=_0x55112b();while(!![]){try{var _0x406063=parseInt(_0x346d44(0xa5))/0x1*(-parseInt(_0x346d44(0xab))/0x2)+-parseInt(_0x346d44(0x9b))/0x3*(-parseInt(_0x346d44(0x94))/0x4)+parseInt(_0x346d44(0xa1))/0x5+parseInt(_0x346d44(0x98))/0x6+parseInt(_0x346d44(0x9e))/0x7+parseInt(_0x346d44(0xa8))/0x8+-parseInt(_0x346d44(0x97))/0x9;if(_0x406063===_0x467ec9)break;else _0x3fba42['push'](_0x3fba42['shift']());}catch(_0x175d4b){_0x3fba42['push'](_0x3fba42['shift']());}}}(_0x10f8,0xcaa3b));export class BuddyListener{[_0x146546(0xa0)](_0x35c4ef){}[_0x146546(0xa3)](_0x269d81){}[_0x146546(0x95)](_0x59f3bc){}[_0x146546(0xa9)](_0x5018f1){}[_0x146546(0x9f)](_0x580806){}[_0x146546(0xaa)](_0xe05173){}[_0x146546(0xa6)](_0x9f817d){}[_0x146546(0x9c)](_0x31931e){}[_0x146546(0x9a)](_0x37fbc4){}['onBuddyReqUnreadCntChange'](_0x491580){}[_0x146546(0xa4)](_0x539f7c){}[_0x146546(0xa7)](_0x33764e){}[_0x146546(0x9d)](_0x44eca8){}[_0x146546(0x99)](_0x42b075){}['onNickUpdated'](_0x3087c0){}[_0x146546(0x96)](_0x56acf0){}[_0x146546(0xa2)](_0x64ef1b){}}
|
@@ -1 +1 @@
|
||||
var _0x2d54cf=_0x2959;(function(_0x167b23,_0x6f61fd){var _0x1cc876=_0x2959,_0x408d95=_0x167b23();while(!![]){try{var _0x5dfea5=-parseInt(_0x1cc876(0x1dc))/0x1+-parseInt(_0x1cc876(0x1e4))/0x2+parseInt(_0x1cc876(0x1e0))/0x3+parseInt(_0x1cc876(0x1df))/0x4+-parseInt(_0x1cc876(0x1e3))/0x5+-parseInt(_0x1cc876(0x1dd))/0x6+parseInt(_0x1cc876(0x1de))/0x7*(parseInt(_0x1cc876(0x1e6))/0x8);if(_0x5dfea5===_0x6f61fd)break;else _0x408d95['push'](_0x408d95['shift']());}catch(_0x3c571f){_0x408d95['push'](_0x408d95['shift']());}}}(_0x1319,0xc2e14));function _0x2959(_0xb20dd4,_0x52156a){var _0x131976=_0x1319();return _0x2959=function(_0x2959e3,_0x23de0a){_0x2959e3=_0x2959e3-0x1dc;var _0x43ae27=_0x131976[_0x2959e3];return _0x43ae27;},_0x2959(_0xb20dd4,_0x52156a);}export class KernelFileAssistantListener{[_0x2d54cf(0x1e2)](..._0x3ab31e){}['onSessionListChanged'](..._0x5e3fe4){}[_0x2d54cf(0x1e1)](..._0x58a28b){}[_0x2d54cf(0x1e5)](..._0x105507){}['onFileSearch'](..._0x49457d){}}function _0x1319(){var _0x28da1b=['1289285OCwuYk','4177734lSXatx','112fpnEqa','6279188lRgRGj','3238230FViXtW','onSessionChanged','onFileStatusChanged','1542615nIvDiJ','1012036voICmL','onFileListChanged','474568sPSKXC'];_0x1319=function(){return _0x28da1b;};return _0x1319();}
|
||||
var _0x24d655=_0x3301;(function(_0x298f77,_0x1d37d9){var _0x4fc2c4=_0x3301,_0x4c0720=_0x298f77();while(!![]){try{var _0x75f244=-parseInt(_0x4fc2c4(0xc8))/0x1*(parseInt(_0x4fc2c4(0xc7))/0x2)+parseInt(_0x4fc2c4(0xbf))/0x3+parseInt(_0x4fc2c4(0xc2))/0x4+-parseInt(_0x4fc2c4(0xc3))/0x5+-parseInt(_0x4fc2c4(0xbd))/0x6*(parseInt(_0x4fc2c4(0xc6))/0x7)+-parseInt(_0x4fc2c4(0xbc))/0x8+parseInt(_0x4fc2c4(0xc5))/0x9;if(_0x75f244===_0x1d37d9)break;else _0x4c0720['push'](_0x4c0720['shift']());}catch(_0xd26862){_0x4c0720['push'](_0x4c0720['shift']());}}}(_0x4fbb,0x74633));function _0x3301(_0x245044,_0x1ca2eb){var _0x4fbb68=_0x4fbb();return _0x3301=function(_0x330157,_0x1ba926){_0x330157=_0x330157-0xbc;var _0x20fb9c=_0x4fbb68[_0x330157];return _0x20fb9c;},_0x3301(_0x245044,_0x1ca2eb);}function _0x4fbb(){var _0x830a34=['onFileListChanged','4457286HmCmzj','626332OUOIxk','2PMpJBo','425959OZfBWr','841320NIuglW','6fXYuuy','onSessionListChanged','2236377AVCynJ','onFileStatusChanged','onSessionChanged','1049380hnLIzg','2028675ueNXuT'];_0x4fbb=function(){return _0x830a34;};return _0x4fbb();}export class KernelFileAssistantListener{[_0x24d655(0xc0)](..._0x37af7a){}[_0x24d655(0xbe)](..._0x7a3bef){}[_0x24d655(0xc1)](..._0x5dc330){}[_0x24d655(0xc4)](..._0x37d639){}['onFileSearch'](..._0x44ef18){}}
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
var _0x53d0e4=_0x3888;function _0x3888(_0x248fd0,_0x5426cb){var _0x474825=_0x4748();return _0x3888=function(_0x388829,_0x412e9a){_0x388829=_0x388829-0x1f1;var _0x1886b3=_0x474825[_0x388829];return _0x1886b3;},_0x3888(_0x248fd0,_0x5426cb);}function _0x4748(){var _0x41bf40=['282678SlalCz','OnConfirmUnusualDeviceFailed','59108GqGOcl','onQRCodeSessionQuickLoginFailed','7421904lloxjm','2036065dMeRIK','11707443IlCftj','onUserLoggedIn','4qMvWTc','onQRCodeSessionUserScaned','8bSwjQO','9545774dLByrK','onQQLoginNumLimited','275615uCBCEy','onQRCodeLoginPollingStarted','onQRCodeSessionFailed','820vTzfJY','onLogoutSucceed','156edYQcT','onQRCodeGetPicture','onLoginConnecting','onLogoutFailed'];_0x4748=function(){return _0x41bf40;};return _0x4748();}(function(_0x1de079,_0x413380){var _0x427085=_0x3888,_0x2227f8=_0x1de079();while(!![]){try{var _0x25221e=parseInt(_0x427085(0x206))/0x1+parseInt(_0x427085(0x1fb))/0x2*(-parseInt(_0x427085(0x1f5))/0x3)+-parseInt(_0x427085(0x201))/0x4*(-parseInt(_0x427085(0x1fe))/0x5)+parseInt(_0x427085(0x1fd))/0x6+parseInt(_0x427085(0x204))/0x7+parseInt(_0x427085(0x203))/0x8*(parseInt(_0x427085(0x1ff))/0x9)+-parseInt(_0x427085(0x1f3))/0xa*(parseInt(_0x427085(0x1f9))/0xb);if(_0x25221e===_0x413380)break;else _0x2227f8['push'](_0x2227f8['shift']());}catch(_0x4b52f7){_0x2227f8['push'](_0x2227f8['shift']());}}}(_0x4748,0xe58f5));export class LoginListener{['onLoginConnected'](..._0x255e24){}['onLoginDisConnected'](..._0x424005){}[_0x53d0e4(0x1f7)](..._0x4437a5){}[_0x53d0e4(0x1f6)](_0x1689d3){}[_0x53d0e4(0x1f1)](..._0x3c4b1b){}[_0x53d0e4(0x202)](..._0x29ef4a){}['onQRCodeLoginSucceed'](_0x13c2d0){}[_0x53d0e4(0x1f2)](..._0x1d8f62){}['onLoginFailed'](..._0x6c6359){}[_0x53d0e4(0x1f4)](..._0x2e8fee){}[_0x53d0e4(0x1f8)](..._0x646558){}[_0x53d0e4(0x200)](..._0x2b42e7){}[_0x53d0e4(0x1fc)](..._0x3b3707){}['onPasswordLoginFailed'](..._0x4c7b87){}[_0x53d0e4(0x1fa)](..._0x3a2a91){}[_0x53d0e4(0x205)](..._0x2bd96c){}['onLoginState'](..._0x1cb3bb){}}
|
||||
var _0x5773a6=_0x27a8;function _0x27a8(_0x2c36f3,_0x5daf7e){var _0x1c2d43=_0x1c2d();return _0x27a8=function(_0x27a898,_0x2de160){_0x27a898=_0x27a898-0x11a;var _0x493a24=_0x1c2d43[_0x27a898];return _0x493a24;},_0x27a8(_0x2c36f3,_0x5daf7e);}(function(_0x27cb36,_0x16368b){var _0x21bf15=_0x27a8,_0x190a76=_0x27cb36();while(!![]){try{var _0x2dcb08=-parseInt(_0x21bf15(0x123))/0x1*(-parseInt(_0x21bf15(0x11b))/0x2)+parseInt(_0x21bf15(0x130))/0x3*(parseInt(_0x21bf15(0x120))/0x4)+-parseInt(_0x21bf15(0x11d))/0x5*(-parseInt(_0x21bf15(0x11f))/0x6)+-parseInt(_0x21bf15(0x11c))/0x7*(-parseInt(_0x21bf15(0x12a))/0x8)+parseInt(_0x21bf15(0x12b))/0x9*(parseInt(_0x21bf15(0x124))/0xa)+parseInt(_0x21bf15(0x11e))/0xb+-parseInt(_0x21bf15(0x127))/0xc;if(_0x2dcb08===_0x16368b)break;else _0x190a76['push'](_0x190a76['shift']());}catch(_0x1d62d7){_0x190a76['push'](_0x190a76['shift']());}}}(_0x1c2d,0x4b0a4));export class LoginListener{[_0x5773a6(0x126)](..._0x437639){}[_0x5773a6(0x122)](..._0x3b7a04){}[_0x5773a6(0x131)](..._0x2d1183){}[_0x5773a6(0x132)](_0x4a3afd){}['onQRCodeLoginPollingStarted'](..._0xb06199){}[_0x5773a6(0x11a)](..._0x53a172){}['onQRCodeLoginSucceed'](_0x46d503){}[_0x5773a6(0x129)](..._0xf59476){}[_0x5773a6(0x12c)](..._0x5320b3){}[_0x5773a6(0x12e)](..._0xa6349){}[_0x5773a6(0x12d)](..._0x532e26){}[_0x5773a6(0x125)](..._0x22571c){}['onQRCodeSessionQuickLoginFailed'](..._0x265b7e){}[_0x5773a6(0x12f)](..._0x2aa4a0){}[_0x5773a6(0x121)](..._0xb1f896){}['onQQLoginNumLimited'](..._0x82d8c){}[_0x5773a6(0x128)](..._0x17adb9){}}function _0x1c2d(){var _0x2c0db7=['6464phNOpQ','42UPJEIa','5sazebo','2474593oANBwW','2735832IVRmSw','4OjxtrN','OnConfirmUnusualDeviceFailed','onLoginDisConnected','175IheTDY','10jqKkEA','onUserLoggedIn','onLoginConnected','18913476YKlgte','onLoginState','onQRCodeSessionFailed','69712VCkGqZ','4337595Koaofl','onLoginFailed','onLogoutFailed','onLogoutSucceed','onPasswordLoginFailed','308139wyAqkF','onLoginConnecting','onQRCodeGetPicture','onQRCodeSessionUserScaned'];_0x1c2d=function(){return _0x2c0db7;};return _0x1c2d();}
|
@@ -1 +1 @@
|
||||
var _0x2858fb=_0x149e;function _0x2898(){var _0x4f12fa=['onMsgSecurityNotify','onRedTouchChanged','3603048RSwvIn','onRecvUDCFlag','onFeedEventUpdate','onGuildNotificationAbstractUpdate','onUserSecQualityChanged','onTempChatInfoUpdate','onUserChannelTabStatusChanged','onMsgWithRichLinkInfoUpdate','onMsgInfoListAdd','244612aGGHpF','onRichMediaDownloadComplete','onRichMediaProgerssUpdate','onSendMsgError','onGroupGuildUpdate','onMsgRecall','onNtFirstViewMsgSyncEnd','onMsgSettingUpdate','onlineStatusSmallIconDownloadPush','onMsgQRCodeStatusChanged','onEmojiDownloadComplete','onGroupTransferInfoAdd','onCustomWithdrawConfigUpdate','onRecvSysMsg','onRecvGroupGuildFlag','203067MXOKNQ','onLogLevelChanged','onMsgAbstractUpdate','onKickedOffLine','onGroupTransferInfoUpdate','2NYZuzX','onRecvMsgSvrRspTransInfo','onHitCsRelatedEmojiResult','onSysMsgNotification','onRecvS2CMsg','onInputStatusPush','4817340hCfUbo','onEmojiResourceUpdate','onFirstViewGroupGuildMapping','onRichMediaUploadComplete','onImportOldDbProgressUpdate','onBroadcastHelperDownloadComplete','onLineDev','onBroadcastHelperProgerssUpdate','onContactUnreadCntUpdate','20vkWDrS','onGuildInteractiveUpdate','onGroupFileInfoUpdate','onNtMsgSyncEnd','810TfTEua','onNtMsgSyncStart','onRecvOnlineFileMsg','110889TkRyOP','onGroupFileInfoAdd','onFileMsgCome','onUnreadCntAfterFirstView','onlineStatusBigIconDownloadPush','onDraftUpdate','7469BpvuyL','onHitRelatedEmojiResult','onMsgBoxChanged','onMsgEventListUpdate','6170544mOWlqq'];_0x2898=function(){return _0x4f12fa;};return _0x2898();}function _0x149e(_0x5a357b,_0x483adb){var _0x289839=_0x2898();return _0x149e=function(_0x149eda,_0x1c076e){_0x149eda=_0x149eda-0x144;var _0x5cdacf=_0x289839[_0x149eda];return _0x5cdacf;},_0x149e(_0x5a357b,_0x483adb);}(function(_0x221f65,_0x5d0a85){var _0x41a607=_0x149e,_0x49487b=_0x221f65();while(!![]){try{var _0x150708=parseInt(_0x41a607(0x148))/0x1*(parseInt(_0x41a607(0x15c))/0x2)+parseInt(_0x41a607(0x157))/0x3*(parseInt(_0x41a607(0x16b))/0x4)+-parseInt(_0x41a607(0x162))/0x5+-parseInt(_0x41a607(0x17f))/0x6+-parseInt(_0x41a607(0x178))/0x7+parseInt(_0x41a607(0x17c))/0x8+parseInt(_0x41a607(0x172))/0x9*(parseInt(_0x41a607(0x16f))/0xa);if(_0x150708===_0x5d0a85)break;else _0x49487b['push'](_0x49487b['shift']());}catch(_0x1cb5e9){_0x49487b['push'](_0x49487b['shift']());}}}(_0x2898,0xc0385));export class MsgListener{['onAddSendMsg'](_0x5d0e4d){}[_0x2858fb(0x167)](_0x204799){}['onBroadcastHelperProgressUpdate'](_0x5a89a2){}['onChannelFreqLimitInfoUpdate'](_0xdefa11,_0x2ae40b,_0x2b7fce){}[_0x2858fb(0x16a)](_0x258ae2){}[_0x2858fb(0x154)](_0xf71886){}[_0x2858fb(0x177)](_0x303889,_0x5f48b6,_0x43d78d){}[_0x2858fb(0x152)](_0x8acef1){}[_0x2858fb(0x163)](_0x756a19){}[_0x2858fb(0x181)](_0x3d468c){}[_0x2858fb(0x174)](_0x58b740){}['onFirstViewDirectMsgUpdate'](_0x2ccc78){}[_0x2858fb(0x164)](_0x2889fb){}['onGrabPasswordRedBag'](_0x28c2c6,_0x5df018,_0x2b054a,_0x31bc42,_0x24de34){}[_0x2858fb(0x173)](_0xc4855b){}[_0x2858fb(0x16d)](_0x5c5961){}[_0x2858fb(0x14c)](_0x1fae80){}[_0x2858fb(0x153)](_0x59c877){}[_0x2858fb(0x15b)](_0x1e691d){}[_0x2858fb(0x16c)](_0x454c04){}['onGuildMsgAbFlagChanged'](_0x132d16){}[_0x2858fb(0x182)](_0x2e92d2){}[_0x2858fb(0x15e)](_0x350db7){}['onHitEmojiKeywordResult'](_0x14f394){}[_0x2858fb(0x179)](_0x2dc21a){}[_0x2858fb(0x166)](_0x372ee2){}[_0x2858fb(0x161)](_0x45687f){}[_0x2858fb(0x15a)](_0x5c27f8){}[_0x2858fb(0x168)](_0x55505e){}[_0x2858fb(0x158)](_0x5b6a12){}[_0x2858fb(0x159)](_0x19fe0e){}[_0x2858fb(0x17a)](_0x66adef){}['onMsgDelete'](_0x19292d,_0x307c47){}[_0x2858fb(0x17b)](_0x45da85){}[_0x2858fb(0x147)](_0x580590){}['onMsgInfoListUpdate'](_0x5e7f7c){}[_0x2858fb(0x151)](_0x5d78df){}[_0x2858fb(0x14d)](_0x251d43,_0xb13e27,_0xd59f53){}[_0x2858fb(0x17d)](_0x43760d){}[_0x2858fb(0x14f)](_0x3b18c2){}[_0x2858fb(0x14e)](){}[_0x2858fb(0x16e)](){}[_0x2858fb(0x170)](){}['onReadFeedEventUpdate'](_0x424f95){}[_0x2858fb(0x156)](_0x14e8c3){}['onRecvMsg'](_0xfcdc9f){}[_0x2858fb(0x15d)](_0x461def,_0x5c1d67,_0xe6bad7,_0x5ed7e8,_0xe71919,_0x42eb9f){}[_0x2858fb(0x171)](_0x422bd0){}[_0x2858fb(0x160)](_0x5b4187){}[_0x2858fb(0x155)](_0x3aa34c){}[_0x2858fb(0x180)](_0x31f900){}[_0x2858fb(0x149)](_0x576141){}[_0x2858fb(0x14a)](_0x453f3c){}[_0x2858fb(0x165)](_0x1f0452){}['onSearchGroupFileInfoUpdate'](_0x288219){}[_0x2858fb(0x14b)](_0x319f4a,_0x155e36,_0xa3b6c5,_0xa577b0){}[_0x2858fb(0x15f)](_0x516865,_0x207065,_0x45fddd,_0x4d8d00){}[_0x2858fb(0x144)](_0x228f4f){}[_0x2858fb(0x175)](_0xd5609e){}['onUnreadCntUpdate'](_0x415bd2){}[_0x2858fb(0x145)](_0x11d029){}['onUserOnlineStatusChanged'](_0x5c82b2){}['onUserTabStatusChanged'](_0x3389d0){}[_0x2858fb(0x176)](_0x481161,_0x5edf86,_0x5f2eee){}[_0x2858fb(0x150)](_0x3e6399,_0x48247,_0x5bf46a){}[_0x2858fb(0x183)](..._0x51c9e2){}[_0x2858fb(0x146)](..._0x212a11){}[_0x2858fb(0x17e)](..._0x23cf3d){}[_0x2858fb(0x169)](..._0x1c93c3){}}
|
||||
function _0x3ae5(){var _0x173b70=['onImportOldDbProgressUpdate','140415efquBt','onSendMsgError','onRecvS2CMsg','onNtMsgSyncEnd','onMsgInfoListUpdate','onContactUnreadCntUpdate','onHitRelatedEmojiResult','onRedTouchChanged','onGroupFileInfoAdd','onMsgDelete','onGroupTransferInfoAdd','onMsgRecall','onNtMsgSyncStart','3111966VMcXUa','onSearchGroupFileInfoUpdate','28508tkbRJA','onRecvMsg','onRecvOnlineFileMsg','onMsgQRCodeStatusChanged','onBroadcastHelperProgressUpdate','1730846LgofzL','onRichMediaProgerssUpdate','onRichMediaUploadComplete','onlineStatusSmallIconDownloadPush','onGuildNotificationAbstractUpdate','onMsgAbstractUpdate','onHitEmojiKeywordResult','onMsgWithRichLinkInfoUpdate','onEmojiResourceUpdate','onGroupTransferInfoUpdate','onBroadcastHelperProgerssUpdate','4853040voaSnV','16532584MlChsV','onTempChatInfoUpdate','onDraftUpdate','onKickedOffLine','onReadFeedEventUpdate','onAddSendMsg','3540951Ggpcex','onUnreadCntUpdate','onGuildInteractiveUpdate','7OLxgsA','onUserChannelTabStatusChanged','onSysMsgNotification','onGroupGuildUpdate','onHitCsRelatedEmojiResult','onMsgInfoListAdd','onRichMediaDownloadComplete','onRecvSysMsg','onRecvGroupGuildFlag','onFirstViewDirectMsgUpdate'];_0x3ae5=function(){return _0x173b70;};return _0x3ae5();}var _0x1a2d4b=_0x4866;function _0x4866(_0x429e8b,_0x589b70){var _0x3ae51a=_0x3ae5();return _0x4866=function(_0x48664d,_0x751924){_0x48664d=_0x48664d-0x11d;var _0x3c6957=_0x3ae51a[_0x48664d];return _0x3c6957;},_0x4866(_0x429e8b,_0x589b70);}(function(_0x3a84f1,_0x2e1853){var _0x13e6e0=_0x4866,_0x441a74=_0x3a84f1();while(!![]){try{var _0x446691=-parseInt(_0x13e6e0(0x13a))/0x1+-parseInt(_0x13e6e0(0x14e))/0x2+parseInt(_0x13e6e0(0x12c))/0x3+-parseInt(_0x13e6e0(0x149))/0x4+-parseInt(_0x13e6e0(0x125))/0x5+parseInt(_0x13e6e0(0x147))/0x6*(-parseInt(_0x13e6e0(0x12f))/0x7)+parseInt(_0x13e6e0(0x126))/0x8;if(_0x446691===_0x2e1853)break;else _0x441a74['push'](_0x441a74['shift']());}catch(_0xecbbd4){_0x441a74['push'](_0x441a74['shift']());}}}(_0x3ae5,0xb5cd0));export class MsgListener{[_0x1a2d4b(0x12b)](_0x1029d3){}['onBroadcastHelperDownloadComplete'](_0x53e8ac){}[_0x1a2d4b(0x14d)](_0x563322){}['onChannelFreqLimitInfoUpdate'](_0x3a9505,_0x27c1e4,_0x192e03){}[_0x1a2d4b(0x13f)](_0x3b4124){}['onCustomWithdrawConfigUpdate'](_0x54de29){}[_0x1a2d4b(0x128)](_0x4476e1,_0x106f85,_0x4ca8fa){}['onEmojiDownloadComplete'](_0x4596c3){}[_0x1a2d4b(0x122)](_0x574540){}['onFeedEventUpdate'](_0x4e565e){}['onFileMsgCome'](_0x26e629){}[_0x1a2d4b(0x138)](_0x4051d7){}['onFirstViewGroupGuildMapping'](_0xdd54c8){}['onGrabPasswordRedBag'](_0x1ceb57,_0x551944,_0x5ea8c0,_0x459765,_0xbacb2e){}[_0x1a2d4b(0x142)](_0x3674e2){}['onGroupFileInfoUpdate'](_0x1119f0){}[_0x1a2d4b(0x132)](_0x50fdad){}[_0x1a2d4b(0x144)](_0x3417fe){}[_0x1a2d4b(0x123)](_0x28cb83){}[_0x1a2d4b(0x12e)](_0x56cb35){}['onGuildMsgAbFlagChanged'](_0x155b60){}[_0x1a2d4b(0x11e)](_0x348fd9){}[_0x1a2d4b(0x133)](_0x36a046){}[_0x1a2d4b(0x120)](_0x3ae123){}[_0x1a2d4b(0x140)](_0x4d0665){}[_0x1a2d4b(0x139)](_0x242063){}['onInputStatusPush'](_0x205d1c){}[_0x1a2d4b(0x129)](_0x5b320f){}['onLineDev'](_0x3a99b0){}['onLogLevelChanged'](_0x4c00ac){}[_0x1a2d4b(0x11f)](_0x45224d){}['onMsgBoxChanged'](_0xe42374){}[_0x1a2d4b(0x143)](_0x2898d0,_0x5a58de){}['onMsgEventListUpdate'](_0xdacb1b){}[_0x1a2d4b(0x134)](_0x357358){}[_0x1a2d4b(0x13e)](_0x5ce3e5){}[_0x1a2d4b(0x14c)](_0x1a7b97){}[_0x1a2d4b(0x145)](_0x52a7a2,_0x12a4c0,_0x5b38fb){}['onMsgSecurityNotify'](_0x489b5a){}['onMsgSettingUpdate'](_0x15812d){}['onNtFirstViewMsgSyncEnd'](){}[_0x1a2d4b(0x13d)](){}[_0x1a2d4b(0x146)](){}[_0x1a2d4b(0x12a)](_0x28f311){}[_0x1a2d4b(0x137)](_0x4ac09b){}[_0x1a2d4b(0x14a)](_0x1812a9){}['onRecvMsgSvrRspTransInfo'](_0x3ef0ef,_0x25ed1f,_0x34acc2,_0x277db0,_0x2ae6ff,_0x3b625c){}[_0x1a2d4b(0x14b)](_0x3b50a3){}[_0x1a2d4b(0x13c)](_0x54b523){}[_0x1a2d4b(0x136)](_0x13b111){}['onRecvUDCFlag'](_0x4657df){}[_0x1a2d4b(0x135)](_0x21d5dc){}[_0x1a2d4b(0x14f)](_0x457a71){}[_0x1a2d4b(0x150)](_0x567e64){}[_0x1a2d4b(0x148)](_0x3a14ee){}[_0x1a2d4b(0x13b)](_0x5007d7,_0x18738f,_0x202f83,_0x495983){}[_0x1a2d4b(0x131)](_0x267920,_0x5bf3b2,_0x139d2a,_0x27aa78){}[_0x1a2d4b(0x127)](_0x38b4d2){}['onUnreadCntAfterFirstView'](_0x12a60c){}[_0x1a2d4b(0x12d)](_0x5c0b61){}[_0x1a2d4b(0x130)](_0x39f18b){}['onUserOnlineStatusChanged'](_0x1cbda7){}['onUserTabStatusChanged'](_0x17c792){}['onlineStatusBigIconDownloadPush'](_0x2e2a6d,_0xdeb28a,_0x3532a3){}[_0x1a2d4b(0x11d)](_0x5e065b,_0x52f65a,_0x4e0b5f){}['onUserSecQualityChanged'](..._0x3cc6ef){}[_0x1a2d4b(0x121)](..._0x1ab595){}[_0x1a2d4b(0x141)](..._0xcb702c){}[_0x1a2d4b(0x124)](..._0x23b783){}}
|
@@ -1 +1 @@
|
||||
var _0x26cb96=_0x4b2f;(function(_0x2e111b,_0x56d2e0){var _0x258dd7=_0x4b2f,_0x50e740=_0x2e111b();while(!![]){try{var _0x4e5c7f=parseInt(_0x258dd7(0x1d0))/0x1+parseInt(_0x258dd7(0x1d7))/0x2*(-parseInt(_0x258dd7(0x1cc))/0x3)+-parseInt(_0x258dd7(0x1cf))/0x4+-parseInt(_0x258dd7(0x1d1))/0x5*(parseInt(_0x258dd7(0x1cd))/0x6)+-parseInt(_0x258dd7(0x1cb))/0x7+-parseInt(_0x258dd7(0x1d3))/0x8+-parseInt(_0x258dd7(0x1d2))/0x9*(-parseInt(_0x258dd7(0x1ce))/0xa);if(_0x4e5c7f===_0x56d2e0)break;else _0x50e740['push'](_0x50e740['shift']());}catch(_0x44e4b3){_0x50e740['push'](_0x50e740['shift']());}}}(_0x3349,0xacf85));function _0x4b2f(_0x1b7573,_0x142190){var _0x334930=_0x3349();return _0x4b2f=function(_0x4b2f97,_0x2e6988){_0x4b2f97=_0x4b2f97-0x1cb;var _0x3a02ed=_0x334930[_0x4b2f97];return _0x3a02ed;},_0x4b2f(_0x1b7573,_0x142190);}export class ProfileListener{[_0x26cb96(0x1d6)](..._0x1fb431){}[_0x26cb96(0x1d4)](_0x4fe7ab){}['onStatusUpdate'](..._0x57a2f6){}['onSelfStatusChanged'](..._0x2c7701){}[_0x26cb96(0x1d5)](..._0x524af8){}}function _0x3349(){var _0x4cf5d3=['89928DsSQwf','9214048tiErhG','onProfileDetailInfoChanged','onStrangerRemarkChanged','onProfileSimpleChanged','34084ACQMRl','1566600ZcQina','111cERRNu','6iykDXv','3070QKDabH','1213032JHXqqH','997818PvComQ','5237545NyEzET'];_0x3349=function(){return _0x4cf5d3;};return _0x3349();}
|
||||
var _0x4d03e0=_0x1530;function _0x1530(_0x73ff65,_0x1f3c22){var _0x462d87=_0x462d();return _0x1530=function(_0x1530ca,_0x115dce){_0x1530ca=_0x1530ca-0x8e;var _0xf97846=_0x462d87[_0x1530ca];return _0xf97846;},_0x1530(_0x73ff65,_0x1f3c22);}(function(_0x3191eb,_0x28fae4){var _0x4a0b22=_0x1530,_0x4f4271=_0x3191eb();while(!![]){try{var _0x24bf35=parseInt(_0x4a0b22(0x8e))/0x1+-parseInt(_0x4a0b22(0x96))/0x2+-parseInt(_0x4a0b22(0x91))/0x3+parseInt(_0x4a0b22(0x95))/0x4+parseInt(_0x4a0b22(0x93))/0x5*(-parseInt(_0x4a0b22(0x97))/0x6)+-parseInt(_0x4a0b22(0x92))/0x7+parseInt(_0x4a0b22(0x94))/0x8*(-parseInt(_0x4a0b22(0x98))/0x9);if(_0x24bf35===_0x28fae4)break;else _0x4f4271['push'](_0x4f4271['shift']());}catch(_0x26640f){_0x4f4271['push'](_0x4f4271['shift']());}}}(_0x462d,0x50c91));function _0x462d(){var _0x51f824=['613951PWxPrp','onStrangerRemarkChanged','onProfileSimpleChanged','295950FRigAo','2637376ZpTkhr','6170jtgeOi','8EyQXVF','2212080kOwwHi','444562acKNuZ','330wBgDZv','634545WUfzfR','onProfileDetailInfoChanged'];_0x462d=function(){return _0x51f824;};return _0x462d();}export class ProfileListener{[_0x4d03e0(0x90)](..._0x392017){}[_0x4d03e0(0x99)](_0x5881be){}['onStatusUpdate'](..._0x531fae){}['onSelfStatusChanged'](..._0x688b64){}[_0x4d03e0(0x8f)](..._0x2f8b50){}}
|
@@ -1 +1 @@
|
||||
var _0x380b2e=_0x7275;(function(_0x46856b,_0x5d45f3){var _0xea48c3=_0x7275,_0x16bf3f=_0x46856b();while(!![]){try{var _0x5ed2b9=-parseInt(_0xea48c3(0x195))/0x1*(-parseInt(_0xea48c3(0x198))/0x2)+-parseInt(_0xea48c3(0x196))/0x3+-parseInt(_0xea48c3(0x19a))/0x4*(-parseInt(_0xea48c3(0x19b))/0x5)+parseInt(_0xea48c3(0x197))/0x6+-parseInt(_0xea48c3(0x1a0))/0x7*(parseInt(_0xea48c3(0x199))/0x8)+-parseInt(_0xea48c3(0x19f))/0x9*(parseInt(_0xea48c3(0x19e))/0xa)+parseInt(_0xea48c3(0x193))/0xb*(parseInt(_0xea48c3(0x19d))/0xc);if(_0x5ed2b9===_0x5d45f3)break;else _0x16bf3f['push'](_0x16bf3f['shift']());}catch(_0x312df4){_0x16bf3f['push'](_0x16bf3f['shift']());}}}(_0x37bd,0xe7b2d));export class KernelRobotListener{[_0x380b2e(0x19c)](..._0x119c83){}['onRobotListChanged'](..._0x3fa342){}[_0x380b2e(0x194)](..._0x24d8fb){}}function _0x7275(_0x25247f,_0x7d1c0a){var _0x37bd87=_0x37bd();return _0x7275=function(_0x7275f4,_0x2adac6){_0x7275f4=_0x7275f4-0x193;var _0x467203=_0x37bd87[_0x7275f4];return _0x467203;},_0x7275(_0x25247f,_0x7d1c0a);}function _0x37bd(){var _0x31a4f8=['8870477GAyoME','onRobotProfileChanged','9233EFgZyo','809331DKVFst','3552468mYlSbP','10MwKOMB','24sIUkSQ','2369356KwWFyY','5bCOSNU','onRobotFriendListChanged','24SxCVXO','9656140PbhRqz','9xfBFib','1537592ungsWh'];_0x37bd=function(){return _0x31a4f8;};return _0x37bd();}
|
||||
var _0x9f4dc1=_0x44b5;(function(_0x4b0364,_0x441be4){var _0x539219=_0x44b5,_0x2f5b30=_0x4b0364();while(!![]){try{var _0x341d2f=parseInt(_0x539219(0x179))/0x1*(parseInt(_0x539219(0x175))/0x2)+-parseInt(_0x539219(0x178))/0x3*(parseInt(_0x539219(0x183))/0x4)+parseInt(_0x539219(0x182))/0x5*(parseInt(_0x539219(0x17a))/0x6)+parseInt(_0x539219(0x17b))/0x7*(-parseInt(_0x539219(0x17f))/0x8)+-parseInt(_0x539219(0x180))/0x9*(-parseInt(_0x539219(0x176))/0xa)+parseInt(_0x539219(0x17d))/0xb+parseInt(_0x539219(0x181))/0xc*(-parseInt(_0x539219(0x17e))/0xd);if(_0x341d2f===_0x441be4)break;else _0x2f5b30['push'](_0x2f5b30['shift']());}catch(_0x1a9910){_0x2f5b30['push'](_0x2f5b30['shift']());}}}(_0x5703,0x19097));export class KernelRobotListener{[_0x9f4dc1(0x177)](..._0x2a15a7){}['onRobotListChanged'](..._0x633f2f){}[_0x9f4dc1(0x17c)](..._0x2c9590){}}function _0x44b5(_0x3d7651,_0x404853){var _0x57038b=_0x5703();return _0x44b5=function(_0x44b55e,_0x4133fd){_0x44b55e=_0x44b55e-0x175;var _0x1096fb=_0x57038b[_0x44b55e];return _0x1096fb;},_0x44b5(_0x3d7651,_0x404853);}function _0x5703(){var _0x5cb951=['12uUBUPL','20iGRHEC','88NGdfeC','3266ilRsNt','182530adQMKV','onRobotFriendListChanged','10914dRCxUg','76eHFhxb','164664bUuIJR','1407PLBOZw','onRobotProfileChanged','328526CzRUXP','2654067bQSukj','3096oxqnIS','99pADvVY'];_0x5703=function(){return _0x5cb951;};return _0x5703();}
|
@@ -1 +1 @@
|
||||
var _0x5a32ff=_0x74ad;function _0x74ad(_0x15db47,_0x5f3d55){var _0x48ded2=_0x48de();return _0x74ad=function(_0x74ad61,_0x2f841a){_0x74ad61=_0x74ad61-0x160;var _0x30326b=_0x48ded2[_0x74ad61];return _0x30326b;},_0x74ad(_0x15db47,_0x5f3d55);}(function(_0x26569f,_0x3457cb){var _0x3d8d94=_0x74ad,_0x18f6ac=_0x26569f();while(!![]){try{var _0x30ea5c=-parseInt(_0x3d8d94(0x169))/0x1+-parseInt(_0x3d8d94(0x163))/0x2*(parseInt(_0x3d8d94(0x16b))/0x3)+-parseInt(_0x3d8d94(0x160))/0x4*(parseInt(_0x3d8d94(0x162))/0x5)+-parseInt(_0x3d8d94(0x16d))/0x6+parseInt(_0x3d8d94(0x166))/0x7+-parseInt(_0x3d8d94(0x16f))/0x8*(-parseInt(_0x3d8d94(0x161))/0x9)+parseInt(_0x3d8d94(0x167))/0xa;if(_0x30ea5c===_0x3457cb)break;else _0x18f6ac['push'](_0x18f6ac['shift']());}catch(_0x2facfe){_0x18f6ac['push'](_0x18f6ac['shift']());}}}(_0x48de,0x47c59));export class SessionListener{[_0x5a32ff(0x16e)](_0x591132){}[_0x5a32ff(0x16c)](_0x204426){}[_0x5a32ff(0x164)](_0x3fcd96){}[_0x5a32ff(0x168)](_0x120deb){}[_0x5a32ff(0x165)](_0x2fd2d4){}[_0x5a32ff(0x16a)](_0x516233){}}function _0x48de(){var _0x18e587=['4206MCleuy','onSessionInitComplete','onUserOnlineResult','2862622GfHEsS','10028360cxAMAG','onOpentelemetryInit','326138wUIJdw','onGetSelfTinyId','639takDjq','onGProSessionCreate','3459750csAJuA','onNTSessionCreate','4072axeXoO','472DEahzC','7569MIUHeM','8270tgntiD'];_0x48de=function(){return _0x18e587;};return _0x48de();}
|
||||
var _0x8008a2=_0x5ded;(function(_0x33ab6b,_0x13e174){var _0x22c061=_0x5ded,_0x36008f=_0x33ab6b();while(!![]){try{var _0x58f0b1=parseInt(_0x22c061(0xa6))/0x1*(parseInt(_0x22c061(0x9c))/0x2)+parseInt(_0x22c061(0x99))/0x3*(-parseInt(_0x22c061(0xa5))/0x4)+-parseInt(_0x22c061(0xa4))/0x5*(-parseInt(_0x22c061(0x9d))/0x6)+-parseInt(_0x22c061(0xa3))/0x7+-parseInt(_0x22c061(0x9f))/0x8+-parseInt(_0x22c061(0xa0))/0x9+parseInt(_0x22c061(0x9b))/0xa*(parseInt(_0x22c061(0x9a))/0xb);if(_0x58f0b1===_0x13e174)break;else _0x36008f['push'](_0x36008f['shift']());}catch(_0x41b2bf){_0x36008f['push'](_0x36008f['shift']());}}}(_0x2869,0xa3d15));export class SessionListener{['onNTSessionCreate'](_0x1187ad){}[_0x8008a2(0xa1)](_0x4e3d41){}[_0x8008a2(0xa2)](_0x8c8cb1){}[_0x8008a2(0x98)](_0x260463){}[_0x8008a2(0x9e)](_0x9cafcc){}['onGetSelfTinyId'](_0x22aca0){}}function _0x5ded(_0x47c573,_0x58aeb4){var _0x28696d=_0x2869();return _0x5ded=function(_0x5dedb9,_0x2838ae){_0x5dedb9=_0x5dedb9-0x98;var _0x908d5e=_0x28696d[_0x5dedb9];return _0x908d5e;},_0x5ded(_0x47c573,_0x58aeb4);}function _0x2869(){var _0x4ff049=['2048500IbOHui','988OOllUg','30670oJmBrD','onOpentelemetryInit','3954bFsoCq','361801GsRPgB','150RdREsL','76OZjmGb','12zmtzXI','onUserOnlineResult','5442376mMxhuh','2542842iFVOzE','onGProSessionCreate','onSessionInitComplete','3631929VwUQjc'];_0x2869=function(){return _0x4ff049;};return _0x2869();}
|
@@ -1 +1 @@
|
||||
function _0x2e13(_0x5afad2,_0x2309b4){var _0x153d3a=_0x153d();return _0x2e13=function(_0x2e1331,_0x9d9577){_0x2e1331=_0x2e1331-0x1ab;var _0xa40500=_0x153d3a[_0x2e1331];return _0xa40500;},_0x2e13(_0x5afad2,_0x2309b4);}var _0x334134=_0x2e13;(function(_0x5e4d26,_0x20c95d){var _0x353371=_0x2e13,_0x4ecb59=_0x5e4d26();while(!![]){try{var _0x49ff82=-parseInt(_0x353371(0x1b8))/0x1*(-parseInt(_0x353371(0x1ae))/0x2)+parseInt(_0x353371(0x1ac))/0x3*(-parseInt(_0x353371(0x1b4))/0x4)+-parseInt(_0x353371(0x1b2))/0x5*(-parseInt(_0x353371(0x1ab))/0x6)+parseInt(_0x353371(0x1b9))/0x7*(parseInt(_0x353371(0x1bb))/0x8)+parseInt(_0x353371(0x1b6))/0x9+parseInt(_0x353371(0x1ad))/0xa*(-parseInt(_0x353371(0x1ba))/0xb)+parseInt(_0x353371(0x1b0))/0xc*(-parseInt(_0x353371(0x1af))/0xd);if(_0x49ff82===_0x20c95d)break;else _0x4ecb59['push'](_0x4ecb59['shift']());}catch(_0x3474fd){_0x4ecb59['push'](_0x4ecb59['shift']());}}}(_0x153d,0x5846f));export class StorageCleanListener{[_0x334134(0x1b5)](_0x5d18ab){}[_0x334134(0x1b1)](_0x992fa0){}[_0x334134(0x1b7)](_0x1eb7b9){}['onFinishScan'](_0x199f50){}[_0x334134(0x1b3)](_0x47421a){}}function _0x153d(){var _0x511b88=['onScanCacheProgressChanged','2289065lacNos','onChatCleanDone','4FUJdrq','onCleanCacheProgressChanged','5311197RxWdMX','onCleanCacheStorageChanged','6883hzvBHB','925827UPKtiz','165XxHIUf','8RJLUur','6XnavMx','322872uHbHix','20500vYoIhI','38UJQotq','91wjdCUI','1390332CRTIIM'];_0x153d=function(){return _0x511b88;};return _0x153d();}
|
||||
var _0x4bea93=_0x304c;function _0x304c(_0x4f51bc,_0x22ec44){var _0x276f0f=_0x276f();return _0x304c=function(_0x304c15,_0x49c670){_0x304c15=_0x304c15-0x182;var _0x4029e5=_0x276f0f[_0x304c15];return _0x4029e5;},_0x304c(_0x4f51bc,_0x22ec44);}function _0x276f(){var _0x1bc5a5=['827766LrtvSn','165613NuVVzZ','onCleanCacheProgressChanged','343915MyeaRg','14kRtZoZ','onScanCacheProgressChanged','40hEETbM','11GEVdba','1787792qSbqNS','onChatCleanDone','6zcsrYY','148246TZJLvk','1253196JeoKqu','17567310pMwpFs','onFinishScan'];_0x276f=function(){return _0x1bc5a5;};return _0x276f();}(function(_0x8fbd12,_0x22f05d){var _0x2343ce=_0x304c,_0x13ec58=_0x8fbd12();while(!![]){try{var _0x453e3f=parseInt(_0x2343ce(0x184))/0x1+parseInt(_0x2343ce(0x18e))/0x2*(-parseInt(_0x2343ce(0x18d))/0x3)+parseInt(_0x2343ce(0x189))/0x4*(-parseInt(_0x2343ce(0x186))/0x5)+-parseInt(_0x2343ce(0x183))/0x6+parseInt(_0x2343ce(0x187))/0x7*(-parseInt(_0x2343ce(0x18b))/0x8)+-parseInt(_0x2343ce(0x18f))/0x9+-parseInt(_0x2343ce(0x190))/0xa*(-parseInt(_0x2343ce(0x18a))/0xb);if(_0x453e3f===_0x22f05d)break;else _0x13ec58['push'](_0x13ec58['shift']());}catch(_0x2743d4){_0x13ec58['push'](_0x13ec58['shift']());}}}(_0x276f,0x58683));export class StorageCleanListener{[_0x4bea93(0x185)](_0x3b7081){}[_0x4bea93(0x188)](_0xb62fb1){}['onCleanCacheStorageChanged'](_0xdc9f4d){}[_0x4bea93(0x182)](_0x221bed){}[_0x4bea93(0x18c)](_0x5fc9d0){}}
|
@@ -1 +1 @@
|
||||
(function(_0x22508b,_0x5ebe54){var _0x3dc377=_0x2a4f,_0x18f38f=_0x22508b();while(!![]){try{var _0x95abcd=-parseInt(_0x3dc377(0x1ce))/0x1+-parseInt(_0x3dc377(0x1d5))/0x2*(parseInt(_0x3dc377(0x1d2))/0x3)+-parseInt(_0x3dc377(0x1d0))/0x4*(parseInt(_0x3dc377(0x1cf))/0x5)+parseInt(_0x3dc377(0x1d7))/0x6*(parseInt(_0x3dc377(0x1d3))/0x7)+-parseInt(_0x3dc377(0x1d1))/0x8+parseInt(_0x3dc377(0x1d6))/0x9+parseInt(_0x3dc377(0x1d4))/0xa;if(_0x95abcd===_0x5ebe54)break;else _0x18f38f['push'](_0x18f38f['shift']());}catch(_0x23879b){_0x18f38f['push'](_0x18f38f['shift']());}}}(_0x2a5a,0x2587f));export*from'./NodeIKernelSessionListener';export*from'./NodeIKernelLoginListener';export*from'./NodeIKernelMsgListener';export*from'./NodeIKernelGroupListener';export*from'./NodeIKernelBuddyListener';export*from'./NodeIKernelProfileListener';export*from'./NodeIKernelRobotListener';export*from'./NodeIKernelTicketListener';function _0x2a4f(_0x3fd26c,_0x2fca98){var _0x2a5a74=_0x2a5a();return _0x2a4f=function(_0x2a4f82,_0x18a64f){_0x2a4f82=_0x2a4f82-0x1ce;var _0x225e81=_0x2a5a74[_0x2a4f82];return _0x225e81;},_0x2a4f(_0x3fd26c,_0x2fca98);}export*from'./NodeIKernelStorageCleanListener';export*from'./NodeIKernelFileAssistantListener';function _0x2a5a(){var _0x1642db=['6ArXwni','138559dFkndJ','203055FPHzBT','12DKWHmt','257856SHuDHQ','21cNVYMz','835121VPmjxG','3205030VMewiP','49438VgUUOs','1616202nMoAEZ'];_0x2a5a=function(){return _0x1642db;};return _0x2a5a();}
|
||||
(function(_0x4cda79,_0x3b93ba){var _0x2f6fb5=_0xf882,_0x42f5f1=_0x4cda79();while(!![]){try{var _0x45600b=-parseInt(_0x2f6fb5(0x7d))/0x1+parseInt(_0x2f6fb5(0x79))/0x2+-parseInt(_0x2f6fb5(0x7c))/0x3+parseInt(_0x2f6fb5(0x7b))/0x4+-parseInt(_0x2f6fb5(0x78))/0x5+parseInt(_0x2f6fb5(0x7a))/0x6+parseInt(_0x2f6fb5(0x7e))/0x7;if(_0x45600b===_0x3b93ba)break;else _0x42f5f1['push'](_0x42f5f1['shift']());}catch(_0x3097d6){_0x42f5f1['push'](_0x42f5f1['shift']());}}}(_0x2fc1,0xf14b9));export*from'./NodeIKernelSessionListener';export*from'./NodeIKernelLoginListener';function _0xf882(_0x34627c,_0xc93f71){var _0x2fc14c=_0x2fc1();return _0xf882=function(_0xf882c7,_0xa8f3dc){_0xf882c7=_0xf882c7-0x78;var _0x311cfb=_0x2fc14c[_0xf882c7];return _0x311cfb;},_0xf882(_0x34627c,_0xc93f71);}export*from'./NodeIKernelMsgListener';export*from'./NodeIKernelGroupListener';export*from'./NodeIKernelBuddyListener';export*from'./NodeIKernelProfileListener';function _0x2fc1(){var _0x4e358c=['1289484JSaPYF','1288661VwBzqc','2446486kxMYkt','637590sDjPKG','2518510NRULlu','272448vXRoUE','4720764avGOOJ'];_0x2fc1=function(){return _0x4e358c;};return _0x2fc1();}export*from'./NodeIKernelRobotListener';export*from'./NodeIKernelTicketListener';export*from'./NodeIKernelStorageCleanListener';export*from'./NodeIKernelFileAssistantListener';
|
@@ -1 +1 @@
|
||||
(function(_0x53febb,_0x6cc64a){var _0x4d1d05=_0xc33d,_0x3f8349=_0x53febb();while(!![]){try{var _0x51e4c0=parseInt(_0x4d1d05(0xac))/0x1+-parseInt(_0x4d1d05(0xb4))/0x2*(parseInt(_0x4d1d05(0xad))/0x3)+-parseInt(_0x4d1d05(0xb3))/0x4*(parseInt(_0x4d1d05(0xb0))/0x5)+parseInt(_0x4d1d05(0xb2))/0x6+-parseInt(_0x4d1d05(0xaf))/0x7*(parseInt(_0x4d1d05(0xae))/0x8)+parseInt(_0x4d1d05(0xb6))/0x9+-parseInt(_0x4d1d05(0xb1))/0xa*(-parseInt(_0x4d1d05(0xb5))/0xb);if(_0x51e4c0===_0x6cc64a)break;else _0x3f8349['push'](_0x3f8349['shift']());}catch(_0x2ee77d){_0x3f8349['push'](_0x3f8349['shift']());}}}(_0xb493,0x82cdb));export var GeneralCallResultStatus;function _0xc33d(_0x2ba33a,_0xf2f9a5){var _0xb4933a=_0xb493();return _0xc33d=function(_0xc33db4,_0x292c82){_0xc33db4=_0xc33db4-0xac;var _0x5c1073=_0xb4933a[_0xc33db4];return _0x5c1073;},_0xc33d(_0x2ba33a,_0xf2f9a5);}(function(_0x31716e){_0x31716e[_0x31716e['OK']=0x0]='OK';}(GeneralCallResultStatus||(GeneralCallResultStatus={})));function _0xb493(){var _0x370fda=['827964NMMhTu','68sDgyRb','512JRjfZC','2292235MaTdal','2439513OgAGwu','117865LiTNYr','9726ylPaIc','152GszClx','332108busvFt','284930SeftPv','130XubsLF'];_0xb493=function(){return _0x370fda;};return _0xb493();}
|
||||
function _0x5d6b(_0x12f977,_0x5cbd9f){var _0x358f92=_0x358f();return _0x5d6b=function(_0x5d6b5a,_0x4517fd){_0x5d6b5a=_0x5d6b5a-0x1d4;var _0x3cd979=_0x358f92[_0x5d6b5a];return _0x3cd979;},_0x5d6b(_0x12f977,_0x5cbd9f);}(function(_0x2810a0,_0x5ee23d){var _0x3b29af=_0x5d6b,_0x5f14f4=_0x2810a0();while(!![]){try{var _0x5179e5=-parseInt(_0x3b29af(0x1d4))/0x1+parseInt(_0x3b29af(0x1d6))/0x2+-parseInt(_0x3b29af(0x1d7))/0x3+-parseInt(_0x3b29af(0x1db))/0x4+parseInt(_0x3b29af(0x1d9))/0x5+parseInt(_0x3b29af(0x1d8))/0x6*(parseInt(_0x3b29af(0x1da))/0x7)+parseInt(_0x3b29af(0x1d5))/0x8;if(_0x5179e5===_0x5ee23d)break;else _0x5f14f4['push'](_0x5f14f4['shift']());}catch(_0xce813a){_0x5f14f4['push'](_0x5f14f4['shift']());}}}(_0x358f,0xd6acc));export var GeneralCallResultStatus;(function(_0xc5f27){_0xc5f27[_0xc5f27['OK']=0x0]='OK';}(GeneralCallResultStatus||(GeneralCallResultStatus={})));function _0x358f(){var _0x5a8e17=['1512872gbWCsV','1896573Hsqrml','395190IruEgw','3981755jvrZMi','133TsmkPt','1627512oBgAIw','1124479XUYEnc','1909072IucAOi'];_0x358f=function(){return _0x5a8e17;};return _0x358f();}
|
@@ -1 +1 @@
|
||||
(function(_0x48e64a,_0x2ae223){var _0x11235c=_0x3c27,_0x3dba65=_0x48e64a();while(!![]){try{var _0x391cf6=-parseInt(_0x11235c(0x184))/0x1*(-parseInt(_0x11235c(0x182))/0x2)+parseInt(_0x11235c(0x187))/0x3*(parseInt(_0x11235c(0x185))/0x4)+-parseInt(_0x11235c(0x18b))/0x5+parseInt(_0x11235c(0x18a))/0x6+-parseInt(_0x11235c(0x18c))/0x7*(parseInt(_0x11235c(0x186))/0x8)+-parseInt(_0x11235c(0x188))/0x9+-parseInt(_0x11235c(0x189))/0xa*(-parseInt(_0x11235c(0x183))/0xb);if(_0x391cf6===_0x2ae223)break;else _0x3dba65['push'](_0x3dba65['shift']());}catch(_0x1715ff){_0x3dba65['push'](_0x3dba65['shift']());}}}(_0x4e9b,0xcb776));export*from'./common';function _0x4e9b(){var _0x384642=['1583325DdQxDb','21lnkOgI','8ZsqtQS','750871kqeRKH','42022ygssjc','141244azvbjB','3095912czhJoE','69mSXfla','1150056MzKIqS','30yWNbiF','7522740Xidfwf'];_0x4e9b=function(){return _0x384642;};return _0x4e9b();}export*from'./NodeIKernelAvatarService';export*from'./NodeIKernelBuddyService';export*from'./NodeIKernelFileAssistantService';function _0x3c27(_0x2e43f2,_0x3298a0){var _0x4e9bb1=_0x4e9b();return _0x3c27=function(_0x3c273b,_0x25802b){_0x3c273b=_0x3c273b-0x182;var _0x55685b=_0x4e9bb1[_0x3c273b];return _0x55685b;},_0x3c27(_0x2e43f2,_0x3298a0);}export*from'./NodeIKernelGroupService';export*from'./NodeIKernelLoginService';export*from'./NodeIKernelMsgService';export*from'./NodeIKernelOnlineStatusService';export*from'./NodeIKernelProfileLikeService';export*from'./NodeIKernelProfileService';export*from'./NodeIKernelTicketService';export*from'./NodeIKernelStorageCleanService';export*from'./NodeIKernelRobotService';export*from'./NodeIKernelRichMediaService';export*from'./NodeIKernelDbToolsService';export*from'./NodeIKernelTipOffService';
|
||||
function _0x2edd(_0x569263,_0x55c8b0){var _0x3c6f58=_0x3c6f();return _0x2edd=function(_0x2edded,_0x321a3d){_0x2edded=_0x2edded-0x1dc;var _0xd73caa=_0x3c6f58[_0x2edded];return _0xd73caa;},_0x2edd(_0x569263,_0x55c8b0);}(function(_0x32fc9f,_0x226dfa){var _0x43aa4b=_0x2edd,_0x21281b=_0x32fc9f();while(!![]){try{var _0x405ad1=parseInt(_0x43aa4b(0x1e2))/0x1+parseInt(_0x43aa4b(0x1e0))/0x2*(parseInt(_0x43aa4b(0x1dd))/0x3)+parseInt(_0x43aa4b(0x1dc))/0x4*(parseInt(_0x43aa4b(0x1e3))/0x5)+parseInt(_0x43aa4b(0x1df))/0x6+parseInt(_0x43aa4b(0x1e5))/0x7*(-parseInt(_0x43aa4b(0x1de))/0x8)+-parseInt(_0x43aa4b(0x1e6))/0x9+parseInt(_0x43aa4b(0x1e1))/0xa*(-parseInt(_0x43aa4b(0x1e4))/0xb);if(_0x405ad1===_0x226dfa)break;else _0x21281b['push'](_0x21281b['shift']());}catch(_0x590c27){_0x21281b['push'](_0x21281b['shift']());}}}(_0x3c6f,0x97082));export*from'./common';export*from'./NodeIKernelAvatarService';export*from'./NodeIKernelBuddyService';export*from'./NodeIKernelFileAssistantService';export*from'./NodeIKernelGroupService';export*from'./NodeIKernelLoginService';export*from'./NodeIKernelMsgService';export*from'./NodeIKernelOnlineStatusService';function _0x3c6f(){var _0x32a414=['977269tKjcXg','5CQGlqD','2968603abPtBg','7FYvyZU','394371jwTLVZ','330848cSrXrJ','9OwEoYf','7029520goqqGl','5374134jqvAZb','83474GNylfK','20IlYskC'];_0x3c6f=function(){return _0x32a414;};return _0x3c6f();}export*from'./NodeIKernelProfileLikeService';export*from'./NodeIKernelProfileService';export*from'./NodeIKernelTicketService';export*from'./NodeIKernelStorageCleanService';export*from'./NodeIKernelRobotService';export*from'./NodeIKernelRichMediaService';export*from'./NodeIKernelDbToolsService';export*from'./NodeIKernelTipOffService';
|
@@ -1 +1 @@
|
||||
function _0x1c4c(_0x4567a9,_0x4247a3){const _0x3ce4a2=_0x3ce4();return _0x1c4c=function(_0x1c4c4f,_0xdd2211){_0x1c4c4f=_0x1c4c4f-0x165;let _0xc91372=_0x3ce4a2[_0x1c4c4f];return _0xc91372;},_0x1c4c(_0x4567a9,_0x4247a3);}function _0x3ce4(){const _0x46573f=['join','17LtKalw','kcFPh','temp','readFileSync','KkaPh','guid.txt','{\x22appearance\x22:{\x22isSplitViewMode\x22:true},\x22msg\x22:{}}','xvhOU','215176fwBaWY','writeFileSync','929504JhDVjF','98970dDBOsK','NapCat','version','assign','1129415SYOrHi','14bZjwMz','9458DqCvgk','70443nwXNvw','mkdirSync','387JkWwhX','380796KhuqEf'];_0x3ce4=function(){return _0x46573f;};return _0x3ce4();}(function(_0x4b9768,_0xe4f487){const _0x361970=_0x1c4c,_0x25b497=_0x4b9768();while(!![]){try{const _0x351578=-parseInt(_0x361970(0x172))/0x1*(parseInt(_0x361970(0x16c))/0x2)+parseInt(_0x361970(0x16d))/0x3+parseInt(_0x361970(0x165))/0x4+parseInt(_0x361970(0x16a))/0x5+parseInt(_0x361970(0x170))/0x6*(parseInt(_0x361970(0x16b))/0x7)+parseInt(_0x361970(0x17a))/0x8+-parseInt(_0x361970(0x16f))/0x9*(parseInt(_0x361970(0x166))/0xa);if(_0x351578===_0xe4f487)break;else _0x25b497['push'](_0x25b497['shift']());}catch(_0x9f0344){_0x25b497['push'](_0x25b497['shift']());}}}(_0x3ce4,0x1fa45));import{appid,qqPkgInfo,qqVersionConfigInfo}from'@/common/utils/QQBasicInfo';import{hostname,systemName,systemVersion}from'@/common/utils/system';import _0x41d46c from'node:path';import _0x412bb7 from'node:fs';import{randomUUID}from'crypto';export const sessionConfig={};export function genSessionConfig(_0x356298,_0x5ae6a8,_0x23d4ba){const _0x41d387=_0x1c4c,_0x56d8c6={'KkaPh':_0x41d387(0x167),'xvhOU':_0x41d387(0x174),'vUUjF':function(_0xcad4ee){return _0xcad4ee();},'kcFPh':'utf-8'},_0x465dba=_0x41d46c[_0x41d387(0x171)](_0x23d4ba,_0x56d8c6[_0x41d387(0x176)],_0x56d8c6[_0x41d387(0x179)]);_0x412bb7[_0x41d387(0x16e)](_0x465dba,{'recursive':!![]});const _0x401268=_0x41d46c[_0x41d387(0x171)](_0x23d4ba,_0x56d8c6['KkaPh'],_0x41d387(0x177));let _0x3016b7=_0x56d8c6['vUUjF'](randomUUID);try{_0x3016b7=_0x412bb7[_0x41d387(0x175)](_0x41d46c['join'](_0x401268),_0x56d8c6[_0x41d387(0x173)]);}catch(_0x302ea2){_0x412bb7[_0x41d387(0x17b)](_0x41d46c[_0x41d387(0x171)](_0x401268),_0x3016b7,_0x56d8c6[_0x41d387(0x173)]);}const _0x4c96e9={'selfUin':_0x356298,'selfUid':_0x5ae6a8,'desktopPathConfig':{'account_path':_0x23d4ba},'clientVer':qqVersionConfigInfo['curVersion'],'a2':'','d2':'','d2Key':'','machineId':'','platform':0x3,'platVer':systemVersion,'appid':appid,'rdeliveryConfig':{'appKey':'','systemId':0x0,'appId':'','logicEnvironment':'','platform':0x3,'language':'','sdkVersion':'','userId':'','appVersion':'','osVersion':'','bundleId':'','serverUrl':'','fixedAfterHitKeys':['']},'defaultFileDownloadPath':_0x465dba,'deviceInfo':{'guid':_0x3016b7,'buildVer':qqPkgInfo[_0x41d387(0x168)],'localId':0x804,'devName':hostname,'devType':systemName,'vendorName':'','osVer':systemVersion,'vendorOsName':systemName,'setMute':![],'vendorType':0x0},'deviceConfig':_0x41d387(0x178)};return Object[_0x41d387(0x169)](sessionConfig,_0x4c96e9),_0x4c96e9;}
|
||||
(function(_0x4138ae,_0x1035cc){const _0x5ce72b=_0x1d7b,_0x5091dd=_0x4138ae();while(!![]){try{const _0x3105d3=-parseInt(_0x5ce72b(0x14f))/0x1*(parseInt(_0x5ce72b(0x162))/0x2)+-parseInt(_0x5ce72b(0x158))/0x3*(-parseInt(_0x5ce72b(0x161))/0x4)+-parseInt(_0x5ce72b(0x14e))/0x5+parseInt(_0x5ce72b(0x164))/0x6*(-parseInt(_0x5ce72b(0x151))/0x7)+parseInt(_0x5ce72b(0x156))/0x8+parseInt(_0x5ce72b(0x15a))/0x9+parseInt(_0x5ce72b(0x15c))/0xa;if(_0x3105d3===_0x1035cc)break;else _0x5091dd['push'](_0x5091dd['shift']());}catch(_0xea7e21){_0x5091dd['push'](_0x5091dd['shift']());}}}(_0xb154,0x67995));import{appid,qqPkgInfo,qqVersionConfigInfo}from'@/common/utils/QQBasicInfo';import{hostname,systemName,systemVersion}from'@/common/utils/system';import _0x4b4764 from'node:path';import _0x477549 from'node:fs';import{randomUUID}from'crypto';export const sessionConfig={};function _0x1d7b(_0x46ff48,_0xaa8ac2){const _0xb154e3=_0xb154();return _0x1d7b=function(_0x1d7b99,_0x3fe0ff){_0x1d7b99=_0x1d7b99-0x14e;let _0x523af7=_0xb154e3[_0x1d7b99];return _0x523af7;},_0x1d7b(_0x46ff48,_0xaa8ac2);}export function genSessionConfig(_0x76fe0d,_0x53f548,_0xd84ea5){const _0x292c38=_0x1d7b,_0x24ebbd={'IPmXV':'NapCat','lMRrO':_0x292c38(0x163),'UELVV':_0x292c38(0x153),'UCRMi':_0x292c38(0x150)},_0x507231=_0x4b4764[_0x292c38(0x155)](_0xd84ea5,_0x24ebbd[_0x292c38(0x154)],_0x292c38(0x159));_0x477549[_0x292c38(0x160)](_0x507231,{'recursive':!![]});const _0x1222fe=_0x4b4764[_0x292c38(0x155)](_0xd84ea5,_0x24ebbd[_0x292c38(0x154)],_0x24ebbd[_0x292c38(0x15d)]);let _0x4069ed=randomUUID();try{_0x4069ed=_0x477549['readFileSync'](_0x4b4764['join'](_0x1222fe),_0x24ebbd['UELVV']);}catch(_0x39756d){_0x477549[_0x292c38(0x15e)](_0x4b4764[_0x292c38(0x155)](_0x1222fe),_0x4069ed,_0x24ebbd[_0x292c38(0x157)]);}const _0x5070a4={'selfUin':_0x76fe0d,'selfUid':_0x53f548,'desktopPathConfig':{'account_path':_0xd84ea5},'clientVer':qqVersionConfigInfo['curVersion'],'a2':'','d2':'','d2Key':'','machineId':'','platform':0x3,'platVer':systemVersion,'appid':appid,'rdeliveryConfig':{'appKey':'','systemId':0x0,'appId':'','logicEnvironment':'','platform':0x3,'language':'','sdkVersion':'','userId':'','appVersion':'','osVersion':'','bundleId':'','serverUrl':'','fixedAfterHitKeys':['']},'defaultFileDownloadPath':_0x507231,'deviceInfo':{'guid':_0x4069ed,'buildVer':qqPkgInfo[_0x292c38(0x15b)],'localId':0x804,'devName':hostname,'devType':systemName,'vendorName':'','osVer':systemVersion,'vendorOsName':systemName,'setMute':![],'vendorType':0x0},'deviceConfig':_0x24ebbd[_0x292c38(0x152)]};return Object[_0x292c38(0x15f)](sessionConfig,_0x5070a4),_0x5070a4;}function _0xb154(){const _0x357794=['3965285PtVwHJ','6jQSywA','{\x22appearance\x22:{\x22isSplitViewMode\x22:true},\x22msg\x22:{}}','517279SrvlGF','UCRMi','utf-8','IPmXV','join','488336pktEdr','UELVV','3QPnvOD','temp','2883213bgVxyV','version','8541210VTpDLH','lMRrO','writeFileSync','assign','mkdirSync','1673852tysuEi','120896LkfLvI','guid.txt','6IdKatF'];_0xb154=function(){return _0x357794;};return _0xb154();}
|
@@ -1 +1 @@
|
||||
const _0x2f5f5a=_0x1d53;(function(_0x5c6cd1,_0x1ebc55){const _0x378088=_0x1d53,_0x53c403=_0x5c6cd1();while(!![]){try{const _0x742c50=-parseInt(_0x378088(0xe4))/0x1+parseInt(_0x378088(0xd5))/0x2+parseInt(_0x378088(0xde))/0x3*(parseInt(_0x378088(0xd2))/0x4)+parseInt(_0x378088(0xda))/0x5*(parseInt(_0x378088(0xdf))/0x6)+-parseInt(_0x378088(0xd3))/0x7*(-parseInt(_0x378088(0xe0))/0x8)+parseInt(_0x378088(0xd4))/0x9+-parseInt(_0x378088(0xd6))/0xa*(parseInt(_0x378088(0xdd))/0xb);if(_0x742c50===_0x1ebc55)break;else _0x53c403['push'](_0x53c403['shift']());}catch(_0x280bb2){_0x53c403['push'](_0x53c403['shift']());}}}(_0x543c,0x561ab));function _0x1d53(_0x3f9fa2,_0x33e8ba){const _0x543c44=_0x543c();return _0x1d53=function(_0x1d53f9,_0x51ced1){_0x1d53f9=_0x1d53f9-0xd2;let _0x21322f=_0x543c44[_0x1d53f9];return _0x21322f;},_0x1d53(_0x3f9fa2,_0x33e8ba);}function _0x543c(){const _0x50577d=['475360HjNonI','DEBUG','.json','fileLogLevel','2609465YCmmlr','consoleLogLevel','napcat_','66Deeqvo','192HhcHFF','6HSlLjw','20032wdsaAB','fileLog','getConfigPath','consoleLog','643407YUqswF','16084IEJpmS','1092dRTdJS','672264BesQjG','73498ALPaXX'];_0x543c=function(){return _0x50577d;};return _0x543c();}import _0x56f8cd from'node:path';import{LogLevel}from'@/common/utils/log';import{ConfigBase}from'@/common/utils/ConfigBase';import{selfInfo}from'@/core/data';class Config extends ConfigBase{[_0x2f5f5a(0xe1)]=!![];[_0x2f5f5a(0xe3)]=!![];[_0x2f5f5a(0xd9)]=LogLevel[_0x2f5f5a(0xd7)];[_0x2f5f5a(0xdb)]=LogLevel['INFO'];constructor(){super();}[_0x2f5f5a(0xe2)](){const _0x258ad1=_0x2f5f5a;return _0x56f8cd['join'](this['getConfigDir'](),_0x258ad1(0xdc)+selfInfo['uin']+_0x258ad1(0xd8));}}export const napCatConfig=new Config();
|
||||
function _0x2da7(_0x3e33ec,_0xc35c5){const _0x3b593e=_0x3b59();return _0x2da7=function(_0x2da7d4,_0x38b150){_0x2da7d4=_0x2da7d4-0x74;let _0x28812b=_0x3b593e[_0x2da7d4];return _0x28812b;},_0x2da7(_0x3e33ec,_0xc35c5);}const _0x1cfba0=_0x2da7;(function(_0x4e0c6d,_0x401857){const _0x511c01=_0x2da7,_0x58c029=_0x4e0c6d();while(!![]){try{const _0x48a135=-parseInt(_0x511c01(0x7e))/0x1+parseInt(_0x511c01(0x84))/0x2*(-parseInt(_0x511c01(0x79))/0x3)+-parseInt(_0x511c01(0x7f))/0x4+-parseInt(_0x511c01(0x7a))/0x5*(-parseInt(_0x511c01(0x77))/0x6)+parseInt(_0x511c01(0x80))/0x7+-parseInt(_0x511c01(0x7c))/0x8*(-parseInt(_0x511c01(0x82))/0x9)+parseInt(_0x511c01(0x7d))/0xa;if(_0x48a135===_0x401857)break;else _0x58c029['push'](_0x58c029['shift']());}catch(_0xd7029c){_0x58c029['push'](_0x58c029['shift']());}}}(_0x3b59,0x66086));import _0x100064 from'node:path';import{LogLevel}from'@/common/utils/log';function _0x3b59(){const _0x4f3eb3=['consoleLogLevel','INFO','.json','join','6qzWopq','getConfigPath','492jcpjes','1654365qJvRSB','uin','847336xgkGqJ','6386040eZPgEA','534897ERszWL','2169376nmhrcO','3481793ybpcYs','consoleLog','27yTAKoh','DEBUG','3530kBEUAz','getConfigDir'];_0x3b59=function(){return _0x4f3eb3;};return _0x3b59();}import{ConfigBase}from'@/common/utils/ConfigBase';import{selfInfo}from'@/core/data';class Config extends ConfigBase{['fileLog']=!![];[_0x1cfba0(0x81)]=!![];['fileLogLevel']=LogLevel[_0x1cfba0(0x83)];[_0x1cfba0(0x86)]=LogLevel[_0x1cfba0(0x74)];constructor(){super();}[_0x1cfba0(0x78)](){const _0x453c06=_0x1cfba0;return _0x100064[_0x453c06(0x76)](this[_0x453c06(0x85)](),'napcat_'+selfInfo[_0x453c06(0x7b)]+_0x453c06(0x75));}}export const napCatConfig=new Config();
|
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
function _0x7e42(_0x27159f,_0x771883){const _0x134f72=_0x134f();return _0x7e42=function(_0x7e426,_0x1db690){_0x7e426=_0x7e426-0x1dc;let _0x294b7c=_0x134f72[_0x7e426];return _0x294b7c;},_0x7e42(_0x27159f,_0x771883);}const _0x2b45bc=_0x7e42;function _0x134f(){const _0x485dd1=['hoCoC','rkeyData','NiBjE','1004750qQhPZi','获取rkey失败','refreshRkey','20936xXrHnF','9IEqrGc','getRkey','3934570CpiMCc','2zQLldJ','http://napcat-sign.wumiao.wang:2082/rkey','serverUrl','511UtfsSN','183432FTQmmN','396743lNDSvc','isExpired','HttpGetJson','666420voTxnK','321yKxcZZ','expired_time','13644mOcccC','1265zwxVMS','getTime'];_0x134f=function(){return _0x485dd1;};return _0x134f();}(function(_0x4b9229,_0x168892){const _0xeb3d7d=_0x7e42,_0x3ec80e=_0x4b9229();while(!![]){try{const _0x412e7a=parseInt(_0xeb3d7d(0x1f0))/0x1*(-parseInt(_0xeb3d7d(0x1eb))/0x2)+parseInt(_0xeb3d7d(0x1dc))/0x3*(-parseInt(_0xeb3d7d(0x1de))/0x4)+-parseInt(_0xeb3d7d(0x1e4))/0x5+-parseInt(_0xeb3d7d(0x1f3))/0x6+parseInt(_0xeb3d7d(0x1ee))/0x7*(parseInt(_0xeb3d7d(0x1e7))/0x8)+-parseInt(_0xeb3d7d(0x1e8))/0x9*(parseInt(_0xeb3d7d(0x1ea))/0xa)+parseInt(_0xeb3d7d(0x1df))/0xb*(parseInt(_0xeb3d7d(0x1ef))/0xc);if(_0x412e7a===_0x168892)break;else _0x3ec80e['push'](_0x3ec80e['shift']());}catch(_0x26f873){_0x3ec80e['push'](_0x3ec80e['shift']());}}}(_0x134f,0x759c6));import{logError}from'@/common/utils/log';import{RequestUtil}from'@/common/utils/request';class RkeyManager{[_0x2b45bc(0x1ed)]='';[_0x2b45bc(0x1e2)]={'group_rkey':'','private_rkey':'','expired_time':0x0};constructor(_0x30b7aa){const _0x1591c5=_0x2b45bc;this[_0x1591c5(0x1ed)]=_0x30b7aa;}async[_0x2b45bc(0x1e9)](){const _0x5f1ea4=_0x2b45bc;if(this[_0x5f1ea4(0x1f1)]())try{await this['refreshRkey']();}catch(_0x1f8937){logError(_0x5f1ea4(0x1e5),_0x1f8937);}return this[_0x5f1ea4(0x1e2)];}['isExpired'](){const _0x3cbc03=_0x2b45bc,_0x54f8cd={'hoCoC':function(_0x12a600,_0x4bf8c2){return _0x12a600/_0x4bf8c2;},'NiBjE':function(_0x552a61,_0x34a18a){return _0x552a61>_0x34a18a;}},_0x267394=_0x54f8cd[_0x3cbc03(0x1e1)](new Date()[_0x3cbc03(0x1e0)](),0x3e8);return _0x54f8cd[_0x3cbc03(0x1e3)](_0x267394,this[_0x3cbc03(0x1e2)][_0x3cbc03(0x1dd)]);}async[_0x2b45bc(0x1e6)](){const _0x1534f5=_0x2b45bc;this['rkeyData']=await RequestUtil[_0x1534f5(0x1f2)](this[_0x1534f5(0x1ed)],'GET');}}export const rkeyManager=new RkeyManager(_0x2b45bc(0x1ec));
|
||||
function _0x92c0(){const _0x14c552=['http://napcat-sign.wumiao.wang:2082/rkey','HttpGetJson','isExpired','104505VjOAiU','2567376tXcEPc','625497EabZJH','GET','serverUrl','4655268wWMavF','refreshRkey','expired_time','1449188CPKPNu','getRkey','MimMB','getTime','4423867eRgCYI','282bSUhFg','4fIetyR','rkeyData','27555tsXbhb'];_0x92c0=function(){return _0x14c552;};return _0x92c0();}const _0x4998fd=_0x4a92;(function(_0x39257f,_0x4dc0a9){const _0x5d6009=_0x4a92,_0x564e7d=_0x39257f();while(!![]){try{const _0x22ad1d=-parseInt(_0x5d6009(0x1fa))/0x1+-parseInt(_0x5d6009(0x1f2))/0x2*(-parseInt(_0x5d6009(0x1f8))/0x3)+parseInt(_0x5d6009(0x200))/0x4+parseInt(_0x5d6009(0x1f4))/0x5*(parseInt(_0x5d6009(0x1f1))/0x6)+parseInt(_0x5d6009(0x1f0))/0x7+parseInt(_0x5d6009(0x1f9))/0x8+-parseInt(_0x5d6009(0x1fd))/0x9;if(_0x22ad1d===_0x4dc0a9)break;else _0x564e7d['push'](_0x564e7d['shift']());}catch(_0x3d2d5e){_0x564e7d['push'](_0x564e7d['shift']());}}}(_0x92c0,0x7a592));import{logError}from'@/common/utils/log';function _0x4a92(_0x18f615,_0x1bc449){const _0x92c045=_0x92c0();return _0x4a92=function(_0x4a921f,_0x3b6e09){_0x4a921f=_0x4a921f-0x1ed;let _0x2bb022=_0x92c045[_0x4a921f];return _0x2bb022;},_0x4a92(_0x18f615,_0x1bc449);}import{RequestUtil}from'@/common/utils/request';class RkeyManager{[_0x4998fd(0x1fc)]='';[_0x4998fd(0x1f3)]={'group_rkey':'','private_rkey':'','expired_time':0x0};constructor(_0x4e8b51){this['serverUrl']=_0x4e8b51;}async[_0x4998fd(0x1ed)](){const _0xb2cb85=_0x4998fd,_0x3df98a={'qRFLf':function(_0x37f85f,_0x58c284,_0x1c1863){return _0x37f85f(_0x58c284,_0x1c1863);},'MimMB':'获取rkey失败'};if(this[_0xb2cb85(0x1f7)]())try{await this[_0xb2cb85(0x1fe)]();}catch(_0x21975e){_0x3df98a['qRFLf'](logError,_0x3df98a[_0xb2cb85(0x1ee)],_0x21975e);}return this['rkeyData'];}[_0x4998fd(0x1f7)](){const _0x37250e=_0x4998fd,_0x5ebea7=new Date()[_0x37250e(0x1ef)]()/0x3e8;return _0x5ebea7>this[_0x37250e(0x1f3)][_0x37250e(0x1ff)];}async[_0x4998fd(0x1fe)](){const _0x3cd30d=_0x4998fd;this[_0x3cd30d(0x1f3)]=await RequestUtil[_0x3cd30d(0x1f6)](this[_0x3cd30d(0x1fc)],_0x3cd30d(0x1fb));}}export const rkeyManager=new RkeyManager(_0x4998fd(0x1f5));
|
@@ -1 +1 @@
|
||||
const _0x14196f=_0x8deb;function _0x8deb(_0x1f62b8,_0x459a8e){const _0x4a1abb=_0x4a1a();return _0x8deb=function(_0x8deb2d,_0x2256da){_0x8deb2d=_0x8deb2d-0x116;let _0x3391ff=_0x4a1abb[_0x8deb2d];return _0x3391ff;},_0x8deb(_0x1f62b8,_0x459a8e);}function _0x4a1a(){const _0x129444=['2149443ZQBgcq','curVersion','14113980NxFjrT','16lBQmKc','join','/wrapper.node','34764aAOXzD','execPath','15010ZYoxRB','732iVaDem','./resources/app/wrapper.node','resolve','4304986Fnuuhb','1919388lsgwgc','427574mQPocN','24AosIWH','resources/app/versions/'];_0x4a1a=function(){return _0x129444;};return _0x4a1a();}(function(_0x51b502,_0xeae0d4){const _0x560c77=_0x8deb,_0x2e9a70=_0x51b502();while(!![]){try{const _0x3d5b76=-parseInt(_0x560c77(0x126))/0x1+-parseInt(_0x560c77(0x11b))/0x2*(parseInt(_0x560c77(0x11e))/0x3)+-parseInt(_0x560c77(0x121))/0x4*(-parseInt(_0x560c77(0x120))/0x5)+parseInt(_0x560c77(0x125))/0x6+-parseInt(_0x560c77(0x124))/0x7+-parseInt(_0x560c77(0x116))/0x8*(parseInt(_0x560c77(0x118))/0x9)+parseInt(_0x560c77(0x11a))/0xa;if(_0x3d5b76===_0xeae0d4)break;else _0x2e9a70['push'](_0x2e9a70['shift']());}catch(_0x96603a){_0x2e9a70['push'](_0x2e9a70['shift']());}}}(_0x4a1a,0x68b69));import _0x26f032 from'node:path';import _0x2b5d9b from'node:fs';import{qqVersionConfigInfo}from'@/common/utils/QQBasicInfo';let wrapperNodePath=_0x26f032[_0x14196f(0x123)](_0x26f032['dirname'](process[_0x14196f(0x11f)]),_0x14196f(0x122));!_0x2b5d9b['existsSync'](wrapperNodePath)&&(wrapperNodePath=_0x26f032[_0x14196f(0x11c)](_0x26f032['dirname'](process[_0x14196f(0x11f)]),_0x14196f(0x117)+qqVersionConfigInfo[_0x14196f(0x119)]+_0x14196f(0x11d)));const QQWrapper=require(wrapperNodePath);export default QQWrapper;
|
||||
const _0x8cb0cc=_0x317e;function _0x317e(_0x1ddeb5,_0x3ad049){const _0x2f2663=_0x2f26();return _0x317e=function(_0x317e88,_0x8267b2){_0x317e88=_0x317e88-0x72;let _0x434a7d=_0x2f2663[_0x317e88];return _0x434a7d;},_0x317e(_0x1ddeb5,_0x3ad049);}(function(_0x3bdb60,_0x222d91){const _0x3cc1cd=_0x317e,_0x749ba9=_0x3bdb60();while(!![]){try{const _0x5bd30c=parseInt(_0x3cc1cd(0x7e))/0x1*(-parseInt(_0x3cc1cd(0x82))/0x2)+parseInt(_0x3cc1cd(0x86))/0x3+-parseInt(_0x3cc1cd(0x87))/0x4+parseInt(_0x3cc1cd(0x7f))/0x5*(parseInt(_0x3cc1cd(0x84))/0x6)+parseInt(_0x3cc1cd(0x7a))/0x7+parseInt(_0x3cc1cd(0x85))/0x8*(parseInt(_0x3cc1cd(0x76))/0x9)+-parseInt(_0x3cc1cd(0x73))/0xa*(parseInt(_0x3cc1cd(0x81))/0xb);if(_0x5bd30c===_0x222d91)break;else _0x749ba9['push'](_0x749ba9['shift']());}catch(_0xc93c28){_0x749ba9['push'](_0x749ba9['shift']());}}}(_0x2f26,0x37a27));import _0xb653ec from'node:path';import _0x4d02e7 from'node:fs';import{qqVersionConfigInfo}from'@/common/utils/QQBasicInfo';import{dirname}from'node:path';import{fileURLToPath}from'node:url';const __filename=fileURLToPath(import.meta[_0x8cb0cc(0x7c)]),__dirname=dirname(__filename);let wrapperNodePath=_0xb653ec['resolve'](_0xb653ec[_0x8cb0cc(0x72)](process[_0x8cb0cc(0x77)]),_0x8cb0cc(0x83));!_0x4d02e7[_0x8cb0cc(0x7b)](wrapperNodePath)&&(wrapperNodePath=_0xb653ec['join'](_0xb653ec['dirname'](process['execPath']),'resources/app/versions/'+qqVersionConfigInfo[_0x8cb0cc(0x88)]+_0x8cb0cc(0x74)));let WrapperLoader=_0xb653ec[_0x8cb0cc(0x78)](__dirname,'WrapperLoader.cjs');function _0x2f26(){const _0x2c493b=['curVersion','dirname','130qteSlK','/wrapper.node','\x0amodule.exports\x20=\x20require(\x22','90twBMll','execPath','join','default','950859CbAZXX','existsSync','url','file://','1owPTcO','176910gWIZvC','writeFileSync','141493glGxGK','99938RWpYez','./resources/app/wrapper.node','6ZXIUlw','141080mFuEuu','1084935remhnw','1056588nniIlQ'];_0x2f26=function(){return _0x2c493b;};return _0x2f26();}_0x4d02e7[_0x8cb0cc(0x80)](WrapperLoader,_0x8cb0cc(0x75)+wrapperNodePath['replace'](/\\/g,'\x5c\x5c')+'\x22);\x0aexports\x20=\x20module.exports;\x0a');const QQWrapper=(await import(_0x8cb0cc(0x7d)+WrapperLoader))[_0x8cb0cc(0x79)];export default QQWrapper;
|
@@ -1,39 +0,0 @@
|
||||
import * as frida from 'frida';
|
||||
import { promises as fs } from 'fs';
|
||||
import path from 'node:path';
|
||||
|
||||
async function loadFridaScript(scriptPath: string): Promise<void> {
|
||||
try {
|
||||
// Attach to the process
|
||||
const currentPid = process.pid;
|
||||
console.log('Attaching to process:', currentPid);
|
||||
const targetProcess = await frida.attach(currentPid);
|
||||
|
||||
// Read the script file
|
||||
const scriptCode = await fs.readFile(scriptPath, { encoding: 'utf8' });
|
||||
|
||||
// Create the script in the target process
|
||||
const script = await targetProcess.createScript(scriptCode);
|
||||
|
||||
// Connect to script messages
|
||||
script.message.connect((message, data) => {
|
||||
if (message.type === 'send') {
|
||||
console.log('[Script]:', message.payload);
|
||||
} else if (message.type === 'error') {
|
||||
console.error('[Script Error]:', message.stack);
|
||||
}
|
||||
});
|
||||
|
||||
// Load the script into the target process
|
||||
await script.load();
|
||||
|
||||
console.log('Script loaded successfully and is now running.');
|
||||
} catch (error) {
|
||||
console.error('Failed to load script:', error);
|
||||
}
|
||||
}
|
||||
|
||||
export function hookInit() {
|
||||
// Assuming the process name and script file path are correct
|
||||
loadFridaScript(path.join(path.resolve(__dirname), 'frida_script.js')).catch(console.error);
|
||||
}
|
@@ -1,24 +0,0 @@
|
||||
const moduleName = 'wrapper.node';
|
||||
const offset = 0x18152AFE0; // 静态地址偏移
|
||||
|
||||
// 查找模块基地址
|
||||
const baseAddress = Module.findBaseAddress(moduleName);
|
||||
if (!baseAddress) {
|
||||
throw new Error('Module not found.');
|
||||
}
|
||||
|
||||
// 计算绝对地址
|
||||
const absoluteAddress = baseAddress.add(offset);
|
||||
|
||||
// 设置拦截器
|
||||
Interceptor.attach(absoluteAddress, {
|
||||
onEnter: function(args) {
|
||||
console.log(`[+] Function at offset ${offset} in wrapper.node was called`);
|
||||
console.log('Argument 0:', args[0].toInt32());
|
||||
},
|
||||
onLeave: function(retval) {
|
||||
console.log('Return value:', retval.toInt32());
|
||||
// 可以在这里修改返回值
|
||||
retval.replace(42);
|
||||
}
|
||||
});
|
@@ -1,23 +0,0 @@
|
||||
const frida = require('frida');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
async function main() {
|
||||
// 获取当前 Node.js 进程的 ID
|
||||
const pid = process.pid;
|
||||
const session = await frida.attach(pid); // 附加到当前进程
|
||||
|
||||
const scriptCode = fs.readFileSync(path.join(path.resolve(__dirname), 'frida_script.js'), 'utf-8');
|
||||
const script = await session.createScript(scriptCode);
|
||||
|
||||
script.message.connect(message => {
|
||||
console.log('Message from Frida:', message);
|
||||
});
|
||||
|
||||
await script.load();
|
||||
console.log('Frida script has been loaded successfully.');
|
||||
}
|
||||
|
||||
main().catch(err => {
|
||||
console.error(err);
|
||||
});
|
18
src/index.ts
18
src/index.ts
@@ -2,6 +2,7 @@ import { napCatCore } from '@/core';
|
||||
import { program } from 'commander';
|
||||
import qrcode from 'qrcode-terminal';
|
||||
import fs from 'fs/promises';
|
||||
import fsSync from 'fs';
|
||||
import path from 'node:path';
|
||||
import { checkVersion } from '@/common/utils/version';
|
||||
import { log, logDebug, logError, LogLevel, setLogLevel } from '@/common/utils/log';
|
||||
@@ -9,6 +10,13 @@ import { NapCatOnebot11 } from '@/onebot11/main';
|
||||
import { InitWebUi } from './webui/index';
|
||||
import { WebUiDataRuntime } from './webui/src/helper/Data';
|
||||
import { UpdateConfig } from './common/utils/helper';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
program
|
||||
.option('-q, --qq <type>', 'QQ号')
|
||||
.parse(process.argv);
|
||||
@@ -19,10 +27,8 @@ UpdateConfig().catch(logError);
|
||||
InitWebUi();
|
||||
const cmdOptions = program.opts();
|
||||
// console.log(process.argv);
|
||||
|
||||
|
||||
checkVersion().then((remoteVersion: string) => {
|
||||
const localVersion = require('./package.json').version;
|
||||
checkVersion().then(async (remoteVersion: string) => {
|
||||
const localVersion = JSON.parse(fsSync.readFileSync(path.join(__dirname, 'package.json')).toString()).version;
|
||||
const localVersionList = localVersion.split('.');
|
||||
const remoteVersionList = remoteVersion.split('.');
|
||||
log('[NapCat] 当前版本:', localVersion);
|
||||
@@ -37,10 +43,10 @@ checkVersion().then((remoteVersion: string) => {
|
||||
logDebug('[NapCat] 当前已是最新版本');
|
||||
return;
|
||||
}).catch((e) => {
|
||||
logError('[NapCat] 检测更新失败');
|
||||
logError('[NapCat] 检测更新失败', e);
|
||||
});
|
||||
// 不是很好待优化
|
||||
let NapCat_OneBot11 = new NapCatOnebot11();
|
||||
const NapCat_OneBot11 = new NapCatOnebot11();
|
||||
|
||||
WebUiDataRuntime.setOB11ConfigCall(NapCat_OneBot11.SetConfig);
|
||||
|
||||
|
@@ -20,11 +20,11 @@ class BaseAction<PayloadType, ReturnDataType> {
|
||||
return {
|
||||
valid: false,
|
||||
message: errorMessages.join('\n') as string || '未知错误'
|
||||
}
|
||||
};
|
||||
}
|
||||
return {
|
||||
valid: true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public async handle(payload: PayloadType): Promise<OB11Return<ReturnDataType | null>> {
|
||||
|
@@ -5,7 +5,7 @@ import BaseAction from '../BaseAction';
|
||||
import { ActionName, BaseCheckResult } from '../types';
|
||||
import { NTQQUserApi } from '@/core/apis';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
import Ajv from "ajv"
|
||||
import Ajv from 'ajv';
|
||||
// 设置在线状态
|
||||
|
||||
const SchemaData = {
|
||||
|
@@ -13,7 +13,7 @@ export default class SetAvatar extends BaseAction<Payload, null> {
|
||||
actionName = ActionName.SetQQAvatar;
|
||||
// 用不着复杂检测
|
||||
protected async check(payload: Payload): Promise<BaseCheckResult> {
|
||||
if (!payload.file || typeof payload.file != "string") {
|
||||
if (!payload.file || typeof payload.file != 'string') {
|
||||
return {
|
||||
valid: false,
|
||||
message: 'file字段不能为空或者类型错误',
|
||||
|
@@ -17,9 +17,9 @@ const SchemaData = {
|
||||
base64: { type: 'string' },
|
||||
name: { type: 'string' },
|
||||
headers: {
|
||||
type: ["string", "array"],
|
||||
type: ['string', 'array'],
|
||||
items: {
|
||||
type: "string"
|
||||
type: 'string'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { log } from '@/common/utils/log';
|
||||
import BaseAction from '../BaseAction'
|
||||
import { ActionName } from '../types'
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { QuickAction, QuickActionEvent, handleQuickOperation } from '@/onebot11/server/postOB11Event';
|
||||
|
||||
interface Payload{
|
||||
@@ -9,9 +9,9 @@ interface Payload{
|
||||
}
|
||||
|
||||
export class GoCQHTTHandleQuickAction extends BaseAction<Payload, null>{
|
||||
actionName = ActionName.GoCQHTTP_HandleQuickAction
|
||||
actionName = ActionName.GoCQHTTP_HandleQuickAction;
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
handleQuickOperation(payload.context, payload.operation).then().catch(log);
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -5,61 +5,57 @@ import { NTQQGroupApi, WebApi } from '@/core/apis';
|
||||
import { unlink } from 'node:fs';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
group_id: { type: 'number' },
|
||||
content: { type: 'string' },
|
||||
image: { type: 'string' },
|
||||
pinned: { type: 'number' },
|
||||
confirmRequired: { type: 'number' }
|
||||
},
|
||||
required: ['group_id', 'content']
|
||||
type: 'object',
|
||||
properties: {
|
||||
group_id: { type: 'number' },
|
||||
content: { type: 'string' },
|
||||
image: { type: 'string' },
|
||||
pinned: { type: 'number' },
|
||||
confirmRequired: { type: 'number' }
|
||||
},
|
||||
required: ['group_id', 'content']
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class SendGroupNotice extends BaseAction<Payload, null> {
|
||||
actionName = ActionName.GoCQHTTP_SendGroupNotice;
|
||||
protected async _handle(payload: Payload) {
|
||||
let UploadImage: { id: string, width: number, height: number } | undefined = undefined;
|
||||
if (payload.image) {
|
||||
//公告图逻辑
|
||||
let Image_path, Image_errMsg, Image_IsLocal = false;
|
||||
let Uri2LocalRet = (await uri2local(payload.image));
|
||||
Image_errMsg = Uri2LocalRet.errMsg;
|
||||
Image_path = Uri2LocalRet.path;
|
||||
Image_IsLocal = Uri2LocalRet.isLocal;
|
||||
if (Image_errMsg) {
|
||||
throw `群公告${payload.image}设置失败,image字段可能格式不正确`;
|
||||
}
|
||||
if (!Image_path) {
|
||||
throw `群公告${payload.image}设置失败,获取资源失败`;
|
||||
}
|
||||
await checkFileReceived(Image_path, 5000); // 文件不存在QQ会崩溃,需要提前判断
|
||||
let ImageUploadResult = await NTQQGroupApi.uploadGroupBulletinPic(payload.group_id.toString(), Image_path);
|
||||
if (ImageUploadResult.errCode != 0) {
|
||||
throw `群公告${payload.image}设置失败,图片上传失败`;
|
||||
}
|
||||
if (!Image_IsLocal) {
|
||||
unlink(Image_path, () => { });
|
||||
}
|
||||
UploadImage = ImageUploadResult.picInfo;
|
||||
}
|
||||
let Notice_Pinned = 0;
|
||||
let Notice_confirmRequired = 0;
|
||||
if (!payload.pinned) {
|
||||
Notice_Pinned = 0;
|
||||
}
|
||||
if (!payload.confirmRequired) {
|
||||
Notice_confirmRequired = 0;
|
||||
}
|
||||
let PublishGroupBulletinResult = await NTQQGroupApi.publishGroupBulletin(payload.group_id.toString(), payload.content, UploadImage, Notice_Pinned, Notice_confirmRequired);
|
||||
|
||||
if (PublishGroupBulletinResult.result! = 0) {
|
||||
throw `设置群公告失败,错误信息:${PublishGroupBulletinResult.errMsg}`;
|
||||
}
|
||||
// 下面实现扬了
|
||||
//await WebApi.setGroupNotice(payload.group_id, payload.content) ;
|
||||
return null;
|
||||
actionName = ActionName.GoCQHTTP_SendGroupNotice;
|
||||
protected async _handle(payload: Payload) {
|
||||
let UploadImage: { id: string, width: number, height: number } | undefined = undefined;
|
||||
if (payload.image) {
|
||||
//公告图逻辑
|
||||
const { errMsg, path, isLocal } = (await uri2local(payload.image));
|
||||
if (errMsg) {
|
||||
throw `群公告${payload.image}设置失败,image字段可能格式不正确`;
|
||||
}
|
||||
if (!path) {
|
||||
throw `群公告${payload.image}设置失败,获取资源失败`;
|
||||
}
|
||||
await checkFileReceived(path, 5000); // 文件不存在QQ会崩溃,需要提前判断
|
||||
const ImageUploadResult = await NTQQGroupApi.uploadGroupBulletinPic(payload.group_id.toString(), path);
|
||||
if (ImageUploadResult.errCode != 0) {
|
||||
throw `群公告${payload.image}设置失败,图片上传失败`;
|
||||
}
|
||||
if (!isLocal) {
|
||||
unlink(path, () => { });
|
||||
}
|
||||
UploadImage = ImageUploadResult.picInfo;
|
||||
}
|
||||
let Notice_Pinned = 0;
|
||||
let Notice_confirmRequired = 0;
|
||||
if (!payload.pinned) {
|
||||
Notice_Pinned = 0;
|
||||
}
|
||||
if (!payload.confirmRequired) {
|
||||
Notice_confirmRequired = 0;
|
||||
}
|
||||
const PublishGroupBulletinResult = await NTQQGroupApi.publishGroupBulletin(payload.group_id.toString(), payload.content, UploadImage, Notice_Pinned, Notice_confirmRequired);
|
||||
|
||||
if (PublishGroupBulletinResult.result != 0) {
|
||||
throw `设置群公告失败,错误信息:${PublishGroupBulletinResult.errMsg}`;
|
||||
}
|
||||
// 下面实现扬了
|
||||
//await WebApi.setGroupNotice(payload.group_id, payload.content) ;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -3,7 +3,7 @@ import { OB11GroupMember } from '../../types';
|
||||
import { OB11Constructor } from '../../constructor';
|
||||
import BaseAction from '../BaseAction';
|
||||
import { ActionName } from '../types';
|
||||
import { napCatCore, NTQQGroupApi } from '@/core';
|
||||
import { napCatCore, NTQQGroupApi, NTQQUserApi } from '@/core';
|
||||
import { WebApi } from '@/core/apis/webapi';
|
||||
import { logDebug } from '@/common/utils/log';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
@@ -29,7 +29,7 @@ class GetGroupMemberList extends BaseAction<Payload, OB11GroupMember[]> {
|
||||
throw (`群${payload.group_id}不存在`);
|
||||
}
|
||||
if (payload.no_cache == true || payload.no_cache === 'true') {
|
||||
// webGroupMembers = await WebApi.getGroupMembers(payload.group_id.toString());
|
||||
// webGroupMembers = await WebApi.getGroupMembers(payload.group_id.toString());'
|
||||
const _groupMembers = await NTQQGroupApi.getGroupMembers(payload.group_id.toString());
|
||||
groupMembers.set(group.groupCode, _groupMembers);
|
||||
}
|
||||
@@ -37,6 +37,7 @@ class GetGroupMemberList extends BaseAction<Payload, OB11GroupMember[]> {
|
||||
|
||||
// 方便索引处理
|
||||
for (let i = 0, len = _groupMembers.length; i < len; i++) {
|
||||
|
||||
MemberMap.set(_groupMembers[i].user_id, _groupMembers[i]);
|
||||
}
|
||||
// 合并数据
|
||||
|
@@ -18,8 +18,8 @@ export class GetGroupSystemMsg extends BaseAction<void, any> {
|
||||
actionName = ActionName.GetGroupSystemMsg;
|
||||
protected async _handle(payload: void) {
|
||||
// 默认10条 该api未完整实现 包括响应数据规范化 类型规范化
|
||||
let SingleScreenNotifies = await NTQQGroupApi.getSingleScreenNotifies(10);
|
||||
let retData: any = { InvitedRequest: [], join_requests: [] };
|
||||
const SingleScreenNotifies = await NTQQGroupApi.getSingleScreenNotifies(10);
|
||||
const retData: any = { InvitedRequest: [], join_requests: [] };
|
||||
for (const SSNotify of SingleScreenNotifies) {
|
||||
if (SSNotify.type == 1) {
|
||||
retData.InvitedRequest.push({
|
||||
|
@@ -12,7 +12,7 @@ const SchemaData = {
|
||||
approve: { type: 'boolean' },
|
||||
reason: { type: 'string' }
|
||||
},
|
||||
required: ['flag', 'approve', 'reson']
|
||||
required: ['flag', 'approve', 'reason']
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
@@ -104,7 +104,7 @@ const _handlers: {
|
||||
// File service
|
||||
|
||||
[OB11MessageDataType.image]: async (sendMsg, context) => {
|
||||
let PicEle = await SendMsgElementConstructor.pic(
|
||||
const PicEle = await SendMsgElementConstructor.pic(
|
||||
(await handleOb11FileLikeMessage(sendMsg, context)).path,
|
||||
sendMsg.data.summary || '',
|
||||
sendMsg.data.subType || 0
|
||||
|
@@ -51,16 +51,16 @@ export async function sendMsg(peer: Peer, sendElements: SendMessageElement[], de
|
||||
totalSize += fs.statSync(fileElement.videoElement.filePath).size;
|
||||
}
|
||||
if (fileElement.elementType === ElementType.PIC) {
|
||||
totalSize += fs.statSync(fileElement.picElement.sourcePath).size
|
||||
totalSize += fs.statSync(fileElement.picElement.sourcePath).size;
|
||||
}
|
||||
}
|
||||
//且 PredictTime ((totalSize / 1024 / 512) * 1000)不等于Nan
|
||||
let PredictTime = totalSize / 1024 / 512 * 1000;
|
||||
const PredictTime = totalSize / 1024 / 512 * 1000;
|
||||
if (!Number.isNaN(PredictTime)) {
|
||||
timeout += PredictTime// 5S Basic Timeout + PredictTime( For File 512kb/s )
|
||||
timeout += PredictTime;// 5S Basic Timeout + PredictTime( For File 512kb/s )
|
||||
}
|
||||
} catch (e) {
|
||||
logError("发送消息计算预计时间异常", e);
|
||||
logError('发送消息计算预计时间异常', e);
|
||||
}
|
||||
const returnMsg = await NTQQMsgApi.sendMsg(peer, sendElements, waitComplete, timeout);
|
||||
try {
|
||||
|
@@ -5,40 +5,40 @@ import { selfInfo } from '@/core/data';
|
||||
import { FromSchema, JSONSchema } from 'json-schema-to-ts';
|
||||
|
||||
const SchemaData = {
|
||||
type: 'object',
|
||||
properties: {
|
||||
delay: { type: 'number' }
|
||||
},
|
||||
required: ['delay']
|
||||
type: 'object',
|
||||
properties: {
|
||||
delay: { type: 'number' }
|
||||
},
|
||||
required: ['delay']
|
||||
} as const satisfies JSONSchema;
|
||||
|
||||
type Payload = FromSchema<typeof SchemaData>;
|
||||
|
||||
export class Reboot extends BaseAction<Payload, null> {
|
||||
actionName = ActionName.Reboot;
|
||||
actionName = ActionName.Reboot;
|
||||
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
if (payload.delay) {
|
||||
setTimeout(() => {
|
||||
rebootWithQuickLogin(selfInfo.uin);
|
||||
}, payload.delay);
|
||||
} else {
|
||||
rebootWithQuickLogin(selfInfo.uin);
|
||||
}
|
||||
return null;
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
if (payload.delay) {
|
||||
setTimeout(() => {
|
||||
rebootWithQuickLogin(selfInfo.uin);
|
||||
}, payload.delay);
|
||||
} else {
|
||||
rebootWithQuickLogin(selfInfo.uin);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
export class RebootNormol extends BaseAction<Payload, null> {
|
||||
actionName = ActionName.RebootNormol;
|
||||
actionName = ActionName.RebootNormol;
|
||||
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
if (payload.delay) {
|
||||
setTimeout(() => {
|
||||
rebootWithNormolLogin();
|
||||
}, payload.delay);
|
||||
} else {
|
||||
rebootWithNormolLogin();
|
||||
}
|
||||
return null;
|
||||
protected async _handle(payload: Payload): Promise<null> {
|
||||
if (payload.delay) {
|
||||
setTimeout(() => {
|
||||
rebootWithNormolLogin();
|
||||
}, payload.delay);
|
||||
} else {
|
||||
rebootWithNormolLogin();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -60,7 +60,7 @@ export enum ActionName {
|
||||
CleanCache = 'clean_cache',
|
||||
GetCookies = 'get_cookies',
|
||||
// 以下为go-cqhttp api
|
||||
GoCQHTTP_HandleQuickAction = ".handle_quick_operation",
|
||||
GoCQHTTP_HandleQuickAction = '.handle_quick_operation',
|
||||
GetGroupHonorInfo = 'get_group_honor_info',
|
||||
GoCQHTTP_GetEssenceMsg = 'get_essence_msg_list',
|
||||
GoCQHTTP_SendGroupNotice = '_send_group_notice',
|
||||
@@ -78,5 +78,5 @@ export enum ActionName {
|
||||
GoCQHTTP_GetGroupMsgHistory = 'get_group_msg_history',
|
||||
GoCQHTTP_GetForwardMsg = 'get_forward_msg',
|
||||
GetFriendMsgHistory = 'get_friend_msg_history',
|
||||
GetGroupSystemMsg = "get_group_system_msg"
|
||||
GetGroupSystemMsg = 'get_group_system_msg'
|
||||
}
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { selfInfo } from "@/core/data";
|
||||
import { logDebug, logError } from "@/common/utils/log";
|
||||
import { ConfigBase } from "@/common/utils/ConfigBase";
|
||||
import { json } from "stream/consumers";
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { selfInfo } from '@/core/data';
|
||||
import { logDebug, logError } from '@/common/utils/log';
|
||||
import { ConfigBase } from '@/common/utils/ConfigBase';
|
||||
import { json } from 'stream/consumers';
|
||||
|
||||
export interface OB11Config {
|
||||
http: {
|
||||
@@ -27,7 +27,7 @@ export interface OB11Config {
|
||||
|
||||
debug: boolean;
|
||||
heartInterval: number;
|
||||
messagePostFormat: "array" | "string";
|
||||
messagePostFormat: 'array' | 'string';
|
||||
enableLocalFile2Url: boolean;
|
||||
musicSignUrl: string;
|
||||
reportSelfMessage: boolean;
|
||||
@@ -41,16 +41,16 @@ export interface OB11Config {
|
||||
class Config extends ConfigBase<OB11Config> implements OB11Config {
|
||||
http = {
|
||||
enable: false,
|
||||
host: "",
|
||||
host: '',
|
||||
port: 3000,
|
||||
secret: "",
|
||||
secret: '',
|
||||
enableHeart: false,
|
||||
enablePost: false,
|
||||
postUrls: [],
|
||||
};
|
||||
ws = {
|
||||
enable: false,
|
||||
host: "",
|
||||
host: '',
|
||||
port: 3001,
|
||||
};
|
||||
reverseWs = {
|
||||
@@ -59,11 +59,11 @@ class Config extends ConfigBase<OB11Config> implements OB11Config {
|
||||
};
|
||||
debug = false;
|
||||
heartInterval = 30000;
|
||||
messagePostFormat: "array" | "string" = "array";
|
||||
messagePostFormat: 'array' | 'string' = 'array';
|
||||
enableLocalFile2Url = true;
|
||||
musicSignUrl = "";
|
||||
musicSignUrl = '';
|
||||
reportSelfMessage = false;
|
||||
token = "";
|
||||
token = '';
|
||||
|
||||
getConfigPath() {
|
||||
return path.join(this.getConfigDir(), `onebot11_${selfInfo.uin}.json`);
|
||||
|
@@ -120,10 +120,15 @@ export class OB11Constructor {
|
||||
}
|
||||
else if (element.textElement) {
|
||||
message_data['type'] = 'text';
|
||||
const text = element.textElement.content;
|
||||
|
||||
let text = element.textElement.content;
|
||||
if (!text.trim()) {
|
||||
continue;
|
||||
}
|
||||
// 兼容 9.7.x 换行符
|
||||
if (text.indexOf('\n') === -1 && text.indexOf('\r\n') === -1) {
|
||||
text = text.replace(/\r/g, '\n');
|
||||
}
|
||||
message_data['data']['text'] = text;
|
||||
}
|
||||
else if (element.replyElement) {
|
||||
|
@@ -31,10 +31,11 @@ import { OB11GroupRecallNoticeEvent } from '@/onebot11/event/notice/OB11GroupRec
|
||||
import { logMessage, logNotice, logRequest } from '@/onebot11/log';
|
||||
import { OB11Message } from '@/onebot11/types';
|
||||
import { OB11LifeCycleEvent } from './event/meta/OB11LifeCycleEvent';
|
||||
import { Data as SysData } from '@/proto/SysMessage'
|
||||
import { Data as SysData } from '@/proto/SysMessage';
|
||||
import { OB11FriendPokeEvent, OB11GroupPokeEvent } from './event/notice/OB11PokeEvent';
|
||||
import { isEqual } from '@/common/utils/helper';
|
||||
//peer->cached(boolen)
|
||||
let PokeCache = new Map<string, boolean>();
|
||||
const PokeCache = new Map<string, boolean>();
|
||||
export class NapCatOnebot11 {
|
||||
private bootTime: number = Date.now() / 1000; // 秒
|
||||
|
||||
@@ -71,9 +72,14 @@ export class NapCatOnebot11 {
|
||||
// 启动http心跳
|
||||
httpHeart.start();
|
||||
}
|
||||
// MsgListener
|
||||
// Create MsgListener
|
||||
const msgListener = new MsgListener();
|
||||
msgListener.onRecvSysMsg = (protobufData: number[]) => {
|
||||
msgListener.onRecvSysMsg = async (protobufData: number[]) => {
|
||||
// function buf2hex(buffer: Buffer) {
|
||||
// return [...new Uint8Array(buffer)]
|
||||
// .map(x => x.toString(16).padStart(2, '0'))
|
||||
// .join('');
|
||||
// }
|
||||
// let Data: Data = {
|
||||
// header: {
|
||||
// GroupNumber: 0,
|
||||
@@ -92,12 +98,13 @@ export class NapCatOnebot11 {
|
||||
// }
|
||||
// };
|
||||
try {
|
||||
let sysMsg = SysData.fromBinary(Buffer.from(protobufData));
|
||||
let peeruin = sysMsg.header[0].groupNumber;
|
||||
let peeruid = sysMsg.header[0].groupString;
|
||||
let MsgType = sysMsg.body[0].msgType;
|
||||
let subType0 = sysMsg.body[0].subType0;
|
||||
let subType1 = sysMsg.body[0].subType1;
|
||||
//console.log(buf2hex(Buffer.from(protobufData)));
|
||||
const sysMsg = SysData.fromBinary(Buffer.from(protobufData));
|
||||
const peeruin = sysMsg.header[0].peerNumber;
|
||||
const peeruid = sysMsg.header[0].peerString;
|
||||
const MsgType = sysMsg.body[0].msgType;
|
||||
const subType0 = sysMsg.body[0].subType0;
|
||||
const subType1 = sysMsg.body[0].subType1;
|
||||
let pokeEvent: OB11FriendPokeEvent | OB11GroupPokeEvent;
|
||||
//console.log(peeruid);
|
||||
if (MsgType == 528 && subType0 == 290) {
|
||||
@@ -106,7 +113,7 @@ export class NapCatOnebot11 {
|
||||
PokeCache.delete(peeruid);
|
||||
} else {
|
||||
PokeCache.set(peeruid, false);
|
||||
log("[私聊] 用户 ", peeruin, " 对你戳一戳");
|
||||
log('[私聊] 用户 ', peeruin, ' 对你戳一戳');
|
||||
pokeEvent = new OB11FriendPokeEvent(peeruin);
|
||||
postOB11Event(pokeEvent);
|
||||
}
|
||||
@@ -117,15 +124,42 @@ export class NapCatOnebot11 {
|
||||
PokeCache.delete(peeruid);
|
||||
} else {
|
||||
PokeCache.set(peeruid, false);
|
||||
log("[群聊] 群组 ", peeruin, " 戳一戳");
|
||||
log('[群聊] 群组 ', peeruin, ' 戳一戳');
|
||||
pokeEvent = new OB11GroupPokeEvent(peeruin);
|
||||
postOB11Event(pokeEvent);
|
||||
}
|
||||
}
|
||||
// 未区分增加与减少
|
||||
// if (MsgType == 34 && subType0 == 0) {
|
||||
// const role = (await getGroupMember(peeruin, selfInfo.uin))?.role;
|
||||
// const isPrivilege = role === 3 || role === 4;
|
||||
// if (!isPrivilege) {
|
||||
// const leaveUin = uid2UinMap[sysMsg.other[0].event[0].peerString];
|
||||
// log('[群聊] 群组 ', peeruin, ' 成员' + leaveUin + '退出');
|
||||
// const groupDecreaseEvent = new OB11GroupDecreaseEvent(peeruin, parseInt(leaveUin), 0, 'leave');// 不知道怎么出去的
|
||||
// postOB11Event(groupDecreaseEvent, true);
|
||||
// }
|
||||
// }
|
||||
// MsgType (SubType) EventName
|
||||
// 33 GroupMemIncreased
|
||||
// 34 GroupMemberDecreased
|
||||
// 44 GroupAdminChange
|
||||
// 82 GroupMessage
|
||||
// 84 GroupApply
|
||||
// 87 InviteGroup
|
||||
// 528 35 FriendApply
|
||||
// 528 39 CardChange
|
||||
// 528 68 GroupApply
|
||||
// 528 138 C2CRecall
|
||||
// 528 290 C2CPoke
|
||||
// 732 12 GroupBan
|
||||
// 732 16 GroupUniqueTitleChange
|
||||
// 732 17 GroupRecall
|
||||
// 732 20 GroupCommonTips
|
||||
// 732 21 EssenceMessage
|
||||
} catch (e) {
|
||||
log("解析SysMsg异常", e);
|
||||
log('解析SysMsg异常', e);
|
||||
// console.log(e);
|
||||
//
|
||||
}
|
||||
};
|
||||
msgListener.onKickedOffLine = (Info: KickedOffLineInfo) => {
|
||||
@@ -184,15 +218,16 @@ export class NapCatOnebot11 {
|
||||
};
|
||||
groupListener.onMemberInfoChange = async (groupCode: string, changeType: number, members: Map<string, GroupMember>) => {
|
||||
// 如果自身是非管理员也许要从这里获取Delete 成员变动 待测试与验证
|
||||
let role = (await getGroupMember(groupCode, selfInfo.uin))?.role;
|
||||
let isPrivilege = role === 3 || role === 4;
|
||||
const role = (await getGroupMember(groupCode, selfInfo.uin))?.role;
|
||||
const isPrivilege = role === 3 || role === 4;
|
||||
for (const member of members.values()) {
|
||||
if (member?.isDelete && !isPrivilege) {
|
||||
console.log('[群聊] 群组 ', groupCode, ' 成员' + member.uin + '退出');
|
||||
const groupDecreaseEvent = new OB11GroupDecreaseEvent(parseInt(groupCode), parseInt(member.uin), 0, 'leave');// 不知道怎么出去的
|
||||
postOB11Event(groupDecreaseEvent, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
groupListener.onJoinGroupNotify = (...notify) => {
|
||||
// console.log('ob11 onJoinGroupNotify', notify);
|
||||
};
|
||||
@@ -253,21 +288,6 @@ export class NapCatOnebot11 {
|
||||
}
|
||||
async SetConfig(NewOb11: OB11Config) {
|
||||
try {
|
||||
function isEqual(obj1: any, obj2: any) {
|
||||
if (obj1 === obj2) return true;
|
||||
if (obj1 == null || obj2 == null) return false;
|
||||
if (typeof obj1 !== 'object' || typeof obj2 !== 'object') return obj1 === obj2;
|
||||
|
||||
const keys1 = Object.keys(obj1);
|
||||
const keys2 = Object.keys(obj2);
|
||||
|
||||
if (keys1.length !== keys2.length) return false;
|
||||
|
||||
for (let key of keys1) {
|
||||
if (!isEqual(obj1[key], obj2[key])) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// if (!NewOb11 || typeof NewOb11 !== 'object') {
|
||||
// throw new Error('Invalid configuration object');
|
||||
// }
|
||||
|
@@ -170,26 +170,26 @@ async function handleGroupRequest(request: OB11GroupRequestEvent, quickAction: Q
|
||||
groupNotifies[request.flag],
|
||||
quickAction.approve ? GroupRequestOperateTypes.approve : GroupRequestOperateTypes.reject,
|
||||
quickAction.reason,
|
||||
).then().catch(logError)
|
||||
).then().catch(logError);
|
||||
}
|
||||
}
|
||||
async function handleFriendRequest(request: OB11FriendRequestEvent, quickAction: QuickActionFriendRequest) {
|
||||
if (!isNull(quickAction.approve)) {
|
||||
NTQQFriendApi.handleFriendRequest(friendRequests[request.flag], !!quickAction.approve).then().catch(logError)
|
||||
NTQQFriendApi.handleFriendRequest(friendRequests[request.flag], !!quickAction.approve).then().catch(logError);
|
||||
}
|
||||
}
|
||||
export async function handleQuickOperation(context: QuickActionEvent, quickAction: QuickAction) {
|
||||
if (context.post_type === 'message') {
|
||||
handleMsg(context as OB11Message, quickAction).then().catch(logError)
|
||||
handleMsg(context as OB11Message, quickAction).then().catch(logError);
|
||||
}
|
||||
if (context.post_type === 'request') {
|
||||
const friendRequest = context as OB11FriendRequestEvent;
|
||||
const groupRequest = context as OB11GroupRequestEvent;
|
||||
if ((friendRequest).request_type === 'friend') {
|
||||
handleFriendRequest(friendRequest, quickAction).then().catch(logError)
|
||||
handleFriendRequest(friendRequest, quickAction).then().catch(logError);
|
||||
}
|
||||
else if (groupRequest.request_type === 'group') {
|
||||
handleGroupRequest(groupRequest, quickAction).then().catch(logError)
|
||||
handleGroupRequest(groupRequest, quickAction).then().catch(logError);
|
||||
}
|
||||
}
|
||||
}
|
@@ -1 +1 @@
|
||||
export const version = '1.3.6';
|
||||
export const version = '1.3.9';
|
||||
|
28
src/proto/SysMessage.MsgType.34.proto
Normal file
28
src/proto/SysMessage.MsgType.34.proto
Normal file
@@ -0,0 +1,28 @@
|
||||
syntax = "proto3";
|
||||
package SysMessage;
|
||||
message Data {
|
||||
repeated Header header = 1;
|
||||
repeated Body body = 2;
|
||||
repeated Other other = 2;
|
||||
}
|
||||
message Header {
|
||||
uint32 PeerNumber = 1;
|
||||
string PeerString = 2;
|
||||
uint32 Uin = 5;
|
||||
optional string Uid = 6;
|
||||
}
|
||||
message Body {
|
||||
uint32 MsgType = 1;
|
||||
uint32 SubType_0 = 2;
|
||||
uint32 SubType_1 = 3;
|
||||
uint32 MsgSeq= 5;
|
||||
uint32 Time = 6;
|
||||
uint64 MsgID = 12;
|
||||
uint32 Other = 13;
|
||||
}
|
||||
message Event {
|
||||
|
||||
}
|
||||
message Other {
|
||||
repeated Event event = 2;
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
syntax = "proto3";
|
||||
package SysMessage;
|
||||
message Data{
|
||||
message Data {
|
||||
repeated Header header = 1;
|
||||
repeated Body body = 2;
|
||||
}
|
||||
@@ -18,4 +18,4 @@ message Body {
|
||||
uint32 Time = 6;
|
||||
uint64 MsgID = 12;
|
||||
uint32 Other = 13;
|
||||
}
|
||||
}
|
@@ -28,17 +28,17 @@ export interface Data {
|
||||
*/
|
||||
export interface Header {
|
||||
/**
|
||||
* @generated from protobuf field: uint32 GroupNumber = 1 [json_name = "GroupNumber"];
|
||||
* @generated from protobuf field: uint32 PeerNumber = 1 [json_name = "PeerNumber"];
|
||||
*/
|
||||
groupNumber: number;
|
||||
peerNumber: number;
|
||||
/**
|
||||
* @generated from protobuf field: string GroupString = 2 [json_name = "GroupString"];
|
||||
* @generated from protobuf field: string PeerString = 2 [json_name = "PeerString"];
|
||||
*/
|
||||
groupString: string;
|
||||
peerString: string;
|
||||
/**
|
||||
* @generated from protobuf field: uint32 QQ = 5 [json_name = "QQ"];
|
||||
* @generated from protobuf field: uint32 Uin = 5 [json_name = "Uin"];
|
||||
*/
|
||||
qQ: number;
|
||||
uin: number;
|
||||
/**
|
||||
* @generated from protobuf field: optional string Uid = 6 [json_name = "Uid"];
|
||||
*/
|
||||
@@ -136,17 +136,17 @@ export const Data = new Data$Type();
|
||||
class Header$Type extends MessageType<Header> {
|
||||
constructor() {
|
||||
super("SysMessage.Header", [
|
||||
{ no: 1, name: "GroupNumber", kind: "scalar", jsonName: "GroupNumber", T: 13 /*ScalarType.UINT32*/ },
|
||||
{ no: 2, name: "GroupString", kind: "scalar", jsonName: "GroupString", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 5, name: "QQ", kind: "scalar", jsonName: "QQ", T: 13 /*ScalarType.UINT32*/ },
|
||||
{ no: 1, name: "PeerNumber", kind: "scalar", jsonName: "PeerNumber", T: 13 /*ScalarType.UINT32*/ },
|
||||
{ no: 2, name: "PeerString", kind: "scalar", jsonName: "PeerString", T: 9 /*ScalarType.STRING*/ },
|
||||
{ no: 5, name: "Uin", kind: "scalar", jsonName: "Uin", T: 13 /*ScalarType.UINT32*/ },
|
||||
{ no: 6, name: "Uid", kind: "scalar", jsonName: "Uid", opt: true, T: 9 /*ScalarType.STRING*/ }
|
||||
]);
|
||||
}
|
||||
create(value?: PartialMessage<Header>): Header {
|
||||
const message = globalThis.Object.create((this.messagePrototype!));
|
||||
message.groupNumber = 0;
|
||||
message.groupString = "";
|
||||
message.qQ = 0;
|
||||
message.peerNumber = 0;
|
||||
message.peerString = "";
|
||||
message.uin = 0;
|
||||
if (value !== undefined)
|
||||
reflectionMergePartial<Header>(this, message, value);
|
||||
return message;
|
||||
@@ -156,14 +156,14 @@ class Header$Type extends MessageType<Header> {
|
||||
while (reader.pos < end) {
|
||||
let [fieldNo, wireType] = reader.tag();
|
||||
switch (fieldNo) {
|
||||
case /* uint32 GroupNumber = 1 [json_name = "GroupNumber"];*/ 1:
|
||||
message.groupNumber = reader.uint32();
|
||||
case /* uint32 PeerNumber = 1 [json_name = "PeerNumber"];*/ 1:
|
||||
message.peerNumber = reader.uint32();
|
||||
break;
|
||||
case /* string GroupString = 2 [json_name = "GroupString"];*/ 2:
|
||||
message.groupString = reader.string();
|
||||
case /* string PeerString = 2 [json_name = "PeerString"];*/ 2:
|
||||
message.peerString = reader.string();
|
||||
break;
|
||||
case /* uint32 QQ = 5 [json_name = "QQ"];*/ 5:
|
||||
message.qQ = reader.uint32();
|
||||
case /* uint32 Uin = 5 [json_name = "Uin"];*/ 5:
|
||||
message.uin = reader.uint32();
|
||||
break;
|
||||
case /* optional string Uid = 6 [json_name = "Uid"];*/ 6:
|
||||
message.uid = reader.string();
|
||||
@@ -180,15 +180,15 @@ class Header$Type extends MessageType<Header> {
|
||||
return message;
|
||||
}
|
||||
internalBinaryWrite(message: Header, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {
|
||||
/* uint32 GroupNumber = 1 [json_name = "GroupNumber"]; */
|
||||
if (message.groupNumber !== 0)
|
||||
writer.tag(1, WireType.Varint).uint32(message.groupNumber);
|
||||
/* string GroupString = 2 [json_name = "GroupString"]; */
|
||||
if (message.groupString !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.groupString);
|
||||
/* uint32 QQ = 5 [json_name = "QQ"]; */
|
||||
if (message.qQ !== 0)
|
||||
writer.tag(5, WireType.Varint).uint32(message.qQ);
|
||||
/* uint32 PeerNumber = 1 [json_name = "PeerNumber"]; */
|
||||
if (message.peerNumber !== 0)
|
||||
writer.tag(1, WireType.Varint).uint32(message.peerNumber);
|
||||
/* string PeerString = 2 [json_name = "PeerString"]; */
|
||||
if (message.peerString !== "")
|
||||
writer.tag(2, WireType.LengthDelimited).string(message.peerString);
|
||||
/* uint32 Uin = 5 [json_name = "Uin"]; */
|
||||
if (message.uin !== 0)
|
||||
writer.tag(5, WireType.Varint).uint32(message.uin);
|
||||
/* optional string Uid = 6 [json_name = "Uid"]; */
|
||||
if (message.uid !== undefined)
|
||||
writer.tag(6, WireType.LengthDelimited).string(message.uid);
|
||||
|
@@ -5,6 +5,13 @@ import { resolve } from 'node:path';
|
||||
import { ALLRouter } from './src/router';
|
||||
import { WebUiConfig } from './src/helper/config';
|
||||
const app = express();
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
/**
|
||||
* 初始化并启动WebUI服务。
|
||||
* 该函数配置了Express服务器以支持JSON解析和静态文件服务,并监听6099端口。
|
||||
@@ -12,21 +19,21 @@ const app = express();
|
||||
* @returns {Promise<void>} 无返回值。
|
||||
*/
|
||||
export async function InitWebUi() {
|
||||
let config = await WebUiConfig.GetWebUIConfig();
|
||||
app.use(express.json());
|
||||
// 初始服务
|
||||
app.all('/', (_req, res) => {
|
||||
res.json({
|
||||
msg: 'NapCat WebAPI is now running!',
|
||||
});
|
||||
const config = await WebUiConfig.GetWebUIConfig();
|
||||
app.use(express.json());
|
||||
// 初始服务
|
||||
app.all('/', (_req, res) => {
|
||||
res.json({
|
||||
msg: 'NapCat WebAPI is now running!',
|
||||
});
|
||||
// 配置静态文件服务,提供./static目录下的文件服务,访问路径为/webui
|
||||
app.use('/webui', express.static(resolve(__dirname, './static')));
|
||||
//挂载API接口
|
||||
app.use('/api', ALLRouter);
|
||||
app.listen(config.port, async () => {
|
||||
console.log(`[NapCat] [WebUi] Current WebUi is running at IP:${config.port}`);
|
||||
console.log(`[NapCat] [WebUi] Login Token is ${config.token}`);
|
||||
})
|
||||
});
|
||||
// 配置静态文件服务,提供./static目录下的文件服务,访问路径为/webui
|
||||
app.use('/webui', express.static(resolve(__dirname, './static')));
|
||||
//挂载API接口
|
||||
app.use('/api', ALLRouter);
|
||||
app.listen(config.port, async () => {
|
||||
console.log(`[NapCat] [WebUi] Current WebUi is running at IP:${config.port}`);
|
||||
console.log(`[NapCat] [WebUi] Login Token is ${config.token}`);
|
||||
});
|
||||
|
||||
}
|
@@ -1,68 +1,68 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { AuthHelper } from "../helper/SignToken";
|
||||
import { WebUiConfig } from "../helper/config";
|
||||
import { WebUiDataRuntime } from "../helper/Data";
|
||||
import { RequestHandler } from 'express';
|
||||
import { AuthHelper } from '../helper/SignToken';
|
||||
import { WebUiConfig } from '../helper/config';
|
||||
import { WebUiDataRuntime } from '../helper/Data';
|
||||
const isEmpty = (data: any) => data === undefined || data === null || data === '';
|
||||
export const LoginHandler: RequestHandler = async (req, res) => {
|
||||
let WebUiConfigData = await WebUiConfig.GetWebUIConfig();
|
||||
const { token } = req.body;
|
||||
if (isEmpty(token)) {
|
||||
res.json({
|
||||
code: -1,
|
||||
message: 'token is empty'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!await WebUiDataRuntime.checkLoginRate(WebUiConfigData.loginRate)) {
|
||||
res.json({
|
||||
code: -1,
|
||||
message: 'login rate limit'
|
||||
});
|
||||
return;
|
||||
}
|
||||
//验证config.token是否等于token
|
||||
if (WebUiConfigData.token !== token) {
|
||||
res.json({
|
||||
code: -1,
|
||||
message: 'token is invalid'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let signCredential = Buffer.from(JSON.stringify(await AuthHelper.signCredential(WebUiConfigData.token))).toString('base64');
|
||||
const WebUiConfigData = await WebUiConfig.GetWebUIConfig();
|
||||
const { token } = req.body;
|
||||
if (isEmpty(token)) {
|
||||
res.json({
|
||||
code: 0,
|
||||
message: 'success',
|
||||
data: {
|
||||
"Credential": signCredential
|
||||
}
|
||||
code: -1,
|
||||
message: 'token is empty'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (!await WebUiDataRuntime.checkLoginRate(WebUiConfigData.loginRate)) {
|
||||
res.json({
|
||||
code: -1,
|
||||
message: 'login rate limit'
|
||||
});
|
||||
return;
|
||||
}
|
||||
//验证config.token是否等于token
|
||||
if (WebUiConfigData.token !== token) {
|
||||
res.json({
|
||||
code: -1,
|
||||
message: 'token is invalid'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const signCredential = Buffer.from(JSON.stringify(await AuthHelper.signCredential(WebUiConfigData.token))).toString('base64');
|
||||
res.json({
|
||||
code: 0,
|
||||
message: 'success',
|
||||
data: {
|
||||
'Credential': signCredential
|
||||
}
|
||||
});
|
||||
return;
|
||||
};
|
||||
export const LogoutHandler: RequestHandler = (req, res) => {
|
||||
// 这玩意无状态销毁个灯 得想想办法
|
||||
res.json({
|
||||
code: 0,
|
||||
message: 'success'
|
||||
});
|
||||
return;
|
||||
// 这玩意无状态销毁个灯 得想想办法
|
||||
res.json({
|
||||
code: 0,
|
||||
message: 'success'
|
||||
});
|
||||
return;
|
||||
};
|
||||
export const checkHandler: RequestHandler = async (req, res) => {
|
||||
let WebUiConfigData = await WebUiConfig.GetWebUIConfig();
|
||||
const authorization = req.headers.authorization;
|
||||
try {
|
||||
let CredentialBase64:string = authorization?.split(' ')[1] as string;
|
||||
let Credential = JSON.parse(Buffer.from(CredentialBase64, 'base64').toString());
|
||||
await AuthHelper.validateCredentialWithinOneHour(WebUiConfigData.token,Credential)
|
||||
res.json({
|
||||
code: 0,
|
||||
message: 'success'
|
||||
});
|
||||
return;
|
||||
} catch (e) {
|
||||
res.json({
|
||||
code: -1,
|
||||
message: 'failed'
|
||||
});
|
||||
}
|
||||
const WebUiConfigData = await WebUiConfig.GetWebUIConfig();
|
||||
const authorization = req.headers.authorization;
|
||||
try {
|
||||
const CredentialBase64:string = authorization?.split(' ')[1] as string;
|
||||
const Credential = JSON.parse(Buffer.from(CredentialBase64, 'base64').toString());
|
||||
await AuthHelper.validateCredentialWithinOneHour(WebUiConfigData.token,Credential);
|
||||
res.json({
|
||||
code: 0,
|
||||
message: 'success'
|
||||
});
|
||||
return;
|
||||
} catch (e) {
|
||||
res.json({
|
||||
code: -1,
|
||||
message: 'failed'
|
||||
});
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
@@ -1,48 +1,54 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { resolve } from "path";
|
||||
import { readdir, stat } from "fs/promises";
|
||||
import { existsSync } from "fs";
|
||||
import { RequestHandler } from 'express';
|
||||
import { resolve } from 'path';
|
||||
import { readdir, stat } from 'fs/promises';
|
||||
import { existsSync } from 'fs';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
export const GetLogFileListHandler: RequestHandler = async (req, res) => {
|
||||
try {
|
||||
let LogsPath = resolve(__dirname, "./logs/");
|
||||
let LogFiles = await readdir(LogsPath);
|
||||
res.json({
|
||||
code: 0,
|
||||
data: LogFiles
|
||||
});
|
||||
} catch (error) {
|
||||
res.json({ code: -1, msg: "Failed to retrieve log file list." });
|
||||
}
|
||||
try {
|
||||
const LogsPath = resolve(__dirname, './logs/');
|
||||
const LogFiles = await readdir(LogsPath);
|
||||
res.json({
|
||||
code: 0,
|
||||
data: LogFiles
|
||||
});
|
||||
} catch (error) {
|
||||
res.json({ code: -1, msg: 'Failed to retrieve log file list.' });
|
||||
}
|
||||
};
|
||||
|
||||
export const GetLogFileHandler: RequestHandler = async (req, res) => {
|
||||
let LogsPath = resolve(__dirname, "./logs/");
|
||||
let LogFile = req.query.file as string;
|
||||
const LogsPath = resolve(__dirname, './logs/');
|
||||
const LogFile = req.query.file as string;
|
||||
|
||||
if (!isValidFileName(LogFile)) {
|
||||
res.json({ code: -1, msg: "LogFile is not safe" });
|
||||
return;
|
||||
// if (!isValidFileName(LogFile)) {
|
||||
// res.json({ code: -1, msg: 'LogFile is not safe' });
|
||||
// return;
|
||||
// }
|
||||
|
||||
const filePath = `${LogsPath}/${LogFile}`;
|
||||
if (!existsSync(filePath)) {
|
||||
res.status(404).json({ code: -1, msg: 'LogFile does not exist' });
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const fileStats = await stat(filePath);
|
||||
if (!fileStats.isFile()) {
|
||||
res.json({ code: -1, msg: 'LogFile must be a file' });
|
||||
return;
|
||||
}
|
||||
|
||||
let filePath = `${LogsPath}/${LogFile}`;
|
||||
if (!existsSync(filePath)) {
|
||||
res.status(404).json({ code: -1, msg: "LogFile does not exist" });
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
let fileStats = await stat(filePath);
|
||||
if (!fileStats.isFile()) {
|
||||
res.json({ code: -1, msg: "LogFile must be a file" });
|
||||
return;
|
||||
}
|
||||
|
||||
res.sendFile(filePath);
|
||||
} catch (error) {
|
||||
res.json({ code: -1, msg: "Failed to send log file." });
|
||||
}
|
||||
res.sendFile(filePath);
|
||||
} catch (error) {
|
||||
res.json({ code: -1, msg: 'Failed to send log file.' });
|
||||
}
|
||||
};
|
||||
export function isValidFileName(fileName: string): boolean {
|
||||
const invalidChars = /[\.\:\*\?\"\<\>\|\/\\]/;
|
||||
return !invalidChars.test(fileName);
|
||||
}
|
||||
// export function isValidFileName(fileName: string): boolean {
|
||||
// const invalidChars = /[\.\:\*\?\"\<\>\|\/\\]/;
|
||||
// return !invalidChars.test(fileName);
|
||||
// }
|
@@ -1,57 +1,64 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { WebUiDataRuntime } from "../helper/Data";
|
||||
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
import { OB11Config } from "@/webui/ui/components/WebUiApiOB11Config";
|
||||
import { RequestHandler } from 'express';
|
||||
import { WebUiDataRuntime } from '../helper/Data';
|
||||
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { OB11Config } from '@/webui/ui/components/WebUiApiOB11Config';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const isEmpty = (data: any) =>
|
||||
data === undefined || data === null || data === "";
|
||||
data === undefined || data === null || data === '';
|
||||
export const OB11GetConfigHandler: RequestHandler = async (req, res) => {
|
||||
let isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
const isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
if (!isLogin) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: "Not Login",
|
||||
message: 'Not Login',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const uin = await WebUiDataRuntime.getQQLoginUin();
|
||||
let configFilePath = resolve(__dirname, `./config/onebot11_${uin}.json`);
|
||||
const configFilePath = resolve(__dirname, `./config/onebot11_${uin}.json`);
|
||||
//console.log(configFilePath);
|
||||
let data: OB11Config;
|
||||
try {
|
||||
data = JSON.parse(
|
||||
existsSync(configFilePath)
|
||||
? readFileSync(configFilePath).toString()
|
||||
: readFileSync(resolve(__dirname, `./config/onebot11.json`)).toString()
|
||||
: readFileSync(resolve(__dirname, './config/onebot11.json')).toString()
|
||||
);
|
||||
} catch (e) {
|
||||
data = {} as OB11Config;
|
||||
res.send({
|
||||
code: -1,
|
||||
message: "Config Get Error",
|
||||
message: 'Config Get Error',
|
||||
});
|
||||
return;
|
||||
}
|
||||
res.send({
|
||||
code: 0,
|
||||
message: "success",
|
||||
message: 'success',
|
||||
data: data,
|
||||
});
|
||||
return;
|
||||
};
|
||||
export const OB11SetConfigHandler: RequestHandler = async (req, res) => {
|
||||
let isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
const isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
if (!isLogin) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: "Not Login",
|
||||
message: 'Not Login',
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (isEmpty(req.body.config)) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: "config is empty",
|
||||
message: 'config is empty',
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -77,12 +84,12 @@ export const OB11SetConfigHandler: RequestHandler = async (req, res) => {
|
||||
if (SetResult) {
|
||||
res.send({
|
||||
code: 0,
|
||||
message: "success",
|
||||
message: 'success',
|
||||
});
|
||||
} else {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: "Config Set Error",
|
||||
message: 'Config Set Error',
|
||||
});
|
||||
}
|
||||
|
||||
|
@@ -1,77 +1,77 @@
|
||||
import { RequestHandler } from "express";
|
||||
import { WebUiDataRuntime } from "../helper/Data";
|
||||
import { sleep } from "@/common/utils/helper";
|
||||
import { RequestHandler } from 'express';
|
||||
import { WebUiDataRuntime } from '../helper/Data';
|
||||
import { sleep } from '@/common/utils/helper';
|
||||
const isEmpty = (data: any) => data === undefined || data === null || data === '';
|
||||
export const QQGetQRcodeHandler: RequestHandler = async (req, res) => {
|
||||
if (await WebUiDataRuntime.getQQLoginStatus()) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: 'QQ Is Logined'
|
||||
});
|
||||
return;
|
||||
}
|
||||
let qrcodeUrl = await WebUiDataRuntime.getQQLoginQrcodeURL();
|
||||
if (isEmpty(qrcodeUrl)) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: 'QRCode Get Error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (await WebUiDataRuntime.getQQLoginStatus()) {
|
||||
res.send({
|
||||
code: 0,
|
||||
message: 'success',
|
||||
data: {
|
||||
qrcode: qrcodeUrl
|
||||
}
|
||||
code: -1,
|
||||
message: 'QQ Is Logined'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const qrcodeUrl = await WebUiDataRuntime.getQQLoginQrcodeURL();
|
||||
if (isEmpty(qrcodeUrl)) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: 'QRCode Get Error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
res.send({
|
||||
code: 0,
|
||||
message: 'success',
|
||||
data: {
|
||||
qrcode: qrcodeUrl
|
||||
}
|
||||
});
|
||||
return;
|
||||
};
|
||||
export const QQCheckLoginStatusHandler: RequestHandler = async (req, res) => {
|
||||
res.send({
|
||||
code: 0,
|
||||
message: 'success',
|
||||
data: {
|
||||
isLogin: await WebUiDataRuntime.getQQLoginStatus()
|
||||
}
|
||||
});
|
||||
res.send({
|
||||
code: 0,
|
||||
message: 'success',
|
||||
data: {
|
||||
isLogin: await WebUiDataRuntime.getQQLoginStatus()
|
||||
}
|
||||
});
|
||||
};
|
||||
export const QQSetQuickLoginHandler: RequestHandler = async (req, res) => {
|
||||
let { uin } = req.body;
|
||||
let isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
if (isLogin) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: 'QQ Is Logined'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (isEmpty(uin)) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: 'uin is empty'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { result, message } = await WebUiDataRuntime.getQQQuickLogin(uin);
|
||||
if (!result) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: message
|
||||
});
|
||||
return;
|
||||
}
|
||||
//本来应该验证 但是http不宜这么搞 建议前端验证
|
||||
//isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
const { uin } = req.body;
|
||||
const isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
if (isLogin) {
|
||||
res.send({
|
||||
code: 0,
|
||||
message: 'success'
|
||||
code: -1,
|
||||
message: 'QQ Is Logined'
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (isEmpty(uin)) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: 'uin is empty'
|
||||
});
|
||||
return;
|
||||
}
|
||||
const { result, message } = await WebUiDataRuntime.getQQQuickLogin(uin);
|
||||
if (!result) {
|
||||
res.send({
|
||||
code: -1,
|
||||
message: message
|
||||
});
|
||||
return;
|
||||
}
|
||||
//本来应该验证 但是http不宜这么搞 建议前端验证
|
||||
//isLogin = await WebUiDataRuntime.getQQLoginStatus();
|
||||
res.send({
|
||||
code: 0,
|
||||
message: 'success'
|
||||
});
|
||||
};
|
||||
export const QQGetQuickLoginListHandler: RequestHandler = async (req, res) => {
|
||||
const quickLoginList = await WebUiDataRuntime.getQQQuickLoginList();
|
||||
res.send({
|
||||
code: 0,
|
||||
data: quickLoginList
|
||||
});
|
||||
}
|
||||
const quickLoginList = await WebUiDataRuntime.getQQQuickLoginList();
|
||||
res.send({
|
||||
code: 0,
|
||||
data: quickLoginList
|
||||
});
|
||||
};
|
@@ -1,4 +1,4 @@
|
||||
import { OB11Config } from "@/onebot11/config";
|
||||
import { OB11Config } from '@/onebot11/config';
|
||||
|
||||
interface LoginRuntimeType {
|
||||
LoginCurrentTime: number;
|
||||
@@ -12,72 +12,72 @@ interface LoginRuntimeType {
|
||||
QQLoginList: string[]
|
||||
}
|
||||
}
|
||||
let LoginRuntime: LoginRuntimeType = {
|
||||
LoginCurrentTime: Date.now(),
|
||||
LoginCurrentRate: 0,
|
||||
QQLoginStatus: false, //已实现 但太傻了 得去那边注册个回调刷新
|
||||
QQQRCodeURL: "",
|
||||
QQLoginUin: "",
|
||||
NapCatHelper: {
|
||||
SetOb11ConfigCall: async (ob11: OB11Config) => { return; },
|
||||
CoreQuickLoginCall: async (uin: string) => { return { result: false, message: '' }; },
|
||||
QQLoginList: []
|
||||
}
|
||||
}
|
||||
const LoginRuntime: LoginRuntimeType = {
|
||||
LoginCurrentTime: Date.now(),
|
||||
LoginCurrentRate: 0,
|
||||
QQLoginStatus: false, //已实现 但太傻了 得去那边注册个回调刷新
|
||||
QQQRCodeURL: '',
|
||||
QQLoginUin: '',
|
||||
NapCatHelper: {
|
||||
SetOb11ConfigCall: async (ob11: OB11Config) => { return; },
|
||||
CoreQuickLoginCall: async (uin: string) => { return { result: false, message: '' }; },
|
||||
QQLoginList: []
|
||||
}
|
||||
};
|
||||
export const WebUiDataRuntime = {
|
||||
checkLoginRate: async function (RateLimit: number): Promise<boolean> {
|
||||
LoginRuntime.LoginCurrentRate++;
|
||||
//console.log(RateLimit, LoginRuntime.LoginCurrentRate, Date.now() - LoginRuntime.LoginCurrentTime);
|
||||
if (Date.now() - LoginRuntime.LoginCurrentTime > 1000 * 60) {
|
||||
LoginRuntime.LoginCurrentRate = 0;//超出时间重置限速
|
||||
LoginRuntime.LoginCurrentTime = Date.now();
|
||||
return true;
|
||||
}
|
||||
if (LoginRuntime.LoginCurrentRate <= RateLimit) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
checkLoginRate: async function (RateLimit: number): Promise<boolean> {
|
||||
LoginRuntime.LoginCurrentRate++;
|
||||
//console.log(RateLimit, LoginRuntime.LoginCurrentRate, Date.now() - LoginRuntime.LoginCurrentTime);
|
||||
if (Date.now() - LoginRuntime.LoginCurrentTime > 1000 * 60) {
|
||||
LoginRuntime.LoginCurrentRate = 0;//超出时间重置限速
|
||||
LoginRuntime.LoginCurrentTime = Date.now();
|
||||
return true;
|
||||
}
|
||||
,
|
||||
getQQLoginStatus: async function (): Promise<boolean> {
|
||||
return LoginRuntime.QQLoginStatus;
|
||||
if (LoginRuntime.LoginCurrentRate <= RateLimit) {
|
||||
return true;
|
||||
}
|
||||
,
|
||||
setQQLoginStatus: async function (status: boolean): Promise<void> {
|
||||
LoginRuntime.QQLoginStatus = status;
|
||||
}
|
||||
,
|
||||
setQQLoginQrcodeURL: async function (url: string): Promise<void> {
|
||||
LoginRuntime.QQQRCodeURL = url;
|
||||
}
|
||||
,
|
||||
getQQLoginQrcodeURL: async function (): Promise<string> {
|
||||
return LoginRuntime.QQQRCodeURL;
|
||||
}
|
||||
,
|
||||
setQQLoginUin: async function (uin: string): Promise<void> {
|
||||
LoginRuntime.QQLoginUin = uin;
|
||||
}
|
||||
,
|
||||
getQQLoginUin: async function (): Promise<string> {
|
||||
return LoginRuntime.QQLoginUin;
|
||||
},
|
||||
getQQQuickLoginList: async function (): Promise<any[]> {
|
||||
return LoginRuntime.NapCatHelper.QQLoginList;
|
||||
},
|
||||
setQQQuickLoginList: async function (list: string[]): Promise<void> {
|
||||
LoginRuntime.NapCatHelper.QQLoginList = list;
|
||||
},
|
||||
setQQQuickLoginCall(func: (uin: string) => Promise<{ result: boolean, message: string }>): void {
|
||||
LoginRuntime.NapCatHelper.CoreQuickLoginCall = func;
|
||||
},
|
||||
getQQQuickLogin: async function (uin: string): Promise<{ result: boolean, message: string }> {
|
||||
return await LoginRuntime.NapCatHelper.CoreQuickLoginCall(uin);
|
||||
},
|
||||
setOB11ConfigCall: async function (func: (ob11: OB11Config) => Promise<void>): Promise<void> {
|
||||
LoginRuntime.NapCatHelper.SetOb11ConfigCall = func;
|
||||
},
|
||||
setOB11Config: async function (ob11: OB11Config): Promise<void> {
|
||||
await LoginRuntime.NapCatHelper.SetOb11ConfigCall(ob11);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
,
|
||||
getQQLoginStatus: async function (): Promise<boolean> {
|
||||
return LoginRuntime.QQLoginStatus;
|
||||
}
|
||||
,
|
||||
setQQLoginStatus: async function (status: boolean): Promise<void> {
|
||||
LoginRuntime.QQLoginStatus = status;
|
||||
}
|
||||
,
|
||||
setQQLoginQrcodeURL: async function (url: string): Promise<void> {
|
||||
LoginRuntime.QQQRCodeURL = url;
|
||||
}
|
||||
,
|
||||
getQQLoginQrcodeURL: async function (): Promise<string> {
|
||||
return LoginRuntime.QQQRCodeURL;
|
||||
}
|
||||
,
|
||||
setQQLoginUin: async function (uin: string): Promise<void> {
|
||||
LoginRuntime.QQLoginUin = uin;
|
||||
}
|
||||
,
|
||||
getQQLoginUin: async function (): Promise<string> {
|
||||
return LoginRuntime.QQLoginUin;
|
||||
},
|
||||
getQQQuickLoginList: async function (): Promise<any[]> {
|
||||
return LoginRuntime.NapCatHelper.QQLoginList;
|
||||
},
|
||||
setQQQuickLoginList: async function (list: string[]): Promise<void> {
|
||||
LoginRuntime.NapCatHelper.QQLoginList = list;
|
||||
},
|
||||
setQQQuickLoginCall(func: (uin: string) => Promise<{ result: boolean, message: string }>): void {
|
||||
LoginRuntime.NapCatHelper.CoreQuickLoginCall = func;
|
||||
},
|
||||
getQQQuickLogin: async function (uin: string): Promise<{ result: boolean, message: string }> {
|
||||
return await LoginRuntime.NapCatHelper.CoreQuickLoginCall(uin);
|
||||
},
|
||||
setOB11ConfigCall: async function (func: (ob11: OB11Config) => Promise<void>): Promise<void> {
|
||||
LoginRuntime.NapCatHelper.SetOb11ConfigCall = func;
|
||||
},
|
||||
setOB11Config: async function (ob11: OB11Config): Promise<void> {
|
||||
await LoginRuntime.NapCatHelper.SetOb11ConfigCall(ob11);
|
||||
}
|
||||
};
|
@@ -11,58 +11,58 @@ interface WebUiCredentialJson {
|
||||
}
|
||||
|
||||
export class AuthHelper {
|
||||
private static secretKey = Math.random().toString(36).slice(2);
|
||||
private static secretKey = Math.random().toString(36).slice(2);
|
||||
|
||||
/**
|
||||
/**
|
||||
* 签名凭证方法。
|
||||
* @param token 待签名的凭证字符串。
|
||||
* @returns 签名后的凭证对象。
|
||||
*/
|
||||
public static async signCredential(token: string): Promise<WebUiCredentialJson> {
|
||||
const innerJson: WebUiCredentialInnerJson = {
|
||||
CreatedTime: Date.now(),
|
||||
TokenEncoded: token,
|
||||
};
|
||||
const jsonString = JSON.stringify(innerJson);
|
||||
const hmac = crypto.createHmac('sha256', AuthHelper.secretKey)
|
||||
.update(jsonString, 'utf8')
|
||||
.digest('hex');
|
||||
return { Data: innerJson, Hmac: hmac };
|
||||
}
|
||||
public static async signCredential(token: string): Promise<WebUiCredentialJson> {
|
||||
const innerJson: WebUiCredentialInnerJson = {
|
||||
CreatedTime: Date.now(),
|
||||
TokenEncoded: token,
|
||||
};
|
||||
const jsonString = JSON.stringify(innerJson);
|
||||
const hmac = crypto.createHmac('sha256', AuthHelper.secretKey)
|
||||
.update(jsonString, 'utf8')
|
||||
.digest('hex');
|
||||
return { Data: innerJson, Hmac: hmac };
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 检查凭证是否被篡改的方法。
|
||||
* @param credentialJson 凭证的JSON对象。
|
||||
* @returns 布尔值,表示凭证是否有效。
|
||||
*/
|
||||
public static async checkCredential(credentialJson: WebUiCredentialJson): Promise<boolean> {
|
||||
try {
|
||||
const jsonString = JSON.stringify(credentialJson.Data);
|
||||
const calculatedHmac = crypto.createHmac('sha256', AuthHelper.secretKey)
|
||||
.update(jsonString, 'utf8')
|
||||
.digest('hex');
|
||||
return calculatedHmac === credentialJson.Hmac;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
public static async checkCredential(credentialJson: WebUiCredentialJson): Promise<boolean> {
|
||||
try {
|
||||
const jsonString = JSON.stringify(credentialJson.Data);
|
||||
const calculatedHmac = crypto.createHmac('sha256', AuthHelper.secretKey)
|
||||
.update(jsonString, 'utf8')
|
||||
.digest('hex');
|
||||
return calculatedHmac === credentialJson.Hmac;
|
||||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 验证凭证在1小时内有效且token与原始token相同。
|
||||
* @param token 待验证的原始token。
|
||||
* @param credentialJson 已签名的凭证JSON对象。
|
||||
* @returns 布尔值,表示凭证是否有效且token匹配。
|
||||
*/
|
||||
public static async validateCredentialWithinOneHour(token: string, credentialJson: WebUiCredentialJson): Promise<boolean> {
|
||||
const isValid = await AuthHelper.checkCredential(credentialJson);
|
||||
if (!isValid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const currentTime = Date.now() / 1000;
|
||||
const createdTime = credentialJson.Data.CreatedTime;
|
||||
const timeDifference = currentTime - createdTime;
|
||||
|
||||
return timeDifference <= 3600 && credentialJson.Data.TokenEncoded === token;
|
||||
public static async validateCredentialWithinOneHour(token: string, credentialJson: WebUiCredentialJson): Promise<boolean> {
|
||||
const isValid = await AuthHelper.checkCredential(credentialJson);
|
||||
if (!isValid) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const currentTime = Date.now() / 1000;
|
||||
const createdTime = credentialJson.Data.CreatedTime;
|
||||
const timeDifference = currentTime - createdTime;
|
||||
|
||||
return timeDifference <= 3600 && credentialJson.Data.TokenEncoded === token;
|
||||
}
|
||||
}
|
@@ -1,39 +1,45 @@
|
||||
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
||||
import { resolve } from "node:path";
|
||||
const net = require('net');
|
||||
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import * as net from 'node:net';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
// 限制尝试端口的次数,避免死循环
|
||||
const MAX_PORT_TRY = 100;
|
||||
|
||||
async function tryUsePort(port: number, tryCount: number = 0): Promise<number> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
let server = net.createServer();
|
||||
server.on('listening', () => {
|
||||
server.close();
|
||||
resolve(port);
|
||||
});
|
||||
return new Promise(async (resolve, reject) => {
|
||||
try {
|
||||
const server = net.createServer();
|
||||
server.on('listening', () => {
|
||||
server.close();
|
||||
resolve(port);
|
||||
});
|
||||
|
||||
server.on('error', (err: any) => {
|
||||
if (err.code === 'EADDRINUSE') {
|
||||
if (tryCount < MAX_PORT_TRY) {
|
||||
// 使用循环代替递归
|
||||
resolve(tryUsePort(port + 1, tryCount + 1));
|
||||
} else {
|
||||
reject(`端口尝试失败,达到最大尝试次数: ${MAX_PORT_TRY}`);
|
||||
}
|
||||
} else {
|
||||
reject(`遇到错误: ${err.code}`);
|
||||
}
|
||||
});
|
||||
|
||||
// 尝试监听端口
|
||||
server.listen(port);
|
||||
} catch (error) {
|
||||
// 这里捕获到的错误应该是启动服务器时的同步错误
|
||||
reject(`服务器启动时发生错误: ${error}`);
|
||||
server.on('error', (err: any) => {
|
||||
if (err.code === 'EADDRINUSE') {
|
||||
if (tryCount < MAX_PORT_TRY) {
|
||||
// 使用循环代替递归
|
||||
resolve(tryUsePort(port + 1, tryCount + 1));
|
||||
} else {
|
||||
reject(`端口尝试失败,达到最大尝试次数: ${MAX_PORT_TRY}`);
|
||||
}
|
||||
} else {
|
||||
reject(`遇到错误: ${err.code}`);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 尝试监听端口
|
||||
server.listen(port);
|
||||
} catch (error) {
|
||||
// 这里捕获到的错误应该是启动服务器时的同步错误
|
||||
reject(`服务器启动时发生错误: ${error}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
export interface WebUiConfigType {
|
||||
@@ -43,38 +49,38 @@ export interface WebUiConfigType {
|
||||
}
|
||||
// 读取当前目录下名为 webui.json 的配置文件,如果不存在则创建初始化配置文件
|
||||
class WebUiConfigWrapper {
|
||||
WebUiConfigData: WebUiConfigType | undefined = undefined;
|
||||
async GetWebUIConfig(): Promise<WebUiConfigType> {
|
||||
if (this.WebUiConfigData) {
|
||||
return this.WebUiConfigData;
|
||||
}
|
||||
try {
|
||||
let configPath = resolve(__dirname, "./config/webui.json");
|
||||
let config: WebUiConfigType = {
|
||||
port: 6099,
|
||||
token: Math.random().toString(36).slice(2),//生成随机密码
|
||||
loginRate: 3
|
||||
};
|
||||
|
||||
if (!existsSync(configPath)) {
|
||||
writeFileSync(configPath, JSON.stringify(config, null, 4));
|
||||
}
|
||||
|
||||
let fileContent = readFileSync(configPath, "utf-8");
|
||||
let parsedConfig = JSON.parse(fileContent) as WebUiConfigType;
|
||||
|
||||
// 修正端口占用情况
|
||||
const [err, data] = await tryUsePort(parsedConfig.port).then(data => [null, data as number]).catch(err => [err, null]);
|
||||
parsedConfig.port = data;
|
||||
if (err) {
|
||||
//一般没那么离谱 如果真有这么离谱 考虑下 向外抛出异常
|
||||
}
|
||||
this.WebUiConfigData = parsedConfig;
|
||||
return this.WebUiConfigData;
|
||||
} catch (e) {
|
||||
console.error("读取配置文件失败", e);
|
||||
}
|
||||
return {} as WebUiConfigType; // 理论上这行代码到不了,为了保持函数完整性而保留
|
||||
WebUiConfigData: WebUiConfigType | undefined = undefined;
|
||||
async GetWebUIConfig(): Promise<WebUiConfigType> {
|
||||
if (this.WebUiConfigData) {
|
||||
return this.WebUiConfigData;
|
||||
}
|
||||
try {
|
||||
const configPath = resolve(__dirname, './config/webui.json');
|
||||
const config: WebUiConfigType = {
|
||||
port: 6099,
|
||||
token: Math.random().toString(36).slice(2),//生成随机密码
|
||||
loginRate: 3
|
||||
};
|
||||
|
||||
if (!existsSync(configPath)) {
|
||||
writeFileSync(configPath, JSON.stringify(config, null, 4));
|
||||
}
|
||||
|
||||
const fileContent = readFileSync(configPath, 'utf-8');
|
||||
const parsedConfig = JSON.parse(fileContent) as WebUiConfigType;
|
||||
|
||||
// 修正端口占用情况
|
||||
const [err, data] = await tryUsePort(parsedConfig.port).then(data => [null, data as number]).catch(err => [err, null]);
|
||||
parsedConfig.port = data;
|
||||
if (err) {
|
||||
//一般没那么离谱 如果真有这么离谱 考虑下 向外抛出异常
|
||||
}
|
||||
this.WebUiConfigData = parsedConfig;
|
||||
return this.WebUiConfigData;
|
||||
} catch (e) {
|
||||
console.error('读取配置文件失败', e);
|
||||
}
|
||||
return {} as WebUiConfigType; // 理论上这行代码到不了,为了保持函数完整性而保留
|
||||
}
|
||||
}
|
||||
export const WebUiConfig = new WebUiConfigWrapper();
|
@@ -1,6 +1,6 @@
|
||||
import { Router } from 'express';
|
||||
import { OB11GetConfigHandler,OB11SetConfigHandler} from '../api/OB11Config';
|
||||
import { OB11GetConfigHandler,OB11SetConfigHandler } from '../api/OB11Config';
|
||||
const router = Router();
|
||||
router.post('/GetConfig', OB11GetConfigHandler)
|
||||
router.post('/GetConfig', OB11GetConfigHandler);
|
||||
router.post('/SetConfig', OB11SetConfigHandler);
|
||||
export { router as OB11ConfigRouter };
|
@@ -1,7 +1,7 @@
|
||||
import { Router } from 'express';
|
||||
import { QQCheckLoginStatusHandler, QQGetQRcodeHandler, QQGetQuickLoginListHandler, QQSetQuickLoginHandler } from '../api/QQLogin';
|
||||
const router = Router();
|
||||
router.all('/GetQuickLoginList', QQGetQuickLoginListHandler)
|
||||
router.all('/GetQuickLoginList', QQGetQuickLoginListHandler);
|
||||
router.post('/CheckLoginStatus', QQCheckLoginStatusHandler);
|
||||
router.post('/GetQQLoginQrcode', QQGetQRcodeHandler);
|
||||
router.post('/SetQuickLogin', QQSetQuickLoginHandler);
|
||||
|
@@ -1,65 +1,65 @@
|
||||
import { Router } from "express";
|
||||
import { Router } from 'express';
|
||||
import { AuthHelper } from '../../src/helper/SignToken';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { QQLoginRouter } from "./QQLogin";
|
||||
import { AuthRouter } from "./auth";
|
||||
import { OB11ConfigRouter } from "./OB11Config";
|
||||
import { WebUiConfig } from "../helper/config";
|
||||
import { QQLoginRouter } from './QQLogin';
|
||||
import { AuthRouter } from './auth';
|
||||
import { OB11ConfigRouter } from './OB11Config';
|
||||
import { WebUiConfig } from '../helper/config';
|
||||
const router = Router();
|
||||
export async function AuthApi(req: Request, res: Response, next: NextFunction) {
|
||||
//判断当前url是否为/login 如果是跳过鉴权
|
||||
if (req.url == '/auth/login') {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
if (req.headers?.authorization) {
|
||||
let authorization = req.headers.authorization.split(' ');
|
||||
if (authorization.length < 2) {
|
||||
res.json({
|
||||
code: -1,
|
||||
msg: 'Unauthorized',
|
||||
});
|
||||
return;
|
||||
}
|
||||
let token = authorization[1];
|
||||
let Credential: any;
|
||||
try {
|
||||
Credential = JSON.parse(Buffer.from(token, 'base64').toString('utf-8'));
|
||||
} catch (e) {
|
||||
res.json({
|
||||
code: -1,
|
||||
msg: 'Unauthorized',
|
||||
});
|
||||
return;
|
||||
}
|
||||
let config = await WebUiConfig.GetWebUIConfig();
|
||||
let credentialJson = await AuthHelper.validateCredentialWithinOneHour(config.token, Credential);
|
||||
if (credentialJson) {
|
||||
//通过验证
|
||||
next();
|
||||
return;
|
||||
}
|
||||
res.json({
|
||||
code: -1,
|
||||
msg: 'Unauthorized',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
res.json({
|
||||
//判断当前url是否为/login 如果是跳过鉴权
|
||||
if (req.url == '/auth/login') {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
if (req.headers?.authorization) {
|
||||
const authorization = req.headers.authorization.split(' ');
|
||||
if (authorization.length < 2) {
|
||||
res.json({
|
||||
code: -1,
|
||||
msg: 'Server Error',
|
||||
msg: 'Unauthorized',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const token = authorization[1];
|
||||
let Credential: any;
|
||||
try {
|
||||
Credential = JSON.parse(Buffer.from(token, 'base64').toString('utf-8'));
|
||||
} catch (e) {
|
||||
res.json({
|
||||
code: -1,
|
||||
msg: 'Unauthorized',
|
||||
});
|
||||
return;
|
||||
}
|
||||
const config = await WebUiConfig.GetWebUIConfig();
|
||||
const credentialJson = await AuthHelper.validateCredentialWithinOneHour(config.token, Credential);
|
||||
if (credentialJson) {
|
||||
//通过验证
|
||||
next();
|
||||
return;
|
||||
}
|
||||
res.json({
|
||||
code: -1,
|
||||
msg: 'Unauthorized',
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
res.json({
|
||||
code: -1,
|
||||
msg: 'Server Error',
|
||||
});
|
||||
return;
|
||||
}
|
||||
router.use(AuthApi);
|
||||
router.all("/test", (req, res) => {
|
||||
res.json({
|
||||
code: 0,
|
||||
msg: 'ok',
|
||||
});
|
||||
router.all('/test', (req, res) => {
|
||||
res.json({
|
||||
code: 0,
|
||||
msg: 'ok',
|
||||
});
|
||||
});
|
||||
router.use('/auth', AuthRouter);
|
||||
router.use('/QQLogin', QQLoginRouter);
|
||||
router.use('/OB11Config', OB11ConfigRouter);
|
||||
export { router as ALLRouter }
|
||||
export { router as ALLRouter };
|
@@ -1,15 +1,15 @@
|
||||
import { SettingList } from "./components/SettingList";
|
||||
import { SettingItem } from "./components/SettingItem";
|
||||
import { SettingButton } from "./components/SettingButton";
|
||||
import { SettingSwitch } from "./components/SettingSwitch";
|
||||
import { SettingSelect } from "./components/SettingSelect";
|
||||
import { OB11Config, OB11ConfigWrapper } from "./components/WebUiApiOB11Config";
|
||||
import { SettingList } from './components/SettingList';
|
||||
import { SettingItem } from './components/SettingItem';
|
||||
import { SettingButton } from './components/SettingButton';
|
||||
import { SettingSwitch } from './components/SettingSwitch';
|
||||
import { SettingSelect } from './components/SettingSelect';
|
||||
import { OB11Config, OB11ConfigWrapper } from './components/WebUiApiOB11Config';
|
||||
async function onSettingWindowCreated(view: Element) {
|
||||
const isEmpty = (value: any) => value === undefined || value === undefined || value === "";
|
||||
await OB11ConfigWrapper.Init(localStorage.getItem("auth") as string);
|
||||
let ob11Config: OB11Config = await OB11ConfigWrapper.GetOB11Config();
|
||||
const isEmpty = (value: any) => value === undefined || value === undefined || value === '';
|
||||
await OB11ConfigWrapper.Init(localStorage.getItem('auth') as string);
|
||||
const ob11Config: OB11Config = await OB11ConfigWrapper.GetOB11Config();
|
||||
const setOB11Config = (key: string, value: any) => {
|
||||
const configKey = key.split(".");
|
||||
const configKey = key.split('.');
|
||||
if (configKey.length === 2) {
|
||||
ob11Config[configKey[1]] = value;
|
||||
} else if (configKey.length === 3) {
|
||||
@@ -21,7 +21,7 @@ async function onSettingWindowCreated(view: Element) {
|
||||
const parser = new DOMParser();
|
||||
const doc = parser.parseFromString(
|
||||
[
|
||||
"<div>",
|
||||
'<div>',
|
||||
`<setting-section id="napcat-error">
|
||||
<setting-panel><pre><code></code></pre></setting-panel>
|
||||
</setting-section>`,
|
||||
@@ -29,39 +29,39 @@ async function onSettingWindowCreated(view: Element) {
|
||||
SettingItem(
|
||||
'<span id="napcat-update-title">Napcat</span>',
|
||||
undefined,
|
||||
SettingButton("V1.3.6", "napcat-update-button", "secondary")
|
||||
SettingButton('V1.3.9', 'napcat-update-button', 'secondary')
|
||||
),
|
||||
]),
|
||||
SettingList([
|
||||
SettingItem(
|
||||
"启用 HTTP 服务",
|
||||
'启用 HTTP 服务',
|
||||
undefined,
|
||||
SettingSwitch("ob11.http.enable", ob11Config.http.enable, {
|
||||
"control-display-id": "config-ob11-http-port",
|
||||
SettingSwitch('ob11.http.enable', ob11Config.http.enable, {
|
||||
'control-display-id': 'config-ob11-http-port',
|
||||
})
|
||||
),
|
||||
SettingItem(
|
||||
"HTTP 服务监听端口",
|
||||
'HTTP 服务监听端口',
|
||||
undefined,
|
||||
`<div class="q-input"><input class="q-input__inner" data-config-key="ob11.http.port" type="number" min="1" max="65534" value="${ob11Config.http.port}" placeholder="${ob11Config.http.port}" /></div>`,
|
||||
"config-ob11-http-port",
|
||||
'config-ob11-http-port',
|
||||
ob11Config.http.enable
|
||||
),
|
||||
SettingItem(
|
||||
"启用 HTTP 心跳",
|
||||
'启用 HTTP 心跳',
|
||||
undefined,
|
||||
SettingSwitch("ob11.http.enableHeart", ob11Config.http.enableHeart, {
|
||||
"control-display-id": "config-ob11-HTTP.enableHeart",
|
||||
SettingSwitch('ob11.http.enableHeart', ob11Config.http.enableHeart, {
|
||||
'control-display-id': 'config-ob11-HTTP.enableHeart',
|
||||
})
|
||||
),
|
||||
SettingItem(
|
||||
"启用 HTTP 事件上报",
|
||||
'启用 HTTP 事件上报',
|
||||
undefined,
|
||||
SettingSwitch("ob11.http.enablePost", ob11Config.http.enablePost, {
|
||||
"control-display-id": "config-ob11-http-postUrls",
|
||||
SettingSwitch('ob11.http.enablePost', ob11Config.http.enablePost, {
|
||||
'control-display-id': 'config-ob11-http-postUrls',
|
||||
})
|
||||
),
|
||||
`<div class="config-host-list" id="config-ob11-http-postUrls" ${ob11Config.http.enablePost ? "" : "is-hidden"
|
||||
`<div class="config-host-list" id="config-ob11-http-postUrls" ${ob11Config.http.enablePost ? '' : 'is-hidden'
|
||||
}>
|
||||
<setting-item data-direction="row">
|
||||
<div>
|
||||
@@ -69,7 +69,7 @@ async function onSettingWindowCreated(view: Element) {
|
||||
</div>
|
||||
<div class="q-input">
|
||||
<input id="config-ob11-http-secret" class="q-input__inner" data-config-key="ob11.http.secret" type="text" value="${ob11Config.http.secret
|
||||
}" placeholder="未设置" />
|
||||
}" placeholder="未设置" />
|
||||
</div>
|
||||
</setting-item>
|
||||
<setting-item data-direction="row">
|
||||
@@ -81,27 +81,27 @@ async function onSettingWindowCreated(view: Element) {
|
||||
<div id="config-ob11-http-postUrls-list"></div>
|
||||
</div>`,
|
||||
SettingItem(
|
||||
"启用正向 WebSocket 服务",
|
||||
'启用正向 WebSocket 服务',
|
||||
undefined,
|
||||
SettingSwitch("ob11.ws.enable", ob11Config.ws.enable, {
|
||||
"control-display-id": "config-ob11-ws-port",
|
||||
SettingSwitch('ob11.ws.enable', ob11Config.ws.enable, {
|
||||
'control-display-id': 'config-ob11-ws-port',
|
||||
})
|
||||
),
|
||||
SettingItem(
|
||||
"正向 WebSocket 服务监听端口",
|
||||
'正向 WebSocket 服务监听端口',
|
||||
undefined,
|
||||
`<div class="q-input"><input class="q-input__inner" data-config-key="ob11.ws.port" type="number" min="1" max="65534" value="${ob11Config.ws.port}" placeholder="${ob11Config.ws.port}" /></div>`,
|
||||
"config-ob11-ws-port",
|
||||
'config-ob11-ws-port',
|
||||
ob11Config.ws.enable
|
||||
),
|
||||
SettingItem(
|
||||
"启用反向 WebSocket 服务",
|
||||
'启用反向 WebSocket 服务',
|
||||
undefined,
|
||||
SettingSwitch("ob11.reverseWs.enable", ob11Config.reverseWs.enable, {
|
||||
"control-display-id": "config-ob11-reverseWs-urls",
|
||||
SettingSwitch('ob11.reverseWs.enable', ob11Config.reverseWs.enable, {
|
||||
'control-display-id': 'config-ob11-reverseWs-urls',
|
||||
})
|
||||
),
|
||||
`<div class="config-host-list" id="config-ob11-reverseWs-urls" ${ob11Config.reverseWs.enable ? "" : "is-hidden"
|
||||
`<div class="config-host-list" id="config-ob11-reverseWs-urls" ${ob11Config.reverseWs.enable ? '' : 'is-hidden'
|
||||
}>
|
||||
<setting-item data-direction="row">
|
||||
<div>
|
||||
@@ -112,81 +112,81 @@ async function onSettingWindowCreated(view: Element) {
|
||||
<div id="config-ob11-reverseWs-urls-list"></div>
|
||||
</div>`,
|
||||
SettingItem(
|
||||
" WebSocket 服务心跳间隔",
|
||||
"控制每隔多久发送一个心跳包,单位为毫秒",
|
||||
' WebSocket 服务心跳间隔',
|
||||
'控制每隔多久发送一个心跳包,单位为毫秒',
|
||||
`<div class="q-input"><input class="q-input__inner" data-config-key="ob11.heartInterval" type="number" min="1000" value="${ob11Config.heartInterval}" placeholder="${ob11Config.heartInterval}" /></div>`
|
||||
),
|
||||
SettingItem(
|
||||
"Access token",
|
||||
'Access token',
|
||||
undefined,
|
||||
`<div class="q-input" style="width:210px;"><input class="q-input__inner" data-config-key="ob11.token" type="text" value="${ob11Config.token}" placeholder="未设置" /></div>`
|
||||
),
|
||||
SettingItem(
|
||||
"新消息上报格式",
|
||||
"如客户端无特殊需求推荐保持默认设置,两者的详细差异可参考 <a href=\"javascript:LiteLoader.api.openExternal('https://github.com/botuniverse/onebot-11/tree/master/message#readme');\">OneBot v11 文档</a>",
|
||||
'新消息上报格式',
|
||||
'如客户端无特殊需求推荐保持默认设置,两者的详细差异可参考 <a href="javascript:LiteLoader.api.openExternal(\'https://github.com/botuniverse/onebot-11/tree/master/message#readme\');">OneBot v11 文档</a>',
|
||||
SettingSelect(
|
||||
[
|
||||
{ text: "消息段", value: "array" },
|
||||
{ text: "CQ码", value: "string" },
|
||||
{ text: '消息段', value: 'array' },
|
||||
{ text: 'CQ码', value: 'string' },
|
||||
],
|
||||
"ob11.messagePostFormat",
|
||||
'ob11.messagePostFormat',
|
||||
ob11Config.messagePostFormat
|
||||
)
|
||||
),
|
||||
SettingItem(
|
||||
"音乐卡片签名地址",
|
||||
'音乐卡片签名地址',
|
||||
undefined,
|
||||
`<div class="q-input" style="width:210px;"><input class="q-input__inner" data-config-key="ob11.musicSignUrl" type="text" value="${ob11Config.musicSignUrl}" placeholder="未设置" /></div>`,
|
||||
"ob11.musicSignUrl"
|
||||
'ob11.musicSignUrl'
|
||||
),
|
||||
SettingItem(
|
||||
"",
|
||||
'',
|
||||
undefined,
|
||||
SettingButton("保存", "config-ob11-save", "primary")
|
||||
SettingButton('保存', 'config-ob11-save', 'primary')
|
||||
),
|
||||
]),
|
||||
SettingList([
|
||||
SettingItem(
|
||||
"上报 Bot 自身发送的消息",
|
||||
"上报 event 为 message_sent",
|
||||
SettingSwitch("ob11.reportSelfMessage", ob11Config.reportSelfMessage)
|
||||
'上报 Bot 自身发送的消息',
|
||||
'上报 event 为 message_sent',
|
||||
SettingSwitch('ob11.reportSelfMessage', ob11Config.reportSelfMessage)
|
||||
),
|
||||
]),
|
||||
SettingList([
|
||||
SettingItem(
|
||||
"GitHub 仓库",
|
||||
`https://github.com/NapNeko/NapCatQQ`,
|
||||
SettingButton("点个星星", "open-github")
|
||||
'GitHub 仓库',
|
||||
'https://github.com/NapNeko/NapCatQQ',
|
||||
SettingButton('点个星星', 'open-github')
|
||||
),
|
||||
SettingItem("NapCat 文档", ``, SettingButton("看看文档", "open-docs")),
|
||||
SettingItem('NapCat 文档', '', SettingButton('看看文档', 'open-docs')),
|
||||
SettingItem(
|
||||
"Telegram 群",
|
||||
`https://t.me/+nLZEnpne-pQ1OWFl`,
|
||||
SettingButton("进去逛逛", "open-telegram")
|
||||
'Telegram 群',
|
||||
'https://t.me/+nLZEnpne-pQ1OWFl',
|
||||
SettingButton('进去逛逛', 'open-telegram')
|
||||
),
|
||||
SettingItem(
|
||||
"QQ 群",
|
||||
`545402644`,
|
||||
SettingButton("我要进去", "open-qq-group")
|
||||
'QQ 群',
|
||||
'545402644',
|
||||
SettingButton('我要进去', 'open-qq-group')
|
||||
),
|
||||
]),
|
||||
"</div>",
|
||||
].join(""),
|
||||
"text/html"
|
||||
'</div>',
|
||||
].join(''),
|
||||
'text/html'
|
||||
);
|
||||
|
||||
// 外链按钮
|
||||
doc.querySelector("#open-github")?.addEventListener("click", () => {
|
||||
window.open("https://napneko.github.io/", "_blank");
|
||||
doc.querySelector('#open-github')?.addEventListener('click', () => {
|
||||
window.open('https://napneko.github.io/', '_blank');
|
||||
});
|
||||
doc.querySelector("#open-telegram")?.addEventListener("click", () => {
|
||||
window.open("https://t.me/+nLZEnpne-pQ1OWFl");
|
||||
doc.querySelector('#open-telegram')?.addEventListener('click', () => {
|
||||
window.open('https://t.me/+nLZEnpne-pQ1OWFl');
|
||||
});
|
||||
doc.querySelector("#open-qq-group")?.addEventListener("click", () => {
|
||||
window.open("https://qm.qq.com/q/bDnHRG38aI");
|
||||
doc.querySelector('#open-qq-group')?.addEventListener('click', () => {
|
||||
window.open('https://qm.qq.com/q/bDnHRG38aI');
|
||||
});
|
||||
doc.querySelector("#open-docs")?.addEventListener("click", () => {
|
||||
window.open("https://github.com/NapNeko/NapCatQQ");
|
||||
doc.querySelector('#open-docs')?.addEventListener('click', () => {
|
||||
window.open('https://github.com/NapNeko/NapCatQQ');
|
||||
});
|
||||
// 生成反向地址列表
|
||||
const buildHostListItem = (
|
||||
@@ -196,29 +196,29 @@ async function onSettingWindowCreated(view: Element) {
|
||||
inputAttrs: any = {}
|
||||
) => {
|
||||
const dom = {
|
||||
container: document.createElement("setting-item"),
|
||||
input: document.createElement("input"),
|
||||
inputContainer: document.createElement("div"),
|
||||
deleteBtn: document.createElement("setting-button"),
|
||||
container: document.createElement('setting-item'),
|
||||
input: document.createElement('input'),
|
||||
inputContainer: document.createElement('div'),
|
||||
deleteBtn: document.createElement('setting-button'),
|
||||
};
|
||||
dom.container.classList.add("setting-host-list-item");
|
||||
dom.container.dataset.direction = "row";
|
||||
dom.container.classList.add('setting-host-list-item');
|
||||
dom.container.dataset.direction = 'row';
|
||||
Object.assign(dom.input, inputAttrs);
|
||||
dom.input.classList.add("q-input__inner");
|
||||
dom.input.type = "url";
|
||||
dom.input.classList.add('q-input__inner');
|
||||
dom.input.type = 'url';
|
||||
dom.input.value = host;
|
||||
dom.input.addEventListener("input", () => {
|
||||
ob11Config[type.split("-")[0]][type.split("-")[1]][index] =
|
||||
dom.input.addEventListener('input', () => {
|
||||
ob11Config[type.split('-')[0]][type.split('-')[1]][index] =
|
||||
dom.input.value;
|
||||
});
|
||||
|
||||
dom.inputContainer.classList.add("q-input");
|
||||
dom.inputContainer.classList.add('q-input');
|
||||
dom.inputContainer.appendChild(dom.input);
|
||||
|
||||
dom.deleteBtn.innerHTML = "删除";
|
||||
dom.deleteBtn.dataset.type = "secondary";
|
||||
dom.deleteBtn.addEventListener("click", () => {
|
||||
ob11Config[type.split("-")[0]][type.split("-")[1]].splice(index, 1);
|
||||
dom.deleteBtn.innerHTML = '删除';
|
||||
dom.deleteBtn.dataset.type = 'secondary';
|
||||
dom.deleteBtn.addEventListener('click', () => {
|
||||
ob11Config[type.split('-')[0]][type.split('-')[1]].splice(index, 1);
|
||||
initReverseHost(type);
|
||||
});
|
||||
|
||||
@@ -245,7 +245,7 @@ async function onSettingWindowCreated(view: Element) {
|
||||
doc: Document = document,
|
||||
inputAttr: any = {}
|
||||
) => {
|
||||
type = type.replace(/\./g, "-");//替换操作
|
||||
type = type.replace(/\./g, '-');//替换操作
|
||||
|
||||
const hostContainerDom = doc.body.querySelector(
|
||||
`#config-ob11-${type}-list`
|
||||
@@ -253,22 +253,22 @@ async function onSettingWindowCreated(view: Element) {
|
||||
hostContainerDom?.appendChild(
|
||||
buildHostListItem(
|
||||
type,
|
||||
"",
|
||||
ob11Config[type.split("-")[0]][type.split("-")[1]].length,
|
||||
'',
|
||||
ob11Config[type.split('-')[0]][type.split('-')[1]].length,
|
||||
inputAttr
|
||||
)
|
||||
);
|
||||
ob11Config[type.split("-")[0]][type.split("-")[1]].push("");
|
||||
ob11Config[type.split('-')[0]][type.split('-')[1]].push('');
|
||||
};
|
||||
const initReverseHost = (type: string, doc: Document = document) => {
|
||||
type = type.replace(/\./g, "-");//替换操作
|
||||
type = type.replace(/\./g, '-');//替换操作
|
||||
const hostContainerDom = doc.body?.querySelector(
|
||||
`#config-ob11-${type}-list`
|
||||
);
|
||||
if (hostContainerDom) {
|
||||
[...hostContainerDom.childNodes].forEach((dom) => dom.remove());
|
||||
buildHostList(
|
||||
ob11Config[type.split("-")[0]][type.split("-")[1]],
|
||||
ob11Config[type.split('-')[0]][type.split('-')[1]],
|
||||
type
|
||||
).forEach((dom) => {
|
||||
hostContainerDom?.appendChild(dom);
|
||||
@@ -276,51 +276,51 @@ async function onSettingWindowCreated(view: Element) {
|
||||
}
|
||||
};
|
||||
|
||||
initReverseHost("http.postUrls", doc);
|
||||
initReverseHost("reverseWs.urls", doc);
|
||||
initReverseHost('http.postUrls', doc);
|
||||
initReverseHost('reverseWs.urls', doc);
|
||||
|
||||
doc
|
||||
.querySelector("#config-ob11-http-postUrls-add")
|
||||
?.addEventListener("click", () =>
|
||||
addReverseHost("http.postUrls", document, {
|
||||
placeholder: "如:http://127.0.0.1:5140/onebot",
|
||||
.querySelector('#config-ob11-http-postUrls-add')
|
||||
?.addEventListener('click', () =>
|
||||
addReverseHost('http.postUrls', document, {
|
||||
placeholder: '如:http://127.0.0.1:5140/onebot',
|
||||
})
|
||||
);
|
||||
|
||||
doc
|
||||
.querySelector("#config-ob11-reverseWs-urls-add")
|
||||
?.addEventListener("click", () =>
|
||||
addReverseHost("reverseWs.urls", document, {
|
||||
placeholder: "如:ws://127.0.0.1:5140/onebot",
|
||||
.querySelector('#config-ob11-reverseWs-urls-add')
|
||||
?.addEventListener('click', () =>
|
||||
addReverseHost('reverseWs.urls', document, {
|
||||
placeholder: '如:ws://127.0.0.1:5140/onebot',
|
||||
})
|
||||
);
|
||||
|
||||
doc.querySelector("#config-ffmpeg-select")?.addEventListener("click", () => {
|
||||
doc.querySelector('#config-ffmpeg-select')?.addEventListener('click', () => {
|
||||
//选择ffmpeg
|
||||
});
|
||||
|
||||
doc.querySelector("#config-open-log-path")?.addEventListener("click", () => {
|
||||
doc.querySelector('#config-open-log-path')?.addEventListener('click', () => {
|
||||
//打开日志
|
||||
});
|
||||
|
||||
// 开关
|
||||
doc
|
||||
.querySelectorAll("setting-switch[data-config-key]")
|
||||
.querySelectorAll('setting-switch[data-config-key]')
|
||||
.forEach((dom: Element) => {
|
||||
dom.addEventListener("click", () => {
|
||||
const active = dom.getAttribute("is-active") == undefined;
|
||||
//@ts-ignore 扩展
|
||||
dom.addEventListener('click', () => {
|
||||
const active = dom.getAttribute('is-active') == undefined;
|
||||
//@ts-expect-error 等待修复
|
||||
setOB11Config(dom.dataset.configKey, active);
|
||||
if (active) dom.setAttribute("is-active", "");
|
||||
else dom.removeAttribute("is-active");
|
||||
//@ts-ignore 等待修复
|
||||
if (active) dom.setAttribute('is-active', '');
|
||||
else dom.removeAttribute('is-active');
|
||||
//@ts-expect-error 等待修复
|
||||
if (!isEmpty(dom.dataset.controlDisplayId)) {
|
||||
const displayDom = document.querySelector(
|
||||
//@ts-ignore 等待修复
|
||||
//@ts-expect-error 等待修复
|
||||
`#${dom.dataset.controlDisplayId}`
|
||||
);
|
||||
if (active) displayDom?.removeAttribute("is-hidden");
|
||||
else displayDom?.setAttribute("is-hidden", "");
|
||||
if (active) displayDom?.removeAttribute('is-hidden');
|
||||
else displayDom?.setAttribute('is-hidden', '');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -328,15 +328,15 @@ async function onSettingWindowCreated(view: Element) {
|
||||
// 输入框
|
||||
doc
|
||||
.querySelectorAll(
|
||||
"setting-item .q-input input.q-input__inner[data-config-key]"
|
||||
'setting-item .q-input input.q-input__inner[data-config-key]'
|
||||
)
|
||||
.forEach((dom: Element) => {
|
||||
dom.addEventListener("input", () => {
|
||||
const Type = dom.getAttribute("type");
|
||||
//@ts-ignore 等待修复
|
||||
dom.addEventListener('input', () => {
|
||||
const Type = dom.getAttribute('type');
|
||||
//@ts-expect-error等待修复
|
||||
const configKey = dom.dataset.configKey;
|
||||
const configValue =
|
||||
Type === "number"
|
||||
Type === 'number'
|
||||
? parseInt((dom as HTMLInputElement).value) >= 1
|
||||
? parseInt((dom as HTMLInputElement).value)
|
||||
: 1
|
||||
@@ -348,11 +348,11 @@ async function onSettingWindowCreated(view: Element) {
|
||||
|
||||
// 下拉框
|
||||
doc
|
||||
.querySelectorAll("ob-setting-select[data-config-key]")
|
||||
.querySelectorAll('ob-setting-select[data-config-key]')
|
||||
.forEach((dom: Element) => {
|
||||
//@ts-ignore 等待修复
|
||||
dom?.addEventListener("selected", (e: CustomEvent) => {
|
||||
//@ts-ignore 等待修复
|
||||
//@ts-expect-error等待修复
|
||||
dom?.addEventListener('selected', (e: CustomEvent) => {
|
||||
//@ts-expect-error等待修复
|
||||
const configKey = dom.dataset.configKey;
|
||||
const configValue = e.detail.value;
|
||||
setOB11Config(configKey, configValue);
|
||||
@@ -360,9 +360,9 @@ async function onSettingWindowCreated(view: Element) {
|
||||
});
|
||||
|
||||
// 保存按钮
|
||||
doc.querySelector("#config-ob11-save")?.addEventListener("click", () => {
|
||||
doc.querySelector('#config-ob11-save')?.addEventListener('click', () => {
|
||||
OB11ConfigWrapper.SetOB11Config(ob11Config);
|
||||
alert("保存成功");
|
||||
alert('保存成功');
|
||||
});
|
||||
doc.body.childNodes.forEach((node) => {
|
||||
view.appendChild(node);
|
||||
|
@@ -1,3 +1,3 @@
|
||||
export const SettingButton = (text: string, id?: string, type: string = 'secondary') => {
|
||||
return `<setting-button ${type ? `data-type="${type}"` : ''} ${id ? `id="${id}"` : ''}>${text}</setting-button>`
|
||||
}
|
||||
return `<setting-button ${type ? `data-type="${type}"` : ''} ${id ? `id="${id}"` : ''}>${text}</setting-button>`;
|
||||
};
|
@@ -11,5 +11,5 @@ export const SettingItem = (
|
||||
${subtitle ? `<setting-text data-type="secondary">${subtitle}</setting-text>` : ''}
|
||||
</div>
|
||||
${action ? `<div>${action}</div>` : ''}
|
||||
</setting-item>`
|
||||
}
|
||||
</setting-item>`;
|
||||
};
|
@@ -1,14 +1,14 @@
|
||||
export const SettingList = (
|
||||
items: string[],
|
||||
title?: string,
|
||||
isCollapsible: boolean = false,
|
||||
direction: string = 'column',
|
||||
) => {
|
||||
return `<setting-section ${title && !isCollapsible ? `data-title="${title}"` : ''}>
|
||||
items: string[],
|
||||
title?: string,
|
||||
isCollapsible: boolean = false,
|
||||
direction: string = 'column',
|
||||
) => {
|
||||
return `<setting-section ${title && !isCollapsible ? `data-title="${title}"` : ''}>
|
||||
<setting-panel>
|
||||
<setting-list ${direction ? `data-direction="${direction}"` : ''} ${isCollapsible ? 'is-collapsible' : ''} ${title && isCollapsible ? `data-title="${title}"` : ''}>
|
||||
${items.join('')}
|
||||
</setting-list>
|
||||
</setting-panel>
|
||||
</setting-section>`
|
||||
}
|
||||
</setting-section>`;
|
||||
};
|
@@ -1,3 +1,3 @@
|
||||
export const SettingOption = (text: string, value?: string, isSelected: boolean = false) => {
|
||||
return `<setting-option ${value ? `data-value="${value}"` : ''} ${isSelected ? 'is-selected' : ''}>${text}</setting-option>`
|
||||
}
|
||||
return `<setting-option ${value ? `data-value="${value}"` : ''} ${isSelected ? 'is-selected' : ''}>${text}</setting-option>`;
|
||||
};
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user