feat: 协议更新
This commit is contained in:
@@ -42,16 +42,16 @@ public class BotAppInfo
|
|||||||
Os = "Linux",
|
Os = "Linux",
|
||||||
Kernel = "Linux",
|
Kernel = "Linux",
|
||||||
VendorOs = "linux",
|
VendorOs = "linux",
|
||||||
CurrentVersion = "3.2.15-30366",
|
CurrentVersion = "3.2.19-39038",
|
||||||
MiscBitmap = 32764,
|
MiscBitmap = 32764,
|
||||||
PtVersion = "2.0.0",
|
PtVersion = "2.0.0",
|
||||||
SsoVersion = 19,
|
SsoVersion = 19,
|
||||||
PackageName = "com.tencent.qq",
|
PackageName = "com.tencent.qq",
|
||||||
WtLoginSdk = "nt.wtlogin.0.0.1",
|
WtLoginSdk = "nt.wtlogin.0.0.1",
|
||||||
AppId = 1600001615,
|
AppId = 1600001615,
|
||||||
SubAppId = 537258424,
|
SubAppId = 537313942,
|
||||||
AppIdQrCode = 13697054,
|
AppIdQrCode = 537313942,
|
||||||
AppClientVersion = 30366,
|
AppClientVersion = 39038,
|
||||||
|
|
||||||
MainSigMap = 169742560,
|
MainSigMap = 169742560,
|
||||||
SubSigMap = 0,
|
SubSigMap = 0,
|
||||||
|
|||||||
@@ -71,13 +71,16 @@ internal class MessagingLogic : LogicBase
|
|||||||
var chain = push.Chain;
|
var chain = push.Chain;
|
||||||
|
|
||||||
// Intercept group invitation
|
// Intercept group invitation
|
||||||
if (chain.Count == 1 && chain[0] is LightAppEntity { AppName: "com.tencent.qun.invite" } app)
|
if (chain.Count == 1 && chain[0] is LightAppEntity
|
||||||
|
{
|
||||||
|
AppName: "com.tencent.qun.invite" or "com.tencent.tuwen.lua"
|
||||||
|
} app)
|
||||||
{
|
{
|
||||||
using var document = JsonDocument.Parse(app.Payload);
|
using var document = JsonDocument.Parse(app.Payload);
|
||||||
var root = document.RootElement;
|
var root = document.RootElement;
|
||||||
|
|
||||||
string url = root.GetProperty("meta").GetProperty("news").GetProperty("jumpUrl").GetString()
|
string url = root.GetProperty("meta").GetProperty("news").GetProperty("jumpUrl").GetString()
|
||||||
?? throw new Exception("sb tx! Is this 'com.tencent.qun.invite'?");
|
?? throw new Exception("sb tx! Is this 'com.tencent.qun.invite' or 'com.tencent.tuwen.lua'?");
|
||||||
var query = HttpUtility.ParseQueryString(new Uri(url).Query);
|
var query = HttpUtility.ParseQueryString(new Uri(url).Query);
|
||||||
uint groupUin = uint.Parse(query["groupcode"]
|
uint groupUin = uint.Parse(query["groupcode"]
|
||||||
?? throw new Exception("sb tx! Is this '/group/invite_join'?"));
|
?? throw new Exception("sb tx! Is this '/group/invite_join'?"));
|
||||||
|
|||||||
@@ -85,29 +85,40 @@ public class ForwardEntity : IMessageEntity
|
|||||||
{
|
{
|
||||||
if (elem.SrcMsg is not { } src) return null;
|
if (elem.SrcMsg is not { } src) return null;
|
||||||
|
|
||||||
var reserve = Serializer.Deserialize<SrcMsg.Preserve>(src.PbReserve.AsSpan());
|
if (src.SourceMsg != null)
|
||||||
return new ForwardEntity(MessagePacker.Parse(new PushMsgBody
|
|
||||||
{
|
{
|
||||||
ResponseHead = new ResponseHead
|
var chain = MessagePacker.Parse(Serializer.Deserialize<PushMsgBody>(src.SourceMsg.AsSpan()), true);
|
||||||
|
return new ForwardEntity(chain);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (src.PbReserve != null)
|
||||||
|
{
|
||||||
|
var reserve = Serializer.Deserialize<SrcMsg.Preserve>(src.PbReserve.AsSpan());
|
||||||
|
return new ForwardEntity(MessagePacker.Parse(new PushMsgBody
|
||||||
{
|
{
|
||||||
FromUin = (uint)src.SenderUin,
|
ResponseHead = new ResponseHead
|
||||||
FromUid = reserve.SenderUid,
|
|
||||||
Grp = reserve.ReceiverUid != null ? null : new ResponseGrp { }
|
|
||||||
},
|
|
||||||
ContentHead = new ContentHead
|
|
||||||
{
|
|
||||||
Random = (long?)(reserve.MessageId & 0xFFFFFFFF),
|
|
||||||
Sequence = src.OrigSeqs?.Count > 0 ? src.OrigSeqs[0] : 0,
|
|
||||||
Timestamp = src.Time,
|
|
||||||
},
|
|
||||||
Body = new MessageBody
|
|
||||||
{
|
|
||||||
RichText = new RichText
|
|
||||||
{
|
{
|
||||||
Elems = src.Elems ?? new List<Elem>(),
|
FromUin = (uint)src.SenderUin,
|
||||||
|
FromUid = reserve.SenderUid,
|
||||||
|
Grp = reserve.ReceiverUid != null ? null : new ResponseGrp { }
|
||||||
|
},
|
||||||
|
ContentHead = new ContentHead
|
||||||
|
{
|
||||||
|
Random = (long?)(reserve.MessageId & 0xFFFFFFFF),
|
||||||
|
Sequence = (src.OrigSeqs != null && src.OrigSeqs.Count > 0) ? src.OrigSeqs[0] : 0,
|
||||||
|
Timestamp = src.Time,
|
||||||
|
},
|
||||||
|
Body = new MessageBody
|
||||||
|
{
|
||||||
|
RichText = new RichText
|
||||||
|
{
|
||||||
|
Elems = src.Elems ?? new List<Elem>(),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}, true));
|
||||||
}, true));
|
}
|
||||||
|
|
||||||
|
return new ForwardEntity(new MessageChain(0, 0, (src.OrigSeqs != null && src.OrigSeqs.Count > 0 ? src.OrigSeqs[0] : 0), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
void IMessageEntity.SetSelfUid(string selfUid) => _selfUid = selfUid;
|
void IMessageEntity.SetSelfUid(string selfUid) => _selfUid = selfUid;
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ namespace Lagrange.Core.Utility.Sign;
|
|||||||
|
|
||||||
internal class LinuxSigner : UrlSigner
|
internal class LinuxSigner : UrlSigner
|
||||||
{
|
{
|
||||||
public LinuxSigner() : base("https://sign.lagrangecore.org/api/sign/30366") { }
|
public LinuxSigner() : base("https://sign.lagrangecore.org/api/sign/39038") { }
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user