From 609e87d0ec9eab052d569da2cca62e3623d0a8e3 Mon Sep 17 00:00:00 2001 From: fuqiuluo Date: Thu, 25 Jul 2024 01:11:13 +0800 Subject: [PATCH] fix: move gpro api #346 --- .../qqguildsdk/api/impl/GProSessionImpl.java | 11 +++ .../qqguildsdk/data/GProGuildInfo.java | 10 +-- .../qqguildsdk/data/GProGuildRoleInfo.java | 2 +- .../data/GProRoleMemberListInfo.java | 2 +- .../genc/GGProGuildMemberSearchResult.java | 5 -- .../nativeinterface/GProJoinGuildResult.java | 2 + .../nativeinterface/GProJoinGuildsResult.java | 2 + .../nativeinterface/GProRoleMemberList.java | 2 + .../GProSearchMemberAndRoleResult.java | 2 + ...FetchChannelInvisibleRoleListCallback.java | 2 + ...oFetchChannelLiveableRoleListCallback.java | 2 + .../IGProFetchGuildInfoCallback.java | 2 + .../IGProFetchGuildListCallback.java | 2 + .../nativeinterface/IGProResultCallback.java | 5 -- .../nativeinterface/IKernelGuildListener.java | 3 + .../nativeinterface/IKernelGuildService.java | 9 ++ .../nativeinterface/IQQNTWrapperSession.java | 7 +- .../nativeinterface/GProGuild.java | 6 +- .../nativeinterface/GProGuildRole.java | 4 +- .../nativeinterface/GProRoleCreateInfo.java | 4 +- .../IGProCreateRoleCallback.java | 4 +- .../IGProFetchMemberListWithRoleCallback.java | 4 +- .../IGProFetchMemberRolesCallback.java | 2 +- .../IGProFetchRoleListPermissionCallback.java | 2 +- .../IGProFetchRolePermissionCallback.java | 6 +- .../nativeinterface/IGProResultCallback.java | 7 ++ .../nativeinterface/IKernelGuildService.java | 90 +++++++++++++++++++ .../IQQGProWrapperSession.java | 9 ++ .../IQQNTStartupSessionWrapper.java | 11 +++ .../fuqiuluo/qqinterface/servlet/GProSvc.kt | 77 +++++++++++----- .../fuqiuluo/qqinterface/servlet/GroupSvc.kt | 11 ++- .../action/handlers/GetTroopMemberInfo.kt | 6 +- .../service/listener/KernelGuildListener.kt | 5 +- .../fuqiuluo/shamrock/utils/PlatformUtils.kt | 2 +- .../xposed/helper/NTServiceFetcher.kt | 13 ++- 35 files changed, 262 insertions(+), 71 deletions(-) create mode 100644 qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/api/impl/GProSessionImpl.java delete mode 100644 qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProResultCallback.java rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/GProGuild.java (87%) rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/GProGuildRole.java (98%) rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/GProRoleCreateInfo.java (88%) rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/IGProCreateRoleCallback.java (54%) rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/IGProFetchMemberListWithRoleCallback.java (70%) rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/IGProFetchMemberRolesCallback.java (76%) rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/IGProFetchRoleListPermissionCallback.java (82%) rename qqinterface/src/main/java/com/tencent/qqnt/{kernel => kernelgpro}/nativeinterface/IGProFetchRolePermissionCallback.java (53%) create mode 100644 qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProResultCallback.java create mode 100644 qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IKernelGuildService.java create mode 100644 qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IQQGProWrapperSession.java create mode 100644 qqinterface/src/main/java/com/tencent/qqnt/ntstartup/nativeinterface/IQQNTStartupSessionWrapper.java diff --git a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/api/impl/GProSessionImpl.java b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/api/impl/GProSessionImpl.java new file mode 100644 index 00000000..056deaa9 --- /dev/null +++ b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/api/impl/GProSessionImpl.java @@ -0,0 +1,11 @@ +package com.tencent.mobileqq.qqguildsdk.api.impl; + +import com.tencent.qqnt.kernelgpro.nativeinterface.IKernelGuildService; + +public class GProSessionImpl { + public IKernelGuildService getGuildService() { + return null; + } + + +} diff --git a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildInfo.java b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildInfo.java index 2d003cee..ced8fc5b 100644 --- a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildInfo.java +++ b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildInfo.java @@ -1,20 +1,12 @@ package com.tencent.mobileqq.qqguildsdk.data; -import android.text.TextUtils; - -import com.tencent.mobileqq.qqguildsdk.data.genc.GGProMedalInfo; -import com.tencent.mobileqq.qqguildsdk.data.genc.GGProNavigationInfo; import com.tencent.mobileqq.qqguildsdk.data.genc.IGProMedalInfo; import com.tencent.mobileqq.qqguildsdk.data.genc.IGProNavigationInfo; -import com.tencent.qqnt.kernel.nativeinterface.GProGuild; -import com.tencent.qqnt.kernel.nativeinterface.GProGuildSpeakableThreshold; -import com.tencent.qqnt.kernel.nativeinterface.GProMedalInfo; -import com.tencent.qqnt.kernel.nativeinterface.GProNavigationInfo; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild; import org.jetbrains.annotations.NotNull; import java.util.ArrayList; -import java.util.Iterator; public class GProGuildInfo implements IGProGuildInfo { diff --git a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildRoleInfo.java b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildRoleInfo.java index 8188ae88..6bdee088 100644 --- a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildRoleInfo.java +++ b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProGuildRoleInfo.java @@ -2,7 +2,7 @@ import androidx.annotation.NonNull; -import com.tencent.qqnt.kernel.nativeinterface.GProGuildRole; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole; import java.util.ArrayList; import java.util.Iterator; diff --git a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProRoleMemberListInfo.java b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProRoleMemberListInfo.java index fa2a3169..f4b7ccdd 100644 --- a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProRoleMemberListInfo.java +++ b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/GProRoleMemberListInfo.java @@ -1,6 +1,6 @@ package com.tencent.mobileqq.qqguildsdk.data; -import com.tencent.qqnt.kernel.nativeinterface.GProGuildRole; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole; import com.tencent.qqnt.kernel.nativeinterface.GProUser; import java.util.ArrayList; diff --git a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/genc/GGProGuildMemberSearchResult.java b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/genc/GGProGuildMemberSearchResult.java index b84e45b6..42727a9c 100644 --- a/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/genc/GGProGuildMemberSearchResult.java +++ b/qqinterface/src/main/java/com/tencent/mobileqq/qqguildsdk/data/genc/GGProGuildMemberSearchResult.java @@ -1,14 +1,9 @@ package com.tencent.mobileqq.qqguildsdk.data.genc; -import com.tencent.mobileqq.qqguildsdk.data.GProGuildRoleInfo; -import com.tencent.mobileqq.qqguildsdk.data.GProUserInfo; import com.tencent.mobileqq.qqguildsdk.data.IGProGuildRoleInfo; import com.tencent.mobileqq.qqguildsdk.data.IGProUserInfo; -import com.tencent.qqnt.kernel.nativeinterface.GProGuildRole; -import com.tencent.qqnt.kernel.nativeinterface.GProUser; import java.util.ArrayList; -import java.util.Iterator; public class GGProGuildMemberSearchResult implements IGProGuildMemberSearchResult { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildResult.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildResult.java index 52f6a77d..04778a5b 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildResult.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildResult.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild; + public final class GProJoinGuildResult { GProGuild guildInfo; GProGuildInit guildInit; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildsResult.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildsResult.java index 01fd40bd..cc6c7829 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildsResult.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProJoinGuildsResult.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild; + import java.io.Serializable; public final class GProJoinGuildsResult implements Serializable { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProRoleMemberList.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProRoleMemberList.java index 6ceb3a92..a4de7f12 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProRoleMemberList.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProRoleMemberList.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole; + import java.util.ArrayList; public final class GProRoleMemberList { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProSearchMemberAndRoleResult.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProSearchMemberAndRoleResult.java index efafded0..d6b8c4fc 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProSearchMemberAndRoleResult.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProSearchMemberAndRoleResult.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole; + import java.util.ArrayList; public final class GProSearchMemberAndRoleResult { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelInvisibleRoleListCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelInvisibleRoleListCallback.java index 8ccb5057..f2922961 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelInvisibleRoleListCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelInvisibleRoleListCallback.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole; + import java.util.ArrayList; public interface IGProFetchChannelInvisibleRoleListCallback { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelLiveableRoleListCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelLiveableRoleListCallback.java index 5fe4352f..27233297 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelLiveableRoleListCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchChannelLiveableRoleListCallback.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole; + import java.util.ArrayList; public interface IGProFetchChannelLiveableRoleListCallback { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildInfoCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildInfoCallback.java index 2eed34e3..74fdeb04 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildInfoCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildInfoCallback.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild; + public interface IGProFetchGuildInfoCallback { void onFetchGuildInfo(int code, String reason, GProGuild gProGuild); } diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildListCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildListCallback.java index 19fc450d..c5b333a9 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildListCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchGuildListCallback.java @@ -1,5 +1,7 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild; + import java.util.ArrayList; public interface IGProFetchGuildListCallback { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProResultCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProResultCallback.java deleted file mode 100644 index a5a4a9fa..00000000 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProResultCallback.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.tencent.qqnt.kernel.nativeinterface; - -public interface IGProResultCallback { - void onResult(int code, String msg, GProSecurityResult result); -} diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildListener.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildListener.java index 5a7a62ef..ef7186e2 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildListener.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildListener.java @@ -1,5 +1,8 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole; + import java.util.ArrayList; import java.util.HashMap; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildService.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildService.java index 785625ac..72489c30 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildService.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IKernelGuildService.java @@ -1,5 +1,14 @@ package com.tencent.qqnt.kernel.nativeinterface; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild; +import com.tencent.qqnt.kernelgpro.nativeinterface.GProRoleCreateInfo; +import com.tencent.qqnt.kernelgpro.nativeinterface.IGProCreateRoleCallback; +import com.tencent.qqnt.kernelgpro.nativeinterface.IGProFetchMemberListWithRoleCallback; +import com.tencent.qqnt.kernelgpro.nativeinterface.IGProFetchMemberRolesCallback; +import com.tencent.qqnt.kernelgpro.nativeinterface.IGProFetchRoleListPermissionCallback; +import com.tencent.qqnt.kernelgpro.nativeinterface.IGProFetchRolePermissionCallback; +import com.tencent.qqnt.kernelgpro.nativeinterface.IGProResultCallback; + import java.util.ArrayList; public interface IKernelGuildService { diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IQQNTWrapperSession.java b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IQQNTWrapperSession.java index 204829f2..ccf1fb5d 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IQQNTWrapperSession.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IQQNTWrapperSession.java @@ -19,11 +19,6 @@ public ArrayList getCacheErrLog() { return null; } - @Override - public IKernelGuildService getGuildService() { - return null; - } - @Override public IKernelMsgService getMsgService() { return null; @@ -93,7 +88,7 @@ public String startNT() { //IKernelGroupService getGroupService(); - IKernelGuildService getGuildService(); + //IKernelGuildService getGuildService(); IKernelMsgService getMsgService(); diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProGuild.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProGuild.java similarity index 87% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProGuild.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProGuild.java index ee94f9f1..bf1c73a4 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProGuild.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProGuild.java @@ -1,7 +1,9 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProCmdUinInfo; +import com.tencent.qqnt.kernel.nativeinterface.GProGuildInfo; import java.io.Serializable; -import java.util.ArrayList; public final class GProGuild implements Serializable { GProCmdUinInfo cmdUinInfo; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProGuildRole.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProGuildRole.java similarity index 98% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProGuildRole.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProGuildRole.java index 3f8c81fb..914aa535 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProGuildRole.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProGuildRole.java @@ -1,4 +1,6 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProRolePermission; import java.util.ArrayList; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProRoleCreateInfo.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProRoleCreateInfo.java similarity index 88% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProRoleCreateInfo.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProRoleCreateInfo.java index 931648ae..728ce900 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/GProRoleCreateInfo.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/GProRoleCreateInfo.java @@ -1,4 +1,6 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProRolePermission; public final class GProRoleCreateInfo { boolean bHoist; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProCreateRoleCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProCreateRoleCallback.java similarity index 54% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProCreateRoleCallback.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProCreateRoleCallback.java index 7f97cbb0..cfc8c40b 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProCreateRoleCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProCreateRoleCallback.java @@ -1,4 +1,6 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProSecurityResult; public interface IGProCreateRoleCallback { void onCreateRoleResult(int code, String msg, GProSecurityResult result, GProGuildRole role); diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchMemberListWithRoleCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchMemberListWithRoleCallback.java similarity index 70% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchMemberListWithRoleCallback.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchMemberListWithRoleCallback.java index d37d50fc..e37113d1 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchMemberListWithRoleCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchMemberListWithRoleCallback.java @@ -1,4 +1,6 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProRoleMemberList; import java.util.ArrayList; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchMemberRolesCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchMemberRolesCallback.java similarity index 76% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchMemberRolesCallback.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchMemberRolesCallback.java index 19ced8e8..745d741a 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchMemberRolesCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchMemberRolesCallback.java @@ -1,4 +1,4 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; import java.util.ArrayList; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchRoleListPermissionCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchRoleListPermissionCallback.java similarity index 82% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchRoleListPermissionCallback.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchRoleListPermissionCallback.java index da23732e..2d6695b8 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchRoleListPermissionCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchRoleListPermissionCallback.java @@ -1,4 +1,4 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; import java.util.ArrayList; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchRolePermissionCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchRolePermissionCallback.java similarity index 53% rename from qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchRolePermissionCallback.java rename to qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchRolePermissionCallback.java index a590914d..528d11fa 100644 --- a/qqinterface/src/main/java/com/tencent/qqnt/kernel/nativeinterface/IGProFetchRolePermissionCallback.java +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProFetchRolePermissionCallback.java @@ -1,4 +1,8 @@ -package com.tencent.qqnt.kernel.nativeinterface; +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProRolePermission; +import com.tencent.qqnt.kernel.nativeinterface.GProRolePermissionCategory; +import com.tencent.qqnt.kernel.nativeinterface.GProRolePermissionDesc; import java.util.ArrayList; diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProResultCallback.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProResultCallback.java new file mode 100644 index 00000000..798d647d --- /dev/null +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IGProResultCallback.java @@ -0,0 +1,7 @@ +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProSecurityResult; + +public interface IGProResultCallback { + void onResult(int code, String msg, GProSecurityResult result); +} diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IKernelGuildService.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IKernelGuildService.java new file mode 100644 index 00000000..67439dd6 --- /dev/null +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IKernelGuildService.java @@ -0,0 +1,90 @@ +package com.tencent.qqnt.kernelgpro.nativeinterface; + +import com.tencent.qqnt.kernel.nativeinterface.GProFaceAuthInfo; +import com.tencent.qqnt.kernel.nativeinterface.GProGuildReqInfo; +import com.tencent.qqnt.kernel.nativeinterface.GProSimpleProfile; +import com.tencent.qqnt.kernel.nativeinterface.IGProAddGuildInfoCallBack; +import com.tencent.qqnt.kernel.nativeinterface.IGProFetchChannelInvisibleRoleListCallback; +import com.tencent.qqnt.kernel.nativeinterface.IGProFetchChannelLiveableRoleListCallback; +import com.tencent.qqnt.kernel.nativeinterface.IGProFetchGuildInfoCallback; +import com.tencent.qqnt.kernel.nativeinterface.IGProFetchGuildListCallback; +import com.tencent.qqnt.kernel.nativeinterface.IGProFetchRetentionGuildListCallback; +import com.tencent.qqnt.kernel.nativeinterface.IGProFetchUserJoinedGuildListCallback; +import com.tencent.qqnt.kernel.nativeinterface.IGProGetMemberInfoByOpenIdCallback; +import com.tencent.qqnt.kernel.nativeinterface.IGProGetUserInfoCallback; +import com.tencent.qqnt.kernel.nativeinterface.IKernelGuildListener; + +import java.util.ArrayList; + +public interface IKernelGuildService { + void refreshGuildList(boolean isForced); // 只刷新id,详细信息需要额外获取 + + //ArrayList getQQMsgListGuilds(); 啥也拿不到 + + void fetchGuildList(ArrayList reqInfos, byte[] cookie, int i2, IGProFetchGuildListCallback iGProFetchGuildListCallback); + + void fetchRetentionGuildList(int i2, int i3, byte[] cookie, long j2, IGProFetchRetentionGuildListCallback iGProFetchRetentionGuildListCallback); + + void fetchUserJoinedGuildList(long guildId, long tinyId, String cookie, IGProFetchUserJoinedGuildListCallback cb); + + void addKernelGuildListener(IKernelGuildListener iKernelGuildListener); + + void GetMemberInfoByOpenId(String str, long j2, boolean z, boolean z2, IGProGetMemberInfoByOpenIdCallback iGProGetMemberInfoByOpenIdCallback); + + ArrayList getGroupGuildListFromCache(); + + ArrayList getGuildListFromCache(); + + void fetchAddGuildInfo(int appId, long guildId, IGProAddGuildInfoCallBack iGProAddGuildInfoCallBack); + + void fetchGuildInfo(long guildId, int seq, IGProFetchGuildInfoCallback iGProFetchGuildInfoCallback); + + //void fetchGuildInfoByAppIdentity(GProGuildIdentity gProGuildIdentity, String str, String str2, IGProFetchGuildInfoByAppIdentityCallback iGProFetchGuildInfoByAppIdentityCallback); + + void fetchGuildInfoForGuest(long guildId, int seq, IGProFetchGuildInfoCallback cb); + + //void fetchGuestGuildInfoWithChannelList(String guildId, String str2, int i2, int seq, String str3, + // IGProFetchGuestGuildInfoWithChannelListCallback iGProFetchGuestGuildInfoWithChannelListCallback); + + GProGuild getGuildInfoFromCache(long guildId); + + // 第一次请求: startIndex = 0 , roleIdIndex = 2 + void fetchMemberListWithRole(long guildId, long channelId, long startIndex, long roleIndex, int count, int seq, IGProFetchMemberListWithRoleCallback cb); + + void refreshGuildInfo(long guildId, boolean force, int seq); + + void refreshGuildInfoOnly(long j2, boolean z, int i2); + + void refreshGuildUserProfileInfo(long guildId, long tinyId, int seq); + + void fetchUserInfo(long guildId, long channelId, ArrayList tinyIdList, int seq, IGProGetUserInfoCallback cb); + + //@Deprecated(since = "QQ新版本不支持创建话题子频道") + //void fetchTopFeeds(long guildId, long channelId, IGProFetchTopFeedsCallback cb); + + void fetchChannelInvisibleRoleList(long guildId, long channelId, IGProFetchChannelInvisibleRoleListCallback cb); + + void fetchChannelLiveableRoleList(long guildId, long channelId, IGProFetchChannelLiveableRoleListCallback cb); + + void fetchMemberRoles(long guildId, long channelId, long tinyId, int seq, IGProFetchMemberRolesCallback cb); + + void fetchRoleListWithPermission(long guildId, int seq, IGProFetchRoleListPermissionCallback cb); + + void fetchRoleWithPermission(long guildId, long roleId, int seq, IGProFetchRolePermissionCallback cb); + + GProSimpleProfile getSimpleProfile(long guildId, long tinyId, int seq); + + GProFaceAuthInfo getFaceAuthInfo(); + + String getGuildUserAvatarUrl(long guildId, long tinyId, int seq); + + String getGuildUserNickname(long guildId); + + void deleteRole(long guild, long role, IGProResultCallback cb); + + void setMemberRoles(long guild, long u1, long u2, long tinyId, ArrayList addRoles, ArrayList removeRoles, IGProResultCallback cb); + + void setRoleInfo(long guild, long role, GProRoleCreateInfo info, IGProResultCallback cb); + + void createRole(long guildId, GProRoleCreateInfo info, ArrayList initialUsers, IGProCreateRoleCallback cb); +} diff --git a/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IQQGProWrapperSession.java b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IQQGProWrapperSession.java new file mode 100644 index 00000000..50d0567b --- /dev/null +++ b/qqinterface/src/main/java/com/tencent/qqnt/kernelgpro/nativeinterface/IQQGProWrapperSession.java @@ -0,0 +1,9 @@ +package com.tencent.qqnt.kernelgpro.nativeinterface; + +public interface IQQGProWrapperSession { + IKernelGuildService getGuildService(); + + static class CppProxy { + public static native IQQGProWrapperSession getGProWrapperSession(String str); + } +} diff --git a/qqinterface/src/main/java/com/tencent/qqnt/ntstartup/nativeinterface/IQQNTStartupSessionWrapper.java b/qqinterface/src/main/java/com/tencent/qqnt/ntstartup/nativeinterface/IQQNTStartupSessionWrapper.java new file mode 100644 index 00000000..2f9abcd8 --- /dev/null +++ b/qqinterface/src/main/java/com/tencent/qqnt/ntstartup/nativeinterface/IQQNTStartupSessionWrapper.java @@ -0,0 +1,11 @@ +package com.tencent.qqnt.ntstartup.nativeinterface; + +import java.util.HashMap; + +public interface IQQNTStartupSessionWrapper { + HashMap getSessionIdList(); + + int start(); + + int stop(); +} diff --git a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GProSvc.kt b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GProSvc.kt index 8f21e49d..b3ac7c24 100644 --- a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GProSvc.kt +++ b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GProSvc.kt @@ -3,10 +3,11 @@ package moe.fuqiuluo.qqinterface.servlet import com.tencent.mobileqq.qqguildsdk.api.IGPSService -import com.tencent.qqnt.kernel.nativeinterface.GProGuildRole -import com.tencent.qqnt.kernel.nativeinterface.GProRoleCreateInfo +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole +import com.tencent.qqnt.kernelgpro.nativeinterface.GProRoleCreateInfo import com.tencent.qqnt.kernel.nativeinterface.GProRoleMemberList import com.tencent.qqnt.kernel.nativeinterface.GProRolePermission +import com.tencent.qqnt.kernelgpro.nativeinterface.IQQGProWrapperSession import kotlinx.coroutines.suspendCancellableCoroutine import kotlinx.coroutines.withTimeoutOrNull import kotlinx.serialization.ExperimentalSerializationApi @@ -21,7 +22,6 @@ import moe.fuqiuluo.shamrock.helper.LogCenter import moe.fuqiuluo.shamrock.tools.EMPTY_BYTE_ARRAY import moe.fuqiuluo.shamrock.tools.decodeToObject import moe.fuqiuluo.shamrock.tools.decodeToOidb -import moe.fuqiuluo.shamrock.tools.slice import moe.fuqiuluo.shamrock.utils.PlatformUtils import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher import moe.fuqiuluo.shamrock.xposed.helper.QQInterfaces @@ -44,7 +44,6 @@ import protobuf.qweb.DEFAULT_DEVICE_INFO import protobuf.qweb.QWebExtInfo import protobuf.qweb.QWebReq import protobuf.qweb.QWebRsp -import tencent.im.oidb.oidb_sso import kotlin.coroutines.resume internal object GProSvc: QQInterfaces() { @@ -53,6 +52,10 @@ internal object GProSvc: QQInterfaces() { return service.selfTinyId.toULong() } + private fun getNTGProSessionId(): String? { + return NTServiceFetcher.startupSessionWrapper.sessionIdList["gpro"] + } + suspend fun getGuildInfo(guildId: ULong): Result { val respBuffer = sendOidbAW("OidbSvcTrpcTcp.0xf57_9", 0xf57, 9, Oidb0xf57Req( filter = Oidb0xf57Filter( @@ -132,7 +135,9 @@ internal object GProSvc: QQInterfaces() { } fun refreshGuildInfo(guildId: ULong) { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService kernelGProService.refreshGuildInfo(guildId.toLong(), true, 1) } @@ -144,8 +149,8 @@ internal object GProSvc: QQInterfaces() { fetchAll: Boolean = false, result: ArrayList = arrayListOf() ): Result>> { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService - + val kernelGProService = + IQQGProWrapperSession.CppProxy.getGProWrapperSession(getNTGProSessionId()).guildService val fetchGuildMemberListResult: Pair> = (withTimeoutOrNull(5000) { suspendCancellableCoroutine { kernelGProService.fetchMemberListWithRole(guildId.toLong(), 0, startIndex, roleIndex, count, 0) { code, reason, finish, nextIndex, nextRoleIdIndex, _, seq, roleList -> @@ -214,7 +219,8 @@ internal object GProSvc: QQInterfaces() { } private fun getGuildListByNt(result: ArrayList) { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = + IQQGProWrapperSession.CppProxy.getGProWrapperSession(getNTGProSessionId()).guildService kernelGProService.guildListFromCache.forEach { if (it.result != 0) return@forEach val guildInfo = it.guildInfo @@ -236,7 +242,9 @@ internal object GProSvc: QQInterfaces() { } suspend fun fetchGuildMemberRoles(guildId: ULong, tinyId: ULong, refresh: Boolean = false): Result> { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService if (refresh) { kernelGProService.refreshGuildUserProfileInfo(guildId.toLong(), tinyId.toLong(), 1) } @@ -251,7 +259,9 @@ internal object GProSvc: QQInterfaces() { } fun getGuildList(refresh: Boolean = false, forceOldApi: Boolean): ArrayList { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService if (refresh) { kernelGProService.refreshGuildList(true) kernelGProService.guildListFromCache.forEach { @@ -274,7 +284,10 @@ internal object GProSvc: QQInterfaces() { } suspend fun getGuildRoles(guildId: ULong): Result> { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService + val roles: List = withTimeoutOrNull(5000) { suspendCancellableCoroutine { kernelGProService.fetchRoleListWithPermission(guildId.toLong(), 1) { code, _, roles, _, _, _ -> @@ -286,7 +299,10 @@ internal object GProSvc: QQInterfaces() { } fun deleteGuildRole(guildId: ULong, roleId: ULong) { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService + kernelGProService.deleteRole(guildId.toLong(), roleId.toLong()) { code, msg, result -> if (code != 0) { LogCenter.log("deleteGuildRole failed: $code($msg) => $result", Level.WARN) @@ -295,7 +311,10 @@ internal object GProSvc: QQInterfaces() { } fun setMemberRole(guildId: ULong, tinyId: ULong, roleId: ULong, isSet: Boolean) { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService + val addList = arrayListOf() val rmList = arrayListOf() (if (isSet) addList else rmList).add(roleId.toLong()) @@ -307,8 +326,11 @@ internal object GProSvc: QQInterfaces() { } suspend fun getGuildRolePermission(guildId: ULong, roleId: ULong): Result { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService - val role:GProGuildRole = withTimeoutOrNull(5000) { + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService + + val role: GProGuildRole = withTimeoutOrNull(5000) { suspendCancellableCoroutine { kernelGProService.fetchRoleWithPermission(guildId.toLong(), roleId.toLong(), 1) { code, msg, role, _, _, _ -> if (code != 0) { @@ -325,10 +347,14 @@ internal object GProSvc: QQInterfaces() { val oldInfo = getGuildRolePermission(guildId, roleId).onFailure { return Result.failure(it) }.getOrThrow() - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService - val info = GProRoleCreateInfo( - name, color, oldInfo.bHoist, oldInfo.rolePermissions - ) + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService + + val info = + GProRoleCreateInfo( + name, color, oldInfo.bHoist, oldInfo.rolePermissions + ) kernelGProService.setRoleInfo(guildId.toLong(), roleId.toLong(), info) { code, msg, result -> if (code != 0) { LogCenter.log("updateGuildRole failed: $code($msg) => $result", Level.WARN) @@ -338,9 +364,18 @@ internal object GProSvc: QQInterfaces() { } suspend fun createGuildRole(guildId: ULong, name: String, color: Long, initialUsers: ArrayList): Result { - val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService + val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession( + getNTGProSessionId() + ).guildService + val permission = GProRolePermission(false, arrayListOf()) - val info = GProRoleCreateInfo(name, color, false, permission) + val info = + GProRoleCreateInfo( + name, + color, + false, + permission + ) val role: GProGuildRole = withTimeoutOrNull(5000) { suspendCancellableCoroutine { kernelGProService.createRole(guildId.toLong(), info, initialUsers) { code, msg, result, role -> 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 9001c936..04911afd 100644 --- a/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GroupSvc.kt +++ b/xposed/src/main/java/moe/fuqiuluo/qqinterface/servlet/GroupSvc.kt @@ -56,7 +56,6 @@ import moe.fuqiuluo.qqinterface.servlet.structures.ProhibitedMemberInfo import moe.fuqiuluo.shamrock.helper.Level import moe.fuqiuluo.shamrock.helper.LogCenter import moe.fuqiuluo.shamrock.helper.MessageHelper -import moe.fuqiuluo.shamrock.remote.action.handlers.GetTroopMemberInfo import moe.fuqiuluo.shamrock.remote.service.data.EssenceMessage import moe.fuqiuluo.shamrock.remote.service.data.GroupAnnouncement import moe.fuqiuluo.shamrock.remote.service.data.GroupAnnouncementMessage @@ -76,7 +75,7 @@ import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty 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_65_VER +import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_71_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 @@ -290,7 +289,7 @@ internal object GroupSvc: QQInterfaces() { var nick = getTroopMemberInfoByUinV2(groupId, userId, true).getOrThrow().let { it.troopnick.ifEmpty { it.troopremark.ifNullOrEmpty("") } } - if (PlatformUtils.getQQVersionCode() > QQ_9_0_65_VER && nick == null) { + if (PlatformUtils.getQQVersionCode() > QQ_9_0_71_VER && nick == null) { nick = getTroopMemberNickByUin(groupId, userId)?.let { it.troopNick .ifNullOrEmpty(it.friendNick) @@ -478,7 +477,7 @@ internal object GroupSvc: QQInterfaces() { } suspend fun isAdmin(groupId: Long): Boolean { - if (PlatformUtils.getQQVersionCode() > QQ_9_0_65_VER) { + if (PlatformUtils.getQQVersionCode() > QQ_9_0_71_VER) { // 针对新版本api做的适配 val account = app.longAccountUin getTroopMemberInfoByUinV2(groupId, account, false).onSuccess { @@ -607,7 +606,7 @@ internal object GroupSvc: QQInterfaces() { groupId: Long, uin: Long ): TroopMemberNickInfo? { - if (PlatformUtils.getQQVersionCode() > QQ_9_0_65_VER) { + if (PlatformUtils.getQQVersionCode() > QQ_9_0_71_VER) { val api = QRoute.api(ITroopMemberListRepoApi::class.java) return withTimeoutOrNull(5.seconds) { suspendCancellableCoroutine { continuation -> @@ -627,7 +626,7 @@ internal object GroupSvc: QQInterfaces() { refresh: Boolean = false ): Result { var info: TroopMemberInfo? = null - if (PlatformUtils.getQQVersionCode() <= QQ_9_0_65_VER) { + if (PlatformUtils.getQQVersionCode() <= QQ_9_0_71_VER) { val service = app.getRuntimeService(ITroopMemberInfoService::class.java, "all") info = service.getTroopMember(groupId.toString(), uin.toString()) if (refresh || !service.isMemberInCache(groupId.toString(), uin.toString()) || info == null || info.troopnick == null) { diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/GetTroopMemberInfo.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/GetTroopMemberInfo.kt index 3a6a8b3a..00f0b2d7 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/GetTroopMemberInfo.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/action/handlers/GetTroopMemberInfo.kt @@ -12,7 +12,7 @@ import moe.fuqiuluo.shamrock.remote.service.data.push.MemberRole import moe.fuqiuluo.shamrock.tools.EmptyJsonString import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty import moe.fuqiuluo.shamrock.utils.PlatformUtils -import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_65_VER +import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_71_VER import moe.fuqiuluo.symbols.OneBotHandler @OneBotHandler("get_group_member_info") @@ -37,7 +37,7 @@ internal object GetTroopMemberInfo : IActionHandler() { val code = PlatformUtils.getQQVersionCode() return ok(when { - (code >= QQ_9_0_65_VER) -> ntQQApiData(groupId, userId, info) + (code >= QQ_9_0_71_VER) -> ntQQApiData(groupId, userId, info) else -> oldQQApiData(groupId, userId, info) }, echo) } @@ -111,7 +111,7 @@ internal object GetTroopMemberInfo : IActionHandler() { age = info.age.toInt(), shutUpTimestamp = 0L ).also { - if (PlatformUtils.getQQVersionCode() <= QQ_9_0_65_VER) { + if (PlatformUtils.getQQVersionCode() <= QQ_9_0_71_VER) { it.distance = info.distance it.area = info.alias } diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/KernelGuildListener.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/KernelGuildListener.kt index 5785004b..5b06a552 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/KernelGuildListener.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/remote/service/listener/KernelGuildListener.kt @@ -12,12 +12,12 @@ import com.tencent.qqnt.kernel.nativeinterface.GProCreateGuildGuideInfo import com.tencent.qqnt.kernel.nativeinterface.GProDailyRecommendPush import com.tencent.qqnt.kernel.nativeinterface.GProDiscoveryStateChangedMsg import com.tencent.qqnt.kernel.nativeinterface.GProGlobalBanner -import com.tencent.qqnt.kernel.nativeinterface.GProGuild +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild import com.tencent.qqnt.kernel.nativeinterface.GProGuildData import com.tencent.qqnt.kernel.nativeinterface.GProGuildInit import com.tencent.qqnt.kernel.nativeinterface.GProGuildListSortInfo import com.tencent.qqnt.kernel.nativeinterface.GProGuildMemberCountInfo -import com.tencent.qqnt.kernel.nativeinterface.GProGuildRole +import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole import com.tencent.qqnt.kernel.nativeinterface.GProGuildSpeakableThreshold import com.tencent.qqnt.kernel.nativeinterface.GProGuildStateRspInfo import com.tencent.qqnt.kernel.nativeinterface.GProGuildUserProfile @@ -49,7 +49,6 @@ import com.tencent.qqnt.kernel.nativeinterface.GProVoiceSmobaGameUserActionPush import com.tencent.qqnt.kernel.nativeinterface.GProWorldState import com.tencent.qqnt.kernel.nativeinterface.GProYLGameTeamInfo import com.tencent.qqnt.kernel.nativeinterface.IKernelGuildListener -import moe.fuqiuluo.shamrock.helper.LogCenter import java.util.ArrayList import java.util.HashMap 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 03e4034f..eefb815e 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/utils/PlatformUtils.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/utils/PlatformUtils.kt @@ -17,7 +17,7 @@ import kotlin.random.Random internal object PlatformUtils { const val QQ_9_0_8_VER = 5540 - const val QQ_9_0_65_VER = 6566 + const val QQ_9_0_71_VER = 6702 fun getQUA(): String { return "V1_AND_SQ_${getQQVersion(MobileQQ.getContext())}_${getQQVersionCode()}_YYB_D" diff --git a/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/helper/NTServiceFetcher.kt b/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/helper/NTServiceFetcher.kt index d453c4aa..75bfbdc0 100644 --- a/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/helper/NTServiceFetcher.kt +++ b/xposed/src/main/java/moe/fuqiuluo/shamrock/xposed/helper/NTServiceFetcher.kt @@ -1,9 +1,11 @@ package moe.fuqiuluo.shamrock.xposed.helper import com.tencent.qqnt.kernel.api.IKernelService +import com.tencent.qqnt.kernel.api.impl.KernelServiceImpl import com.tencent.qqnt.kernel.api.impl.MsgService import com.tencent.qqnt.kernel.nativeinterface.IOperateCallback import com.tencent.qqnt.kernel.nativeinterface.IQQNTWrapperSession +import com.tencent.qqnt.ntstartup.nativeinterface.IQQNTStartupSessionWrapper import kotlinx.coroutines.sync.Mutex import kotlinx.coroutines.sync.withLock import moe.fuqiuluo.shamrock.helper.Level @@ -15,6 +17,7 @@ import moe.fuqiuluo.shamrock.utils.PlatformUtils internal object NTServiceFetcher { private lateinit var iKernelService: IKernelService + private lateinit var startupSession: IQQNTStartupSessionWrapper private val lock = Mutex() private var curKernelHash = 0 @@ -30,7 +33,13 @@ internal object NTServiceFetcher { LogCenter.log("Fetch kernel service successfully: $curKernelHash,$curHash,${PlatformUtils.isMainProcess()}") curKernelHash = curHash this.iKernelService = service - + if (PlatformUtils.getQQVersionCode() >= PlatformUtils.QQ_9_0_71_VER) { + this.startupSession = KernelServiceImpl::class.java.declaredFields.first { + it.type == IQQNTStartupSessionWrapper::class.java + }.also { + it.isAccessible = true + }.get(service) as IQQNTStartupSessionWrapper + } initNTKernelListener(msgService) antiBackgroundMode(sessionService) @@ -99,4 +108,6 @@ internal object NTServiceFetcher { val kernelService: IKernelService get() = iKernelService + val startupSessionWrapper: IQQNTStartupSessionWrapper + get() = startupSession } \ No newline at end of file