fix
This commit is contained in:
1 parent
d48aeffc0d
commit
9334caf50d
3 files changed
+33
-11
No files matched your search
@@ -35,6 +35,7 @@ export class NTQQFileApi {
|
||||
this.context = context;
|
||||
this.core = core;
|
||||
this.rkeyManager = new RkeyManager(['https://llob.linyuchen.net/rkey', 'http://napcat-sign.wumiao.wang:2082/rkey'], this.context.logger);
|
||||
|
||||
}
|
||||
|
||||
async copyFile(filePath: string, destPath: string) {
|
||||
@@ -375,14 +376,9 @@ export class NTQQFileApi {
|
||||
group_rkey: 'CAQSKAB6JWENi5LM_xp9vumLbuThJSaYf-yzMrbZsuq7Uz2qffcqm614gds',
|
||||
online_rkey: false
|
||||
};
|
||||
if (this.core.apis.PacketApi.PacketClient?.isConnected) {
|
||||
let rkeylist = await this.core.apis.PacketApi.sendRkeyPacket();
|
||||
if (rkeylist.length > 0) {
|
||||
rkeyData.group_rkey = rkeylist[0].rkey;
|
||||
rkeyData.private_rkey = rkeylist[1].rkey;
|
||||
rkeyData.online_rkey = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!rkeyData.online_rkey) {
|
||||
try {
|
||||
let tempRkeyData = await this.rkeyManager.getRkey();
|
||||
|
||||
+13
-2
@@ -46,8 +46,19 @@ export class NTQQPacketApi {
|
||||
await this.PacketClient.connect();
|
||||
await this.PacketClient.init(process.pid, table.recv, table.send);
|
||||
this.isInit = true;
|
||||
this.InitOtherServer()
|
||||
return this.isInit;
|
||||
}
|
||||
async InitOtherServer() {
|
||||
this.core.apis.FileApi.rkeyManager.regOutputRkey(
|
||||
async () => {
|
||||
let rkeylist = await this.core.apis.PacketApi.sendRkeyPacket();
|
||||
if (rkeylist.length > 0) {
|
||||
return rkeylist;
|
||||
}
|
||||
return undefined;
|
||||
});
|
||||
}
|
||||
randText(len: number) {
|
||||
let text = '';
|
||||
let possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
|
||||
@@ -74,8 +85,8 @@ export class NTQQPacketApi {
|
||||
async sendRkeyPacket() {
|
||||
let u8 = await this.core.apis.PacketApi.buildRkeyPacket()
|
||||
let ret = await this.core.apis.PacketApi.sendPacket('OidbSvcTrpcTcp.0x9067_202', Buffer.from(u8).toString('hex'), true);
|
||||
if(!ret?.hex_data) return []
|
||||
let body = new NapProtoMsg(OidbSvcTrpcTcpBaseRsp).decode(Buffer.from(ret.hex_data,'hex')).body;
|
||||
if (!ret?.hex_data) return []
|
||||
let body = new NapProtoMsg(OidbSvcTrpcTcpBaseRsp).decode(Buffer.from(ret.hex_data, 'hex')).body;
|
||||
//console.log('ret: ', Buffer.from(body).toString('hex'));
|
||||
let retdata = new NapProtoMsg(OidbSvcTrpcTcp0X9067_202_Rsp_Body).decode(body)
|
||||
//console.log('ret: ', JSON.stringify(retdata.data.rkeyList));
|
||||
|
||||
Reference in new issue
Block a user