Shamrock: 修复NT接口缺失闪退

Signed-off-by: WhiteChi <whitechi73@outlook.com>
This commit is contained in:
WhiteChi 2023-10-27 13:43:39 +08:00
parent 7ec4a95303
commit 617874fea1
7 changed files with 17 additions and 9 deletions

View File

@ -23,7 +23,7 @@ import kotlin.concurrent.timer
import kotlin.coroutines.resume import kotlin.coroutines.resume
import kotlin.coroutines.suspendCoroutine import kotlin.coroutines.suspendCoroutine
abstract class BaseSvc { internal abstract class BaseSvc {
companion object { companion object {
val currentUin: String val currentUin: String
get() = app.currentAccountUin get() = app.currentAccountUin

View File

@ -27,8 +27,12 @@ import tencent.im.oidb.oidb_sso
import kotlin.coroutines.resume import kotlin.coroutines.resume
internal object CardSvc: BaseSvc() { internal object CardSvc: BaseSvc() {
private val GetModelShowLock = Mutex() private val GetModelShowLock by lazy {
private val refreshCardLock = Mutex() Mutex()
}
private val refreshCardLock by lazy {
Mutex()
}
suspend fun getModelShow(uin: Long = app.longAccountUin): String { suspend fun getModelShow(uin: Long = app.longAccountUin): String {
return GetModelShowLock.withLock { return GetModelShowLock.withLock {

View File

@ -11,7 +11,6 @@ import tencent.im.oidb.cmd0x6d8.oidb_0x6d8
import tencent.im.oidb.oidb_sso import tencent.im.oidb.oidb_sso
internal object FileSvc: BaseSvc() { internal object FileSvc: BaseSvc() {
fun createFileFolder(groupId: String, folderName: String) { fun createFileFolder(groupId: String, folderName: String) {
sendOidb("OidbSvc.0x6d7_0", 1751, 0, protobufOf( sendOidb("OidbSvc.0x6d7_0", 1751, 0, protobufOf(
1 to mapOf( 1 to mapOf(

View File

@ -1,8 +1,10 @@
@file:OptIn(DelicateCoroutinesApi::class)
package moe.fuqiuluo.qqinterface.servlet package moe.fuqiuluo.qqinterface.servlet
import com.tencent.mobileqq.data.Friends import com.tencent.mobileqq.data.Friends
import com.tencent.mobileqq.friend.api.IFriendDataService import com.tencent.mobileqq.friend.api.IFriendDataService
import com.tencent.mobileqq.friend.api.IFriendHandlerService import com.tencent.mobileqq.friend.api.IFriendHandlerService
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.launch import kotlinx.coroutines.launch

View File

@ -38,8 +38,12 @@ import java.nio.ByteBuffer
import kotlin.coroutines.resume import kotlin.coroutines.resume
internal object GroupSvc: BaseSvc() { internal object GroupSvc: BaseSvc() {
private val RefreshTroopMemberInfoLock = Mutex() private val RefreshTroopMemberInfoLock by lazy {
private val RefreshTroopMemberListLock = Mutex() Mutex()
}
private val RefreshTroopMemberListLock by lazy {
Mutex()
}
private lateinit var METHOD_REQ_MEMBER_INFO: Method private lateinit var METHOD_REQ_MEMBER_INFO: Method
private lateinit var METHOD_REQ_MEMBER_INFO_V2: Method private lateinit var METHOD_REQ_MEMBER_INFO_V2: Method

View File

@ -4,7 +4,6 @@ import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.suspendCancellableCoroutine
import moe.fuqiuluo.qqinterface.servlet.FriendSvc import moe.fuqiuluo.qqinterface.servlet.FriendSvc
import moe.fuqiuluo.qqinterface.servlet.GroupSvc import moe.fuqiuluo.qqinterface.servlet.GroupSvc
import moe.fuqiuluo.qqinterface.servlet.MsgSvc
import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher
import kotlin.coroutines.resume import kotlin.coroutines.resume

View File

@ -73,8 +73,8 @@ internal object NTServiceFetcher {
LogCenter.log("Register MSG listener successfully.") LogCenter.log("Register MSG listener successfully.")
msgService.addMsgListener(AioListener) msgService.addMsgListener(AioListener)
groupService.addKernelGroupListener(GroupEventListener) //groupService.addKernelGroupListener(GroupEventListener)
LogCenter.log("Register Group listener successfully.") //LogCenter.log("Register Group listener successfully.")
PrimitiveListener.registerListener() PrimitiveListener.registerListener()
} catch (e: Throwable) { } catch (e: Throwable) {