diff --git a/qqinterface/src/main/java/com/tencent/mobileqq/data/troop/TroopInfo.java b/qqinterface/src/main/java/com/tencent/mobileqq/data/troop/TroopInfo.java index 9a215269..52c6f293 100644 --- a/qqinterface/src/main/java/com/tencent/mobileqq/data/troop/TroopInfo.java +++ b/qqinterface/src/main/java/com/tencent/mobileqq/data/troop/TroopInfo.java @@ -146,6 +146,7 @@ public class TroopInfo { public byte[] troopInfoExtByte; public String troopLevelMap; public String troopRemark; + @Deprecated public String troopcode; public short troopface; public String troopmemo; @@ -154,6 +155,7 @@ public class TroopInfo { public int trooptype; public String troopuin; public long udwCmdUinRingtoneID; + @Deprecated public String uin; public int wClickBAFTipCount; public int wInsertBAFTipCount; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/trooplist/ITroopListRepoApi.java b/qqinterface/src/main/java/com/tencent/qqnt/trooplist/ITroopListRepoApi.java new file mode 100644 index 00000000..3697667d --- /dev/null +++ b/qqinterface/src/main/java/com/tencent/qqnt/trooplist/ITroopListRepoApi.java @@ -0,0 +1,45 @@ +package com.tencent.qqnt.trooplist; + +import androidx.lifecycle.LifecycleOwner; + +import com.tencent.mobileqq.data.troop.TroopInfo; +import com.tencent.mobileqq.qroute.QRouteApi; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.List; + +import kotlin.Unit; +import kotlin.jvm.functions.Function1; + +public interface ITroopListRepoApi extends QRouteApi { + void fetchTroopLevelInfo(@NotNull String str, boolean z); + + void fetchTroopList(boolean z); + + //@NotNull + //a getFetchTroopListResultLiveData(); + + @NotNull + List getSortedValidTopTroopInfoFromCache(); + + @NotNull + List getSortedValidTroopInfoFromCache(); + + @NotNull + List getTopTroopListFromCache(); + + @Nullable + TroopInfo getTroopInfoFromCache(@NotNull String str); + + @NotNull + List getTroopListFromCache(); + + //@Nullable + //a> getTroopListLiveData(); + + void preloadTroopList(); + + void requestSetTroopTop(@NotNull LifecycleOwner lifecycleOwner, @NotNull String str, boolean z, @NotNull Function1 function1); +} diff --git a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GroupSvc.kt b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GroupSvc.kt index 04911afd..562aded3 100644 --- a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GroupSvc.kt +++ b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GroupSvc.kt @@ -19,6 +19,7 @@ import com.tencent.protofile.join_group_link.join_group_link import com.tencent.qphone.base.remote.ToServiceMsg import com.tencent.qqnt.kernel.nativeinterface.MemberInfo import com.tencent.qqnt.kernel.nativeinterface.MsgConstant +import com.tencent.qqnt.trooplist.ITroopListRepoApi import com.tencent.qqnt.troopmemberlist.ITroopMemberListRepoApi import friendlist.stUinInfo import io.ktor.client.call.body @@ -76,6 +77,7 @@ import moe.fuqiuluo.shamrock.tools.putBuf32Long import moe.fuqiuluo.shamrock.utils.FileUtils import moe.fuqiuluo.shamrock.utils.PlatformUtils import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_71_VER +import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_80_VER import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_8_VER import moe.fuqiuluo.shamrock.xposed.helper.AppRuntimeFetcher import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher @@ -228,17 +230,27 @@ internal object GroupSvc: QQInterfaces() { } suspend fun getGroupList(refresh: Boolean): Result> { - val service = app.getRuntimeService(ITroopInfoService::class.java, "all") - - var troopList = service.allTroopList - if(refresh || !service.isTroopCacheInited || troopList == null) { - if(!requestGroupInfo(service)) { - return Result.failure(Exception("获取群列表失败")) - } else { - troopList = service.allTroopList + if (PlatformUtils.getQQVersionCode() <= QQ_9_0_80_VER) { + val service = app.getRuntimeService(ITroopInfoService::class.java, "all") + + var troopList = service.allTroopList + if(refresh || !service.isTroopCacheInited || troopList == null) { + if(!requestGroupInfo(service)) { + return Result.failure(Exception("获取群列表失败")) + } else { + troopList = service.allTroopList + } + } + return Result.success(troopList) + } else { + val service = QRoute.api(ITroopListRepoApi::class.java) + val troopList = service.troopListFromCache + if (troopList == null || troopList.isEmpty() || refresh) { + service.fetchTroopList(true) + return Result.success(service.troopListFromCache) } + return Result.success(troopList) } - return Result.success(troopList) } suspend fun getNotJoinedGroupInfo(groupId: Long): Result { diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/utils/PlatformUtils.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/utils/PlatformUtils.kt index eefb815e..bc470068 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/utils/PlatformUtils.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/utils/PlatformUtils.kt @@ -18,6 +18,7 @@ import kotlin.random.Random internal object PlatformUtils { const val QQ_9_0_8_VER = 5540 const val QQ_9_0_71_VER = 6702 + const val QQ_9_0_80_VER = 6869 fun getQUA(): String { return "V1_AND_SQ_${getQQVersion(MobileQQ.getContext())}_${getQQVersionCode()}_YYB_D"