Compare commits

...

127 Commits
main ... v1.1.0

Author SHA1 Message Date
linyuchen
ddcbe78a01 chore: release.yml 2024-04-17 18:40:49 +08:00
linyuchen
00b6c964e2 chore: release not need git submodule 2024-04-17 18:37:11 +08:00
linyuchen
d7d2b06ecc chore: change action token 2024-04-17 18:27:08 +08:00
Version
fafc59360d chore:version change 2024-04-17 09:50:56 +00:00
linyuchen
19e105785e update core 2024-04-17 17:38:02 +08:00
linyuchen
b87ac09e43 update core 2024-04-17 17:37:23 +08:00
linyuchen
af9092d7c7 fix: send forward msg 2024-04-17 17:35:14 +08:00
linyuchen
24a1ffd652 fix: http server cors 2024-04-17 17:06:24 +08:00
linyuchen
662813cc58 fix: postLoginStatus on error 2024-04-17 17:01:29 +08:00
linyuchen
d890b78290 refactor: auto_escape of send msg 2024-04-16 23:22:37 +08:00
linyuchen
58747d7d4a fix: delete group 2024-04-16 23:10:29 +08:00
linyuchen
0773a4f39c feat: Support post url params 2024-04-16 23:09:56 +08:00
linyuchen
66cc7f8a1f feat: http heart 2024-04-16 20:58:29 +08:00
linyuchen
01ab40bf4a Merge remote-tracking branch 'origin/main' 2024-04-16 20:28:26 +08:00
linyuchen
4c09147fd1 fix: cq code auto escape
fix: get groups no cache
2024-04-16 20:28:05 +08:00
手瓜一十雪
f9f426d788 build:friend history 2024-04-16 18:50:39 +08:00
手瓜一十雪
ff8fa1bf31 fix 2024-04-16 18:39:15 +08:00
手瓜一十雪
59f99e4f6a fix 2024-04-16 18:36:51 +08:00
手瓜一十雪
7449ce9c3b fix 2024-04-16 18:32:02 +08:00
手瓜一十雪
f6bc8f0a1f fix 2024-04-16 18:26:50 +08:00
手瓜一十雪
4d10b8cdee Revert "chore:version change"
This reverts commit 36ce3b08fe.
2024-04-16 14:13:22 +08:00
手瓜一十雪
5a61c5de09 limit:workflow 2024-04-16 14:10:31 +08:00
手瓜一十雪
f84d0db811 fix 2024-04-16 14:01:05 +08:00
Version
36ce3b08fe chore:version change 2024-04-16 05:57:37 +00:00
手瓜一十雪
da8ea5b545 Revert "chore:version change"
This reverts commit 034d12c347.
2024-04-16 13:57:04 +08:00
手瓜一十雪
fad3dbf4cd fix 2024-04-16 13:56:07 +08:00
Version
034d12c347 chore:version change 2024-04-16 05:54:20 +00:00
手瓜一十雪
c94dbf1d9a fix:workflow 2024-04-16 13:53:14 +08:00
手瓜一十雪
e516687a9e fix 2024-04-16 13:50:01 +08:00
手瓜一十雪
4a2f77b0a6 fix 2024-04-16 13:49:32 +08:00
手瓜一十雪
7b29ecba71 fix 2024-04-16 13:47:42 +08:00
手瓜一十雪
11241b8e07 Revert "chore:version change"
This reverts commit 52bbd1f20b.
2024-04-16 13:44:22 +08:00
Version
52bbd1f20b chore:version change 2024-04-16 05:42:48 +00:00
手瓜一十雪
4044750515 fix 2024-04-16 13:42:22 +08:00
手瓜一十雪
b670c546b9 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2024-04-16 13:38:00 +08:00
手瓜一十雪
f37bbf93cb fix 2024-04-16 13:37:42 +08:00
linyuchen
87311ab41a Merge remote-tracking branch 'origin/main' 2024-04-16 13:28:15 +08:00
linyuchen
ecb4d1845c update core 2024-04-16 13:28:05 +08:00
手瓜一十雪
35c232ab25 fix 2024-04-16 13:27:33 +08:00
linyuchen
df0be2e251 Merge remote-tracking branch 'origin/main' 2024-04-16 13:25:25 +08:00
linyuchen
871b3a102b refactor: recall get_group_list if groups is empty 2024-04-16 13:25:12 +08:00
手瓜一十雪
02299e3892 fix 2024-04-16 13:17:30 +08:00
手瓜一十雪
6af4d6f5b8 fix 2024-04-16 13:14:09 +08:00
手瓜一十雪
4fb5700367 fix 2024-04-16 13:12:33 +08:00
手瓜一十雪
8579276381 fix 2024-04-16 13:10:07 +08:00
手瓜一十雪
7ba60b22c5 fix 2024-04-16 13:06:07 +08:00
linyuchen
031932f41c Merge remote-tracking branch 'origin/main' 2024-04-16 13:00:02 +08:00
linyuchen
079d0a89b1 fix: tsconfig path alias 2024-04-16 12:59:52 +08:00
手瓜一十雪
c4fdce6d64 fix 2024-04-16 12:55:16 +08:00
手瓜一十雪
5604c2b29f Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2024-04-16 12:55:05 +08:00
手瓜一十雪
74b5ab2b47 fix 2024-04-16 12:53:37 +08:00
linyuchen
c29cbfe123 Merge remote-tracking branch 'origin/main' 2024-04-16 12:51:42 +08:00
手瓜一十雪
6fe5cb1ffd remove 2024-04-16 12:51:12 +08:00
linyuchen
7edd5a7a8e Merge remote-tracking branch 'origin/main' 2024-04-16 12:50:22 +08:00
linyuchen
c1edc1b99b fix: Send empty forward msg 2024-04-16 12:50:14 +08:00
手瓜一十雪
4d1d890f72 fix 2024-04-16 12:47:36 +08:00
手瓜一十雪
fe0f82fa2b fix:checkVesion 2024-04-16 12:46:37 +08:00
手瓜一十雪
84083a65a8 fix:checkVesion 2024-04-16 12:45:07 +08:00
手瓜一十雪
fc91c6bc08 fix 2024-04-16 12:43:39 +08:00
手瓜一十雪
09120171ba fix 2024-04-16 12:42:07 +08:00
手瓜一十雪
a362f920dc fix:workflow 2024-04-16 12:41:18 +08:00
手瓜一十雪
9d7729f548 fix:workflow 2024-04-16 12:21:50 +08:00
手瓜一十雪
ed56e177cf chore:workflow version 2024-04-16 11:49:44 +08:00
手瓜一十雪
9db28bd502 fix:version output 2024-04-16 11:43:14 +08:00
linyuchen
aded70eb2e Create LICENSE 2024-04-16 10:27:32 +08:00
手瓜一十雪
dfbad85465 re:version 2024-04-16 10:02:40 +08:00
手瓜一十雪
52076fe182 chore: version 2024-04-16 08:50:48 +08:00
linyuchen
5575c3cb13 style: remove unused import 2024-04-15 22:44:48 +08:00
linyuchen
637d32efff fix: calculate qq level 2024-04-15 22:44:29 +08:00
linyuchen
fd54658e53 todo: retry get groups if groups length is 0 2024-04-15 22:42:31 +08:00
linyuchen
2f39a8d76e refactor: rename extends api folder 2024-04-15 22:39:31 +08:00
linyuchen
6a3e793500 style: comment unused function 2024-04-15 22:39:06 +08:00
linyuchen
3b3ffeda6b script: gen version 2024-04-15 22:36:06 +08:00
linyuchen
f7d92a3b11 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	script/napcat.bat
2024-04-15 22:31:18 +08:00
linyuchen
d9d9ba8bf1 fix: Support Onebot v11 get_forward_msg 2024-04-15 17:39:18 +08:00
手瓜一十雪
f5d9090183 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2024-04-15 11:26:19 +08:00
手瓜一十雪
705ecd1ef1 fix:build 2024-04-15 11:26:11 +08:00
linyuchen
08b5266a86 Update README.md 2024-04-15 11:12:28 +08:00
linyuchen
ecc4846ba8 Update README.md 2024-04-15 11:11:51 +08:00
手瓜一十雪
4aab705d11 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2024-04-15 11:08:45 +08:00
手瓜一十雪
4615a68bcc style:lint 2024-04-15 11:08:31 +08:00
linyuchen
bf6934e8ac Update README.md 2024-04-15 10:55:23 +08:00
手瓜一十雪
af8c304bd4 fix:build workflow 2024-04-15 10:54:36 +08:00
手瓜一十雪
51dac5a5a8 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2024-04-15 10:53:04 +08:00
手瓜一十雪
56463d9e36 chore: issue 2024-04-15 10:52:41 +08:00
linyuchen
a6a339dc59 Update README.md 2024-04-15 10:52:34 +08:00
手瓜一十雪
8423304ab5 Merge branch 'main' of https://github.com/NapNeko/NapCatQQ 2024-04-15 10:48:26 +08:00
手瓜一十雪
bb7408dbe9 chore:workflow-build 2024-04-15 10:48:08 +08:00
linyuchen
7eff4dcf02 Update README.md 2024-04-15 10:44:31 +08:00
linyuchen
d7ee3fec3d Update README.md 2024-04-15 10:36:48 +08:00
手瓜一十雪
5e026a3e8d fix:update info&bat script 2024-04-15 10:32:54 +08:00
手瓜一十雪
d5e117b89f fix:re token 2024-04-15 08:19:15 +08:00
手瓜一十雪
c87a5501df feat:boot 2024-04-15 08:04:56 +08:00
手瓜一十雪
7584ebba0b feat:boot 2024-04-15 08:04:23 +08:00
手瓜一十雪
66075e3960 fix 2024-04-15 08:00:02 +08:00
linyuchen
193ba781a0 fix: readme syntax 2024-04-15 02:07:23 +08:00
linyuchen
3e5dd64acc Update README.md 2024-04-15 01:48:57 +08:00
linyuchen
d66ab7d389 chore: start bat 2024-04-15 01:38:46 +08:00
手瓜一十雪
d2e6b27ecd fix 2024-04-15 01:17:24 +08:00
手瓜一十雪
0588541357 fix 2024-04-15 01:11:29 +08:00
手瓜一十雪
096ea84af6 fix 2024-04-15 01:01:36 +08:00
手瓜一十雪
04d0cfd510 fix:build 2024-04-15 00:54:02 +08:00
手瓜一十雪
7653f969ec chore:workflow 2024-04-15 00:52:59 +08:00
linyuchen
c4ab6a4a8d Merge remote-tracking branch 'origin/main' 2024-04-15 00:28:55 +08:00
linyuchen
d1ecd1318f chore: version 1.0.0 2024-04-15 00:28:40 +08:00
手瓜一十雪
8d65b1427d chore:version 2024-04-15 00:28:22 +08:00
手瓜一十雪
e693a6057e chore:release 2024-04-15 00:22:46 +08:00
linyuchen
d0aa490ac3 chore: version 0.0.1 2024-04-15 00:17:39 +08:00
linyuchen
0b6cad7d4f doc: update README.md 2024-04-15 00:15:24 +08:00
linyuchen
14e6c6d9a6 NapCatQQ 2024-04-15 00:09:08 +08:00
手瓜一十雪
b2061347a5 chore: package.json 2024-04-14 21:05:10 +08:00
手瓜一十雪
79979f0a3b fix 2024-04-12 08:21:56 +08:00
linyuchen
48d70b2349 Update README.md 2024-04-10 16:49:51 +08:00
linyuchen
b1f6309662 Update README.md 2024-04-10 16:49:17 +08:00
linyuchen
1acde76292 logo png 2024-04-10 16:47:01 +08:00
linyuchen
3b4867d7ab logo 2024-04-10 16:43:06 +08:00
linyuchen
5ae965f4d3 Update README.md 2024-04-10 15:35:46 +08:00
linyuchen
742427b77b Update README.md 2024-04-10 15:08:38 +08:00
linyuchen
3d70a101f1 Update README.md 2024-04-10 15:01:19 +08:00
手瓜一十雪
99062a5ea3 fix 2024-04-09 23:45:01 +08:00
手瓜一十雪
056d87f7ae fix 2024-04-09 21:26:15 +08:00
手瓜一十雪
df5a58772c Create release.plain.yml 2024-04-09 21:24:44 +08:00
手瓜一十雪
e45db05b8e fix 2024-04-07 22:15:54 +08:00
手瓜一十雪
d234f74703 fix 2024-04-07 22:14:07 +08:00
手瓜一十雪
3ae2a1be4a chore:readme 2024-04-07 22:04:34 +08:00
linyuchen
2b828abd90 Update README.md 2024-03-29 20:45:11 +08:00
linyuchen
4b598b1575 Update README.md 2024-03-29 19:39:30 +08:00
228 changed files with 9065 additions and 10 deletions

21
.editorconfig Normal file
View File

@@ -0,0 +1,21 @@
# EditorConfig is awesome: https://EditorConfig.org
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
# Matches multiple files with brace expansion notation
# Set default charset
charset = utf-8
# 2 space indentation
[*.{cjs,mjs,js,jsx,ts,tsx,css,scss,sass,html,json}]
indent_style = space
indent_size = 2
# Unfortunately, EditorConfig doesn't support space configuration inside import braces directly.
# You'll need to rely on your linter/formatter like ESLint or Prettier for that.

1
.env.development Normal file
View File

@@ -0,0 +1 @@
VITE_BUILD_TYPE = Development

1
.env.production Normal file
View File

@@ -0,0 +1 @@
VITE_BUILD_TYPE = Production

67
.eslintrc.cjs Normal file
View File

@@ -0,0 +1,67 @@
module.exports = {
'env': {
'es2021': true,
'node': true
},
'ignorePatterns': ['src/core/', 'src/core.lib/'],
'extends': [
'eslint:recommended',
'plugin:@typescript-eslint/recommended'
],
'overrides': [
{
'env': {
'node': true
},
'files': [
'.eslintrc.{js,cjs}'
],
'parserOptions': {
'sourceType': 'script'
}
}
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 'latest',
'sourceType': 'module'
},
'plugins': [
'@typescript-eslint',
'import'
],
'settings': {
'import/parsers': {
'@typescript-eslint/parser': ['.ts']
},
'import/resolver': {
'typescript': {
'alwaysTryTypes': true
}
}
},
'rules': {
'indent': [
'error',
2
],
'linebreak-style': [
'error',
'unix'
],
'quotes': [
'error',
'single'
],
'semi': [
'error',
'always'
],
'no-unused-vars': 'off',
'no-async-promise-executor': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-var-requires': 'off',
'object-curly-spacing': ['error', 'always'],
}
};

81
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,81 @@
name: Bug 反馈
description: 报告可能的 NapCat 异常行为
title: '[BUG] '
labels: bug
body:
- type: markdown
attributes:
value: |
欢迎来到 NapCat 的 Issue Tracker请填写以下表格来提交 Bug。
在提交新的 Bug 反馈前,请确保您:
* 已经搜索了现有的 issues并且没有找到可以解决您问题的方法
* 不与现有的某一 issue 重复
- type: input
id: system-version
attributes:
label: 系统版本
description: 运行 QQNT 的系统版本
placeholder: Windows 10 Pro Workstation 22H2
validations:
required: true
- type: input
id: qqnt-version
attributes:
label: QQNT 版本
description: 可在 QQNT 的「关于」的设置页中找到
placeholder: 9.9.7-21804
validations:
required: true
- type: input
id: napcat-version
attributes:
label: NapCat 版本
description: 可在 LiteLoaderQQNT 的设置页或是 QQNT 的设置页侧栏中找到
placeholder: 1.0.0
validations:
required: true
- type: input
id: onebot-client-version
attributes:
label: OneBot 客户端
description: 连接至 NapCat 的客户端版本信息
placeholder: Overflow 2.16.0-2cf7991-SNAPSHOT
validations:
required: true
- type: textarea
id: what-happened
attributes:
label: 发生了什么?
description: 填写你认为的 NapCat 的不正常行为
validations:
required: true
- type: textarea
id: how-reproduce
attributes:
label: 如何复现
description: 填写应当如何操作才能触发这个不正常行为
placeholder: |
1. xxx
2. xxx
3. xxx
validations:
required: true
- type: textarea
id: what-expected
attributes:
label: 期望的结果?
description: 填写你认为 NapCat 应当执行的正常行为
validations:
required: true
- type: textarea
id: napcat-log
attributes:
label: NapCat 运行日志
description: 粘贴相关日志内容到此处
render: shell
- type: textarea
id: onebot-client-log
attributes:
label: OneBot 客户端运行日志
description: 粘贴 OneBot 客户端的相关日志内容到此处
render: shell

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "npm" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "daily"

71
.github/workflows/build.yml vendored Normal file
View File

@@ -0,0 +1,71 @@
name: "Build"
on:
push:
branches:
- main
permissions: write-all
jobs:
build-linux:
if: ${{ startsWith(github.event.head_commit.message, 'build:') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target_platform: [linux,darwin]
target_arch: [x64, arm64]
steps:
- name: Clone Main Repository
uses: actions/checkout@v4
with:
repository: 'NapNeko/NapCatQQ'
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Build NuCat Linux
run: |
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
npm run build:prod
cd dist
npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
cd ..
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
path: dist
build-win32:
if: ${{ startsWith(github.event.head_commit.message, 'build:') }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target_platform: [win32]
target_arch: [x64]
steps:
- name: Clone Main Repository
uses: actions/checkout@v4
with:
repository: 'NapNeko/NapCatQQ'
submodules: true
token: ${{ secrets.GITHUB_TOKEN }}
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Build NuCat Linux
run: |
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
npm run build:prod
cd dist
npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
cd ..
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
path: dist

130
.github/workflows/release.yml vendored Normal file
View File

@@ -0,0 +1,130 @@
name: "release"
on:
push:
tags:
- "v*"
permissions: write-all
jobs:
check-version:
runs-on: ubuntu-latest
steps:
- name: Clone Repository
uses: actions/checkout@v4
with:
ref: main
token: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Check Version
run: |
ls
node ./script/checkVersion.cjs
sh ./checkVersion.sh
build-linux:
needs: [check-version]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target_platform: [linux,darwin]
target_arch: [x64, arm64]
steps:
- name: Clone Main Repository
uses: actions/checkout@v4
with:
repository: 'NapNeko/NapCatQQ'
submodules: true
ref: main
token: ${{ secrets.NAPCAT_BUILD }}
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Build NuCat Linux
run: |
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
npm run build:prod
cd dist
npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
cd ..
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
path: dist
build-win32:
runs-on: ubuntu-latest
needs: [check-version]
strategy:
fail-fast: false
matrix:
target_platform: [win32]
target_arch: [x64]
steps:
- name: Clone Main Repository
uses: actions/checkout@v4
with:
repository: 'NapNeko/NapCatQQ'
submodules: true
ref: main
token: ${{ secrets.NAPCAT_BUILD }}
- name: Use Node.js 20.X
uses: actions/setup-node@v4
with:
node-version: 20.x
- name: Build NuCat Linux
run: |
npm i --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
npm run build:prod
cd dist
npm i --omit=dev --arch=${{ matrix.target_arch }} --platform=${{ matrix.target_platform }}
cd ..
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: NapCat.${{ matrix.target_platform }}.${{ matrix.target_arch }}
path: dist
release-napcat:
needs: [build-win32,build-linux]
runs-on: ubuntu-latest
steps:
- name: Download All Artifact
uses: actions/download-artifact@v4
- name: Compress subdirectories
run: |
for dir in */; do
base=$(basename "$dir")
zip -r "${base}.zip" "$dir"
done
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Create Release Draft and Upload Artifacts
uses: softprops/action-gh-release@v1
with:
name: NapCat V${{ env.VERSION }}
token: ${{ secrets.GITHUB_TOKEN }}
files: |
NapCat.win32.x64.zip
NapCat.linux.x64.zip
NapCat.linux.arm64.zip
# NapCat.darwin.x64.zip
# NapCat.darwin.arm64.zip
draft: true

17
.gitignore vendored Normal file
View File

@@ -0,0 +1,17 @@
# Logs
# Develop
node_modules/
package-lock.json
out/
dist/
src/core.lib/common/
# Editor
.vscode/*
!.vscode/extensions.json
.idea/*
# Build
*.db
checkVersion.sh

4
.gitmodules vendored Normal file
View File

@@ -0,0 +1,4 @@
[submodule "src/core"]
path = src/core
url = https://github.com/NapNeko/core.git
branch = master

21
LICENSE Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2024 NapCatQQ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

173
README.md
View File

@@ -1,14 +1,167 @@
# NapCatQQ
<div align="center">
<img src="https://socialify.git.ci/NapNeko/NapCatQQ/image?description=1&language=1&logo=https%3A%2F%2Fraw.githubusercontent.com%2FNapNeko%2FNapCatQQ%2Fmain%2Flogo.png&name=1&stargazers=1&theme=Auto" alt="NapCatQQ" width="640" height="320" />
</div>
## 介绍
## 项目介绍
## 下载与安装
前往release获取
NapCatQQ瞌睡猫QQ不准叫我NCQQ像睡着了一样在后台低占用运行的无头(没有界面)的NTQQ
## 使用与配置
参考文档
目前测试在 Windows 上表现优秀,最低可达只占用内存 **20M**左右
## 开源与安全
为了防止过于扩散与违规使用,未来 NapCat 发版都会不公布源码,在未来形势有所转变下可能会发布源码。
代码将进行混淆与插桩,请不要违法使用与宣传本项目。
由于 Linux 上的 QQ 图形依赖较多,会导致内存占用小高,大约 **100+M**,目前正在研究如何优化
具体占用会因人而异QQ 群、好友越多占用越高
## 下载
前往 Release 页面下载最新版本
## 启动
NapCat 是基于 官方NTQQ 实现的Bot框架因此先需要安装官方QQ**注意同个账号不能同时登录原版 QQ 和 NapCatQQ**
*如果没有安装 QQ 请往后翻查看安装方法*
修改 `config/onebot11.json`内容,并重名为 `onebot11_<你的QQ号>.json`,如`onebot11_1234567.json`
json 配置内容参数解释:
```json5
{
// 是否启用http服务, true为启动false为禁用如果启用可以通过http接口发送消息
"enableHttp": false,
// http服务端口
"httpPort": 3000,
// 是否启用正向websocket服务
"enableWs": false,
// 正向websocket服务端口
"wsPort": 3001,
// 是否启用反向websocket服务
"enableWsReverse": false,
// 反向websocket对接的地址, 如["ws://127.0.0.1:8080/onebot/v11/ws"]
"wsReverseUrls": [],
// 是否启用http上报服务
"enableHttpPost": false,
// http上报地址, 如["http://127.0.0.1:8080/onebot/v11/http"]
"httpPostUrls": [],
// 是否启用http心跳
"enableHttpHeart": false,
// http上报密钥可为空
"httpSecret": "",
// 消息上报格式array为消息组string为cq码字符串
"messagePostFormat": "array",
// 是否上报自己发送的消息
"reportSelfMessage": false,
// 是否开启调试模式开启后上报消息会携带一个raw字段为原始消息内容
"debug": false,
// 调用get_file接口时如果获取不到url则使用base64字段返回文件内容
"enableLocalFile2Url": true,
// ws心跳间隔单位毫秒
"heartInterval": 30000,
// access_token可以为空
"token": ""
}
```
### Windows 启动
运行`powershell ./napcat.ps1`, 或者 `napcat.bat`,如果出现乱码,可以尝试运行`napcat-utf8.ps1``napcat-utf8.bat`
*如果出现 powershell 运行不了,以管理员身份打开 powershell输入 `Set-ExecutionPolicy RemoteSigned`*
### Linux 启动
运行`napcat.sh`
## 使用无需扫码快速登录
前提是你已经成功登录过QQ可以加参数` -q <你的QQ>` 进行登录,如`napcat.sh -q 1234567`
## 安装
### Linux安装
#### 安装 Linux QQ(22741),已经安装了的可以跳过
目前还在研究怎么精简安装暂时只能安装官方QQ整体依赖
下载QQ
[deb x86版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_amd64_01.deb)
[deb arm版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_arm64_01.deb)
[rpm x86版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_x86_64_01.rpm)
[rpm arm版本](https://dldir1.qq.com/qqfile/qq/QQNT/Linux/QQ_3.2.7_240403_aarch64_01.rpm)
```bash
sudo apt install ./qq.deb
```
```bash
安装QQ的依赖
sudo apt install libgbm1 libasound2
```
### Windows 安装
#### 安装Windows QQ(22741),已经安装了的可以跳过
[Windows版本QQ下载](https://dldir1.qq.com/qqfile/qq/QQNT/Windows/QQ_9.9.9_240403_x64_01.exe)
### 编译安装 NapCat
**如果你是直接下载编译好的版本,可以跳过这一步**
准备环境 [node18.18](https://nodejs.org/download/release/v18.18.2/)
```
export NODE_ENV=production
npm install
```
## 常见问题
### 二维码无法扫描
NapCat 会自动保存二维码到目录,可以手动打开图片扫描
如果没有条件访问本地目录,可以将二维码解析的 url 复制到二维码生成网站上生成二维码然后手机QQ扫描
### 语音、视频发送失败
需要配置 ffmpeg将 ffmpeg 目录加入环境变量,如果仍未生效,可以修改 napcat 启动脚本加入 FFMPEG_PATH 变量指定到 ffmpeg
程序的完整路径
如 Windows 上修改 napcat.ps1在第一行加入
```powershell
$env:FFMPEG_PATH="d:\ffmpeg\bin\ffmpeg.exe"
```
### 出现 error code v2:-1 之类的提示
不用管,这是正常现象,是因为 QQ 本身的问题,不影响使用
## API 文档
参考 [LLOneBot](https://llonebot.github.io/zh-CN/develop/api) 的文档
<!--
QQ群545402644
-->
## 声明
* 请不要在无关地方宣传NapCatQQ本项目只是用于学习 node 相关知识,切勿用于违法用途
* NapCat 不会收集用户隐私信息,但是未来可能会为了更好的利于 NapCat 的优化会收集一些设备信息,如 cpu 架构,系统版本等
## 相关链接
[TG群](https://t.me/+nLZEnpne-pQ1OWFl)
## 鸣谢名单
[OpenShamrock]()
[Lagrange]()

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

65
package.json Normal file
View File

@@ -0,0 +1,65 @@
{
"name": "napcat",
"private": true,
"type": "module",
"version": "1.1.0",
"scripts": {
"watch:dev": "vite --mode development",
"watch:prod": "vite --mode production",
"build:dev": "vite build --mode development",
"build:prod": "vite build --mode production",
"build": "npm run build:dev",
"build:core": "cd ./src/core && vite build --mode production",
"watch": "npm run watch:dev",
"debug-win": "powershell dist/napcat.ps1",
"lint": "eslint --fix src/**/*.{js,ts}",
"release": "npm run build:prod",
"depend": "cd dist && npm install --omit=dev"
},
"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",
"@types/express": "^4.17.21",
"@types/figlet": "^1.5.8",
"@types/fluent-ffmpeg": "^2.1.24",
"@types/node": "^20.11.30",
"@types/qrcode-terminal": "^0.12.2",
"@types/uuid": "^9.0.8",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"eslint": "^8.57.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"i": "^0.3.7",
"javascript-obfuscator": "^4.1.0",
"protobufjs-cli": "^1.1.2",
"rollup": "^4.13.2",
"rollup-plugin-dts": "^6.1.0",
"rollup-plugin-obfuscator": "^1.1.0",
"typescript": "^5.3.3",
"vite": "^5.2.6",
"vite-plugin-cp": "^4.0.8",
"vite-plugin-dts": "^3.8.2",
"vite-tsconfig-paths": "^4.3.2"
},
"dependencies": {
"commander": "^12.0.0",
"cors": "^2.8.5",
"express": "^5.0.0-beta.2",
"file-type": "^19.0.0",
"fluent-ffmpeg": "^2.1.2",
"image-size": "^1.1.1",
"log4js": "^6.9.1",
"protobufjs": "^7.2.6",
"qrcode-terminal": "^0.12.0",
"silk-wasm": "^3.3.4",
"sqlite3": "^5.1.7",
"uuid": "^9.0.1",
"ws": "^8.16.0",
"yaml": "^2.4.1"
}
}

