diff --git a/annotations/src/main/java/moe/fuqiuluo/symbols/Protobuf.kt b/annotations/src/main/java/moe/fuqiuluo/symbols/Protobuf.kt index 4407d4b9..a9e148ec 100644 --- a/annotations/src/main/java/moe/fuqiuluo/symbols/Protobuf.kt +++ b/annotations/src/main/java/moe/fuqiuluo/symbols/Protobuf.kt @@ -7,10 +7,6 @@ import kotlin.reflect.KClass interface Protobuf> -inline fun > KClass.decode(data: ByteArray): T { - return ProtoBuf.decodeFromByteArray(data) -} - inline fun > ByteArray.decodeProtobuf(to: KClass? = null): T { return ProtoBuf.decodeFromByteArray(this) } diff --git a/protobuf/src/main/java/protobuf/message/AppShareInfo.kt b/protobuf/src/main/java/protobuf/message/AppShareInfo.kt new file mode 100644 index 00000000..1323bafe --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/AppShareInfo.kt @@ -0,0 +1,26 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class AppShareInfo( + @ProtoNumber(1) var appshareId: UInt? = null, + @ProtoNumber(2) var appshareCookie: ByteArray? = null, + @ProtoNumber(3) var appshareResource: PluginInfo? = null, +) + +@Serializable +data class PluginInfo( + @ProtoNumber(1) var resId: UInt = 0u, + @ProtoNumber(2) var pkgName: String = "", + @ProtoNumber(3) var newVer: UInt = 0u, + @ProtoNumber(4) var resType: UInt = 0u, + @ProtoNumber(5) var lanType: UInt = 0u, + @ProtoNumber(6) var priority: UInt = 0u, + @ProtoNumber(7) var resName: String = "", + @ProtoNumber(8) var resDesc: String = "", + @ProtoNumber(9) var resUrlBig: String = "", + @ProtoNumber(10) var resUrlSmall: String = "", + @ProtoNumber(11) var resConf: String = "", +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/MessageContent.kt b/protobuf/src/main/java/protobuf/message/ContentHead.kt similarity index 85% rename from protobuf/src/main/java/protobuf/message/MessageContent.kt rename to protobuf/src/main/java/protobuf/message/ContentHead.kt index 0868eddb..cfc065b3 100644 --- a/protobuf/src/main/java/protobuf/message/MessageContent.kt +++ b/protobuf/src/main/java/protobuf/message/ContentHead.kt @@ -4,12 +4,12 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber @Serializable -data class MessageContent( +data class ContentHead( @ProtoNumber(1) val msgType: Int = Int.MIN_VALUE, @ProtoNumber(2) val msgSubType: Int? = null, - @ProtoNumber(3) val u1: Int? = null, + @ProtoNumber(3) val divSeq: Int? = null, @ProtoNumber(4) val msgViaRandom: Long = Long.MIN_VALUE, - @ProtoNumber(5) val msgSeq_: Long? = null, + @ProtoNumber(5) val sequence: Long? = null, @ProtoNumber(6) val msgTime: Long? = null, @ProtoNumber(7) val u2: Int? = null, @ProtoNumber(8) val u6: Int? = null, @@ -27,5 +27,5 @@ data class ForwardHead( @ProtoNumber(2) val u2: Int? = null, @ProtoNumber(3) val u3: Int? = null, @ProtoNumber(4) val ub641: String? = null, - @ProtoNumber(5) val Avatar: String? = null + @ProtoNumber(5) val avatar: String? = null ) diff --git a/protobuf/src/main/java/protobuf/message/Elem.kt b/protobuf/src/main/java/protobuf/message/Elem.kt new file mode 100644 index 00000000..87429317 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/Elem.kt @@ -0,0 +1,64 @@ +package protobuf.message + +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber +import protobuf.message.element.* + +@OptIn(ExperimentalSerializationApi::class) +@Serializable +data class Elem( + @ProtoNumber(1) val text: TextMsg? = null, + @ProtoNumber(2) val face: FaceMsg? = null, +// @ProtoNumber(3) val onlineImage: OnlineImage? = null, + @ProtoNumber(4) val notOnlineImage: NotOnlineImage? = null, +// @ProtoNumber(5) var transElemInfo: TransElem? = null, + @ProtoNumber(6) val marketFace: MarketFace? = null, +// @ProtoNumber(7) var elemFlags: ElemFlags? = null, + @ProtoNumber(8) val customFace: CustomFace? = null, + @ProtoNumber(9) var elemFlags2: ElemFlags2? = null, +// @ProtoNumber(10) var funFace: FunFace? = null, +// @ProtoNumber(11) var secretFile: SecretFileMsg? = null, +// @ProtoNumber(12) var richMsg: RichMsg? = null, +// @ProtoNumber(13) var groupFile: GroupFile? = null, +// @ProtoNumber(14) var pubGroup: PubGroup? = null, +// @ProtoNumber(15) var marketTrans: MarketTrans? = null, +// @ProtoNumber(16) var extraInfo: ExtraInfo? = null, +// @ProtoNumber(17) var shakeWindow: ShakeWindow? = null, +// @ProtoNumber(18) var pubAccount: PubAccount? = null, +// @ProtoNumber(19) var videoFile: VideoFile? = null, +// @ProtoNumber(20) var tipsInfo: TipsInfo? = null, +// @ProtoNumber(21) var anonGroupMsg: AnonymousGroupMsg? = null, +// @ProtoNumber(22) var qqLiveOld: QQLiveOld? = null, +// @ProtoNumber(23) var lifeOnline: LifeOnlineAccount? = null, +// @ProtoNumber(24) var qqwalletMsg: QQWalletMsg? = null, +// @ProtoNumber(25) var crmElem: CrmElem? = null, +// @ProtoNumber(26) var conferenceTipsInfo: ConferenceTipsInfo? = null, +// @ProtoNumber(27) var redbagInfo: RedBagInfo? = null, +// @ProtoNumber(28) var lowVersionTips: LowVersionTips? = null, +// @ProtoNumber(29) var bankcodeCtrlInfo: ByteArray? = null, +// @ProtoNumber(30) var nearByMsg: NearByMessageType? = null, +// @ProtoNumber(31) var customElem: CustomElem? = null, +// @ProtoNumber(32) var locationInfo: LocationInfo? = null, +// @ProtoNumber(33) var pubAccInfo: PubAccInfo? = null, +// @ProtoNumber(34) var smallEmoji: SmallEmoji? = null, +// @ProtoNumber(35) var fsjMsgElem: FSJMessageElem? = null, +// @ProtoNumber(36) var arkApp: ArkAppElem? = null, + @ProtoNumber(37) val generalFlags: GeneralFlags? = null, +// @ProtoNumber(38) var hcFlashPic: CustomFace? = null, +// @ProtoNumber(39) var deliverGiftMsg: DeliverGiftMsg? = null, +// @ProtoNumber(40) var bitapp_msg: BitAppMsg? = null, +// @ProtoNumber(41) var openQqData: OpenQQData? = null, +// @ProtoNumber(42) var apolloMsg: ApolloActMsg? = null, +// @ProtoNumber(43) var groupPubAccInfo: GroupPubAccountInfo? = null, +// @ProtoNumber(44) var blessMsg: BlessingMessage? = null, + @ProtoNumber(45) var srcMsg: SourceMsg? = null, +// @ProtoNumber(46) var lolaMsg: LolaMsg? = null, +// @ProtoNumber(47) var groupBusinessMsg: GroupBusinessMsg? = null, +// @ProtoNumber(48) var msgWorkflowNotify: WorkflowNotifyMsg? = null, +// @ProtoNumber(49) var patElem: PatsElem? = null, +// @ProtoNumber(50) var groupPostElem: GroupPostElem? = null, + @ProtoNumber(51) val lightApp: LightAppElem? = null, +// @ProtoNumber(52) var eimInfo: EIMInfo? = null, + @ProtoNumber(53) val commonElem: CommonElem? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/Message.kt b/protobuf/src/main/java/protobuf/message/Message.kt deleted file mode 100644 index ee5dd9ab..00000000 --- a/protobuf/src/main/java/protobuf/message/Message.kt +++ /dev/null @@ -1,17 +0,0 @@ -@file:OptIn(ExperimentalSerializationApi::class) -package protobuf.message - -import kotlinx.serialization.ExperimentalSerializationApi -import kotlinx.serialization.Serializable -import kotlinx.serialization.protobuf.ProtoNumber - -@Serializable -data class RichMessage( - @ProtoNumber(1) val font: Font? = null, - @ProtoNumber(2) val elements: List? = null -) - -@Serializable -data class Font( - @ProtoNumber(9) val fontName: String? = null -) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/MessageBody.kt b/protobuf/src/main/java/protobuf/message/MessageBody.kt deleted file mode 100644 index 398b2e5e..00000000 --- a/protobuf/src/main/java/protobuf/message/MessageBody.kt +++ /dev/null @@ -1,11 +0,0 @@ -package protobuf.message - -import kotlinx.serialization.Serializable -import kotlinx.serialization.protobuf.ProtoNumber - -@Serializable -data class MessageBody( - @ProtoNumber(1) val rich: RichMessage? = null, - @ProtoNumber(2) val rawBuffer: ByteArray? = null, - @ProtoNumber(3) val MsgEncryptContent: ByteArray? = null -) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/MessageElement.kt b/protobuf/src/main/java/protobuf/message/MessageElement.kt deleted file mode 100644 index 3da71016..00000000 --- a/protobuf/src/main/java/protobuf/message/MessageElement.kt +++ /dev/null @@ -1,13 +0,0 @@ -package protobuf.message - -import kotlinx.serialization.Serializable -import kotlinx.serialization.protobuf.ProtoNumber -import protobuf.message.element.* - -@Serializable -data class MessageElement( - @ProtoNumber(1) val text: TextElement? = null, - @ProtoNumber(2) val face: FaceElement? = null, - @ProtoNumber(51) val json: JsonElement? = null, - @ProtoNumber(53) val comm: CommonElement? = null, -) diff --git a/protobuf/src/main/java/protobuf/message/MsgBody.kt b/protobuf/src/main/java/protobuf/message/MsgBody.kt new file mode 100644 index 00000000..f285e193 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/MsgBody.kt @@ -0,0 +1,11 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class MsgBody( + @ProtoNumber(1) val richText: RichText? = null, + @ProtoNumber(2) val msgContent: ByteArray? = null, + @ProtoNumber(3) val msgEncryptContent: ByteArray? = null +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/MsgControl.kt b/protobuf/src/main/java/protobuf/message/MsgControl.kt new file mode 100644 index 00000000..fd95048d --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/MsgControl.kt @@ -0,0 +1,9 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class MsgControl( + @ProtoNumber(1) val msgFlag: Int? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/NotOnlineFile.kt b/protobuf/src/main/java/protobuf/message/NotOnlineFile.kt new file mode 100644 index 00000000..ca7ec71d --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/NotOnlineFile.kt @@ -0,0 +1,28 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class NotOnlineFile( + @ProtoNumber(1) var fileType: UInt? = null, + @ProtoNumber(2) var sig: ByteArray? = null, + @ProtoNumber(3) var fileUuid: ByteArray? = null, + @ProtoNumber(4) var fileMd5: ByteArray? = null, + @ProtoNumber(5) var fileName: ByteArray? = null, + @ProtoNumber(6) var fileSize: ULong? = null, + @ProtoNumber(7) var note: ByteArray? = null, + @ProtoNumber(8) var reserved: UInt? = null, + @ProtoNumber(9) var subcmd: UInt? = null, + @ProtoNumber(10) var microCloud: UInt? = null, + @ProtoNumber(11) var rptFileUrls: List? = null, + @ProtoNumber(12) var downloadFlag: UInt? = null, + @ProtoNumber(50) var dangerEvel: UInt? = null, + @ProtoNumber(51) var lifeTime: UInt? = null, + @ProtoNumber(52) var uploadTime: UInt? = null, + @ProtoNumber(53) var absFileType: UInt? = null, + @ProtoNumber(54) var clientType: UInt? = null, + @ProtoNumber(55) var expireTime: UInt? = null, + @ProtoNumber(56) var pbReserve: ByteArray? = null, + @ProtoNumber(57) var fileidcrcMedia: String? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/NtMessage.kt b/protobuf/src/main/java/protobuf/message/NtMessage.kt deleted file mode 100644 index 52297216..00000000 --- a/protobuf/src/main/java/protobuf/message/NtMessage.kt +++ /dev/null @@ -1,11 +0,0 @@ -package protobuf.message - -import kotlinx.serialization.Serializable -import kotlinx.serialization.protobuf.ProtoNumber - -@Serializable -data class NtMessage( - @ProtoNumber(1) val msgHead: MessageHead? = null, - @ProtoNumber(2) val contentHead: MessageContent? = null, - @ProtoNumber(3) val body: MessageBody? = null, -) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/PbSendMsgReq.kt b/protobuf/src/main/java/protobuf/message/PbSendMsgReq.kt new file mode 100644 index 00000000..12d2e260 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/PbSendMsgReq.kt @@ -0,0 +1,23 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber +import moe.fuqiuluo.symbols.Protobuf + +@Serializable +data class PbSendMsgReq( + @ProtoNumber(1) val routingHead: RoutingHead? = null, + @ProtoNumber(2) val contentHead: ContentHead? = null, + @ProtoNumber(3) val msgBody: MsgBody? = null, + @ProtoNumber(4) val msgSeq: UInt? = null, + @ProtoNumber(5) val msgRand: UInt? = null, + @ProtoNumber(6) val syncCookie: ByteArray? = null, + @ProtoNumber(7) val appShare: AppShareInfo? = null, + @ProtoNumber(8) val msgVia: UInt? = null, + @ProtoNumber(9) val dataStatist: UInt? = null, +// @ProtoNumber(10) val multiMsgAssist: MultiMsgAssist? = null, +// @ProtoNumber(11) val inputNotifyInfo: InputNotifyInfo? = null, + @ProtoNumber(12) val ctrl: MsgControl? = null, +// @ProtoNumber(13) val receiptReq: ReceiptReq? = null, + @ProtoNumber(14) val multiSendSeq: UInt? = null +) : Protobuf \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/Ptt.kt b/protobuf/src/main/java/protobuf/message/Ptt.kt new file mode 100644 index 00000000..2aedae4f --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/Ptt.kt @@ -0,0 +1,32 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class Ptt( + @ProtoNumber(1) var fileType: UInt?=null, + @ProtoNumber(2) var srcUin: ULong?=null, + @ProtoNumber(3) var fileUuid: ByteArray?=null, + @ProtoNumber(4) var fileMd5: ByteArray?=null, + @ProtoNumber(5) var fileName: ByteArray?=null, + @ProtoNumber(6) var fileSize: UInt?=null, + @ProtoNumber(7) var reserve: ByteArray?=null, + @ProtoNumber(8) var fileId: UInt?=null, + @ProtoNumber(9) var serverIp: UInt?=null, + @ProtoNumber(10) var serverPort: UInt?=null, + @ProtoNumber(11) var boolValid: Boolean = false, + @ProtoNumber(12) var signature: ByteArray?=null, + @ProtoNumber(13) var shortcut: ByteArray?=null, + @ProtoNumber(14) var fileKey: ByteArray?=null, + @ProtoNumber(15) var magicPttIndex: UInt?=null, + @ProtoNumber(16) var voiceSwitch: UInt?=null, + @ProtoNumber(17) var pttUrl: ByteArray?=null, + @ProtoNumber(18) var groupFileKey: ByteArray?=null, + @ProtoNumber(19) var time: UInt?=null, + @ProtoNumber(20) var downPara: ByteArray?=null, + @ProtoNumber(29) var format: UInt?=null, + @ProtoNumber(30) var pbReserve: ByteArray?=null, + @ProtoNumber(31) var rptPttUrls: List? = null, + @ProtoNumber(32) var downloadFlag: UInt?=null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/PushMsgBody.kt b/protobuf/src/main/java/protobuf/message/PushMsgBody.kt new file mode 100644 index 00000000..be21eec4 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/PushMsgBody.kt @@ -0,0 +1,11 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class PushMsgBody( + @ProtoNumber(1) val msgHead: ResponseHead? = null, + @ProtoNumber(2) val contentHead: ContentHead? = null, + @ProtoNumber(3) val body: MsgBody? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/MessageHead.kt b/protobuf/src/main/java/protobuf/message/ResponseHead.kt similarity index 82% rename from protobuf/src/main/java/protobuf/message/MessageHead.kt rename to protobuf/src/main/java/protobuf/message/ResponseHead.kt index 5f57c646..e92a2e73 100644 --- a/protobuf/src/main/java/protobuf/message/MessageHead.kt +++ b/protobuf/src/main/java/protobuf/message/ResponseHead.kt @@ -6,25 +6,25 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber @Serializable -data class MessageHead( +data class ResponseHead( @ProtoNumber(1) val peer: Long = Long.MIN_VALUE, @ProtoNumber(2) val peerUid: String? = null, @ProtoNumber(3) val flag: Int = Int.MIN_VALUE, @ProtoNumber(4) val appId: Int = Int.MIN_VALUE, @ProtoNumber(5) val receiver: Long? = null, @ProtoNumber(6) val receiverUid: String? = null, - @ProtoNumber(7) val forward: MessageForward? = null, - @ProtoNumber(8) val groupInfo: GroupInfo? = null, + @ProtoNumber(7) val forward: ResponseForward? = null, + @ProtoNumber(8) val responseGrp: ResponseGrp? = null, ) @Serializable -data class MessageForward( +data class ResponseForward( @ProtoNumber(6) val friendName: String? = null, @ProtoNumber(11) val u1: Int? = null, ) @Serializable -data class GroupInfo( +data class ResponseGrp( @ProtoNumber(1) val groupCode: ULong = ULong.MIN_VALUE, @ProtoNumber(4) val memberCard: String? = null, @ProtoNumber(5) val u1: Int? = null, diff --git a/protobuf/src/main/java/protobuf/message/RichText.kt b/protobuf/src/main/java/protobuf/message/RichText.kt new file mode 100644 index 00000000..3e5c1280 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/RichText.kt @@ -0,0 +1,31 @@ +@file:OptIn(ExperimentalSerializationApi::class) + +package protobuf.message + +import kotlinx.serialization.ExperimentalSerializationApi +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class RichText( + @ProtoNumber(1) val attr: Attr? = null, + @ProtoNumber(2) val elements: List? = null, + @ProtoNumber(3) val not_online_file: NotOnlineFile? = null, + @ProtoNumber(4) val ptt: Ptt? = null, + @ProtoNumber(5) val tmp_ptt: TmpPtt? = null, + @ProtoNumber(6) val trans_211_tmp_msg: Trans211TmpMsg? = null, +) + +@Serializable +data class Attr( + @ProtoNumber(1) val codePage: Int? = null, + @ProtoNumber(2) val time: UInt? = null, + @ProtoNumber(3) val random: UInt? = null, + @ProtoNumber(4) val color: UInt? = null, + @ProtoNumber(5) val size: UInt? = null, + @ProtoNumber(6) val effect: UInt? = null, + @ProtoNumber(7) val charSet: UInt? = null, + @ProtoNumber(8) val pitchAndFamily: UInt? = null, + @ProtoNumber(9) val fontName: String? = null, + @ProtoNumber(10) val reserve_data: ByteArray? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/RoutingHead.kt b/protobuf/src/main/java/protobuf/message/RoutingHead.kt new file mode 100644 index 00000000..5bb3cfe9 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/RoutingHead.kt @@ -0,0 +1,14 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber +import protobuf.message.routing.* + +@Serializable +data class RoutingHead( + @ProtoNumber(1) val c2c: C2C? = null, + @ProtoNumber(2) val grp: Grp? = null, + @ProtoNumber(3) val grpTmp: GrpTmp? = null, + @ProtoNumber(6) val wpaTmp: WPATmp? = null, + @ProtoNumber(15) val trans0X211: Trans0X211? = null +) diff --git a/protobuf/src/main/java/protobuf/message/TmpPtt.kt b/protobuf/src/main/java/protobuf/message/TmpPtt.kt new file mode 100644 index 00000000..90ed50cf --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/TmpPtt.kt @@ -0,0 +1,20 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class TmpPtt( + @ProtoNumber(1) var fileType: UInt? = null, + @ProtoNumber(2) var fileUuid: ByteArray? = null, + @ProtoNumber(3) var fileMd5: ByteArray? = null, + @ProtoNumber(4) var fileName: ByteArray? = null, + @ProtoNumber(5) var fileSize: UInt? = null, + @ProtoNumber(6) var pttTimes: UInt? = null, + @ProtoNumber(7) var userType: UInt? = null, + @ProtoNumber(8) var ptttransFlag: UInt? = null, + @ProtoNumber(9) var busiType: UInt? = null, + @ProtoNumber(10) var msgId: ULong? = null, + @ProtoNumber(30) var pbReserve: ByteArray? = null, + @ProtoNumber(31) var pttEncodeData: ByteArray? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/Trans211TmpMsg.kt b/protobuf/src/main/java/protobuf/message/Trans211TmpMsg.kt new file mode 100644 index 00000000..4957d8b5 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/Trans211TmpMsg.kt @@ -0,0 +1,10 @@ +package protobuf.message + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class Trans211TmpMsg( + @ProtoNumber(1) var msgBody: ByteArray? = null, + @ProtoNumber(2) var c2cCmd: UInt? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/CommonElem.kt b/protobuf/src/main/java/protobuf/message/element/CommonElem.kt new file mode 100644 index 00000000..c0e4b425 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/CommonElem.kt @@ -0,0 +1,11 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class CommonElem( + @ProtoNumber(1) val serviceType: Int? = null, + @ProtoNumber(2) val elem: ByteArray? = null, + @ProtoNumber(3) val businessType: Int? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/CommonElement.kt b/protobuf/src/main/java/protobuf/message/element/CommonElement.kt deleted file mode 100644 index 7111d02a..00000000 --- a/protobuf/src/main/java/protobuf/message/element/CommonElement.kt +++ /dev/null @@ -1,11 +0,0 @@ -package protobuf.message.element - -import kotlinx.serialization.Serializable -import kotlinx.serialization.protobuf.ProtoNumber - -@Serializable -data class CommonElement( - @ProtoNumber(1) val type: Int? = null, - @ProtoNumber(2) val data: ByteArray? = null, - @ProtoNumber(3) val u1: Int? = null, -) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/CustomFace.kt b/protobuf/src/main/java/protobuf/message/element/CustomFace.kt new file mode 100644 index 00000000..8c81f39e --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/CustomFace.kt @@ -0,0 +1,49 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class CustomFace( + @ProtoNumber(1) var guid: ByteArray? = null, + @ProtoNumber(2) var filePath: String? = null, + @ProtoNumber(3) var shortcut: String? = null, + @ProtoNumber(4) var buffer: ByteArray? = null, + @ProtoNumber(5) var flag: ByteArray? = null, + @ProtoNumber(6) var oldData: ByteArray? = null, + @ProtoNumber(7) var fileId: UInt? = null, + @ProtoNumber(8) var serverIp: UInt? = null, + @ProtoNumber(9) var serverPort: UInt? = null, + @ProtoNumber(10) var fileType: UInt? = null, // 66 + @ProtoNumber(11) var signature: ByteArray? = null, + @ProtoNumber(12) var useful: UInt? = null, + @ProtoNumber(13) var md5: ByteArray? = null, + @ProtoNumber(14) var thumbUrl: String? = null, + @ProtoNumber(15) var bigUrl: String? = null, + @ProtoNumber(16) var origUrl: String? = null, + @ProtoNumber(17) var bizType: UInt? = null, + @ProtoNumber(18) var repeatIndex: UInt? = null, + @ProtoNumber(19) var repeatImage: UInt? = null, + @ProtoNumber(20) var imageType: UInt? = null, + @ProtoNumber(21) var index: UInt? = null, + @ProtoNumber(22) var width: UInt? = null, + @ProtoNumber(23) var height: UInt? = null, + @ProtoNumber(24) var source: UInt? = null, + @ProtoNumber(25) var size: UInt? = null, + @ProtoNumber(26) var origin: UInt? = null, + @ProtoNumber(27) var thumbWidth: UInt? = null, + @ProtoNumber(28) var thumbHeight: UInt? = null, + @ProtoNumber(29) var showLen: UInt? = null, + @ProtoNumber(30) var downloadLen: UInt? = null, + @ProtoNumber(31) var url400: String? = null, + @ProtoNumber(32) var width400: UInt? = null, + @ProtoNumber(33) var height400: UInt? = null, + @ProtoNumber(34) var pbReserve: PbReserve? = null, +){ + companion object{ + @Serializable + data class PbReserve( + @ProtoNumber(1) var field1: Int? = null + ) + } +} \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/ElemFlags2.kt b/protobuf/src/main/java/protobuf/message/element/ElemFlags2.kt new file mode 100644 index 00000000..bfff6a71 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/ElemFlags2.kt @@ -0,0 +1,38 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class ElemFlags2( + @ProtoNumber(1) var color_text_id: UInt? = null, + @ProtoNumber(2) var msg_id: ULong? = null, + @ProtoNumber(3) var whisper_session_id: UInt? = null, + @ProtoNumber(4) var ptt_change_bit: UInt? = null, + @ProtoNumber(5) var vip_status: UInt? = null, + @ProtoNumber(6) var compatible_id: UInt? = null, + @ProtoNumber(7) var rpt_insts: List? = null, + @ProtoNumber(8) var msg_rpt_cnt: UInt? = null, + @ProtoNumber(9) var src_inst: Inst? = null, + @ProtoNumber(10) var longtitude: UInt? = null, + @ProtoNumber(11) var latitude: UInt? = null, + @ProtoNumber(12) var custom_font: UInt? = null, + @ProtoNumber(13) var pc_support_def: PcSupportDef? = null, + @ProtoNumber(14) var crm_flags: UInt? = null, +) + +@Serializable +data class Inst( + @ProtoNumber(1) var app_id: UInt? = null, + @ProtoNumber(2) var inst_id: UInt? = null, +) + +@Serializable +data class PcSupportDef( + @ProtoNumber(1) var pc_ptl_begin: UInt? = null, + @ProtoNumber(2) var pc_ptl_end: UInt? = null, + @ProtoNumber(3) var mac_ptl_begin: UInt? = null, + @ProtoNumber(4) var mac_ptl_end: UInt? = null, + @ProtoNumber(5) var rpt_ptls_support: List? = null, + @ProtoNumber(6) var rpt_ptls_not_support: List? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/FaceElement.kt b/protobuf/src/main/java/protobuf/message/element/FaceMsg.kt similarity index 60% rename from protobuf/src/main/java/protobuf/message/element/FaceElement.kt rename to protobuf/src/main/java/protobuf/message/element/FaceMsg.kt index 98993281..c396b2fd 100644 --- a/protobuf/src/main/java/protobuf/message/element/FaceElement.kt +++ b/protobuf/src/main/java/protobuf/message/element/FaceMsg.kt @@ -4,6 +4,9 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber @Serializable -data class FaceElement( +data class FaceMsg( @ProtoNumber(1) val id: Int? = null, + @ProtoNumber(2) var old: ByteArray? = null, + @ProtoNumber(11) var buf: ByteArray? = null, + ) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/GeneralFlags.kt b/protobuf/src/main/java/protobuf/message/element/GeneralFlags.kt new file mode 100644 index 00000000..105aa596 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/GeneralFlags.kt @@ -0,0 +1,28 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + + +@Serializable +data class GeneralFlags( + @ProtoNumber(1) val bubbleDiyTextId: UInt? = null, + @ProtoNumber(2) val groupFlagNew: UInt? = null, + @ProtoNumber(3) val uin: ULong? = null, + @ProtoNumber(4) val rpId: ByteArray? = null, + @ProtoNumber(5) val prpFold: UInt? = null, + @ProtoNumber(6) val longTextFlag: UInt? = null, + @ProtoNumber(7) val longTextResid: ByteArray? = null, + @ProtoNumber(8) val groupType: UInt? = null, + @ProtoNumber(9) val toUinFlag: UInt? = null, + @ProtoNumber(10) val glamourLevel: UInt? = null, + @ProtoNumber(11) val memberLevel: UInt? = null, + @ProtoNumber(12) val groupRankSeq: ULong? = null, + @ProtoNumber(13) val olympicTorch: UInt? = null, + @ProtoNumber(14) val babyqGuideMsgCookie: ByteArray? = null, + @ProtoNumber(15) val expertFlag: UInt? = null, + @ProtoNumber(16) val bubbleSubId: UInt? = null, + @ProtoNumber(17) val pendantId: ULong? = null, + @ProtoNumber(18) val rpIndex: ByteArray? = null, + @ProtoNumber(19) val reserve: ByteArray? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/JsonElement.kt b/protobuf/src/main/java/protobuf/message/element/LightAppElem.kt similarity index 88% rename from protobuf/src/main/java/protobuf/message/element/JsonElement.kt rename to protobuf/src/main/java/protobuf/message/element/LightAppElem.kt index bfe9e26f..32eb25a6 100644 --- a/protobuf/src/main/java/protobuf/message/element/JsonElement.kt +++ b/protobuf/src/main/java/protobuf/message/element/LightAppElem.kt @@ -4,6 +4,6 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.protobuf.ProtoNumber @Serializable -data class JsonElement( +data class LightAppElem( @ProtoNumber(1) val data: ByteArray? = null, ) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/MarketFace.kt b/protobuf/src/main/java/protobuf/message/element/MarketFace.kt new file mode 100644 index 00000000..14b56260 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/MarketFace.kt @@ -0,0 +1,21 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class MarketFace( + @ProtoNumber(1) var faceName: String? = null, + @ProtoNumber(2) var itemType: Int? = null, + @ProtoNumber(3) var faceInfo: Int? = null, + @ProtoNumber(4) var faceId: String? = null, + @ProtoNumber(5) var tabId: Int? = null, + @ProtoNumber(6) var subType: Int? = null, + @ProtoNumber(7) var key: ByteArray? = null, + @ProtoNumber(8) var param: ByteArray? = null, + @ProtoNumber(9) var mediaType: Int? = null, + @ProtoNumber(10) var imageWidth: Int? = null, + @ProtoNumber(11) var imageHeight: Int? = null, + @ProtoNumber(12) var mobileparam: ByteArray? = null, + @ProtoNumber(13) var pbReserve: ByteArray? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/NotOnlineImage.kt b/protobuf/src/main/java/protobuf/message/element/NotOnlineImage.kt new file mode 100644 index 00000000..2e296ca7 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/NotOnlineImage.kt @@ -0,0 +1,46 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class NotOnlineImage( + @ProtoNumber(1) val filePath: ByteArray? = null, + @ProtoNumber(2) val fileLen: UInt? = null, + @ProtoNumber(3) val downloadPath: ByteArray? = null, + @ProtoNumber(4) val oldVerSendFile: ByteArray? = null, + @ProtoNumber(5) val imgType: UInt? = null, + @ProtoNumber(6) val previewsImage: ByteArray? = null, + @ProtoNumber(7) val picMd5: ByteArray? = null, + @ProtoNumber(8) val picHeight: UInt? = null, + @ProtoNumber(9) val picWidth: UInt? = null, + @ProtoNumber(10) val resId: ByteArray? = null, + @ProtoNumber(11) val flag: ByteArray? = null, + @ProtoNumber(12) val thumbUrl: String? = null, + @ProtoNumber(13) val original: UInt? = null, + @ProtoNumber(14) val bigUrl: String? = null, + @ProtoNumber(15) val origUrl: String? = null, + @ProtoNumber(16) val bizType: UInt? = null, + @ProtoNumber(17) val result: UInt? = null, + @ProtoNumber(18) val index: UInt? = null, + @ProtoNumber(19) val opFaceBuf: ByteArray? = null, + @ProtoNumber(20) val oldPicMd5: Boolean = false, + @ProtoNumber(21) val thumbWidth: UInt? = null, + @ProtoNumber(22) val thumbHeight: UInt? = null, + @ProtoNumber(23) val fileId: UInt? = null, + @ProtoNumber(24) val showLen: UInt? = null, + @ProtoNumber(25) val downloadLen: UInt? = null, + @ProtoNumber(26) val url400: String? = null, + @ProtoNumber(27) val width400: UInt? = null, + @ProtoNumber(28) val height400: UInt? = null, + @ProtoNumber(29) val pbReserve: PbReserve? = null, +) { + companion object { + @Serializable + data class PbReserve( + @ProtoNumber(1) var field1: Int? = null, + @ProtoNumber(8) var field8: String? = null, + @ProtoNumber(30) var url: String? = null + ) + } +} \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/SourceMsg.kt b/protobuf/src/main/java/protobuf/message/element/SourceMsg.kt new file mode 100644 index 00000000..53b4cd48 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/SourceMsg.kt @@ -0,0 +1,30 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber +import protobuf.message.Elem + +@Serializable +data class SourceMsg( + @ProtoNumber(1) var origSeqs: List? = null, + @ProtoNumber(2) var senderUin: ULong? = null, + @ProtoNumber(3) var time: ULong? = null, + @ProtoNumber(4) var flag: UInt? = null, + @ProtoNumber(5) var elems: List? = null, + @ProtoNumber(6) var type: UInt? = null, + @ProtoNumber(7) var richMsg: ByteArray? = null, + @ProtoNumber(8) var pbReserve: PbReserve? = null, + @ProtoNumber(9) var srcMsg: ByteArray? = null, + @ProtoNumber(10) var toUin: ULong? = null, + @ProtoNumber(11) var troopName: String? = null, +) { + companion object { + @Serializable + data class PbReserve( + @ProtoNumber(3) var field3: ULong? = null, + @ProtoNumber(6) var senderUid: String? = null, + @ProtoNumber(7) var receiverUid: String? = null, + @ProtoNumber(8) var field8: Int? = null, + ) + } +} \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/TextElement.kt b/protobuf/src/main/java/protobuf/message/element/TextElement.kt deleted file mode 100644 index fec3285a..00000000 --- a/protobuf/src/main/java/protobuf/message/element/TextElement.kt +++ /dev/null @@ -1,40 +0,0 @@ -package protobuf.message.element - -import kotlinx.serialization.Serializable -import kotlinx.serialization.protobuf.ProtoNumber - -@Serializable -data class TextElement( - @ProtoNumber(1) val text: String? = null, - @ProtoNumber(2) val link: String? = null, - @ProtoNumber(3) val attr6Buf: ByteArray? = null, - @ProtoNumber(4) val attr7Buf: ByteArray? = null, - @ProtoNumber(11) val buf: ByteArray? = null, - @ProtoNumber(12) val pbReserve: TextResvAttr? = null, -) { - companion object { - @Serializable - data class TextResvAttr( - @ProtoNumber(1) val wording: ByteArray? = null, - @ProtoNumber(2) val textAnalysisResult: Int? = null, - @ProtoNumber(3) val atType: Int? = null, - @ProtoNumber(4) val atMemberUin: Long? = null, - @ProtoNumber(5) val atMemberTinyid: Long? = null, - @ProtoNumber(6) val atChannelInfo: ExtChannelInfo? = null, - @ProtoNumber(7) val atRoleInfo: ExtRoleInfo? = null, - ) - - @Serializable - data class ExtChannelInfo( - @ProtoNumber(1) val guildId: Long? = null, - @ProtoNumber(2) val channelId: Long? = null, - ) - - @Serializable - data class ExtRoleInfo( - @ProtoNumber(1) val id: Long? = null, - @ProtoNumber(2) val info: ByteArray? = null, - @ProtoNumber(3) val flag: Int? = null, - ) - } -} \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/TextMsg.kt b/protobuf/src/main/java/protobuf/message/element/TextMsg.kt new file mode 100644 index 00000000..b16405e7 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/TextMsg.kt @@ -0,0 +1,14 @@ +package protobuf.message.element + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber + +@Serializable +data class TextMsg( + @ProtoNumber(1) val str: String? = null, + @ProtoNumber(2) val link: String? = null, + @ProtoNumber(3) val attr6Buf: ByteArray? = null, + @ProtoNumber(4) val attr7Buf: ByteArray? = null, + @ProtoNumber(11) val buf: ByteArray? = null, + @ProtoNumber(12) val pbReserve: ByteArray? = null, +) \ No newline at end of file diff --git a/protobuf/src/main/java/protobuf/message/element/commelem/ButtonExtra.kt b/protobuf/src/main/java/protobuf/message/element/commelem/ButtonExtra.kt new file mode 100644 index 00000000..e9fce5c8 --- /dev/null +++ b/protobuf/src/main/java/protobuf/message/element/commelem/ButtonExtra.kt @@ -0,0 +1,53 @@ +package protobuf.message.element.commelem + +import kotlinx.serialization.Serializable +import kotlinx.serialization.protobuf.ProtoNumber +import moe.fuqiuluo.symbols.Protobuf + + +@Serializable +data class ButtonExtra( + @ProtoNumber(1) val field1: Object1? = null, +) : Protobuf + +@Serializable +data class Object1( + @ProtoNumber(1) val rows: List? = null, + @ProtoNumber(2) val appid: Int? = null, +) + +@Serializable +data class Row( + @ProtoNumber(1) val buttons: List