diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 7d342a7..d0443c5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -24,7 +24,7 @@ android { minSdk = 24 targetSdk = 33 versionCode = (System.currentTimeMillis() / 1000).toInt() - versionName = "1.0.5-dev" + gitCommitHash() + versionName = "1.0.6-dev" + gitCommitHash() testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -66,6 +66,7 @@ android { create("app") { dimension = "mode" ndk { + println("Full architecture and full compilation.") abiFilters.add("arm64-v8a") abiFilters.add("x86_64") } @@ -73,12 +74,14 @@ android { create("arm64") { dimension = "mode" ndk { + println("Full compilation of arm64 architecture") abiFilters.add("arm64-v8a") } } create("x64") { dimension = "mode" ndk { + println("Full compilation of x64 architecture") abiFilters.add("x86_64") } } diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GroupFileCommonResult.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GroupFileCommonResult.java index b449cf6..b5567a3 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GroupFileCommonResult.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GroupFileCommonResult.java @@ -1,7 +1,5 @@ package com.tencent.qqnt.kernel.nativeinterface; -/* compiled from: P */ -/* loaded from: classes2.dex */ public final class GroupFileCommonResult { String clientWording; int retCode; @@ -29,8 +27,6 @@ public final class GroupFileCommonResult { } public GroupFileCommonResult(int i2, String str, String str2) { - this.retMsg = ""; - this.clientWording = ""; this.retCode = i2; this.retMsg = str; this.clientWording = str2; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IDeleteGroupFileCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IDeleteGroupFileCallback.java index 5fefb93..210f3ba 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IDeleteGroupFileCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IDeleteGroupFileCallback.java @@ -1,5 +1,5 @@ package com.tencent.qqnt.kernel.nativeinterface; public interface IDeleteGroupFileCallback { - void onResult(int i2, String str, DeleteGroupFileResult deleteGroupFileResult); + void onResult(int code, String why, DeleteGroupFileResult result); } \ No newline at end of file diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelRichMediaService.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelRichMediaService.java index b43759c..7201af5 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelRichMediaService.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelRichMediaService.java @@ -9,7 +9,7 @@ public interface IKernelRichMediaService { void cancelTransferTask(Contact contact, ArrayList arrayList, ArrayList arrayList2, IOperateTransferInfoCallback iOperateTransferInfoCallback); - void deleteGroupFile(long j2, String str, int i2, IDeleteGroupFileCallback iDeleteGroupFileCallback); + void deleteGroupFile(long groupCode, String fileUid, int bizId, IDeleteGroupFileCallback cb); void deleteTransferInfo(Contact contact, ArrayList arrayList, IOperateTransferInfoCallback iOperateTransferInfoCallback); diff --git a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/FileSvc.kt b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/FileSvc.kt index d44be64..3d4067e 100644 --- a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/FileSvc.kt +++ b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/FileSvc.kt @@ -1,7 +1,12 @@ package moe.fuqiuluo.qqinterface.servlet import com.tencent.mobileqq.pb.ByteStringMicro +import com.tencent.qqnt.kernel.nativeinterface.DeleteGroupFileResult +import com.tencent.qqnt.kernel.nativeinterface.GroupFileCommonResult +import com.tencent.qqnt.kernel.nativeinterface.IDeleteGroupFileCallback import io.ktor.util.Deflate +import kotlinx.coroutines.suspendCancellableCoroutine +import kotlinx.coroutines.withTimeoutOrNull import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import moe.fuqiuluo.proto.protobufOf @@ -12,8 +17,11 @@ import moe.fuqiuluo.shamrock.tools.EMPTY_BYTE_ARRAY import moe.fuqiuluo.shamrock.tools.slice import moe.fuqiuluo.shamrock.tools.toHexString import moe.fuqiuluo.shamrock.utils.DeflateTools +import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher import tencent.im.oidb.cmd0x6d8.oidb_0x6d8 import tencent.im.oidb.oidb_sso +import kotlin.coroutines.resume +import kotlin.coroutines.suspendCoroutine internal object FileSvc: BaseSvc() { fun createFileFolder(groupId: String, folderName: String) { @@ -38,8 +46,23 @@ internal object FileSvc: BaseSvc() { } fun deleteGroupFile(groupId: String, bizId: Int, fileUid: String) { + /* + val kernelService = NTServiceFetcher.kernelService + val sessionService = kernelService.wrapperSession + val richMediaService = sessionService.richMediaService + + val result = withTimeoutOrNull(3000L) { + suspendCancellableCoroutine { + richMediaService.deleteGroupFile(groupId.toLong(), fileUid, bizId) { code, _, result -> + it.resume(code to result.result) + } + } + } + + return if (result == null) Result.failure(RuntimeException("delete group file timeout")) else Result.success(result)*/ + // 调用QQ内部实现会导致闪退! sendOidb("OidbSvc.0x6d6_3", 1750, 3, protobufOf( - 4 to mapOf( + 4 to mapOf( 1 to groupId.toLong(), 2 to 3, 3 to bizId, diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/DeleteGroupFile.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/DeleteGroupFile.kt index febc738..f2d2938 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/DeleteGroupFile.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/DeleteGroupFile.kt @@ -14,10 +14,30 @@ internal object DeleteGroupFile: IActionHandler() { return invoke(groupId, fileId, busid, session.echo) } + /* + suspend operator fun invoke( + groupId: String, + fileId: String, + bizId: Int, + echo: JsonElement = EmptyJsonString + ): String { + val result = FileSvc.deleteGroupFile(groupId, bizId, fileId) + if(result.isFailure) { + return error(result.exceptionOrNull()?.message ?: "删除群文件失败", echo) + } + val commonResult = result.getOrThrow() + if (commonResult.first != 0 || commonResult.second.retCode != 0) { + return error(commonResult.second.clientWording, echo) + } + return ok("成功", echo) + } + */ operator fun invoke(groupId: String, fileId: String, bizId: Int, echo: JsonElement = EmptyJsonString): String { FileSvc.deleteGroupFile(groupId, bizId, fileId) return ok("成功", echo) } + override val requiredParams: Array = arrayOf("group_id", "file_id", "busid") + override fun path(): String = "delete_group_file" } \ No newline at end of file diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/PrimitiveListener.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/PrimitiveListener.kt index c51257a..e7f8dee 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/PrimitiveListener.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/PrimitiveListener.kt @@ -52,7 +52,7 @@ internal object PrimitiveListener { ) return val msgType = pb[1, 2, 1].asInt var subType = 0 - if (pb.has(1, 2, 3)) { + if (pb.has(1, 2, 3) && pb.has(1, 2, 2)) { subType = pb[1, 2, 2].asInt } val msgTime = pb[1, 2, 6].asLong