13
script/checkVersion.cjs Normal file
View File

@@ -0,0 +1,13 @@
let fs = require("fs");
let process = require("process")
console.log("[NapCat] [CheckVersion] 开始检测当前仓库版本...");
let currentVersion = require("../package.json").version;
let targetVersion = process.env.VERSION;
console.log("[NapCat] [CheckVersion] currentVersion:", currentVersion, " targetVersion:", targetVersion);
// fs.mkdirSync("./dist");
if (currentVersion === targetVersion) {
fs.writeFileSync("./checkVersion.sh", "#!/bin/bashe\necho \"CheckVersion Is Done\"")
} else {
let runscript = "sed -i 's/\"version\": \"" + currentVersion + "\"/\"version\": \"" + targetVersion + "\"/g' package.json";
fs.writeFileSync("./checkVersion.sh", "#!/bin/bashe\ngit config --global user.email \"bot@test.nanaeo.cn\"\n git config --global user.name \"Version\"\n" + runscript + "\ngit add .\n git commit -m \"chore:version change\"\n git push -u origin main")
}

15
script/debug-gc.ps1 Normal file
View File

@@ -0,0 +1,15 @@
function Get-QQpath {
try {
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
$uninstallString = $key.UninstallString
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
}
catch {
throw "Error getting UninstallString: $_"
}
}
$params = $args -join " "
$QQpath = Get-QQpath
$Bootfile = Join-Path (Get-Location) "\dist\inject.cjs"
$env:ELECTRON_RUN_AS_NODE = 1
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$QQpath' --expose-gc $Bootfile $params}"

21
script/gen-version.ts Normal file
View File

@@ -0,0 +1,21 @@
import fs from 'fs'
import path from 'path'
import { version } from '../src/onebot11/version'
const manifestPath = path.join(__dirname, '../package.json')
function readManifest (): any {
if (fs.existsSync(manifestPath)) {
return JSON.parse(fs.readFileSync(manifestPath, 'utf-8'))
}
}
function writeManifest (manifest: any) {
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2))
}
const manifest = readManifest()
if (version !== manifest.version) {
manifest.version = version
writeManifest(manifest)
}

3
script/napcat-custom.bat Normal file
View File

@@ -0,0 +1,3 @@
chcp 65001
set ELECTRON_RUN_AS_NODE=1
"H:\Program Files\QQNT最新版\QQ.exe" %~dp0/napcat.cjs %*

17
script/napcat-log.ps1 Normal file
View File

@@ -0,0 +1,17 @@
function Get-QQpath {
try {
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
$uninstallString = $key.UninstallString
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
}
catch {
return "D:\QQ.exe"
}
}
$params = $args -join " "
$QQpath = Get-QQpath
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
$env:ELECTRON_RUN_AS_NODE = 1
$argumentList = '-noexit', '-noprofile', "-command `"$QQpath`" `"$Bootfile`" $params"
Start-Process powershell -ArgumentList $argumentList -RedirectStandardOutput "log.txt" -RedirectStandardError "error.txt"
powershell Get-Content -Wait -Encoding UTF8 log.txt

18
script/napcat-utf8.bat Normal file
View File

@@ -0,0 +1,18 @@
@echo off
setlocal enabledelayedexpansion
chcp 65001
:loop_read
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
set "RetString=%%b"
goto :napcat_boot
)
:napcat_boot
for %%a in ("!RetString!") do (
set "pathWithoutUninstall=%%~dpa"
)
set "QQPath=!pathWithoutUninstall!QQ.exe"
set ELECTRON_RUN_AS_NODE=1
echo !QQPath!
"!QQPath!" ./napcat.cjs %*

15
script/napcat-utf8.ps1 Normal file
View File

@@ -0,0 +1,15 @@
function Get-QQpath {
try {
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
$uninstallString = $key.UninstallString
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
}
catch {
return "D:\QQ.exe"
}
}
$params = $args -join " "
$QQpath = Get-QQpath
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
$env:ELECTRON_RUN_AS_NODE = 1
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$QQpath' $Bootfile $params}"

17
script/napcat.bat Normal file
View File

@@ -0,0 +1,17 @@
@echo off
setlocal enabledelayedexpansion
:loop_read
for /f "tokens=2*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ" /v "UninstallString"') do (
set "RetString=%%b"
goto :napcat_boot
)
:napcat_boot
for %%a in ("!RetString!") do (
set "pathWithoutUninstall=%%~dpa"
)
set "QQPath=!pathWithoutUninstall!QQ.exe"
set ELECTRON_RUN_AS_NODE=1
echo !QQPath!
"!QQPath!" ./napcat.cjs %*

15
script/napcat.ps1 Normal file
View File

@@ -0,0 +1,15 @@
function Get-QQpath {
try {
$key = Get-ItemProperty -Path "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\QQ"
$uninstallString = $key.UninstallString
return [System.IO.Path]::GetDirectoryName($uninstallString) + "\QQ.exe"
}
catch {
return "D:\QQ.exe"
}
}
$params = $args -join " "
$QQpath = Get-QQpath
$Bootfile = Join-Path $PSScriptRoot "napcat.cjs"
$env:ELECTRON_RUN_AS_NODE = 1
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& '$QQpath' $Bootfile $params}"

4
script/napcat.sh Normal file
View File

@@ -0,0 +1,4 @@
#!/bin/bash
SCRIPT_DIR=$(realpath $(dirname "${BASH_SOURCE[0]}"))
export ELECTRON_RUN_AS_NODE=1
/opt/QQ/qq ${SCRIPT_DIR}/napcat.cjs $@

90
src/common/data.ts Normal file
View File

@@ -0,0 +1,90 @@
import {
type Friend,
type FriendRequest,
type Group,
type GroupMember, GroupNotify,
type SelfInfo
} from '@/core/qqnt/entities';
import { isNumeric } from './utils/helper';
import { log } from '@/common/utils/log';
export const selfInfo: SelfInfo = {
uid: '',
uin: '',
nick: '',
online: true
};
// groupCode -> Group
export const groups: Map<string, Group> = new Map<string, Group>();
export function deleteGroup(groupQQ: string) {
groups.delete(groupQQ);
groupMembers.delete(groupQQ);
}
// 群号 -> 群成员map(uid=>GroupMember)
export const groupMembers: Map<string, Map<string, GroupMember>> = new Map<string, Map<string, GroupMember>>();
// uid -> Friend
export const friends: Map<string, Friend> = new Map<string, Friend>();
export const friendRequests: Record<string, FriendRequest> = {}; // flag->FriendRequest
export const groupNotifies: Record<string, GroupNotify> = {}; // flag->GroupNotify
export const napCatError = {
ffmpegError: '',
httpServerError: '',
wsServerError: '',
otherError: 'NapCat未能正常启动请检查日志查看错误'
};
export async function getFriend(uinOrUid: string): Promise<Friend | undefined> {
uinOrUid = uinOrUid.toString();
if (isNumeric(uinOrUid)) {
const friendList = Array.from(friends.values());
return friendList.find(friend => friend.uin === uinOrUid);
} else {
return friends.get(uinOrUid);
}
}
export async function getGroup(qq: string): Promise<Group | undefined> {
const group = groups.get(qq.toString());
return group;
}
export async function getGroupMember(groupQQ: string | number, memberUinOrUid: string | number) {
groupQQ = groupQQ.toString();
memberUinOrUid = memberUinOrUid.toString();
const members = groupMembers.get(groupQQ);
if (!members) {
return null;
}
// log('getGroupMember', members);
if (isNumeric(memberUinOrUid)) {
return Array.from(members.values()).find(member => member.uin === memberUinOrUid);
} else {
return members.get(memberUinOrUid);
}
}
export async function refreshGroupMembers(groupQQ: string) {
// const group = groups.find(group => group.groupCode === groupQQ)
// if (group) {
// group.members = await NTQQGroupApi.getGroupMembers(groupQQ)
// }
}
export const uid2UinMap: Record<string, string> = {}; // 一串加密的字符串(uid) -> qq号
export function getUidByUin(uin: string) {
for (const uid in uid2UinMap) {
if (uid2UinMap[uid] === uin) {
return uid;
}
}
}
export const tempGroupCodeMap: Record<string, string> = {}; // peerUid => 群号

117
src/common/server/http.ts Normal file
View File

@@ -0,0 +1,117 @@
import express, { Express, Request, Response } from 'express';
import cors from 'cors';
import http from 'http';
import { log } from '../utils/log';
import { ob11Config } from '@/onebot11/config';
type RegisterHandler = (res: Response, payload: any) => Promise<any>
export abstract class HttpServerBase {
name: string = 'LLOneBot';
private readonly expressAPP: Express;
private server: http.Server | null = null;
constructor() {
this.expressAPP = express();
this.expressAPP.use(cors());
this.expressAPP.use(express.urlencoded({ extended: true, limit: '5000mb' }));
this.expressAPP.use((req, res, next) => {
// 兼容处理没有带content-type的请求
// log("req.headers['content-type']", req.headers['content-type'])
req.headers['content-type'] = 'application/json';
const originalJson = express.json({ limit: '5000mb' });
// 调用原始的express.json()处理器
originalJson(req, res, (err) => {
if (err) {
log('Error parsing JSON:', err);
return res.status(400).send('Invalid JSON');
}
next();
});
});
}
authorize(req: Request, res: Response, next: () => void) {
const serverToken = ob11Config.token;
let clientToken = '';
const authHeader = req.get('authorization');
if (authHeader) {
clientToken = authHeader.split('Bearer ').pop() || '';
log('receive http header token', clientToken);
} else if (req.query.access_token) {
if (Array.isArray(req.query.access_token)) {
clientToken = req.query.access_token[0].toString();
} else {
clientToken = req.query.access_token.toString();
}
log('receive http url token', clientToken);
}
if (serverToken && clientToken != serverToken) {
return res.status(403).send(JSON.stringify({ message: 'token verify failed!' }));
}
next();
}
start(port: number) {
try {
this.expressAPP.get('/', (req: Request, res: Response) => {
res.send(`${this.name}已启动`);
});
this.listen(port);
} catch (e: any) {
log('HTTP服务启动失败', e.toString());
// llonebotError.httpServerError = "HTTP服务启动失败, " + e.toString()
}
}
stop() {
// llonebotError.httpServerError = ""
if (this.server) {
this.server.close();
this.server = null;
}
}
restart(port: number) {
this.stop();
this.start(port);
}
abstract handleFailed(res: Response, payload: any, err: any): void
registerRouter(method: 'post' | 'get' | string, url: string, handler: RegisterHandler) {
if (!url.startsWith('/')) {
url = '/' + url;
}
// @ts-expect-error wait fix
if (!this.expressAPP[method]) {
const err = `${this.name} register router failed${method} not exist`;
log(err);
throw err;
}
// @ts-expect-error wait fix
this.expressAPP[method](url, this.authorize, async (req: Request, res: Response) => {
let payload = req.body;
if (method == 'get') {
payload = req.query;
} else if (req.query) {
payload = { ...req.query, ...req.body };
}
log('收到http请求', url, payload);
try {
res.send(await handler(res, payload));
} catch (e: any) {
this.handleFailed(res, payload, e.stack.toString());
}
});
}
protected listen(port: number) {
this.server = this.expressAPP.listen(port, '0.0.0.0', () => {
const info = `${this.name} started 0.0.0.0:${port}`;
log(info);
});
}
}

View File

@@ -0,0 +1,102 @@
import { WebSocket, WebSocketServer } from 'ws';
import urlParse from 'url';
import { IncomingMessage } from 'node:http';
import { log } from '@/common/utils/log';
class WebsocketClientBase {
private wsClient: WebSocket | undefined;
constructor() {
}
send(msg: string) {
if (this.wsClient && this.wsClient.readyState == WebSocket.OPEN) {
this.wsClient.send(msg);
}
}
onMessage(msg: string) {
}
}
export class WebsocketServerBase {
private ws: WebSocketServer | null = null;
public token: string = '';
constructor() {
}
start(port: number) {
try {
this.ws = new WebSocketServer({
port ,
maxPayload: 1024 * 1024 * 1024
});
} catch (e: any) {
throw Error('ws服务启动失败, ' + e.toString());
}
this.ws.on('connection', (wsClient, req) => {
const url: string = req.url!.split('?').shift() || '/';
this.authorize(wsClient, req);
this.onConnect(wsClient, url, req);
wsClient.on('message', async (msg) => {
this.onMessage(wsClient, url, msg.toString());
});
});
}
stop() {
this.ws && this.ws.close((err) => {
log('ws server close failed!', err);
});
this.ws = null;
}
restart(port: number) {
this.stop();
this.start(port);
}
authorize(wsClient: WebSocket, req: IncomingMessage) {
const url = req.url!.split('?').shift();
log('ws connect', url);
let clientToken: string = '';
const authHeader = req.headers['authorization'];
if (authHeader) {
clientToken = authHeader.split('Bearer ').pop() || '';
log('receive ws header token', clientToken);
} else {
const parsedUrl = urlParse.parse(req.url || '/', true);
const urlToken = parsedUrl.query.access_token;
if (urlToken) {
if (Array.isArray(urlToken)) {
clientToken = urlToken[0];
} else {
clientToken = urlToken;
}
log('receive ws url token', clientToken);
}
}
if (this.token && clientToken != this.token) {
this.authorizeFailed(wsClient);
return wsClient.close();
}
}
authorizeFailed(wsClient: WebSocket) {
}
onConnect(wsClient: WebSocket, url: string, req: IncomingMessage) {
}
onMessage(wsClient: WebSocket, url: string, msg: string) {
}
sendHeart() {
}
}

View File

@@ -0,0 +1,60 @@
import path from 'node:path';
import fs from 'node:fs';
import os from 'node:os';
import { systemPlatform } from '@/common/utils/system';
export const exePath = process.execPath;
export const pkgInfoPath = path.join(path.dirname(exePath), 'resources', 'app', 'package.json');
let configVersionInfoPath;
if (os.platform() !== 'linux') {
configVersionInfoPath = path.join(path.dirname(exePath), 'resources', 'app', 'versions', 'config.json');
} else {
const userPath = os.homedir();
const appDataPath = path.resolve(userPath, './.config/QQ');
configVersionInfoPath = path.resolve(appDataPath, './versions/config.json');
}
if (typeof configVersionInfoPath !== 'string') {
throw new Error('Something went wrong when load QQ info path');
}
export { configVersionInfoPath };
type QQPkgInfo = {
version: string;
buildVersion: string;
platform: string;
eleArch: string;
}
type QQVersionConfigInfo = {
baseVersion: string;
curVersion: string;
prevVersion: string;
onErrorVersions: Array<any>;
buildId: string;
}
let _qqVersionConfigInfo: QQVersionConfigInfo = {
'baseVersion': '9.9.9-22578',
'curVersion': '9.9.9-22578',
'prevVersion': '',
'onErrorVersions': [],
'buildId': '22578'
};
if (fs.existsSync(configVersionInfoPath)) {
_qqVersionConfigInfo = JSON.parse(fs.readFileSync(configVersionInfoPath).toString());
}
export const qqVersionConfigInfo: QQVersionConfigInfo = _qqVersionConfigInfo;
export const qqPkgInfo: QQPkgInfo = require(pkgInfoPath);
let _appid: string = '537213335'; // 默认为 Windows 平台的 appid
if (systemPlatform === 'linux') {
_appid = '537213710';
}
// todo: mac 平台的 appid
export const appid = _appid;

135
src/common/utils/audio.ts Normal file
View File

@@ -0,0 +1,135 @@
import fs from 'fs';
import { encode, getDuration, getWavFileInfo, isWav } from 'silk-wasm';
import fsPromise from 'fs/promises';
import { log } from './log';
import path from 'node:path';
import { v4 as uuidv4 } from 'uuid';
import { spawn } from 'node:child_process';
import { getTempDir } from '@/common/utils/file';
let TEMP_DIR = './';
setTimeout(() => {
TEMP_DIR = getTempDir();
}, 100);
export async function encodeSilk(filePath: string) {
function getFileHeader(filePath: string) {
// 定义要读取的字节数
const bytesToRead = 7;
try {
const buffer = fs.readFileSync(filePath, {
encoding: null,
flag: 'r',
});
const fileHeader = buffer.toString('hex', 0, bytesToRead);
return fileHeader;
} catch (err) {
console.error('读取文件错误:', err);
return;
}
}
async function isWavFile(filePath: string) {
return isWav(fs.readFileSync(filePath));
}
async function guessDuration(pttPath: string) {
const pttFileInfo = await fsPromise.stat(pttPath);
let duration = pttFileInfo.size / 1024 / 3; // 3kb/s
duration = Math.floor(duration);
duration = Math.max(1, duration);
log('通过文件大小估算语音的时长:', duration);
return duration;
}
// function verifyDuration(oriDuration: number, guessDuration: number) {
// // 单位都是秒
// if (oriDuration - guessDuration > 10) {
// return guessDuration
// }
// oriDuration = Math.max(1, oriDuration)
// return oriDuration
// }
// async function getAudioSampleRate(filePath: string) {
// try {
// const mm = await import('music-metadata');
// const metadata = await mm.parseFile(filePath);
// log(`${filePath}采样率`, metadata.format.sampleRate);
// return metadata.format.sampleRate;
// } catch (error) {
// log(`${filePath}采样率获取失败`, error.stack);
// // console.error(error);
// }
// }
try {
const pttPath = path.join(TEMP_DIR, uuidv4());
if (getFileHeader(filePath) !== '02232153494c4b') {
log(`语音文件${filePath}需要转换成silk`);
const _isWav = await isWavFile(filePath);
const pcmPath = pttPath + '.pcm';
let sampleRate = 0;
const convert = () => {
return new Promise<Buffer>((resolve, reject) => {
// todo: 通过配置文件获取ffmpeg路径
const ffmpegPath = process.env.FFMPEG_PATH || 'ffmpeg';
const cp = spawn(ffmpegPath, ['-y', '-i', filePath, '-ar', '24000', '-ac', '1', '-f', 's16le', pcmPath]);
cp.on('error', err => {
log('FFmpeg处理转换出错: ', err.message);
return reject(err);
});
cp.on('exit', (code, signal) => {
const EXIT_CODES = [0, 255];
if (code == null || EXIT_CODES.includes(code)) {
sampleRate = 24000;
const data = fs.readFileSync(pcmPath);
fs.unlink(pcmPath, (err) => {
});
return resolve(data);
}
log(`FFmpeg exit: code=${code ?? 'unknown'} sig=${signal ?? 'unknown'}`);
reject(Error('FFmpeg处理转换失败'));
});
});
};
let input: Buffer;
if (!_isWav) {
input = await convert();
} else {
input = fs.readFileSync(filePath);
const allowSampleRate = [8000, 12000, 16000, 24000, 32000, 44100, 48000];
const { fmt } = getWavFileInfo(input);
// log(`wav文件信息`, fmt)
if (!allowSampleRate.includes(fmt.sampleRate)) {
input = await convert();
}
}
const silk = await encode(input, sampleRate);
fs.writeFileSync(pttPath, silk.data);
log(`语音文件${filePath}转换成功!`, pttPath, '时长:', silk.duration);
return {
converted: true,
path: pttPath,
duration: silk.duration / 1000
};
} else {
const silk = fs.readFileSync(filePath);
let duration = 0;
try {
duration = getDuration(silk) / 1000;
} catch (e: any) {
log('获取语音文件时长失败, 使用文件大小推测时长', filePath, e.stack);
duration = await guessDuration(filePath);
}
return {
converted: false,
path: filePath,
duration,
};
}
} catch (error: any) {
log('convert silk failed', error.stack);
return {};
}
}

323
src/common/utils/db.ts Normal file
View File

