Commit d6822b7d authored by Him188's avatar Him188

QQA Debugging update

parent 5f16f23c
......@@ -110,12 +110,10 @@ internal inline fun PacketFactory<*>.buildOutgingPacket(
@UseExperimental(MiraiInternalAPI::class)
internal inline fun PacketFactory<*>.buildLoginOutgoingPacket(
client: QQAndroidClient,
subAppId: Long,
bodyType: Byte, // login=2, uni=1
bodyType: Byte,
extraData: ByteArray = EMPTY_BYTE_ARRAY,
name: String? = null,
id: PacketId = this.id,
ssoExtraData: ByteReadPacket = BRP_STUB,
key: ByteArray = KEY_16_ZEROS,
body: BytePacketBuilder.(sequenceId: Int) -> Unit
): OutgoingPacket {
......
......@@ -35,7 +35,7 @@ internal object LoginPacket : PacketFactory<LoginPacket.LoginPacketResponse>() {
@UseExperimental(MiraiInternalAPI::class)
operator fun invoke(
client: QQAndroidClient
): OutgoingPacket = buildLoginOutgoingPacket(client, subAppId = subAppId, bodyType = 2) { sequenceId ->
): OutgoingPacket = buildLoginOutgoingPacket(client, bodyType = 2) { sequenceId ->
writeLoginSsoPacket(client, subAppId, id, sequenceId = sequenceId) {
writeOicqRequestPacket(client, EncryptMethodECDH7(client.ecdh), id) {
writeShort(9) // subCommand
......
......@@ -17,6 +17,7 @@ import net.mamoe.mirai.qqandroid.network.protocol.packet.writeLoginSsoPacket
import net.mamoe.mirai.qqandroid.utils.NetworkType
import net.mamoe.mirai.utils.currentTimeSeconds
import net.mamoe.mirai.utils.io.encodeToString
import net.mamoe.mirai.utils.io.toReadPacket
@Suppress("EnumEntryName")
enum class RegPushReason {
......@@ -48,10 +49,12 @@ internal object SvcReqRegisterPacket : PacketFactory<SvcReqRegisterPacket.Respon
client,
bodyType = 1,
extraData = client.wLoginSigInfo.d2.data,
key = client.wLoginSigInfo.d2Key,
subAppId = subAppId
key = client.wLoginSigInfo.d2Key
) { sequenceId ->
writeLoginSsoPacket(client, subAppId= subAppId, packetId = id, sequenceId = sequenceId){
writeLoginSsoPacket(
client, subAppId = subAppId, packetId = id,
extraData = client.wLoginSigInfo.tgt.toReadPacket(), sequenceId = sequenceId
) {
writeUniRequestPacket {
sServantName = "PushService"
sFuncName = "SvcReqRegister"
......
......@@ -6,7 +6,6 @@ import net.mamoe.mirai.data.Packet
import net.mamoe.mirai.qqandroid.QQAndroidBot
import net.mamoe.mirai.qqandroid.network.QQAndroidClient
import net.mamoe.mirai.qqandroid.network.protocol.packet.*
import net.mamoe.mirai.utils.io.toReadPacket
internal object TransEmpPacket : PacketFactory<TransEmpPacket.Response>() {
......@@ -20,7 +19,7 @@ internal object TransEmpPacket : PacketFactory<TransEmpPacket.Response>() {
@Suppress("FunctionName")
fun SubCommand1(
client: QQAndroidClient
): OutgoingPacket = buildLoginOutgoingPacket(client, bodyType = 2, subAppId = subAppId, ssoExtraData = byteArrayOf().toReadPacket()) {
): OutgoingPacket = buildLoginOutgoingPacket(client, bodyType = 2) {
writeOicqRequestPacket(client, EncryptMethodECDH135(client.ecdh), id) {
// 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