This commit is contained in:
fuqiuluo 2024-08-04 13:37:11 +08:00
parent cdc9ca1a72
commit 976526ab79
4 changed files with 68 additions and 8 deletions

View File

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

View File

@ -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<Boolean> getFetchTroopListResultLiveData();
@NotNull
List<TroopInfo> getSortedValidTopTroopInfoFromCache();
@NotNull
List<TroopInfo> getSortedValidTroopInfoFromCache();
@NotNull
List<TroopInfo> getTopTroopListFromCache();
@Nullable
TroopInfo getTroopInfoFromCache(@NotNull String str);
@NotNull
List<TroopInfo> getTroopListFromCache();
//@Nullable
//a<List<TroopInfo>> getTroopListLiveData();
void preloadTroopList();
void requestSetTroopTop(@NotNull LifecycleOwner lifecycleOwner, @NotNull String str, boolean z, @NotNull Function1<? super Boolean, Unit> function1);
}

View File

@ -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<List<TroopInfo>> {
val service = app.getRuntimeService(ITroopInfoService::class.java, "all")
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
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<NotJoinedGroupInfo> {

View File

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