@@ -0,0 +1,323 @@
import { ElementType, FileElement, PicElement, PttElement, RawMessage, VideoElement } from '@/core/qqnt/entities';
import sqlite3 from 'sqlite3';
import { log } from '@/common/utils/log';
type DBMsg = {
id: number,
longId: string,
seq: number,
peerUid: string,
msg: string
}
type DBFile = {
name: string; // 文件名
path: string;
url: string;
size: number;
uuid: string;
msgId: string;
elementId: string;
element: PicElement | VideoElement | FileElement | PttElement;
elementType: ElementType.PIC | ElementType.VIDEO | ElementType.FILE | ElementType.PTT;
}
class DBUtilBase {
protected db: sqlite3.Database | undefined;
createConnection(dbPath: string) {
if (this.db) {
return;
}
this.db = new sqlite3.Database(dbPath, sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, (err) => {
if (err) {
log('Could not connect to database', err);
return;
}
this.createTable();
});
}
protected createTable() {
throw new Error('Method not implemented.');
}
close() {
this.db?.close();
}
}
class DBUtil extends DBUtilBase {
private msgCache: Map<string, RawMessage> = new Map<string, RawMessage>();
constructor() {
super();
const interval = 1000 * 60 * 10; // 10分钟清理一次缓存
setInterval(() => {
log('清理消息缓存');
this.msgCache.forEach((msg, key) => {
if ((Date.now() - parseInt(msg.msgTime) * 1000) > interval) {
this.msgCache.delete(key);
}
});
}, interval);
}
protected createTable() {
// 消息记录
const createTableSQL = `
CREATE TABLE IF NOT EXISTS msgs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
long_id TEXT NOT NULL UNIQUE,
seq INTEGER NOT NULL,
peer_uid TEXT NOT NULL,
msg TEXT NOT NULL
)`;
this.db!.run(createTableSQL, function (err) {
if (err) {
log('Could not create table', err);
}
});
// 文件缓存
const createFileTableSQL = `
CREATE TABLE IF NOT EXISTS files (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
path TEXT NOT NULL,
url TEXT,
size INTEGER NOT NULL,
uuid TEXT,
elementType INTEGER,
element TEXT NOT NULL,
elementId TEXT NOT NULL,
msgId TEXT NOT NULL
)`;
this.db!.run(createFileTableSQL, function (err) {
if (err) {
log('Could not create table files', err);
}
});
// 接收到的临时会话消息uid
const createTempUinTableSQL = `
CREATE TABLE IF NOT EXISTS temp_uins (
id INTEGER PRIMARY KEY AUTOINCREMENT,
uid TEXT,
uin TEXT
)`;
this.db!.run(createTempUinTableSQL, function (err) {
if (err) {
log('Could not create table temp_uins', err);
}
});
}
private async getMsg(query: string, params: any[]) {
const stmt = this.db!.prepare(query);
return new Promise<RawMessage | null>((resolve, reject) => {
stmt.get(...params, (err: any, row: DBMsg) => {
// log("getMsg", row, err);
if (err) {
log('Could not get msg by short id', err);
resolve(null);
}
try {
const msg = JSON.parse(row.msg);
msg.id = row.id;
return resolve(msg);
} catch (e) {
return resolve(null);
}
});
});
}
async getMsgByShortId(shortId: number): Promise<RawMessage | null> {
const getStmt = 'SELECT * FROM msgs WHERE id = ?';
return this.getMsg(getStmt, [shortId]);
}
async getMsgByLongId(longId: string): Promise<RawMessage | null> {
if (this.msgCache.has(longId)) {
return this.msgCache.get(longId)!;
}
return this.getMsg('SELECT * FROM msgs WHERE long_id = ?', [longId]);
}
async getMsgBySeq(peerUid: string, seq: string): Promise<RawMessage | null> {
const stmt = 'SELECT * FROM msgs WHERE peer_uid = ? AND seq = ?';
return this.getMsg(stmt, [peerUid, seq]);
}
async addMsg(msg: RawMessage, update = true): Promise<number> {
log('正在记录消息到数据库', msg.msgId);
const existMsg = await this.getMsgByLongId(msg.msgId);
if (existMsg) {
// log('消息已存在,更新数据库', msg.msgId);
if (update) this.updateMsg(msg).then();
return existMsg.id!;
}
const stmt = this.db!.prepare('INSERT INTO msgs (long_id, seq, peer_uid, msg) VALUES (?, ?, ?, ?)');
// const runAsync = promisify(stmt.run.bind(stmt));
return new Promise((resolve, reject) => {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const dbInstance = this;
stmt.run(msg.msgId, msg.msgSeq, msg.peerUid, JSON.stringify(msg), function (err: any) {
if (err) {
if (err.errno === 19) {
// log('消息已存在,更新数据库', msg.msgId);
dbInstance.getMsgByLongId(msg.msgId).then((msg: RawMessage | null) => {
if (msg) {
dbInstance.msgCache.set(msg.msgId, msg);
// log('获取消息短id成功', msg.id);
resolve(msg.id!);
} else {
log('db could not get msg by long id', err);
resolve(-1);
}
});
} else {
log('db could not add msg', err);
resolve(-1);
}
} else {
// log("addMsg", this);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
msg.id = this.lastID;
dbInstance.msgCache.set(msg.msgId, msg);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// log('获取消息短id成功', this.lastID);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
resolve(this.lastID);
}
});
});
}
async updateMsg(msg: RawMessage) {
const existMsg = this.msgCache.get(msg.msgId);
if (existMsg) {
Object.assign(existMsg, msg);
}
const stmt = this.db!.prepare('UPDATE msgs SET msg = ?, seq = ? WHERE long_id = ?');
try {
stmt.run(JSON.stringify(msg), msg.msgSeq, msg.msgId);
} catch (e) {
log('updateMsg db error', e);
}
}
async addFileCache(file: DBFile) {
const stmt = this.db!.prepare('INSERT INTO files (name, path, url, size, uuid, elementType ,element, elementId, msgId) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)');
return new Promise((resolve, reject) => {
stmt.run(file.name, file.path, file.url, file.size, file.uuid,
file.elementType,
JSON.stringify(file.element),
file.elementId,
file.msgId,
function (err: any) {
if (err) {
log('db could not add file', err);
reject(err);
}
resolve(null);
});
});
}
private async getFileCache(query: string, params: any[]) {
const stmt = this.db!.prepare(query);
return new Promise<DBFile | null>((resolve, reject) => {
stmt.get(...params, (err: any, row: DBFile & { element: string }) => {
if (err) {
log('db could not get file cache', err);
reject(err);
}
if (row) {
row.element = JSON.parse(row.element);
}
resolve(row);
});
});
}
async getFileCacheByName(name: string): Promise<DBFile | null> {
return this.getFileCache('SELECT * FROM files WHERE name = ?', [name]);
}
async getFileCacheByUuid(uuid: string): Promise<DBFile | null> {
return this.getFileCache('SELECT * FROM files WHERE uuid = ?', [uuid]);
}
// todo: 是否所有的文件都有uuid语音消息有没有uuid
async updateFileCache(file: DBFile) {
const stmt = this.db!.prepare('UPDATE files SET path = ?, url = ? WHERE uuid = ?');
return new Promise((resolve, reject) => {
stmt.run(file.path, file.url, function (err: any) {
if (err) {
log('db could not update file cache', err);
reject(err);
}
resolve(null);
});
});
}
// 被动收到的临时会话消息uin->uid
async getReceivedTempUinMap() {
const stmt = 'SELECT * FROM temp_uins';
return new Promise<Record<string, string>>((resolve, reject) => {
this.db!.all(stmt, (err, rows: { uin: string, uid: string }[]) => {
if (err) {
log('db could not get temp uin map', err);
reject(err);
}
const map: Record<string, string> = {};
rows.forEach(row => {
map[row.uin] = row.uid;
});
resolve(map);
});
});
}
// 通过uin获取临时会话消息uid
async getUidByTempUin(uid: string) {
const stmt = 'SELECT * FROM temp_uins WHERE uin = ?';
return new Promise<string>((resolve, reject) => {
this.db!.get(stmt, [uid], (err, row: { uin: string, uid: string }) => {
if (err) {
log('db could not get temp uin map', err);
reject(err);
}
resolve(row?.uid);
});
});
}
async addTempUin(uin: string, uid: string) {
const existUid = await this.getUidByTempUin(uin);
if (!existUid) {
const stmt = this.db!.prepare('INSERT INTO temp_uins (uin, uid) VALUES (?, ?)');
return new Promise((resolve, reject) => {
stmt.run(uin, uid, function (err: any) {
if (err) {
log('db could not add temp uin', err);
reject(err);
}
resolve(null);
});
});
}
}
}
export const dbUtil = new DBUtil();

272
src/common/utils/file.ts Normal file
View File

@@ -0,0 +1,272 @@
import fs from 'fs';
import fsPromise from 'fs/promises';
import crypto from 'crypto';
import util from 'util';
import path from 'node:path';
import { log } from './log';
import { dbUtil } from './db';
import * as fileType from 'file-type';
import { v4 as uuidv4 } from 'uuid';
import { napCatCore } from '@/core';
export const getNapCatDir = () => {
const p = path.join(napCatCore.wrapper.dataPath, 'NapCat');
fs.mkdirSync(p, { recursive: true });
return p;
};
export const getTempDir = () => {
const p = path.join(getNapCatDir(), 'temp');
// 创建临时目录
if (!fs.existsSync(p)) {
fs.mkdirSync(p, { recursive: true });
}
return p;
};
export function isGIF(path: string) {
const buffer = Buffer.alloc(4);
const fd = fs.openSync(path, 'r');
fs.readSync(fd, buffer, 0, 4, 0);
fs.closeSync(fd);
return buffer.toString() === 'GIF8';
}
// 定义一个异步函数来检查文件是否存在
export function checkFileReceived(path: string, timeout: number = 3000): Promise<void> {
return new Promise((resolve, reject) => {
const startTime = Date.now();
function check() {
if (fs.existsSync(path)) {
resolve();
} else if (Date.now() - startTime > timeout) {
reject(new Error(`文件不存在: ${path}`));
} else {
setTimeout(check, 100);
}
}
check();
});
}
export async function file2base64(path: string) {
const readFile = util.promisify(fs.readFile);
const result = {
err: '',
data: ''
};
try {
// 读取文件内容
// if (!fs.existsSync(path)){
// path = path.replace("\\Ori\\", "\\Thumb\\");
// }
try {
await checkFileReceived(path, 5000);
} catch (e: any) {
result.err = e.toString();
return result;
}
const data = await readFile(path);
// 转换为Base64编码
result.data = data.toString('base64');
} catch (err: any) {
result.err = err.toString();
}
return result;
}
export function calculateFileMD5(filePath: string): Promise<string> {
return new Promise((resolve, reject) => {
// 创建一个流式读取器
const stream = fs.createReadStream(filePath);
const hash = crypto.createHash('md5');
stream.on('data', (data: Buffer) => {
// 当读取到数据时,更新哈希对象的状态
hash.update(data);
});
stream.on('end', () => {
// 文件读取完成,计算哈希
const md5 = hash.digest('hex');
resolve(md5);
});
stream.on('error', (err: Error) => {
// 处理可能的读取错误
reject(err);
});
});
}
export interface HttpDownloadOptions {
url: string;
headers?: Record<string, string> | string;
}
export async function httpDownload(options: string | HttpDownloadOptions): Promise<Buffer> {
const chunks: Buffer[] = [];
let url: string;
let headers: Record<string, string> = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36'
};
if (typeof options === 'string') {
url = options;
} else {
url = options.url;
if (options.headers) {
if (typeof options.headers === 'string') {
headers = JSON.parse(options.headers);
} else {
headers = options.headers;
}
}
}
const fetchRes = await fetch(url, headers);
if (!fetchRes.ok) throw new Error(`下载文件失败: ${fetchRes.statusText}`);
const blob = await fetchRes.blob();
const buffer = await blob.arrayBuffer();
return Buffer.from(buffer);
}
type Uri2LocalRes = {
success: boolean,
errMsg: string,
fileName: string,
ext: string,
path: string,
isLocal: boolean
}
export async function uri2local(uri: string, fileName: string | null = null): Promise<Uri2LocalRes> {
const res = {
success: false,
errMsg: '',
fileName: '',
ext: '',
path: '',
isLocal: false
};
if (!fileName) {
fileName = uuidv4();
}
let filePath = path.join(getTempDir(), fileName);
let url = null;
try {
url = new URL(uri);
} catch (e: any) {
res.errMsg = `uri ${uri} 解析失败,` + e.toString() + ` 可能${uri}不存在`;
return res;
}
// log("uri protocol", url.protocol, uri);
if (url.protocol == 'base64:') {
// base64转成文件
const base64Data = uri.split('base64://')[1];
try {
const buffer = Buffer.from(base64Data, 'base64');
fs.writeFileSync(filePath, buffer);
} catch (e: any) {
res.errMsg = 'base64文件下载失败,' + e.toString();
return res;
}
} else if (url.protocol == 'http:' || url.protocol == 'https:') {
// 下载文件
let buffer: Buffer | null = null;
try {
buffer = await httpDownload(uri);
} catch (e: any) {
res.errMsg = `${url}下载失败,` + e.toString();
return res;
}
try {
const pathInfo = path.parse(decodeURIComponent(url.pathname));
if (pathInfo.name) {
fileName = pathInfo.name;
if (pathInfo.ext) {
fileName += pathInfo.ext;
// res.ext = pathInfo.ext
}
}
res.fileName = fileName;
filePath = path.join(getTempDir(), uuidv4() + fileName);
fs.writeFileSync(filePath, buffer);
} catch (e: any) {
res.errMsg = `${url}下载失败,` + e.toString();
return res;
}
} else {
let pathname: string;
if (url.protocol === 'file:') {
// await fs.copyFile(url.pathname, filePath);
pathname = decodeURIComponent(url.pathname);
if (process.platform === 'win32') {
filePath = pathname.slice(1);
} else {
filePath = pathname;
}
} else {
const cache = await dbUtil.getFileCacheByName(uri);
if (cache) {
filePath = cache.path;
} else {
filePath = uri;
}
}
res.isLocal = true;
}
// else{
// res.errMsg = `不支持的file协议,` + url.protocol
// return res
// }
// if (isGIF(filePath) && !res.isLocal) {
// await fs.rename(filePath, filePath + ".gif");
// filePath += ".gif";
// }
if (!res.isLocal && !res.ext) {
try {
const ext: string | undefined = (await fileType.fileTypeFromFile(filePath))?.ext;
if (ext) {
log('获取文件类型', ext, filePath);
fs.renameSync(filePath, filePath + `.${ext}`);
filePath += `.${ext}`;
res.fileName += `.${ext}`;
res.ext = ext;
}
} catch (e) {
// log("获取文件类型失败", filePath,e.stack)
}
}
res.success = true;
res.path = filePath;
return res;
}
export async function copyFolder(sourcePath: string, destPath: string) {
try {
const entries = await fsPromise.readdir(sourcePath, { withFileTypes: true });
await fsPromise.mkdir(destPath, { recursive: true });
for (const entry of entries) {
const srcPath = path.join(sourcePath, entry.name);
const dstPath = path.join(destPath, entry.name);
if (entry.isDirectory()) {
await copyFolder(srcPath, dstPath);
} else {
try {
await fsPromise.copyFile(srcPath, dstPath);
} catch (error) {
console.error(`无法复制文件 '${srcPath}' 到 '${dstPath}': ${error}`);
// 这里可以决定是否要继续复制其他文件
}
}
}
} catch (error) {
console.error('复制文件夹时出错:', error);
}
}

View File

@@ -0,0 +1,20 @@
import crypto from 'node:crypto';
export function sleep(ms: number): Promise<void> {
return new Promise(resolve => setTimeout(resolve, ms));
}
export function getMd5(s: string) {
const h = crypto.createHash('md5');
h.update(s);
return h.digest('hex');
}
export function isNull(value: any) {
return value === undefined || value === null;
}
export function isNumeric(str: string) {
return /^\d+$/.test(str);
}

4
src/common/utils/log.ts Normal file
View File

@@ -0,0 +1,4 @@
export function log(...args: any[]) {
console.log(...args);
}

View File

@@ -0,0 +1,7 @@
// QQ等级换算
import { QQLevel } from '@/core/qqnt/entities';
export function calcQQLevel(level: QQLevel) {
const { crownNum, sunNum, moonNum, starNum } = level;
return crownNum * 64 + sunNum * 16 + moonNum * 4 + starNum;
}

View File

@@ -0,0 +1,9 @@
import os from 'node:os';
import path from 'node:path';
export const systemPlatform = os.platform();
export const systemVersion = os.release();
export const hostname = os.hostname();
const homeDir = os.homedir();
export const downloadsPath = path.join(homeDir, 'Downloads');
export const systemName = os.type();

44
src/common/utils/umami.ts Normal file
View File

@@ -0,0 +1,44 @@
import { request } from 'https';
export function postLoginStatus() {
const req = request(
{
hostname: 'napcat.wumiao.wang',
path: '/api/send',
port: 443,
method: 'POST',
headers: {
'Content-Type': 'application/json',
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0'
}
},
(res) => {
//let data = '';
res.on('data', (chunk) => {
//data += chunk;
});
res.on('error', (err) => {
});
res.on('end', () => {
//console.log('Response:', data);
});
}
);
req.on('error', (e) => {
// console.error('Request error:', e);
});
const StatesData = {
type: 'event',
payload: {
'website': '952bf82f-8f49-4456-aec5-e17db5f27f7e',
'hostname': 'napcat.demo.cn',
'screen': '1920x1080',
'language': 'zh-CN',
'title': 'OneBot.Login',
'url': '/login/onebot11',
'referrer': 'https://napcat.demo.cn/login?type=onebot11'
}
};
req.write(JSON.stringify(StatesData));
req.end();
}

View File

@@ -0,0 +1,44 @@
import { get as httpsGet } from 'node:https';
function requestMirror(url: string): Promise<string | undefined> {
return new Promise((resolve, reject) => {
httpsGet(url, (response) => {
let data = '';
response.on('data', (chunk) => {
data += chunk;
});
response.on('end', () => {
try {
const parsedData = JSON.parse(data);
const version = parsedData.version;
resolve(version);
} catch (error) {
// 解析失败或无法访问域名,跳过
resolve(undefined);
}
});
}).on('error', (error) => {
// 请求失败,跳过
resolve(undefined);
});
});
}
export async function checkVersion(): Promise<string> {
return new Promise(async (resolve, reject) => {
const MirrorList =
[
'https://fastly.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json',
'https://gcore.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json',
'https://cdn.jsdelivr.us/gh/NapNeko/NapCatQQ@main/package.json',
'https://jsd.cdn.zzko.cn/gh/NapNeko/NapCatQQ@main/package.json'
];
for (const url of MirrorList) {
const version = await requestMirror(url);
if (version) {
resolve(version);
}
}
reject('get verison error!');
});
}

88
src/common/utils/video.ts Normal file

File diff suppressed because one or more lines are too long

1
src/core Submodule

Submodule src/core added at 5aecf12000

22
src/core.lib/package.json Normal file
View File

@@ -0,0 +1,22 @@
{
"name": "@napneko/core",
"version": "1.0.0",
"description": "",
"type": "module",
"main": "./index.js",
"files": [
"lib"
],
"scripts": {
"lint": "eslint --fix ./src/**/*.ts",
"build:dev": "vite build --mode development",
"build:prod": "vite build --mode production",
"build": "npm run build:dev"
},
"author": "NapNeko",
"license": "MIT",
"bugs": {
"url": "https://github.com/NapNeko/NapCatQQ/issues"
},
"homepage": "https://github.com/NapNeko/NapCatQQ#readme"
}

27
src/core.lib/src/index.d.ts vendored Normal file
View File

@@ -0,0 +1,27 @@
/// <reference types="node" />
import { GlobalAdapter } from './qqnt/adapters';
import { QRCodeLoginSucceedType } from './qqnt/services';
import { NapCatCoreWrapper } from './wrapper';
import { NapCatCoreLogin } from './login';
import { NapCatCoreSession } from './session';
import { NapCatCoreService } from './service';
import { EventEmitter } from 'node:events';
import * as log4js from '@log4js-node/log4js-api';
export interface LoginSuccessCallback {
(): void | Promise<void>;
}
export declare class NapCatCore extends EventEmitter {
readonly log: log4js.Logger;
readonly adapter: GlobalAdapter;
readonly wrapper: NapCatCoreWrapper;
readonly login: NapCatCoreLogin;
readonly session: NapCatCoreSession;
readonly service: NapCatCoreService;
private loginSuccessCbList;
constructor();
initPostLogin(args: QRCodeLoginSucceedType): Promise<void>;
private onLoginSuccess;
private onMessage;
addLoginSuccessCallback(cb: LoginSuccessCallback): void;
}
export declare const napCatCore: NapCatCore;

File diff suppressed because one or more lines are too long

48
src/core.lib/src/login.d.ts vendored Normal file
View File

