Commit d6822b7d authored by Him188's avatar Him188

QQA Debugging update

parent 5f16f23c
...@@ -110,12 +110,10 @@ internal inline fun PacketFactory<*>.buildOutgingPacket( ...@@ -110,12 +110,10 @@ internal inline fun PacketFactory<*>.buildOutgingPacket(
@UseExperimental(MiraiInternalAPI::class) @UseExperimental(MiraiInternalAPI::class)
internal inline fun PacketFactory<*>.buildLoginOutgoingPacket( internal inline fun PacketFactory<*>.buildLoginOutgoingPacket(
client: QQAndroidClient, client: QQAndroidClient,
subAppId: Long, bodyType: Byte,
bodyType: Byte, // login=2, uni=1
extraData: ByteArray = EMPTY_BYTE_ARRAY, extraData: ByteArray = EMPTY_BYTE_ARRAY,
name: String? = null, name: String? = null,
id: PacketId = this.id, id: PacketId = this.id,
ssoExtraData: ByteReadPacket = BRP_STUB,
key: ByteArray = KEY_16_ZEROS, key: ByteArray = KEY_16_ZEROS,
body: BytePacketBuilder.(sequenceId: Int) -> Unit body: BytePacketBuilder.(sequenceId: Int) -> Unit
): OutgoingPacket { ): OutgoingPacket {
......
...@@ -35,7 +35,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse>() { ...@@ -35,7 +35,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse>() {
@UseExperimental(MiraiInternalAPI::class) @UseExperimental(MiraiInternalAPI::class)
operator fun invoke( operator fun invoke(
client: QQAndroidClient client: QQAndroidClient
): OutgoingPacket = buildLoginOutgoingPacket(client, subAppId = subAppId, bodyType = 2) { sequenceId -> ): OutgoingPacket = buildLoginOutgoingPacket(client, bodyType = 2) { sequenceId ->
writeLoginSsoPacket(client, subAppId, id, sequenceId = sequenceId) { writeLoginSsoPacket(client, subAppId, id, sequenceId = sequenceId) {
writeOicqRequestPacket(client, EncryptMethodECDH7(client.ecdh), id) { writeOicqRequestPacket(client, EncryptMethodECDH7(client.ecdh), id) {
writeShort(9) // subCommand writeShort(9) // subCommand
......
...@@ -17,6 +17,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.writeLoginSsoPacket ...@@ -17,6 +17,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.writeLoginSsoPacket
import net.mamoe.mirai.qqandroid.utils.NetworkType import net.mamoe.mirai.qqandroid.utils.NetworkType
import net.mamoe.mirai.utils.currentTimeSeconds import net.mamoe.mirai.utils.currentTimeSeconds
import net.mamoe.mirai.utils.io.encodeToString import net.mamoe.mirai.utils.io.encodeToString
import net.mamoe.mirai.utils.io.toReadPacket
@Suppress("EnumEntryName") @Suppress("EnumEntryName")
enum class RegPushReason { enum class RegPushReason {
...@@ -48,10 +49,12 @@ internal object SvcReqRegisterPacket : PacketFactory<SvcReqRegisterPacket.Respon ...@@ -48,10 +49,12 @@ internal object SvcReqRegisterPacket : PacketFactory<SvcReqRegisterPacket.Respon
client, client,
bodyType = 1, bodyType = 1,
extraData = client.wLoginSigInfo.d2.data, extraData = client.wLoginSigInfo.d2.data,
key = client.wLoginSigInfo.d2Key, key = client.wLoginSigInfo.d2Key
subAppId = subAppId
) { sequenceId -> ) { sequenceId ->
writeLoginSsoPacket(client, subAppId= subAppId, packetId = id, sequenceId = sequenceId){ writeLoginSsoPacket(
client, subAppId = subAppId, packetId = id,
extraData = client.wLoginSigInfo.tgt.toReadPacket(), sequenceId = sequenceId
) {
writeUniRequestPacket { writeUniRequestPacket {
sServantName = "PushService" sServantName = "PushService"
sFuncName = "SvcReqRegister" sFuncName = "SvcReqRegister"
......
...@@ -6,7 +6,6 @@ import net.mamoe.mirai.data.Packet ...@@ -6,7 +6,6 @@ import net.mamoe.mirai.data.Packet
import net.mamoe.mirai.qqandroid.QQAndroidBot import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.network.QQAndroidClient import net.mamoe.mirai.qqandroid.network.QQAndroidClient
import net.mamoe.mirai.qqandroid.network.protocol.packet.* import net.mamoe.mirai.qqandroid.network.protocol.packet.*
import net.mamoe.mirai.utils.io.toReadPacket
internal object TransEmpPacket : PacketFactory<TransEmpPacket.Response>() { internal object TransEmpPacket : PacketFactory<TransEmpPacket.Response>() {
...@@ -20,7 +19,7 @@ internal object TransEmpPacket : PacketFactory<TransEmpPacket.Response>() { ...@@ -20,7 +19,7 @@ internal object TransEmpPacket : PacketFactory<TransEmpPacket.Response>() {
@Suppress("FunctionName") @Suppress("FunctionName")
fun SubCommand1( fun SubCommand1(
client: QQAndroidClient client: QQAndroidClient
): OutgoingPacket = buildLoginOutgoingPacket(client, bodyType = 2, subAppId = subAppId, ssoExtraData = byteArrayOf().toReadPacket()) { ): OutgoingPacket = buildLoginOutgoingPacket(client, bodyType = 2) {
writeOicqRequestPacket(client, EncryptMethodECDH135(client.ecdh), id) { writeOicqRequestPacket(client, EncryptMethodECDH135(client.ecdh), id) {
// oicq.wlogin_sdk.request.trans_emp_1#packTransEmpBody // oicq.wlogin_sdk.request.trans_emp_1#packTransEmpBody
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment