mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-07-19 12:03:37 +00:00
Compare commits
293 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
fd7d2dbf53 | ||
![]() |
6609697752 | ||
![]() |
dcd6e1973e | ||
![]() |
3614a6e932 | ||
![]() |
931a0210e5 | ||
![]() |
f9e7de4b42 | ||
![]() |
8e0b79594e | ||
![]() |
17122c4360 | ||
![]() |
154f7b6a30 | ||
![]() |
52e5543d0b | ||
![]() |
3c304bd2ae | ||
![]() |
26609bb8fd | ||
![]() |
de3fa9aaa4 | ||
![]() |
788665f84c | ||
![]() |
3943782971 | ||
![]() |
8f899c40f2 | ||
![]() |
a1f582399e | ||
![]() |
440b63f662 | ||
![]() |
7d2cc3b56b | ||
![]() |
5fe3422469 | ||
![]() |
6c02cedb1e | ||
![]() |
3cc2f1dcad | ||
![]() |
773cdc5877 | ||
![]() |
361a7329d7 | ||
![]() |
29910f1236 | ||
![]() |
4a164016f5 | ||
![]() |
cebd3e62a4 | ||
![]() |
2562a38fa1 | ||
![]() |
d46c922bbf | ||
![]() |
66b59982f7 | ||
![]() |
ad397ccf7f | ||
![]() |
bdef80ede7 | ||
![]() |
385dcbc75a | ||
![]() |
74cf501c8f | ||
![]() |
0c200d6748 | ||
![]() |
e65a36c517 | ||
![]() |
126b54ad40 | ||
![]() |
78637751af | ||
![]() |
f96526ee3a | ||
![]() |
b3c7a91f3d | ||
![]() |
b8daeef0c4 | ||
![]() |
2b662944cf | ||
![]() |
3d516df01e | ||
![]() |
26b4a9b15b | ||
![]() |
0f8af273ae | ||
![]() |
fa29a31da9 | ||
![]() |
9e0d2606d8 | ||
![]() |
338dedd6e0 | ||
![]() |
1f893b1393 | ||
![]() |
b783d6f928 | ||
![]() |
8ca0d40f05 | ||
![]() |
2f40a80434 | ||
![]() |
812d8eb5bb | ||
![]() |
bf5f548349 | ||
![]() |
ebf90e72b9 | ||
![]() |
31d7d42edf | ||
![]() |
833875b42f | ||
![]() |
b901c10f3c | ||
![]() |
8ab678bd97 | ||
![]() |
55d5072f46 | ||
![]() |
a379ffd0f2 | ||
![]() |
4501d73134 | ||
![]() |
5f15774ec7 | ||
![]() |
c9e057599e | ||
![]() |
66851f5625 | ||
![]() |
b33c235b4d | ||
![]() |
d6693b6114 | ||
![]() |
36b4d26c78 | ||
![]() |
617592d90a | ||
![]() |
15a77b8070 | ||
![]() |
606eccd22b | ||
![]() |
5613450313 | ||
![]() |
c59b5564af | ||
![]() |
330b086b8b | ||
![]() |
9837ef4f36 | ||
![]() |
add46b3251 | ||
![]() |
e169199107 | ||
![]() |
92fe654850 | ||
![]() |
b257486404 | ||
![]() |
bdf2e33f40 | ||
![]() |
224d361923 | ||
![]() |
3452fa56df | ||
![]() |
cd256235da | ||
![]() |
361a164f2a | ||
![]() |
0e60d4b198 | ||
![]() |
67b47e39b4 | ||
![]() |
8f54310f63 | ||
![]() |
c7a7494d7e | ||
![]() |
af88b3166d | ||
![]() |
b7837b2a14 | ||
![]() |
950ddc749e | ||
![]() |
df081ef0cf | ||
![]() |
7b24f90d9f | ||
![]() |
f2e4579fd8 | ||
![]() |
97cb351827 | ||
![]() |
c1ec53fdbb | ||
![]() |
98214aa429 | ||
![]() |
ce7deac2dd | ||
![]() |
612092b867 | ||
![]() |
92579d5949 | ||
![]() |
9ab07060ae | ||
![]() |
0d45125d79 | ||
![]() |
9ced152778 | ||
![]() |
3685ab2e3e | ||
![]() |
be605f11f2 | ||
![]() |
8cca8df976 | ||
![]() |
990a31e961 | ||
![]() |
5db201c342 | ||
![]() |
a625e30dd4 | ||
![]() |
b236cdd060 | ||
![]() |
2db9899184 | ||
![]() |
fe5d6db986 | ||
![]() |
7c7bf8fecf | ||
![]() |
76e3a46378 | ||
![]() |
16f3897fec | ||
![]() |
045e120854 | ||
![]() |
2b7fcce9b2 | ||
![]() |
9685931694 | ||
![]() |
1dc844435a | ||
![]() |
18892379de | ||
![]() |
620d61c8dc | ||
![]() |
9f91398875 | ||
![]() |
a29b1154a9 | ||
![]() |
34d19a471a | ||
![]() |
2ef6477d7c | ||
![]() |
26e6800836 | ||
![]() |
9dbbcf3872 | ||
![]() |
6b3343e1e4 | ||
![]() |
ef48f754a5 | ||
![]() |
3be1ede847 | ||
![]() |
7bff1b61e8 | ||
![]() |
6affd0eb68 | ||
![]() |
0a112d15e0 | ||
![]() |
4e03f582bb | ||
![]() |
8f186c1c5e | ||
![]() |
cd1bae9a1f | ||
![]() |
60796c26ca | ||
![]() |
28927f950d | ||
![]() |
95f16ebc8c | ||
![]() |
25bca8385d | ||
![]() |
965c7f23b4 | ||
![]() |
33082af9cc | ||
![]() |
1f7f3565b0 | ||
![]() |
f784363696 | ||
![]() |
37bd51e138 | ||
![]() |
c367728c43 | ||
![]() |
61f0f5d884 | ||
![]() |
5f2ebeead7 | ||
![]() |
7646037fc7 | ||
![]() |
eac6d285ff | ||
![]() |
b921d5e734 | ||
![]() |
831d808e63 | ||
![]() |
451b88d7e3 | ||
![]() |
f916682a71 | ||
![]() |
2d76bcf0cf | ||
![]() |
8db294efe6 | ||
![]() |
5cc5149aed | ||
![]() |
7ecb01dc9f | ||
![]() |
8bf1a545d9 | ||
![]() |
efb2be2f94 | ||
![]() |
bd2edda494 | ||
![]() |
991172eae4 | ||
![]() |
fc7631f9aa | ||
![]() |
a21efb7d2f | ||
![]() |
03bc844ad0 | ||
![]() |
f7bdc35ed6 | ||
![]() |
0efdffd857 | ||
![]() |
6a16a42d0c | ||
![]() |
e9c00c72b1 | ||
![]() |
ab22f36b8a | ||
![]() |
c57497cd91 | ||
![]() |
ba123236e5 | ||
![]() |
338b6e4607 | ||
![]() |
f88c717560 | ||
![]() |
f8ffc92db5 | ||
![]() |
98c23c172c | ||
![]() |
781c107d8c | ||
![]() |
186668c075 | ||
![]() |
cf9f785193 | ||
![]() |
72d2d3f224 | ||
![]() |
087c76b394 | ||
![]() |
4f9fb2c8c3 | ||
![]() |
334e43e764 | ||
![]() |
7843256402 | ||
![]() |
0522ba35fe | ||
![]() |
24d3b52e0b | ||
![]() |
3177110f0f | ||
![]() |
e1b8243a67 | ||
![]() |
b1c6ce3885 | ||
![]() |
0b4b25a11e | ||
![]() |
1176fe984a | ||
![]() |
6ca768c3ee | ||
![]() |
3da1659c8d | ||
![]() |
9aa4cd319c | ||
![]() |
5af866cdca | ||
![]() |
2b421fa447 | ||
![]() |
30ec964325 | ||
![]() |
714d7d72eb | ||
![]() |
687aa0f363 | ||
![]() |
8363ab07a7 | ||
![]() |
c46a757339 | ||
![]() |
557864395b | ||
![]() |
3f7a85d80b | ||
![]() |
8d18d2ce1f | ||
![]() |
7141ba1587 | ||
![]() |
44d350a225 | ||
![]() |
239b8e72d9 | ||
![]() |
279bdb6fb1 | ||
![]() |
a0cea819da | ||
![]() |
9ab7f60544 | ||
![]() |
aaf7191bf3 | ||
![]() |
628c9be0c8 | ||
![]() |
733052720c | ||
![]() |
a10f007194 | ||
![]() |
6fa50c58d3 | ||
![]() |
c54a58d6e4 | ||
![]() |
34cb1ea3fd | ||
![]() |
f640b0ca91 | ||
![]() |
60e16da42e | ||
![]() |
0cdceb95d6 | ||
![]() |
70bd22d925 | ||
![]() |
82462dd647 | ||
![]() |
c0466e943d | ||
![]() |
b187b4695d | ||
![]() |
b1956d2a37 | ||
![]() |
590b622e5f | ||
![]() |
3d8174396a | ||
![]() |
b8dc6e9bd9 | ||
![]() |
8ee99109dc | ||
![]() |
902041d4ee | ||
![]() |
cc34aef47e | ||
![]() |
0afbbe7c7a | ||
![]() |
8004553ba7 | ||
![]() |
0023b2846a | ||
![]() |
34775c1816 | ||
![]() |
e0759e704b | ||
![]() |
0aa225ca78 | ||
![]() |
b43b4ee5c0 | ||
![]() |
0cdb8cecbf | ||
![]() |
fd6a306742 | ||
![]() |
7f3b3d2277 | ||
![]() |
8be5b977bf | ||
![]() |
d7ddb15f9c | ||
![]() |
9a6a1798d0 | ||
![]() |
14196fd349 | ||
![]() |
941b89a523 | ||
![]() |
a5f9e5f8c0 | ||
![]() |
80c3356c8f | ||
![]() |
914136b750 | ||
![]() |
f9a60795f5 | ||
![]() |
19640927c7 | ||
![]() |
22faac7e36 | ||
![]() |
30d260ab32 | ||
![]() |
115120d066 | ||
![]() |
1327844736 | ||
![]() |
29904f3cb7 | ||
![]() |
50395594b7 | ||
![]() |
9360af88b3 | ||
![]() |
376370336c | ||
![]() |
70df6e3302 | ||
![]() |
0a1fc2dc12 | ||
![]() |
9857f6e437 | ||
![]() |
56d6ebe916 | ||
![]() |
81134ea2d4 | ||
![]() |
a9f3e7fc54 | ||
![]() |
eb84e2f8c9 | ||
![]() |
61cfa0e86d | ||
![]() |
0a01b8ade9 | ||
![]() |
1457efa9a4 | ||
![]() |
fa5c7add7a | ||
![]() |
d644eba4d1 | ||
![]() |
9c422c1a8f | ||
![]() |
b6db37202f | ||
![]() |
4ca3891089 | ||
![]() |
4c7ed01776 | ||
![]() |
45c922c377 | ||
![]() |
f854c258bd | ||
![]() |
a643fac073 | ||
![]() |
861f105bea | ||
![]() |
bf10ce9f1e | ||
![]() |
ccf521d0a8 | ||
![]() |
6075d98eaa | ||
![]() |
a3801fc243 | ||
![]() |
a1f0c05f3a | ||
![]() |
a568c96929 | ||
![]() |
d58bcf3c0e | ||
![]() |
985f2e6436 | ||
![]() |
ad441fa793 | ||
![]() |
316300cc86 | ||
![]() |
5c4f37b234 | ||
![]() |
77b51a072d | ||
![]() |
2536e1ae6a | ||
![]() |
14822c9599 |
@@ -1,21 +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|crlf
|
||||
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.
|
||||
# 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.
|
||||
|
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: "Build"
|
||||
name: "Build Action"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
|
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: "release"
|
||||
name: "Build Release"
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -130,6 +130,7 @@ jobs:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
body_path: CHANGELOG.md
|
||||
files: |
|
||||
NapCat.win32.ia32.zip
|
||||
NapCat.win32.x64.zip
|
||||
NapCat.linux.x64.zip
|
||||
NapCat.linux.arm64.zip
|
||||
|
69
.github/workflows/test.yml
vendored
Normal file
69
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,69 @@
|
||||
name: "Build Test"
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
build-linux:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target_platform: [linux]
|
||||
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
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target_platform: [win32]
|
||||
target_arch: [x64,ia32]
|
||||
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
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -14,4 +14,5 @@ dist/
|
||||
|
||||
# Build
|
||||
*.db
|
||||
checkVersion.sh
|
||||
checkVersion.sh
|
||||
bun.lockb
|
||||
|
4
.gitmodules
vendored
4
.gitmodules
vendored
@@ -1,4 +0,0 @@
|
||||
[submodule "src/core"]
|
||||
path = src/core
|
||||
url = https://github.com/NapNeko/core.git
|
||||
branch = master
|
11
docs/changelogs/CHANGELOG.v1.7.5.md
Normal file
11
docs/changelogs/CHANGELOG.v1.7.5.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# v1.7.5
|
||||
|
||||
QQ Version: Windows 9.9.15-26702 / Linux 3.2.12-26702
|
||||
|
||||
## 启动的方式
|
||||
Way03/Way05
|
||||
|
||||
## 新增与调整
|
||||
1. 支持 9.9.15/3.2.12 版本QQ
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
11
docs/changelogs/old/CHANGELOG.v1.6.1.md
Normal file
11
docs/changelogs/old/CHANGELOG.v1.6.1.md
Normal file
@@ -0,0 +1,11 @@
|
||||
# v1.6.1
|
||||
|
||||
QQ Version: Windows 9.9.11-24815 / Linux 3.2.9-24815
|
||||
|
||||
## 修复与优化
|
||||
|
||||
|
||||
## 新增与调整
|
||||
* 修复poke异常事件
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
13
docs/changelogs/old/CHANGELOG.v1.6.2.md
Normal file
13
docs/changelogs/old/CHANGELOG.v1.6.2.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# v1.6.2
|
||||
|
||||
QQ Version: Windows 9.9.11-24815 / Linux 3.2.9-24815
|
||||
|
||||
## 修复与优化
|
||||
* 修复获取Cookies异常崩溃问题
|
||||
* 尝试修复成员退群缓存问题
|
||||
* 修复自身退群后群缓存清理问题
|
||||
|
||||
## 新增与调整
|
||||
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
13
docs/changelogs/old/CHANGELOG.v1.6.3.md
Normal file
13
docs/changelogs/old/CHANGELOG.v1.6.3.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# v1.6.3
|
||||
|
||||
QQ Version: Windows 9.9.11-24815 / Linux 3.2.9-24815
|
||||
|
||||
## 修复与优化
|
||||
* 修复带有groupid的私聊消息异常发送到群聊消息
|
||||
* 尝试修复rws热重载失效问题
|
||||
* 尝试修复进群事件无法正常获取uin
|
||||
|
||||
## 新增与调整
|
||||
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
18
docs/changelogs/old/CHANGELOG.v1.6.4.md
Normal file
18
docs/changelogs/old/CHANGELOG.v1.6.4.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# v1.6.4
|
||||
|
||||
QQ Version: Windows 9.9.12-26000 / Linux 3.2.9-26000
|
||||
## 使用前警告
|
||||
1. 在最近版本由于QQ本体大幅变动,为了保证NapCat可用性,NapCat近期启动与安装方式将将大幅变动,请关注文档和社群获取。
|
||||
2. 在Core上完全执行开源,请不要用于违法用途,如此可能造成NapCat完全停止更新。
|
||||
3. 针对原启动方式的围堵,NapCat研发了多种方式,除此其余理论与扩展的分析和思路将部分展示于Docs,以便各位参与开发与维护NapCat。
|
||||
## 其余·备注
|
||||
启动方式: WayBoot.03 (Electron Main进程为Node 直接注入代码 同理项目: LiteLoader)
|
||||
|
||||
## 修复与优化
|
||||
1. 支持Win平台 9.9.12
|
||||
2. 修复部分发送图片下载异常情况
|
||||
|
||||
## 新增与调整
|
||||
没有哦
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
18
docs/changelogs/old/CHANGELOG.v1.6.5.md
Normal file
18
docs/changelogs/old/CHANGELOG.v1.6.5.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# v1.6.5
|
||||
|
||||
QQ Version: Windows 9.9.12-26000 / Linux 3.2.9-26000
|
||||
## 使用前警告
|
||||
1. 在最近版本由于QQ本体大幅变动,为了保证NapCat可用性,NapCat近期启动与安装方式将将大幅变动,请关注文档和社群获取。
|
||||
2. 在Core上完全执行开源,请不要用于违法用途,如此可能造成NapCat完全停止更新。
|
||||
3. 针对原启动方式的围堵,NapCat研发了多种方式,除此其余理论与扩展的分析和思路将部分展示于Docs,以便各位参与开发与维护NapCat。
|
||||
## 其余·备注
|
||||
启动方式: WayBoot.03 (Electron Main进程为Node 直接注入代码 同理项目: LiteLoader)
|
||||
|
||||
## 修复与优化
|
||||
1. 优化了WrapperNative载入代码
|
||||
2. 优化缓存
|
||||
|
||||
## 新增与调整
|
||||
没有哦
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
17
docs/changelogs/old/CHANGELOG.v1.6.6.md
Normal file
17
docs/changelogs/old/CHANGELOG.v1.6.6.md
Normal file
@@ -0,0 +1,17 @@
|
||||
# v1.6.6
|
||||
|
||||
QQ Version: Windows 9.9.12-26000 / Linux 3.2.9-26000
|
||||
## 使用前警告
|
||||
1. 在最近版本由于QQ本体大幅变动,为了保证NapCat可用性,NapCat近期启动与安装方式将将大幅变动,请关注文档和社群获取。
|
||||
2. 在Core上完全执行开源,请不要用于违法用途,如此可能造成NapCat完全停止更新。
|
||||
3. 针对原启动方式的围堵,NapCat研发了多种方式,除此其余理论与扩展的分析和思路将部分展示于Docs,以便各位参与开发与维护NapCat。
|
||||
## 其余·备注
|
||||
启动方式: WayBoot.03 (Electron Main进程为Node 直接注入代码 同理项目: LiteLoader)
|
||||
|
||||
## 修复与优化
|
||||
1. 修复了一些问题
|
||||
|
||||
## 新增与调整
|
||||
没有哦
|
||||
|
||||
新增的 API 详细见[API文档](https://napneko.github.io/zh-CN/develop/extends_api)
|
@@ -1,2 +0,0 @@
|
||||
# 开始
|
||||
jadx 跳转于 `com.tencent.qqnt.kernel.*`
|
@@ -1,42 +0,0 @@
|
||||
# Android
|
||||
```java
|
||||
GroupMemberExtReq groupMemberExtReq = new GroupMemberExtReq();
|
||||
groupMemberExtReq.sourceType = MemberExtSourceType.TITLETYPE.ordinal();
|
||||
groupMemberExtReq.groupCode = longOrNull.longValue();
|
||||
groupMemberExtReq.beginUin = "0";
|
||||
groupMemberExtReq.dataTime = "0";
|
||||
Long[] lArr = new Long[1];
|
||||
AppInterface a2 = dVar.a();
|
||||
lArr[0] = Long.valueOf(a2 != null ? a2.getLongAccountUin() : 0L);
|
||||
arrayListOf = CollectionsKt__CollectionsKt.arrayListOf(lArr);
|
||||
groupMemberExtReq.uinList = arrayListOf;
|
||||
MemberExtInfoFilter memberExtInfoFilter = new MemberExtInfoFilter();
|
||||
memberExtInfoFilter.memberLevelInfoUin = 1;
|
||||
memberExtInfoFilter.memberLevelInfoPoint = 1;
|
||||
memberExtInfoFilter.memberLevelInfoActiveDay = 1;
|
||||
memberExtInfoFilter.memberLevelInfoLevel = 1;
|
||||
memberExtInfoFilter.levelName = 1;
|
||||
memberExtInfoFilter.dataTime = 1;
|
||||
memberExtInfoFilter.sysShowFlag = 1;
|
||||
memberExtInfoFilter.userShowFlag = 1;
|
||||
memberExtInfoFilter.userShowFlagNew = 1;
|
||||
memberExtInfoFilter.levelNameNew = 1;
|
||||
Unit unit = Unit.INSTANCE;
|
||||
groupMemberExtReq.memberExtFilter = memberExtInfoFilter;
|
||||
troopLevelFrequencyControl.f(troopUin, new TroopListRepo$fetchTroopLevelInfo$2(b2, groupMemberExtReq, troopUin, new com.tencent.qqnt.troopmemberlist.report.c("fetchTroopLevelInfo")));
|
||||
```
|
||||
# Win
|
||||
参数解析位于 sub_181456A10(24108) -> wrapper.node(24108)+1456A10
|
||||
IGroupService.GetMemberExt(param: object);
|
||||
param展开如下
|
||||
```
|
||||
groupCode string
|
||||
beginUin string
|
||||
dataTime string
|
||||
uinList Array<string>
|
||||
uinNum string
|
||||
groupType string
|
||||
richCardNameVer string
|
||||
sourceType number
|
||||
memberExtFilter object// 参数解析位于 sub_18145A6D0(24108) -> wrapper.node(24108)+145A6D0
|
||||
```
|
@@ -1,3 +1,4 @@
|
||||
|
||||
public static final int C2C_PIC_DOWNLOAD = 1004;
|
||||
public static final String C2C_PIC_DOWNLOAD_DOMAIN = "c2cpicdw.qpic.cn";
|
||||
public static final String C2C_PIC_DOWNLOAD_QUIC_DOMAIN = "c2cpicdw.quic.qpic.cn";
|
||||
|
16
docs/develop/NC 1.6.X的计划.md
Normal file
16
docs/develop/NC 1.6.X的计划.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# 开发方向
|
||||
方向一 NativeCall/Hook:
|
||||
1. 崩溃检测机制的实现
|
||||
2. Api_Caller 的Hook 可以拿到Event/Handler 进一步提升NC 即时的拦截与处理一些事件比如ReCall拦截
|
||||
3. Node包装层 进一步分析,拿到脱离自带Listener/Adapter,可以拿到一些更加底层的数据变动 或许包括更多二进制数据
|
||||
|
||||
方向二 全新的无头启动 Way01
|
||||
1. 基于Node启动原理,借助导出符号获取函数地址 再次还原NodeMain
|
||||
|
||||
方向三 发包与收包
|
||||
1. 参考 方向一/3 大概可以收包
|
||||
2. 发包 (暂时没有计划)
|
||||
|
||||
方向四 版本控制
|
||||
1. 根据不同版本进行逻辑控制
|
||||
2. 某些参数的自动提取
|
@@ -1,24 +0,0 @@
|
||||
# 前排提示
|
||||
由于Core未处于开源,非组织人员无法参与Core开发,此处为Core开发提示
|
||||
|
||||
# 准备工具
|
||||
frida ida-pro jadx x64dbg ce 内部调试脚本
|
||||
|
||||
## ida-pro
|
||||
1. 用于快速分析入参和返回类型
|
||||
2. 通过静态QLog推测语义
|
||||
3. 提取Listener与Service (常用)
|
||||
## frida
|
||||
1. 用于动态获取QLog推测语义
|
||||
2. 捕捉Native函数 实际入参与数据 分析中间流程
|
||||
|
||||
## jadx
|
||||
1. 通过其它平台实现 静态获取QLog推测语义
|
||||
2. 提供部分未调用代码 参考
|
||||
|
||||
## x64dbg
|
||||
1. 验证IDA的Hook点
|
||||
|
||||
## 内部脚本
|
||||
1. 提取Listener与Service (不调用无类型 不推荐)
|
||||
2. 获取NT调用流程
|
8
docs/develop/碎碎的研究记录.md
Normal file
8
docs/develop/碎碎的研究记录.md
Normal file
@@ -0,0 +1,8 @@
|
||||
# Api方向
|
||||
## getMsgUniqueId √ 已应用
|
||||
getMsgUniqueId 传入时间 产出一个唯一ID 发送消息作为一个参数
|
||||
|
||||
# Native方向
|
||||
## magic_load
|
||||
## api_caller
|
||||
## NodeMain
|
14
package.json
14
package.json
@@ -2,7 +2,7 @@
|
||||
"name": "napcat",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"version": "1.6.0",
|
||||
"version": "1.7.5",
|
||||
"scripts": {
|
||||
"watch:dev": "vite --mode development",
|
||||
"watch:prod": "vite --mode production",
|
||||
@@ -19,10 +19,9 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.24.7",
|
||||
"@babel/preset-typescript": "^7.24.7",
|
||||
"vite-plugin-babel": "^1.2.0",
|
||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||
"@babel/plugin-proposal-decorators": "^7.24.7",
|
||||
"@babel/preset-typescript": "^7.24.7",
|
||||
"@log4js-node/log4js-api": "^1.0.2",
|
||||
"@protobuf-ts/plugin": "^2.9.4",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
@@ -31,9 +30,9 @@
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/figlet": "^1.5.8",
|
||||
"@types/fluent-ffmpeg": "^2.1.24",
|
||||
"@types/node": "^20.11.30",
|
||||
"@types/jest": "^29.5.12",
|
||||
"@types/node": "^22.0.0",
|
||||
"@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",
|
||||
@@ -47,6 +46,7 @@
|
||||
"rollup-plugin-obfuscator": "^1.1.0",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.2.6",
|
||||
"vite-plugin-babel": "^1.2.0",
|
||||
"vite-plugin-cp": "^4.0.8",
|
||||
"vite-plugin-dts": "^3.8.2",
|
||||
"vite-tsconfig-paths": "^4.3.2"
|
||||
@@ -64,9 +64,7 @@
|
||||
"json-schema-to-ts": "^3.1.0",
|
||||
"log4js": "^6.9.1",
|
||||
"qrcode-terminal": "^0.12.0",
|
||||
"silk-wasm": "^3.3.4",
|
||||
"sqlite3": "^5.1.7",
|
||||
"uuid": "^10.0.0",
|
||||
"silk-wasm": "^3.6.1",
|
||||
"ws": "^8.16.0"
|
||||
}
|
||||
}
|
||||
|
45
script/BootWay.03.ps1
Normal file
45
script/BootWay.03.ps1
Normal file
@@ -0,0 +1,45 @@
|
||||
# Dont Use This Script
|
||||
# 2024.7.3
|
||||
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 "get QQ path error: $_"
|
||||
}
|
||||
}
|
||||
function Select-QQPath {
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Windows.Forms.Application]::EnableVisualStyles()
|
||||
|
||||
$dialogTitle = "Select QQ.exe"
|
||||
|
||||
$filePicker = New-Object System.Windows.Forms.OpenFileDialog
|
||||
$filePicker.Title = $dialogTitle
|
||||
$filePicker.Filter = "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*"
|
||||
$filePicker.FilterIndex = 1
|
||||
$null = $filePicker.ShowDialog()
|
||||
if (-not ($filePicker.FileName)) {
|
||||
throw "User did not select an .exe file."
|
||||
}
|
||||
return $filePicker.FileName
|
||||
}
|
||||
|
||||
$params = $args -join " "
|
||||
Try {
|
||||
$QQpath = Get-QQpath
|
||||
}
|
||||
Catch {
|
||||
$QQpath = Select-QQPath
|
||||
}
|
||||
|
||||
if (!(Test-Path $QQpath)) {
|
||||
throw "provided QQ path is invalid: $QQpath"
|
||||
}
|
||||
|
||||
$Bootfile = Join-Path $PSScriptRoot "napcat.mjs"
|
||||
$env:ELECTRON_RUN_AS_NODE = 1
|
||||
$commandInfo = Get-Command $QQpath -ErrorAction Stop
|
||||
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging }"
|
123
script/BootWay05.ps1
Normal file
123
script/BootWay05.ps1
Normal file
@@ -0,0 +1,123 @@
|
||||
# 检查当前会话是否具有管理员权限
|
||||
function Test-Administrator {
|
||||
$user = [Security.Principal.WindowsIdentity]::GetCurrent()
|
||||
(New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
|
||||
}
|
||||
|
||||
if (-not (Test-Administrator)) {
|
||||
# 如果不是管理员,则重新启动脚本以管理员模式运行
|
||||
$scriptPath = $myInvocation.MyCommand.Path
|
||||
if (-not $scriptPath) {
|
||||
$scriptPath = $PSCommandPath
|
||||
}
|
||||
$newProcess = New-Object System.Diagnostics.ProcessStartInfo "powershell";
|
||||
$newProcess.Arguments = "-File `"$scriptPath`" $args"
|
||||
$newProcess.Verb = "runas";
|
||||
[System.Diagnostics.Process]::Start($newProcess);
|
||||
exit
|
||||
}
|
||||
|
||||
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 "get QQ path error: $_"
|
||||
}
|
||||
}
|
||||
function Select-QQPath {
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Windows.Forms.Application]::EnableVisualStyles()
|
||||
|
||||
$dialogTitle = "Select QQ.exe"
|
||||
|
||||
$filePicker = New-Object System.Windows.Forms.OpenFileDialog
|
||||
$filePicker.Title = $dialogTitle
|
||||
$filePicker.Filter = "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*"
|
||||
$filePicker.FilterIndex = 1
|
||||
$null = $filePicker.ShowDialog()
|
||||
if (-not ($filePicker.FileName)) {
|
||||
throw "User did not select an .exe file."
|
||||
}
|
||||
return $filePicker.FileName
|
||||
}
|
||||
|
||||
# 设置当前工作目录
|
||||
$scriptDirectory = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
|
||||
Set-Location $scriptDirectory
|
||||
|
||||
# 获取当前目录路径
|
||||
$currentPath = Get-Location
|
||||
|
||||
# 替换\为/
|
||||
$currentPath = $currentPath -replace '\\', '/'
|
||||
|
||||
# 生成JavaScript代码
|
||||
$jsCode = @"
|
||||
(async () => {
|
||||
await import('file:///$currentPath/napcat.mjs');
|
||||
})();
|
||||
"@
|
||||
|
||||
# 将JavaScript代码保存到文件中
|
||||
$jsFilePath = Join-Path $currentPath "loadScript.js"
|
||||
$jsCode | Out-File -FilePath $jsFilePath -Encoding UTF8
|
||||
|
||||
Write-Output "JavaScript code has been generated and saved to $jsFilePath"
|
||||
# 设置NAPCAT_PATH环境变量为 当前目录的loadScript.js地址
|
||||
$env:NAPCAT_PATH = $jsFilePath
|
||||
|
||||
$params = $args -join " "
|
||||
Try {
|
||||
$QQpath = Get-QQpath
|
||||
}
|
||||
Catch {
|
||||
$QQpath = Select-QQPath
|
||||
}
|
||||
# 拿不到QQ路径则退出
|
||||
if (!(Test-Path $QQpath)) {
|
||||
Write-Output "provided QQ path is invalid: $QQpath"
|
||||
Read-Host "Press any key to continue..."
|
||||
exit
|
||||
}
|
||||
|
||||
$commandInfo = Get-Command $QQpath -ErrorAction Stop
|
||||
|
||||
# 收集dbghelp.dll路径和HASH信息
|
||||
$QQpath = Split-Path $QQpath
|
||||
$oldDllPath = Join-Path $QQpath "dbghelp.dll"
|
||||
$oldDllHash = Get-FileHash $oldDllPath -Algorithm MD5
|
||||
$newDllPath = Join-Path $currentPath "dbghelp.dll"
|
||||
$newDllHash = Get-FileHash $newDllPath -Algorithm MD5
|
||||
# 如果文件一致则跳过
|
||||
if ($oldDllHash.Hash -ne $newDllHash.Hash) {
|
||||
$processes = Get-Process -Name QQ -ErrorAction SilentlyContinue
|
||||
if ($processes) {
|
||||
# 文件占用则退出
|
||||
Write-Output "dbghelp.dll is in use by the following processes:"
|
||||
$processes | ForEach-Object { Write-Output "$($_.Id) $($_.Name) $($_.Path)" }
|
||||
Write-Output "dbghelp.dll is in use, cannot continue."
|
||||
Read-Host "Press any key to continue..."
|
||||
exit
|
||||
} else {
|
||||
# 文件未占用则尝试覆盖
|
||||
try {
|
||||
Copy-Item -Path "$newDllPath" -Destination "$oldDllPath" -Force
|
||||
Write-Output "dbghelp.dll has been copied to $QQpath"
|
||||
} catch {
|
||||
Write-Output "Failed to copy dbghelp.dll: $_"
|
||||
Read-Host "Press any key to continue..."
|
||||
exit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# 带参数启动QQ
|
||||
try {
|
||||
Start-Process powershell -ArgumentList '-noexit', '-noprofile', "-command &{& chcp 65001;& '$($commandInfo.Path)' --enable-logging $params}" -NoNewWindow -ErrorAction Stop
|
||||
} catch {
|
||||
Write-Output "Failed to start process as administrator: $_"
|
||||
Read-Host "Press any key to continue..."
|
||||
}
|
28
script/NapCat.164.bat
Normal file
28
script/NapCat.164.bat
Normal file
@@ -0,0 +1,28 @@
|
||||
@echo off
|
||||
chcp 65001
|
||||
:: 检查是否有管理员权限
|
||||
net session >nul 2>&1
|
||||
if %errorlevel% neq 0 (
|
||||
echo 请求管理员权限...
|
||||
powershell -Command "Start-Process '%~f0' -Verb runAs"
|
||||
exit /b
|
||||
)
|
||||
:: 如果有管理员权限,继续执行
|
||||
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"
|
||||
|
||||
echo !QQPath!
|
||||
"!QQPath!" --enable-logging %*
|
||||
|
||||
pause
|
3
script/NapCat.Way01.bat
Normal file
3
script/NapCat.Way01.bat
Normal file
@@ -0,0 +1,3 @@
|
||||
REM 全新启动脚本 基于 Hook Native 预计版本1.6.0左右发布
|
||||
@echo off
|
||||
pause
|
BIN
script/dbghelp.dll
Normal file
BIN
script/dbghelp.dll
Normal file
Binary file not shown.
20
script/index.js
Normal file
20
script/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
// --------------------
|
||||
// 2024.7.3 9.9.12 BootWay.03 其余方法暂不公开(此方案为临时方案 Win平台已验证)
|
||||
// 缺陷 (已知)
|
||||
// 1.与非入侵式不同 现在破坏本体代码
|
||||
// 2.重启代码与正常启动代码失效
|
||||
// 3.Win需要补丁
|
||||
// 4.更新后丢失内容 需要重写此文件
|
||||
// 5.安装难度上升与周围基础设施失效
|
||||
// --------------------
|
||||
|
||||
const path = require('path');
|
||||
const CurrentPath = path.dirname(__filename)
|
||||
const hasNapcatParam = process.argv.includes('--enable-logging');
|
||||
if (hasNapcatParam) {
|
||||
(async () => {
|
||||
await import("file://" + path.join(CurrentPath, './napcat/napcat.mjs'));
|
||||
})();
|
||||
} else {
|
||||
require('./launcher.node').load('external_index', module);
|
||||
}
|
18
script/napcat-9912-utf8.bat
Normal file
18
script/napcat-9912-utf8.bat
Normal 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!"
|
||||
cd /d !QQPath!
|
||||
echo !QQPath!
|
||||
QQ.exe --enable-logging %*
|
41
script/napcat-9912-utf8.ps1
Normal file
41
script/napcat-9912-utf8.ps1
Normal file
@@ -0,0 +1,41 @@
|
||||
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) + "\"
|
||||
}
|
||||
catch {
|
||||
throw "get QQ path error: $_"
|
||||
}
|
||||
}
|
||||
function Select-QQPath {
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Windows.Forms.Application]::EnableVisualStyles()
|
||||
|
||||
$dialogTitle = "Select QQ.exe"
|
||||
|
||||
$filePicker = New-Object System.Windows.Forms.OpenFileDialog
|
||||
$filePicker.Title = $dialogTitle
|
||||
$filePicker.Filter = "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*"
|
||||
$filePicker.FilterIndex = 1
|
||||
$null = $filePicker.ShowDialog()
|
||||
if (-not ($filePicker.FileName)) {
|
||||
throw "User did not select an .exe file."
|
||||
}
|
||||
return $filePicker.FileName
|
||||
}
|
||||
|
||||
$params = $args -join " "
|
||||
Try {
|
||||
$QQpath = Get-QQpath
|
||||
}
|
||||
Catch {
|
||||
$QQpath = Select-QQPath
|
||||
}
|
||||
|
||||
if (!(Test-Path $QQpath)) {
|
||||
throw "provided QQ path is invalid: $QQpath"
|
||||
}
|
||||
|
||||
Set-Location -Path $QQpath
|
||||
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& chcp 65001;& ./QQ.exe --enable-logging $params}"
|
17
script/napcat-9912.bat
Normal file
17
script/napcat-9912.bat
Normal 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!
|
||||
cd /d !QQPath!
|
||||
echo !QQPath!
|
||||
QQ.exe --enable-logging %*
|
41
script/napcat-9912.ps1
Normal file
41
script/napcat-9912.ps1
Normal file
@@ -0,0 +1,41 @@
|
||||
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) + "\"
|
||||
}
|
||||
catch {
|
||||
throw "get QQ path error: $_"
|
||||
}
|
||||
}
|
||||
function Select-QQPath {
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Windows.Forms.Application]::EnableVisualStyles()
|
||||
|
||||
$dialogTitle = "Select QQ.exe"
|
||||
|
||||
$filePicker = New-Object System.Windows.Forms.OpenFileDialog
|
||||
$filePicker.Title = $dialogTitle
|
||||
$filePicker.Filter = "Executable Files (*.exe)|*.exe|All Files (*.*)|*.*"
|
||||
$filePicker.FilterIndex = 1
|
||||
$null = $filePicker.ShowDialog()
|
||||
if (-not ($filePicker.FileName)) {
|
||||
throw "User did not select an .exe file."
|
||||
}
|
||||
return $filePicker.FileName
|
||||
}
|
||||
|
||||
$params = $args -join " "
|
||||
Try {
|
||||
$QQpath = Get-QQpath
|
||||
}
|
||||
Catch {
|
||||
$QQpath = Select-QQPath
|
||||
}
|
||||
|
||||
if (!(Test-Path $QQpath)) {
|
||||
throw "provided QQ path is invalid: $QQpath"
|
||||
}
|
||||
|
||||
Set-Location -Path $QQpath
|
||||
Start-Process powershell -ArgumentList "-noexit", "-noprofile", "-command &{& ./QQ.exe --enable-logging $params}"
|
@@ -9,7 +9,15 @@ type RegisterHandler = (res: Response, payload: any) => Promise<any>
|
||||
export abstract class HttpServerBase {
|
||||
name: string = 'NapCatQQ';
|
||||
private readonly expressAPP: Express;
|
||||
private server: http.Server | null = null;
|
||||
private _server: http.Server | null = null;
|
||||
|
||||
public get server(): http.Server | null {
|
||||
return this._server;
|
||||
}
|
||||
|
||||
private set server(value: http.Server | null) {
|
||||
this._server = value;
|
||||
}
|
||||
|
||||
constructor() {
|
||||
this.expressAPP = express();
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import { WebSocket, WebSocketServer } from 'ws';
|
||||
import http from 'http';
|
||||
import urlParse from 'url';
|
||||
import { IncomingMessage } from 'node:http';
|
||||
import { log } from '@/common/utils/log';
|
||||
@@ -27,17 +28,36 @@ export class WebsocketServerBase {
|
||||
constructor() {
|
||||
}
|
||||
|
||||
start(port: number, host: string = '') {
|
||||
try {
|
||||
this.ws = new WebSocketServer({
|
||||
port,
|
||||
host: '',
|
||||
maxPayload: 1024 * 1024 * 1024
|
||||
}).on('error', () => {
|
||||
});
|
||||
log(`ws服务启动成功, ${host}:${port}`);
|
||||
} catch (e: any) {
|
||||
throw Error('ws服务启动失败, 请检查监听的ip和端口' + e.toString());
|
||||
start(port: number | http.Server, host: string = '') {
|
||||
if (port instanceof http.Server) {
|
||||
try {
|
||||
const wss = new WebSocketServer({
|
||||
noServer: true,
|
||||
maxPayload: 1024 * 1024 * 1024
|
||||
}).on('error', () => {
|
||||
});
|
||||
this.ws = wss;
|
||||
port.on('upgrade', function upgrade(request, socket, head) {
|
||||
wss.handleUpgrade(request, socket, head, function done(ws) {
|
||||
wss.emit('connection', ws, request);
|
||||
});
|
||||
});
|
||||
log('ws服务启动成功, 绑定到HTTP服务');
|
||||
} catch (e: any) {
|
||||
throw Error('ws服务启动失败, 可能是绑定的HTTP服务异常' + e.toString());
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
this.ws = new WebSocketServer({
|
||||
port,
|
||||
host: '',
|
||||
maxPayload: 1024 * 1024 * 1024
|
||||
}).on('error', () => {
|
||||
});
|
||||
log(`ws服务启动成功, ${host}:${port}`);
|
||||
} catch (e: any) {
|
||||
throw Error('ws服务启动失败, 请检查监听的ip和端口' + e.toString());
|
||||
}
|
||||
}
|
||||
this.ws.on('connection', (wsClient, req) => {
|
||||
const url: string = req.url!.split('?').shift() || '/';
|
||||
@@ -50,10 +70,12 @@ export class WebsocketServerBase {
|
||||
}
|
||||
|
||||
stop() {
|
||||
this.ws && this.ws.close((err) => {
|
||||
log('ws server close failed!', err);
|
||||
});
|
||||
this.ws = null;
|
||||
if (this.ws) {
|
||||
this.ws.close((err) => {
|
||||
if (err) log('ws server close failed!', err);
|
||||
});
|
||||
this.ws = null;
|
||||
}
|
||||
}
|
||||
|
||||
restart(port: number) {
|
||||
|
@@ -1,36 +0,0 @@
|
||||
import { sleep } from '@/common/utils/helper';
|
||||
import { logError } from './log';
|
||||
type AsyncQueueTask = (() => void) | (()=>Promise<void>);
|
||||
|
||||
|
||||
export class AsyncQueue {
|
||||
private tasks: (AsyncQueueTask)[] = [];
|
||||
|
||||
public addTask(task: AsyncQueueTask) {
|
||||
this.tasks.push(task);
|
||||
// console.log('addTask', this.tasks.length);
|
||||
if (this.tasks.length === 1) {
|
||||
this.runQueue().then().catch(()=>{});
|
||||
}
|
||||
}
|
||||
|
||||
private async runQueue() {
|
||||
// console.log('runQueue', this.tasks.length);
|
||||
while (this.tasks.length > 0) {
|
||||
const task = this.tasks[0];
|
||||
// console.log('typeof task', typeof task);
|
||||
try {
|
||||
const taskRet = task();
|
||||
// console.log('type of taskRet', typeof taskRet, taskRet);
|
||||
if (taskRet instanceof Promise) {
|
||||
await taskRet;
|
||||
}
|
||||
} catch (e) {
|
||||
// console.error(e);
|
||||
logError(e);
|
||||
}
|
||||
this.tasks.shift();
|
||||
await sleep(100);
|
||||
}
|
||||
}
|
||||
}
|
@@ -3,6 +3,7 @@ import fs from 'node:fs';
|
||||
import { log, logDebug, logError } from '@/common/utils/log';
|
||||
import { dirname } from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import { selfInfo } from '@/core/data';
|
||||
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
@@ -12,8 +13,9 @@ const configDir = path.resolve(__dirname, 'config');
|
||||
fs.mkdirSync(configDir, { recursive: true });
|
||||
|
||||
|
||||
export class ConfigBase<T>{
|
||||
|
||||
export class ConfigBase<T> {
|
||||
public name: string = 'default_config';
|
||||
private pathName: string | null = null; // 本次读取的文件路径
|
||||
constructor() {
|
||||
}
|
||||
|
||||
@@ -22,19 +24,28 @@ export class ConfigBase<T>{
|
||||
return null;
|
||||
}
|
||||
|
||||
getConfigDir(){
|
||||
getConfigDir() {
|
||||
const configDir = path.resolve(__dirname, 'config');
|
||||
fs.mkdirSync(configDir, { recursive: true });
|
||||
return configDir;
|
||||
}
|
||||
getConfigPath(): string {
|
||||
throw new Error('Method not implemented.');
|
||||
getConfigPath(pathName: string | null): string {
|
||||
const suffix = pathName ? `_${pathName}` : '';
|
||||
const filename = `${this.name}${suffix}.json`;
|
||||
return path.join(this.getConfigDir(), filename);
|
||||
}
|
||||
|
||||
read() {
|
||||
const configPath = this.getConfigPath();
|
||||
// 尝试加载当前账号配置
|
||||
if (this.read_from_file(selfInfo.uin, false)) return this;
|
||||
// 尝试加载默认配置
|
||||
return this.read_from_file('', true);
|
||||
}
|
||||
read_from_file(pathName: string, createIfNotExist: boolean) {
|
||||
const configPath = this.getConfigPath(pathName);
|
||||
if (!fs.existsSync(configPath)) {
|
||||
try{
|
||||
if (!createIfNotExist) return null;
|
||||
this.pathName = pathName; // 记录有效的设置文件
|
||||
try {
|
||||
fs.writeFileSync(configPath, JSON.stringify(this, this.getKeys(), 2));
|
||||
log(`配置文件${configPath}已创建\n如果修改此文件后需要重启 NapCat 生效`);
|
||||
}
|
||||
@@ -43,6 +54,7 @@ export class ConfigBase<T>{
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
try {
|
||||
const data = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
||||
logDebug(`配置文件${configPath}已加载`, data);
|
||||
@@ -61,9 +73,13 @@ export class ConfigBase<T>{
|
||||
}
|
||||
}
|
||||
|
||||
save(config: T) {
|
||||
save(config: T, overwrite: boolean = false) {
|
||||
Object.assign(this, config);
|
||||
const configPath = this.getConfigPath();
|
||||
if (overwrite) {
|
||||
// 用户要求强制写入,则变更当前文件为目标文件
|
||||
this.pathName = `${selfInfo.uin}`;
|
||||
}
|
||||
const configPath = this.getConfigPath(this.pathName);
|
||||
try {
|
||||
fs.writeFileSync(configPath, JSON.stringify(this, this.getKeys(), 2));
|
||||
} catch (e: any) {
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import { NodeIKernelMsgListener } from '@/core';
|
||||
import { NodeIQQNTWrapperSession } from '@/core/wrapper';
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
@@ -6,6 +5,7 @@ interface Internal_MapKey {
|
||||
timeout: number,
|
||||
createtime: number,
|
||||
func: (...arg: any[]) => any,
|
||||
checker: ((...args: any[]) => boolean) | undefined,
|
||||
}
|
||||
|
||||
export class ListenerClassBase {
|
||||
@@ -84,17 +84,19 @@ export class NTEventWrapper {
|
||||
}
|
||||
//统一回调清理事件
|
||||
async DispatcherListener(ListenerMainName: string, ListenerSubName: string, ...args: any[]) {
|
||||
//console.log(ListenerMainName, this.EventTask.get(ListenerMainName), ListenerSubName, this.EventTask.get(ListenerMainName)?.get(ListenerSubName));
|
||||
//console.log(ListenerMainName, ListenerSubName, ...args,this.EventTask.get(ListenerMainName)?.get(ListenerSubName));
|
||||
this.EventTask.get(ListenerMainName)?.get(ListenerSubName)?.forEach((task, uuid) => {
|
||||
//console.log(task.func, uuid, task.createtime, task.timeout);
|
||||
if (task.createtime + task.timeout < Date.now()) {
|
||||
this.EventTask.get(ListenerMainName)?.get(ListenerSubName)?.delete(uuid);
|
||||
return;
|
||||
}
|
||||
task.func(...args);
|
||||
if (task.checker && task.checker(...args)) {
|
||||
task.func(...args);
|
||||
}
|
||||
});
|
||||
}
|
||||
async CallNoListenerEvent<EventType extends (...args: any[]) => Promise<any>,>(EventName = '', timeout: number = 3000, ...args: Parameters<EventType>) {
|
||||
async CallNoListenerEvent<EventType extends (...args: any[]) => Promise<any> | any>(EventName = '', timeout: number = 3000, ...args: Parameters<EventType>) {
|
||||
return new Promise<Awaited<ReturnType<EventType>>>(async (resolve, reject) => {
|
||||
const EventFunc = this.CreatEventFunction<EventType>(EventName);
|
||||
let complete = false;
|
||||
@@ -108,27 +110,71 @@ export class NTEventWrapper {
|
||||
resolve(retData);
|
||||
});
|
||||
}
|
||||
async CallNormalEvent<EventType extends (...args: any[]) => Promise<any>, ListenerType extends (...args: any[]) => void>(EventName = '', ListenerName = '', waitTimes = 1, timeout: number = 3000, ...args: Parameters<EventType>) {
|
||||
async RegisterListen<ListenerType extends (...args: any[]) => void>(ListenerName = '', waitTimes = 1, timeout = 5000, checker: (...args: Parameters<ListenerType>) => boolean) {
|
||||
return new Promise<Parameters<ListenerType>>((resolve, reject) => {
|
||||
const ListenerNameList = ListenerName.split('/');
|
||||
const ListenerMainName = ListenerNameList[0];
|
||||
const ListenerSubName = ListenerNameList[1];
|
||||
const id = randomUUID();
|
||||
let complete = 0;
|
||||
let retData: Parameters<ListenerType> | undefined = undefined;
|
||||
const databack = () => {
|
||||
if (complete == 0) {
|
||||
reject(new Error(' ListenerName:' + ListenerName + ' timeout'));
|
||||
} else {
|
||||
resolve(retData!);
|
||||
}
|
||||
};
|
||||
const Timeouter = setTimeout(databack, timeout);
|
||||
const eventCallbak = {
|
||||
timeout: timeout,
|
||||
createtime: Date.now(),
|
||||
checker: checker,
|
||||
func: (...args: Parameters<ListenerType>) => {
|
||||
complete++;
|
||||
retData = args;
|
||||
if (complete >= waitTimes) {
|
||||
clearTimeout(Timeouter);
|
||||
databack();
|
||||
}
|
||||
}
|
||||
};
|
||||
if (!this.EventTask.get(ListenerMainName)) {
|
||||
this.EventTask.set(ListenerMainName, new Map());
|
||||
}
|
||||
if (!(this.EventTask.get(ListenerMainName)?.get(ListenerSubName))) {
|
||||
this.EventTask.get(ListenerMainName)?.set(ListenerSubName, new Map());
|
||||
}
|
||||
this.EventTask.get(ListenerMainName)?.get(ListenerSubName)?.set(id, eventCallbak);
|
||||
this.CreatListenerFunction(ListenerMainName);
|
||||
});
|
||||
}
|
||||
async CallNormalEvent<EventType extends (...args: any[]) => Promise<any>, ListenerType extends (...args: any[]) => void>
|
||||
(EventName = '', ListenerName = '', waitTimes = 1, timeout: number = 3000, checker: (...args: Parameters<ListenerType>) => boolean, ...args: Parameters<EventType>) {
|
||||
return new Promise<[EventRet: Awaited<ReturnType<EventType>>, ...Parameters<ListenerType>]>(async (resolve, reject) => {
|
||||
const id = randomUUID();
|
||||
let complete = 0;
|
||||
let retData: Parameters<ListenerType> | undefined = undefined;
|
||||
let retEvent: any = {};
|
||||
const databack = () => {
|
||||
if (complete < waitTimes) {
|
||||
reject(new Error('NTEvent EventName:' + EventName + ' ListenerName:' + ListenerName + ' timeout'));
|
||||
if (complete == 0) {
|
||||
reject(new Error('Timeout: NTEvent EventName:' + EventName + ' ListenerName:' + ListenerName + ' EventRet:\n' + JSON.stringify(retEvent, null, 4) + '\n'));
|
||||
} else {
|
||||
resolve([retEvent as Awaited<ReturnType<EventType>>, ...retData!]);
|
||||
}
|
||||
};
|
||||
const Timeouter = setTimeout(databack, timeout);
|
||||
|
||||
|
||||
const ListenerNameList = ListenerName.split('/');
|
||||
const ListenerMainName = ListenerNameList[0];
|
||||
const ListenerSubName = ListenerNameList[1];
|
||||
|
||||
const Timeouter = setTimeout(databack, timeout);
|
||||
|
||||
const eventCallbak = {
|
||||
timeout: timeout,
|
||||
createtime: Date.now(),
|
||||
checker: checker,
|
||||
func: (...args: any[]) => {
|
||||
complete++;
|
||||
//console.log('func', ...args);
|
||||
@@ -148,7 +194,6 @@ export class NTEventWrapper {
|
||||
this.EventTask.get(ListenerMainName)?.get(ListenerSubName)?.set(id, eventCallbak);
|
||||
this.CreatListenerFunction(ListenerMainName);
|
||||
const EventFunc = this.CreatEventFunction<EventType>(EventName);
|
||||
//console.log("测试打点", args);
|
||||
retEvent = await EventFunc!(...(args as any[]));
|
||||
});
|
||||
}
|
||||
|
@@ -1,145 +0,0 @@
|
||||
import { logError, logDebug } from '@/common/utils/log';
|
||||
|
||||
type group_id = number;
|
||||
type user_id = number;
|
||||
|
||||
class cacheNode<T> {
|
||||
value: T;
|
||||
groupId: group_id;
|
||||
userId: user_id;
|
||||
prev: cacheNode<T> | null;
|
||||
next: cacheNode<T> | null;
|
||||
timestamp: number;
|
||||
|
||||
constructor(groupId: group_id, userId: user_id, value: T) {
|
||||
this.groupId = groupId;
|
||||
this.userId = userId;
|
||||
this.value = value;
|
||||
this.prev = null;
|
||||
this.next = null;
|
||||
this.timestamp = Date.now();
|
||||
}
|
||||
}
|
||||
|
||||
type cache<T> = { [key: group_id]: { [key: user_id]: cacheNode<T> } };
|
||||
class LRU<T> {
|
||||
private maxAge: number;
|
||||
private maxSize: number;
|
||||
private currentSize: number;
|
||||
private cache: cache<T>;
|
||||
private head: cacheNode<T> | null = null;
|
||||
private tail: cacheNode<T> | null = null;
|
||||
private onFuncs: ((node: cacheNode<T>) => void)[] = [];
|
||||
|
||||
constructor(maxAge: number = 2e4, maxSize: number = 5e3) {
|
||||
this.maxAge = maxAge;
|
||||
this.maxSize = maxSize;
|
||||
this.cache = Object.create(null);
|
||||
this.currentSize = 0;
|
||||
|
||||
if (maxSize == 0) return;
|
||||
setInterval(() => this.removeExpired(), this.maxAge);
|
||||
}
|
||||
|
||||
// 移除LRU节点
|
||||
private removeLRUNode(node: cacheNode<T>) {
|
||||
logDebug(
|
||||
'removeLRUNode',
|
||||
node.groupId,
|
||||
node.userId,
|
||||
node.value,
|
||||
this.currentSize
|
||||
);
|
||||
node.prev = node.next = null;
|
||||
delete this.cache[node.groupId][node.userId];
|
||||
this.removeNode(node);
|
||||
this.onFuncs.forEach((func) => func(node));
|
||||
this.currentSize--;
|
||||
}
|
||||
|
||||
public on(func: (node: cacheNode<T>) => void) {
|
||||
this.onFuncs.push(func);
|
||||
}
|
||||
|
||||
private removeExpired() {
|
||||
const now = Date.now();
|
||||
let current = this.tail;
|
||||
const nodesToRemove: cacheNode<T>[] = [];
|
||||
let removedCount = 0;
|
||||
|
||||
// 收集需要删除的节点
|
||||
while (current && now - current.timestamp > this.maxAge) {
|
||||
nodesToRemove.push(current);
|
||||
current = current.prev;
|
||||
removedCount++;
|
||||
if (removedCount >= 100) break;
|
||||
}
|
||||
|
||||
// 更新链表指向
|
||||
if (nodesToRemove.length > 0) {
|
||||
const newTail = nodesToRemove[nodesToRemove.length - 1].prev;
|
||||
if (newTail) {
|
||||
newTail.next = null;
|
||||
} else {
|
||||
this.head = null;
|
||||
}
|
||||
this.tail = newTail;
|
||||
}
|
||||
|
||||
nodesToRemove.forEach((node) => {
|
||||
node.prev = node.next = null;
|
||||
delete this.cache[node.groupId][node.userId];
|
||||
|
||||
this.currentSize--;
|
||||
this.onFuncs.forEach((func) => func(node));
|
||||
});
|
||||
}
|
||||
|
||||
private addNode(node: cacheNode<T>) {
|
||||
node.next = this.head;
|
||||
if (this.head) this.head.prev = node;
|
||||
if (!this.tail) this.tail = node;
|
||||
this.head = node;
|
||||
}
|
||||
|
||||
private removeNode(node: cacheNode<T>) {
|
||||
if (node.prev) node.prev.next = node.next;
|
||||
if (node.next) node.next.prev = node.prev;
|
||||
if (node === this.head) this.head = node.next;
|
||||
if (node === this.tail) this.tail = node.prev;
|
||||
}
|
||||
|
||||
private moveToHead(node: cacheNode<T>) {
|
||||
if (this.head === node) return;
|
||||
|
||||
this.removeNode(node);
|
||||
this.addNode(node);
|
||||
node.prev = null;
|
||||
}
|
||||
|
||||
public set(groupId: group_id, userId: user_id, value: T) {
|
||||
if (!this.cache[groupId]) {
|
||||
this.cache[groupId] = Object.create(null);
|
||||
}
|
||||
|
||||
const groupObject = this.cache[groupId];
|
||||
|
||||
if (groupObject[userId]) {
|
||||
const node = groupObject[userId];
|
||||
node.value = value;
|
||||
node.timestamp = Date.now();
|
||||
this.moveToHead(node);
|
||||
} else {
|
||||
const node = new cacheNode(groupId, userId, value);
|
||||
groupObject[userId] = node;
|
||||
this.currentSize++;
|
||||
this.addNode(node);
|
||||
if (this.currentSize > this.maxSize) {
|
||||
const tail = this.tail!;
|
||||
this.removeLRUNode(tail);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default LRU;
|
@@ -1,53 +1,142 @@
|
||||
import crypto from 'crypto';
|
||||
import { Peer } from '@/core';
|
||||
import crypto, { randomInt, randomUUID } from 'crypto';
|
||||
import { logError } from './log';
|
||||
|
||||
class LimitedHashTable<K, V> {
|
||||
private keyToValue: Map<K, V> = new Map();
|
||||
private valueToKey: Map<V, K> = new Map();
|
||||
private maxSize: number;
|
||||
private KeyQueneList: K[] = [];
|
||||
private ValueQueneList: V[] = [];
|
||||
constructor(maxSize: number) {
|
||||
this.maxSize = maxSize;
|
||||
}
|
||||
set(key: K, value: V): void {
|
||||
this.keyToValue.set(key, value);
|
||||
this.valueToKey.set(value, key);
|
||||
if (this.KeyQueneList.length >= this.maxSize || this.ValueQueneList.length >= this.maxSize) {
|
||||
this.KeyQueneList.shift();
|
||||
this.ValueQueneList.shift();
|
||||
}
|
||||
}
|
||||
private keyToValue: Map<K, V> = new Map();
|
||||
private valueToKey: Map<V, K> = new Map();
|
||||
private maxSize: number;
|
||||
|
||||
getValue(key: K): V | undefined {
|
||||
return this.keyToValue.get(key);
|
||||
}
|
||||
constructor(maxSize: number) {
|
||||
this.maxSize = maxSize;
|
||||
}
|
||||
resize(count: number) {
|
||||
this.maxSize = count;
|
||||
}
|
||||
|
||||
getKey(value: V): K | undefined {
|
||||
return this.valueToKey.get(value);
|
||||
set(key: K, value: V): void {
|
||||
// const isExist = this.keyToValue.get(key);
|
||||
// if (isExist && isExist === value) {
|
||||
// return;
|
||||
// }
|
||||
this.keyToValue.set(key, value);
|
||||
this.valueToKey.set(value, key);
|
||||
while (this.keyToValue.size !== this.valueToKey.size) {
|
||||
console.log('keyToValue.size !== valueToKey.size Error Atom');
|
||||
this.keyToValue.clear();
|
||||
this.valueToKey.clear();
|
||||
}
|
||||
// console.log('---------------');
|
||||
// console.log(this.keyToValue);
|
||||
// console.log(this.valueToKey);
|
||||
// console.log('---------------');
|
||||
while (this.keyToValue.size > this.maxSize || this.valueToKey.size > this.maxSize) {
|
||||
//console.log(this.keyToValue.size > this.maxSize, this.valueToKey.size > this.maxSize);
|
||||
const oldestKey = this.keyToValue.keys().next().value;
|
||||
this.valueToKey.delete(this.keyToValue.get(oldestKey)!);
|
||||
this.keyToValue.delete(oldestKey);
|
||||
}
|
||||
}
|
||||
|
||||
delete(key: K): void {
|
||||
const value = this.keyToValue.get(key);
|
||||
if (value !== undefined) {
|
||||
this.keyToValue.delete(key);
|
||||
this.valueToKey.delete(value);
|
||||
}
|
||||
getValue(key: K): V | undefined {
|
||||
return this.keyToValue.get(key);
|
||||
}
|
||||
|
||||
getKey(value: V): K | undefined {
|
||||
return this.valueToKey.get(value);
|
||||
}
|
||||
|
||||
deleteByValue(value: V): void {
|
||||
const key = this.valueToKey.get(value);
|
||||
if (key !== undefined) {
|
||||
this.keyToValue.delete(key);
|
||||
this.valueToKey.delete(value);
|
||||
}
|
||||
}
|
||||
|
||||
deleteByKey(key: K): void {
|
||||
const value = this.keyToValue.get(key);
|
||||
if (value !== undefined) {
|
||||
this.keyToValue.delete(key);
|
||||
this.valueToKey.delete(value);
|
||||
}
|
||||
}
|
||||
|
||||
getKeyList(): K[] {
|
||||
return Array.from(this.keyToValue.keys());
|
||||
}
|
||||
//获取最近刚写入的几个值
|
||||
getHeads(size: number): { key: K; value: V }[] | undefined {
|
||||
const keyList = this.getKeyList();
|
||||
if (keyList.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
const result: { key: K; value: V }[] = [];
|
||||
const listSize = Math.min(size, keyList.length);
|
||||
for (let i = 0; i < listSize; i++) {
|
||||
const key = keyList[listSize - i];
|
||||
result.push({ key, value: this.keyToValue.get(key)! });
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
class MessageUniqueWrapper {
|
||||
private msgIdMap: LimitedHashTable<number, string> = new LimitedHashTable(1000);
|
||||
createMsg(MsgId: string) {
|
||||
let ShortId = parseInt(crypto.createHash('sha1').update('2345').digest('hex').slice(0, 8), 16);
|
||||
this.msgIdMap.set(ShortId, MsgId);
|
||||
return ShortId;
|
||||
private msgDataMap: LimitedHashTable<string, number>;
|
||||
private msgIdMap: LimitedHashTable<string, number>;
|
||||
constructor(maxMap: number = 1000) {
|
||||
this.msgIdMap = new LimitedHashTable<string, number>(maxMap);
|
||||
this.msgDataMap = new LimitedHashTable<string, number>(maxMap);
|
||||
}
|
||||
getRecentMsgIds(Peer: Peer, size: number): string[] {
|
||||
const heads = this.msgIdMap.getHeads(size);
|
||||
if (!heads) {
|
||||
return [];
|
||||
}
|
||||
getMsgIdByShortId(ShortId: number) {
|
||||
return this.msgIdMap.getValue(ShortId);
|
||||
}
|
||||
getShortIdByMsgId(MsgId: string) {
|
||||
return this.msgIdMap.getKey(MsgId);
|
||||
const data = heads.map((t) => MessageUnique.getMsgIdAndPeerByShortId(t.value));
|
||||
const ret = data.filter((t) => t?.Peer.chatType === Peer.chatType && t?.Peer.peerUid === Peer.peerUid);
|
||||
return ret.map((t) => t?.MsgId).filter((t) => t !== undefined);
|
||||
}
|
||||
createMsg(peer: Peer, msgId: string): number | undefined {
|
||||
const key = `${msgId}|${peer.chatType}|${peer.peerUid}`;
|
||||
const hash = crypto.createHash('md5').update(key);
|
||||
const shortId = hash.digest().readInt32BE(0);
|
||||
//减少性能损耗
|
||||
// const isExist = this.msgIdMap.getKey(shortId);
|
||||
// if (isExist && isExist === msgId) {
|
||||
// return shortId;
|
||||
// }
|
||||
this.msgIdMap.set(msgId, shortId);
|
||||
this.msgDataMap.set(key, shortId);
|
||||
return shortId;
|
||||
}
|
||||
|
||||
getMsgIdAndPeerByShortId(shortId: number): { MsgId: string; Peer: Peer } | undefined {
|
||||
const data = this.msgDataMap.getKey(shortId);
|
||||
if (data) {
|
||||
const [msgId, chatTypeStr, peerUid] = data.split('|');
|
||||
const peer: Peer = {
|
||||
chatType: parseInt(chatTypeStr),
|
||||
peerUid,
|
||||
guildId: '',
|
||||
};
|
||||
return { MsgId: msgId, Peer: peer };
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
getShortIdByMsgId(msgId: string): number | undefined {
|
||||
return this.msgIdMap.getValue(msgId);
|
||||
}
|
||||
getPeerByMsgId(msgId: string) {
|
||||
const shortId = this.msgIdMap.getValue(msgId);
|
||||
if (!shortId) return undefined;
|
||||
return this.getMsgIdAndPeerByShortId(shortId);
|
||||
}
|
||||
resize(maxSize: number): void {
|
||||
this.msgIdMap.resize(maxSize);
|
||||
this.msgDataMap.resize(maxSize);
|
||||
}
|
||||
}
|
||||
|
||||
export const MessageUnique = new MessageUniqueWrapper();
|
||||
export const MessageUnique: MessageUniqueWrapper = new MessageUniqueWrapper();
|
@@ -1,14 +1,14 @@
|
||||
// 方案一 MiniApp发包方案
|
||||
// 前置条件: 处于GUI环境 存在MiniApp
|
||||
|
||||
import { NTQQSystemApi } from "@/core";
|
||||
import { NTQQSystemApi } from '@/core';
|
||||
|
||||
// 前排提示: 开发验证仅Win平台开展
|
||||
export class MiniAppUtil {
|
||||
static async RunMiniAppWithGUI() {
|
||||
//process.env.ELECTRON_RUN_AS_NODE = undefined;//没用还是得自己用cpp之类的语言写个程序转发参数
|
||||
return NTQQSystemApi.BootMiniApp(process.execPath, "miniapp://open/1007?url=https%3A%2F%2Fm.q.qq.com%2Fa%2Fs%2Fedd0a83d3b8afe233dfa07adaaf8033f%3Fscene%3D1007%26min_refer%3D10001");
|
||||
}
|
||||
static async RunMiniAppWithGUI() {
|
||||
//process.env.ELECTRON_RUN_AS_NODE = undefined;//没用还是得自己用cpp之类的语言写个程序转发参数
|
||||
return NTQQSystemApi.BootMiniApp(process.execPath, 'miniapp://open/1007?url=https%3A%2F%2Fm.q.qq.com%2Fa%2Fs%2Fedd0a83d3b8afe233dfa07adaaf8033f%3Fscene%3D1007%26min_refer%3D10001');
|
||||
}
|
||||
}
|
||||
// 方案二 MiniApp发包方案 替代MiniApp方案
|
||||
// 前置条件: 无
|
||||
|
@@ -3,7 +3,6 @@ import fs from 'node:fs';
|
||||
import os from 'node:os';
|
||||
import { systemPlatform } from '@/common/utils/system';
|
||||
import { logError } from '@/common/utils/log';
|
||||
|
||||
export const exePath = process.execPath;
|
||||
|
||||
export const pkgInfoPath = path.join(path.dirname(exePath), 'resources', 'app', 'package.json');
|
||||
@@ -38,16 +37,16 @@ type QQVersionConfigInfo = {
|
||||
}
|
||||
|
||||
let _qqVersionConfigInfo: QQVersionConfigInfo = {
|
||||
'baseVersion': '9.9.11-24568',
|
||||
'curVersion': '9.9.11-24568',
|
||||
'baseVersion': '9.9.15-26702',
|
||||
'curVersion': '9.9.15-26702',
|
||||
'prevVersion': '',
|
||||
'onErrorVersions': [],
|
||||
'buildId': '24568'
|
||||
'buildId': '26702'
|
||||
};
|
||||
|
||||
if (fs.existsSync(configVersionInfoPath)) {
|
||||
try {
|
||||
const _ =JSON.parse(fs.readFileSync(configVersionInfoPath).toString());
|
||||
const _ = JSON.parse(fs.readFileSync(configVersionInfoPath).toString());
|
||||
_qqVersionConfigInfo = Object.assign(_qqVersionConfigInfo, _);
|
||||
} catch (e) {
|
||||
logError('Load QQ version config info failed, Use default version', e);
|
||||
@@ -55,23 +54,25 @@ if (fs.existsSync(configVersionInfoPath)) {
|
||||
}
|
||||
|
||||
export const qqVersionConfigInfo: QQVersionConfigInfo = _qqVersionConfigInfo;
|
||||
//V1_WIN_NQ_9.9.11_24568_GW_B
|
||||
//V1_WIN_NQ_9.9.12_25765_GW_B
|
||||
export const qqPkgInfo: QQPkgInfo = JSON.parse(fs.readFileSync(pkgInfoPath).toString());
|
||||
// platform_type: 3,
|
||||
// app_type: 4,
|
||||
// app_version: '9.9.9-23159',
|
||||
// qua: 'V1_WIN_NQ_9.9.9_23159_GW_B',
|
||||
// appid: '537213764',
|
||||
// app_version: '9.9.12-25765',
|
||||
// qua: 'V1_WIN_NQ_9.9.12_25765_GW_B',
|
||||
// appid: '537234702',
|
||||
// platVer: '10.0.26100',
|
||||
// clientVer: '9.9.9-23159',
|
||||
// clientVer: '9.9.9-25765',
|
||||
|
||||
// Linux
|
||||
// app_version: '3.2.9-24568',
|
||||
// qua: 'V1_LNX_NQ_3.2.9_24568_GW_B',
|
||||
|
||||
let _appid: string = '537226369'; // 默认为 Windows 平台的 appid
|
||||
// app_version: '3.2.9-25765',
|
||||
// qua: 'V1_LNX_NQ_3.2.10_25765_GW_B',
|
||||
export function requireMinNTQBuild(buildStr: string) {
|
||||
return parseInt(qqVersionConfigInfo.buildId) >= parseInt(buildStr);
|
||||
}
|
||||
let _appid: string = '537237765'; // 默认为 Windows 平台的 appid
|
||||
if (systemPlatform === 'linux') {
|
||||
_appid = '537226441';
|
||||
_appid = '537234773';
|
||||
}
|
||||
// todo: mac 平台的 appid
|
||||
export const appid = _appid;
|
||||
export const appid = _appid;
|
@@ -1,9 +1,9 @@
|
||||
import fs from 'fs';
|
||||
import { encode, getDuration, getWavFileInfo, isWav } from 'silk-wasm';
|
||||
import { encode, getDuration, getWavFileInfo, isWav, isSilk } from 'silk-wasm';
|
||||
import fsPromise from 'fs/promises';
|
||||
import { log, logError } from './log';
|
||||
import path from 'node:path';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { spawn } from 'node:child_process';
|
||||
import { getTempDir } from '@/common/utils/file';
|
||||
|
||||
@@ -63,10 +63,11 @@ export async function encodeSilk(filePath: string) {
|
||||
// }
|
||||
|
||||
try {
|
||||
const pttPath = path.join(TEMP_DIR, uuidv4());
|
||||
if (getFileHeader(filePath) !== '02232153494c4b') {
|
||||
const file = await fsPromise.readFile(filePath);
|
||||
const pttPath = path.join(TEMP_DIR, randomUUID());
|
||||
if (!isSilk(file)) {
|
||||
log(`语音文件${filePath}需要转换成silk`);
|
||||
const _isWav = await isWavFile(filePath);
|
||||
const _isWav = isWav(file);
|
||||
const pcmPath = pttPath + '.pcm';
|
||||
let sampleRate = 0;
|
||||
const convert = () => {
|
||||
@@ -96,7 +97,7 @@ export async function encodeSilk(filePath: string) {
|
||||
if (!_isWav) {
|
||||
input = await convert();
|
||||
} else {
|
||||
input = fs.readFileSync(filePath);
|
||||
input = file;
|
||||
const allowSampleRate = [8000, 12000, 16000, 24000, 32000, 44100, 48000];
|
||||
const { fmt } = getWavFileInfo(input);
|
||||
// log(`wav文件信息`, fmt)
|
||||
@@ -113,7 +114,7 @@ export async function encodeSilk(filePath: string) {
|
||||
duration: silk.duration / 1000
|
||||
};
|
||||
} else {
|
||||
const silk = fs.readFileSync(filePath);
|
||||
const silk = file;
|
||||
let duration = 0;
|
||||
try {
|
||||
duration = getDuration(silk) / 1000;
|
||||
|
@@ -1,449 +0,0 @@
|
||||
import { ElementType, FileElement, PicElement, PttElement, RawMessage, VideoElement } from '../../core/src/entities';
|
||||
|
||||
import sqlite3 from 'sqlite3';
|
||||
import { log, logDebug, logError } from '@/common/utils/log';
|
||||
import { NTQQMsgApi } from '@/core';
|
||||
import LRU from '@/common/utils/LRUCache';
|
||||
|
||||
export interface IRember {
|
||||
last_sent_time: number;
|
||||
join_time: number;
|
||||
user_id: number;
|
||||
}
|
||||
|
||||
|
||||
type DBMsg = {
|
||||
id: number,
|
||||
shortId: number,
|
||||
longId: string,
|
||||
seq: number,
|
||||
peerUid: string,
|
||||
chatType: number,
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
async init(dbPath: string) {
|
||||
if (this.db) {
|
||||
return;
|
||||
}
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
this.db = new sqlite3.Database(dbPath, sqlite3.OPEN_READWRITE | sqlite3.OPEN_CREATE, (err) => {
|
||||
if (err) {
|
||||
logError('Could not connect to database', err);
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
this.createTable();
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protected createTable() {
|
||||
throw new Error('Method not implemented.');
|
||||
}
|
||||
|
||||
close() {
|
||||
this.db?.close();
|
||||
}
|
||||
}
|
||||
|
||||
class DBUtil extends DBUtilBase {
|
||||
private msgCache: Map<string | number, RawMessage> = new Map<string | number, RawMessage>();
|
||||
private globalMsgShortId = -2147483640;
|
||||
private groupIds: number[] = [];
|
||||
private LURCache = new LRU<number>();
|
||||
private LastSentCache = new (class {
|
||||
private cache: { gid: number; uid: number }[] = [];
|
||||
private maxSize: number;
|
||||
|
||||
constructor(maxSize: number = 5000) {
|
||||
this.maxSize = maxSize;
|
||||
}
|
||||
|
||||
get(gid: number, uid: number): boolean {
|
||||
const exists = this.cache.some(
|
||||
(entry) => entry.gid === gid && entry.uid === uid
|
||||
);
|
||||
if (!exists) {
|
||||
this.cache.push({ gid, uid });
|
||||
if (this.cache.length > this.maxSize) {
|
||||
this.cache.shift();
|
||||
}
|
||||
}
|
||||
|
||||
return exists;
|
||||
}
|
||||
})();
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
const interval = 1000 * 60 * 10; // 10分钟清理一次缓存
|
||||
setInterval(() => {
|
||||
logDebug('清理消息缓存');
|
||||
this.msgCache.forEach((msg, key) => {
|
||||
if ((Date.now() - parseInt(msg.msgTime) * 1000) > interval) {
|
||||
this.msgCache.delete(key);
|
||||
}
|
||||
});
|
||||
}, interval);
|
||||
}
|
||||
|
||||
async init(dbPath: string) {
|
||||
await super.init(dbPath);
|
||||
this.globalMsgShortId = await this.getCurrentMaxShortId();
|
||||
|
||||
|
||||
// 初始化群缓存列表
|
||||
this.db!.serialize(() => {
|
||||
const sql = 'SELECT * FROM sqlite_master WHERE type=\'table\'';
|
||||
this.db!.all(sql, [], (err, rows: { name: string }[]) => {
|
||||
if (err) return logError(err);
|
||||
rows.forEach((row) => this.groupIds.push(parseInt(row.name)));
|
||||
//logDebug(`已加载 ${groupIds.length} 个群`);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
this.LURCache.on(async (node) => {
|
||||
const { value: time, groupId, userId } = node;
|
||||
|
||||
logDebug('插入发言时间', userId, groupId);
|
||||
await this.createGroupInfoTimeTableIfNotExist(groupId);
|
||||
|
||||
const method = await this.getDataSetMethod(groupId, userId);
|
||||
logDebug('插入发言时间方法判断', userId, groupId, method);
|
||||
|
||||
const sql =
|
||||
method == 'update'
|
||||
? `UPDATE "${groupId}" SET last_sent_time = ? WHERE user_id = ?`
|
||||
: `INSERT INTO "${groupId}" (last_sent_time, user_id) VALUES (?, ?)`;
|
||||
|
||||
this.db!.all(sql, [time, userId], (err) => {
|
||||
if (err) {
|
||||
return logError('插入/更新发言时间失败', userId, groupId);
|
||||
}
|
||||
logDebug('插入/更新发言时间成功', userId, groupId);
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
async getDataSetMethod(groupId: number, userId: number) {
|
||||
// 缓存记录
|
||||
if (this.LastSentCache.get(groupId, userId)) {
|
||||
logDebug('缓存命中', userId, groupId);
|
||||
return 'update';
|
||||
}
|
||||
|
||||
// 数据库判断
|
||||
return new Promise<'insert' | 'update'>((resolve, reject) => {
|
||||
this.db!.all(
|
||||
`SELECT * FROM "${groupId}" WHERE user_id = ?`,
|
||||
[userId],
|
||||
(err, rows) => {
|
||||
if (err) {
|
||||
logError('查询发言时间存在失败', userId, groupId, err);
|
||||
return logError('插入发言时间失败', userId, groupId, err);
|
||||
}
|
||||
|
||||
if (rows.length === 0) {
|
||||
logDebug('查询发言时间不存在', userId, groupId);
|
||||
return resolve('insert');
|
||||
}
|
||||
|
||||
logDebug('查询发言时间存在', userId, groupId);
|
||||
resolve('update');
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
async createGroupInfoTimeTableIfNotExist(groupId: number) {
|
||||
const createTableSQL = (groupId: number) =>
|
||||
`CREATE TABLE IF NOT EXISTS "${groupId}" (
|
||||
user_id INTEGER,
|
||||
last_sent_time INTEGER,
|
||||
join_time INTEGER,
|
||||
PRIMARY KEY (user_id)
|
||||
);`;
|
||||
|
||||
if (this.groupIds.includes(groupId)) {
|
||||
return;
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
const sql = createTableSQL(groupId);
|
||||
this.db!.all(sql, (err) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
}
|
||||
this.groupIds.push(groupId);
|
||||
resolve(true);
|
||||
});
|
||||
});
|
||||
}
|
||||
protected createTable() {
|
||||
// 消息记录
|
||||
const createTableSQL = `
|
||||
CREATE TABLE IF NOT EXISTS msgs (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
shortId INTEGER NOT NULL UNIQUE,
|
||||
longId TEXT NOT NULL UNIQUE,
|
||||
seq INTEGER NOT NULL,
|
||||
peerUid TEXT NOT NULL,
|
||||
chatType INTEGER NOT NULL
|
||||
)`;
|
||||
this.db!.run(createTableSQL, function (err) {
|
||||
if (err) {
|
||||
logError('Could not create table msgs', err.stack);
|
||||
}
|
||||
});
|
||||
|
||||
// 文件缓存
|
||||
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) {
|
||||
logError('Could not create table files', err);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private async getCurrentMaxShortId() {
|
||||
return new Promise<number>((resolve, reject) => {
|
||||
this.db!.get('SELECT MAX(shortId) as maxId FROM msgs', (err, row: { maxId: number }) => {
|
||||
if (err) {
|
||||
logDebug('Could not get max short id, Use default -2147483640', err);
|
||||
return resolve(-2147483640);
|
||||
}
|
||||
logDebug('数据库中消息最大短id', row?.maxId);
|
||||
resolve(row?.maxId ?? -2147483640);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
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) {
|
||||
logError('Could not get msg', err, query, params);
|
||||
return resolve(null);
|
||||
}
|
||||
if (!row) {
|
||||
// logDebug('不存在数据库中的消息,不进行处理', query, params);
|
||||
resolve(null);
|
||||
return;
|
||||
}
|
||||
const msgId = row.longId;
|
||||
NTQQMsgApi.getMsgsByMsgId({ peerUid: row.peerUid, chatType: row.chatType }, [msgId]).then(res => {
|
||||
const msg = res.msgList[0];
|
||||
if (!msg) {
|
||||
resolve(null);
|
||||
return;
|
||||
}
|
||||
msg.id = row.shortId;
|
||||
resolve(msg);
|
||||
}).catch(e => {
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async getMsgByShortId(shortId: number): Promise<RawMessage | null> {
|
||||
if (this.msgCache.has(shortId)) {
|
||||
return this.msgCache.get(shortId)!;
|
||||
}
|
||||
const getStmt = 'SELECT * FROM msgs WHERE shortId = ?';
|
||||
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 longId = ?', [longId]);
|
||||
}
|
||||
|
||||
async getMsgBySeq(peerUid: string, seq: string): Promise<RawMessage | null> {
|
||||
const stmt = 'SELECT * FROM msgs WHERE peerUid = ? AND seq = ?';
|
||||
return this.getMsg(stmt, [peerUid, seq]);
|
||||
}
|
||||
|
||||
async addMsg(msg: RawMessage, update = true): Promise<number> {
|
||||
const existMsg = await this.getMsgByLongId(msg.msgId);
|
||||
if (existMsg) {
|
||||
// logDebug('消息已存在,更新数据库', msg.msgId);
|
||||
if (update) this.updateMsg(msg).then();
|
||||
return existMsg.id!;
|
||||
}
|
||||
const stmt = this.db!.prepare('INSERT INTO msgs (shortId, longId, seq, peerUid, chatType) VALUES (?, ?, ?, ?, ?)');
|
||||
// const runAsync = promisify(stmt.run.bind(stmt));
|
||||
const shortId = ++this.globalMsgShortId;
|
||||
msg.id = shortId;
|
||||
//logDebug(`记录消息到数据库, 消息长id: ${msg.msgId}, 短id: ${msg.id}`);
|
||||
this.msgCache.set(shortId, msg);
|
||||
this.msgCache.set(msg.msgId, msg);
|
||||
stmt.run(this.globalMsgShortId, msg.msgId, msg.msgSeq.toString(), msg.peerUid, msg.chatType, (err: any) => {
|
||||
if (err) {
|
||||
if (err.errno === 19) {
|
||||
this.getMsgByLongId(msg.msgId).then((msg: RawMessage | null) => {
|
||||
if (msg) {
|
||||
this.msgCache.set(shortId, msg);
|
||||
this.msgCache.set(msg.msgId, msg);
|
||||
// logDebug('获取消息短id成功', msg.id);
|
||||
} else {
|
||||
logError('db could not get msg by long id', err);
|
||||
}
|
||||
}).catch(e => logError('db getMsgByLongId error', e));
|
||||
} else {
|
||||
logError('db could not add msg', err);
|
||||
}
|
||||
}
|
||||
});
|
||||
return shortId;
|
||||
}
|
||||
|
||||
async updateMsg(msg: RawMessage) {
|
||||
const existMsg = this.msgCache.get(msg.msgId);
|
||||
if (existMsg) {
|
||||
Object.assign(existMsg, msg);
|
||||
}
|
||||
//logDebug(`更新消息, shortId:${msg.id}, seq: ${msg.msgSeq}, msgId: ${msg.msgId}`);
|
||||
const stmt = this.db!.prepare('UPDATE msgs SET seq=? WHERE longId=?');
|
||||
stmt.run(msg.msgSeq, msg.msgId, (err: any) => {
|
||||
if (err) {
|
||||
logError('updateMsg db error', err);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
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) {
|
||||
logError('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) {
|
||||
logError('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, file.uuid, function (err: any) {
|
||||
if (err) {
|
||||
logError('db could not update file cache', err);
|
||||
reject(err);
|
||||
}
|
||||
resolve(null);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async getLastSentTimeAndJoinTime(
|
||||
groupId: number
|
||||
): Promise<IRember[]> {
|
||||
logDebug('读取发言时间', groupId);
|
||||
return new Promise<IRember[]>((resolve, reject) => {
|
||||
this.db!.all(`SELECT * FROM "${groupId}" `, (err, rows: IRember[]) => {
|
||||
if (err) {
|
||||
logError('查询发言时间失败', groupId);
|
||||
return resolve([]);
|
||||
}
|
||||
logDebug('查询发言时间成功', groupId, rows);
|
||||
resolve(rows);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
insertLastSentTime(
|
||||
groupId: number,
|
||||
userId: number,
|
||||
time: number
|
||||
) {
|
||||
this.LURCache.set(groupId, userId, time);
|
||||
}
|
||||
async insertJoinTime(
|
||||
groupId: number,
|
||||
userId: number,
|
||||
time: number
|
||||
) {
|
||||
await this.createGroupInfoTimeTableIfNotExist(groupId);
|
||||
this.db!.all(
|
||||
`INSERT OR REPLACE INTO "${groupId}" (user_id, last_sent_time, join_time) VALUES (?,?,?)`,
|
||||
[userId, time, time],
|
||||
(err) => {
|
||||
if (err)
|
||||
logError(err),
|
||||
Promise.reject(),
|
||||
logError('插入入群时间失败', userId, groupId);
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export const dbUtil = new DBUtil();
|
@@ -4,9 +4,8 @@ import crypto from 'crypto';
|
||||
import util from 'util';
|
||||
import path from 'node:path';
|
||||
import { log, logError } from './log';
|
||||
import { dbUtil } from '@/common/utils/db';
|
||||
import * as fileType from 'file-type';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { napCatCore } from '@/core';
|
||||
|
||||
export const getNapCatDir = () => {
|
||||
@@ -148,6 +147,8 @@ export async function httpDownload(options: string | HttpDownloadOptions): Promi
|
||||
};
|
||||
if (typeof options === 'string') {
|
||||
url = options;
|
||||
const host = new URL(url).hostname;
|
||||
headers['Host'] = host;
|
||||
} else {
|
||||
url = options.url;
|
||||
if (options.headers) {
|
||||
@@ -158,7 +159,12 @@ export async function httpDownload(options: string | HttpDownloadOptions): Promi
|
||||
}
|
||||
}
|
||||
}
|
||||
const fetchRes = await fetch(url, { headers });
|
||||
const fetchRes = await fetch(url, { headers }).catch((err) => {
|
||||
if (err.cause) {
|
||||
throw err.cause;
|
||||
}
|
||||
throw err;
|
||||
});
|
||||
if (!fetchRes.ok) throw new Error(`下载文件失败: ${fetchRes.statusText}`);
|
||||
|
||||
const blob = await fetchRes.blob();
|
||||
@@ -185,7 +191,7 @@ export async function uri2local(uri: string, fileName: string | null = null): Pr
|
||||
isLocal: false
|
||||
};
|
||||
if (!fileName) {
|
||||
fileName = uuidv4();
|
||||
fileName = randomUUID();
|
||||
}
|
||||
let filePath = path.join(getTempDir(), fileName);
|
||||
let url = null;
|
||||
@@ -228,7 +234,7 @@ export async function uri2local(uri: string, fileName: string | null = null): Pr
|
||||
}
|
||||
fileName = fileName.replace(/[/\\:*?"<>|]/g, '_');
|
||||
res.fileName = fileName;
|
||||
filePath = path.join(getTempDir(), uuidv4() + fileName);
|
||||
filePath = path.join(getTempDir(), randomUUID() + fileName);
|
||||
fs.writeFileSync(filePath, buffer);
|
||||
} catch (e: any) {
|
||||
res.errMsg = `${url}下载失败,` + e.toString();
|
||||
@@ -244,13 +250,14 @@ export async function uri2local(uri: string, fileName: string | null = null): Pr
|
||||
} else {
|
||||
filePath = pathname;
|
||||
}
|
||||
} else {
|
||||
const cache = await dbUtil.getFileCacheByName(uri);
|
||||
if (cache) {
|
||||
filePath = cache.path;
|
||||
} else {
|
||||
filePath = uri;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// const cache = await dbUtil.getFileCacheByName(uri);
|
||||
// if (cache) {
|
||||
// filePath = cache.path;
|
||||
// } else {
|
||||
// filePath = uri;
|
||||
// }
|
||||
}
|
||||
|
||||
res.isLocal = true;
|
||||
|
@@ -8,10 +8,50 @@ import * as fsPromise from 'node:fs/promises';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
//下面这个类是用于将uid+msgid合并的类
|
||||
export class UUIDConverter {
|
||||
static encode(highStr: string, lowStr: string): string {
|
||||
const high = BigInt(highStr);
|
||||
const low = BigInt(lowStr);
|
||||
const highHex = high.toString(16).padStart(16, '0');
|
||||
const lowHex = low.toString(16).padStart(16, '0');
|
||||
const combinedHex = highHex + lowHex;
|
||||
const uuid = `${combinedHex.substring(0, 8)}-${combinedHex.substring(8, 12)}-${combinedHex.substring(12, 16)}-${combinedHex.substring(16, 20)}-${combinedHex.substring(20)}`;
|
||||
return uuid;
|
||||
}
|
||||
static decode(uuid: string): { high: string, low: string } {
|
||||
const hex = uuid.replace(/-/g, '');
|
||||
const high = BigInt('0x' + hex.substring(0, 16));
|
||||
const low = BigInt('0x' + hex.substring(16));
|
||||
return { high: high.toString(), low: low.toString() };
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export function sleep(ms: number): Promise<void> {
|
||||
return new Promise(resolve => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function PromiseTimer<T>(promise: Promise<T>, ms: number): Promise<T> {
|
||||
const timeoutPromise = new Promise<T>((_, reject) =>
|
||||
setTimeout(() => reject(new Error('PromiseTimer: Operation timed out')), ms)
|
||||
);
|
||||
return Promise.race([promise, timeoutPromise]);
|
||||
}
|
||||
export async function runAllWithTimeout<T>(tasks: Promise<T>[], timeout: number): Promise<T[]> {
|
||||
const wrappedTasks = tasks.map(task =>
|
||||
PromiseTimer(task, timeout).then(
|
||||
result => ({ status: 'fulfilled', value: result }),
|
||||
error => ({ status: 'rejected', reason: error })
|
||||
)
|
||||
);
|
||||
const results = await Promise.all(wrappedTasks);
|
||||
return results
|
||||
.filter(result => result.status === 'fulfilled')
|
||||
.map(result => (result as { status: 'fulfilled'; value: T }).value);
|
||||
}
|
||||
|
||||
export function getMd5(s: string) {
|
||||
|
||||
const h = crypto.createHash('md5');
|
||||
@@ -89,7 +129,36 @@ export function CacheClassFuncAsync(ttl: number = 3600 * 1000, customKey: string
|
||||
}
|
||||
return logExecutionTime;
|
||||
}
|
||||
|
||||
export function CacheClassFuncAsyncExtend(ttl: number = 3600 * 1000, customKey: string = '', checker: any = (...data: any[]) => { return true; }) {
|
||||
//console.log('CacheClassFuncAsync', ttl, customKey);
|
||||
function logExecutionTime(target: any, methodName: string, descriptor: PropertyDescriptor) {
|
||||
//console.log('logExecutionTime', target, methodName, descriptor);
|
||||
const cache = new Map<string, { expiry: number; value: any }>();
|
||||
const originalMethod = descriptor.value;
|
||||
descriptor.value = async function (...args: any[]) {
|
||||
const key = `${customKey}${String(methodName)}.(${args.map(arg => JSON.stringify(arg)).join(', ')})`;
|
||||
cache.forEach((value, key) => {
|
||||
if (value.expiry < Date.now()) {
|
||||
cache.delete(key);
|
||||
}
|
||||
});
|
||||
const cachedValue = cache.get(key);
|
||||
if (cachedValue && cachedValue.expiry > Date.now()) {
|
||||
return cachedValue.value;
|
||||
}
|
||||
// const start = Date.now();
|
||||
const result = await originalMethod.apply(this, args);
|
||||
if (!checker(...args, result)) {
|
||||
return result;//丢弃缓存
|
||||
}
|
||||
// const end = Date.now();
|
||||
// console.log(`Method ${methodName} executed in ${end - start} ms.`);
|
||||
cache.set(key, { expiry: Date.now() + ttl, value: result });
|
||||
return result;
|
||||
};
|
||||
}
|
||||
return logExecutionTime;
|
||||
}
|
||||
// export function CacheClassFuncAsync(ttl: number = 3600 * 1000, customKey: string = ''): any {
|
||||
// const cache = new Map<string, { expiry: number; value: any }>();
|
||||
|
||||
@@ -264,23 +333,23 @@ export function isEqual(obj1: any, obj2: any) {
|
||||
}
|
||||
|
||||
export async function deleteOldFiles(directoryPath: string, daysThreshold: number) {
|
||||
try {
|
||||
const files = await fsPromise.readdir(directoryPath);
|
||||
try {
|
||||
const files = await fsPromise.readdir(directoryPath);
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(directoryPath, file);
|
||||
const stats = await fsPromise.stat(filePath);
|
||||
const lastModifiedTime = stats.mtimeMs;
|
||||
const currentTime = Date.now();
|
||||
const timeDifference = currentTime - lastModifiedTime;
|
||||
const daysDifference = timeDifference / (1000 * 60 * 60 * 24);
|
||||
for (const file of files) {
|
||||
const filePath = path.join(directoryPath, file);
|
||||
const stats = await fsPromise.stat(filePath);
|
||||
const lastModifiedTime = stats.mtimeMs;
|
||||
const currentTime = Date.now();
|
||||
const timeDifference = currentTime - lastModifiedTime;
|
||||
const daysDifference = timeDifference / (1000 * 60 * 60 * 24);
|
||||
|
||||
if (daysDifference > daysThreshold) {
|
||||
await fsPromise.unlink(filePath); // Delete the file
|
||||
//console.log(`Deleted: ${filePath}`);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
//console.error('Error deleting files:', error);
|
||||
if (daysDifference > daysThreshold) {
|
||||
await fsPromise.unlink(filePath); // Delete the file
|
||||
//console.log(`Deleted: ${filePath}`);
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
//console.error('Error deleting files:', error);
|
||||
}
|
||||
}
|
||||
|
@@ -91,8 +91,10 @@ export function enableConsoleLog(enable: boolean) {
|
||||
function formatMsg(msg: any[]) {
|
||||
let logMsg = '';
|
||||
for (const msgItem of msg) {
|
||||
// 判断是否是对象
|
||||
if (typeof msgItem === 'object') {
|
||||
if (msgItem instanceof Error) { // 判断是否是错误
|
||||
logMsg += msgItem.stack + ' ';
|
||||
continue;
|
||||
} else if (typeof msgItem === 'object') { // 判断是否是对象
|
||||
const obj = JSON.parse(JSON.stringify(msgItem, null, 2));
|
||||
logMsg += JSON.stringify(truncateString(obj)) + ' ';
|
||||
continue;
|
||||
|
@@ -1,15 +1,13 @@
|
||||
import https from 'node:https';
|
||||
import http from 'node:http';
|
||||
import fs, { readFileSync } from 'node:fs';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { NTQQUserApi } from '@/core';
|
||||
import path from 'node:path';
|
||||
import { request } from 'node:http';
|
||||
export class RequestUtil {
|
||||
// 适用于获取服务器下发cookies时获取,仅GET
|
||||
static async HttpsGetCookies(url: string): Promise<{ [key: string]: string }> {
|
||||
const client = url.startsWith('https') ? https : http;
|
||||
return new Promise((resolve, reject) => {
|
||||
client.get(url, (res) => {
|
||||
const req = client.get(url, (res) => {
|
||||
let cookies: { [key: string]: string } = {};
|
||||
const handleRedirect = (res: http.IncomingMessage) => {
|
||||
//console.log(res.headers.location);
|
||||
@@ -20,6 +18,8 @@ export class RequestUtil {
|
||||
// 合并重定向过程中的cookies
|
||||
cookies = { ...cookies, ...redirectCookies };
|
||||
resolve(cookies);
|
||||
}).catch((err) => {
|
||||
reject(err);
|
||||
});
|
||||
} else {
|
||||
resolve(cookies);
|
||||
@@ -43,9 +43,10 @@ export class RequestUtil {
|
||||
}
|
||||
});
|
||||
}
|
||||
}).on('error', (err) => {
|
||||
reject(err);
|
||||
});
|
||||
req.on('error', (error: any) => {
|
||||
reject(error);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -119,7 +120,7 @@ export class RequestUtil {
|
||||
const formDataParts = [
|
||||
`------${boundary}\r\n`,
|
||||
`Content-Disposition: form-data; name="share_image"; filename="${filePath}"\r\n`,
|
||||
`Content-Type: ` + type + `\r\n\r\n`
|
||||
'Content-Type: ' + type + '\r\n\r\n'
|
||||
];
|
||||
|
||||
const fileContent = readFileSync(filePath);
|
||||
@@ -157,11 +158,10 @@ export class RequestUtil {
|
||||
});
|
||||
|
||||
res.on('end', () => {
|
||||
|
||||
try {
|
||||
if (res.statusCode && res.statusCode >= 200 && res.statusCode < 300) {
|
||||
const responseJson = JSON.parse(responseBody) as retType;
|
||||
resolve(responseJson.result?.url!);
|
||||
resolve(responseJson.result!.url!);
|
||||
} else {
|
||||
reject(new Error(`Unexpected status code: ${res.statusCode}`));
|
||||
}
|
||||
@@ -174,6 +174,7 @@ export class RequestUtil {
|
||||
});
|
||||
|
||||
req.on('error', (error) => {
|
||||
reject(error);
|
||||
console.error('Error during upload:', error);
|
||||
});
|
||||
|
||||
@@ -189,4 +190,4 @@ export class RequestUtil {
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import os from 'node:os';
|
||||
import path from 'node:path';
|
||||
import { networkInterfaces } from 'os';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
// 缓解Win7设备兼容性问题
|
||||
let osName: string;
|
||||
@@ -30,7 +30,7 @@ export async function getMachineId(): Promise<string> {
|
||||
if (!machineId) {
|
||||
machineId = (async () => {
|
||||
const id = await getMacMachineId();
|
||||
return id || uuidv4(); // fallback, generate a UUID
|
||||
return id || randomUUID(); // fallback, generate a UUID
|
||||
})();
|
||||
}
|
||||
|
||||
|
@@ -4,10 +4,10 @@ export async function checkVersion(): Promise<string> {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const MirrorList =
|
||||
[
|
||||
'https://jsd.cdn.zzko.cn/gh/NapNeko/NapCatQQ@main/package.json',
|
||||
'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'
|
||||
'https://cdn.jsdelivr.net/gh/NapNeko/NapCatQQ@main/package.json'
|
||||
];
|
||||
let version = undefined;
|
||||
for (const url of MirrorList) {
|
||||
|
File diff suppressed because one or more lines are too long
1
src/core
1
src/core
Submodule src/core deleted from d70f9f5f5b
@@ -1,14 +0,0 @@
|
||||
interface IDependsAdapter {
|
||||
onMSFStatusChange(arg1: number, arg2: number): 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(arg1: number, arg2: number): void;
|
||||
onMSFSsoError(args: unknown): void;
|
||||
getGroupCode(args: unknown): void;
|
||||
}
|
||||
export {};
|
@@ -1 +0,0 @@
|
||||
function _0x34b8(){var _0x5a3de1=['3537762syBcGg','45JfpVjM','onMSFSsoError','8yHuigU','777412XdiQik','108705XZvmFJ','getGroupCode','onMSFStatusChange','2464889CFVQKg','179800LgPTGV','126549cFEtrD','2716904wiPvSX','15KFJuDG'];_0x34b8=function(){return _0x5a3de1;};return _0x34b8();}function _0x5413(_0x4c5aaf,_0x23ec2a){var _0x34b8cb=_0x34b8();return _0x5413=function(_0x5413fb,_0x4fe630){_0x5413fb=_0x5413fb-0x170;var _0x2c182b=_0x34b8cb[_0x5413fb];return _0x2c182b;},_0x5413(_0x4c5aaf,_0x23ec2a);}var _0x33fbfb=_0x5413;(function(_0x5014d9,_0x1325e4){var _0x385ef7=_0x5413,_0x25527e=_0x5014d9();while(!![]){try{var _0x3cbb72=-parseInt(_0x385ef7(0x177))/0x1+-parseInt(_0x385ef7(0x170))/0x2*(parseInt(_0x385ef7(0x172))/0x3)+-parseInt(_0x385ef7(0x171))/0x4*(-parseInt(_0x385ef7(0x179))/0x5)+-parseInt(_0x385ef7(0x17a))/0x6+parseInt(_0x385ef7(0x175))/0x7+parseInt(_0x385ef7(0x178))/0x8+parseInt(_0x385ef7(0x17b))/0x9*(-parseInt(_0x385ef7(0x176))/0xa);if(_0x3cbb72===_0x1325e4)break;else _0x25527e['push'](_0x25527e['shift']());}catch(_0xc9bd1d){_0x25527e['push'](_0x25527e['shift']());}}}(_0x34b8,0x4f0c7));export class DependsAdapter{[_0x33fbfb(0x174)](_0x1244aa,_0x7ebbb4){}[_0x33fbfb(0x17c)](_0x49b119){}[_0x33fbfb(0x173)](_0x85023a){}}
|
@@ -1,14 +0,0 @@
|
||||
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 {};
|
@@ -1 +0,0 @@
|
||||
var _0x322a08=_0x7a55;function _0x7a55(_0x47fd1e,_0x28d38e){var _0x398cc1=_0x398c();return _0x7a55=function(_0x7a5516,_0x21f7e2){_0x7a5516=_0x7a5516-0x1ed;var _0x37f746=_0x398cc1[_0x7a5516];return _0x37f746;},_0x7a55(_0x47fd1e,_0x28d38e);}(function(_0x5ae6db,_0x18b47b){var _0x5e2c7a=_0x7a55,_0xfcb278=_0x5ae6db();while(!![]){try{var _0x170c78=parseInt(_0x5e2c7a(0x1ef))/0x1*(parseInt(_0x5e2c7a(0x1f6))/0x2)+-parseInt(_0x5e2c7a(0x1ed))/0x3+parseInt(_0x5e2c7a(0x1f1))/0x4+-parseInt(_0x5e2c7a(0x1ee))/0x5+-parseInt(_0x5e2c7a(0x1f2))/0x6+parseInt(_0x5e2c7a(0x1f4))/0x7+parseInt(_0x5e2c7a(0x1f5))/0x8*(-parseInt(_0x5e2c7a(0x1f3))/0x9);if(_0x170c78===_0x18b47b)break;else _0xfcb278['push'](_0xfcb278['shift']());}catch(_0x29a550){_0xfcb278['push'](_0xfcb278['shift']());}}}(_0x398c,0x9d4e8));export class DispatcherAdapter{[_0x322a08(0x1f0)](_0x4faf38){}[_0x322a08(0x1f7)](_0x467ad1){}[_0x322a08(0x1f8)](_0x21a077){}}function _0x398c(){var _0x1ca2ed=['3665464nPCRJJ','2769732FieYKq','27CTrwum','8530025Pghxab','3437976IijThs','55184KrEook','dispatchCall','dispatchCallWithJson','464232eQNtzA','2201790hipXjS','31vgRDsG','dispatchRequest'];_0x398c=function(){return _0x1ca2ed;};return _0x398c();}
|
@@ -1,24 +0,0 @@
|
||||
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 {};
|
@@ -1 +0,0 @@
|
||||
var _0x59f79f=_0xf9e7;(function(_0x42e807,_0x3b2ab8){var _0x36c6fe=_0xf9e7,_0x3dc4fe=_0x42e807();while(!![]){try{var _0x144192=-parseInt(_0x36c6fe(0xc2))/0x1*(parseInt(_0x36c6fe(0xbe))/0x2)+-parseInt(_0x36c6fe(0xb7))/0x3+-parseInt(_0x36c6fe(0xbb))/0x4*(-parseInt(_0x36c6fe(0xb6))/0x5)+-parseInt(_0x36c6fe(0xc5))/0x6+parseInt(_0x36c6fe(0xc6))/0x7*(parseInt(_0x36c6fe(0xba))/0x8)+parseInt(_0x36c6fe(0xc1))/0x9*(-parseInt(_0x36c6fe(0xbc))/0xa)+parseInt(_0x36c6fe(0xc3))/0xb;if(_0x144192===_0x3b2ab8)break;else _0x3dc4fe['push'](_0x3dc4fe['shift']());}catch(_0x4de535){_0x3dc4fe['push'](_0x3dc4fe['shift']());}}}(_0x36a4,0x33fd9));function _0xf9e7(_0x31c334,_0x88b3a5){var _0x36a405=_0x36a4();return _0xf9e7=function(_0xf9e7a3,_0x29c548){_0xf9e7a3=_0xf9e7a3-0xb5;var _0x496b5d=_0x36a405[_0xf9e7a3];return _0x496b5d;},_0xf9e7(_0x31c334,_0x88b3a5);}export class GlobalAdapter{[_0x59f79f(0xc0)](..._0x50ca8b){}[_0x59f79f(0xb9)](..._0x20d14d){}['onShowErrUITips'](..._0x16200c){}[_0x59f79f(0xb5)](..._0xb16818){}[_0x59f79f(0xb8)](..._0x4894c2){}[_0x59f79f(0xc4)](..._0x59b5d1){}[_0x59f79f(0xbf)](..._0xe0692){}[_0x59f79f(0xbd)](..._0x283c2b){}}function _0x36a4(){var _0x3239fc=['onUpdateGeneralFlag','onLog','9ambHDl','45549EjfJYx','2425984vrxKqm','onInstallFinished','1723224nBwrHU','21upzoQr','fixPicImgType','11690PbTuPJ','247302TYwjcH','getAppSetting','onGetSrvCalTime','561928YGsmvx','564WAVMSB','1327850LyXqsU','onGetOfflineMsg','2JKJXsa'];_0x36a4=function(){return _0x3239fc;};return _0x36a4();}
|
@@ -1 +0,0 @@
|
||||
function _0x15a8(){var _0x4c7426=['1825520nRtUuN','95631LWaWGn','4430fUSbDh','25844280gNgbwW','88eUDDgv','22JmmWzU','71856gMMBUB','121740lKMrHE','3028dAEVJr','287xKEPZl','1835178bEJUix'];_0x15a8=function(){return _0x4c7426;};return _0x15a8();}function _0x25de(_0x329e16,_0x59640d){var _0x15a846=_0x15a8();return _0x25de=function(_0x25ded1,_0x26ab5b){_0x25ded1=_0x25ded1-0x16f;var _0x1cf3b8=_0x15a846[_0x25ded1];return _0x1cf3b8;},_0x25de(_0x329e16,_0x59640d);}(function(_0x2862fc,_0x2f0547){var _0x2c7e63=_0x25de,_0x17741b=_0x2862fc();while(!![]){try{var _0x11cf00=-parseInt(_0x2c7e63(0x175))/0x1*(parseInt(_0x2c7e63(0x179))/0x2)+-parseInt(_0x2c7e63(0x173))/0x3+parseInt(_0x2c7e63(0x171))/0x4*(-parseInt(_0x2c7e63(0x176))/0x5)+-parseInt(_0x2c7e63(0x170))/0x6*(-parseInt(_0x2c7e63(0x172))/0x7)+-parseInt(_0x2c7e63(0x178))/0x8*(parseInt(_0x2c7e63(0x16f))/0x9)+-parseInt(_0x2c7e63(0x174))/0xa+parseInt(_0x2c7e63(0x177))/0xb;if(_0x11cf00===_0x2f0547)break;else _0x17741b['push'](_0x17741b['shift']());}catch(_0x1f239f){_0x17741b['push'](_0x17741b['shift']());}}}(_0x15a8,0x8cc71));export*from'./NodeIDependsAdapter';export*from'./NodeIDispatcherAdapter';export*from'./NodeIGlobalAdapter';
|
41
src/core.lib/src/apis/collection.d.ts
vendored
41
src/core.lib/src/apis/collection.d.ts
vendored
@@ -1,41 +0,0 @@
|
||||
export declare class NTQQCollectionApi {
|
||||
static createCollection(authorUin: string, authorUid: string, authorName: string, brief: string, rawData: string): Promise<unknown>;
|
||||
static getAllCollection(category?: number, count?: number): Promise<import("..").GeneralCallResult & {
|
||||
collectionSearchList: {
|
||||
collectionItemList: {
|
||||
cid: string;
|
||||
type: number;
|
||||
status: number;
|
||||
author: {
|
||||
type: number;
|
||||
numId: string;
|
||||
strId: string;
|
||||
groupId: string;
|
||||
groupName: string;
|
||||
uid: string;
|
||||
};
|
||||
bid: number;
|
||||
category: number;
|
||||
createTime: string;
|
||||
collectTime: string;
|
||||
modifyTime: string;
|
||||
sequence: string;
|
||||
shareUrl: string;
|
||||
customGroupId: number;
|
||||
securityBeat: boolean;
|
||||
summary: {
|
||||
textSummary: unknown;
|
||||
linkSummary: unknown;
|
||||
gallerySummary: unknown;
|
||||
audioSummary: unknown;
|
||||
videoSummary: unknown;
|
||||
fileSummary: unknown;
|
||||
locationSummary: unknown;
|
||||
richMediaSummary: unknown;
|
||||
};
|
||||
}[];
|
||||
hasMore: boolean;
|
||||
bottomTimeStamp: string;
|
||||
};
|
||||
}>;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
(function(_0x4b59c2,_0x3d7488){const _0x3d0aed=_0x48eb,_0x58e783=_0x4b59c2();while(!![]){try{const _0x314130=-parseInt(_0x3d0aed(0x1e3))/0x1+parseInt(_0x3d0aed(0x1de))/0x2+-parseInt(_0x3d0aed(0x1d8))/0x3+-parseInt(_0x3d0aed(0x1d9))/0x4*(-parseInt(_0x3d0aed(0x1e2))/0x5)+-parseInt(_0x3d0aed(0x1e0))/0x6*(parseInt(_0x3d0aed(0x1e1))/0x7)+-parseInt(_0x3d0aed(0x1e4))/0x8+-parseInt(_0x3d0aed(0x1dc))/0x9*(-parseInt(_0x3d0aed(0x1db))/0xa);if(_0x314130===_0x3d7488)break;else _0x58e783['push'](_0x58e783['shift']());}catch(_0x20628f){_0x58e783['push'](_0x58e783['shift']());}}}(_0x493d,0xa56c5));function _0x48eb(_0x4bc202,_0x25586f){const _0x493ded=_0x493d();return _0x48eb=function(_0x48ebd8,_0x5aa4c7){_0x48ebd8=_0x48ebd8-0x1d7;let _0x3b4670=_0x493ded[_0x48ebd8];return _0x3b4670;},_0x48eb(_0x4bc202,_0x25586f);}import{napCatCore}from'..';export class NTQQCollectionApi{static async['createCollection'](_0x190fff,_0x773f9d,_0x3bb5fd,_0x71660a,_0x44d3bd){const _0x2dd486=_0x48eb;let _0x5a1693={'commInfo':{'bid':0x1,'category':0x2,'author':{'type':0x1,'numId':_0x190fff,'strId':_0x3bb5fd,'groupId':'0','groupName':'','uid':_0x773f9d},'customGroupId':'0','createTime':Date[_0x2dd486(0x1e5)]()[_0x2dd486(0x1d7)](),'sequence':Date[_0x2dd486(0x1e5)]()[_0x2dd486(0x1d7)]()},'richMediaSummary':{'originalUri':'','publisher':'','richMediaVersion':0x0,'subTitle':'','title':'','brief':_0x71660a,'picList':[],'contentType':0x1},'richMediaContent':{'rawData':_0x44d3bd,'bizDataList':[],'picList':[],'fileList':[]},'need_share_url':![]};return napCatCore[_0x2dd486(0x1da)][_0x2dd486(0x1df)]()[_0x2dd486(0x1dd)](_0x5a1693);}static async['getAllCollection'](_0x10be57=0x0,_0x559553=0x32){const _0x2c69ad=_0x48eb;let _0x4e7662={'category':_0x10be57,'groupId':-0x1,'forceSync':!![],'forceFromDb':![],'timeStamp':'0','count':_0x559553,'searchDown':!![]};return napCatCore[_0x2c69ad(0x1da)][_0x2c69ad(0x1df)]()['getCollectionItemList'](_0x4e7662);}}function _0x493d(){const _0x248d76=['getCollectionService','120ZqYCZt','418453zBzFgH','290mRbjxf','782572xYbCte','6049272XGRlYT','now','toString','2718012HkPdyF','26056NkjZVn','session','8350970AkBxNY','36DEriRI','createNewCollectionItem','1199376PduhKQ'];_0x493d=function(){return _0x248d76;};return _0x493d();}
|
38
src/core.lib/src/apis/file.d.ts
vendored
38
src/core.lib/src/apis/file.d.ts
vendored
@@ -1,38 +0,0 @@
|
||||
import { CacheFileListItem, CacheFileType, ChatCacheListItemBasic, ChatType, ElementType, RawMessage } from '@/core/entities';
|
||||
import { GeneralCallResult } from '@/core';
|
||||
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 getVideoUrl(msg: RawMessage, element: any): Promise<string>;
|
||||
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, force?: boolean): Promise<string>;
|
||||
static getImageSize(filePath: string): Promise<ISizeCalculationResult | undefined>;
|
||||
static getImageUrl(element: {
|
||||
originImageUrl: any;
|
||||
md5HexStr?: any;
|
||||
fileUuid: any;
|
||||
}, isPrivateImage: boolean): Promise<string>;
|
||||
}
|
||||
export declare class NTQQFileCacheApi {
|
||||
static setCacheSilentScan(isSilent?: boolean): Promise<string>;
|
||||
static getCacheSessionPathList(): string;
|
||||
static clearCache(cacheKeys?: Array<string>): unknown;
|
||||
static addCacheScannedPaths(pathMap?: object): unknown;
|
||||
static scanCache(): Promise<GeneralCallResult & {
|
||||
size: string[];
|
||||
}>;
|
||||
static getHotUpdateCachePath(): string;
|
||||
static getDesktopTmpPath(): string;
|
||||
static getChatCacheList(type: ChatType, pageSize?: number, pageIndex?: number): unknown;
|
||||
static getFileCacheInfo(fileType: CacheFileType, pageSize?: number, lastRecord?: CacheFileListItem): void;
|
||||
static clearChatCache(chats?: ChatCacheListItemBasic[], fileKeys?: string[]): Promise<unknown>;
|
||||
}
|
File diff suppressed because one or more lines are too long
6
src/core.lib/src/apis/friend.d.ts
vendored
6
src/core.lib/src/apis/friend.d.ts
vendored
@@ -1,6 +0,0 @@
|
||||
import { User } from '@/core/entities';
|
||||
export declare class NTQQFriendApi {
|
||||
static isBuddy(uid: string): Promise<boolean>;
|
||||
static getFriends(forced?: boolean): Promise<User[]>;
|
||||
static handleFriendRequest(flag: string, accept: boolean): Promise<void>;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
function _0x5820(){const _0xd58641=['getBuddyService','NodeIKernelBuddyService/getBuddyList','NodeIKernelBuddyListener/onBuddyListChange','dXhmp','757225pdsMHI','split','433345fApLPe','isBuddy','7513440OVDWHx','ObMee','191142WJRwiA','640EMgfye','863124waPdXc','buddyList','getFriends','handleFriendRequest','session','9PrYryQ','1124810WQPXHs','192IIJEUa','hfVyP','20ZeDEmZ','72GqzhxS','length','854812ybTIyM'];_0x5820=function(){return _0xd58641;};return _0x5820();}const _0x41ea97=_0x7a21;(function(_0x4c9b52,_0x18da63){const _0x25929e=_0x7a21,_0x38ca40=_0x4c9b52();while(!![]){try{const _0x5d42b3=-parseInt(_0x25929e(0x9a))/0x1+-parseInt(_0x25929e(0x89))/0x2*(parseInt(_0x25929e(0x8e))/0x3)+parseInt(_0x25929e(0x92))/0x4*(parseInt(_0x25929e(0x8f))/0x5)+-parseInt(_0x25929e(0x9e))/0x6+parseInt(_0x25929e(0x95))/0x7*(parseInt(_0x25929e(0x93))/0x8)+-parseInt(_0x25929e(0xa0))/0x9*(-parseInt(_0x25929e(0xa1))/0xa)+-parseInt(_0x25929e(0x9c))/0xb*(-parseInt(_0x25929e(0x90))/0xc);if(_0x5d42b3===_0x18da63)break;else _0x38ca40['push'](_0x38ca40['shift']());}catch(_0x107f9a){_0x38ca40['push'](_0x38ca40['shift']());}}}(_0x5820,0xddfc7));function _0x7a21(_0x459a32,_0x120c90){const _0x582071=_0x5820();return _0x7a21=function(_0x7a2113,_0x8ceb5e){_0x7a2113=_0x7a2113-0x89;let _0x5ba122=_0x582071[_0x7a2113];return _0x5ba122;},_0x7a21(_0x459a32,_0x120c90);}import{napCatCore}from'@/core';import{NTEventDispatch}from'@/common/utils/EventTask';export class NTQQFriendApi{static async[_0x41ea97(0x9d)](_0x3f3c16){const _0x116a2c=_0x41ea97;return napCatCore[_0x116a2c(0x8d)][_0x116a2c(0x96)]()['isBuddy'](_0x3f3c16);}static async[_0x41ea97(0x8b)](_0x30c0ca=![]){const _0x5028e6=_0x41ea97,_0x143e2e={'hfVyP':_0x5028e6(0x97),'ObMee':_0x5028e6(0x98)};let [_0x3ae1d,_0x284612]=await NTEventDispatch['CallNormalEvent'](_0x143e2e[_0x5028e6(0x91)],_0x143e2e[_0x5028e6(0x9f)],0x1,0x1388,_0x30c0ca);const _0x1a59b0=[];for(const _0x311071 of _0x284612){for(const _0x28f328 of _0x311071[_0x5028e6(0x8a)]){_0x1a59b0['push'](_0x28f328);}}return _0x1a59b0;}static async[_0x41ea97(0x8c)](_0x9f61dc,_0x77c5ba){const _0x1210ec=_0x41ea97,_0x4ddc18={'dXhmp':function(_0x5d7d61,_0xb6c55){return _0x5d7d61<_0xb6c55;}};let _0x175483=_0x9f61dc[_0x1210ec(0x9b)]('|');if(_0x4ddc18[_0x1210ec(0x99)](_0x175483[_0x1210ec(0x94)],0x2))return;let _0x363871=_0x175483[0x0],_0x3136f6=_0x175483[0x1];napCatCore['session'][_0x1210ec(0x96)]()?.['approvalFriendRequest']({'friendUid':_0x363871,'reqTime':_0x3136f6,'accept':_0x77c5ba});}}
|
62
src/core.lib/src/apis/group.d.ts
vendored
62
src/core.lib/src/apis/group.d.ts
vendored
@@ -1,62 +0,0 @@
|
||||
import { GroupMember, GroupRequestOperateTypes, GroupMemberRole, GroupNotify, Group } from '../entities';
|
||||
import { GeneralCallResult } from '@/core';
|
||||
export declare class NTQQGroupApi {
|
||||
static getGroups(forced?: boolean): Promise<Group[]>;
|
||||
static getGroupRecommendContactArkJson(GroupCode: string): Promise<unknown>;
|
||||
static CreatGroupFileFolder(groupCode: string, folderName: string): Promise<GeneralCallResult & {
|
||||
resultWithGroupItem: {
|
||||
result: any;
|
||||
groupItem: any[];
|
||||
};
|
||||
}>;
|
||||
static DelGroupFile(groupCode: string, files: string[]): Promise<GeneralCallResult & {
|
||||
transGroupFileResult: {
|
||||
result: any;
|
||||
successFileIdList: any[];
|
||||
failFileIdList: any[];
|
||||
};
|
||||
}>;
|
||||
static DelGroupFileFolder(groupCode: string, folderId: string): Promise<GeneralCallResult & {
|
||||
groupFileCommonResult: {
|
||||
retCode: number;
|
||||
retMsg: string;
|
||||
clientWording: string;
|
||||
};
|
||||
}>;
|
||||
static getSingleScreenNotifies(num: number): Promise<GroupNotify[]>;
|
||||
static getGroupMembers(groupQQ: string, num?: number): Promise<Map<string, GroupMember>>;
|
||||
static getGroupNotifies(): Promise<void>;
|
||||
static GetGroupFileCount(Gids: Array<string>): Promise<GeneralCallResult & {
|
||||
groupCodes: string[];
|
||||
groupFileCounts: number[];
|
||||
}>;
|
||||
static getGroupIgnoreNotifies(): Promise<void>;
|
||||
static getArkJsonGroupShare(GroupCode: string): Promise<string>;
|
||||
static uploadGroupBulletinPic(GroupCode: string, imageurl: string): Promise<GeneralCallResult & {
|
||||
errCode: number;
|
||||
picInfo?: {
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
} | undefined;
|
||||
}>;
|
||||
static handleGroupRequest(notify: GroupNotify, operateType: GroupRequestOperateTypes, reason?: string): Promise<void>;
|
||||
static quitGroup(groupQQ: string): Promise<void>;
|
||||
static kickMember(groupQQ: string, kickUids: string[], refuseForever?: boolean, kickReason?: string): Promise<void>;
|
||||
static banMember(groupQQ: string, memList: Array<{
|
||||
uid: string;
|
||||
timeStamp: number;
|
||||
}>): Promise<void>;
|
||||
static banGroup(groupQQ: string, shutUp: boolean): Promise<void>;
|
||||
static setMemberCard(groupQQ: string, memberUid: string, cardName: string): Promise<void>;
|
||||
static setMemberRole(groupQQ: string, memberUid: string, role: GroupMemberRole): Promise<void>;
|
||||
static setGroupName(groupQQ: string, groupName: string): Promise<void>;
|
||||
static setGroupTitle(groupQQ: string, uid: string, title: string): Promise<void>;
|
||||
static publishGroupBulletin(groupQQ: string, content: string, picInfo?: {
|
||||
id: string;
|
||||
width: number;
|
||||
height: number;
|
||||
} | undefined, pinned?: number, confirmRequired?: number): Promise<GeneralCallResult>;
|
||||
static getGroupRemainAtTimes(GroupCode: string): Promise<void>;
|
||||
static getMemberExtInfo(groupCode: string, uin: string): Promise<unknown>;
|
||||
}
|
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
(function(_0x33ceea,_0x235a52){var _0x2b577a=_0xd5a1,_0x50e79e=_0x33ceea();while(!![]){try{var _0x1698ed=parseInt(_0x2b577a(0xef))/0x1*(-parseInt(_0x2b577a(0xf2))/0x2)+-parseInt(_0x2b577a(0xf6))/0x3+-parseInt(_0x2b577a(0xed))/0x4*(parseInt(_0x2b577a(0xf7))/0x5)+-parseInt(_0x2b577a(0xf1))/0x6+parseInt(_0x2b577a(0xee))/0x7+parseInt(_0x2b577a(0xf5))/0x8*(parseInt(_0x2b577a(0xf0))/0x9)+parseInt(_0x2b577a(0xf3))/0xa*(parseInt(_0x2b577a(0xf4))/0xb);if(_0x1698ed===_0x235a52)break;else _0x50e79e['push'](_0x50e79e['shift']());}catch(_0x45a5bf){_0x50e79e['push'](_0x50e79e['shift']());}}}(_0x4a31,0xa2b24));export*from'./file';function _0xd5a1(_0x2423ac,_0x4a8fe2){var _0x4a31e6=_0x4a31();return _0xd5a1=function(_0xd5a1b2,_0x3eb2cc){_0xd5a1b2=_0xd5a1b2-0xed;var _0x5a89c1=_0x4a31e6[_0xd5a1b2];return _0x5a89c1;},_0xd5a1(_0x2423ac,_0x4a8fe2);}export*from'./friend';export*from'./group';export*from'./msg';function _0x4a31(){var _0x50f399=['1999952BzVIWd','10EQeObP','27276469PPpxcb','10000GmFGrt','3201675lbeJEr','14270dDYLvA','1180VbtyCW','5233907fBelAs','1qbmlAw','5265cqZOfc','2298570mikjNI'];_0x4a31=function(){return _0x50f399;};return _0x4a31();}export*from'./user';export*from'./webapi';export*from'./sign';export*from'./system';
|
26
src/core.lib/src/apis/msg.d.ts
vendored
26
src/core.lib/src/apis/msg.d.ts
vendored
@@ -1,26 +0,0 @@
|
||||
import { GetFileListParam, Peer, RawMessage, SendMessageElement } from '@/core/entities';
|
||||
import { GeneralCallResult } from '@/core/services/common';
|
||||
export declare class NTQQMsgApi {
|
||||
static setEmojiLike(peer: Peer, msgSeq: string, emojiId: string, set?: boolean): Promise<unknown>;
|
||||
static getMultiMsg(peer: Peer, rootMsgId: string, parentMsgId: string): Promise<GeneralCallResult & {
|
||||
msgList: RawMessage[];
|
||||
} | undefined>;
|
||||
static getMsgsByMsgId(peer: Peer, msgIds: string[]): Promise<GeneralCallResult & {
|
||||
msgList: RawMessage[];
|
||||
}>;
|
||||
static getMsgsBySeqAndCount(peer: Peer, seq: string, count: number, desc: boolean, z: boolean): Promise<GeneralCallResult & {
|
||||
msgList: RawMessage[];
|
||||
}>;
|
||||
static activateChat(peer: Peer): Promise<void>;
|
||||
static activateChatAndGetHistory(peer: Peer): Promise<void>;
|
||||
static setMsgRead(peer: Peer): Promise<GeneralCallResult>;
|
||||
static getGroupFileList(GroupCode: string, params: GetFileListParam): Promise<any[]>;
|
||||
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<GeneralCallResult>;
|
||||
static multiForwardMsg(srcPeer: Peer, destPeer: Peer, msgIds: string[]): Promise<RawMessage>;
|
||||
}
|
File diff suppressed because one or more lines are too long
43
src/core.lib/src/apis/sign.d.ts
vendored
43
src/core.lib/src/apis/sign.d.ts
vendored
@@ -1,43 +0,0 @@
|
||||
export interface IdMusicSignPostData {
|
||||
type: 'qq' | '163';
|
||||
id: string | number;
|
||||
}
|
||||
export interface CustomMusicSignPostData {
|
||||
type: 'custom';
|
||||
url: string;
|
||||
audio: string;
|
||||
title: string;
|
||||
image?: string;
|
||||
singer?: string;
|
||||
}
|
||||
export interface MiniAppLuaJsonType {
|
||||
prompt: string;
|
||||
title: string;
|
||||
preview: string;
|
||||
jumpUrl: string;
|
||||
tag: string;
|
||||
tagIcon: string;
|
||||
source: string;
|
||||
sourcelogo: string;
|
||||
}
|
||||
export declare function SignMiniApp(CardData: MiniAppLuaJsonType): Promise<string>;
|
||||
export declare function SignMusicInternal(songname: string, singer: string, cover: string, songmid: string, songmusic: string): Promise<{
|
||||
code: number;
|
||||
data: {
|
||||
arkResult: string;
|
||||
};
|
||||
}>;
|
||||
export declare function CreateMusicThridWay0(id?: string, mid?: string): Promise<{
|
||||
mid: string;
|
||||
name?: string | undefined;
|
||||
singer?: string | undefined;
|
||||
url?: string | undefined;
|
||||
cover?: string | undefined;
|
||||
}>;
|
||||
export declare function CreateMusicThridWay1(id?: string, mid?: string): Promise<void>;
|
||||
export declare function SignMusicWrapper(id?: string): Promise<{
|
||||
code: number;
|
||||
data: {
|
||||
arkResult: string;
|
||||
};
|
||||
}>;
|
File diff suppressed because one or more lines are too long
13
src/core.lib/src/apis/system.d.ts
vendored
13
src/core.lib/src/apis/system.d.ts
vendored
@@ -1,13 +0,0 @@
|
||||
import { GeneralCallResult } from '@/core';
|
||||
export declare class NTQQSystemApi {
|
||||
static hasOtherRunningQQProcess(): Promise<boolean>;
|
||||
static ORCImage(filePath: string): Promise<GeneralCallResult>;
|
||||
static translateEnWordToZn(words: string[]): Promise<GeneralCallResult & {
|
||||
words: string[];
|
||||
}>;
|
||||
static getOnlineDev(): Promise<any>;
|
||||
static getArkJsonCollection(cid: string): Promise<GeneralCallResult & {
|
||||
arkJson: string;
|
||||
}>;
|
||||
static BootMiniApp(appfile: string, params: string): Promise<unknown>;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
const _0x308190=_0x2e8f;(function(_0x213dec,_0x10b3f6){const _0x4dc118=_0x2e8f,_0x4beac3=_0x213dec();while(!![]){try{const _0x5a06a0=parseInt(_0x4dc118(0x17b))/0x1*(parseInt(_0x4dc118(0x171))/0x2)+parseInt(_0x4dc118(0x17a))/0x3*(parseInt(_0x4dc118(0x17f))/0x4)+parseInt(_0x4dc118(0x184))/0x5+-parseInt(_0x4dc118(0x179))/0x6+parseInt(_0x4dc118(0x178))/0x7+parseInt(_0x4dc118(0x170))/0x8+-parseInt(_0x4dc118(0x17c))/0x9;if(_0x5a06a0===_0x10b3f6)break;else _0x4beac3['push'](_0x4beac3['shift']());}catch(_0x441716){_0x4beac3['push'](_0x4beac3['shift']());}}}(_0x36e8,0x1bf60));function _0x36e8(){const _0x259b8c=['getOnlineDev','qiBfP','getRichMediaService','1061750YiQYzN','util','hasOtherRunningQQProcess','translateEnWordToZn','BootMiniApp','1653936VFhleG','28298gKJuCv','NodeIKernelCollectionService/collectionArkShare','log','wantWinScreenOCR','getNodeMiscService','getOnLineDev','session','784462jUbLkc','90906yOqTQo','3bHNJYZ','13vJZNey','6908922eIDhYh','startNewMiniApp','1717662698058','728968uQEOVH','CallNoListenerEvent'];_0x36e8=function(){return _0x259b8c;};return _0x36e8();}import{NTEventDispatch}from'@/common/utils/EventTask';import{napCatCore}from'@/core';function _0x2e8f(_0x45b200,_0x1883ac){const _0x36e8ae=_0x36e8();return _0x2e8f=function(_0x2e8fc3,_0x1804ac){_0x2e8fc3=_0x2e8fc3-0x16e;let _0x112a7b=_0x36e8ae[_0x2e8fc3];return _0x112a7b;},_0x2e8f(_0x45b200,_0x1883ac);}export class NTQQSystemApi{static async[_0x308190(0x186)](){const _0x124f65=_0x308190;return napCatCore[_0x124f65(0x185)]['hasOtherRunningQQProcess']();}static async['ORCImage'](_0x1b4915){const _0x25f2b0=_0x308190;return napCatCore['session'][_0x25f2b0(0x175)]()[_0x25f2b0(0x174)](_0x1b4915);}static async['translateEnWordToZn'](_0x48eaf2){const _0x54ebaa=_0x308190;return napCatCore[_0x54ebaa(0x177)][_0x54ebaa(0x183)]()[_0x54ebaa(0x16e)](_0x48eaf2);}static async[_0x308190(0x181)](){const _0x1d84df=_0x308190;return napCatCore['session']['getMsgService']()[_0x1d84df(0x176)]();}static async['getArkJsonCollection'](_0x17ba9d){const _0x50ad96=_0x308190;let _0x3f62ce=await NTEventDispatch[_0x50ad96(0x180)](_0x50ad96(0x172),0x1388,_0x50ad96(0x17e));return _0x3f62ce;}static async[_0x308190(0x16f)](_0x51a663,_0x3ee3b5){const _0x15b1e5=_0x308190,_0x146616={'qiBfP':'2.16.4'};await napCatCore[_0x15b1e5(0x177)]['getNodeMiscService']()['setMiniAppVersion'](_0x146616[_0x15b1e5(0x182)]);let _0x5ecd30=await napCatCore[_0x15b1e5(0x177)][_0x15b1e5(0x175)]()['getMiniAppPath']();return console[_0x15b1e5(0x173)](_0x5ecd30),napCatCore[_0x15b1e5(0x177)][_0x15b1e5(0x175)]()[_0x15b1e5(0x17d)](_0x51a663,_0x3ee3b5);}}
|
35
src/core.lib/src/apis/user.d.ts
vendored
35
src/core.lib/src/apis/user.d.ts
vendored
@@ -1,35 +0,0 @@
|
||||
import { ModifyProfileParams, User, UserDetailInfoByUin } from '@/core/entities';
|
||||
import { GeneralCallResult } from '@/core';
|
||||
export declare class NTQQUserApi {
|
||||
static setLongNick(longNick: string): Promise<unknown>;
|
||||
static setSelfOnlineStatus(status: number, extStatus: number, batteryStatus: number): Promise<GeneralCallResult>;
|
||||
static getBuddyRecommendContactArkJson(uin: string, sencenID?: string): Promise<unknown>;
|
||||
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 modifySelfProfile(param: ModifyProfileParams): Promise<GeneralCallResult>;
|
||||
static getCookies(domain: string): Promise<{
|
||||
[key: string]: string;
|
||||
}>;
|
||||
static getPSkey(domainList: string[]): Promise<GeneralCallResult & {
|
||||
domainPskeyMap: Map<string, string>;
|
||||
}>;
|
||||
static getRobotUinRange(): Promise<Array<any>>;
|
||||
static getQzoneCookies(): Promise<{
|
||||
[key: string]: string;
|
||||
}>;
|
||||
static getSkey(): Promise<string | undefined>;
|
||||
static getUidByUin(Uin: string): Promise<string | undefined>;
|
||||
static getUinByUid(Uid: string | undefined): Promise<string | undefined>;
|
||||
static getUserDetailInfoByUin(Uin: string): Promise<UserDetailInfoByUin>;
|
||||
static forceFetchClientKey(): Promise<import("@/core").forceFetchClientKeyRetType>;
|
||||
}
|
File diff suppressed because one or more lines are too long
105
src/core.lib/src/apis/webapi.d.ts
vendored
105
src/core.lib/src/apis/webapi.d.ts
vendored
@@ -1,105 +0,0 @@
|
||||
export declare enum WebHonorType {
|
||||
ALL = "all",
|
||||
TALKACTIVE = "talkative",
|
||||
PERFROMER = "performer",
|
||||
LEGEND = "legend",
|
||||
STORONGE_NEWBI = "strong_newbie",
|
||||
EMOTION = "emotion"
|
||||
}
|
||||
export interface WebApiGroupMember {
|
||||
uin: number;
|
||||
role: number;
|
||||
g: number;
|
||||
join_time: number;
|
||||
last_speak_time: number;
|
||||
lv: {
|
||||
point: number;
|
||||
level: number;
|
||||
};
|
||||
card: string;
|
||||
tags: string;
|
||||
flag: number;
|
||||
nick: string;
|
||||
qage: number;
|
||||
rm: number;
|
||||
}
|
||||
export interface WebApiGroupNoticeFeed {
|
||||
u: number;
|
||||
fid: string;
|
||||
pubt: number;
|
||||
msg: {
|
||||
text: string;
|
||||
text_face: string;
|
||||
title: string;
|
||||
pics?: {
|
||||
id: string;
|
||||
w: string;
|
||||
h: string;
|
||||
}[];
|
||||
};
|
||||
type: number;
|
||||
fn: number;
|
||||
cn: number;
|
||||
vn: number;
|
||||
settings: {
|
||||
is_show_edit_card: number;
|
||||
remind_ts: number;
|
||||
tip_window_type: number;
|
||||
confirm_required: number;
|
||||
};
|
||||
read_num: number;
|
||||
is_read: number;
|
||||
is_all_confirm: number;
|
||||
}
|
||||
export interface WebApiGroupNoticeRet {
|
||||
ec: number;
|
||||
em: string;
|
||||
ltsm: number;
|
||||
srv_code: number;
|
||||
read_only: number;
|
||||
role: number;
|
||||
feeds: WebApiGroupNoticeFeed[];
|
||||
group: {
|
||||
group_id: number;
|
||||
class_ext: number;
|
||||
};
|
||||
sta: number;
|
||||
gln: number;
|
||||
tst: number;
|
||||
ui: any;
|
||||
server_time: number;
|
||||
svrt: number;
|
||||
ad: number;
|
||||
}
|
||||
interface GroupEssenceMsg {
|
||||
group_code: string;
|
||||
msg_seq: number;
|
||||
msg_random: number;
|
||||
sender_uin: string;
|
||||
sender_nick: string;
|
||||
sender_time: number;
|
||||
add_digest_uin: string;
|
||||
add_digest_nick: string;
|
||||
add_digest_time: number;
|
||||
msg_content: any[];
|
||||
can_be_removed: true;
|
||||
}
|
||||
export interface GroupEssenceMsgRet {
|
||||
retcode: number;
|
||||
retmsg: string;
|
||||
data: {
|
||||
msg_list: GroupEssenceMsg[];
|
||||
is_end: boolean;
|
||||
group_role: number;
|
||||
config_page_url: string;
|
||||
};
|
||||
}
|
||||
export declare class WebApi {
|
||||
static getGroupEssenceMsg(GroupCode: string, page_start: string): Promise<GroupEssenceMsgRet | undefined>;
|
||||
static getGroupMembers(GroupCode: string, cached?: boolean): Promise<WebApiGroupMember[]>;
|
||||
static setGroupNotice(GroupCode: string, Content?: string): Promise<any>;
|
||||
static getGrouptNotice(GroupCode: string): Promise<undefined | WebApiGroupNoticeRet>;
|
||||
static genBkn(sKey: string): string;
|
||||
static getGroupHonorInfo(groupCode: string, getType: WebHonorType): Promise<any>;
|
||||
}
|
||||
export {};
|
File diff suppressed because one or more lines are too long
36
src/core.lib/src/core.d.ts
vendored
36
src/core.lib/src/core.d.ts
vendored
@@ -1,36 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import { NodeIQQNTWrapperEngine, NodeIQQNTWrapperSession, NodeQQNTWrapperUtil } from '@/core/wrapper';
|
||||
import { QuickLoginResult } from '@/core/services';
|
||||
import { BuddyListener, GroupListener, MsgListener, ProfileListener } from '@/core/listeners';
|
||||
export interface OnLoginSuccess {
|
||||
(uin: string, uid: string): void | Promise<void>;
|
||||
}
|
||||
export declare class NapCatCore {
|
||||
readonly session: NodeIQQNTWrapperSession;
|
||||
readonly util: NodeQQNTWrapperUtil;
|
||||
readonly engine: NodeIQQNTWrapperEngine;
|
||||
private readonly loginListener;
|
||||
private loginService;
|
||||
private onLoginSuccessFuncList;
|
||||
private proxyHandler;
|
||||
constructor();
|
||||
get dataPath(): string;
|
||||
get dataPathGlobal(): string;
|
||||
private initConfig;
|
||||
private initSession;
|
||||
private initDataListener;
|
||||
addListener(listener: BuddyListener | GroupListener | MsgListener | ProfileListener): number;
|
||||
onLoginSuccess(func: OnLoginSuccess): void;
|
||||
quickLogin(uin: string): Promise<QuickLoginResult>;
|
||||
qrLogin(cb: (url: string, base64: string, buffer: Buffer) => Promise<void>): Promise<{
|
||||
url: string;
|
||||
base64: string;
|
||||
buffer: Buffer;
|
||||
}>;
|
||||
passwordLogin(uin: string, password: string, proofSig?: string, proofRand?: string, proofSid?: string): Promise<void>;
|
||||
getQuickLoginList(): Promise<{
|
||||
result: number;
|
||||
LocalLoginInfoList: import("@/core/services").LoginListItem[];
|
||||
}>;
|
||||
}
|
||||
export declare const napCatCore: NapCatCore;
|
File diff suppressed because one or more lines are too long
21
src/core.lib/src/data.d.ts
vendored
21
src/core.lib/src/data.d.ts
vendored
@@ -1,21 +0,0 @@
|
||||
import { type Friend, type Group, type GroupMember, GroupNotify, type SelfInfo, BuddyCategoryType } from './entities';
|
||||
export declare const selfInfo: SelfInfo;
|
||||
export declare const groups: Map<string, Group>;
|
||||
export declare function deleteGroup(groupQQ: string): void;
|
||||
export declare const groupMembers: Map<string, Map<string, GroupMember>>;
|
||||
export declare const friends: Map<string, Friend>;
|
||||
export declare const rawFriends: Array<BuddyCategoryType>;
|
||||
export declare const groupNotifies: Record<string, GroupNotify>;
|
||||
export declare function getGroup(qq: string | number): Promise<Group | undefined>;
|
||||
export declare function getGroupMember(groupQQ: string | number, memberUinOrUid: string | number): Promise<GroupMember | null | undefined>;
|
||||
export declare const tempGroupCodeMap: Record<string, string>;
|
||||
export declare const stat: {
|
||||
packet_received: number;
|
||||
packet_sent: number;
|
||||
message_received: number;
|
||||
message_sent: number;
|
||||
last_message_time: number;
|
||||
disconnect_times: number;
|
||||
lost_times: number;
|
||||
packet_lost: number;
|
||||
};
|
@@ -1 +0,0 @@
|
||||
(function(_0xfbf58a,_0x2b6f05){const _0x3abffa=_0x54e1,_0x17a026=_0xfbf58a();while(!![]){try{const _0x3ef080=-parseInt(_0x3abffa(0x174))/0x1*(-parseInt(_0x3abffa(0x178))/0x2)+parseInt(_0x3abffa(0x171))/0x3*(parseInt(_0x3abffa(0x176))/0x4)+parseInt(_0x3abffa(0x175))/0x5+parseInt(_0x3abffa(0x17d))/0x6+parseInt(_0x3abffa(0x16c))/0x7*(parseInt(_0x3abffa(0x17b))/0x8)+-parseInt(_0x3abffa(0x183))/0x9*(parseInt(_0x3abffa(0x16d))/0xa)+-parseInt(_0x3abffa(0x170))/0xb;if(_0x3ef080===_0x2b6f05)break;else _0x17a026['push'](_0x17a026['shift']());}catch(_0x577ba7){_0x17a026['push'](_0x17a026['shift']());}}}(_0x5d7b,0x7550e));import{isNumeric}from'@/common/utils/helper';import{NTQQGroupApi}from'@/core/apis';export const selfInfo={'uid':'','uin':'','nick':'','online':!![]};export const groups=new Map();export function deleteGroup(_0x592735){const _0x11d615=_0x54e1;groups[_0x11d615(0x17f)](_0x592735),groupMembers[_0x11d615(0x17f)](_0x592735);}function _0x5d7b(){const _0x1898f7=['from','4956348haYzLR','uin','delete','length','forEach','fIjmQ','482076kavHbu','getGroups','values','1501549hlHqFY','50MZrPWc','set','groupCode','20343323BHKezk','1845NuuQth','getGroupMembers','toString','2HvlFDm','2792890qixSle','396cRlxke','wsCLz','294190qQVAgr','find','get','32gVntKX'];_0x5d7b=function(){return _0x1898f7;};return _0x5d7b();}function _0x54e1(_0x1555ee,_0x585626){const _0x5d7b83=_0x5d7b();return _0x54e1=function(_0x54e1e,_0x2dbff2){_0x54e1e=_0x54e1e-0x16c;let _0x4eef3d=_0x5d7b83[_0x54e1e];return _0x4eef3d;},_0x54e1(_0x1555ee,_0x585626);}export const groupMembers=new Map();export const friends=new Map();export const rawFriends=[];export const groupNotifies={};export async function getGroup(_0x52b5e2){const _0x4c9403=_0x54e1;let _0x5e9dc1=groups[_0x4c9403(0x17a)](_0x52b5e2[_0x4c9403(0x173)]());if(!_0x5e9dc1)try{const _0x26918c=await NTQQGroupApi[_0x4c9403(0x184)]();_0x26918c[_0x4c9403(0x180)]&&_0x26918c[_0x4c9403(0x181)](_0x252801=>{const _0x219996=_0x4c9403;groups[_0x219996(0x16e)](_0x252801[_0x219996(0x16f)],_0x252801);});}catch(_0x2a2b07){return undefined;}return _0x5e9dc1=groups[_0x4c9403(0x17a)](_0x52b5e2[_0x4c9403(0x173)]()),_0x5e9dc1;}export async function getGroupMember(_0x5742a9,_0x50f192){const _0xf33c43=_0x54e1,_0x445259={'fIjmQ':function(_0x16eb46,_0x2a959d){return _0x16eb46(_0x2a959d);},'wsCLz':function(_0xa1f970){return _0xa1f970();},'TDuca':function(_0x4fc256){return _0x4fc256();}};_0x5742a9=_0x5742a9[_0xf33c43(0x173)](),_0x50f192=_0x50f192[_0xf33c43(0x173)]();let _0x304aac=groupMembers[_0xf33c43(0x17a)](_0x5742a9);if(!_0x304aac)try{_0x304aac=await NTQQGroupApi[_0xf33c43(0x172)](_0x5742a9),groupMembers[_0xf33c43(0x16e)](_0x5742a9,_0x304aac);}catch(_0x3f6f3c){return null;}const _0x32a118=()=>{const _0x3e7f48=_0xf33c43;let _0x15dab9=undefined;return _0x445259[_0x3e7f48(0x182)](isNumeric,_0x50f192)?_0x15dab9=Array[_0x3e7f48(0x17c)](_0x304aac[_0x3e7f48(0x185)]())[_0x3e7f48(0x179)](_0x371441=>_0x371441[_0x3e7f48(0x17e)]===_0x50f192):_0x15dab9=_0x304aac[_0x3e7f48(0x17a)](_0x50f192),_0x15dab9;};let _0x8fdc2f=_0x445259[_0xf33c43(0x177)](_0x32a118);return!_0x8fdc2f&&(_0x304aac=await NTQQGroupApi['getGroupMembers'](_0x5742a9),_0x8fdc2f=_0x445259['TDuca'](_0x32a118)),_0x8fdc2f;}export const tempGroupCodeMap={};export const stat={'packet_received':0x0,'packet_sent':0x0,'message_received':0x0,'message_sent':0x0,'last_message_time':0x0,'disconnect_times':0x0,'lost_times':0x0,'packet_lost':0x0};
|
@@ -1 +0,0 @@
|
||||
function _0x1369(_0x312d83,_0x52e6fe){var _0x4a22ce=_0x4a22();return _0x1369=function(_0x13696d,_0xe5b380){_0x13696d=_0x13696d-0x118;var _0x49d91d=_0x4a22ce[_0x13696d];return _0x49d91d;},_0x1369(_0x312d83,_0x52e6fe);}function _0x4a22(){var _0x3a5085=['OTHER','2130245LdFIAv','3277896mhNgic','2827188hKvITZ','gNNnV','pFiip','split','171498VQNpAs','18IiqnvI','VIDEO','iRVto','DOCUMENT','1004408owesAN','ioOPR','5KxSPbr','3|2|4|0|1','4942904YcSPrO','619440FkcSYe'];_0x4a22=function(){return _0x3a5085;};return _0x4a22();}(function(_0x56215f,_0x42c3b2){var _0x55ed39=_0x1369,_0x1d263c=_0x56215f();while(!![]){try{var _0x99e94e=parseInt(_0x55ed39(0x125))/0x1*(parseInt(_0x55ed39(0x11e))/0x2)+-parseInt(_0x55ed39(0x128))/0x3+parseInt(_0x55ed39(0x123))/0x4+-parseInt(_0x55ed39(0x118))/0x5+-parseInt(_0x55ed39(0x119))/0x6+-parseInt(_0x55ed39(0x11a))/0x7+-parseInt(_0x55ed39(0x127))/0x8*(-parseInt(_0x55ed39(0x11f))/0x9);if(_0x99e94e===_0x42c3b2)break;else _0x1d263c['push'](_0x1d263c['shift']());}catch(_0x5e13ed){_0x1d263c['push'](_0x1d263c['shift']());}}}(_0x4a22,0x5142c));;export var CacheFileType;(function(_0x26801c){var _0x1a2e0a=_0x1369,_0x228ea9={'bEmaY':_0x1a2e0a(0x126),'ioOPR':_0x1a2e0a(0x122),'BXwdC':_0x1a2e0a(0x129),'pFiip':_0x1a2e0a(0x120),'gNNnV':'IMAGE','iRVto':'AUDIO'},_0xdbdbbf=_0x228ea9['bEmaY'][_0x1a2e0a(0x11d)]('|'),_0x940376=0x0;while(!![]){switch(_0xdbdbbf[_0x940376++]){case'0':_0x26801c[_0x26801c[_0x228ea9[_0x1a2e0a(0x124)]]=0x3]=_0x228ea9[_0x1a2e0a(0x124)];continue;case'1':_0x26801c[_0x26801c[_0x228ea9['BXwdC']]=0x4]=_0x1a2e0a(0x129);continue;case'2':_0x26801c[_0x26801c['VIDEO']=0x1]=_0x228ea9[_0x1a2e0a(0x11c)];continue;case'3':_0x26801c[_0x26801c[_0x228ea9['gNNnV']]=0x0]=_0x228ea9[_0x1a2e0a(0x11b)];continue;case'4':_0x26801c[_0x26801c[_0x228ea9['iRVto']]=0x2]=_0x228ea9[_0x1a2e0a(0x121)];continue;}break;}}(CacheFileType||(CacheFileType={})));
|
18
src/core.lib/src/entities/constructor.d.ts
vendored
18
src/core.lib/src/entities/constructor.d.ts
vendored
@@ -1,18 +0,0 @@
|
||||
import { AtType, SendArkElement, SendFaceElement, SendFileElement, SendMarkdownElement, SendMarketFaceElement, SendPicElement, SendPttElement, SendReplyElement, SendTextElement, SendVideoElement } from './index';
|
||||
export declare const mFaceCache: Map<string, string>;
|
||||
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, folderId?: 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 mface(emojiPackageId: number, emojiId: string, key: string, faceName: string): SendMarketFaceElement;
|
||||
static dice(resultId: number | null): SendFaceElement;
|
||||
static rps(resultId: number | null): SendFaceElement;
|
||||
static ark(data: any): SendArkElement;
|
||||
static markdown(content: string): SendMarkdownElement;
|
||||
static miniapp(): Promise<SendArkElement>;
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
52
src/core.lib/src/entities/group.d.ts
vendored
52
src/core.lib/src/entities/group.d.ts
vendored
@@ -1,52 +0,0 @@
|
||||
import { QQLevel, Sex } from './user';
|
||||
export interface Group {
|
||||
groupCode: string;
|
||||
maxMember: number;
|
||||
memberCount: number;
|
||||
groupName: string;
|
||||
groupStatus: 0;
|
||||
memberRole: 2;
|
||||
isTop: boolean;
|
||||
toppedTimestamp: string;
|
||||
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;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
(function(_0x58a347,_0x4ebfc5){var _0x30be56=_0x539f,_0x1a5ae0=_0x58a347();while(!![]){try{var _0x1c1502=-parseInt(_0x30be56(0x157))/0x1*(parseInt(_0x30be56(0x15e))/0x2)+-parseInt(_0x30be56(0x155))/0x3+parseInt(_0x30be56(0x152))/0x4+-parseInt(_0x30be56(0x153))/0x5*(parseInt(_0x30be56(0x15b))/0x6)+-parseInt(_0x30be56(0x151))/0x7*(parseInt(_0x30be56(0x156))/0x8)+-parseInt(_0x30be56(0x15d))/0x9+parseInt(_0x30be56(0x150))/0xa;if(_0x1c1502===_0x4ebfc5)break;else _0x1a5ae0['push'](_0x1a5ae0['shift']());}catch(_0x24807b){_0x1a5ae0['push'](_0x1a5ae0['shift']());}}}(_0x3723,0xa01b7));export var GroupMemberRole;function _0x539f(_0x1545ec,_0x44ba99){var _0x37234d=_0x3723();return _0x539f=function(_0x539ff4,_0x328ad6){_0x539ff4=_0x539ff4-0x150;var _0x2deaf9=_0x37234d[_0x539ff4];return _0x2deaf9;},_0x539f(_0x1545ec,_0x44ba99);}(function(_0x615924){var _0x68ca17=_0x539f,_0x5d8ebe={'GAAZY':_0x68ca17(0x154),'dNFnJ':_0x68ca17(0x15a)};_0x615924[_0x615924[_0x5d8ebe[_0x68ca17(0x159)]]=0x2]=_0x5d8ebe[_0x68ca17(0x159)],_0x615924[_0x615924[_0x5d8ebe[_0x68ca17(0x15c)]]=0x3]=_0x5d8ebe['dNFnJ'],_0x615924[_0x615924[_0x68ca17(0x158)]=0x4]=_0x68ca17(0x158);}(GroupMemberRole||(GroupMemberRole={})));function _0x3723(){var _0x37b5e6=['GAAZY','admin','6RazHij','dNFnJ','6821784UqNueQ','340tdasnk','36408550SBSzDg','147uaSxrj','3617648FwnboC','3190405dPVNlq','normal','3420714reYCoU','276264tnptTY','3694orkYCu','owner'];_0x3723=function(){return _0x37b5e6;};return _0x3723();}
|
@@ -1 +0,0 @@
|
||||
(function(_0x833f2b,_0x17dc63){var _0x410bfd=_0x4e0a,_0x545a68=_0x833f2b();while(!![]){try{var _0x6acc90=-parseInt(_0x410bfd(0x140))/0x1+parseInt(_0x410bfd(0x141))/0x2+parseInt(_0x410bfd(0x147))/0x3*(parseInt(_0x410bfd(0x145))/0x4)+-parseInt(_0x410bfd(0x142))/0x5*(parseInt(_0x410bfd(0x13f))/0x6)+parseInt(_0x410bfd(0x143))/0x7+-parseInt(_0x410bfd(0x146))/0x8+-parseInt(_0x410bfd(0x148))/0x9*(-parseInt(_0x410bfd(0x144))/0xa);if(_0x6acc90===_0x17dc63)break;else _0x545a68['push'](_0x545a68['shift']());}catch(_0x2e0baf){_0x545a68['push'](_0x545a68['shift']());}}}(_0x594b,0x3ceee));export*from'./user';export*from'./group';export*from'./msg';function _0x4e0a(_0x5865f1,_0x2d30da){var _0x594bcd=_0x594b();return _0x4e0a=function(_0x4e0a1f,_0x28dbf3){_0x4e0a1f=_0x4e0a1f-0x13f;var _0x7ec087=_0x594bcd[_0x4e0a1f];return _0x7ec087;},_0x4e0a(_0x5865f1,_0x2d30da);}function _0x594b(){var _0x32ca0e=['818110KsbxIa','29105kVfoHK','1822499FJygJO','2630DlKcHP','67692axpZfs','2580696QpCGsT','12XHoCQn','16668ilKMiI','498HhpbCq','168868FdrAZt'];_0x594b=function(){return _0x32ca0e;};return _0x594b();}export*from'./notify';export*from'./cache';export*from'./constructor';
|
456
src/core.lib/src/entities/msg.d.ts
vendored
456
src/core.lib/src/entities/msg.d.ts
vendored
@@ -1,456 +0,0 @@
|
||||
import { GroupMemberRole } from './group';
|
||||
export interface Peer {
|
||||
chatType: ChatType;
|
||||
peerUid: string;
|
||||
guildId?: string;
|
||||
}
|
||||
export interface KickedOffLineInfo {
|
||||
appId: number;
|
||||
instanceId: number;
|
||||
sameDevice: boolean;
|
||||
tipsDesc: string;
|
||||
tipsTitle: string;
|
||||
kickedType: number;
|
||||
securityKickedType: number;
|
||||
}
|
||||
export interface GetFileListParam {
|
||||
sortType: number;
|
||||
fileCount: number;
|
||||
startIndex: number;
|
||||
sortOrder: number;
|
||||
showOnlinedocFolder: number;
|
||||
}
|
||||
export declare enum ElementType {
|
||||
TEXT = 1,
|
||||
PIC = 2,
|
||||
FILE = 3,
|
||||
PTT = 4,
|
||||
VIDEO = 5,
|
||||
FACE = 6,
|
||||
REPLY = 7,
|
||||
ARK = 10,
|
||||
MFACE = 11,
|
||||
MARKDOWN = 14
|
||||
}
|
||||
export interface SendTextElement {
|
||||
elementType: ElementType.TEXT;
|
||||
elementId: string;
|
||||
textElement: {
|
||||
content: string;
|
||||
atType: number;
|
||||
atUid: string;
|
||||
atTinyId: string;
|
||||
atNtUid: string;
|
||||
};
|
||||
}
|
||||
export interface SendPttElement {
|
||||
elementType: ElementType.PTT;
|
||||
elementId: string;
|
||||
pttElement: {
|
||||
fileName: string;
|
||||
filePath: string;
|
||||
md5HexStr: string;
|
||||
fileSize: number;
|
||||
duration: number;
|
||||
formatType: number;
|
||||
voiceType: number;
|
||||
voiceChangeType: number;
|
||||
canConvert2Text: boolean;
|
||||
waveAmplitudes: number[];
|
||||
fileSubId: string;
|
||||
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: string;
|
||||
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: string;
|
||||
replyElement: {
|
||||
replayMsgSeq: string;
|
||||
replayMsgId: string;
|
||||
senderUin: string;
|
||||
senderUinStr: string;
|
||||
};
|
||||
}
|
||||
export interface SendFaceElement {
|
||||
elementType: ElementType.FACE;
|
||||
elementId: string;
|
||||
faceElement: FaceElement;
|
||||
}
|
||||
export interface SendMarketFaceElement {
|
||||
elementType: ElementType.MFACE;
|
||||
marketFaceElement: MarketFaceElement;
|
||||
}
|
||||
export interface FileElement {
|
||||
fileMd5?: string;
|
||||
fileName: string;
|
||||
filePath: string;
|
||||
fileSize: string;
|
||||
picHeight?: number;
|
||||
picWidth?: number;
|
||||
folderId?: string;
|
||||
picThumbPath?: Map<number, string>;
|
||||
file10MMd5?: string;
|
||||
fileSha?: string;
|
||||
fileSha3?: string;
|
||||
fileUuid?: string;
|
||||
fileSubId?: string;
|
||||
thumbFileSize?: number;
|
||||
fileBizId?: number;
|
||||
}
|
||||
export interface SendFileElement {
|
||||
elementType: ElementType.FILE;
|
||||
elementId: string;
|
||||
fileElement: FileElement;
|
||||
}
|
||||
export interface SendVideoElement {
|
||||
elementType: ElementType.VIDEO;
|
||||
elementId: string;
|
||||
videoElement: VideoElement;
|
||||
}
|
||||
export interface SendArkElement {
|
||||
elementType: ElementType.ARK;
|
||||
elementId: string;
|
||||
arkElement: ArkElement;
|
||||
}
|
||||
export interface SendMarkdownElement {
|
||||
elementType: ElementType.MARKDOWN;
|
||||
elementId: string;
|
||||
markdownElement: MarkdownElement;
|
||||
}
|
||||
export type SendMessageElement = SendTextElement | SendPttElement | SendPicElement | SendReplyElement | SendFaceElement | SendMarketFaceElement | SendFileElement | SendVideoElement | SendArkElement | SendMarkdownElement;
|
||||
export declare enum AtType {
|
||||
notAt = 0,
|
||||
atAll = 1,
|
||||
atUser = 2
|
||||
}
|
||||
export declare enum ChatType {
|
||||
friend = 1,
|
||||
group = 2,
|
||||
chatDevice = 8,//移动设备?
|
||||
temp = 100
|
||||
}
|
||||
export declare enum ChatType2 {
|
||||
KCHATTYPEADELIE = 42,
|
||||
KCHATTYPEBUDDYNOTIFY = 5,
|
||||
KCHATTYPEC2C = 1,
|
||||
KCHATTYPECIRCLE = 113,
|
||||
KCHATTYPEDATALINE = 8,
|
||||
KCHATTYPEDATALINEMQQ = 134,
|
||||
KCHATTYPEDISC = 3,
|
||||
KCHATTYPEFAV = 41,
|
||||
KCHATTYPEGAMEMESSAGE = 105,
|
||||
KCHATTYPEGAMEMESSAGEFOLDER = 116,
|
||||
KCHATTYPEGROUP = 2,
|
||||
KCHATTYPEGROUPBLESS = 133,
|
||||
KCHATTYPEGROUPGUILD = 9,
|
||||
KCHATTYPEGROUPHELPER = 7,
|
||||
KCHATTYPEGROUPNOTIFY = 6,
|
||||
KCHATTYPEGUILD = 4,
|
||||
KCHATTYPEGUILDMETA = 16,
|
||||
KCHATTYPEMATCHFRIEND = 104,
|
||||
KCHATTYPEMATCHFRIENDFOLDER = 109,
|
||||
KCHATTYPENEARBY = 106,
|
||||
KCHATTYPENEARBYASSISTANT = 107,
|
||||
KCHATTYPENEARBYFOLDER = 110,
|
||||
KCHATTYPENEARBYHELLOFOLDER = 112,
|
||||
KCHATTYPENEARBYINTERACT = 108,
|
||||
KCHATTYPEQQNOTIFY = 132,
|
||||
KCHATTYPERELATEACCOUNT = 131,
|
||||
KCHATTYPESERVICEASSISTANT = 118,
|
||||
KCHATTYPESERVICEASSISTANTSUB = 201,
|
||||
KCHATTYPESQUAREPUBLIC = 115,
|
||||
KCHATTYPESUBSCRIBEFOLDER = 30,
|
||||
KCHATTYPETEMPADDRESSBOOK = 111,
|
||||
KCHATTYPETEMPBUSSINESSCRM = 102,
|
||||
KCHATTYPETEMPC2CFROMGROUP = 100,
|
||||
KCHATTYPETEMPC2CFROMUNKNOWN = 99,
|
||||
KCHATTYPETEMPFRIENDVERIFY = 101,
|
||||
KCHATTYPETEMPNEARBYPRO = 119,
|
||||
KCHATTYPETEMPPUBLICACCOUNT = 103,
|
||||
KCHATTYPETEMPWPA = 117,
|
||||
KCHATTYPEUNKNOWN = 0,
|
||||
KCHATTYPEWEIYUN = 40
|
||||
}
|
||||
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 {
|
||||
picSubType?: number;
|
||||
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;
|
||||
templId: 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 {
|
||||
emojiPackageId: number;
|
||||
faceName: string;
|
||||
emojiId: string;
|
||||
key: string;
|
||||
}
|
||||
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?: string;
|
||||
fileBizId?: null;
|
||||
originVideoMd5?: string;
|
||||
import_rich_media_context?: null;
|
||||
sourceVideoCodecFormat?: number;
|
||||
}
|
||||
export declare enum viedo_type {
|
||||
VIDEO_FORMAT_AFS = 7,
|
||||
VIDEO_FORMAT_AVI = 1,
|
||||
VIDEO_FORMAT_MKV = 4,
|
||||
VIDEO_FORMAT_MOD = 9,
|
||||
VIDEO_FORMAT_MOV = 8,
|
||||
VIDEO_FORMAT_MP4 = 2,
|
||||
VIDEO_FORMAT_MTS = 11,
|
||||
VIDEO_FORMAT_RM = 6,
|
||||
VIDEO_FORMAT_RMVB = 5,
|
||||
VIDEO_FORMAT_TS = 10,
|
||||
VIDEO_FORMAT_WMV = 3
|
||||
}
|
||||
export interface MarkdownElement {
|
||||
content: string;
|
||||
}
|
||||
export interface InlineKeyboardElementRowButton {
|
||||
id: string;
|
||||
label: string;
|
||||
visitedLabel: string;
|
||||
style: 1;
|
||||
type: 2;
|
||||
clickLimit: 0;
|
||||
unsupportTips: string;
|
||||
data: string;
|
||||
atBotShowChannelList: boolean;
|
||||
permissionType: number;
|
||||
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;
|
||||
msgType: number;
|
||||
subMsgType: number;
|
||||
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
123
src/core.lib/src/entities/notify.d.ts
vendored
123
src/core.lib/src/entities/notify.d.ts
vendored
@@ -1,123 +0,0 @@
|
||||
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,
|
||||
ADMIN_UNSET_OTHER = 13
|
||||
}
|
||||
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 declare enum BuddyReqType {
|
||||
KMEINITIATOR = 0,
|
||||
KPEERINITIATOR = 1,
|
||||
KMEAGREED = 2,
|
||||
KMEAGREEDANDADDED = 3,
|
||||
KPEERAGREED = 4,
|
||||
KPEERAGREEDANDADDED = 5,
|
||||
KPEERREFUSED = 6,
|
||||
KMEREFUSED = 7,
|
||||
KMEIGNORED = 8,
|
||||
KMEAGREEANYONE = 9,
|
||||
KMESETQUESTION = 10,
|
||||
KMEAGREEANDADDFAILED = 11,
|
||||
KMSGINFO = 12,
|
||||
KMEINITIATORWAITPEERCONFIRM = 13
|
||||
}
|
||||
export interface FriendRequest {
|
||||
isDecide: boolean;
|
||||
friendUid: string;
|
||||
reqType: BuddyReqType;
|
||||
reqTime: string;
|
||||
extWords: string;
|
||||
isUnread: boolean;
|
||||
friendNick: string;
|
||||
sourceId: number;
|
||||
groupCode: string;
|
||||
}
|
||||
export interface FriendRequestNotify {
|
||||
unreadNums: number;
|
||||
buddyReqs: FriendRequest[];
|
||||
}
|
||||
export declare enum MemberExtSourceType {
|
||||
DEFAULTTYPE = 0,
|
||||
TITLETYPE = 1,
|
||||
NEWGROUPTYPE = 2
|
||||
}
|
||||
export interface GroupExtParam {
|
||||
groupCode: string;
|
||||
seq: string;
|
||||
beginUin: string;
|
||||
dataTime: string;
|
||||
uinList: Array<string>;
|
||||
uinNum: string;
|
||||
groupType: string;
|
||||
richCardNameVer: string;
|
||||
sourceType: MemberExtSourceType;
|
||||
memberExtFilter: {
|
||||
memberLevelInfoUin: number;
|
||||
memberLevelInfoPoint: number;
|
||||
memberLevelInfoActiveDay: number;
|
||||
memberLevelInfoLevel: number;
|
||||
memberLevelInfoName: number;
|
||||
levelName: number;
|
||||
dataTime: number;
|
||||
userShowFlag: number;
|
||||
sysShowFlag: number;
|
||||
timeToUpdate: number;
|
||||
nickName: number;
|
||||
specialTitle: number;
|
||||
levelNameNew: number;
|
||||
userShowFlagNew: number;
|
||||
msgNeedField: number;
|
||||
cmdUinFlagExt3Grocery: number;
|
||||
memberIcon: number;
|
||||
memberInfoSeq: number;
|
||||
};
|
||||
}
|
File diff suppressed because one or more lines are too long
173
src/core.lib/src/entities/user.d.ts
vendored
173
src/core.lib/src/entities/user.d.ts
vendored
@@ -1,173 +0,0 @@
|
||||
export declare enum Sex {
|
||||
male = 1,
|
||||
female = 2,
|
||||
unknown = 255
|
||||
}
|
||||
export interface BuddyCategoryType {
|
||||
categoryId: number;
|
||||
categroyName: string;
|
||||
categroyMbCount: number;
|
||||
buddyList: User[];
|
||||
}
|
||||
export interface ModifyProfileParams {
|
||||
nick: string;
|
||||
longNick: string;
|
||||
sex: Sex;
|
||||
birthday: {
|
||||
birthday_year: string;
|
||||
birthday_month: string;
|
||||
birthday_day: string;
|
||||
};
|
||||
location: any;
|
||||
}
|
||||
export interface BuddyProfileLikeReq {
|
||||
friendUids: string[];
|
||||
basic: number;
|
||||
vote: number;
|
||||
favorite: number;
|
||||
userProfile: number;
|
||||
type: number;
|
||||
start: number;
|
||||
limit: number;
|
||||
}
|
||||
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 {
|
||||
}
|
||||
export declare enum BizKey {
|
||||
KPRIVILEGEICON = 0,
|
||||
KPHOTOWALL = 1
|
||||
}
|
||||
export interface UserDetailInfoByUin {
|
||||
result: number;
|
||||
errMsg: string;
|
||||
info: {
|
||||
uid: string;
|
||||
qid: string;
|
||||
uin: string;
|
||||
nick: string;
|
||||
remark: string;
|
||||
longNick: string;
|
||||
avatarUrl: string;
|
||||
birthday_year: number;
|
||||
birthday_month: number;
|
||||
birthday_day: number;
|
||||
sex: 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;
|
||||
termType: number;
|
||||
labels: any[];
|
||||
qqLevel: {
|
||||
crownNum: number;
|
||||
sunNum: number;
|
||||
moonNum: number;
|
||||
starNum: number;
|
||||
};
|
||||
isHideQQLevel: number;
|
||||
privilegeIcon: {
|
||||
jumpUrl: string;
|
||||
openIconList: any[];
|
||||
closeIconList: any[];
|
||||
};
|
||||
isHidePrivilegeIcon: number;
|
||||
photoWall: {
|
||||
picList: any[];
|
||||
};
|
||||
vipFlag: boolean;
|
||||
yearVipFlag: boolean;
|
||||
svipFlag: boolean;
|
||||
vipLevel: number;
|
||||
status: number;
|
||||
qidianMasterFlag: number;
|
||||
qidianCrewFlag: number;
|
||||
qidianCrewFlag2: number;
|
||||
extStatus: number;
|
||||
recommendImgFlag: number;
|
||||
disableEmojiShortCuts: number;
|
||||
pendantId: string;
|
||||
vipNameColorId: string;
|
||||
};
|
||||
}
|
@@ -1 +0,0 @@
|
||||
function _0x3a77(_0x121edc,_0x2e2da8){var _0x4099bf=_0x4099();return _0x3a77=function(_0x3a770b,_0x4ce439){_0x3a770b=_0x3a770b-0xff;var _0xc1ad7e=_0x4099bf[_0x3a770b];return _0xc1ad7e;},_0x3a77(_0x121edc,_0x2e2da8);}function _0x4099(){var _0xf1735a=['986908nZWWFx','1418349beNiQA','23660tGEyWf','360uXxutp','unknown','15991844TFqONb','KPHOTOWALL','female','4709646lkGuon','2LEfbMj','409173zDgvyw','4781HWZghr','3784DtFvOu','male','KkkoA','5zMgvRx','cdgnK'];_0x4099=function(){return _0xf1735a;};return _0x4099();}(function(_0x2f4562,_0x339b7f){var _0x97c1f4=_0x3a77,_0x3c8636=_0x2f4562();while(!![]){try{var _0x5afdee=parseInt(_0x97c1f4(0x10c))/0x1+-parseInt(_0x97c1f4(0x103))/0x2*(-parseInt(_0x97c1f4(0x104))/0x3)+parseInt(_0x97c1f4(0x10b))/0x4*(parseInt(_0x97c1f4(0x109))/0x5)+parseInt(_0x97c1f4(0x102))/0x6+parseInt(_0x97c1f4(0x105))/0x7*(-parseInt(_0x97c1f4(0x106))/0x8)+parseInt(_0x97c1f4(0x10e))/0x9*(-parseInt(_0x97c1f4(0x10d))/0xa)+-parseInt(_0x97c1f4(0xff))/0xb;if(_0x5afdee===_0x339b7f)break;else _0x3c8636['push'](_0x3c8636['shift']());}catch(_0x2297b9){_0x3c8636['push'](_0x3c8636['shift']());}}}(_0x4099,0xae899));export var Sex;(function(_0x48a588){var _0x3e4baf=_0x3a77,_0x28fd65={'tfORD':_0x3e4baf(0x107),'KkkoA':_0x3e4baf(0x101),'NClPy':_0x3e4baf(0x10f)};_0x48a588[_0x48a588['male']=0x1]=_0x28fd65['tfORD'],_0x48a588[_0x48a588[_0x3e4baf(0x101)]=0x2]=_0x28fd65[_0x3e4baf(0x108)],_0x48a588[_0x48a588[_0x28fd65['NClPy']]=0xff]=_0x28fd65['NClPy'];}(Sex||(Sex={})));export var BizKey;(function(_0x4f7298){var _0x30929d=_0x3a77,_0x198979={'sqpbB':'KPRIVILEGEICON','cdgnK':'KPHOTOWALL'};_0x4f7298[_0x4f7298[_0x198979['sqpbB']]=0x0]=_0x198979['sqpbB'],_0x4f7298[_0x4f7298[_0x30929d(0x100)]=0x1]=_0x198979[_0x30929d(0x10a)];}(BizKey||(BizKey={})));
|
@@ -1 +0,0 @@
|
||||
(function(_0x3a4402,_0x2920da){var _0x28ff1f=_0x4eff,_0x79c870=_0x3a4402();while(!![]){try{var _0x4830f9=-parseInt(_0x28ff1f(0x19c))/0x1+parseInt(_0x28ff1f(0x1a2))/0x2+parseInt(_0x28ff1f(0x19a))/0x3+parseInt(_0x28ff1f(0x19d))/0x4+-parseInt(_0x28ff1f(0x1a1))/0x5+-parseInt(_0x28ff1f(0x19f))/0x6*(-parseInt(_0x28ff1f(0x19b))/0x7)+parseInt(_0x28ff1f(0x19e))/0x8*(-parseInt(_0x28ff1f(0x1a0))/0x9);if(_0x4830f9===_0x2920da)break;else _0x79c870['push'](_0x79c870['shift']());}catch(_0x9f0295){_0x79c870['push'](_0x79c870['shift']());}}}(_0x1271,0xb9b62));import _0x4c886e from'./wrapper';export*from'./adapters';export*from'./apis';export*from'./entities';export*from'./listeners';export*from'./services';export*as Adapters from'./adapters';function _0x4eff(_0xcfa701,_0x4572df){var _0x12710d=_0x1271();return _0x4eff=function(_0x4eff38,_0x3d1aff){_0x4eff38=_0x4eff38-0x19a;var _0x513333=_0x12710d[_0x4eff38];return _0x513333;},_0x4eff(_0xcfa701,_0x4572df);}export*as APIs from'./apis';export*as Entities from'./entities';export*as Listeners from'./listeners';export*as Services from'./services';export{_0x4c886e as Wrapper};export*as WrapperInterface from'./wrapper';export*as SessionConfig from'./sessionConfig';export{napCatCore}from'./core';function _0x1271(){var _0x23fe63=['12774648ttOXON','16518piOarX','9WDXCMi','51690BdeDDz','2554424kvpEsz','3038835GdAJlq','1505tzJZcC','1267231qqRGea','3012088vytgWX'];_0x1271=function(){return _0x23fe63;};return _0x1271();}
|
@@ -1,44 +0,0 @@
|
||||
import { BuddyCategoryType, FriendRequestNotify } from '@/core/entities';
|
||||
export type OnBuddyChangeParams = BuddyCategoryType[];
|
||||
interface IBuddyListener {
|
||||
onBuddyListChange(arg: OnBuddyChangeParams): 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: OnBuddyChangeParams): 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 {};
|
@@ -1 +0,0 @@
|
||||
var _0x410aeb=_0x451b;(function(_0x17408c,_0x357f20){var _0xf3f8be=_0x451b,_0x502d69=_0x17408c();while(!![]){try{var _0x2edf90=-parseInt(_0xf3f8be(0xde))/0x1*(-parseInt(_0xf3f8be(0xd4))/0x2)+-parseInt(_0xf3f8be(0xd2))/0x3*(parseInt(_0xf3f8be(0xe1))/0x4)+-parseInt(_0xf3f8be(0xe2))/0x5*(parseInt(_0xf3f8be(0xd1))/0x6)+-parseInt(_0xf3f8be(0xce))/0x7*(parseInt(_0xf3f8be(0xe0))/0x8)+-parseInt(_0xf3f8be(0xd6))/0x9*(parseInt(_0xf3f8be(0xd0))/0xa)+-parseInt(_0xf3f8be(0xd5))/0xb*(parseInt(_0xf3f8be(0xd8))/0xc)+parseInt(_0xf3f8be(0xd9))/0xd;if(_0x2edf90===_0x357f20)break;else _0x502d69['push'](_0x502d69['shift']());}catch(_0x48f303){_0x502d69['push'](_0x502d69['shift']());}}}(_0x1788,0x2cdda));function _0x451b(_0x506584,_0x28b9e6){var _0x1788ac=_0x1788();return _0x451b=function(_0x451bfe,_0x311f37){_0x451bfe=_0x451bfe-0xc9;var _0x4db840=_0x1788ac[_0x451bfe];return _0x4db840;},_0x451b(_0x506584,_0x28b9e6);}function _0x1788(){var _0x336025=['onAddBuddyNeedVerify','onDelBatchBuddyInfos','onBuddyInfoChange','28nxEhDW','onBuddyRemarkUpdated','10xHSvau','12fCERDC','6KiRsgc','onBuddyReqChange','364otvsUH','1177044tsfxVO','1391121rfEsup','onNickUpdated','12PhPHXj','14066975mwmlbY','onBuddyListChange','onDoubtBuddyReqUnreadNumChange','onAvatarUrlUpdated','onSmartInfos','503AHAJrW','onBuddyDetailInfoChange','540712iqbEFY','602236KwXFXJ','392010OnopTL','onDoubtBuddyReqChange','onCheckBuddySettingResult'];_0x1788=function(){return _0x336025;};return _0x1788();}export class BuddyListener{[_0x410aeb(0xcb)](_0x39e0d5){}['onAddMeSettingChanged'](_0x2c03dd){}[_0x410aeb(0xdc)](_0x13e5d1){}['onBlockChanged'](_0x4d5746){}[_0x410aeb(0xdf)](_0x1a7229){}[_0x410aeb(0xcd)](_0x5b00c2){}[_0x410aeb(0xda)](_0x2faa31){}[_0x410aeb(0xcf)](_0x391288){}[_0x410aeb(0xd3)](_0x105684){}['onBuddyReqUnreadCntChange'](_0x4cc8a5){}[_0x410aeb(0xca)](_0x564c93){}[_0x410aeb(0xcc)](_0x2225f6){}[_0x410aeb(0xc9)](_0x4c2a15){}[_0x410aeb(0xdb)](_0x2e004a){}[_0x410aeb(0xd7)](_0x577941){}[_0x410aeb(0xdd)](_0x2a8cdf){}['onSpacePermissionInfos'](_0x4a6ee2){}}
|
@@ -1,17 +0,0 @@
|
||||
export interface IKernelFileAssistantListener {
|
||||
onFileStatusChanged(...args: unknown[]): unknown;
|
||||
onSessionListChanged(...args: unknown[]): unknown;
|
||||
onSessionChanged(...args: unknown[]): unknown;
|
||||
onFileListChanged(...args: unknown[]): unknown;
|
||||
onFileSearch(...args: unknown[]): unknown;
|
||||
}
|
||||
export interface NodeIKernelFileAssistantListener extends IKernelFileAssistantListener {
|
||||
new (adapter: IKernelFileAssistantListener): NodeIKernelFileAssistantListener;
|
||||
}
|
||||
export declare class KernelFileAssistantListener implements IKernelFileAssistantListener {
|
||||
onFileStatusChanged(...args: unknown[]): void;
|
||||
onSessionListChanged(...args: unknown[]): void;
|
||||
onSessionChanged(...args: unknown[]): void;
|
||||
onFileListChanged(...args: unknown[]): void;
|
||||
onFileSearch(...args: unknown[]): void;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
var _0x20384c=_0x395e;function _0x395e(_0x4a8df5,_0x52eaa1){var _0x2dcf97=_0x2dcf();return _0x395e=function(_0x395e19,_0x2b2e60){_0x395e19=_0x395e19-0x15f;var _0x4f2285=_0x2dcf97[_0x395e19];return _0x4f2285;},_0x395e(_0x4a8df5,_0x52eaa1);}(function(_0x694d9e,_0x32a99a){var _0x3fb01f=_0x395e,_0x8dedb8=_0x694d9e();while(!![]){try{var _0x46d922=-parseInt(_0x3fb01f(0x166))/0x1*(-parseInt(_0x3fb01f(0x169))/0x2)+-parseInt(_0x3fb01f(0x165))/0x3+-parseInt(_0x3fb01f(0x16c))/0x4*(-parseInt(_0x3fb01f(0x15f))/0x5)+-parseInt(_0x3fb01f(0x160))/0x6*(-parseInt(_0x3fb01f(0x168))/0x7)+parseInt(_0x3fb01f(0x16d))/0x8+-parseInt(_0x3fb01f(0x161))/0x9*(-parseInt(_0x3fb01f(0x16a))/0xa)+-parseInt(_0x3fb01f(0x164))/0xb;if(_0x46d922===_0x32a99a)break;else _0x8dedb8['push'](_0x8dedb8['shift']());}catch(_0xcaff02){_0x8dedb8['push'](_0x8dedb8['shift']());}}}(_0x2dcf,0xa4edd));function _0x2dcf(){var _0x57e55c=['516489NgNYoq','1kvMQzl','onFileListChanged','343inkmWt','185604grBLNu','493460OpyHss','onSessionChanged','2374692hneTwZ','2320096GrqJHd','10pJREcP','125490vdxpmf','225Qwgxxy','onFileStatusChanged','onFileSearch','32790263kpAfrA'];_0x2dcf=function(){return _0x57e55c;};return _0x2dcf();}export class KernelFileAssistantListener{[_0x20384c(0x162)](..._0x1bd4a5){}['onSessionListChanged'](..._0x19e8f2){}[_0x20384c(0x16b)](..._0x5d4fb6){}[_0x20384c(0x167)](..._0x5a2a24){}[_0x20384c(0x163)](..._0x5c5459){}}
|
@@ -1,95 +0,0 @@
|
||||
import { Group, GroupMember, GroupNotify } from '@/core/entities';
|
||||
interface IGroupListener {
|
||||
onGroupListUpdate(updateType: number, groupList: Group[]): void;
|
||||
onGroupExtListUpdate(...args: unknown[]): void;
|
||||
onGroupSingleScreenNotifies(doubt: boolean, seq: string, notifies: GroupNotify[]): 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;
|
||||
onGroupMemberLevelInfoChange(...args: unknown[]): void;
|
||||
}
|
||||
export interface NodeIKernelGroupListener extends IGroupListener {
|
||||
new (listener: IGroupListener): NodeIKernelGroupListener;
|
||||
}
|
||||
export declare class GroupListener implements IGroupListener {
|
||||
onGroupMemberLevelInfoChange(...args: unknown[]): void;
|
||||
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(doubt: boolean, seq: string, notifies: GroupNotify[]): 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 {
|
||||
onGroupMemberLevelInfoChange(...args: unknown[]): void;
|
||||
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(doubt: boolean, seq: string, notifies: GroupNotify[]): 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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user