This commit is contained in:
Him188 2020-02-10 13:54:21 +08:00
parent 644842e191
commit ec82232aa3
5 changed files with 8 additions and 3 deletions

View File

@ -118,7 +118,7 @@ internal class OnlinePush {
}
}
34 -> {
var groupUinorCode = readUInt().toLong()
var groupUinOrCode = readUInt().toLong()
if (readByte().toInt() == 1) {
val target = readUInt().toLong()
val groupUin = content.fromUin

View File

@ -7,6 +7,8 @@
* https://github.com/mamoe/mirai/blob/master/LICENSE
*/
@file:Suppress("DEPRECATION")
package androidPacketTests
import net.mamoe.mirai.utils.cryptor.decryptBy
@ -24,6 +26,7 @@ fun ByteArray.decryptBy16Zero() = this.decryptBy(ByteArray(16))
fun ByteArray.dropTCPHead(): ByteArray = this.drop(16 * 3 + 6).toByteArray()
@Suppress("LocalVariableName")
fun loadPrivateKey(s: String): ECPrivateKey {
fun fromHex(
hex: String

View File

@ -258,6 +258,7 @@ fun String.generateProtoBufDataClass(): GeneratedClass {
}
fun adjustPropertyName(_name: String): String {
@Suppress("NAME_SHADOWING")
var name = _name
when {
name.startsWith("str") -> {

View File

@ -26,7 +26,7 @@ import java.util.zip.Inflater
/**
* Ktor HttpClient. 不同平台使用不同引擎.
*/
@KtorExperimentalAPI
@UseExperimental(KtorExperimentalAPI::class)
actual val Http: HttpClient
get() = HttpClient(CIO)

View File

@ -11,6 +11,7 @@ package net.mamoe.mirai.japt.internal
import kotlinx.coroutines.runBlocking
import kotlinx.io.core.ByteReadPacket
import kotlinx.io.core.readBytes
import net.mamoe.mirai.Bot
import net.mamoe.mirai.BotAccount
import net.mamoe.mirai.data.AddFriendResult
@ -39,7 +40,7 @@ internal class BlockingBotImpl(private val bot: Bot) : BlockingBot {
override fun getGroup(id: Long): BlockingGroup = runBlocking { bot.getGroup(id).blocking() }
override fun getNetwork(): BotNetworkHandler = bot.network
override fun login() = runBlocking { bot.login() }
override fun downloadAsByteArray(image: Image): ByteArray = bot.run { runBlocking { image.downloadAsByteArray() } }
override fun downloadAsByteArray(image: Image): ByteArray = bot.run { runBlocking { image.download().readBytes() } }
override fun download(image: Image): ByteReadPacket = bot.run { runBlocking { image.download() } }
override fun addFriend(id: Long, message: String?, remark: String?): AddFriendResult = runBlocking { bot.addFriend(id, message, remark) }
override fun approveFriendAddRequest(id: Long, remark: String?) = runBlocking { bot.approveFriendAddRequest(id, remark) }