mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2024-11-21 09:36:35 +00:00
feat: add packGroupFileDownloadReq
& packC2CFileDownloadReq
This commit is contained in:
parent
93aab437b7
commit
5c21a1727c
@ -7,7 +7,7 @@ import { PacketHexStr, PacketPacker } from "@/core/packet/packer";
|
||||
import { NapProtoMsg } from '@/core/packet/proto/NapProto';
|
||||
import { OidbSvcTrpcTcp0X9067_202_Rsp_Body } from '@/core/packet/proto/oidb/Oidb.0x9067_202';
|
||||
import { OidbSvcTrpcTcpBase, OidbSvcTrpcTcpBaseRsp } from '@/core/packet/proto/oidb/OidbBase';
|
||||
import { OidbSvcTrpcTcp0XFE1_2RSP } from '@/core/packet/proto/oidb/Oidb.fe1_2';
|
||||
import { OidbSvcTrpcTcp0XFE1_2RSP } from '@/core/packet/proto/oidb/Oidb.0XFE1_2';
|
||||
import {LogWrapper} from "@/common/log";
|
||||
import {SendLongMsgResp} from "@/core/packet/proto/message/action";
|
||||
import {PacketMsg} from "@/core/packet/msg/message";
|
||||
|
@ -5,8 +5,8 @@ import {NapProtoMsg} from "@/core/packet/proto/NapProto";
|
||||
import {OidbSvcTrpcTcpBase} from "@/core/packet/proto/oidb/OidbBase";
|
||||
import {OidbSvcTrpcTcp0X9067_202} from "@/core/packet/proto/oidb/Oidb.0x9067_202";
|
||||
import {OidbSvcTrpcTcp0X8FC_2, OidbSvcTrpcTcp0X8FC_2_Body} from "@/core/packet/proto/oidb/Oidb.0x8FC_2";
|
||||
import {OidbSvcTrpcTcp0XFE1_2} from "@/core/packet/proto/oidb/Oidb.fe1_2";
|
||||
import {OidbSvcTrpcTcp0XED3_1} from "@/core/packet/proto/oidb/Oidb.ed3_1";
|
||||
import {OidbSvcTrpcTcp0XFE1_2} from "@/core/packet/proto/oidb/Oidb.0XFE1_2";
|
||||
import {OidbSvcTrpcTcp0XED3_1} from "@/core/packet/proto/oidb/Oidb.0xED3_1";
|
||||
import {NTV2RichMediaReq} from "@/core/packet/proto/oidb/common/Ntv2.RichMediaReq";
|
||||
import {HttpConn0x6ff_501} from "@/core/packet/proto/action/action";
|
||||
import {LongMsgResult, SendLongMsgReq} from "@/core/packet/proto/message/action";
|
||||
@ -14,6 +14,8 @@ import {PacketMsgBuilder} from "@/core/packet/msg/builder";
|
||||
import {PacketMsgPicElement} from "@/core/packet/msg/element";
|
||||
import {LogWrapper} from "@/common/log";
|
||||
import {PacketMsg} from "@/core/packet/msg/message";
|
||||
import {OidbSvcTrpcTcp0x6D6} from "@/core/packet/proto/oidb/Oidb.0x6D6";
|
||||
import {OidbSvcTrpcTcp0XE37_1200} from "@/core/packet/proto/oidb/Oidb.0xE37_1200";
|
||||
|
||||
export type PacketHexStr = string & { readonly hexNya: unique symbol };
|
||||
|
||||
@ -130,7 +132,7 @@ export class PacketPacker {
|
||||
}
|
||||
|
||||
// highway part
|
||||
packHttp0x6ff_501() {
|
||||
packHttp0x6ff_501(): PacketHexStr {
|
||||
return this.toHexStr(new NapProtoMsg(HttpConn0x6ff_501).encode({
|
||||
httpConn: {
|
||||
field1: 0,
|
||||
@ -148,7 +150,7 @@ export class PacketPacker {
|
||||
}));
|
||||
}
|
||||
|
||||
async packUploadGroupImgReq(groupUin: number, img: PacketMsgPicElement) {
|
||||
async packUploadGroupImgReq(groupUin: number, img: PacketMsgPicElement): Promise<PacketHexStr> {
|
||||
const req = new NapProtoMsg(NTV2RichMediaReq).encode(
|
||||
{
|
||||
reqHead: {
|
||||
@ -216,7 +218,7 @@ export class PacketPacker {
|
||||
return this.toHexStr(this.packOidbPacket(0x11c4, 100, req, true, false));
|
||||
}
|
||||
|
||||
async packUploadC2CImgReq(peerUin: string, img: PacketMsgPicElement) {
|
||||
async packUploadC2CImgReq(peerUin: string, img: PacketMsgPicElement): Promise<PacketHexStr> {
|
||||
const req = new NapProtoMsg(NTV2RichMediaReq).encode({
|
||||
reqHead: {
|
||||
common: {
|
||||
@ -283,4 +285,37 @@ export class PacketPacker {
|
||||
)
|
||||
return this.toHexStr(this.packOidbPacket(0x11c5, 100, req, true, false));
|
||||
}
|
||||
|
||||
packGroupFileDownloadReq(groupUin: number, fileUUID: string): PacketHexStr {
|
||||
return this.toHexStr(
|
||||
new NapProtoMsg(OidbSvcTrpcTcp0x6D6).encode({
|
||||
download: {
|
||||
groupUin: groupUin,
|
||||
appId: 7,
|
||||
busId: 102,
|
||||
fileId: fileUUID
|
||||
}
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
packC2CFileDownloadReq(selfUid: string, fileUUID: string, fileHash: string): PacketHexStr {
|
||||
return this.toHexStr(
|
||||
new NapProtoMsg(OidbSvcTrpcTcp0XE37_1200).encode({
|
||||
subCommand: 1200,
|
||||
field2: 1,
|
||||
body: {
|
||||
receiverUid: selfUid,
|
||||
fileUuid: fileUUID,
|
||||
type: 2,
|
||||
fileHash: fileHash,
|
||||
t2: 0
|
||||
},
|
||||
field101: 3,
|
||||
field102: 103,
|
||||
field200: 1,
|
||||
field99999: Buffer.from([0xc0, 0x85, 0x2c, 0x01])
|
||||
})
|
||||
)
|
||||
}
|
||||
}
|
||||
|
100
src/core/packet/proto/oidb/Oidb.0x6D6.ts
Normal file
100
src/core/packet/proto/oidb/Oidb.0x6D6.ts
Normal file
@ -0,0 +1,100 @@
|
||||
import { ScalarType } from "@protobuf-ts/runtime";
|
||||
import { ProtoField } from "../NapProto";
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6 = {
|
||||
file: ProtoField(1, () => OidbSvcTrpcTcp0x6D6Upload, true),
|
||||
download: ProtoField(3, () => OidbSvcTrpcTcp0x6D6Download, true),
|
||||
delete: ProtoField(4, () => OidbSvcTrpcTcp0x6D6Delete, true),
|
||||
rename: ProtoField(5, () => OidbSvcTrpcTcp0x6D6Rename, true),
|
||||
move: ProtoField(6, () => OidbSvcTrpcTcp0x6D6Move, true),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6Upload = {
|
||||
groupUin: ProtoField(1, ScalarType.UINT32),
|
||||
appId: ProtoField(2, ScalarType.UINT32),
|
||||
busId: ProtoField(3, ScalarType.UINT32),
|
||||
entrance: ProtoField(4, ScalarType.UINT32),
|
||||
targetDirectory: ProtoField(5, ScalarType.STRING),
|
||||
fileName: ProtoField(6, ScalarType.STRING),
|
||||
localDirectory: ProtoField(7, ScalarType.STRING),
|
||||
fileSize: ProtoField(8, ScalarType.UINT64),
|
||||
fileSha1: ProtoField(9, ScalarType.BYTES),
|
||||
fileSha3: ProtoField(10, ScalarType.BYTES),
|
||||
fileMd5: ProtoField(11, ScalarType.BYTES),
|
||||
field15: ProtoField(15, ScalarType.BOOL),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6Download = {
|
||||
groupUin: ProtoField(1, ScalarType.UINT32),
|
||||
appId: ProtoField(2, ScalarType.UINT32),
|
||||
busId: ProtoField(3, ScalarType.UINT32),
|
||||
fileId: ProtoField(4, ScalarType.STRING),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6Delete = {
|
||||
groupUin: ProtoField(1, ScalarType.UINT32),
|
||||
busId: ProtoField(3, ScalarType.UINT32),
|
||||
fileId: ProtoField(5, ScalarType.STRING),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6Rename = {
|
||||
groupUin: ProtoField(1, ScalarType.UINT32),
|
||||
busId: ProtoField(3, ScalarType.UINT32),
|
||||
fileId: ProtoField(4, ScalarType.STRING),
|
||||
parentFolder: ProtoField(5, ScalarType.STRING),
|
||||
newFileName: ProtoField(6, ScalarType.STRING),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6Move = {
|
||||
groupUin: ProtoField(1, ScalarType.UINT32),
|
||||
appId: ProtoField(2, ScalarType.UINT32),
|
||||
busId: ProtoField(3, ScalarType.UINT32),
|
||||
fileId: ProtoField(4, ScalarType.STRING),
|
||||
parentDirectory: ProtoField(5, ScalarType.STRING),
|
||||
targetDirectory: ProtoField(6, ScalarType.STRING),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6Response = {
|
||||
upload: ProtoField(1, () => OidbSvcTrpcTcp0x6D6_0Response),
|
||||
download: ProtoField(3, () => OidbSvcTrpcTcp0x6D6_2Response),
|
||||
delete: ProtoField(4, () => OidbSvcTrpcTcp0x6D6_3_4_5Response),
|
||||
rename: ProtoField(5, () => OidbSvcTrpcTcp0x6D6_3_4_5Response),
|
||||
move: ProtoField(6, () => OidbSvcTrpcTcp0x6D6_3_4_5Response),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6_0Response = {
|
||||
retCode: ProtoField(1, ScalarType.INT32),
|
||||
retMsg: ProtoField(2, ScalarType.STRING),
|
||||
clientWording: ProtoField(3, ScalarType.STRING),
|
||||
uploadIp: ProtoField(4, ScalarType.STRING),
|
||||
serverDns: ProtoField(5, ScalarType.STRING),
|
||||
busId: ProtoField(6, ScalarType.INT32),
|
||||
fileId: ProtoField(7, ScalarType.STRING),
|
||||
checkKey: ProtoField(8, ScalarType.BYTES),
|
||||
fileKey: ProtoField(9, ScalarType.BYTES),
|
||||
boolFileExist: ProtoField(10, ScalarType.BOOL),
|
||||
uploadIpLanV4: ProtoField(12, ScalarType.STRING, false, true),
|
||||
uploadIpLanV6: ProtoField(13, ScalarType.STRING, false, true),
|
||||
uploadPort: ProtoField(14, ScalarType.UINT32),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6_2Response = {
|
||||
retCode: ProtoField(1, ScalarType.INT32),
|
||||
retMsg: ProtoField(2, ScalarType.STRING),
|
||||
clientWording: ProtoField(3, ScalarType.STRING),
|
||||
downloadIp: ProtoField(4, ScalarType.STRING),
|
||||
downloadDns: ProtoField(5, ScalarType.STRING),
|
||||
downloadUrl: ProtoField(6, ScalarType.BYTES),
|
||||
fileSha1: ProtoField(7, ScalarType.BYTES),
|
||||
fileSha3: ProtoField(8, ScalarType.BYTES),
|
||||
fileMd5: ProtoField(9, ScalarType.BYTES),
|
||||
cookieVal: ProtoField(10, ScalarType.BYTES),
|
||||
saveFileName: ProtoField(11, ScalarType.STRING),
|
||||
previewPort: ProtoField(12, ScalarType.UINT32),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0x6D6_3_4_5Response = {
|
||||
retCode: ProtoField(1, ScalarType.INT32),
|
||||
retMsg: ProtoField(2, ScalarType.STRING),
|
||||
clientWording: ProtoField(3, ScalarType.STRING),
|
||||
};
|
61
src/core/packet/proto/oidb/Oidb.0xE37_1200.ts
Normal file
61
src/core/packet/proto/oidb/Oidb.0xE37_1200.ts
Normal file
@ -0,0 +1,61 @@
|
||||
import { ScalarType } from "@protobuf-ts/runtime";
|
||||
import { ProtoField } from "../NapProto";
|
||||
|
||||
export const OidbSvcTrpcTcp0XE37_1200 = {
|
||||
subCommand: ProtoField(1, ScalarType.UINT32, true),
|
||||
field2: ProtoField(2, ScalarType.INT32, true),
|
||||
body: ProtoField(14, () => OidbSvcTrpcTcp0XE37_1200Body, true),
|
||||
field101: ProtoField(101, ScalarType.INT32, true),
|
||||
field102: ProtoField(102, ScalarType.INT32, true),
|
||||
field200: ProtoField(200, ScalarType.INT32, true),
|
||||
field99999: ProtoField(99999, ScalarType.BYTES, true),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0XE37_1200Body = {
|
||||
receiverUid: ProtoField(10, ScalarType.STRING, true),
|
||||
fileUuid: ProtoField(20, ScalarType.STRING, true),
|
||||
type: ProtoField(30, ScalarType.INT32, true),
|
||||
fileHash: ProtoField(60, ScalarType.STRING, true),
|
||||
t2: ProtoField(601, ScalarType.INT32, true),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0XE37_1200Response = {
|
||||
command: ProtoField(1, ScalarType.UINT32, true),
|
||||
subCommand: ProtoField(2, ScalarType.UINT32, true),
|
||||
body: ProtoField(14, () => OidbSvcTrpcTcp0XE37_1200ResponseBody, true),
|
||||
field50: ProtoField(50, ScalarType.UINT32, true),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0XE37_1200ResponseBody = {
|
||||
field10: ProtoField(10, ScalarType.UINT32, true),
|
||||
state: ProtoField(20, ScalarType.STRING, true),
|
||||
result: ProtoField(30, () => OidbSvcTrpcTcp0XE37_1200Result, true),
|
||||
metadata: ProtoField(40, () => OidbSvcTrpcTcp0XE37_1200Metadata, true),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0XE37_1200Result = {
|
||||
server: ProtoField(20, ScalarType.STRING, true),
|
||||
port: ProtoField(40, ScalarType.UINT32, true),
|
||||
url: ProtoField(50, ScalarType.STRING, true),
|
||||
additionalServer: ProtoField(60, ScalarType.STRING, false, true),
|
||||
ssoPort: ProtoField(80, ScalarType.UINT32, true),
|
||||
ssoUrl: ProtoField(90, ScalarType.STRING, true),
|
||||
extra: ProtoField(120, ScalarType.BYTES, true),
|
||||
};
|
||||
|
||||
export const OidbSvcTrpcTcp0XE37_1200Metadata = {
|
||||
uin: ProtoField(1, ScalarType.UINT32, true),
|
||||
field2: ProtoField(2, ScalarType.UINT32, true),
|
||||
field3: ProtoField(3, ScalarType.UINT32, true),
|
||||
size: ProtoField(4, ScalarType.UINT32, true),
|
||||
timestamp: ProtoField(5, ScalarType.UINT32, true),
|
||||
fileUuid: ProtoField(6, ScalarType.STRING, true),
|
||||
fileName: ProtoField(7, ScalarType.STRING, true),
|
||||
field100: ProtoField(100, ScalarType.BYTES, true),
|
||||
field101: ProtoField(101, ScalarType.BYTES, true),
|
||||
field110: ProtoField(110, ScalarType.UINT32, true),
|
||||
timestamp1: ProtoField(130, ScalarType.UINT32, true),
|
||||
fileHash: ProtoField(140, ScalarType.STRING, true),
|
||||
field141: ProtoField(141, ScalarType.BYTES, true),
|
||||
field142: ProtoField(142, ScalarType.BYTES, true),
|
||||
};
|
Loading…
x
Reference in New Issue
Block a user