@@ -0,0 +1,48 @@
import { LoginListener } from './qqnt/listeners';
import { LoginInitConfig, NodeIKernelLoginService } from './qqnt/services';
import { NapCatCore } from '.';
/**
* NapCat 登录相关核心类
*
* **【注意】**:只有在调用 `init` 方法后才会被真正初始化!
*/
export declare class NapCatCoreLogin {
readonly core: NapCatCore;
readonly service: NodeIKernelLoginService;
readonly listener: LoginListener;
constructor(core: NapCatCore);
/**
* 初始化 `NodeIKernelLoginService`
* @param {LoginInitConfig} config `NodeIKernelLoginService` 初始化配置
* @returns {void}
*/
init(config: LoginInitConfig): void;
/**
* 初始化监听器,用于向父级 `NapCatCore` 发送事件
*/
private initListener;
/**
* 获取在此客户端上登录过的账号列表
* @returns {Promise<{ result: number, LocalLoginInfoList: LoginListItem[] }>}
*/
private getLoginList;
/**
* 使用二维码方式登录账号,获取到的二维码链接可通过 `system.login.qrcode` 事件获取。
*/
qrcode(): Promise<void>;
/**
* 使用快速登录方式登录账号,欲登录的账号必须在此客户端上登录过
* @param {string} uin 欲登录账户的 Uin
* @returns {Promise<void>}
*/
quick(uin: string): Promise<void>;
/**
* 使用账号密码方式登录,需要滑块验证会发送 `system.login.slider` 事件,登录错误会发送 `system.login.error` 事件。
* @param {string} uin 登录账号
* @param {string} password 登录密码
* @param {string} [proofSig] 验证码返回的 ticket
* @param {string} [proofRand] 验证码返回的随机字符串值
* @param {string} [proofSid] 验证码的 sid
*/
password(uin: string, password: string, proofSig?: string, proofRand?: string, proofSid?: string): Promise<void>;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,14 @@
interface IDependsAdapter {
onMSFStatusChange(args: unknown): void;
onMSFSsoError(args: unknown): void;
getGroupCode(args: unknown): void;
}
export interface NodeIDependsAdapter extends IDependsAdapter {
new (adapter: IDependsAdapter): NodeIDependsAdapter;
}
export declare class DependsAdapter implements IDependsAdapter {
onMSFStatusChange(args: unknown): void;
onMSFSsoError(args: unknown): void;
getGroupCode(args: unknown): void;
}
export {};

View File

@@ -0,0 +1 @@
function _0xf120(_0xb970ba,_0xf7d893){var _0x4f9c7e=_0x4f9c();return _0xf120=function(_0xf12079,_0x131120){_0xf12079=_0xf12079-0xc6;var _0x3ddf5a=_0x4f9c7e[_0xf12079];return _0x3ddf5a;},_0xf120(_0xb970ba,_0xf7d893);}function _0x4f9c(){var _0x3d6dfa=['25760410sccxYa','6078224aJOjSq','6608637GGRCHx','30WjSudP','1263184GdIuXA','7jJbzkS','692352hUSolA','45928jbuIps','39RTDEhx','307669SAAUvZ'];_0x4f9c=function(){return _0x3d6dfa;};return _0x4f9c();}(function(_0x2d8616,_0x3a0482){var _0xf9b7aa=_0xf120,_0x189e1a=_0x2d8616();while(!![]){try{var _0x4e7d5b=parseInt(_0xf9b7aa(0xc8))/0x1+parseInt(_0xf9b7aa(0xcd))/0x2+-parseInt(_0xf9b7aa(0xc7))/0x3*(parseInt(_0xf9b7aa(0xc6))/0x4)+parseInt(_0xf9b7aa(0xcc))/0x5*(parseInt(_0xf9b7aa(0xcf))/0x6)+-parseInt(_0xf9b7aa(0xce))/0x7*(-parseInt(_0xf9b7aa(0xca))/0x8)+parseInt(_0xf9b7aa(0xcb))/0x9+-parseInt(_0xf9b7aa(0xc9))/0xa;if(_0x4e7d5b===_0x3a0482)break;else _0x189e1a['push'](_0x189e1a['shift']());}catch(_0x309c1d){_0x189e1a['push'](_0x189e1a['shift']());}}}(_0x4f9c,0x61bf9));export class DependsAdapter{['onMSFStatusChange'](_0x2f8187){}['onMSFSsoError'](_0x576690){}['getGroupCode'](_0x3bae35){}}

View File

@@ -0,0 +1,14 @@
interface IDispatcherAdapter {
dispatchRequest(arg: unknown): void;
dispatchCall(arg: unknown): void;
dispatchCallWithJson(arg: unknown): void;
}
export interface NodeIDispatcherAdapter extends IDispatcherAdapter {
new (adapter: IDispatcherAdapter): NodeIDispatcherAdapter;
}
export declare class DispatcherAdapter implements IDispatcherAdapter {
dispatchRequest(arg: unknown): void;
dispatchCall(arg: unknown): void;
dispatchCallWithJson(arg: unknown): void;
}
export {};

View File

@@ -0,0 +1 @@
var _0x5727b9=_0x2df7;function _0x2df7(_0x3971d8,_0x4c585e){var _0x4305f0=_0x4305();return _0x2df7=function(_0x2df780,_0x2fb009){_0x2df780=_0x2df780-0x19f;var _0x53e652=_0x4305f0[_0x2df780];return _0x53e652;},_0x2df7(_0x3971d8,_0x4c585e);}function _0x4305(){var _0x6cc688=['6488664ifSUlU','4178262LHiEOG','2nksJLr','8271480HkXfar','102498wlqXHm','12040029SSuaKe','3539620lzrEJI','dispatchCallWithJson','355yQEArS','995282mYiXUB'];_0x4305=function(){return _0x6cc688;};return _0x4305();}(function(_0x467d0a,_0x503a75){var _0x4d4195=_0x2df7,_0x3f2080=_0x467d0a();while(!![]){try{var _0x1922e8=-parseInt(_0x4d4195(0x19f))/0x1*(-parseInt(_0x4d4195(0x1a2))/0x2)+-parseInt(_0x4d4195(0x1a1))/0x3+parseInt(_0x4d4195(0x1a6))/0x4+-parseInt(_0x4d4195(0x1a8))/0x5*(-parseInt(_0x4d4195(0x1a4))/0x6)+parseInt(_0x4d4195(0x1a3))/0x7+-parseInt(_0x4d4195(0x1a0))/0x8+-parseInt(_0x4d4195(0x1a5))/0x9;if(_0x1922e8===_0x503a75)break;else _0x3f2080['push'](_0x3f2080['shift']());}catch(_0x364f26){_0x3f2080['push'](_0x3f2080['shift']());}}}(_0x4305,0xb2fae));export class DispatcherAdapter{['dispatchRequest'](_0x310115){}['dispatchCall'](_0x175ade){}[_0x5727b9(0x1a7)](_0x2773d9){}}

View File

@@ -0,0 +1,24 @@
interface IGlobalAdapter {
onLog(...args: unknown[]): void;
onGetSrvCalTime(...args: unknown[]): void;
onShowErrUITips(...args: unknown[]): void;
fixPicImgType(...args: unknown[]): void;
getAppSetting(...args: unknown[]): void;
onInstallFinished(...args: unknown[]): void;
onUpdateGeneralFlag(...args: unknown[]): void;
onGetOfflineMsg(...args: unknown[]): void;
}
export interface NodeIGlobalAdapter extends IGlobalAdapter {
new (adapter: IGlobalAdapter): NodeIGlobalAdapter;
}
export declare class GlobalAdapter implements IGlobalAdapter {
onLog(...args: unknown[]): void;
onGetSrvCalTime(...args: unknown[]): void;
onShowErrUITips(...args: unknown[]): void;
fixPicImgType(...args: unknown[]): void;
getAppSetting(...args: unknown[]): void;
onInstallFinished(...args: unknown[]): void;
onUpdateGeneralFlag(...args: unknown[]): void;
onGetOfflineMsg(...args: unknown[]): void;
}
export {};

View File

@@ -0,0 +1 @@
function _0x2f88(_0x1eba24,_0x5ef2fd){var _0x352bbc=_0x352b();return _0x2f88=function(_0x2f8861,_0x28226b){_0x2f8861=_0x2f8861-0xba;var _0x360fea=_0x352bbc[_0x2f8861];return _0x360fea;},_0x2f88(_0x1eba24,_0x5ef2fd);}var _0x1829c2=_0x2f88;(function(_0x104ed5,_0x2d7c97){var _0x4ca004=_0x2f88,_0x36426e=_0x104ed5();while(!![]){try{var _0x38918e=-parseInt(_0x4ca004(0xc2))/0x1+-parseInt(_0x4ca004(0xc8))/0x2*(-parseInt(_0x4ca004(0xca))/0x3)+-parseInt(_0x4ca004(0xc9))/0x4+-parseInt(_0x4ca004(0xc5))/0x5*(-parseInt(_0x4ca004(0xcb))/0x6)+-parseInt(_0x4ca004(0xc4))/0x7*(-parseInt(_0x4ca004(0xbd))/0x8)+parseInt(_0x4ca004(0xbf))/0x9+parseInt(_0x4ca004(0xbb))/0xa*(-parseInt(_0x4ca004(0xbe))/0xb);if(_0x38918e===_0x2d7c97)break;else _0x36426e['push'](_0x36426e['shift']());}catch(_0x506caa){_0x36426e['push'](_0x36426e['shift']());}}}(_0x352b,0xa7ce0));export class GlobalAdapter{[_0x1829c2(0xc0)](..._0x36b0eb){}[_0x1829c2(0xba)](..._0x59de75){}[_0x1829c2(0xc1)](..._0x1b006c){}['fixPicImgType'](..._0xec6527){}[_0x1829c2(0xbc)](..._0x11ca5b){}[_0x1829c2(0xc7)](..._0x1c4a6f){}[_0x1829c2(0xc6)](..._0x3eb04a){}[_0x1829c2(0xc3)](..._0x144190){}}function _0x352b(){var _0x158f1c=['onUpdateGeneralFlag','onInstallFinished','2eRLDVa','5263128qtWkCV','1499370RbKusH','1164UwpnmO','onGetSrvCalTime','8110010wrCpUj','getAppSetting','4856lpyxQN','11wbemXL','11831211GEkruI','onLog','onShowErrUITips','374095AStjyy','onGetOfflineMsg','7259LZzDYB','19185UKFTEW'];_0x352b=function(){return _0x158f1c;};return _0x352b();}

View File

@@ -0,0 +1,3 @@
export * from './NodeIDependsAdapter';
export * from './NodeIDispatcherAdapter';
export * from './NodeIGlobalAdapter';

View File

@@ -0,0 +1 @@
(function(_0x2c82f1,_0x15a7f9){var _0x1f4fc5=_0x552e,_0x120ca7=_0x2c82f1();while(!![]){try{var _0x4c6d1c=parseInt(_0x1f4fc5(0x15c))/0x1+-parseInt(_0x1f4fc5(0x15e))/0x2*(-parseInt(_0x1f4fc5(0x162))/0x3)+parseInt(_0x1f4fc5(0x15b))/0x4*(parseInt(_0x1f4fc5(0x161))/0x5)+parseInt(_0x1f4fc5(0x164))/0x6+parseInt(_0x1f4fc5(0x163))/0x7*(parseInt(_0x1f4fc5(0x15f))/0x8)+-parseInt(_0x1f4fc5(0x160))/0x9+parseInt(_0x1f4fc5(0x165))/0xa*(-parseInt(_0x1f4fc5(0x15d))/0xb);if(_0x4c6d1c===_0x15a7f9)break;else _0x120ca7['push'](_0x120ca7['shift']());}catch(_0x3aefd3){_0x120ca7['push'](_0x120ca7['shift']());}}}(_0xd80b,0x20563));export*from'./NodeIDependsAdapter';export*from'./NodeIDispatcherAdapter';function _0x552e(_0x39eb72,_0x4dbf66){var _0xd80bdc=_0xd80b();return _0x552e=function(_0x552ee6,_0x13fdea){_0x552ee6=_0x552ee6-0x15b;var _0x3a61fe=_0xd80bdc[_0x552ee6];return _0x3a61fe;},_0x552e(_0x39eb72,_0x4dbf66);}export*from'./NodeIGlobalAdapter';function _0xd80b(){var _0x1bbbcb=['6fGUKmf','16WwftsI','1932201moPtem','107665lzVkdY','44268zTNceZ','823004HAclpT','369624MwMTRi','34250lRnGss','24RIiZmT','185176eqCtHc','990mKKIXr'];_0xd80b=function(){return _0x1bbbcb;};return _0xd80b();}

17
src/core.lib/src/qqnt/apis/file.d.ts vendored Normal file
View File

@@ -0,0 +1,17 @@
import { ChatType, ElementType } from '@/core/qqnt/entities';
import * as fileType from 'file-type';
import { ISizeCalculationResult } from 'image-size/dist/types/interface';
export declare class NTQQFileApi {
static getFileType(filePath: string): Promise<fileType.FileTypeResult | undefined>;
static copyFile(filePath: string, destPath: string): Promise<void>;
static getFileSize(filePath: string): Promise<number>;
static uploadFile(filePath: string, elementType?: ElementType, elementSubType?: number): Promise<{
md5: string;
fileName: string;
path: string;
fileSize: number;
ext: string;
}>;
static downloadMedia(msgId: string, chatType: ChatType, peerUid: string, elementId: string, thumbPath: string, sourcePath: string, timeout?: number): Promise<string>;
static getImageSize(filePath: string): Promise<ISizeCalculationResult | undefined>;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,5 @@
import { FriendRequest } from '@/core/qqnt/entities';
export declare class NTQQFriendApi {
static getFriends(forced?: boolean): Promise<void>;
static handleFriendRequest(request: FriendRequest, accept: boolean): Promise<void>;
}

View File

@@ -0,0 +1 @@
var _0x4ca1de=_0x34f9;(function(_0x7e0c07,_0x5cdc7e){var _0x2f2028=_0x34f9,_0x2ff538=_0x7e0c07();while(!![]){try{var _0x4c7b75=parseInt(_0x2f2028(0x1f4))/0x1+parseInt(_0x2f2028(0x1f2))/0x2+-parseInt(_0x2f2028(0x1ec))/0x3+parseInt(_0x2f2028(0x1f3))/0x4+parseInt(_0x2f2028(0x1f1))/0x5+parseInt(_0x2f2028(0x1ef))/0x6*(-parseInt(_0x2f2028(0x1ee))/0x7)+parseInt(_0x2f2028(0x1f6))/0x8;if(_0x4c7b75===_0x5cdc7e)break;else _0x2ff538['push'](_0x2ff538['shift']());}catch(_0x1968c1){_0x2ff538['push'](_0x2ff538['shift']());}}}(_0x32d1,0x3da68));function _0x32d1(){var _0x1cec81=['handleFriendRequest','4328576FDzCwc','kernelService','getFriends','buddy','924384dnjOwy','friendUid','30961wRVdVP','588WckXXN','approvalFriendRequest','1027420spUryZ','125202pRSscv','632696Ehvzus','26771SGppnE'];_0x32d1=function(){return _0x1cec81;};return _0x32d1();}import{napCatCore}from'@/core';function _0x34f9(_0x11186d,_0x218a52){var _0x32d1c2=_0x32d1();return _0x34f9=function(_0x34f95f,_0x337760){_0x34f95f=_0x34f95f-0x1ea;var _0x3145df=_0x32d1c2[_0x34f95f];return _0x3145df;},_0x34f9(_0x11186d,_0x218a52);}export class NTQQFriendApi{static async[_0x4ca1de(0x1ea)](_0x3db7fe=![]){}static async[_0x4ca1de(0x1f5)](_0x132184,_0x3d842c){var _0xc2c284=_0x4ca1de;napCatCore['service'][_0xc2c284(0x1eb)][_0xc2c284(0x1f7)]?.[_0xc2c284(0x1f0)]({'friendUid':_0x132184[_0xc2c284(0x1ed)],'reqTime':_0x132184['reqTime'],'accept':_0x3d842c});}}

20
src/core.lib/src/qqnt/apis/group.d.ts vendored Normal file
View File

@@ -0,0 +1,20 @@
import { GroupMember, GroupRequestOperateTypes, GroupMemberRole, GroupNotify, Group } from '../entities';
export declare class NTQQGroupApi {
static getGroups(forced?: boolean): Promise<Group[]>;
static getGroupMembers(groupQQ: string, num?: number): Promise<void | GroupMember[]>;
static getGroupNotifies(): Promise<void>;
static getGroupIgnoreNotifies(): Promise<void>;
static handleGroupRequest(notify: GroupNotify, operateType: GroupRequestOperateTypes, reason?: string): Promise<void | undefined>;
static quitGroup(groupQQ: string): Promise<void | undefined>;
static kickMember(groupQQ: string, kickUids: string[], refuseForever?: boolean, kickReason?: string): Promise<void | undefined>;
static banMember(groupQQ: string, memList: Array<{
uid: string;
timeStamp: number;
}>): Promise<void | undefined>;
static banGroup(groupQQ: string, shutUp: boolean): Promise<void | undefined>;
static setMemberCard(groupQQ: string, memberUid: string, cardName: string): Promise<void | undefined>;
static setMemberRole(groupQQ: string, memberUid: string, role: GroupMemberRole): Promise<void | undefined>;
static setGroupName(groupQQ: string, groupName: string): Promise<void | undefined>;
static setGroupTitle(groupQQ: string, uid: string, title: string): Promise<void>;
static publishGroupBulletin(groupQQ: string, title: string, content: string): void;
}

View File

@@ -0,0 +1 @@
function _0xb985(){const _0x51c8a0=['onGroupListUpdate','banGroup','setGroupTitle','setGroupShutUp','quitGroup','8AhtgZN','groupCode','kernelService','setGroupName','setMemberCard','XGZCO','setMemberShutUp','84429ypkIVZ','operateSysNotify','107217DzVlua','108pqgHIy','modifyMemberCardName','2738937lDwOzG','2368684geGMsy','service','getGroups','modifyGroupName','20328540CiaNGl','376wtQSaY','getGroupMembers','then','group','handleGroupRequest','4756505ehSveg','type','banMember','removeKernelGroupListener','433489WjdMuq','kickMember'];_0xb985=function(){return _0x51c8a0;};return _0xb985();}const _0xef94fb=_0x5d15;(function(_0x5c0a08,_0x143632){const _0x343f63=_0x5d15,_0x103568=_0x5c0a08();while(!![]){try{const _0x49cc3d=-parseInt(_0x343f63(0x115))/0x1*(parseInt(_0x343f63(0x10e))/0x2)+parseInt(_0x343f63(0x11a))/0x3+parseInt(_0x343f63(0x11b))/0x4+-parseInt(_0x343f63(0x103))/0x5+parseInt(_0x343f63(0x118))/0x6*(-parseInt(_0x343f63(0x107))/0x7)+-parseInt(_0x343f63(0x120))/0x8*(parseInt(_0x343f63(0x117))/0x9)+parseInt(_0x343f63(0x11f))/0xa;if(_0x49cc3d===_0x143632)break;else _0x103568['push'](_0x103568['shift']());}catch(_0x2a08ba){_0x103568['push'](_0x103568['shift']());}}}(_0xb985,0x8c3b6));import{napCatCore}from'@/core';import{GroupListener}from'@/core/qqnt';function _0x5d15(_0x1c94b7,_0x28cfcb){const _0xb9851=_0xb985();return _0x5d15=function(_0x5d152e,_0x66587f){_0x5d152e=_0x5d152e-0xff;let _0x54fa62=_0xb9851[_0x5d152e];return _0x54fa62;},_0x5d15(_0x1c94b7,_0x28cfcb);}export class NTQQGroupApi{static async[_0xef94fb(0x11d)](_0x3100fa=![]){const _0xc059ed={'XGZCO':function(_0x373a57,_0x3001a4){return _0x373a57(_0x3001a4);},'pBdEx':function(_0x109df5,_0x1a1a79,_0x246b71){return _0x109df5(_0x1a1a79,_0x246b71);}};let _0xa0aa4a=![];return new Promise((_0x30c428,_0x17839a)=>{const _0x1acb61=_0x5d15;_0xc059ed['pBdEx'](setTimeout,()=>{const _0x4d698c=_0x5d15;!_0xa0aa4a&&(napCatCore[_0x4d698c(0x11c)][_0x4d698c(0x101)]['kernelService']?.[_0x4d698c(0x106)](_0x34f42e),_0xc059ed[_0x4d698c(0x113)](_0x30c428,[]));},0x2710);const _0x399940=new GroupListener();_0x399940[_0x1acb61(0x109)]=(_0x4d078e,_0x19737d)=>{const _0x24ec89=_0x1acb61;_0xa0aa4a=!![],_0xc059ed[_0x24ec89(0x113)](_0x30c428,_0x19737d),napCatCore[_0x24ec89(0x11c)]['group']['kernelService']?.[_0x24ec89(0x106)](_0x34f42e);};const _0x34f42e=napCatCore[_0x1acb61(0x11c)][_0x1acb61(0x101)]['addGroupListener'](_0x399940);napCatCore['service'][_0x1acb61(0x101)][_0x1acb61(0x110)]?.['getGroupList'](_0x3100fa)[_0x1acb61(0x100)]();});}static async[_0xef94fb(0xff)](_0x2337f4,_0x380095=0xbb8){}static async['getGroupNotifies'](){}static async['getGroupIgnoreNotifies'](){}static async[_0xef94fb(0x102)](_0x442ee1,_0x4ead35,_0x474fe9){const _0xc306cc=_0xef94fb,_0x2e4f8a={'PoBAn':function(_0x4c267e,_0x2ce44f){return _0x4c267e||_0x2ce44f;}};return napCatCore[_0xc306cc(0x11c)]['group'][_0xc306cc(0x110)]?.[_0xc306cc(0x116)](![],{'operateType':_0x4ead35,'targetMsg':{'seq':_0x442ee1['seq'],'type':_0x442ee1[_0xc306cc(0x104)],'groupCode':_0x442ee1[_0xc306cc(0x101)][_0xc306cc(0x10f)],'postscript':_0x2e4f8a['PoBAn'](_0x474fe9,'')}});}static async['quitGroup'](_0x41167a){const _0x51f3a8=_0xef94fb;return napCatCore['service'][_0x51f3a8(0x101)][_0x51f3a8(0x110)]?.[_0x51f3a8(0x10d)](_0x41167a);}static async['kickMember'](_0x5425b7,_0x526c07,_0x82e4eb=![],_0x383276=''){const _0x9cdd40=_0xef94fb;return napCatCore['service'][_0x9cdd40(0x101)][_0x9cdd40(0x110)]?.[_0x9cdd40(0x108)](_0x5425b7,_0x526c07,_0x82e4eb,_0x383276);}static async[_0xef94fb(0x105)](_0x4367d3,_0x4280cd){const _0x19cd0f=_0xef94fb;return napCatCore[_0x19cd0f(0x11c)]['group']['kernelService']?.[_0x19cd0f(0x114)](_0x4367d3,_0x4280cd);}static async[_0xef94fb(0x10a)](_0x49ad60,_0x35e977){const _0x2cd96e=_0xef94fb;return napCatCore['service'][_0x2cd96e(0x101)][_0x2cd96e(0x110)]?.[_0x2cd96e(0x10c)](_0x49ad60,_0x35e977);}static async[_0xef94fb(0x112)](_0x198039,_0x497014,_0x184095){const _0x43f2d7=_0xef94fb;return napCatCore[_0x43f2d7(0x11c)][_0x43f2d7(0x101)][_0x43f2d7(0x110)]?.[_0x43f2d7(0x119)](_0x198039,_0x497014,_0x184095);}static async['setMemberRole'](_0x376aaf,_0x4f14d2,_0x36a5c5){const _0x3f1af3=_0xef94fb;return napCatCore[_0x3f1af3(0x11c)][_0x3f1af3(0x101)][_0x3f1af3(0x110)]?.['modifyMemberRole'](_0x376aaf,_0x4f14d2,_0x36a5c5);}static async[_0xef94fb(0x111)](_0x52e9f3,_0x4c4cc9){const _0x2a8ae4=_0xef94fb;return napCatCore['service'][_0x2a8ae4(0x101)][_0x2a8ae4(0x110)]?.[_0x2a8ae4(0x11e)](_0x52e9f3,_0x4c4cc9,![]);}static async[_0xef94fb(0x10b)](_0xe4d508,_0x15b1f2,_0x428758){}static['publishGroupBulletin'](_0x52aacd,_0x36a063,_0x4d67c5){}}

7
src/core.lib/src/qqnt/apis/index.d.ts vendored Normal file
View File

@@ -0,0 +1,7 @@
export * from './file';
export * from './friend';
export * from './group';
export * from './msg';
export * from './user';
export * from './webapi';
export * from './window';

View File

@@ -0,0 +1 @@
(function(_0x3894af,_0x3d5053){var _0x58d356=_0x58ac,_0x55569f=_0x3894af();while(!![]){try{var _0x14cf6e=-parseInt(_0x58d356(0x72))/0x1*(-parseInt(_0x58d356(0x6b))/0x2)+parseInt(_0x58d356(0x71))/0x3+-parseInt(_0x58d356(0x73))/0x4+-parseInt(_0x58d356(0x6f))/0x5+parseInt(_0x58d356(0x70))/0x6+-parseInt(_0x58d356(0x6c))/0x7*(-parseInt(_0x58d356(0x6d))/0x8)+-parseInt(_0x58d356(0x6e))/0x9;if(_0x14cf6e===_0x3d5053)break;else _0x55569f['push'](_0x55569f['shift']());}catch(_0x165ee9){_0x55569f['push'](_0x55569f['shift']());}}}(_0x5f29,0xb6924));export*from'./file';export*from'./friend';export*from'./group';export*from'./msg';function _0x58ac(_0x2b3293,_0x4556ce){var _0x5f29da=_0x5f29();return _0x58ac=function(_0x58acee,_0x491171){_0x58acee=_0x58acee-0x6b;var _0x212cd7=_0x5f29da[_0x58acee];return _0x212cd7;},_0x58ac(_0x2b3293,_0x4556ce);}export*from'./user';export*from'./webapi';export*from'./window';function _0x5f29(){var _0x415e16=['29bLLLWc','670508TFnmtm','18290xjmwVS','6779668DueYlz','8BTtpQA','18371763hWRIZk','3141645LOoFGr','5393196Tisudp','4357440cpCWZo'];_0x5f29=function(){return _0x415e16;};return _0x5f29();}

19
src/core.lib/src/qqnt/apis/msg.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
import { Peer, RawMessage, SendMessageElement } from '@/core/qqnt/entities';
import { NapCatCore } from '@/core';
import { GeneralCallResult } from '@/core/qqnt/services/common';
export declare class NTQQMsgApi {
static napCatCore: NapCatCore | null;
static getMultiMsg(peer: Peer, rootMsgId: string, parentMsgId: string): Promise<GeneralCallResult & {
msgList: RawMessage[];
} | undefined>;
static activateChat(peer: Peer): Promise<void>;
static activateChatAndGetHistory(peer: Peer): Promise<void>;
static getMsgHistory(peer: Peer, msgId: string, count: number): Promise<GeneralCallResult & {
msgList: RawMessage[];
}>;
static fetchRecentContact(): Promise<void>;
static recallMsg(peer: Peer, msgIds: string[]): Promise<void>;
static sendMsg(peer: Peer, msgElements: SendMessageElement[], waitComplete?: boolean, timeout?: number): Promise<RawMessage>;
static forwardMsg(srcPeer: Peer, destPeer: Peer, msgIds: string[]): Promise<void>;
static multiForwardMsg(srcPeer: Peer, destPeer: Peer, msgIds: string[]): Promise<RawMessage>;
}

File diff suppressed because one or more lines are too long

19
src/core.lib/src/qqnt/apis/user.d.ts vendored Normal file
View File

@@ -0,0 +1,19 @@
import { User } from '@/core/qqnt/entities';
export declare class NTQQUserApi {
static like(uid: string, count?: number): Promise<{
result: number;
errMsg: string;
succCounts: number;
}>;
static setQQAvatar(filePath: string): Promise<{
result: number;
errMsg: string;
}>;
static getSelfInfo(): Promise<void>;
static getUserInfo(uid: string): Promise<void>;
static getUserDetailInfo(uid: string): Promise<User>;
static getPSkey(): Promise<void>;
static getSkey(groupName: string, groupCode: string): Promise<void | {
data: string;
}>;
}

View File

@@ -0,0 +1 @@
const _0x2a96ba=_0x264b;function _0x3d3d(){const _0x3394cc=['set','7235JsjWni','3085224mGvbwT','addLoginSuccessCallback','getUserDetailInfo\x20timeout','delete','onProfileDetailInfoChanged','setQQAvatar','getUserDetailInfoWithBizInfo','then','274087neyRaE','102XjUnDP','kernelService','660hpMlOr','setHeader','440yHCykd','profileLike','getUserInfo','423fgJkCy','412xrdoEV','70zxeNrj','addProfileListener','447942QqatJn','32298YTAtPE','getUserDetailInfo','result','profile','getSkey','28881pvUXFc','Igrkl','MkWmf','getSelfInfo','service','forEach','like','uid'];_0x3d3d=function(){return _0x3394cc;};return _0x3d3d();}(function(_0x247eee,_0x564413){const _0x39e585=_0x264b,_0xb4e9fe=_0x247eee();while(!![]){try{const _0x28691f=parseInt(_0x39e585(0x13f))/0x1*(parseInt(_0x39e585(0x13a))/0x2)+parseInt(_0x39e585(0x143))/0x3+parseInt(_0x39e585(0x140))/0x4*(parseInt(_0x39e585(0x152))/0x5)+-parseInt(_0x39e585(0x138))/0x6*(parseInt(_0x39e585(0x144))/0x7)+-parseInt(_0x39e585(0x13c))/0x8*(-parseInt(_0x39e585(0x149))/0x9)+-parseInt(_0x39e585(0x141))/0xa*(parseInt(_0x39e585(0x15b))/0xb)+-parseInt(_0x39e585(0x153))/0xc;if(_0x28691f===_0x564413)break;else _0xb4e9fe['push'](_0xb4e9fe['shift']());}catch(_0x1b85c5){_0xb4e9fe['push'](_0xb4e9fe['shift']());}}}(_0x3d3d,0x19821));import{napCatCore}from'@/core';import{ProfileListener}from'@/core/qqnt/listeners';import{randomUUID}from'crypto';function _0x264b(_0x1d0ba3,_0xcaff09){const _0x3d3dae=_0x3d3d();return _0x264b=function(_0x264ba9,_0x489b4c){_0x264ba9=_0x264ba9-0x138;let _0x4b9f88=_0x3d3dae[_0x264ba9];return _0x4b9f88;},_0x264b(_0x1d0ba3,_0xcaff09);}const userInfoCache={},profileListener=new ProfileListener(),userDetailHandlers=new Map();profileListener[_0x2a96ba(0x157)]=_0x3d00fd=>{const _0x2654a8=_0x2a96ba;userInfoCache[_0x3d00fd[_0x2654a8(0x150)]]=_0x3d00fd,userDetailHandlers[_0x2654a8(0x14e)](_0x4b03cf=>_0x4b03cf(_0x3d00fd));},setTimeout(()=>{const _0x392652=_0x2a96ba;napCatCore[_0x392652(0x154)](()=>{const _0x432a1b=_0x392652;napCatCore[_0x432a1b(0x14d)][_0x432a1b(0x147)][_0x432a1b(0x142)](profileListener);});},0x64);export class NTQQUserApi{static async[_0x2a96ba(0x14f)](_0x1ea06c,_0x2013c9=0x1){const _0x23ebc8=_0x2a96ba;return napCatCore['service'][_0x23ebc8(0x13d)][_0x23ebc8(0x139)]['setBuddyProfileLike']({'friendUid':_0x1ea06c,'sourceId':0x47,'doLikeCount':_0x2013c9,'doLikeTollCount':0x0});}static async[_0x2a96ba(0x158)](_0x32cbc4){const _0x1ff6c0=_0x2a96ba,_0x9a2369=napCatCore[_0x1ff6c0(0x14d)]['profile'][_0x1ff6c0(0x139)]?.[_0x1ff6c0(0x13b)](_0x32cbc4);return{'result':_0x9a2369?.[_0x1ff6c0(0x146)],'errMsg':_0x9a2369?.['errMsg']};}static async[_0x2a96ba(0x14c)](){}static async[_0x2a96ba(0x13e)](_0x5dffdd){}static async[_0x2a96ba(0x145)](_0x390a41){const _0x3b31e2=_0x2a96ba,_0x324e04={'Igrkl':function(_0x10a511,_0x649a4e){return _0x10a511===_0x649a4e;},'DjnGf':function(_0x114dbb,_0x218a54){return _0x114dbb(_0x218a54);},'MkWmf':function(_0x5cfe20){return _0x5cfe20();},'BNGZC':function(_0x46500d,_0x1d5299,_0x41101e){return _0x46500d(_0x1d5299,_0x41101e);}},_0x55516c=napCatCore[_0x3b31e2(0x14d)]['profile'][_0x3b31e2(0x139)];return new Promise((_0x3d7af5,_0xf9f68a)=>{const _0x3ef6f2=_0x3b31e2,_0x4bd7c9=_0x324e04[_0x3ef6f2(0x14b)](randomUUID);let _0x157462=![];_0x324e04['BNGZC'](setTimeout,()=>{const _0x417930=_0x3ef6f2;!_0x157462&&_0xf9f68a(_0x417930(0x155));},0x1388),userDetailHandlers[_0x3ef6f2(0x151)](_0x4bd7c9,_0x5adb86=>{const _0x4f52c8=_0x3ef6f2;_0x324e04[_0x4f52c8(0x14a)](_0x5adb86['uid'],_0x390a41)&&(_0x157462=!![],userDetailHandlers[_0x4f52c8(0x156)](_0x4bd7c9),_0x324e04['DjnGf'](_0x3d7af5,_0x5adb86));}),_0x55516c[_0x3ef6f2(0x159)](_0x390a41,[0x0])[_0x3ef6f2(0x15a)](_0x26f1dc=>{});});}static async['getPSkey'](){}static async[_0x2a96ba(0x148)](_0x8e5e68,_0x1ff1c8){}}

13
src/core.lib/src/qqnt/apis/webapi.d.ts vendored Normal file
View File

@@ -0,0 +1,13 @@
export declare class WebApi {
private static bkn;
private static skey;
private static pskey;
private static cookie;
private defaultHeaders;
constructor();
addGroupDigest(groupCode: string, msgSeq: string): Promise<any>;
getGroupDigest(groupCode: string): Promise<any>;
private genBkn;
private init;
private request;
}

View File

@@ -0,0 +1 @@
const _0x447b25=_0x44f5;(function(_0x5d3681,_0x395c87){const _0x3ebfd6=_0x44f5,_0x58ee89=_0x5d3681();while(!![]){try{const _0x1dc950=-parseInt(_0x3ebfd6(0x1ca))/0x1+parseInt(_0x3ebfd6(0x1bd))/0x2*(parseInt(_0x3ebfd6(0x1cf))/0x3)+parseInt(_0x3ebfd6(0x1c4))/0x4+parseInt(_0x3ebfd6(0x1c6))/0x5*(-parseInt(_0x3ebfd6(0x1bc))/0x6)+parseInt(_0x3ebfd6(0x1e0))/0x7*(-parseInt(_0x3ebfd6(0x1c1))/0x8)+parseInt(_0x3ebfd6(0x1d4))/0x9+-parseInt(_0x3ebfd6(0x1ce))/0xa*(parseInt(_0x3ebfd6(0x1e2))/0xb);if(_0x1dc950===_0x395c87)break;else _0x58ee89['push'](_0x58ee89['shift']());}catch(_0x469cb8){_0x58ee89['push'](_0x58ee89['shift']());}}}(_0x5824,0x266d9));function _0x5824(){const _0x59813a=['8449zENILZ','WIiGs','77MLZIXT','include','request','3048PAvCMs','16kuulLx','bkn','json','skey','352EvbWJT','&msg_seq=','CFmXU','862404fNrzqn','&bkn=','1455BKIqqx','https://qun.qq.com/cgi-bin/group_digest/digest_list?random=665&X-CROSS-ORIGIN=fetch&group_code=','headers','genBkn','129847bNmjZw','https://qun.qq.com/cgi-bin/group_digest/cancel_digest?random=665&X-CROSS-ORIGIN=fetch&group_code=','&msg_random=444021292','getGroupDigest','226020BorPhS','93831gVGRjN','JpGnD','addGroupDigest','length','afGhO','1625229eiBBXW','GET','VepUx','utBMM','YkHxF','defaultHeaders','MpBSl','init','toString','kVfpJ','cookie','&page_start=0&page_limit=20'];_0x5824=function(){return _0x59813a;};return _0x5824();}import{log}from'@/common/utils/log';function _0x44f5(_0x430e94,_0x3fc05c){const _0x582483=_0x5824();return _0x44f5=function(_0x44f52e,_0x30be5b){_0x44f52e=_0x44f52e-0x1bb;let _0x58ae39=_0x582483[_0x44f52e];return _0x58ae39;},_0x44f5(_0x430e94,_0x3fc05c);}export class WebApi{static [_0x447b25(0x1be)];static [_0x447b25(0x1c0)];static ['pskey'];static [_0x447b25(0x1de)];[_0x447b25(0x1d9)]={'User-Agent':'QQ/8.9.28.635\x20CFNetwork/1312\x20Darwin/21.0.0'};constructor(){}async[_0x447b25(0x1d1)](_0x34f337,_0x5c2aeb){const _0x305fa5=_0x447b25,_0x3aa085=_0x305fa5(0x1cb)+_0x34f337+_0x305fa5(0x1c2)+_0x5c2aeb+_0x305fa5(0x1cc),_0xbac247=await this[_0x305fa5(0x1bb)](_0x3aa085);return await _0xbac247[_0x305fa5(0x1bf)]();}async[_0x447b25(0x1cd)](_0x15fef1){const _0xaaf645=_0x447b25,_0x33c1d5={'JpGnD':function(_0x480b63,_0x41e7b7){return _0x480b63(_0x41e7b7);}},_0x1c16fd=_0xaaf645(0x1c7)+_0x15fef1+_0xaaf645(0x1df),_0x1c4d9e=await this[_0xaaf645(0x1bb)](_0x1c16fd);return _0x33c1d5[_0xaaf645(0x1d0)](log,_0x1c4d9e[_0xaaf645(0x1c8)]),await _0x1c4d9e[_0xaaf645(0x1bf)]();}[_0x447b25(0x1c9)](_0x3a8099){const _0x58828e=_0x447b25,_0x2ca5aa={'YkHxF':function(_0x5146bf,_0x35f0b3){return _0x5146bf||_0x35f0b3;},'MpBSl':function(_0x5b456c,_0x351cb6){return _0x5b456c<_0x351cb6;},'utBMM':function(_0x1697de,_0x520433){return _0x1697de+_0x520433;},'YKntL':function(_0x4eae49,_0x129bdc){return _0x4eae49&_0x129bdc;}};_0x3a8099=_0x2ca5aa[_0x58828e(0x1d8)](_0x3a8099,'');let _0x30751e=0x1505;for(let _0x2434a5=0x0;_0x2ca5aa[_0x58828e(0x1da)](_0x2434a5,_0x3a8099[_0x58828e(0x1d2)]);_0x2434a5++){const _0x255291=_0x3a8099['charCodeAt'](_0x2434a5);_0x30751e=_0x2ca5aa[_0x58828e(0x1d7)](_0x2ca5aa['utBMM'](_0x30751e,_0x30751e<<0x5),_0x255291);}return _0x2ca5aa['YKntL'](_0x30751e,0x7fffffff)[_0x58828e(0x1dc)]();}async[_0x447b25(0x1db)](){const _0x423548=_0x447b25;if(!WebApi[_0x423548(0x1be)]){}}async[_0x447b25(0x1bb)](_0x28965b,_0x544ccf=_0x447b25(0x1d5),_0x1921d6={}){const _0x84e9f9=_0x447b25,_0x31d253={'afGhO':function(_0x34ea1d,_0x5c41ae){return _0x34ea1d+_0x5c41ae;},'kVfpJ':_0x84e9f9(0x1e3),'CFmXU':function(_0x73469c,_0x591ea7,_0x1765ce,_0x31674b){return _0x73469c(_0x591ea7,_0x1765ce,_0x31674b);},'WIiGs':'request','VepUx':function(_0x47a805,_0xa98a61,_0x48042b){return _0x47a805(_0xa98a61,_0x48042b);}};await this[_0x84e9f9(0x1db)](),_0x28965b+=_0x31d253[_0x84e9f9(0x1d3)](_0x84e9f9(0x1c5),WebApi[_0x84e9f9(0x1be)]);const _0x37f976={...this[_0x84e9f9(0x1d9)],..._0x1921d6,'Cookie':WebApi[_0x84e9f9(0x1de)],'credentials':_0x31d253[_0x84e9f9(0x1dd)]};_0x31d253[_0x84e9f9(0x1c3)](log,_0x31d253[_0x84e9f9(0x1e1)],_0x28965b,_0x37f976);const _0x2b5a8b={'method':_0x544ccf,'headers':_0x37f976};return _0x31d253[_0x84e9f9(0x1d6)](fetch,_0x28965b,_0x2b5a8b);}}

11
src/core.lib/src/qqnt/apis/window.d.ts vendored Normal file
View File

@@ -0,0 +1,11 @@
export interface NTQQWindow {
windowName: string;
windowUrlHash: string;
}
export declare class NTQQWindows {
static GroupHomeWorkWindow: NTQQWindow;
static GroupNotifyFilterWindow: NTQQWindow;
static GroupEssenceWindow: NTQQWindow;
}
export declare class NTQQWindowApi {
}

View File

@@ -0,0 +1 @@
function _0x521e(){var _0x33adf8=['7059141BHboty','1270bIrDJy','386573vgVvuG','6784464wYencX','38096jnUSSo','GroupEssenceWindow','101TKMtJH','GroupNotifyFilterWindow','#/group-home-work','GroupHomeWorkWindow','132368pRXXlI','#/group-essence','15972wduSQg','318ujvPbx','2093830ZNfykx','133tGDqgg','#/group-notify-filter'];_0x521e=function(){return _0x33adf8;};return _0x521e();}var _0xad48dc=_0x22d1;(function(_0x5e7a4d,_0x98e132){var _0x3d8de1=_0x22d1,_0x3ae5b5=_0x5e7a4d();while(!![]){try{var _0x391d92=parseInt(_0x3d8de1(0x1dd))/0x1*(-parseInt(_0x3d8de1(0x1e3))/0x2)+-parseInt(_0x3d8de1(0x1e4))/0x3*(parseInt(_0x3d8de1(0x1db))/0x4)+parseInt(_0x3d8de1(0x1d4))/0x5+-parseInt(_0x3d8de1(0x1da))/0x6+parseInt(_0x3d8de1(0x1d5))/0x7*(-parseInt(_0x3d8de1(0x1e1))/0x8)+-parseInt(_0x3d8de1(0x1d7))/0x9+parseInt(_0x3d8de1(0x1d8))/0xa*(parseInt(_0x3d8de1(0x1d9))/0xb);if(_0x391d92===_0x98e132)break;else _0x3ae5b5['push'](_0x3ae5b5['shift']());}catch(_0x4ad141){_0x3ae5b5['push'](_0x3ae5b5['shift']());}}}(_0x521e,0xcc2ea));function _0x22d1(_0x1514d1,_0x59145c){var _0x521ed3=_0x521e();return _0x22d1=function(_0x22d10f,_0x50a268){_0x22d10f=_0x22d10f-0x1d4;var _0x3e5d51=_0x521ed3[_0x22d10f];return _0x3e5d51;},_0x22d1(_0x1514d1,_0x59145c);}export class NTQQWindows{static [_0xad48dc(0x1e0)]={'windowName':_0xad48dc(0x1e0),'windowUrlHash':_0xad48dc(0x1df)};static [_0xad48dc(0x1de)]={'windowName':'GroupNotifyFilterWindow','windowUrlHash':_0xad48dc(0x1d6)};static [_0xad48dc(0x1dc)]={'windowName':'GroupEssenceWindow','windowUrlHash':_0xad48dc(0x1e2)};}export class NTQQWindowApi{}

View File

@@ -0,0 +1,58 @@
import { ChatType } from './msg';
export interface CacheScanResult {
result: number;
size: [
string,
string,
string,
string,
string,
string,
string,
string,
string
];
}
export interface ChatCacheList {
pageCount: number;
infos: ChatCacheListItem[];
}
export interface ChatCacheListItem {
chatType: ChatType;
basicChatCacheInfo: ChatCacheListItemBasic;
guildChatCacheInfo: unknown[];
}
export interface ChatCacheListItemBasic {
chatSize: string;
chatTime: string;
uid: string;
uin: string;
remarkName: string;
nickName: string;
chatType?: ChatType;
isChecked?: boolean;
}
export declare enum CacheFileType {
IMAGE = 0,
VIDEO = 1,
AUDIO = 2,
DOCUMENT = 3,
OTHER = 4
}
export interface CacheFileList {
infos: CacheFileListItem[];
}
export interface CacheFileListItem {
fileSize: string;
fileTime: string;
fileKey: string;
elementId: string;
elementIdStr: string;
fileType: CacheFileType;
path: string;
fileName: string;
senderId: string;
previewPath: string;
senderName: string;
isChecked?: boolean;
}

View File

@@ -0,0 +1 @@
function _0x9634(){var _0x4f7a62=['138qcUzkH','AQhpq','8ETqkLK','hkESv','13383326DCFGaZ','1415202apEvKv','171zJiCNa','912919eWeZfc','DOCUMENT','185894JtlDZu','414316MtZxXF','18640lxwwEZ','IMAGE','4OKPJIo','OTHER','119740LcVYkN','AUDIO','IrUoN','VIDEO','mJCEE'];_0x9634=function(){return _0x4f7a62;};return _0x9634();}(function(_0x34f60c,_0x13f860){var _0x521222=_0x4be1,_0x2905b3=_0x34f60c();while(!![]){try{var _0x463b86=-parseInt(_0x521222(0xf7))/0x1+-parseInt(_0x521222(0xf6))/0x2+-parseInt(_0x521222(0xf2))/0x3*(-parseInt(_0x521222(0xfa))/0x4)+parseInt(_0x521222(0xfc))/0x5*(-parseInt(_0x521222(0x101))/0x6)+-parseInt(_0x521222(0xf4))/0x7*(parseInt(_0x521222(0xef))/0x8)+-parseInt(_0x521222(0xf3))/0x9*(-parseInt(_0x521222(0xf8))/0xa)+parseInt(_0x521222(0xf1))/0xb;if(_0x463b86===_0x13f860)break;else _0x2905b3['push'](_0x2905b3['shift']());}catch(_0x429281){_0x2905b3['push'](_0x2905b3['shift']());}}}(_0x9634,0x82b24));function _0x4be1(_0x150f6b,_0x49f53){var _0x96345c=_0x9634();return _0x4be1=function(_0x4be103,_0xa966ae){_0x4be103=_0x4be103-0xef;var _0x2b74f9=_0x96345c[_0x4be103];return _0x2b74f9;},_0x4be1(_0x150f6b,_0x49f53);}export var CacheFileType;(function(_0x45b59b){var _0x3a1171=_0x4be1,_0x4f79d7={'VeYZL':_0x3a1171(0xf9),'AQhpq':_0x3a1171(0xff),'hkESv':_0x3a1171(0xfd),'IrUoN':_0x3a1171(0xf5),'mJCEE':_0x3a1171(0xfb)};_0x45b59b[_0x45b59b[_0x3a1171(0xf9)]=0x0]=_0x4f79d7['VeYZL'],_0x45b59b[_0x45b59b[_0x4f79d7[_0x3a1171(0x102)]]=0x1]=_0x4f79d7[_0x3a1171(0x102)],_0x45b59b[_0x45b59b[_0x4f79d7[_0x3a1171(0xf0)]]=0x2]=_0x4f79d7[_0x3a1171(0xf0)],_0x45b59b[_0x45b59b[_0x4f79d7['IrUoN']]=0x3]=_0x4f79d7[_0x3a1171(0xfe)],_0x45b59b[_0x45b59b[_0x4f79d7[_0x3a1171(0x100)]]=0x4]=_0x4f79d7[_0x3a1171(0x100)];}(CacheFileType||(CacheFileType={})));

View File

@@ -0,0 +1,14 @@
import { AtType, SendArkElement, SendFaceElement, SendFileElement, SendPicElement, SendPttElement, SendReplyElement, SendTextElement, SendVideoElement } from '../entities';
export declare class SendMsgElementConstructor {
static text(content: string): SendTextElement;
static at(atUid: string, atNtUid: string, atType: AtType, atName: string): SendTextElement;
static reply(msgSeq: string, msgId: string, senderUin: string, senderUinStr: string): SendReplyElement;
static pic(picPath: string, summary?: string, subType?: 0 | 1): Promise<SendPicElement>;
static file(filePath: string, fileName?: string): Promise<SendFileElement>;
static video(filePath: string, fileName?: string, diyThumbPath?: string): Promise<SendVideoElement>;
static ptt(pttPath: string): Promise<SendPttElement>;
static face(faceId: number): SendFaceElement;
static dice(resultId: number | null): SendFaceElement;
static rps(resultId: number | null): SendFaceElement;
static ark(data: any): SendArkElement;
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,52 @@
import { QQLevel, Sex } from './user';
export interface Group {
groupCode: string;
maxMember: number;
memberCount: number;
groupName: string;
groupStatus: 0;
memberRole: 2;
isTop: boolean;
toppedTimestamp: '0';
privilegeFlag: number;
isConf: boolean;
hasModifyConfGroupFace: boolean;
hasModifyConfGroupName: boolean;
remarkName: string;
hasMemo: boolean;
groupShutupExpireTime: string;
personShutupExpireTime: string;
discussToGroupUin: string;
discussToGroupMaxMsgSeq: number;
discussToGroupTime: number;
groupFlagExt: number;
authGroupType: number;
groupCreditLevel: number;
groupFlagExt3: number;
groupOwnerId: {
'memberUin': string;
'memberUid': string;
};
}
export declare enum GroupMemberRole {
normal = 2,
admin = 3,
owner = 4
}
export interface GroupMember {
memberSpecialTitle?: string;
avatarPath: string;
cardName: string;
cardType: number;
isDelete: boolean;
nick: string;
qid: string;
remark: string;
role: GroupMemberRole;
shutUpTime: number;
uid: string;
uin: string;
isRobot: boolean;
sex?: Sex;
qqLevel?: QQLevel;
}

View File

@@ -0,0 +1 @@
function _0x1b34(_0x8e876c,_0x19b006){var _0x4081cd=_0x4081();return _0x1b34=function(_0x1b346b,_0x56ac77){_0x1b346b=_0x1b346b-0x15c;var _0xa26e7f=_0x4081cd[_0x1b346b];return _0xa26e7f;},_0x1b34(_0x8e876c,_0x19b006);}(function(_0x2751f4,_0x50d4d1){var _0x359eb7=_0x1b34,_0x1cca62=_0x2751f4();while(!![]){try{var _0x49d544=-parseInt(_0x359eb7(0x15c))/0x1+parseInt(_0x359eb7(0x15f))/0x2*(-parseInt(_0x359eb7(0x162))/0x3)+parseInt(_0x359eb7(0x169))/0x4+-parseInt(_0x359eb7(0x163))/0x5+parseInt(_0x359eb7(0x160))/0x6+-parseInt(_0x359eb7(0x15e))/0x7*(parseInt(_0x359eb7(0x167))/0x8)+parseInt(_0x359eb7(0x168))/0x9;if(_0x49d544===_0x50d4d1)break;else _0x1cca62['push'](_0x1cca62['shift']());}catch(_0x5c934e){_0x1cca62['push'](_0x1cca62['shift']());}}}(_0x4081,0x5c354));export var GroupMemberRole;function _0x4081(){var _0x1e9f80=['owner','GcJOL','1040FZbSnz','4749606ypAeck','1641448CsRPdi','3107MEMiUO','OuiNA','19243qqdYRA','12xClyqo','3801672uRAuBC','NsHtZ','116661MIIHfT','3001125uQXxBT','admin'];_0x4081=function(){return _0x1e9f80;};return _0x4081();}(function(_0x434f1e){var _0x493c64=_0x1b34,_0x1e9ec2={'NsHtZ':'normal','GcJOL':_0x493c64(0x164),'OuiNA':_0x493c64(0x165)};_0x434f1e[_0x434f1e[_0x1e9ec2[_0x493c64(0x161)]]=0x2]=_0x1e9ec2[_0x493c64(0x161)],_0x434f1e[_0x434f1e[_0x1e9ec2[_0x493c64(0x166)]]=0x3]=_0x1e9ec2[_0x493c64(0x166)],_0x434f1e[_0x434f1e[_0x1e9ec2[_0x493c64(0x15d)]]=0x4]=_0x493c64(0x165);}(GroupMemberRole||(GroupMemberRole={})));

View File

@@ -0,0 +1,6 @@
export * from './user';
export * from './group';
export * from './msg';
export * from './notify';
export * from './cache';
export * from './constructor';

View File

@@ -0,0 +1 @@
(function(_0x1a335b,_0x56de0e){var _0x506033=_0x50e6,_0x146c7d=_0x1a335b();while(!![]){try{var _0x10d1e7=parseInt(_0x506033(0xa8))/0x1+-parseInt(_0x506033(0xa6))/0x2*(-parseInt(_0x506033(0xaa))/0x3)+parseInt(_0x506033(0xac))/0x4+parseInt(_0x506033(0xa7))/0x5*(-parseInt(_0x506033(0xa3))/0x6)+parseInt(_0x506033(0xa4))/0x7+-parseInt(_0x506033(0xa9))/0x8*(parseInt(_0x506033(0xa5))/0x9)+-parseInt(_0x506033(0xab))/0xa;if(_0x10d1e7===_0x56de0e)break;else _0x146c7d['push'](_0x146c7d['shift']());}catch(_0x40b4c7){_0x146c7d['push'](_0x146c7d['shift']());}}}(_0x1fc1,0x9b216));export*from'./user';function _0x50e6(_0x1dc155,_0x32a10c){var _0x1fc10d=_0x1fc1();return _0x50e6=function(_0x50e6d1,_0x4c452c){_0x50e6d1=_0x50e6d1-0xa3;var _0x205f62=_0x1fc10d[_0x50e6d1];return _0x205f62;},_0x50e6(_0x1dc155,_0x32a10c);}export*from'./group';export*from'./msg';export*from'./notify';function _0x1fc1(){var _0x11f3d9=['9444915ZuKUfk','2020dWvUBo','52255TfdWUG','950201ZyxWlB','8xiakEF','1407KdoGan','7918380godIXk','2812956oVNMlC','402mYyiPG','7348418VtpeAU'];_0x1fc1=function(){return _0x11f3d9;};return _0x1fc1();}export*from'./cache';export*from'./constructor';

400
src/core.lib/src/qqnt/entities/msg.d.ts vendored Normal file
View File

@@ -0,0 +1,400 @@
import { GroupMemberRole } from './group';
export interface Peer {
chatType: ChatType;
peerUid: string;
guildId?: '';
}
export declare enum ElementType {
TEXT = 1,
PIC = 2,
FILE = 3,
PTT = 4,
VIDEO = 5,
FACE = 6,
REPLY = 7,
ARK = 10
}
export interface SendTextElement {
elementType: ElementType.TEXT;
elementId: '';
textElement: {
content: string;
atType: number;
atUid: string;
atTinyId: string;
atNtUid: string;
};
}
export interface SendPttElement {
elementType: ElementType.PTT;
elementId: '';
pttElement: {
fileName: string;
filePath: string;
md5HexStr: string;
fileSize: number;
duration: number;
formatType: number;
voiceType: number;
voiceChangeType: number;
canConvert2Text: boolean;
waveAmplitudes: number[];
fileSubId: '';
playState: number;
autoConvertText: number;
};
}
export declare enum PicType {
gif = 2000,
jpg = 1000
}
export declare enum PicSubType {
normal = 0,// 普通图片,大图
face = 1
}
export interface SendPicElement {
elementType: ElementType.PIC;
elementId: '';
picElement: {
md5HexStr: string;
fileSize: number | string;
picWidth: number;
picHeight: number;
fileName: string;
sourcePath: string;
original: boolean;
picType: PicType;
picSubType: PicSubType;
fileUuid: string;
fileSubId: string;
thumbFileSize: number;
summary: string;
};
}
export interface SendReplyElement {
elementType: ElementType.REPLY;
elementId: '';
replyElement: {
replayMsgSeq: string;
replayMsgId: string;
senderUin: string;
senderUinStr: string;
};
}
export interface SendFaceElement {
elementType: ElementType.FACE;
elementId: '';
faceElement: FaceElement;
}
export interface FileElement {
'fileMd5'?: '';
'fileName': string;
'filePath': string;
fileSize: string;
'picHeight'?: number;
'picWidth'?: number;
'picThumbPath'?: Map<number, string>;
'file10MMd5'?: '';
'fileSha'?: '';
'fileSha3'?: '';
'fileUuid'?: '';
'fileSubId'?: '';
'thumbFileSize'?: number;
fileBizId?: number;
}
export interface SendFileElement {
elementType: ElementType.FILE;
elementId: '';
fileElement: FileElement;
}
export interface SendVideoElement {
elementType: ElementType.VIDEO;
elementId: '';
videoElement: VideoElement;
}
export interface SendArkElement {
elementType: ElementType.ARK;
elementId: '';
arkElement: ArkElement;
}
export type SendMessageElement = SendTextElement | SendPttElement | SendPicElement | SendReplyElement | SendFaceElement | SendFileElement | SendVideoElement | SendArkElement;
export declare enum AtType {
notAt = 0,
atAll = 1,
atUser = 2
}
export declare enum ChatType {
friend = 1,
group = 2,
temp = 100
}
export interface PttElement {
canConvert2Text: boolean;
duration: number;
fileBizId: null;
fileId: number;
fileName: string;
filePath: string;
fileSize: string;
fileSubId: string;
fileUuid: string;
formatType: string;
invalidState: number;
md5HexStr: string;
playState: number;
progress: number;
text: string;
transferStatus: number;
translateStatus: number;
voiceChangeType: number;
voiceType: number;
waveAmplitudes: number[];
}
export interface ArkElement {
bytesData: string;
linkInfo: null;
subElementType: null;
}
export declare const IMAGE_HTTP_HOST = "https://gchat.qpic.cn";
export declare const IMAGE_HTTP_HOST_NT = "https://multimedia.nt.qq.com.cn";
export interface PicElement {
originImageUrl: string;
originImageMd5?: string;
sourcePath: string;
thumbPath: Map<number, string>;
picWidth: number;
picHeight: number;
fileSize: number;
fileName: string;
fileUuid: string;
md5HexStr?: string;
}
export declare enum GrayTipElementSubType {
INVITE_NEW_MEMBER = 12,
MEMBER_NEW_TITLE = 17
}
export interface GrayTipElement {
subElementType: GrayTipElementSubType;
revokeElement: {
operatorRole: string;
operatorUid: string;
operatorNick: string;
operatorRemark: string;
operatorMemRemark?: string;
wording: string;
};
aioOpGrayTipElement: TipAioOpGrayTipElement;
groupElement: TipGroupElement;
xmlElement: {
content: string;
};
jsonGrayTipElement: {
jsonStr: string;
};
}
export declare enum FaceType {
normal = 1,// 小黄脸
normal2 = 2,// 新小黄脸, 从faceIndex 222开始
dice = 3
}
export declare enum FaceIndex {
dice = 358,
RPS = 359
}
export interface FaceElement {
faceIndex: number;
faceType: FaceType;
faceText?: string;
packId?: string;
stickerId?: string;
sourceType?: number;
stickerType?: number;
resultId?: string;
surpriseId?: string;
randomType?: number;
}
export interface MarketFaceElement {
'itemType': 6;
'faceInfo': 1;
'emojiPackageId': 203875;
'subType': 3;
'mediaType': 0;
'imageWidth': 200;
'imageHeight': 200;
'faceName': string;
'emojiId': '094d53bd1c9ac5d35d04b08e8a6c992c';
'key': 'a8b1dd0aebc8d910';
'param': null;
'mobileParam': null;
'sourceType': null;
'startTime': null;
'endTime': null;
'emojiType': 1;
'hasIpProduct': null;
'voiceItemHeightArr': null;
'sourceName': null;
'sourceJumpUrl': null;
'sourceTypeName': null;
'backColor': null;
'volumeColor': null;
'staticFacePath': 'E:\\SystemDocuments\\QQ\\721011692\\nt_qq\\nt_data\\Emoji\\marketface\\203875\\094d53bd1c9ac5d35d04b08e8a6c992c_aio.png';
'dynamicFacePath': 'E:\\SystemDocuments\\QQ\\721011692\\nt_qq\\nt_data\\Emoji\\marketface\\203875\\094d53bd1c9ac5d35d04b08e8a6c992c';
'supportSize': [
{
'width': 300;
'height': 300;
},
{
'width': 200;
'height': 200;
}
];
'apngSupportSize': null;
}
export interface VideoElement {
'filePath': string;
'fileName': string;
'videoMd5'?: string;
'thumbMd5'?: string;
'fileTime'?: number;
'thumbSize'?: number;
'fileFormat'?: number;
'fileSize'?: string;
'thumbWidth'?: number;
'thumbHeight'?: number;
'busiType'?: 0;
'subBusiType'?: 0;
'thumbPath'?: Map<number, any>;
'transferStatus'?: 0;
'progress'?: 0;
'invalidState'?: 0;
'fileUuid'?: string;
'fileSubId'?: '';
'fileBizId'?: null;
'originVideoMd5'?: '';
'import_rich_media_context'?: null;
'sourceVideoCodecFormat'?: number;
}
export interface MarkdownElement {
content: string;
}
export interface InlineKeyboardElementRowButton {
'id': '';
'label': string;
'visitedLabel': string;
'style': 1;
'type': 2;
'clickLimit': 0;
'unsupportTips': '请升级新版手机QQ';
'data': string;
'atBotShowChannelList': false;
'permissionType': 2;
'specifyRoleIds': [];
'specifyTinyids': [];
'isReply': false;
'anchor': 0;
'enter': false;
'subscribeDataTemplateIds': [];
}
export interface InlineKeyboardElement {
rows: [
{
buttons: InlineKeyboardElementRowButton[];
}
];
}
export interface TipAioOpGrayTipElement {
operateType: number;
peerUid: string;
fromGrpCodeOfTmpChat: string;
}
export declare enum TipGroupElementType {
memberIncrease = 1,
kicked = 3,// 被移出群
ban = 8
}
export interface TipGroupElement {
'type': TipGroupElementType;
'role': 0;
'groupName': string;
'memberUid': string;
'memberNick': string;
'memberRemark': string;
'adminUid': string;
'adminNick': string;
'adminRemark': string;
'createGroup': null;
'memberAdd'?: {
'showType': 1;
'otherAdd': null;
'otherAddByOtherQRCode': null;
'otherAddByYourQRCode': null;
'youAddByOtherQRCode': null;
'otherInviteOther': null;
'otherInviteYou': null;
'youInviteOther': null;
};
'shutUp'?: {
'curTime': string;
'duration': string;
'admin': {
'uid': string;
'card': string;
'name': string;
'role': GroupMemberRole;
};
'member': {
'uid': string;
'card': string;
'name': string;
'role': GroupMemberRole;
};
};
}
export interface MultiForwardMsgElement {
xmlContent: string;
resId: string;
fileName: string;
}
export interface RawMessage {
id?: number;
msgId: string;
msgTime: string;
msgSeq: string;
senderUid: string;
senderUin: string;
peerUid: string;
peerUin: string;
sendNickName: string;
sendMemberName?: string;
chatType: ChatType;
sendStatus?: number;
recallTime: string;
elements: {
elementId: string;
elementType: ElementType;
replyElement: {
senderUid: string;
sourceMsgIsIncPic: boolean;
sourceMsgText: string;
replayMsgSeq: string;
};
textElement: {
atType: AtType;
atUid: string;
content: string;
atNtUid: string;
};
picElement: PicElement;
pttElement: PttElement;
arkElement: ArkElement;
grayTipElement: GrayTipElement;
faceElement: FaceElement;
videoElement: VideoElement;
fileElement: FileElement;
marketFaceElement: MarketFaceElement;
inlineKeyboardElement: InlineKeyboardElement;
markdownElement: MarkdownElement;
multiForwardMsgElement: MultiForwardMsgElement;
}[];
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,68 @@
export declare enum GroupNotifyTypes {
INVITE_ME = 1,
INVITED_JOIN = 4,// 有人接受了邀请入群
JOIN_REQUEST = 7,
ADMIN_SET = 8,
KICK_MEMBER = 9,
MEMBER_EXIT = 11,// 主动退出
ADMIN_UNSET = 12
}
export interface GroupNotifies {
doubt: boolean;
nextStartSeq: string;
notifies: GroupNotify[];
}
export declare enum GroupNotifyStatus {
IGNORE = 0,
WAIT_HANDLE = 1,
APPROVE = 2,
REJECT = 3
}
export interface GroupNotify {
time: number;
seq: string;
type: GroupNotifyTypes;
status: GroupNotifyStatus;
group: {
groupCode: string;
groupName: string;
};
user1: {
uid: string;
nickName: string;
};
user2: {
uid: string;
nickName: string;
};
actionUser: {
uid: string;
nickName: string;
};
actionTime: string;
invitationExt: {
srcType: number;
groupCode: string;
waitStatus: number;
};
postscript: string;
repeatSeqs: [];
warningTips: string;
}
export declare enum GroupRequestOperateTypes {
approve = 1,
reject = 2
}
export interface FriendRequest {
friendUid: string;
reqTime: string;
extWords: string;
isUnread: boolean;
friendNick: string;
sourceId: number;
groupCode: string;
}
export interface FriendRequestNotify {
unreadNums: number;
buddyReqs: FriendRequest[];
}

View File

@@ -0,0 +1 @@
(function(_0x4e65fd,_0x581fb5){var _0x87f250=_0x3174,_0xa04f98=_0x4e65fd();while(!![]){try{var _0x37d483=parseInt(_0x87f250(0x153))/0x1*(-parseInt(_0x87f250(0x144))/0x2)+parseInt(_0x87f250(0x161))/0x3+-parseInt(_0x87f250(0x14a))/0x4*(-parseInt(_0x87f250(0x147))/0x5)+parseInt(_0x87f250(0x15f))/0x6+-parseInt(_0x87f250(0x14f))/0x7*(-parseInt(_0x87f250(0x160))/0x8)+parseInt(_0x87f250(0x150))/0x9*(parseInt(_0x87f250(0x15a))/0xa)+-parseInt(_0x87f250(0x15c))/0xb;if(_0x37d483===_0x581fb5)break;else _0xa04f98['push'](_0xa04f98['shift']());}catch(_0x1bbeeb){_0xa04f98['push'](_0xa04f98['shift']());}}}(_0x5cb7,0x6ba07));export var GroupNotifyTypes;(function(_0x3d5a51){var _0x1fd500=_0x3174,_0x4b4996={'kARXm':_0x1fd500(0x158),'DNXfM':_0x1fd500(0x141),'GIUJJ':_0x1fd500(0x15d),'OIMNY':'INVITED_JOIN','aNVkp':'JOIN_REQUEST','DaDQJ':_0x1fd500(0x155),'VtKDp':_0x1fd500(0x146),'YArYb':_0x1fd500(0x149)},_0x19a383=_0x4b4996[_0x1fd500(0x145)][_0x1fd500(0x157)]('|'),_0x220586=0x0;while(!![]){switch(_0x19a383[_0x220586++]){case'0':_0x3d5a51[_0x3d5a51[_0x4b4996[_0x1fd500(0x154)]]=0x8]=_0x4b4996[_0x1fd500(0x154)];continue;case'1':_0x3d5a51[_0x3d5a51[_0x4b4996[_0x1fd500(0x162)]]=0x9]=_0x4b4996[_0x1fd500(0x162)];continue;case'2':_0x3d5a51[_0x3d5a51[_0x4b4996[_0x1fd500(0x142)]]=0x4]=_0x4b4996[_0x1fd500(0x142)];continue;case'3':_0x3d5a51[_0x3d5a51[_0x4b4996[_0x1fd500(0x148)]]=0x7]=_0x4b4996[_0x1fd500(0x148)];continue;case'4':_0x3d5a51[_0x3d5a51[_0x4b4996['DaDQJ']]=0xc]=_0x4b4996[_0x1fd500(0x15b)];continue;case'5':_0x3d5a51[_0x3d5a51[_0x1fd500(0x146)]=0xb]=_0x4b4996['VtKDp'];continue;case'6':_0x3d5a51[_0x3d5a51[_0x4b4996['YArYb']]=0x1]=_0x4b4996[_0x1fd500(0x14c)];continue;}break;}}(GroupNotifyTypes||(GroupNotifyTypes={})));function _0x3174(_0x466573,_0x4a9fef){var _0x5cb7fc=_0x5cb7();return _0x3174=function(_0x317483,_0x26c346){_0x317483=_0x317483-0x140;var _0x1e3ad6=_0x5cb7fc[_0x317483];return _0x1e3ad6;},_0x3174(_0x466573,_0x4a9fef);}function _0x5cb7(){var _0x97c24f=['YBAIt','ADMIN_SET','OIMNY','KYboP','134jtaDMX','kARXm','MEMBER_EXIT','5xPeGsk','aNVkp','INVITE_ME','3111788pxIpHU','EbzZM','YArYb','approve','YLTrW','1144108aplgcs','9StqFin','fTFNZ','WAIT_HANDLE','10281wBEhka','DNXfM','ADMIN_UNSET','IGNORE','split','6|2|3|0|1|5|4','xAyUV','1306490halxRV','DaDQJ','12173788CKZGMB','KICK_MEMBER','reject','2763228uLecGe','16SdtmCi','1621056CLAjxd','GIUJJ','APPROVE'];_0x5cb7=function(){return _0x97c24f;};return _0x5cb7();}export var GroupNotifyStatus;(function(_0x3a6297){var _0x5c3869=_0x3174,_0xf8229e={'YBAIt':_0x5c3869(0x156),'YLTrW':_0x5c3869(0x152),'xAyUV':_0x5c3869(0x163),'EbzZM':'REJECT'};_0x3a6297[_0x3a6297[_0x5c3869(0x156)]=0x0]=_0xf8229e[_0x5c3869(0x140)],_0x3a6297[_0x3a6297[_0x5c3869(0x152)]=0x1]=_0xf8229e[_0x5c3869(0x14e)],_0x3a6297[_0x3a6297[_0xf8229e['xAyUV']]=0x2]=_0xf8229e[_0x5c3869(0x159)],_0x3a6297[_0x3a6297[_0xf8229e[_0x5c3869(0x14b)]]=0x3]=_0xf8229e[_0x5c3869(0x14b)];}(GroupNotifyStatus||(GroupNotifyStatus={})));export var GroupRequestOperateTypes;(function(_0x5d2ec6){var _0x20c53c=_0x3174,_0x4cb2aa={'KYboP':_0x20c53c(0x14d),'fTFNZ':_0x20c53c(0x15e)};_0x5d2ec6[_0x5d2ec6[_0x4cb2aa[_0x20c53c(0x143)]]=0x1]=_0x4cb2aa[_0x20c53c(0x143)],_0x5d2ec6[_0x5d2ec6[_0x4cb2aa[_0x20c53c(0x151)]]=0x2]=_0x4cb2aa[_0x20c53c(0x151)];}(GroupRequestOperateTypes||(GroupRequestOperateTypes={})));

View File

@@ -0,0 +1,73 @@
export declare enum Sex {
male = 1,
female = 2,
unknown = 255
}
export interface QQLevel {
'crownNum': number;
'sunNum': number;
'moonNum': number;
'starNum': number;
}
export interface User {
uid: string;
uin: string;
nick: string;
avatarUrl?: string;
longNick?: string;
remark?: string;
sex?: Sex;
qqLevel?: QQLevel;
qid?: string;
'birthday_year'?: number;
'birthday_month'?: number;
'birthday_day'?: number;
'topTime'?: string;
'constellation'?: number;
'shengXiao'?: number;
'kBloodType'?: number;
'homeTown'?: string;
'makeFriendCareer'?: number;
'pos'?: string;
'eMail'?: string;
'phoneNum'?: string;
'college'?: string;
'country'?: string;
'province'?: string;
'city'?: string;
'postCode'?: string;
'address'?: string;
'isBlock'?: boolean;
'isSpecialCareOpen'?: boolean;
'isSpecialCareZone'?: boolean;
'ringId'?: string;
'regTime'?: number;
interest?: string;
'labels'?: string[];
'isHideQQLevel'?: number;
'privilegeIcon'?: {
'jumpUrl': string;
'openIconList': unknown[];
'closeIconList': unknown[];
};
'photoWall'?: {
'picList': unknown[];
};
'vipFlag'?: boolean;
'yearVipFlag'?: boolean;
'svipFlag'?: boolean;
'vipLevel'?: number;
'status'?: number;
'qidianMasterFlag'?: number;
'qidianCrewFlag'?: number;
'qidianCrewFlag2'?: number;
'extStatus'?: number;
'recommendImgFlag'?: number;
'disableEmojiShortCuts'?: number;
'pendantId'?: string;
}
export interface SelfInfo extends User {
online?: boolean;
}
export interface Friend extends User {
}

View File

@@ -0,0 +1 @@
function _0x1a7e(){var _0xd0f553=['998312dFnyiY','2171038GRyBcz','9javMxU','4061370WKKWmE','TXnit','14noUmae','363aEZtmZ','12eTVoBl','184340wgbCYa','female','SbqkB','VWmbF','28748dgtrWK','4717764IsHJdI','1UdlILl','41331917IvNfpN','unknown'];_0x1a7e=function(){return _0xd0f553;};return _0x1a7e();}function _0x255d(_0x5d637a,_0x42bc91){var _0x1a7e79=_0x1a7e();return _0x255d=function(_0x255df1,_0x2f5c5a){_0x255df1=_0x255df1-0xb9;var _0x6427ce=_0x1a7e79[_0x255df1];return _0x6427ce;},_0x255d(_0x5d637a,_0x42bc91);}(function(_0x44e5fb,_0x211db5){var _0x42b3d5=_0x255d,_0xb30228=_0x44e5fb();while(!![]){try{var _0x9f7cbd=-parseInt(_0x42b3d5(0xc6))/0x1*(parseInt(_0x42b3d5(0xb9))/0x2)+-parseInt(_0x42b3d5(0xbe))/0x3*(parseInt(_0x42b3d5(0xc4))/0x4)+parseInt(_0x42b3d5(0xbb))/0x5+-parseInt(_0x42b3d5(0xc5))/0x6*(parseInt(_0x42b3d5(0xbd))/0x7)+-parseInt(_0x42b3d5(0xc9))/0x8+parseInt(_0x42b3d5(0xba))/0x9*(-parseInt(_0x42b3d5(0xc0))/0xa)+parseInt(_0x42b3d5(0xc7))/0xb*(parseInt(_0x42b3d5(0xbf))/0xc);if(_0x9f7cbd===_0x211db5)break;else _0xb30228['push'](_0xb30228['shift']());}catch(_0x23fc14){_0xb30228['push'](_0xb30228['shift']());}}}(_0x1a7e,0xdb6cc));export var Sex;(function(_0x9e1085){var _0x448cc8=_0x255d,_0x5c7856={'SbqkB':'male','TXnit':_0x448cc8(0xc1),'VWmbF':_0x448cc8(0xc8)};_0x9e1085[_0x9e1085[_0x5c7856[_0x448cc8(0xc2)]]=0x1]=_0x5c7856[_0x448cc8(0xc2)],_0x9e1085[_0x9e1085[_0x5c7856[_0x448cc8(0xbc)]]=0x2]=_0x5c7856[_0x448cc8(0xbc)],_0x9e1085[_0x9e1085[_0x5c7856['VWmbF']]=0xff]=_0x5c7856[_0x448cc8(0xc3)];}(Sex||(Sex={})));

14
src/core.lib/src/qqnt/index.d.ts vendored Normal file
View File

@@ -0,0 +1,14 @@
import QQWrapper from './wrapper';
export * from './adapters';
export * from './apis';
export * from './entities';
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 { QQWrapper as Wrapper };
export * as WrapperInterface from './wrapper';
export * as SessionConfig from './sessionConfig';

View File

@@ -0,0 +1 @@
function _0x4233(){var _0xac06a9=['4AUIyAv','780WVbhhm','2OFLmgh','20Ilqxfj','4112LBbMXm','1718845ZSyIiD','574hBoLHk','1098NIFxRX','1989891NgMdSh','223371wxvlmi','533797IAizcC','3368844mrecbz'];_0x4233=function(){return _0xac06a9;};return _0x4233();}(function(_0x24bfa6,_0x233107){var _0x358a4c=_0x5da2,_0xebd235=_0x24bfa6();while(!![]){try{var _0x3291bf=parseInt(_0x358a4c(0x173))/0x1*(parseInt(_0x358a4c(0x178))/0x2)+-parseInt(_0x358a4c(0x172))/0x3*(parseInt(_0x358a4c(0x176))/0x4)+parseInt(_0x358a4c(0x16f))/0x5+parseInt(_0x358a4c(0x177))/0x6*(parseInt(_0x358a4c(0x170))/0x7)+parseInt(_0x358a4c(0x16e))/0x8*(parseInt(_0x358a4c(0x171))/0x9)+-parseInt(_0x358a4c(0x16d))/0xa*(-parseInt(_0x358a4c(0x174))/0xb)+parseInt(_0x358a4c(0x175))/0xc;if(_0x3291bf===_0x233107)break;else _0xebd235['push'](_0xebd235['shift']());}catch(_0x3a345f){_0xebd235['push'](_0xebd235['shift']());}}}(_0x4233,0x56aba));import _0x5ac432 from'./wrapper';export*from'./adapters';export*from'./apis';export*from'./entities';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';function _0x5da2(_0x17faa9,_0x41d39c){var _0x423314=_0x4233();return _0x5da2=function(_0x5da243,_0x4a622a){_0x5da243=_0x5da243-0x16d;var _0x3cbce3=_0x423314[_0x5da243];return _0x3cbce3;},_0x5da2(_0x17faa9,_0x41d39c);}export*as Services from'./services';export{_0x5ac432 as Wrapper};export*as WrapperInterface from'./wrapper';export*as SessionConfig from'./sessionConfig';

View File

@@ -0,0 +1,53 @@
import { FriendRequestNotify, User } from '@/core/qqnt/entities';
interface IBuddyListener {
onBuddyListChange(arg: {
categoryId: number;
categroyName: string;
categroyMbCount: number;
buddyList: User[];
}[]): void;
onBuddyInfoChange(arg: unknown): void;
onBuddyDetailInfoChange(arg: unknown): void;
onNickUpdated(arg: unknown): void;
onBuddyRemarkUpdated(arg: unknown): void;
onAvatarUrlUpdated(arg: unknown): void;
onBuddyReqChange(arg: FriendRequestNotify): void;
onBuddyReqUnreadCntChange(arg: unknown): void;
onCheckBuddySettingResult(arg: unknown): void;
onAddBuddyNeedVerify(arg: unknown): void;
onSmartInfos(arg: unknown): void;
onSpacePermissionInfos(arg: unknown): void;
onDoubtBuddyReqChange(arg: unknown): void;
onDoubtBuddyReqUnreadNumChange(arg: unknown): void;
onBlockChanged(arg: unknown): void;
onAddMeSettingChanged(arg: unknown): void;
onDelBatchBuddyInfos(arg: unknown): void;
}
export interface NodeIKernelBuddyListener extends IBuddyListener {
new (listener: IBuddyListener): NodeIKernelBuddyListener;
}
export declare class BuddyListener implements IBuddyListener {
onAddBuddyNeedVerify(arg: unknown): void;
onAddMeSettingChanged(arg: unknown): void;
onAvatarUrlUpdated(arg: unknown): void;
onBlockChanged(arg: unknown): void;
onBuddyDetailInfoChange(arg: unknown): void;
onBuddyInfoChange(arg: unknown): void;
onBuddyListChange(arg: {
categoryId: number;
categroyName: string;
categroyMbCount: number;
buddyList: User[];
}[]): void;
onBuddyRemarkUpdated(arg: unknown): void;
onBuddyReqChange(arg: FriendRequestNotify): void;
onBuddyReqUnreadCntChange(arg: unknown): void;
onCheckBuddySettingResult(arg: unknown): void;
onDelBatchBuddyInfos(arg: unknown): void;
onDoubtBuddyReqChange(arg: unknown): void;
onDoubtBuddyReqUnreadNumChange(arg: unknown): void;
onNickUpdated(arg: unknown): void;
onSmartInfos(arg: unknown): void;
onSpacePermissionInfos(arg: unknown): void;
}
export {};

View File

@@ -0,0 +1 @@
var _0x19de79=_0x4817;function _0x4817(_0x4e9f26,_0x39aacc){var _0x9ae40f=_0x9ae4();return _0x4817=function(_0x481725,_0x54ccb8){_0x481725=_0x481725-0x1b6;var _0x4373fb=_0x9ae40f[_0x481725];return _0x4373fb;},_0x4817(_0x4e9f26,_0x39aacc);}function _0x9ae4(){var _0x7a2dca=['onBlockChanged','8mtaCle','onDoubtBuddyReqChange','1282092AnYcsB','60eObfPW','onAddMeSettingChanged','onDelBatchBuddyInfos','onSmartInfos','1781290APPlbB','32ObIQvb','onAddBuddyNeedVerify','547893XcWmIw','onBuddyDetailInfoChange','85014ypzIUb','15144LbyiaJ','onCheckBuddySettingResult','onBuddyReqUnreadCntChange','onBuddyReqChange','onAvatarUrlUpdated','286581nIbbZV','4121843nzaKal','onBuddyListChange','4cOSXDo'];_0x9ae4=function(){return _0x7a2dca;};return _0x9ae4();}(function(_0x39a67b,_0x48dfad){var _0x492a9b=_0x4817,_0x53fd82=_0x39a67b();while(!![]){try{var _0x5bef31=parseInt(_0x492a9b(0x1bc))/0x1*(-parseInt(_0x492a9b(0x1c7))/0x2)+parseInt(_0x492a9b(0x1c2))/0x3*(parseInt(_0x492a9b(0x1c5))/0x4)+parseInt(_0x492a9b(0x1ca))/0x5*(-parseInt(_0x492a9b(0x1bd))/0x6)+parseInt(_0x492a9b(0x1c9))/0x7+-parseInt(_0x492a9b(0x1b8))/0x8*(parseInt(_0x492a9b(0x1ba))/0x9)+parseInt(_0x492a9b(0x1b7))/0xa+parseInt(_0x492a9b(0x1c3))/0xb;if(_0x5bef31===_0x48dfad)break;else _0x53fd82['push'](_0x53fd82['shift']());}catch(_0x45cdcd){_0x53fd82['push'](_0x53fd82['shift']());}}}(_0x9ae4,0x35249));export class BuddyListener{[_0x19de79(0x1b9)](_0x13deb3){}[_0x19de79(0x1cb)](_0x4c4323){}[_0x19de79(0x1c1)](_0x21ae78){}[_0x19de79(0x1c6)](_0x4d795f){}[_0x19de79(0x1bb)](_0x238e0a){}['onBuddyInfoChange'](_0x1dc9a8){}[_0x19de79(0x1c4)](_0x5242b7){}['onBuddyRemarkUpdated'](_0x46fc03){}[_0x19de79(0x1c0)](_0x3e17a6){}[_0x19de79(0x1bf)](_0x1e1da1){}[_0x19de79(0x1be)](_0x53296b){}[_0x19de79(0x1cc)](_0x4816bb){}[_0x19de79(0x1c8)](_0x55e5a5){}['onDoubtBuddyReqUnreadNumChange'](_0x523d05){}['onNickUpdated'](_0x3f660f){}[_0x19de79(0x1b6)](_0x114fea){}['onSpacePermissionInfos'](_0x384ab3){}}

View File

@@ -0,0 +1,92 @@
import { Group, GroupMember, GroupNotify } from '@/core/qqnt/entities';
interface IGroupListener {
onGroupListUpdate(updateType: number, groupList: Group[]): void;
onGroupExtListUpdate(...args: unknown[]): void;
onGroupSingleScreenNotifies(...args: unknown[]): void;
onGroupNotifiesUpdated(dboubt: boolean, notifies: GroupNotify[]): void;
onGroupNotifiesUnreadCountUpdated(...args: unknown[]): void;
onGroupDetailInfoChange(...args: unknown[]): void;
onGroupAllInfoChange(...args: unknown[]): void;
onGroupsMsgMaskResult(...args: unknown[]): void;
onGroupConfMemberChange(...args: unknown[]): void;
onGroupBulletinChange(...args: unknown[]): void;
onGetGroupBulletinListResult(...args: unknown[]): void;
onMemberListChange(arg: {
sceneId: string;
ids: string[];
infos: Map<string, GroupMember>;
finish: boolean;
hasRobot: boolean;
}): void;
onMemberInfoChange(groupCode: string, changeType: number, members: Map<string, GroupMember>): void;
onSearchMemberChange(...args: unknown[]): void;
onGroupBulletinRichMediaDownloadComplete(...args: unknown[]): void;
onGroupBulletinRichMediaProgressUpdate(...args: unknown[]): void;
onGroupStatisticInfoChange(...args: unknown[]): void;
onJoinGroupNotify(...args: unknown[]): void;
onShutUpMemberListChanged(...args: unknown[]): void;
onGroupBulletinRemindNotify(...args: unknown[]): void;
onGroupFirstBulletinNotify(...args: unknown[]): void;
onJoinGroupNoVerifyFlag(...args: unknown[]): void;
onGroupArkInviteStateResult(...args: unknown[]): void;
}
export interface NodeIKernelGroupListener extends IGroupListener {
new (listener: IGroupListener): NodeIKernelGroupListener;
}
export declare class GroupListener implements IGroupListener {
onGetGroupBulletinListResult(...args: unknown[]): void;
onGroupAllInfoChange(...args: unknown[]): void;
onGroupBulletinChange(...args: unknown[]): void;
onGroupBulletinRemindNotify(...args: unknown[]): void;
onGroupArkInviteStateResult(...args: unknown[]): void;
onGroupBulletinRichMediaDownloadComplete(...args: unknown[]): void;
onGroupConfMemberChange(...args: unknown[]): void;
onGroupDetailInfoChange(...args: unknown[]): void;
onGroupExtListUpdate(...args: unknown[]): void;
onGroupFirstBulletinNotify(...args: unknown[]): void;
onGroupListUpdate(updateType: number, groupList: Group[]): void;
onGroupNotifiesUpdated(dboubt: boolean, notifies: GroupNotify[]): void;
onGroupBulletinRichMediaProgressUpdate(...args: unknown[]): void;
onGroupNotifiesUnreadCountUpdated(...args: unknown[]): void;
onGroupSingleScreenNotifies(...args: unknown[]): void;
onGroupsMsgMaskResult(...args: unknown[]): void;
onGroupStatisticInfoChange(...args: unknown[]): void;
onJoinGroupNotify(...args: unknown[]): void;
onJoinGroupNoVerifyFlag(...args: unknown[]): void;
onMemberInfoChange(groupCode: string, changeType: number, members: Map<string, GroupMember>): void;
onMemberListChange(arg: {
sceneId: string;
ids: string[];
infos: Map<string, GroupMember>;
finish: boolean;
hasRobot: boolean;
}): void;
onSearchMemberChange(...args: unknown[]): void;
onShutUpMemberListChanged(...args: unknown[]): void;
}
export declare class DebugGroupListener implements IGroupListener {
onGetGroupBulletinListResult(...args: unknown[]): void;
onGroupAllInfoChange(...args: unknown[]): void;
onGroupBulletinChange(...args: unknown[]): void;
onGroupBulletinRemindNotify(...args: unknown[]): void;
onGroupArkInviteStateResult(...args: unknown[]): void;
onGroupBulletinRichMediaDownloadComplete(...args: unknown[]): void;
onGroupConfMemberChange(...args: unknown[]): void;
onGroupDetailInfoChange(...args: unknown[]): void;
onGroupExtListUpdate(...args: unknown[]): void;
onGroupFirstBulletinNotify(...args: unknown[]): void;
onGroupListUpdate(...args: unknown[]): void;
onGroupNotifiesUpdated(...args: unknown[]): void;
onGroupBulletinRichMediaProgressUpdate(...args: unknown[]): void;
onGroupNotifiesUnreadCountUpdated(...args: unknown[]): void;
onGroupSingleScreenNotifies(...args: unknown[]): void;
onGroupsMsgMaskResult(...args: unknown[]): void;
onGroupStatisticInfoChange(...args: unknown[]): void;
onJoinGroupNotify(...args: unknown[]): void;
onJoinGroupNoVerifyFlag(...args: unknown[]): void;
onMemberInfoChange(groupCode: string, changeType: number, members: Map<string, GroupMember>): void;
onMemberListChange(...args: unknown[]): void;
onSearchMemberChange(...args: unknown[]): void;
onShutUpMemberListChanged(...args: unknown[]): void;
}
export {};

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,44 @@
export interface IKernelLoginListener {
onLoginConnected(...args: any[]): void;
onLoginDisConnected(...args: any[]): void;
onLoginConnecting(...args: any[]): void;
onQRCodeGetPicture(...args: any[]): void;
onQRCodeLoginPollingStarted(...args: any[]): void;
onQRCodeSessionUserScaned(...args: any[]): void;
onQRCodeLoginSucceed(...args: any[]): void;
onQRCodeSessionFailed(...args: any[]): void;
onLoginFailed(...args: any[]): void;
onLogoutSucceed(...args: any[]): void;
onLogoutFailed(...args: any[]): void;
onUserLoggedIn(...args: any[]): void;
onQRCodeSessionQuickLoginFailed(...args: any[]): void;
onPasswordLoginFailed(...args: any[]): void;
OnConfirmUnusualDeviceFailed(...args: any[]): void;
onQQLoginNumLimited(...args: any[]): void;
onLoginState(...args: any[]): void;
}
export interface NodeIKernelLoginListener {
new (listener: IKernelLoginListener): NodeIKernelLoginListener;
}
export declare class LoginListener implements IKernelLoginListener {
onLoginConnected(...args: any[]): void;
onLoginDisConnected(...args: any[]): void;
onLoginConnecting(...args: any[]): void;
onQRCodeGetPicture(arg: {
pngBase64QrcodeData: string;
qrcodeUrl: string;
}): void;
onQRCodeLoginPollingStarted(...args: any[]): void;
onQRCodeSessionUserScaned(...args: any[]): void;
onQRCodeLoginSucceed(...args: any[]): void;
onQRCodeSessionFailed(...args: any[]): void;
onLoginFailed(...args: any[]): void;
onLogoutSucceed(...args: any[]): void;
onLogoutFailed(...args: any[]): void;
onUserLoggedIn(...args: any[]): void;
onQRCodeSessionQuickLoginFailed(...args: any[]): void;
onPasswordLoginFailed(...args: any[]): void;
OnConfirmUnusualDeviceFailed(...args: any[]): void;
onQQLoginNumLimited(...args: any[]): void;
onLoginState(...args: any[]): void;
}

View File

@@ -0,0 +1 @@
function _0x1c06(_0x330064,_0x20c17f){var _0x43f4a1=_0x43f4();return _0x1c06=function(_0x1c0685,_0x53e9d4){_0x1c0685=_0x1c0685-0x11d;var _0x2020b5=_0x43f4a1[_0x1c0685];return _0x2020b5;},_0x1c06(_0x330064,_0x20c17f);}var _0x185456=_0x1c06;function _0x43f4(){var _0x12fd38=['35DNfuBc','onQRCodeLoginSucceed','onLoginConnected','2tqaecq','onLogoutFailed','1222776EIIKkt','onQRCodeSessionUserScaned','onQRCodeLoginPollingStarted','OnConfirmUnusualDeviceFailed','onQRCodeSessionQuickLoginFailed','3245030UuHsAb','onQRCodeSessionFailed','4648890OexhdD','860414qXmATT','onPasswordLoginFailed','onLoginFailed','onQQLoginNumLimited','onLogoutSucceed','181836ysOKvp','26446023aomwBP','704288bUcxVz'];_0x43f4=function(){return _0x12fd38;};return _0x43f4();}(function(_0x16ef70,_0x14752b){var _0x3d0e62=_0x1c06,_0x5b120c=_0x16ef70();while(!![]){try{var _0x43d865=-parseInt(_0x3d0e62(0x11e))/0x1*(parseInt(_0x3d0e62(0x129))/0x2)+-parseInt(_0x3d0e62(0x123))/0x3+parseInt(_0x3d0e62(0x12b))/0x4+-parseInt(_0x3d0e62(0x130))/0x5+-parseInt(_0x3d0e62(0x11d))/0x6+parseInt(_0x3d0e62(0x126))/0x7*(-parseInt(_0x3d0e62(0x125))/0x8)+parseInt(_0x3d0e62(0x124))/0x9;if(_0x43d865===_0x14752b)break;else _0x5b120c['push'](_0x5b120c['shift']());}catch(_0x328d7d){_0x5b120c['push'](_0x5b120c['shift']());}}}(_0x43f4,0x7016a));export class LoginListener{[_0x185456(0x128)](..._0xc23bdc){}['onLoginDisConnected'](..._0x3a9a33){}['onLoginConnecting'](..._0x40eb05){}['onQRCodeGetPicture'](_0x17f3ad){}[_0x185456(0x12d)](..._0x3f68c7){}[_0x185456(0x12c)](..._0x2e836b){}[_0x185456(0x127)](..._0x470e17){}[_0x185456(0x131)](..._0x389eaf){}[_0x185456(0x120)](..._0x534f04){}[_0x185456(0x122)](..._0x26e5db){}[_0x185456(0x12a)](..._0x414227){}['onUserLoggedIn'](..._0x227bb5){}[_0x185456(0x12f)](..._0x1d4926){}[_0x185456(0x11f)](..._0x37209a){}[_0x185456(0x12e)](..._0x52b0a4){}[_0x185456(0x121)](..._0x330993){}['onLoginState'](..._0x1717e8){}}

View File

@@ -0,0 +1,166 @@
import { RawMessage } from '@/core/qqnt/entities';
export interface OnRichMediaDownloadCompleteParams {
fileModelId: string;
msgElementId: string;
msgId: string;
fileId: string;
fileProgress: string;
fileSpeed: string;
fileErrCode: string;
fileErrMsg: string;
fileDownType: number;
thumbSize: number;
filePath: string;
totalSize: string;
trasferStatus: number;
step: number;
commonFileInfo: unknown | null;
fileSrvErrCode: string;
clientMsg: string;
businessId: number;
userTotalSpacePerDay: unknown | null;
userUsedSpacePerDay: unknown | null;
}
export interface IKernelMsgListener {
onAddSendMsg(msgRecord: RawMessage): void;
onBroadcastHelperDownloadComplete(broadcastHelperTransNotifyInfo: unknown): void;
onBroadcastHelperProgressUpdate(broadcastHelperTransNotifyInfo: unknown): void;
onChannelFreqLimitInfoUpdate(contact: unknown, z: unknown, freqLimitInfo: unknown): void;
onContactUnreadCntUpdate(hashMap: unknown): void;
onCustomWithdrawConfigUpdate(customWithdrawConfig: unknown): void;
onDraftUpdate(contact: unknown, arrayList: unknown, j2: unknown): void;
onEmojiDownloadComplete(emojiNotifyInfo: unknown): void;
onEmojiResourceUpdate(emojiResourceInfo: unknown): void;
onFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
onFileMsgCome(arrayList: unknown): void;
onFirstViewDirectMsgUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
onFirstViewGroupGuildMapping(arrayList: unknown): void;
onGrabPasswordRedBag(i2: unknown, str: unknown, i3: unknown, recvdOrder: unknown, msgRecord: unknown): void;
onGroupFileInfoAdd(groupItem: unknown): void;
onGroupFileInfoUpdate(groupFileListResult: unknown): void;
onGroupGuildUpdate(groupGuildNotifyInfo: unknown): void;
onGroupTransferInfoAdd(groupItem: unknown): void;
onGroupTransferInfoUpdate(groupFileListResult: unknown): void;
onGuildInteractiveUpdate(guildInteractiveNotificationItem: unknown): void;
onGuildMsgAbFlagChanged(guildMsgAbFlag: unknown): void;
onGuildNotificationAbstractUpdate(guildNotificationAbstractInfo: unknown): void;
onHitCsRelatedEmojiResult(downloadRelateEmojiResultInfo: unknown): void;
onHitEmojiKeywordResult(hitRelatedEmojiWordsResult: unknown): void;
onHitRelatedEmojiResult(relatedWordEmojiInfo: unknown): void;
onImportOldDbProgressUpdate(importOldDbMsgNotifyInfo: unknown): void;
onInputStatusPush(inputStatusInfo: unknown): void;
onKickedOffLine(kickedInfo: unknown): void;
onLineDev(arrayList: unknown): void;
onLogLevelChanged(j2: unknown): void;
onMsgAbstractUpdate(arrayList: unknown): void;
onMsgBoxChanged(arrayList: unknown): void;
onMsgDelete(contact: unknown, arrayList: unknown): void;
onMsgEventListUpdate(hashMap: unknown): void;
onMsgInfoListAdd(arrayList: unknown): void;
onMsgInfoListUpdate(msgList: RawMessage[]): void;
onMsgQRCodeStatusChanged(i2: unknown): void;
onMsgRecall(i2: unknown, str: unknown, j2: unknown): void;
onMsgSecurityNotify(msgRecord: unknown): void;
onMsgSettingUpdate(msgSetting: unknown): void;
onNtFirstViewMsgSyncEnd(): void;
onNtMsgSyncEnd(): void;
onNtMsgSyncStart(): void;
onReadFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
onRecvGroupGuildFlag(i2: unknown): void;
onRecvMsg(...arrayList: unknown[]): void;
onRecvMsgSvrRspTransInfo(j2: unknown, contact: unknown, i2: unknown, i3: unknown, str: unknown, bArr: unknown): void;
onRecvOnlineFileMsg(arrayList: unknown): void;
onRecvS2CMsg(arrayList: unknown): void;
onRecvSysMsg(arrayList: unknown): void;
onRecvUDCFlag(i2: unknown): void;
onRichMediaDownloadComplete(fileTransNotifyInfo: OnRichMediaDownloadCompleteParams): void;
onRichMediaProgerssUpdate(fileTransNotifyInfo: unknown): void;
onRichMediaUploadComplete(fileTransNotifyInfo: unknown): void;
onSearchGroupFileInfoUpdate(searchGroupFileResult: unknown): void;
onSendMsgError(j2: unknown, contact: unknown, i2: unknown, str: unknown): void;
onSysMsgNotification(i2: unknown, j2: unknown, j3: unknown, arrayList: unknown): void;
onTempChatInfoUpdate(tempChatInfo: unknown): void;
onUnreadCntAfterFirstView(hashMap: unknown): void;
onUnreadCntUpdate(hashMap: unknown): void;
onUserChannelTabStatusChanged(z: unknown): void;
onUserOnlineStatusChanged(z: unknown): void;
onUserTabStatusChanged(arrayList: unknown): void;
onlineStatusBigIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
onlineStatusSmallIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
onUserSecQualityChanged(...args: unknown[]): void;
onMsgWithRichLinkInfoUpdate(...args: unknown[]): void;
onRedTouchChanged(...args: unknown[]): void;
}
export interface NodeIKernelMsgListener {
new (listener: IKernelMsgListener): NodeIKernelMsgListener;
}
export declare class MsgListener implements IKernelMsgListener {
onAddSendMsg(msgRecord: RawMessage): void;
onBroadcastHelperDownloadComplete(broadcastHelperTransNotifyInfo: unknown): void;
onBroadcastHelperProgressUpdate(broadcastHelperTransNotifyInfo: unknown): void;
onChannelFreqLimitInfoUpdate(contact: unknown, z: unknown, freqLimitInfo: unknown): void;
onContactUnreadCntUpdate(hashMap: unknown): void;
onCustomWithdrawConfigUpdate(customWithdrawConfig: unknown): void;
onDraftUpdate(contact: unknown, arrayList: unknown, j2: unknown): void;
onEmojiDownloadComplete(emojiNotifyInfo: unknown): void;
onEmojiResourceUpdate(emojiResourceInfo: unknown): void;
onFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
onFileMsgCome(arrayList: unknown): void;
onFirstViewDirectMsgUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
onFirstViewGroupGuildMapping(arrayList: unknown): void;
onGrabPasswordRedBag(i2: unknown, str: unknown, i3: unknown, recvdOrder: unknown, msgRecord: unknown): void;
onGroupFileInfoAdd(groupItem: unknown): void;
onGroupFileInfoUpdate(groupFileListResult: unknown): void;
onGroupGuildUpdate(groupGuildNotifyInfo: unknown): void;
onGroupTransferInfoAdd(groupItem: unknown): void;
onGroupTransferInfoUpdate(groupFileListResult: unknown): void;
onGuildInteractiveUpdate(guildInteractiveNotificationItem: unknown): void;
onGuildMsgAbFlagChanged(guildMsgAbFlag: unknown): void;
onGuildNotificationAbstractUpdate(guildNotificationAbstractInfo: unknown): void;
onHitCsRelatedEmojiResult(downloadRelateEmojiResultInfo: unknown): void;
onHitEmojiKeywordResult(hitRelatedEmojiWordsResult: unknown): void;
onHitRelatedEmojiResult(relatedWordEmojiInfo: unknown): void;
onImportOldDbProgressUpdate(importOldDbMsgNotifyInfo: unknown): void;
onInputStatusPush(inputStatusInfo: unknown): void;
onKickedOffLine(kickedInfo: unknown): void;
onLineDev(arrayList: unknown): void;
onLogLevelChanged(j2: unknown): void;
onMsgAbstractUpdate(arrayList: unknown): void;
onMsgBoxChanged(arrayList: unknown): void;
onMsgDelete(contact: unknown, arrayList: unknown): void;
onMsgEventListUpdate(hashMap: unknown): void;
onMsgInfoListAdd(arrayList: unknown): void;
onMsgInfoListUpdate(msgList: RawMessage[]): void;
onMsgQRCodeStatusChanged(i2: unknown): void;
onMsgRecall(i2: unknown, str: unknown, j2: unknown): void;
onMsgSecurityNotify(msgRecord: unknown): void;
onMsgSettingUpdate(msgSetting: unknown): void;
onNtFirstViewMsgSyncEnd(): void;
onNtMsgSyncEnd(): void;
onNtMsgSyncStart(): void;
onReadFeedEventUpdate(firstViewDirectMsgNotifyInfo: unknown): void;
onRecvGroupGuildFlag(i2: unknown): void;
onRecvMsg(arrayList: RawMessage[]): void;
onRecvMsgSvrRspTransInfo(j2: unknown, contact: unknown, i2: unknown, i3: unknown, str: unknown, bArr: unknown): void;
onRecvOnlineFileMsg(arrayList: unknown): void;
onRecvS2CMsg(arrayList: unknown): void;
onRecvSysMsg(arrayList: unknown): void;
onRecvUDCFlag(i2: unknown): void;
onRichMediaDownloadComplete(fileTransNotifyInfo: OnRichMediaDownloadCompleteParams): void;
onRichMediaProgerssUpdate(fileTransNotifyInfo: unknown): void;
onRichMediaUploadComplete(fileTransNotifyInfo: unknown): void;
onSearchGroupFileInfoUpdate(searchGroupFileResult: unknown): void;
onSendMsgError(j2: unknown, contact: unknown, i2: unknown, str: unknown): void;
onSysMsgNotification(i2: unknown, j2: unknown, j3: unknown, arrayList: unknown): void;
onTempChatInfoUpdate(tempChatInfo: unknown): void;
onUnreadCntAfterFirstView(hashMap: unknown): void;
onUnreadCntUpdate(hashMap: unknown): void;
onUserChannelTabStatusChanged(z: unknown): void;
onUserOnlineStatusChanged(z: unknown): void;
onUserTabStatusChanged(arrayList: unknown): void;
onlineStatusBigIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
onlineStatusSmallIconDownloadPush(i2: unknown, j2: unknown, str: unknown): void;
onUserSecQualityChanged(...args: unknown[]): void;
onMsgWithRichLinkInfoUpdate(...args: unknown[]): void;
onRedTouchChanged(...args: unknown[]): void;
}

View File

@@ -0,0 +1 @@
function _0x5717(_0xcbcfe2,_0x4280b7){var _0x9d98f5=_0x9d98();return _0x5717=function(_0x571728,_0x3c9ea5){_0x571728=_0x571728-0x1db;var _0x4ab97b=_0x9d98f5[_0x571728];return _0x4ab97b;},_0x5717(_0xcbcfe2,_0x4280b7);}var _0x4dde70=_0x5717;(function(_0x5366c4,_0x11fe40){var _0x38b26b=_0x5717,_0x114e30=_0x5366c4();while(!![]){try{var _0x3df5e8=parseInt(_0x38b26b(0x207))/0x1+parseInt(_0x38b26b(0x1df))/0x2+parseInt(_0x38b26b(0x1e7))/0x3*(parseInt(_0x38b26b(0x1e0))/0x4)+parseInt(_0x38b26b(0x216))/0x5*(-parseInt(_0x38b26b(0x20a))/0x6)+parseInt(_0x38b26b(0x214))/0x7*(-parseInt(_0x38b26b(0x213))/0x8)+-parseInt(_0x38b26b(0x1ea))/0x9*(parseInt(_0x38b26b(0x1de))/0xa)+parseInt(_0x38b26b(0x1e9))/0xb;if(_0x3df5e8===_0x11fe40)break;else _0x114e30['push'](_0x114e30['shift']());}catch(_0x202cf4){_0x114e30['push'](_0x114e30['shift']());}}}(_0x9d98,0x4b9b2));export class MsgListener{['onAddSendMsg'](_0x52e12d){}[_0x4dde70(0x1e5)](_0x459079){}[_0x4dde70(0x1e1)](_0x2ee4fe){}['onChannelFreqLimitInfoUpdate'](_0x4e20d4,_0x53b06f,_0x173033){}['onContactUnreadCntUpdate'](_0x203778){}['onCustomWithdrawConfigUpdate'](_0x1b7acf){}[_0x4dde70(0x1f8)](_0x46a8d0,_0x2871cc,_0x108680){}[_0x4dde70(0x1f2)](_0x2108a8){}[_0x4dde70(0x1f3)](_0x1f6053){}['onFeedEventUpdate'](_0xa61377){}[_0x4dde70(0x202)](_0x5e287a){}[_0x4dde70(0x210)](_0x302589){}[_0x4dde70(0x1f6)](_0x3c7596){}[_0x4dde70(0x1db)](_0x56a9fc,_0x28aab0,_0x4cbebc,_0x3bdf8e,_0x4aec1e){}[_0x4dde70(0x1fb)](_0x14da27){}[_0x4dde70(0x1e2)](_0x6869e9){}[_0x4dde70(0x200)](_0x12df3e){}[_0x4dde70(0x212)](_0xbb1bc0){}[_0x4dde70(0x1fa)](_0x38751e){}[_0x4dde70(0x1ec)](_0x349671){}[_0x4dde70(0x208)](_0x94baec){}[_0x4dde70(0x1f5)](_0x2328ec){}[_0x4dde70(0x205)](_0x56a1b1){}[_0x4dde70(0x20f)](_0x59b240){}[_0x4dde70(0x1f9)](_0x28d958){}['onImportOldDbProgressUpdate'](_0x11a33d){}[_0x4dde70(0x204)](_0x5c7351){}[_0x4dde70(0x1fd)](_0x59d0f0){}['onLineDev'](_0x3f5058){}[_0x4dde70(0x1f1)](_0x454586){}[_0x4dde70(0x20e)](_0x345f93){}[_0x4dde70(0x20d)](_0x7ebcd4){}[_0x4dde70(0x1dc)](_0x3f077b,_0x45bfec){}[_0x4dde70(0x1f0)](_0x4acac6){}[_0x4dde70(0x1ff)](_0x88f758){}['onMsgInfoListUpdate'](_0x4c58d5){}[_0x4dde70(0x1fc)](_0x365162){}[_0x4dde70(0x20c)](_0x22280e,_0xd763c2,_0x268bc1){}[_0x4dde70(0x1ef)](_0xb8904d){}['onMsgSettingUpdate'](_0x277a02){}['onNtFirstViewMsgSyncEnd'](){}['onNtMsgSyncEnd'](){}[_0x4dde70(0x209)](){}['onReadFeedEventUpdate'](_0x22e683){}[_0x4dde70(0x1f4)](_0x228641){}[_0x4dde70(0x206)](_0x238cc8){}[_0x4dde70(0x215)](_0x5b5c03,_0x1e1f02,_0x45f3e7,_0x25c809,_0x6670ed,_0x1415ce){}[_0x4dde70(0x1e3)](_0x1508d9){}[_0x4dde70(0x1e4)](_0x217567){}['onRecvSysMsg'](_0x8c9e9d){}[_0x4dde70(0x1dd)](_0x1c0820){}[_0x4dde70(0x217)](_0x559ca2){}[_0x4dde70(0x1eb)](_0x23e7ac){}[_0x4dde70(0x201)](_0x1d726d){}['onSearchGroupFileInfoUpdate'](_0x4a2029){}[_0x4dde70(0x20b)](_0x18991,_0x233c3b,_0x46153c,_0x53b534){}[_0x4dde70(0x1e8)](_0x11e52f,_0x3bd9f9,_0x2bfc2e,_0x3f34c5){}['onTempChatInfoUpdate'](_0x402f4f){}[_0x4dde70(0x1ed)](_0x13f715){}[_0x4dde70(0x1ee)](_0x4caa37){}[_0x4dde70(0x203)](_0x23a223){}['onUserOnlineStatusChanged'](_0x1f5493){}[_0x4dde70(0x1e6)](_0x9a6f90){}['onlineStatusBigIconDownloadPush'](_0x5638ff,_0xd6ee4c,_0x41d936){}[_0x4dde70(0x1fe)](_0xbaab1e,_0x23186c,_0x241faf){}[_0x4dde70(0x211)](..._0x2aab5a){}[_0x4dde70(0x1f7)](..._0x5e415f){}['onRedTouchChanged'](..._0x33a563){}}function _0x9d98(){var _0x94d753=['369147IvZkeg','onSysMsgNotification','13269520NMAmhQ','2326986fkSTtg','onRichMediaProgerssUpdate','onGuildInteractiveUpdate','onUnreadCntAfterFirstView','onUnreadCntUpdate','onMsgSecurityNotify','onMsgEventListUpdate','onLogLevelChanged','onEmojiDownloadComplete','onEmojiResourceUpdate','onRecvGroupGuildFlag','onGuildNotificationAbstractUpdate','onFirstViewGroupGuildMapping','onMsgWithRichLinkInfoUpdate','onDraftUpdate','onHitRelatedEmojiResult','onGroupTransferInfoUpdate','onGroupFileInfoAdd','onMsgQRCodeStatusChanged','onKickedOffLine','onlineStatusSmallIconDownloadPush','onMsgInfoListAdd','onGroupGuildUpdate','onRichMediaUploadComplete','onFileMsgCome','onUserChannelTabStatusChanged','onInputStatusPush','onHitCsRelatedEmojiResult','onRecvMsg','23100MVPrBj','onGuildMsgAbFlagChanged','onNtMsgSyncStart','12zOCZpx','onSendMsgError','onMsgRecall','onMsgBoxChanged','onMsgAbstractUpdate','onHitEmojiKeywordResult','onFirstViewDirectMsgUpdate','onUserSecQualityChanged','onGroupTransferInfoAdd','816dbFfAa','34223TXxYin','onRecvMsgSvrRspTransInfo','276670FACrbA','onRichMediaDownloadComplete','onGrabPasswordRedBag','onMsgDelete','onRecvUDCFlag','20TiLfRu','167334MitTkQ','4IiVjmk','onBroadcastHelperProgressUpdate','onGroupFileInfoUpdate','onRecvOnlineFileMsg','onRecvS2CMsg','onBroadcastHelperDownloadComplete','onUserTabStatusChanged'];_0x9d98=function(){return _0x94d753;};return _0x9d98();}

View File

@@ -0,0 +1,19 @@
import { User } from '@/core/qqnt/entities';
interface IProfileListener {
onProfileSimpleChanged(...args: unknown[]): void;
onProfileDetailInfoChanged(profile: User): void;
onStatusUpdate(...args: unknown[]): void;
onSelfStatusChanged(...args: unknown[]): void;
onStrangerRemarkChanged(...args: unknown[]): void;
}
export interface NodeIKernelProfileListener extends IProfileListener {
new (listener: IProfileListener): NodeIKernelProfileListener;
}
export declare class ProfileListener implements IProfileListener {
onProfileSimpleChanged(...args: unknown[]): void;
onProfileDetailInfoChanged(profile: User): void;
onStatusUpdate(...args: unknown[]): void;
onSelfStatusChanged(...args: unknown[]): void;
onStrangerRemarkChanged(...args: unknown[]): void;
}
export {};

View File

@@ -0,0 +1 @@
var _0x4d2437=_0x4e8e;function _0x5893(){var _0x1717b8=['5223078Ncgfpv','4035516uKwbjW','5014495BdDyqS','onStrangerRemarkChanged','11747943MZmSev','onProfileDetailInfoChanged','onStatusUpdate','2HesvFZ','2891560ArBJJH','413202SsPKua','8zbBNxQ','6IWIzzF','3659088cjMXdC'];_0x5893=function(){return _0x1717b8;};return _0x5893();}(function(_0x987d8d,_0x29d94d){var _0x1d6715=_0x4e8e,_0xc01cf0=_0x987d8d();while(!![]){try{var _0x4d8fd2=-parseInt(_0x1d6715(0x1d2))/0x1*(-parseInt(_0x1d6715(0x1c7))/0x2)+parseInt(_0x1d6715(0x1cc))/0x3+-parseInt(_0x1d6715(0x1ca))/0x4+-parseInt(_0x1d6715(0x1cd))/0x5*(parseInt(_0x1d6715(0x1c9))/0x6)+-parseInt(_0x1d6715(0x1cb))/0x7+-parseInt(_0x1d6715(0x1c8))/0x8*(-parseInt(_0x1d6715(0x1cf))/0x9)+parseInt(_0x1d6715(0x1d3))/0xa;if(_0x4d8fd2===_0x29d94d)break;else _0xc01cf0['push'](_0xc01cf0['shift']());}catch(_0x6cb389){_0xc01cf0['push'](_0xc01cf0['shift']());}}}(_0x5893,0xa8388));function _0x4e8e(_0x504f07,_0x4e0d5b){var _0x589391=_0x5893();return _0x4e8e=function(_0x4e8e00,_0x578f3e){_0x4e8e00=_0x4e8e00-0x1c7;var _0x1511aa=_0x589391[_0x4e8e00];return _0x1511aa;},_0x4e8e(_0x504f07,_0x4e0d5b);}export class ProfileListener{['onProfileSimpleChanged'](..._0x554eb1){}[_0x4d2437(0x1d0)](_0x2321bd){}[_0x4d2437(0x1d1)](..._0x4019c8){}['onSelfStatusChanged'](..._0x1af695){}[_0x4d2437(0x1ce)](..._0x5ff72d){}}

View File

@@ -0,0 +1,19 @@
export interface ISessionListener {
onNTSessionCreate(args: unknown): void;
onGProSessionCreate(args: unknown): void;
onSessionInitComplete(args: unknown): void;
onOpentelemetryInit(args: unknown): void;
onUserOnlineResult(args: unknown): void;
onGetSelfTinyId(args: unknown): void;
}
export interface NodeIKernelSessionListener extends ISessionListener {
new (adapter: ISessionListener): NodeIKernelSessionListener;
}
export declare class SessionListener implements ISessionListener {
onNTSessionCreate(args: unknown): void;
onGProSessionCreate(args: unknown): void;
onSessionInitComplete(args: unknown): void;
onOpentelemetryInit(args: unknown): void;
onUserOnlineResult(args: unknown): void;
onGetSelfTinyId(args: unknown): void;
}

View File

@@ -0,0 +1 @@
function _0x3ad8(){var _0x5f424d=['onGetSelfTinyId','2657920hsdvve','onGProSessionCreate','5021274lfCVdQ','507369BdWwsV','6650805RtUhyS','4OVoKSH','onNTSessionCreate','5042968UkMuTf','5tiUPxm','742541DHFUvu','1447119PxRCmQ'];_0x3ad8=function(){return _0x5f424d;};return _0x3ad8();}var _0x374c8f=_0x5b10;(function(_0x3b86db,_0x55a50f){var _0x15e561=_0x5b10,_0x1869ab=_0x3b86db();while(!![]){try{var _0x1d2c26=-parseInt(_0x15e561(0x19c))/0x1+parseInt(_0x15e561(0x198))/0x2*(-parseInt(_0x15e561(0x196))/0x3)+parseInt(_0x15e561(0x193))/0x4+parseInt(_0x15e561(0x19b))/0x5*(parseInt(_0x15e561(0x195))/0x6)+parseInt(_0x15e561(0x197))/0x7+-parseInt(_0x15e561(0x19a))/0x8+-parseInt(_0x15e561(0x19d))/0x9;if(_0x1d2c26===_0x55a50f)break;else _0x1869ab['push'](_0x1869ab['shift']());}catch(_0x331744){_0x1869ab['push'](_0x1869ab['shift']());}}}(_0x3ad8,0x8d7c5));function _0x5b10(_0x2ec80,_0x28b47c){var _0x3ad802=_0x3ad8();return _0x5b10=function(_0x5b105b,_0x22d503){_0x5b105b=_0x5b105b-0x192;var _0x32a031=_0x3ad802[_0x5b105b];return _0x32a031;},_0x5b10(_0x2ec80,_0x28b47c);}export class SessionListener{[_0x374c8f(0x199)](_0xe67085){}[_0x374c8f(0x194)](_0x243462){}['onSessionInitComplete'](_0x48072c){}['onOpentelemetryInit'](_0x100d43){}['onUserOnlineResult'](_0x15917b){}[_0x374c8f(0x192)](_0x2efccf){}}

View File

@@ -0,0 +1,6 @@
export * from './NodeIKernelSessionListener';
export * from './NodeIKernelLoginListener';
export * from './NodeIKernelMsgListener';
export * from './NodeIKernelGroupListener';
export * from './NodeIKernelBuddyListener';
export * from './NodeIKernelProfileListener ';

View File

@@ -0,0 +1 @@
function _0x246e(){var _0x5aa9c5=['72fNXJDi','13028608uTlZIj','338315poUzwx','6pnAcpd','4SikUcf','4657566KkUoZt','12883731ErwJfz','8333082lGbVxJ','20435790CPVluX','31058ZEXaUi'];_0x246e=function(){return _0x5aa9c5;};return _0x246e();}(function(_0x159bb7,_0x810ae4){var _0x40206b=_0x34fb,_0x13b030=_0x159bb7();while(!![]){try{var _0x43764b=-parseInt(_0x40206b(0x1b3))/0x1*(-parseInt(_0x40206b(0x1b4))/0x2)+parseInt(_0x40206b(0x1b9))/0x3*(-parseInt(_0x40206b(0x1b8))/0x4)+-parseInt(_0x40206b(0x1b6))/0x5*(-parseInt(_0x40206b(0x1b7))/0x6)+parseInt(_0x40206b(0x1ba))/0x7+-parseInt(_0x40206b(0x1b5))/0x8+-parseInt(_0x40206b(0x1bb))/0x9+parseInt(_0x40206b(0x1bc))/0xa;if(_0x43764b===_0x810ae4)break;else _0x13b030['push'](_0x13b030['shift']());}catch(_0x2f90b9){_0x13b030['push'](_0x13b030['shift']());}}}(_0x246e,0xeb133));function _0x34fb(_0x4e1f00,_0x4dec5f){var _0x246e4c=_0x246e();return _0x34fb=function(_0x34fbca,_0x359e1d){_0x34fbca=_0x34fbca-0x1b3;var _0x367d20=_0x246e4c[_0x34fbca];return _0x367d20;},_0x34fb(_0x4e1f00,_0x4dec5f);}export*from'./NodeIKernelSessionListener';export*from'./NodeIKernelLoginListener';export*from'./NodeIKernelMsgListener';export*from'./NodeIKernelGroupListener';export*from'./NodeIKernelBuddyListener';export*from'./NodeIKernelProfileListener\x20';

View File

@@ -0,0 +1,17 @@
export interface NodeIKernelAvatarService {
addAvatarListener(...args: unknown[]): unknown;
removeAvatarListener(...args: unknown[]): unknown;
getAvatarPath(...args: unknown[]): unknown;
forceDownloadAvatar(...args: unknown[]): unknown;
getGroupAvatarPath(...args: unknown[]): unknown;
getConfGroupAvatarPath(...args: unknown[]): unknown;
forceDownloadGroupAvatar(...args: unknown[]): unknown;
getGroupPortraitPath(...args: unknown[]): unknown;
forceDownloadGroupPortrait(...args: unknown[]): unknown;
getAvatarPaths(...args: unknown[]): unknown;
getGroupAvatarPaths(...args: unknown[]): unknown;
getConfGroupAvatarPaths(...args: unknown[]): unknown;
getAvatarPathByUin(...args: unknown[]): unknown;
forceDownloadAvatarByUin(...args: unknown[]): unknown;
isNull(): boolean;
}

View File

@@ -0,0 +1 @@
export{};

Some files were not shown because too many files have changed in this diff Show More