diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/OnlinePushPack.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/OnlinePushPack.kt new file mode 100644 index 000000000..770eb0bb6 --- /dev/null +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/data/jce/OnlinePushPack.kt @@ -0,0 +1,87 @@ +package net.mamoe.mirai.qqandroid.network.protocol.data.jce + +import kotlinx.serialization.SerialId +import kotlinx.serialization.Serializable +import net.mamoe.mirai.qqandroid.io.JceStruct + +class OnlinePushPack { + @Serializable + internal class DelMsgInfo( + @SerialId(0) val fromUin: Long, + @SerialId(1) val uMsgTime: Long, + @SerialId(2) val shMsgSeq: Short, + @SerialId(3) val vMsgCookies: ByteArray? = null, + @SerialId(4) val wCmd: Short? = null, + @SerialId(5) val uMsgType: Long? = null, + @SerialId(6) val uAppId: Long? = null, + @SerialId(7) val sendTime: Long? = null, + @SerialId(8) val ssoSeq: Int? = null, + @SerialId(9) val ssoIp: Int? = null, + @SerialId(10) val clientIp: Int? = null + ) : JceStruct + + @Serializable + internal class DeviceInfo( + @SerialId(0) val netType: Byte? = null, + @SerialId(1) val devType: String? = "", + @SerialId(2) val oSVer: String? = "", + @SerialId(3) val vendorName: String? = "", + @SerialId(4) val vendorOSName: String? = "", + @SerialId(5) val iOSIdfa: String? = "" + ) : JceStruct + + @Serializable + internal class Name( + @SerialId(0) val fromUin: Long, + @SerialId(1) val uMsgTime: Long, + @SerialId(2) val shMsgType: Short, + @SerialId(3) val shMsgSeq: Short, + @SerialId(4) val msg: String = "", + @SerialId(5) val uRealMsgTime: Int? = null, + @SerialId(6) val vMsg: ByteArray? = null, + @SerialId(7) val uAppShareID: Long? = null, + @SerialId(8) val vMsgCookies: ByteArray? = null, + @SerialId(9) val vAppShareCookie: ByteArray? = null, + @SerialId(10) val msgUid: Long? = null, + @SerialId(11) val lastChangeTime: Long? = 1L, + @SerialId(12) val vCPicInfo: List? = null, + @SerialId(13) val stShareData: ShareData? = null, + @SerialId(14) val fromInstId: Long? = null, + @SerialId(15) val vRemarkOfSender: ByteArray? = null, + @SerialId(16) val fromMobile: String? = "", + @SerialId(17) val fromName: String? = "", + @SerialId(18) val vNickName: List? = null, + @SerialId(19) val stC2CTmpMsgHead: TempMsgHead? = null + ) : JceStruct + + @Serializable + internal class SvcReqPushMsg( + @SerialId(0) val uin: Long, + @SerialId(1) val uMsgTime: Long, + @SerialId(2) val vMsgInfos: List, + @SerialId(3) val svrip: Int? = 0, + @SerialId(4) val vSyncCookie: ByteArray? = null, + @SerialId(5) val vUinPairMsg: List? = null, + @SerialId(6) val mPreviews: Map? = null, + @SerialId(7) val wUserActive: Int? = null, + @SerialId(12) val wGeneralFlag: Int? = null + ) : JceStruct + + @Serializable + internal class SvcRespPushMsg( + @SerialId(0) val uin: Long, + @SerialId(1) val vDelInfos: List, + @SerialId(2) val svrip: Int, + @SerialId(3) val pushToken: ByteArray? = null, + @SerialId(4) val serviceType: Int? = null, + @SerialId(5) val deviceInfo: DeviceInfo? = null + ) : JceStruct + + @Serializable + internal class UinPairMsg( + @SerialId(1) val uLastReadTime: Long? = null, + @SerialId(2) val peerUin: Long? = null, + @SerialId(3) val uMsgCompleted: Long? = null, + @SerialId(4) val vMsgInfos: List? = null + ) : JceStruct +} \ No newline at end of file diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt index 68f0cc9e6..cfd3fb275 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.kt @@ -4,16 +4,21 @@ package net.mamoe.mirai.qqandroid.network.protocol.packet.chat.receive import kotlinx.io.core.ByteReadPacket import net.mamoe.mirai.contact.MemberPermission +import net.mamoe.mirai.data.NoPakcet import net.mamoe.mirai.data.Packet import net.mamoe.mirai.event.broadcast import net.mamoe.mirai.message.GroupMessage import net.mamoe.mirai.qqandroid.QQAndroidBot +import net.mamoe.mirai.qqandroid.io.serialization.decodeUniPacket import net.mamoe.mirai.qqandroid.io.serialization.readProtoBuf +import net.mamoe.mirai.qqandroid.network.protocol.data.jce.MsgInfo +import net.mamoe.mirai.qqandroid.network.protocol.data.jce.OnlinePushPack import net.mamoe.mirai.qqandroid.network.protocol.data.proto.ImMsgBody import net.mamoe.mirai.qqandroid.network.protocol.data.proto.MsgOnlinePush import net.mamoe.mirai.qqandroid.network.protocol.packet.IncomingPacketFactory import net.mamoe.mirai.qqandroid.network.protocol.packet.OutgoingPacket import net.mamoe.mirai.qqandroid.utils.toMessageChain +import net.mamoe.mirai.utils.cryptor.contentToString internal inline class GroupMessageOrNull(val delegate: GroupMessage?) : Packet { override fun toString(): String { @@ -70,4 +75,21 @@ internal class OnlinePush { return null } } + + internal object ReqPush : IncomingPacketFactory("OnlinePush.ReqPush") { + @UseExperimental(ExperimentalStdlibApi::class) + override suspend fun ByteReadPacket.decode(bot: QQAndroidBot, sequenceId: Int): Packet { + val reqPushMsg = decodeUniPacket(OnlinePushPack.SvcReqPushMsg.serializer(), "req") + reqPushMsg.vMsgInfos.forEach { msgInfo: MsgInfo -> + + } + println(reqPushMsg.contentToString()) + return NoPakcet + } + + + override suspend fun QQAndroidBot.handle(packet: Packet, sequenceId: Int): OutgoingPacket? { + return null + } + } } \ No newline at end of file