From 1ecb1a722735377abd913a120aefece1ea0f00ca Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:26:47 +0800 Subject: [PATCH 1/6] uint32 --- client/operation.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/operation.go b/client/operation.go index 24afe11..b99eaf6 100644 --- a/client/operation.go +++ b/client/operation.go @@ -1319,7 +1319,7 @@ func (c *QQClient) GetUnidirectionalFriendList() (ret []*entity.Friend, err erro // DeleteUnidirectionalFriend 删除单向好友 // ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/web.go#L62 -func (c *QQClient) DeleteUnidirectionalFriend(uin int64) error { +func (c *QQClient) DeleteUnidirectionalFriend(uin uint32) error { webRsp := &struct { ErrorCode int32 `json:"ErrorCode"` }{} From e95f6aa06e4b961c58a9330a555f4abffd1b71c5 Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:31:20 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat:=20=E9=80=9A=E8=BF=87TX=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E6=A3=80=E6=9F=A5URL=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/operation.go | 13 ++++ client/packets/oidb/security_url.go | 67 +++++++++++++++++++ .../service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go | 58 ++++++++++++++++ .../service/oidb/OidbSvcTrpcTcp0xBCB_0.proto | 65 ++++++++++++++++++ 4 files changed, 203 insertions(+) create mode 100644 client/packets/oidb/security_url.go create mode 100644 client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go create mode 100644 client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto diff --git a/client/operation.go b/client/operation.go index b99eaf6..e376a72 100644 --- a/client/operation.go +++ b/client/operation.go @@ -1335,3 +1335,16 @@ func (c *QQClient) DeleteUnidirectionalFriend(uin uint32) error { } return nil } + +// CheckUrlSafely 通过TX服务器检查URL安全性 +func (c *QQClient) CheckUrlSafely(url string) (oidb2.UrlSecurityLevel, error) { + pkt, err := oidb2.BuildUrlCheckRequest(c.Uin, url) + if err != nil { + return oidb2.UrlSecurityLevelUnknown, err + } + resp, err := c.sendOidbPacketAndWait(pkt) + if err != nil { + return oidb2.UrlSecurityLevelUnknown, err + } + return oidb2.ParseUrlCheckResponse(resp) +} diff --git a/client/packets/oidb/security_url.go b/client/packets/oidb/security_url.go new file mode 100644 index 0000000..1257c5f --- /dev/null +++ b/client/packets/oidb/security_url.go @@ -0,0 +1,67 @@ +package oidb + +import ( + "errors" + + "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb" + + "github.com/RomiChan/protobuf/proto" +) + +// see https://github.com/Mrs4s/MiraiGo/blob/master/client/security.go + +type UrlSecurityLevel int + +const ( + UrlSecurityLevelSafe UrlSecurityLevel = iota + 1 + UrlSecurityLevelUnknown + UrlSecurityLevelDanger +) + +func (m UrlSecurityLevel) String() string { + switch m { + case UrlSecurityLevelSafe: + return "safe" + case UrlSecurityLevelDanger: + return "danger" + default: + return "unknown" + } +} + +func BuildUrlCheckRequest(botuin uint32, url string) (*Packet, error) { + body := &oidb.OidbSvcTrpcTcp0XBCB_0_ReqBody{ + CheckUrlReq: &oidb.CheckUrlReq{ + Url: []string{url}, + QqPfTo: proto.String("mqq.group"), + Type: proto.Uint32(2), + SendUin: proto.Uint64(uint64(botuin)), + ReqType: proto.String("webview"), + OriginalUrl: proto.Some(url), + IsArk: proto.Bool(false), + IsFinish: proto.Bool(false), + SrcUrls: []string{url}, + SrcPlatform: proto.Uint32(1), + Qua: proto.String("AQQ_2013 4.6/2013 8.4.184945&NA_0/000000&ADR&null18&linux&2017&C2293D02BEE31158&7.1.2&V3"), + }, + } + return BuildOidbPacket(0xBCB, 0, body, false, false) +} + +func ParseUrlCheckResponse(data []byte) (UrlSecurityLevel, error) { + var rsp oidb.OidbSvcTrpcTcp0XBCB_0_RspBody + _, err := ParseOidbPacket(data, &rsp) + if err != nil { + return UrlSecurityLevelUnknown, err + } + if rsp.CheckUrlRsp == nil || len(rsp.CheckUrlRsp.Results) == 0 { + return UrlSecurityLevelUnknown, errors.New("response is empty") + } + if rsp.CheckUrlRsp.Results[0].JumpUrl.IsSome() { + return UrlSecurityLevelDanger, nil + } + if rsp.CheckUrlRsp.Results[0].Umrtype.Unwrap() == 2 { + return UrlSecurityLevelSafe, nil + } + return UrlSecurityLevelUnknown, nil +} diff --git a/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go new file mode 100644 index 0000000..1e6c319 --- /dev/null +++ b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go @@ -0,0 +1,58 @@ +// Code generated by protoc-gen-golite. DO NOT EDIT. +// source: pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto + +package oidb + +import ( + proto "github.com/RomiChan/protobuf/proto" +) + +type OidbSvcTrpcTcp0XBCB_0_ReqBody struct { + NotUseCache proto.Option[int32] `protobuf:"varint,9,opt"` + CheckUrlReq *CheckUrlReq `protobuf:"bytes,10,opt"` + _ [0]func() +} + +type CheckUrlReq struct { + Url []string `protobuf:"bytes,1,rep"` + Refer proto.Option[string] `protobuf:"bytes,2,opt"` + Plateform proto.Option[string] `protobuf:"bytes,3,opt"` + QqPfTo proto.Option[string] `protobuf:"bytes,4,opt"` + Type proto.Option[uint32] `protobuf:"varint,5,opt"` + From proto.Option[uint32] `protobuf:"varint,6,opt"` + Chatid proto.Option[uint64] `protobuf:"varint,7,opt"` + ServiceType proto.Option[uint64] `protobuf:"varint,8,opt"` + SendUin proto.Option[uint64] `protobuf:"varint,9,opt"` + ReqType proto.Option[string] `protobuf:"bytes,10,opt"` + OriginalUrl proto.Option[string] `protobuf:"bytes,11,opt"` + IsArk proto.Option[bool] `protobuf:"varint,12,opt"` + ArkName proto.Option[string] `protobuf:"bytes,13,opt"` + IsFinish proto.Option[bool] `protobuf:"varint,14,opt"` + SrcUrls []string `protobuf:"bytes,15,rep"` + SrcPlatform proto.Option[uint32] `protobuf:"varint,16,opt"` + Qua proto.Option[string] `protobuf:"bytes,17,opt"` +} + +type OidbSvcTrpcTcp0XBCB_0_RspBody struct { + Wording proto.Option[string] `protobuf:"bytes,1,opt"` + CheckUrlRsp *CheckUrlRsp `protobuf:"bytes,10,opt"` + _ [0]func() +} + +type CheckUrlRsp struct { + Results []*UrlCheckResult `protobuf:"bytes,1,rep"` + NextReqDuration proto.Option[uint32] `protobuf:"varint,2,opt"` +} + +type UrlCheckResult struct { + Url proto.Option[string] `protobuf:"bytes,1,opt"` + Result proto.Option[uint32] `protobuf:"varint,2,opt"` + JumpResult proto.Option[uint32] `protobuf:"varint,3,opt"` + JumpUrl proto.Option[string] `protobuf:"bytes,4,opt"` + Level proto.Option[uint32] `protobuf:"varint,5,opt"` + SubLevel proto.Option[uint32] `protobuf:"varint,6,opt"` + Umrtype proto.Option[uint32] `protobuf:"varint,7,opt"` + RetFrom proto.Option[uint32] `protobuf:"varint,8,opt"` + OperationBit proto.Option[uint64] `protobuf:"varint,9,opt"` + _ [0]func() +} diff --git a/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto new file mode 100644 index 0000000..4809bc6 --- /dev/null +++ b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto @@ -0,0 +1,65 @@ +syntax = "proto2"; + +option go_package = "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb"; + +message OidbSvcTrpcTcp0xBCB_0_ReqBody { + optional int32 notUseCache = 9; + optional CheckUrlReq checkUrlReq = 10; +} + +message CheckUrlReq { + repeated string url = 1; + optional string refer = 2; + optional string plateform = 3; + optional string qqPfTo = 4; + optional uint32 type = 5; + optional uint32 from = 6; + optional uint64 chatid = 7; + optional uint64 serviceType = 8; + optional uint64 sendUin = 9; + optional string reqType = 10; + optional string originalUrl = 11; + optional bool isArk = 12; + optional string arkName = 13; + optional bool isFinish = 14; + repeated string srcUrls = 15; + optional uint32 srcPlatform = 16; + optional string qua = 17; +} + +message OidbSvcTrpcTcp0xBCB_0_RspBody { + optional string wording = 1; + optional CheckUrlRsp checkUrlRsp = 10; +} + +message CheckUrlRsp { + repeated UrlCheckResult results = 1; + optional uint32 nextReqDuration = 2; +} + +message UrlCheckResult { + optional string url = 1; + optional uint32 result = 2; + optional uint32 jumpResult = 3; + optional string jumpUrl = 4; + optional uint32 level = 5; + optional uint32 subLevel = 6; + optional uint32 umrtype = 7; + optional uint32 retFrom = 8; + optional uint64 operationBit = 9; +} + +/* +message CheckUrlReqItem { + optional string url = 1; + optional string refer = 2; + optional string plateform = 3; + optional string qqPfTo = 4; + optional uint32 type = 5; + optional uint32 from = 6; + optional uint64 chatid = 7; + optional uint64 serviceType = 8; + optional uint64 sendUin = 9; + optional string reqType = 10; +} +*/ \ No newline at end of file From 252319a81f250f8ddd1fbc1a92f5dce384cfdc24 Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:48:58 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E8=BF=99=E5=80=92=E9=9C=89=E7=8E=A9?= =?UTF-8?q?=E6=84=8F(=E2=95=AF=E2=80=B5=E2=96=A1=E2=80=B2)=E2=95=AF?= =?UTF-8?q?=EF=B8=B5=E2=94=BB=E2=94=81=E2=94=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/operation.go | 6 +++--- client/packets/oidb/security_url.go | 26 +++++++++++++------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/client/operation.go b/client/operation.go index e376a72..69d1609 100644 --- a/client/operation.go +++ b/client/operation.go @@ -1337,14 +1337,14 @@ func (c *QQClient) DeleteUnidirectionalFriend(uin uint32) error { } // CheckUrlSafely 通过TX服务器检查URL安全性 -func (c *QQClient) CheckUrlSafely(url string) (oidb2.UrlSecurityLevel, error) { +func (c *QQClient) CheckUrlSafely(url string) (oidb2.URLSecurityLevel, error) { pkt, err := oidb2.BuildUrlCheckRequest(c.Uin, url) if err != nil { - return oidb2.UrlSecurityLevelUnknown, err + return oidb2.URLSecurityLevelUnknown, err } resp, err := c.sendOidbPacketAndWait(pkt) if err != nil { - return oidb2.UrlSecurityLevelUnknown, err + return oidb2.URLSecurityLevelUnknown, err } return oidb2.ParseUrlCheckResponse(resp) } diff --git a/client/packets/oidb/security_url.go b/client/packets/oidb/security_url.go index 1257c5f..a00afcc 100644 --- a/client/packets/oidb/security_url.go +++ b/client/packets/oidb/security_url.go @@ -10,19 +10,19 @@ import ( // see https://github.com/Mrs4s/MiraiGo/blob/master/client/security.go -type UrlSecurityLevel int +type URLSecurityLevel int const ( - UrlSecurityLevelSafe UrlSecurityLevel = iota + 1 - UrlSecurityLevelUnknown - UrlSecurityLevelDanger + URLSecurityLevelSafe URLSecurityLevel = iota + 1 + URLSecurityLevelUnknown + URLSecurityLevelDanger ) -func (m UrlSecurityLevel) String() string { +func (m URLSecurityLevel) String() string { switch m { - case UrlSecurityLevelSafe: + case URLSecurityLevelSafe: return "safe" - case UrlSecurityLevelDanger: + case URLSecurityLevelDanger: return "danger" default: return "unknown" @@ -48,20 +48,20 @@ func BuildUrlCheckRequest(botuin uint32, url string) (*Packet, error) { return BuildOidbPacket(0xBCB, 0, body, false, false) } -func ParseUrlCheckResponse(data []byte) (UrlSecurityLevel, error) { +func ParseUrlCheckResponse(data []byte) (URLSecurityLevel, error) { var rsp oidb.OidbSvcTrpcTcp0XBCB_0_RspBody _, err := ParseOidbPacket(data, &rsp) if err != nil { - return UrlSecurityLevelUnknown, err + return URLSecurityLevelUnknown, err } if rsp.CheckUrlRsp == nil || len(rsp.CheckUrlRsp.Results) == 0 { - return UrlSecurityLevelUnknown, errors.New("response is empty") + return URLSecurityLevelUnknown, errors.New("response is empty") } if rsp.CheckUrlRsp.Results[0].JumpUrl.IsSome() { - return UrlSecurityLevelDanger, nil + return URLSecurityLevelDanger, nil } if rsp.CheckUrlRsp.Results[0].Umrtype.Unwrap() == 2 { - return UrlSecurityLevelSafe, nil + return URLSecurityLevelSafe, nil } - return UrlSecurityLevelUnknown, nil + return URLSecurityLevelUnknown, nil } From 293f3a6d067c18b2506095290cf4f619d53d48f8 Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Fri, 15 Nov 2024 01:54:29 +0800 Subject: [PATCH 4/6] =?UTF-8?q?(-=EF=B9=8F-=EF=BC=9B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/operation.go | 6 +++--- client/packets/oidb/security_url.go | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/client/operation.go b/client/operation.go index 69d1609..9b04267 100644 --- a/client/operation.go +++ b/client/operation.go @@ -1337,8 +1337,8 @@ func (c *QQClient) DeleteUnidirectionalFriend(uin uint32) error { } // CheckUrlSafely 通过TX服务器检查URL安全性 -func (c *QQClient) CheckUrlSafely(url string) (oidb2.URLSecurityLevel, error) { - pkt, err := oidb2.BuildUrlCheckRequest(c.Uin, url) +func (c *QQClient) CheckURLSafely(url string) (oidb2.URLSecurityLevel, error) { + pkt, err := oidb2.BuildURLCheckRequest(c.Uin, url) if err != nil { return oidb2.URLSecurityLevelUnknown, err } @@ -1346,5 +1346,5 @@ func (c *QQClient) CheckUrlSafely(url string) (oidb2.URLSecurityLevel, error) { if err != nil { return oidb2.URLSecurityLevelUnknown, err } - return oidb2.ParseUrlCheckResponse(resp) + return oidb2.ParseURLCheckResponse(resp) } diff --git a/client/packets/oidb/security_url.go b/client/packets/oidb/security_url.go index a00afcc..02aea63 100644 --- a/client/packets/oidb/security_url.go +++ b/client/packets/oidb/security_url.go @@ -24,12 +24,14 @@ func (m URLSecurityLevel) String() string { return "safe" case URLSecurityLevelDanger: return "danger" + case URLSecurityLevelUnknown: + return "unknown" default: return "unknown" } } -func BuildUrlCheckRequest(botuin uint32, url string) (*Packet, error) { +func BuildURLCheckRequest(botuin uint32, url string) (*Packet, error) { body := &oidb.OidbSvcTrpcTcp0XBCB_0_ReqBody{ CheckUrlReq: &oidb.CheckUrlReq{ Url: []string{url}, @@ -48,7 +50,7 @@ func BuildUrlCheckRequest(botuin uint32, url string) (*Packet, error) { return BuildOidbPacket(0xBCB, 0, body, false, false) } -func ParseUrlCheckResponse(data []byte) (URLSecurityLevel, error) { +func ParseURLCheckResponse(data []byte) (URLSecurityLevel, error) { var rsp oidb.OidbSvcTrpcTcp0XBCB_0_RspBody _, err := ParseOidbPacket(data, &rsp) if err != nil { From 2184c09caeca4eb2d5864a08ca902b205f4077a1 Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Fri, 15 Nov 2024 10:16:52 +0800 Subject: [PATCH 5/6] ... --- client/operation.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/operation.go b/client/operation.go index 9b04267..75fd3ca 100644 --- a/client/operation.go +++ b/client/operation.go @@ -14,10 +14,9 @@ import ( "strconv" "strings" - "github.com/LagrangeDev/LagrangeGo/utils" "github.com/pkg/errors" - "github.com/tidwall/gjson" + "golang.org/x/net/html" "github.com/LagrangeDev/LagrangeGo/client/entity" @@ -29,6 +28,7 @@ import ( "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb" "github.com/LagrangeDev/LagrangeGo/internal/proto" message2 "github.com/LagrangeDev/LagrangeGo/message" + "github.com/LagrangeDev/LagrangeGo/utils" "github.com/LagrangeDev/LagrangeGo/utils/binary" "github.com/LagrangeDev/LagrangeGo/utils/crypto" ) @@ -1336,7 +1336,7 @@ func (c *QQClient) DeleteUnidirectionalFriend(uin uint32) error { return nil } -// CheckUrlSafely 通过TX服务器检查URL安全性 +// CheckURLSafely 通过TX服务器检查URL安全性 func (c *QQClient) CheckURLSafely(url string) (oidb2.URLSecurityLevel, error) { pkt, err := oidb2.BuildURLCheckRequest(c.Uin, url) if err != nil { From c6ef19e9da54453212ca2695e4648e688f6db537 Mon Sep 17 00:00:00 2001 From: icarus-ai <82353054+icarus-ai@users.noreply.github.com> Date: Fri, 15 Nov 2024 15:54:38 +0800 Subject: [PATCH 6/6] ... --- client/operation.go | 1 + client/packets/oidb/security_url.go | 24 ++-- .../service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go | 68 +++++---- .../service/oidb/OidbSvcTrpcTcp0xBCB_0.proto | 132 +++++++++--------- 4 files changed, 111 insertions(+), 114 deletions(-) diff --git a/client/operation.go b/client/operation.go index 75fd3ca..263d7d6 100644 --- a/client/operation.go +++ b/client/operation.go @@ -1337,6 +1337,7 @@ func (c *QQClient) DeleteUnidirectionalFriend(uin uint32) error { } // CheckURLSafely 通过TX服务器检查URL安全性 +// ref https://github.com/Mrs4s/MiraiGo/blob/54bdd873e3fed9fe1c944918924674dacec5ac76/client/security.go#L24 func (c *QQClient) CheckURLSafely(url string) (oidb2.URLSecurityLevel, error) { pkt, err := oidb2.BuildURLCheckRequest(c.Uin, url) if err != nil { diff --git a/client/packets/oidb/security_url.go b/client/packets/oidb/security_url.go index 02aea63..88d8dd3 100644 --- a/client/packets/oidb/security_url.go +++ b/client/packets/oidb/security_url.go @@ -4,8 +4,6 @@ import ( "errors" "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb" - - "github.com/RomiChan/protobuf/proto" ) // see https://github.com/Mrs4s/MiraiGo/blob/master/client/security.go @@ -35,16 +33,16 @@ func BuildURLCheckRequest(botuin uint32, url string) (*Packet, error) { body := &oidb.OidbSvcTrpcTcp0XBCB_0_ReqBody{ CheckUrlReq: &oidb.CheckUrlReq{ Url: []string{url}, - QqPfTo: proto.String("mqq.group"), - Type: proto.Uint32(2), - SendUin: proto.Uint64(uint64(botuin)), - ReqType: proto.String("webview"), - OriginalUrl: proto.Some(url), - IsArk: proto.Bool(false), - IsFinish: proto.Bool(false), + QqPfTo: "mqq.group", + Type: 2, + SendUin: uint64(botuin), + ReqType: "webview", + OriginalUrl: url, + IsArk: false, + IsFinish: false, SrcUrls: []string{url}, - SrcPlatform: proto.Uint32(1), - Qua: proto.String("AQQ_2013 4.6/2013 8.4.184945&NA_0/000000&ADR&null18&linux&2017&C2293D02BEE31158&7.1.2&V3"), + SrcPlatform: 1, + Qua: "AQQ_2013 4.6/2013 8.4.184945&NA_0/000000&ADR&null18&linux&2017&C2293D02BEE31158&7.1.2&V3", }, } return BuildOidbPacket(0xBCB, 0, body, false, false) @@ -59,10 +57,10 @@ func ParseURLCheckResponse(data []byte) (URLSecurityLevel, error) { if rsp.CheckUrlRsp == nil || len(rsp.CheckUrlRsp.Results) == 0 { return URLSecurityLevelUnknown, errors.New("response is empty") } - if rsp.CheckUrlRsp.Results[0].JumpUrl.IsSome() { + if rsp.CheckUrlRsp.Results[0].JumpUrl != "" { return URLSecurityLevelDanger, nil } - if rsp.CheckUrlRsp.Results[0].Umrtype.Unwrap() == 2 { + if rsp.CheckUrlRsp.Results[0].Umrtype == 2 { return URLSecurityLevelSafe, nil } return URLSecurityLevelUnknown, nil diff --git a/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go index 1e6c319..409dec1 100644 --- a/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go +++ b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.pb.go @@ -3,56 +3,52 @@ package oidb -import ( - proto "github.com/RomiChan/protobuf/proto" -) - type OidbSvcTrpcTcp0XBCB_0_ReqBody struct { - NotUseCache proto.Option[int32] `protobuf:"varint,9,opt"` - CheckUrlReq *CheckUrlReq `protobuf:"bytes,10,opt"` + NotUseCache int32 `protobuf:"varint,9,opt"` + CheckUrlReq *CheckUrlReq `protobuf:"bytes,10,opt"` _ [0]func() } type CheckUrlReq struct { - Url []string `protobuf:"bytes,1,rep"` - Refer proto.Option[string] `protobuf:"bytes,2,opt"` - Plateform proto.Option[string] `protobuf:"bytes,3,opt"` - QqPfTo proto.Option[string] `protobuf:"bytes,4,opt"` - Type proto.Option[uint32] `protobuf:"varint,5,opt"` - From proto.Option[uint32] `protobuf:"varint,6,opt"` - Chatid proto.Option[uint64] `protobuf:"varint,7,opt"` - ServiceType proto.Option[uint64] `protobuf:"varint,8,opt"` - SendUin proto.Option[uint64] `protobuf:"varint,9,opt"` - ReqType proto.Option[string] `protobuf:"bytes,10,opt"` - OriginalUrl proto.Option[string] `protobuf:"bytes,11,opt"` - IsArk proto.Option[bool] `protobuf:"varint,12,opt"` - ArkName proto.Option[string] `protobuf:"bytes,13,opt"` - IsFinish proto.Option[bool] `protobuf:"varint,14,opt"` - SrcUrls []string `protobuf:"bytes,15,rep"` - SrcPlatform proto.Option[uint32] `protobuf:"varint,16,opt"` - Qua proto.Option[string] `protobuf:"bytes,17,opt"` + Url []string `protobuf:"bytes,1,rep"` + Refer string `protobuf:"bytes,2,opt"` + Plateform string `protobuf:"bytes,3,opt"` + QqPfTo string `protobuf:"bytes,4,opt"` + Type uint32 `protobuf:"varint,5,opt"` + From uint32 `protobuf:"varint,6,opt"` + Chatid uint64 `protobuf:"varint,7,opt"` + ServiceType uint64 `protobuf:"varint,8,opt"` + SendUin uint64 `protobuf:"varint,9,opt"` + ReqType string `protobuf:"bytes,10,opt"` + OriginalUrl string `protobuf:"bytes,11,opt"` + IsArk bool `protobuf:"varint,12,opt"` + ArkName string `protobuf:"bytes,13,opt"` + IsFinish bool `protobuf:"varint,14,opt"` + SrcUrls []string `protobuf:"bytes,15,rep"` + SrcPlatform uint32 `protobuf:"varint,16,opt"` + Qua string `protobuf:"bytes,17,opt"` } type OidbSvcTrpcTcp0XBCB_0_RspBody struct { - Wording proto.Option[string] `protobuf:"bytes,1,opt"` - CheckUrlRsp *CheckUrlRsp `protobuf:"bytes,10,opt"` + Wording string `protobuf:"bytes,1,opt"` + CheckUrlRsp *CheckUrlRsp `protobuf:"bytes,10,opt"` _ [0]func() } type CheckUrlRsp struct { - Results []*UrlCheckResult `protobuf:"bytes,1,rep"` - NextReqDuration proto.Option[uint32] `protobuf:"varint,2,opt"` + Results []*UrlCheckResult `protobuf:"bytes,1,rep"` + NextReqDuration uint32 `protobuf:"varint,2,opt"` } type UrlCheckResult struct { - Url proto.Option[string] `protobuf:"bytes,1,opt"` - Result proto.Option[uint32] `protobuf:"varint,2,opt"` - JumpResult proto.Option[uint32] `protobuf:"varint,3,opt"` - JumpUrl proto.Option[string] `protobuf:"bytes,4,opt"` - Level proto.Option[uint32] `protobuf:"varint,5,opt"` - SubLevel proto.Option[uint32] `protobuf:"varint,6,opt"` - Umrtype proto.Option[uint32] `protobuf:"varint,7,opt"` - RetFrom proto.Option[uint32] `protobuf:"varint,8,opt"` - OperationBit proto.Option[uint64] `protobuf:"varint,9,opt"` + Url string `protobuf:"bytes,1,opt"` + Result uint32 `protobuf:"varint,2,opt"` + JumpResult uint32 `protobuf:"varint,3,opt"` + JumpUrl string `protobuf:"bytes,4,opt"` + Level uint32 `protobuf:"varint,5,opt"` + SubLevel uint32 `protobuf:"varint,6,opt"` + Umrtype uint32 `protobuf:"varint,7,opt"` + RetFrom uint32 `protobuf:"varint,8,opt"` + OperationBit uint64 `protobuf:"varint,9,opt"` _ [0]func() } diff --git a/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto index 4809bc6..0a8f691 100644 --- a/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto +++ b/client/packets/pb/service/oidb/OidbSvcTrpcTcp0xBCB_0.proto @@ -1,65 +1,67 @@ -syntax = "proto2"; - -option go_package = "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb"; - -message OidbSvcTrpcTcp0xBCB_0_ReqBody { - optional int32 notUseCache = 9; - optional CheckUrlReq checkUrlReq = 10; -} - -message CheckUrlReq { - repeated string url = 1; - optional string refer = 2; - optional string plateform = 3; - optional string qqPfTo = 4; - optional uint32 type = 5; - optional uint32 from = 6; - optional uint64 chatid = 7; - optional uint64 serviceType = 8; - optional uint64 sendUin = 9; - optional string reqType = 10; - optional string originalUrl = 11; - optional bool isArk = 12; - optional string arkName = 13; - optional bool isFinish = 14; - repeated string srcUrls = 15; - optional uint32 srcPlatform = 16; - optional string qua = 17; -} - -message OidbSvcTrpcTcp0xBCB_0_RspBody { - optional string wording = 1; - optional CheckUrlRsp checkUrlRsp = 10; -} - -message CheckUrlRsp { - repeated UrlCheckResult results = 1; - optional uint32 nextReqDuration = 2; -} - -message UrlCheckResult { - optional string url = 1; - optional uint32 result = 2; - optional uint32 jumpResult = 3; - optional string jumpUrl = 4; - optional uint32 level = 5; - optional uint32 subLevel = 6; - optional uint32 umrtype = 7; - optional uint32 retFrom = 8; - optional uint64 operationBit = 9; -} - -/* -message CheckUrlReqItem { - optional string url = 1; - optional string refer = 2; - optional string plateform = 3; - optional string qqPfTo = 4; - optional uint32 type = 5; - optional uint32 from = 6; - optional uint64 chatid = 7; - optional uint64 serviceType = 8; - optional uint64 sendUin = 9; - optional string reqType = 10; -} -*/ \ No newline at end of file +syntax = "proto3"; + +// ref https://github.com/Mrs4s/MiraiGo/blob/master/client/pb/oidb/oidb0xbcb.proto + +option go_package = "github.com/LagrangeDev/LagrangeGo/client/packets/pb/service/oidb"; + +message OidbSvcTrpcTcp0xBCB_0_ReqBody { + int32 notUseCache = 9; + CheckUrlReq checkUrlReq = 10; +} + +message CheckUrlReq { + repeated string url = 1; + string refer = 2; + string plateform = 3; + string qqPfTo = 4; + uint32 type = 5; + uint32 from = 6; + uint64 chatid = 7; + uint64 serviceType = 8; + uint64 sendUin = 9; + string reqType = 10; + string originalUrl = 11; + bool isArk = 12; + string arkName = 13; + bool isFinish = 14; + repeated string srcUrls = 15; + uint32 srcPlatform = 16; + string qua = 17; +} + +message OidbSvcTrpcTcp0xBCB_0_RspBody { + string wording = 1; + CheckUrlRsp checkUrlRsp = 10; +} + +message CheckUrlRsp { + repeated UrlCheckResult results = 1; + uint32 nextReqDuration = 2; +} + +message UrlCheckResult { + string url = 1; + uint32 result = 2; + uint32 jumpResult = 3; + string jumpUrl = 4; + uint32 level = 5; + uint32 subLevel = 6; + uint32 umrtype = 7; + uint32 retFrom = 8; + uint64 operationBit = 9; +} + +/* +message CheckUrlReqItem { + string url = 1; + string refer = 2; + string plateform = 3; + string qqPfTo = 4; + uint32 type = 5; + uint32 from = 6; + uint64 chatid = 7; + uint64 serviceType = 8; + uint64 sendUin = 9; + string reqType = 10; +} +*/