Shamrock: Gwellekaat dilemel ar restr strollad

This commit is contained in:
WhiteChi 2023-11-21 22:05:34 +08:00
parent b9c2de744e
commit 2af8d6d817
7 changed files with 51 additions and 9 deletions

View File

@ -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")
}
}

View File

@ -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;

View File

@ -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);
}

View File

@ -9,7 +9,7 @@ public interface IKernelRichMediaService {
void cancelTransferTask(Contact contact, ArrayList<Long> arrayList, ArrayList<Integer> 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<Long> arrayList, IOperateTransferInfoCallback iOperateTransferInfoCallback);

View File

@ -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,6 +46,21 @@ 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(
1 to groupId.toLong(),

View File

@ -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<String> = arrayOf("group_id", "file_id", "busid")
override fun path(): String = "delete_group_file"
}

View File

@ -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