From 012ecaa85d4f39e7d09d5f7572049258c1097d24 Mon Sep 17 00:00:00 2001 From: fuqiuluo Date: Mon, 8 Jul 2024 08:55:49 +0800 Subject: [PATCH] fix #335 --- README.md | 2 + .../shamrock/ui/fragment/DashboardFragment.kt | 4 +- .../src/main/java/protobuf/oidb/TrpcOidb.kt | 4 +- .../main/java/kritor/service/FriendService.kt | 4 +- .../main/java/kritor/service/GroupService.kt | 12 ++--- .../java/kritor/service/MessageService.kt | 6 +-- .../internals/GlobalEventTransmitter.kt | 52 +++++++++---------- .../java/qq/service/bdh/NtV2RichMediaSvc.kt | 22 ++++++-- .../java/qq/service/file/GroupFileHelper.kt | 8 +-- .../main/java/qq/service/msg/MsgConvertor.kt | 4 +- .../java/qq/service/msg/MultiConvertor.kt | 4 +- .../java/qq/service/msg/NtMsgConvertor.kt | 6 +-- .../qq/service/msg/ReqMessageConvertor.kt | 4 +- .../java/qq/service/msg/ReqMultiConvertor.kt | 4 +- 14 files changed, 78 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index f34bedf..2c4b822 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,8 @@ > Riru可能导致封禁,请减少使用。 > 如有违反法律,请联系删除。 > 请勿在任何平台宣传,宣扬,转发本项目,请勿恶意修改企业安装包造成相关企业产生损失,如有违背,必将追责到底。 +> +> 社区地址:[discord](https://discord.gg/MKR2wz863h) ## 兼容|迁移|替代 说明 diff --git a/app/src/main/java/moe/fuqiuluo/shamrock/ui/fragment/DashboardFragment.kt b/app/src/main/java/moe/fuqiuluo/shamrock/ui/fragment/DashboardFragment.kt index 2b3bfa2..efd39c7 100644 --- a/app/src/main/java/moe/fuqiuluo/shamrock/ui/fragment/DashboardFragment.kt +++ b/app/src/main/java/moe/fuqiuluo/shamrock/ui/fragment/DashboardFragment.kt @@ -162,7 +162,7 @@ private fun FunctionCard( Function( title = "主动RPC", - desc = "Kritor协议实现RPC", + desc = "Kritor协议实现RPC,由Shamrock放出rpc服务", isSwitch = ShamrockConfig[ctx, ActiveRPC] ) { ShamrockConfig[ctx, ActiveRPC] = it @@ -171,7 +171,7 @@ private fun FunctionCard( Function( title = "被动RPC", - desc = "Kritor协议实现RPC", + desc = "Kritor协议实现RPC,由客户端提供反向的rpc服务", isSwitch = ShamrockConfig[ctx, PassiveRPC] ) { ShamrockConfig[ctx, PassiveRPC] = it diff --git a/protobuf/src/main/java/protobuf/oidb/TrpcOidb.kt b/protobuf/src/main/java/protobuf/oidb/TrpcOidb.kt index d182ef4..765ccce 100644 --- a/protobuf/src/main/java/protobuf/oidb/TrpcOidb.kt +++ b/protobuf/src/main/java/protobuf/oidb/TrpcOidb.kt @@ -8,7 +8,9 @@ import moe.fuqiuluo.symbols.Protobuf data class TrpcOidb( @ProtoNumber(1) val cmd: Int = Int.MIN_VALUE, @ProtoNumber(2) val service: Int = Int.MIN_VALUE, - @ProtoNumber(4) val buffer: ByteArray, + @ProtoNumber(3) val result: UInt? = null, + @ProtoNumber(4) val buffer: ByteArray? = null, + @ProtoNumber(5) val msg: String? = null, //@ProtoNumber(11) val traceParams: Map = mapOf(), @ProtoNumber(12) val flag: Int = Int.MIN_VALUE, ): Protobuf \ No newline at end of file diff --git a/xposed/src/main/java/kritor/service/FriendService.kt b/xposed/src/main/java/kritor/service/FriendService.kt index c5512e8..1e750df 100644 --- a/xposed/src/main/java/kritor/service/FriendService.kt +++ b/xposed/src/main/java/kritor/service/FriendService.kt @@ -156,8 +156,8 @@ internal object FriendService : FriendServiceGrpcKt.FriendServiceCoroutineImplBa val bundle = Bundle() val service = QQInterfaces.app .getRuntimeService(IProfileProtocolService::class.java, "all") - if (request.hasNickName()) { - bundle.putString(IProfileProtocolConst.KEY_NICK, request.nickName) + if (request.hasNick()) { + bundle.putString(IProfileProtocolConst.KEY_NICK, request.nick) } if (request.hasCompany()) { bundle.putString(IProfileProtocolConst.KEY_COMPANY, request.company) diff --git a/xposed/src/main/java/kritor/service/GroupService.kt b/xposed/src/main/java/kritor/service/GroupService.kt index 7f12461..2e3c375 100644 --- a/xposed/src/main/java/kritor/service/GroupService.kt +++ b/xposed/src/main/java/kritor/service/GroupService.kt @@ -259,12 +259,12 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase( .ifNullOrEmpty { memberInfo.friendnick } ?: "" age = memberInfo.age.toInt() uniqueTitle = memberInfo.mUniqueTitle ?: "" - uniqueTitleExpireTime = memberInfo.mUniqueTitleExpire + uniqueTitleExpireTime = memberInfo.mUniqueTitleExpire.toLong() card = memberInfo.troopnick.ifNullOrEmpty { memberInfo.friendnick } ?: "" joinTime = memberInfo.join_time lastActiveTime = memberInfo.last_active_time level = memberInfo.level - shutUpTimestamp = memberInfo.gagTimeStamp + shutUpTime = memberInfo.gagTimeStamp distance = memberInfo.distance addAllHonors((memberInfo.honorList ?: "") @@ -295,12 +295,12 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase( nick = memberInfo.nick ?: "" age = 0 uniqueTitle = memberInfo.memberSpecialTitle ?: "" - uniqueTitleExpireTime = memberInfo.specialTitleExpireTime.toInt() + uniqueTitleExpireTime = memberInfo.specialTitleExpireTime card = memberInfo.cardName.ifNullOrEmpty { memberInfo.nick } ?: "" joinTime = memberInfo.joinTime.toLong() lastActiveTime = memberInfo.lastSpeakTime.toLong() level = memberInfo.memberLevel - shutUpTimestamp = memberInfo.shutUpTime.toLong() + shutUpTime = memberInfo.shutUpTime.toLong() distance = 0 addAllHonors(memberInfo.groupHonor.let { bytes -> @@ -327,7 +327,7 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase( this.addProhibitedUsersInfo(ProhibitedUserInfo.newBuilder().apply { uid = ContactHelper.getUidByUinAsync(it.memberUin) uin = it.memberUin - prohibitedTime = it.shutuptimestap + prohibitedTime = it.shutuptimestap.toLong() }) } }.build() @@ -360,7 +360,7 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase( maxMemberCount = groupInfo.maxMember memberCount = groupInfo.memberCount groupDesc = groupInfo.groupDesc - createTime = groupInfo.createTime.toInt() + createTime = groupInfo.createTime groupFlag = groupInfo.groupFlag groupFlagExt = groupInfo.groupFlagExt }.build() diff --git a/xposed/src/main/java/kritor/service/MessageService.kt b/xposed/src/main/java/kritor/service/MessageService.kt index 3fde248..3aff295 100644 --- a/xposed/src/main/java/kritor/service/MessageService.kt +++ b/xposed/src/main/java/kritor/service/MessageService.kt @@ -315,7 +315,7 @@ internal object MessageService : MessageServiceGrpcKt.MessageServiceCoroutineImp throw StatusRuntimeException(Status.INTERNAL.withCause(it)) }.getOrThrow().map { detail -> PushMessageBody.newBuilder().apply { - this.time = detail.time + this.time = detail.time.toLong() this.messageId = detail.qqMsgId.toString() this.messageSeq = detail.msgSeq this.contact = io.kritor.common.Contact.newBuilder().apply { @@ -398,10 +398,10 @@ internal object MessageService : MessageServiceGrpcKt.MessageServiceCoroutineImp this.messageId = it.msgId.toString() } this.messageSeq = it.messageSeq - this.messageTime = it.senderTime.toInt() + this.messageTime = it.senderTime this.senderNick = it.senderNick this.senderUin = it.senderId - this.operationTime = it.operatorTime.toInt() + this.operationTime = it.operatorTime this.operatorNick = it.operatorNick this.operatorUin = it.operatorId this.jsonElements = it.messageContent.toString() diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt index 073fd0e..fab056a 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/internals/GlobalEventTransmitter.kt @@ -42,7 +42,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { elements: ArrayList, ): Boolean { transMessageEvent(record, PushMessageBody.newBuilder().apply { - this.time = record.msgTime.toInt() + this.time = record.msgTime this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { @@ -65,7 +65,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { elements: ArrayList, ): Boolean { transMessageEvent(record, PushMessageBody.newBuilder().apply { - this.time = record.msgTime.toInt() + this.time = record.msgTime this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { @@ -90,7 +90,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { fromNick: String, ): Boolean { transMessageEvent(record, PushMessageBody.newBuilder().apply { - this.time = record.msgTime.toInt() + this.time = record.msgTime this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { @@ -113,7 +113,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { elements: ArrayList, ): Boolean { transMessageEvent(record, PushMessageBody.newBuilder().apply { - this.time = record.msgTime.toInt() + this.time = record.msgTime this.messageId = record.msgId.toString() this.messageSeq = record.msgSeq this.contact = Contact.newBuilder().apply { @@ -152,16 +152,16 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.PRIVATE_FILE_UPLOADED - this.time = msgTime.toInt() + this.time = msgTime this.privateFileUploaded = PrivateFileUploadedNotice.newBuilder().apply { this.fileId = fileId this.fileName = fileName this.operatorUid = senderUid this.operatorUin = senderUin this.fileSize = fileSize - this.expireTime = expireTime.toInt() - this.fileSubId = fileSubId - this.url = url + this.expireTime = expireTime + this.fileSubId = fileSubId.toInt() // todo(这玩意真的是一个数字?) + this.fileUrl = url }.build() }.build()) return true @@ -183,7 +183,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_FILE_UPLOADED - this.time = msgTime.toInt() + this.time = msgTime this.groupFileUploaded = GroupFileUploadedNotice.newBuilder().apply { this.groupId = groupId this.operatorUid = senderUid @@ -191,7 +191,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { this.fileId = uuid this.fileName = fileName this.fileSize = fileSize - this.busId = bizId + this.fileSubId = bizId this.fileUrl = url }.build() }.build()) @@ -212,7 +212,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_SIGN_IN - this.time = time.toInt() + this.time = time this.groupSignIn = GroupSignInNotice.newBuilder().apply { this.groupId = groupCode this.targetUid = ContactHelper.getUidByUinAsync(target) @@ -235,7 +235,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_POKE - this.time = time.toInt() + this.time = time this.groupPoke = GroupPokeNotice.newBuilder().apply { this.groupId = groupCode this.action = action @@ -261,7 +261,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_MEMBER_INCREASE - this.time = time.toInt() + this.time = time this.groupMemberIncrease = GroupMemberIncreasedNotice.newBuilder().apply { this.groupId = groupCode this.operatorUid = operatorUid @@ -285,7 +285,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_MEMBER_DECREASE - this.time = time.toInt() + this.time = time this.groupMemberDecrease = GroupMemberDecreasedNotice.newBuilder().apply { this.groupId = groupCode this.operatorUid = operatorUid @@ -307,7 +307,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_ADMIN_CHANGED - this.time = msgTime.toInt() + this.time = msgTime this.groupAdminChanged = GroupAdminChangedNotice.newBuilder().apply { this.groupId = groupCode this.targetUid = targetUid @@ -327,7 +327,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_WHOLE_BAN - this.time = msgTime.toInt() + this.time = msgTime this.groupWholeBan = GroupWholeBanNotice.newBuilder().apply { this.groupId = groupCode this.isBan = isOpen @@ -349,7 +349,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_MEMBER_BAN - this.time = msgTime.toInt() + this.time = msgTime this.groupMemberBan = GroupMemberBanNotice.newBuilder().apply { this.groupId = groupCode this.operatorUid = operatorUid @@ -376,7 +376,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_RECALL - this.time = time.toInt() + this.time = time this.groupRecall = GroupRecallNotice.newBuilder().apply { this.groupId = groupCode this.operatorUid = operatorUid @@ -398,7 +398,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_CARD_CHANGED - this.time = time.toInt() + this.time = time this.groupCardChanged = GroupCardChangedNotice.newBuilder().apply { this.groupId = groupId this.targetUin = targetId @@ -416,7 +416,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_MEMBER_UNIQUE_TITLE_CHANGED - this.time = time.toInt() + this.time = time this.groupMemberUniqueTitleChanged = GroupUniqueTitleChangedNotice.newBuilder().apply { this.groupId = groupId this.targetUid = ContactHelper.getUidByUinAsync(targetUin) @@ -437,7 +437,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.GROUP_ESSENCE_CHANGED - this.time = time.toInt() + this.time = time this.groupEssenceChanged = GroupEssenceMessageNotice.newBuilder().apply { this.groupId = groupId this.messageId = msgId.toString() @@ -465,7 +465,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.PRIVATE_POKE - this.time = msgTime.toInt() + this.time = msgTime this.privatePoke = PrivatePokeNotice.newBuilder().apply { this.action = action ?: "" this.operatorUid = ContactHelper.getUidByUinAsync(operator) @@ -480,7 +480,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { suspend fun transPrivateRecall(time: Long, operator: Long, msgId: Long, tipText: String): Boolean { pushNotice(NoticeEvent.newBuilder().apply { this.type = NoticeEvent.NoticeType.PRIVATE_RECALL - this.time = time.toInt() + this.time = time this.privateRecall = PrivateRecallNotice.newBuilder().apply { this.operatorUin = operator this.messageId = msgId.toString() @@ -499,7 +499,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { suspend fun transFriendApp(time: Long, applierUid: String, operator: Long, tipText: String, flag: String): Boolean { pushRequest(RequestEvent.newBuilder().apply { this.type = RequestEvent.RequestType.FRIEND_APPLY - this.time = time.toInt() + this.time = time this.requestId = flag this.friendApply = FriendApplyRequest.newBuilder().apply { this.applierUid = applierUid @@ -520,7 +520,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushRequest(RequestEvent.newBuilder().apply { this.type = RequestEvent.RequestType.GROUP_APPLY - this.time = time.toInt() + this.time = time this.requestId = flag this.groupApply = GroupApplyRequest.newBuilder().apply { this.applierUid = applierUid @@ -541,7 +541,7 @@ internal object GlobalEventTransmitter : QQInterfaces() { ): Boolean { pushRequest(RequestEvent.newBuilder().apply { this.type = RequestEvent.RequestType.GROUP_APPLY - this.time = time.toInt() + this.time = time this.requestId = flag this.invitedGroup = InvitedJoinGroupRequest.newBuilder().apply { this.inviterUid = inviterUid diff --git a/xposed/src/main/java/qq/service/bdh/NtV2RichMediaSvc.kt b/xposed/src/main/java/qq/service/bdh/NtV2RichMediaSvc.kt index a974a47..91e961e 100644 --- a/xposed/src/main/java/qq/service/bdh/NtV2RichMediaSvc.kt +++ b/xposed/src/main/java/qq/service/bdh/NtV2RichMediaSvc.kt @@ -355,7 +355,16 @@ internal object NtV2RichMediaSvc: QQInterfaces() { if (fromServiceMsg == null || fromServiceMsg.wupBuffer == null) { return Result.failure(Exception("unable to get multimedia pic info: ${fromServiceMsg?.wupBuffer}")) } - fromServiceMsg.wupBuffer.decodeProtobuf().buffer.decodeProtobuf().download?.rkeyParam?.let { + val trpc = kotlin.runCatching { + fromServiceMsg.wupBuffer.decodeProtobuf() + }.getOrElse { + fromServiceMsg.wupBuffer.slice(4).decodeProtobuf() + } + if (trpc.buffer == null) { + return Result.failure(Exception("unable to get multimedia pic info: ${trpc.msg}")) + } + + trpc.buffer?.decodeProtobuf()?.download?.rkeyParam?.let { return Result.success(it) } }.onFailure { @@ -448,8 +457,15 @@ internal object NtV2RichMediaSvc: QQInterfaces() { if (fromServiceMsg == null || fromServiceMsg.wupBuffer == null) { return Result.failure(Exception("unable to request upload nt pic")) } - val rspBuffer = fromServiceMsg.wupBuffer.decodeProtobuf().buffer - val rsp = rspBuffer.decodeProtobuf() + val trpc = kotlin.runCatching { + fromServiceMsg.wupBuffer.decodeProtobuf() + }.getOrElse { + fromServiceMsg.wupBuffer.slice(4).decodeProtobuf() + } + if (trpc.buffer == null) { + return Result.failure(Exception("unable to request upload nt pic: ${trpc.msg}")) + } + val rsp = trpc.buffer!!.decodeProtobuf() if (rsp.upload == null) { return Result.failure(Exception("unable to request upload nt pic: ${rsp.head}")) } diff --git a/xposed/src/main/java/qq/service/file/GroupFileHelper.kt b/xposed/src/main/java/qq/service/file/GroupFileHelper.kt index e919878..5f5642e 100644 --- a/xposed/src/main/java/qq/service/file/GroupFileHelper.kt +++ b/xposed/src/main/java/qq/service/file/GroupFileHelper.kt @@ -116,9 +116,9 @@ internal object GroupFileHelper: QQInterfaces() { this.fileName = fileInfo.str_file_name.get() this.fileSize = fileInfo.uint64_file_size.get() this.busId = fileInfo.uint32_bus_id.get() - this.uploadTime = fileInfo.uint32_upload_time.get() - this.expireTime = fileInfo.uint32_dead_time.get() - this.modifyTime = fileInfo.uint32_modify_time.get() + this.uploadTime = fileInfo.uint32_upload_time.get().toLong() + this.expireTime = fileInfo.uint32_dead_time.get().toLong() + this.modifyTime = fileInfo.uint32_modify_time.get().toLong() this.downloadTimes = fileInfo.uint32_download_times.get() this.uploader = fileInfo.uint64_uploader_uin.get() this.uploaderName = fileInfo.str_uploader_name.get() @@ -133,7 +133,7 @@ internal object GroupFileHelper: QQInterfaces() { this.folderId = folderInfo.str_folder_id.get() this.folderName = folderInfo.str_folder_name.get() this.totalFileCount = folderInfo.uint32_total_file_count.get() - this.createTime = folderInfo.uint32_create_time.get() + this.createTime = folderInfo.uint32_create_time.get().toLong() this.creator = folderInfo.uint64_create_uin.get() this.creatorName = folderInfo.str_creator_name.get() }.build()) diff --git a/xposed/src/main/java/qq/service/msg/MsgConvertor.kt b/xposed/src/main/java/qq/service/msg/MsgConvertor.kt index 0800b86..fbc2ac9 100644 --- a/xposed/src/main/java/qq/service/msg/MsgConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/MsgConvertor.kt @@ -78,7 +78,7 @@ private object MsgConvertor { elem.type = ElementType.POKE elem.setPoke(PokeElement.newBuilder().apply { this.id = face.vaspokeId - this.type = face.pokeType + this.pokeType = face.pokeType this.strength = face.pokeStrength }) } else { @@ -195,7 +195,7 @@ private object MsgConvertor { else -> throw UnsupportedOperationException("Not supported chat type: ${record.chatType}") } - this.type = + this.fileType = if (image.isFlashPic == true) ImageElement.ImageType.FLASH else if (image.original) ImageElement.ImageType.ORIGIN else ImageElement.ImageType.COMMON this.subType = image.picSubType }) diff --git a/xposed/src/main/java/qq/service/msg/MultiConvertor.kt b/xposed/src/main/java/qq/service/msg/MultiConvertor.kt index aa50eb2..43bb8f0 100644 --- a/xposed/src/main/java/qq/service/msg/MultiConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/MultiConvertor.kt @@ -65,7 +65,7 @@ suspend fun List.toKritorResponseMessages(contact: Contact): ArrayList RichProtoSvc.getGroupPicDownUrl( origUrl, @@ -85,7 +85,7 @@ suspend fun List.toKritorResponseMessages(contact: Contact): ArrayList RichProtoSvc.getGroupPicDownUrl( origUrl, diff --git a/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt b/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt index df24391..fac55ca 100644 --- a/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/NtMsgConvertor.kt @@ -254,8 +254,8 @@ object NtMsgConvertor { } private suspend fun imageConvertor(contact: Contact, msgId: Long, sourceImage: Element): Result { - val isOriginal = sourceImage.image.type == ImageType.ORIGIN - val isFlash = sourceImage.image.type == ImageType.FLASH + val isOriginal = sourceImage.image.fileType == ImageType.ORIGIN + val isFlash = sourceImage.image.fileType == ImageType.FLASH val file = when (sourceImage.image.dataCase!!) { ImageElement.DataCase.FILE_NAME -> { val fileMd5 = sourceImage.image.fileName.replace(regex = "[{}\\-]".toRegex(), replacement = "") @@ -638,7 +638,7 @@ object NtMsgConvertor { face.faceText = "" face.faceType = 5 face.packId = null - face.pokeType = sourcePoke.poke.type + face.pokeType = sourcePoke.poke.pokeType face.spokeSummary = "" face.doubleHit = 0 face.vaspokeId = sourcePoke.poke.id diff --git a/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt b/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt index 8754e44..108bdd0 100644 --- a/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/ReqMessageConvertor.kt @@ -73,7 +73,7 @@ private object ReqMsgConvertor { if (face.faceType == 5) { elem.setPoke(PokeElement.newBuilder().apply { this.id = face.vaspokeId - this.type = face.pokeType + this.pokeType = face.pokeType this.strength = face.pokeStrength }) } else { @@ -174,7 +174,7 @@ private object ReqMsgConvertor { else -> throw UnsupportedOperationException("Not supported chat type: ${contact.chatType}") } - this.type = + this.fileType = if (image.isFlashPic == true) ImageElement.ImageType.FLASH else if (image.original) ImageElement.ImageType.ORIGIN else ImageElement.ImageType.COMMON this.subType = image.picSubType }) diff --git a/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt b/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt index 8bad4f7..16f784c 100644 --- a/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt +++ b/xposed/src/main/java/qq/service/msg/ReqMultiConvertor.kt @@ -183,7 +183,7 @@ suspend fun List.toRichText(contact: Contact): Result { - val type = it.image.type + val type = it.image.fileType val isOriginal = type == ImageElement.ImageType.ORIGIN val file = when(it.image.dataCase!!) { ImageElement.DataCase.FILE_NAME -> { @@ -391,7 +391,7 @@ suspend fun List.toRichText(contact: Contact): Result