mirror of
https://github.com/whitechi73/OpenShamrock.git
synced 2024-08-14 05:12:17 +00:00
Compare commits
8 Commits
36ed55d220
...
v1.0.9
Author | SHA1 | Date | |
---|---|---|---|
976526ab79 | |||
cdc9ca1a72 | |||
609e87d0ec | |||
cf01a25ea6 | |||
f090ef1937 | |||
1cc033498c | |||
7eaa470dd2 | |||
c49861d982 |
@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
## 简介
|
## 简介
|
||||||
|
|
||||||
☘ 基于 Lsposed(**Non**-Riru) 实现 OneBot 标准的 QQ 机器人框架,原作者[**fuqiuluo**](https://github.com/fuqiuluo)已脱离开发,接下来由白池接手哦!本项目为OpenShamrock,不会有任何收费行为,欢迎大家的加入!
|
☘ 基于 Lsposed(**Non**-Riru) 实现 OneBot 标准的 QQ 机器人框架!
|
||||||
|
|
||||||
> 本项目仅提供学习与交流用途,请在24小时内删除。
|
> 本项目仅提供学习与交流用途,请在24小时内删除。
|
||||||
> 本项目目的是研究 Xposed 和 LSPosed 框架的使用。 Epic 框架开发相关知识。
|
> 本项目目的是研究 Xposed 和 LSPosed 框架的使用。 Epic 框架开发相关知识。
|
||||||
@ -27,6 +27,8 @@
|
|||||||
|
|
||||||
## 兼容|迁移|替代 说明
|
## 兼容|迁移|替代 说明
|
||||||
|
|
||||||
|
仅支持QQ9.0.70以上的版本,低版本问题将不再修复与处理。
|
||||||
|
|
||||||
- 一键移植:本项目基于 go-cqhttp 的文档进行开发实现。
|
- 一键移植:本项目基于 go-cqhttp 的文档进行开发实现。
|
||||||
- 平行部署:可多平台部署,未来将会支持 Docker 部署的教程。
|
- 平行部署:可多平台部署,未来将会支持 Docker 部署的教程。
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ data class RKeyInfo(
|
|||||||
@ProtoNumber(2) val rkeyTtlSec: ULong?,
|
@ProtoNumber(2) val rkeyTtlSec: ULong?,
|
||||||
@ProtoNumber(3) val storeId: UInt = 0u,
|
@ProtoNumber(3) val storeId: UInt = 0u,
|
||||||
@ProtoNumber(4) val rkeyCreateTime: UInt?,
|
@ProtoNumber(4) val rkeyCreateTime: UInt?,
|
||||||
@ProtoNumber(4) val type: UInt,
|
@ProtoNumber(5) val type: UInt,
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
@ -146,6 +146,7 @@ public class TroopInfo {
|
|||||||
public byte[] troopInfoExtByte;
|
public byte[] troopInfoExtByte;
|
||||||
public String troopLevelMap;
|
public String troopLevelMap;
|
||||||
public String troopRemark;
|
public String troopRemark;
|
||||||
|
@Deprecated
|
||||||
public String troopcode;
|
public String troopcode;
|
||||||
public short troopface;
|
public short troopface;
|
||||||
public String troopmemo;
|
public String troopmemo;
|
||||||
@ -154,6 +155,7 @@ public class TroopInfo {
|
|||||||
public int trooptype;
|
public int trooptype;
|
||||||
public String troopuin;
|
public String troopuin;
|
||||||
public long udwCmdUinRingtoneID;
|
public long udwCmdUinRingtoneID;
|
||||||
|
@Deprecated
|
||||||
public String uin;
|
public String uin;
|
||||||
public int wClickBAFTipCount;
|
public int wClickBAFTipCount;
|
||||||
public int wInsertBAFTipCount;
|
public int wInsertBAFTipCount;
|
||||||
|
@ -1,63 +1,92 @@
|
|||||||
package com.tencent.mobileqq.data.troop;
|
package com.tencent.mobileqq.data.troop;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
import com.tencent.qqnt.kernelpublic.nativeinterface.MemberRole;
|
||||||
|
|
||||||
public class TroopMemberInfo {
|
public class TroopMemberInfo {
|
||||||
public long active_point;
|
public static final long VALUE_DISTANCE_TO_SELF_UNKOWN = -100;
|
||||||
|
protected static final int VALUE_INVALID = -100;
|
||||||
|
public static final long VALUE_MEMBER_CLOSE_SHARE_LBS = -1001;
|
||||||
|
|
||||||
public int addState;
|
public int addState;
|
||||||
public byte age;
|
|
||||||
public String alias;
|
@Deprecated(since = "推荐使用TroopMemberNickInfo")
|
||||||
public String autoremark;
|
public String autoremark;
|
||||||
public long cmduinFlagEx3Grocery;
|
|
||||||
public long credit_level;
|
public long credit_level;
|
||||||
public long datetime;
|
|
||||||
public String displayedNamePinyinFirst;
|
public String displayedNamePinyinFirst;
|
||||||
public short faceid;
|
|
||||||
|
@Nullable
|
||||||
|
public TroopMemberInfoExt extInfo;
|
||||||
|
|
||||||
|
@Deprecated(since = "推荐使用TroopMemberNickInfo")
|
||||||
public String friendnick;
|
public String friendnick;
|
||||||
public long gagTimeStamp;
|
public long gagTimeStamp;
|
||||||
public String honorList;
|
public String honorList;
|
||||||
|
public boolean isTroopFollowed;
|
||||||
|
public long join_time;
|
||||||
|
public long last_active_time;
|
||||||
|
public int level;
|
||||||
|
public int mBigClubVipType;
|
||||||
|
public byte mHonorRichFlag;
|
||||||
|
public boolean mIsShielded;
|
||||||
|
public int mVipType;
|
||||||
|
public String memberUid;
|
||||||
|
public String memberuin;
|
||||||
|
public int newRealLevel;
|
||||||
|
public TroopMemberNickInfo nickInfo;
|
||||||
|
public int realLevel;
|
||||||
|
public MemberRole role;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
|
public TroopMemberSpecialTitleInfo specialTitleInfo;
|
||||||
|
|
||||||
|
@Deprecated(since = "推荐使用TroopMemberNickInfo")
|
||||||
|
public String troopColorNick;
|
||||||
|
|
||||||
|
@Deprecated(since = "推荐使用TroopMemberNickInfo")
|
||||||
|
public int troopColorNickId;
|
||||||
|
|
||||||
|
@Deprecated(since = "推荐使用TroopMemberNickInfo")
|
||||||
|
public String troopnick;
|
||||||
|
public String troopuin;
|
||||||
|
public int globalTroopLevel = VALUE_INVALID;
|
||||||
|
public int flagEx = 0;
|
||||||
|
|
||||||
|
// QQ OLD API DATA
|
||||||
|
public long active_point;
|
||||||
|
public byte age;
|
||||||
|
public String alias;
|
||||||
|
public long cmduinFlagEx3Grocery;
|
||||||
|
public long datetime;
|
||||||
|
public short faceid;
|
||||||
public String hwCourse;
|
public String hwCourse;
|
||||||
public int hwIdentity;
|
public int hwIdentity;
|
||||||
public String hwName;
|
public String hwName;
|
||||||
public int isShowQZone;
|
public int isShowQZone;
|
||||||
public boolean isTroopFollowed;
|
|
||||||
public long join_time;
|
|
||||||
public long lastMsgUpdateHonorRichTime;
|
public long lastMsgUpdateHonorRichTime;
|
||||||
public long last_active_time;
|
|
||||||
public int level;
|
|
||||||
public int mBigClubTemplateId;
|
public int mBigClubTemplateId;
|
||||||
public int mBigClubVipLevel;
|
public int mBigClubVipLevel;
|
||||||
public int mBigClubVipType;
|
|
||||||
public int mGlamourLevel;
|
public int mGlamourLevel;
|
||||||
public byte mHonorRichFlag;
|
|
||||||
public int mIsHideBigClub;
|
public int mIsHideBigClub;
|
||||||
public boolean mIsShielded;
|
|
||||||
public String mUniqueTitle;
|
public String mUniqueTitle;
|
||||||
public int mVipLevel;
|
public int mVipLevel;
|
||||||
public int mVipTemplateId;
|
public int mVipTemplateId;
|
||||||
public int mVipType;
|
|
||||||
public String memberuin;
|
|
||||||
public int newRealLevel;
|
|
||||||
public String pyAll_autoremark;
|
public String pyAll_autoremark;
|
||||||
public String pyAll_friendnick;
|
public String pyAll_friendnick;
|
||||||
public String pyAll_troopnick;
|
public String pyAll_troopnick;
|
||||||
public String pyFirst_autoremark;
|
public String pyFirst_autoremark;
|
||||||
public String pyFirst_friendnick;
|
public String pyFirst_friendnick;
|
||||||
public String pyFirst_troopnick;
|
public String pyFirst_troopnick;
|
||||||
public int realLevel;
|
|
||||||
public String recommendRemark;
|
public String recommendRemark;
|
||||||
public byte sex;
|
public byte sex;
|
||||||
public byte status;
|
public byte status;
|
||||||
public int tribeLevel;
|
public int tribeLevel;
|
||||||
public int tribePoint;
|
public int tribePoint;
|
||||||
public String troopColorNick;
|
|
||||||
public int troopColorNickId;
|
|
||||||
public String troopnick;
|
|
||||||
public String troopremark;
|
public String troopremark;
|
||||||
public String troopuin;
|
|
||||||
public int qqVipInfo = 0;
|
public int qqVipInfo = 0;
|
||||||
public int superQqInfo = 0;
|
public int superQqInfo = 0;
|
||||||
public int superVipInfo = 0;
|
public int superVipInfo = 0;
|
||||||
public int hotChatGlamourLevel = -100;
|
public int hotChatGlamourLevel = -100;
|
||||||
public int globalTroopLevel = -100;
|
|
||||||
public int distance = 0;
|
public int distance = 0;
|
||||||
public long msgseq = -100;
|
public long msgseq = -100;
|
||||||
public double distanceToSelf = -100.0d;
|
public double distanceToSelf = -100.0d;
|
||||||
|
@ -0,0 +1,48 @@
|
|||||||
|
package com.tencent.mobileqq.data.troop;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import kotlin.jvm.JvmField;
|
||||||
|
|
||||||
|
public class TroopMemberInfoExt {
|
||||||
|
@JvmField
|
||||||
|
public int commonFrdCnt;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
public long flagEx3;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
public int hwIdentity;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
public long lastMsgUpdateHonorRichTime;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@Nullable
|
||||||
|
public String memberUin;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@Nullable
|
||||||
|
public byte[] nickIconRepeatMsgBuffer;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@Nullable
|
||||||
|
public String recommendRemark;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@Nullable
|
||||||
|
public String showNameForPinyin;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@Nullable
|
||||||
|
public String showNamePinyinAll;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@Nullable
|
||||||
|
public String showNamePinyinFirst;
|
||||||
|
|
||||||
|
@JvmField
|
||||||
|
@Nullable
|
||||||
|
public String troopUin;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,29 @@
|
|||||||
|
package com.tencent.mobileqq.data.troop;
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
public class TroopMemberSpecialTitleInfo {
|
||||||
|
public final int getExpireTimeSec() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public final String getFriendNick() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public final String getSpecialTitle() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public final String getTroopUin() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public final String getUin() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,20 +1,12 @@
|
|||||||
package com.tencent.mobileqq.qqguildsdk.data;
|
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.IGProMedalInfo;
|
||||||
import com.tencent.mobileqq.qqguildsdk.data.genc.IGProNavigationInfo;
|
import com.tencent.mobileqq.qqguildsdk.data.genc.IGProNavigationInfo;
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuild;
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild;
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuildSpeakableThreshold;
|
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProMedalInfo;
|
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProNavigationInfo;
|
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
|
|
||||||
public class GProGuildInfo implements IGProGuildInfo {
|
public class GProGuildInfo implements IGProGuildInfo {
|
||||||
|
@ -2,7 +2,7 @@ package com.tencent.mobileqq.qqguildsdk.data;
|
|||||||
|
|
||||||
import androidx.annotation.NonNull;
|
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.ArrayList;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package com.tencent.mobileqq.qqguildsdk.data;
|
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 com.tencent.qqnt.kernel.nativeinterface.GProUser;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -1,14 +1,9 @@
|
|||||||
package com.tencent.mobileqq.qqguildsdk.data.genc;
|
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.IGProGuildRoleInfo;
|
||||||
import com.tencent.mobileqq.qqguildsdk.data.IGProUserInfo;
|
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.ArrayList;
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
public class GGProGuildMemberSearchResult implements IGProGuildMemberSearchResult {
|
public class GGProGuildMemberSearchResult implements IGProGuildMemberSearchResult {
|
||||||
|
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
public final class Contact implements IKernelModel, Serializable {
|
||||||
|
int chatType;
|
||||||
|
String guildId;
|
||||||
|
String peerUid;
|
||||||
|
long serialVersionUID;
|
||||||
|
|
||||||
|
public Contact() {
|
||||||
|
this.serialVersionUID = 1L;
|
||||||
|
this.peerUid = "";
|
||||||
|
this.guildId = "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getChatType() {
|
||||||
|
return this.chatType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getGuildId() {
|
||||||
|
return this.guildId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPeerUid() {
|
||||||
|
return this.peerUid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setChatType(int i2) {
|
||||||
|
this.chatType = i2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setGuildId(String str) {
|
||||||
|
this.guildId = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPeerUid(String str) {
|
||||||
|
this.peerUid = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString() {
|
||||||
|
return "Contact{chatType=" + this.chatType + ",peerUid=" + this.peerUid + ",guildId=" + this.guildId + ",}";
|
||||||
|
}
|
||||||
|
|
||||||
|
public Contact(int i2, String str, String str2) {
|
||||||
|
this.serialVersionUID = 1L;
|
||||||
|
this.chatType = i2;
|
||||||
|
this.peerUid = str;
|
||||||
|
this.guildId = str2;
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild;
|
||||||
|
|
||||||
public final class GProJoinGuildResult {
|
public final class GProJoinGuildResult {
|
||||||
GProGuild guildInfo;
|
GProGuild guildInfo;
|
||||||
GProGuildInit guildInit;
|
GProGuildInit guildInit;
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
public final class GProJoinGuildsResult implements Serializable {
|
public final class GProJoinGuildsResult implements Serializable {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public final class GProRoleMemberList {
|
public final class GProRoleMemberList {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public final class GProSearchMemberAndRoleResult {
|
public final class GProSearchMemberAndRoleResult {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public interface IGProFetchChannelInvisibleRoleListCallback {
|
public interface IGProFetchChannelInvisibleRoleListCallback {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public interface IGProFetchChannelLiveableRoleListCallback {
|
public interface IGProFetchChannelLiveableRoleListCallback {
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild;
|
||||||
|
|
||||||
public interface IGProFetchGuildInfoCallback {
|
public interface IGProFetchGuildInfoCallback {
|
||||||
void onFetchGuildInfo(int code, String reason, GProGuild gProGuild);
|
void onFetchGuildInfo(int code, String reason, GProGuild gProGuild);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernel.nativeinterface;
|
||||||
|
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuild;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public interface IGProFetchGuildListCallback {
|
public interface IGProFetchGuildListCallback {
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
|
||||||
|
|
||||||
public interface IGProResultCallback {
|
|
||||||
void onResult(int code, String msg, GProSecurityResult result);
|
|
||||||
}
|
|
@ -1,5 +1,8 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
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.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
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;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
public interface IKernelGuildService {
|
public interface IKernelGuildService {
|
||||||
|
@ -19,11 +19,6 @@ public interface IQQNTWrapperSession {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public IKernelGuildService getGuildService() {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IKernelMsgService getMsgService() {
|
public IKernelMsgService getMsgService() {
|
||||||
return null;
|
return null;
|
||||||
@ -93,7 +88,7 @@ public interface IQQNTWrapperSession {
|
|||||||
|
|
||||||
//IKernelGroupService getGroupService();
|
//IKernelGroupService getGroupService();
|
||||||
|
|
||||||
IKernelGuildService getGuildService();
|
//IKernelGuildService getGuildService();
|
||||||
|
|
||||||
IKernelMsgService getMsgService();
|
IKernelMsgService getMsgService();
|
||||||
|
|
||||||
|
@ -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.io.Serializable;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
public final class GProGuild implements Serializable {
|
public final class GProGuild implements Serializable {
|
||||||
GProCmdUinInfo cmdUinInfo;
|
GProCmdUinInfo cmdUinInfo;
|
@ -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;
|
import java.util.ArrayList;
|
||||||
|
|
@ -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 {
|
public final class GProRoleCreateInfo {
|
||||||
boolean bHoist;
|
boolean bHoist;
|
@ -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 {
|
public interface IGProCreateRoleCallback {
|
||||||
void onCreateRoleResult(int code, String msg, GProSecurityResult result, GProGuildRole role);
|
void onCreateRoleResult(int code, String msg, GProSecurityResult result, GProGuildRole role);
|
@ -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;
|
import java.util.ArrayList;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernelgpro.nativeinterface;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.tencent.qqnt.kernel.nativeinterface;
|
package com.tencent.qqnt.kernelgpro.nativeinterface;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
@ -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;
|
import java.util.ArrayList;
|
||||||
|
|
@ -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);
|
||||||
|
}
|
@ -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<GProQQMsgListGuild> getQQMsgListGuilds(); 啥也拿不到
|
||||||
|
|
||||||
|
void fetchGuildList(ArrayList<GProGuildReqInfo> 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<GProGuild> getGroupGuildListFromCache();
|
||||||
|
|
||||||
|
ArrayList<GProGuild> 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<Long> 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<Long> addRoles, ArrayList<Long> removeRoles, IGProResultCallback cb);
|
||||||
|
|
||||||
|
void setRoleInfo(long guild, long role, GProRoleCreateInfo info, IGProResultCallback cb);
|
||||||
|
|
||||||
|
void createRole(long guildId, GProRoleCreateInfo info, ArrayList<Long> initialUsers, IGProCreateRoleCallback cb);
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,11 @@
|
|||||||
|
package com.tencent.qqnt.ntstartup.nativeinterface;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
public interface IQQNTStartupSessionWrapper {
|
||||||
|
HashMap<String, String> getSessionIdList();
|
||||||
|
|
||||||
|
int start();
|
||||||
|
|
||||||
|
int stop();
|
||||||
|
}
|
@ -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);
|
||||||
|
}
|
@ -3,10 +3,11 @@
|
|||||||
package moe.fuqiuluo.qqinterface.servlet
|
package moe.fuqiuluo.qqinterface.servlet
|
||||||
|
|
||||||
import com.tencent.mobileqq.qqguildsdk.api.IGPSService
|
import com.tencent.mobileqq.qqguildsdk.api.IGPSService
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuildRole
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProGuildRole
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProRoleCreateInfo
|
import com.tencent.qqnt.kernelgpro.nativeinterface.GProRoleCreateInfo
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProRoleMemberList
|
import com.tencent.qqnt.kernel.nativeinterface.GProRoleMemberList
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProRolePermission
|
import com.tencent.qqnt.kernel.nativeinterface.GProRolePermission
|
||||||
|
import com.tencent.qqnt.kernelgpro.nativeinterface.IQQGProWrapperSession
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
import kotlinx.coroutines.withTimeoutOrNull
|
import kotlinx.coroutines.withTimeoutOrNull
|
||||||
import kotlinx.serialization.ExperimentalSerializationApi
|
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.EMPTY_BYTE_ARRAY
|
||||||
import moe.fuqiuluo.shamrock.tools.decodeToObject
|
import moe.fuqiuluo.shamrock.tools.decodeToObject
|
||||||
import moe.fuqiuluo.shamrock.tools.decodeToOidb
|
import moe.fuqiuluo.shamrock.tools.decodeToOidb
|
||||||
import moe.fuqiuluo.shamrock.tools.slice
|
|
||||||
import moe.fuqiuluo.shamrock.utils.PlatformUtils
|
import moe.fuqiuluo.shamrock.utils.PlatformUtils
|
||||||
import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher
|
import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher
|
||||||
import moe.fuqiuluo.shamrock.xposed.helper.QQInterfaces
|
import moe.fuqiuluo.shamrock.xposed.helper.QQInterfaces
|
||||||
@ -44,7 +44,6 @@ import protobuf.qweb.DEFAULT_DEVICE_INFO
|
|||||||
import protobuf.qweb.QWebExtInfo
|
import protobuf.qweb.QWebExtInfo
|
||||||
import protobuf.qweb.QWebReq
|
import protobuf.qweb.QWebReq
|
||||||
import protobuf.qweb.QWebRsp
|
import protobuf.qweb.QWebRsp
|
||||||
import tencent.im.oidb.oidb_sso
|
|
||||||
import kotlin.coroutines.resume
|
import kotlin.coroutines.resume
|
||||||
|
|
||||||
internal object GProSvc: QQInterfaces() {
|
internal object GProSvc: QQInterfaces() {
|
||||||
@ -53,6 +52,10 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
return service.selfTinyId.toULong()
|
return service.selfTinyId.toULong()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun getNTGProSessionId(): String? {
|
||||||
|
return NTServiceFetcher.startupSessionWrapper.sessionIdList["gpro"]
|
||||||
|
}
|
||||||
|
|
||||||
suspend fun getGuildInfo(guildId: ULong): Result<Oidb0xf57MetaInfo> {
|
suspend fun getGuildInfo(guildId: ULong): Result<Oidb0xf57MetaInfo> {
|
||||||
val respBuffer = sendOidbAW("OidbSvcTrpcTcp.0xf57_9", 0xf57, 9, Oidb0xf57Req(
|
val respBuffer = sendOidbAW("OidbSvcTrpcTcp.0xf57_9", 0xf57, 9, Oidb0xf57Req(
|
||||||
filter = Oidb0xf57Filter(
|
filter = Oidb0xf57Filter(
|
||||||
@ -132,7 +135,9 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun refreshGuildInfo(guildId: ULong) {
|
fun refreshGuildInfo(guildId: ULong) {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession(
|
||||||
|
getNTGProSessionId()
|
||||||
|
).guildService
|
||||||
kernelGProService.refreshGuildInfo(guildId.toLong(), true, 1)
|
kernelGProService.refreshGuildInfo(guildId.toLong(), true, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -144,8 +149,8 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
fetchAll: Boolean = false,
|
fetchAll: Boolean = false,
|
||||||
result: ArrayList<GProRoleMemberList> = arrayListOf()
|
result: ArrayList<GProRoleMemberList> = arrayListOf()
|
||||||
): Result<Pair<GetGuildMemberListNextToken, ArrayList<GProRoleMemberList>>> {
|
): Result<Pair<GetGuildMemberListNextToken, ArrayList<GProRoleMemberList>>> {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService =
|
||||||
|
IQQGProWrapperSession.CppProxy.getGProWrapperSession(getNTGProSessionId()).guildService
|
||||||
val fetchGuildMemberListResult: Pair<GetGuildMemberListNextToken, ArrayList<GProRoleMemberList>> = (withTimeoutOrNull(5000) {
|
val fetchGuildMemberListResult: Pair<GetGuildMemberListNextToken, ArrayList<GProRoleMemberList>> = (withTimeoutOrNull(5000) {
|
||||||
suspendCancellableCoroutine {
|
suspendCancellableCoroutine {
|
||||||
kernelGProService.fetchMemberListWithRole(guildId.toLong(), 0, startIndex, roleIndex, count, 0) { code, reason, finish, nextIndex, nextRoleIdIndex, _, seq, roleList ->
|
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<GuildInfo>) {
|
private fun getGuildListByNt(result: ArrayList<GuildInfo>) {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService =
|
||||||
|
IQQGProWrapperSession.CppProxy.getGProWrapperSession(getNTGProSessionId()).guildService
|
||||||
kernelGProService.guildListFromCache.forEach {
|
kernelGProService.guildListFromCache.forEach {
|
||||||
if (it.result != 0) return@forEach
|
if (it.result != 0) return@forEach
|
||||||
val guildInfo = it.guildInfo
|
val guildInfo = it.guildInfo
|
||||||
@ -236,7 +242,9 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun fetchGuildMemberRoles(guildId: ULong, tinyId: ULong, refresh: Boolean = false): Result<ArrayList<GProGuildRole>> {
|
suspend fun fetchGuildMemberRoles(guildId: ULong, tinyId: ULong, refresh: Boolean = false): Result<ArrayList<GProGuildRole>> {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession(
|
||||||
|
getNTGProSessionId()
|
||||||
|
).guildService
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
kernelGProService.refreshGuildUserProfileInfo(guildId.toLong(), tinyId.toLong(), 1)
|
kernelGProService.refreshGuildUserProfileInfo(guildId.toLong(), tinyId.toLong(), 1)
|
||||||
}
|
}
|
||||||
@ -251,7 +259,9 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun getGuildList(refresh: Boolean = false, forceOldApi: Boolean): ArrayList<GuildInfo> {
|
fun getGuildList(refresh: Boolean = false, forceOldApi: Boolean): ArrayList<GuildInfo> {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession(
|
||||||
|
getNTGProSessionId()
|
||||||
|
).guildService
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
kernelGProService.refreshGuildList(true)
|
kernelGProService.refreshGuildList(true)
|
||||||
kernelGProService.guildListFromCache.forEach {
|
kernelGProService.guildListFromCache.forEach {
|
||||||
@ -274,7 +284,10 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getGuildRoles(guildId: ULong): Result<List<GProGuildRole>> {
|
suspend fun getGuildRoles(guildId: ULong): Result<List<GProGuildRole>> {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession(
|
||||||
|
getNTGProSessionId()
|
||||||
|
).guildService
|
||||||
|
|
||||||
val roles: List<GProGuildRole> = withTimeoutOrNull(5000) {
|
val roles: List<GProGuildRole> = withTimeoutOrNull(5000) {
|
||||||
suspendCancellableCoroutine {
|
suspendCancellableCoroutine {
|
||||||
kernelGProService.fetchRoleListWithPermission(guildId.toLong(), 1) { code, _, roles, _, _, _ ->
|
kernelGProService.fetchRoleListWithPermission(guildId.toLong(), 1) { code, _, roles, _, _, _ ->
|
||||||
@ -286,7 +299,10 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun deleteGuildRole(guildId: ULong, roleId: ULong) {
|
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 ->
|
kernelGProService.deleteRole(guildId.toLong(), roleId.toLong()) { code, msg, result ->
|
||||||
if (code != 0) {
|
if (code != 0) {
|
||||||
LogCenter.log("deleteGuildRole failed: $code($msg) => $result", Level.WARN)
|
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) {
|
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<Long>()
|
val addList = arrayListOf<Long>()
|
||||||
val rmList = arrayListOf<Long>()
|
val rmList = arrayListOf<Long>()
|
||||||
(if (isSet) addList else rmList).add(roleId.toLong())
|
(if (isSet) addList else rmList).add(roleId.toLong())
|
||||||
@ -307,7 +326,10 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getGuildRolePermission(guildId: ULong, roleId: ULong): Result<GProGuildRole> {
|
suspend fun getGuildRolePermission(guildId: ULong, roleId: ULong): Result<GProGuildRole> {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession(
|
||||||
|
getNTGProSessionId()
|
||||||
|
).guildService
|
||||||
|
|
||||||
val role: GProGuildRole = withTimeoutOrNull(5000) {
|
val role: GProGuildRole = withTimeoutOrNull(5000) {
|
||||||
suspendCancellableCoroutine {
|
suspendCancellableCoroutine {
|
||||||
kernelGProService.fetchRoleWithPermission(guildId.toLong(), roleId.toLong(), 1) { code, msg, role, _, _, _ ->
|
kernelGProService.fetchRoleWithPermission(guildId.toLong(), roleId.toLong(), 1) { code, msg, role, _, _, _ ->
|
||||||
@ -325,8 +347,12 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
val oldInfo = getGuildRolePermission(guildId, roleId).onFailure {
|
val oldInfo = getGuildRolePermission(guildId, roleId).onFailure {
|
||||||
return Result.failure(it)
|
return Result.failure(it)
|
||||||
}.getOrThrow()
|
}.getOrThrow()
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession(
|
||||||
val info = GProRoleCreateInfo(
|
getNTGProSessionId()
|
||||||
|
).guildService
|
||||||
|
|
||||||
|
val info =
|
||||||
|
GProRoleCreateInfo(
|
||||||
name, color, oldInfo.bHoist, oldInfo.rolePermissions
|
name, color, oldInfo.bHoist, oldInfo.rolePermissions
|
||||||
)
|
)
|
||||||
kernelGProService.setRoleInfo(guildId.toLong(), roleId.toLong(), info) { code, msg, result ->
|
kernelGProService.setRoleInfo(guildId.toLong(), roleId.toLong(), info) { code, msg, result ->
|
||||||
@ -338,9 +364,18 @@ internal object GProSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun createGuildRole(guildId: ULong, name: String, color: Long, initialUsers: ArrayList<Long>): Result<GProGuildRole> {
|
suspend fun createGuildRole(guildId: ULong, name: String, color: Long, initialUsers: ArrayList<Long>): Result<GProGuildRole> {
|
||||||
val kernelGProService = NTServiceFetcher.kernelService.wrapperSession.guildService
|
val kernelGProService = IQQGProWrapperSession.CppProxy.getGProWrapperSession(
|
||||||
|
getNTGProSessionId()
|
||||||
|
).guildService
|
||||||
|
|
||||||
val permission = GProRolePermission(false, arrayListOf())
|
val permission = GProRolePermission(false, arrayListOf())
|
||||||
val info = GProRoleCreateInfo(name, color, false, permission)
|
val info =
|
||||||
|
GProRoleCreateInfo(
|
||||||
|
name,
|
||||||
|
color,
|
||||||
|
false,
|
||||||
|
permission
|
||||||
|
)
|
||||||
val role: GProGuildRole = withTimeoutOrNull(5000) {
|
val role: GProGuildRole = withTimeoutOrNull(5000) {
|
||||||
suspendCancellableCoroutine {
|
suspendCancellableCoroutine {
|
||||||
kernelGProService.createRole(guildId.toLong(), info, initialUsers) { code, msg, result, role ->
|
kernelGProService.createRole(guildId.toLong(), info, initialUsers) { code, msg, result, role ->
|
||||||
|
@ -19,6 +19,7 @@ import com.tencent.protofile.join_group_link.join_group_link
|
|||||||
import com.tencent.qphone.base.remote.ToServiceMsg
|
import com.tencent.qphone.base.remote.ToServiceMsg
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.MemberInfo
|
import com.tencent.qqnt.kernel.nativeinterface.MemberInfo
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
|
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
|
||||||
|
import com.tencent.qqnt.trooplist.ITroopListRepoApi
|
||||||
import com.tencent.qqnt.troopmemberlist.ITroopMemberListRepoApi
|
import com.tencent.qqnt.troopmemberlist.ITroopMemberListRepoApi
|
||||||
import friendlist.stUinInfo
|
import friendlist.stUinInfo
|
||||||
import io.ktor.client.call.body
|
import io.ktor.client.call.body
|
||||||
@ -75,7 +76,8 @@ import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty
|
|||||||
import moe.fuqiuluo.shamrock.tools.putBuf32Long
|
import moe.fuqiuluo.shamrock.tools.putBuf32Long
|
||||||
import moe.fuqiuluo.shamrock.utils.FileUtils
|
import moe.fuqiuluo.shamrock.utils.FileUtils
|
||||||
import moe.fuqiuluo.shamrock.utils.PlatformUtils
|
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_80_VER
|
||||||
import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_8_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.AppRuntimeFetcher
|
||||||
import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher
|
import moe.fuqiuluo.shamrock.xposed.helper.NTServiceFetcher
|
||||||
@ -228,6 +230,7 @@ internal object GroupSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getGroupList(refresh: Boolean): Result<List<TroopInfo>> {
|
suspend fun getGroupList(refresh: Boolean): Result<List<TroopInfo>> {
|
||||||
|
if (PlatformUtils.getQQVersionCode() <= QQ_9_0_80_VER) {
|
||||||
val service = app.getRuntimeService(ITroopInfoService::class.java, "all")
|
val service = app.getRuntimeService(ITroopInfoService::class.java, "all")
|
||||||
|
|
||||||
var troopList = service.allTroopList
|
var troopList = service.allTroopList
|
||||||
@ -239,6 +242,15 @@ internal object GroupSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Result.success(troopList)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getNotJoinedGroupInfo(groupId: Long): Result<NotJoinedGroupInfo> {
|
suspend fun getNotJoinedGroupInfo(groupId: Long): Result<NotJoinedGroupInfo> {
|
||||||
@ -289,7 +301,7 @@ internal object GroupSvc: QQInterfaces() {
|
|||||||
var nick = getTroopMemberInfoByUinV2(groupId, userId, true).getOrThrow().let {
|
var nick = getTroopMemberInfoByUinV2(groupId, userId, true).getOrThrow().let {
|
||||||
it.troopnick.ifEmpty { it.troopremark.ifNullOrEmpty("") }
|
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 {
|
nick = getTroopMemberNickByUin(groupId, userId)?.let {
|
||||||
it.troopNick
|
it.troopNick
|
||||||
.ifNullOrEmpty(it.friendNick)
|
.ifNullOrEmpty(it.friendNick)
|
||||||
@ -476,12 +488,21 @@ internal object GroupSvc: QQInterfaces() {
|
|||||||
return groupInfo.troopowneruin == app.account
|
return groupInfo.troopowneruin == app.account
|
||||||
}
|
}
|
||||||
|
|
||||||
fun isAdmin(groupId: Long): Boolean {
|
suspend fun isAdmin(groupId: Long): Boolean {
|
||||||
|
if (PlatformUtils.getQQVersionCode() > QQ_9_0_71_VER) {
|
||||||
|
// 针对新版本api做的适配
|
||||||
|
val account = app.longAccountUin
|
||||||
|
getTroopMemberInfoByUinV2(groupId, account, false).onSuccess {
|
||||||
|
if (it.role == com.tencent.qqnt.kernelpublic.nativeinterface.MemberRole.ADMIN
|
||||||
|
|| it.role == com.tencent.qqnt.kernelpublic.nativeinterface.MemberRole.OWNER) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val service = app
|
val service = app
|
||||||
.getRuntimeService(ITroopInfoService::class.java, "all")
|
.getRuntimeService(ITroopInfoService::class.java, "all")
|
||||||
|
|
||||||
val groupInfo = service.getTroopInfo(groupId.toString())
|
val groupInfo = service.getTroopInfo(groupId.toString())
|
||||||
|
|
||||||
return groupInfo.isAdmin || groupInfo.troopowneruin == app.account
|
return groupInfo.isAdmin || groupInfo.troopowneruin == app.account
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -597,7 +618,7 @@ internal object GroupSvc: QQInterfaces() {
|
|||||||
groupId: Long,
|
groupId: Long,
|
||||||
uin: Long
|
uin: Long
|
||||||
): TroopMemberNickInfo? {
|
): TroopMemberNickInfo? {
|
||||||
if (PlatformUtils.getQQVersionCode() > QQ_9_0_65_VER) {
|
if (PlatformUtils.getQQVersionCode() > QQ_9_0_71_VER) {
|
||||||
val api = QRoute.api(ITroopMemberListRepoApi::class.java)
|
val api = QRoute.api(ITroopMemberListRepoApi::class.java)
|
||||||
return withTimeoutOrNull(5.seconds) {
|
return withTimeoutOrNull(5.seconds) {
|
||||||
suspendCancellableCoroutine<TroopMemberNickInfo> { continuation ->
|
suspendCancellableCoroutine<TroopMemberNickInfo> { continuation ->
|
||||||
@ -617,7 +638,7 @@ internal object GroupSvc: QQInterfaces() {
|
|||||||
refresh: Boolean = false
|
refresh: Boolean = false
|
||||||
): Result<TroopMemberInfo> {
|
): Result<TroopMemberInfo> {
|
||||||
var info: TroopMemberInfo? = null
|
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")
|
val service = app.getRuntimeService(ITroopMemberInfoService::class.java, "all")
|
||||||
info = service.getTroopMember(groupId.toString(), uin.toString())
|
info = service.getTroopMember(groupId.toString(), uin.toString())
|
||||||
if (refresh || !service.isMemberInCache(groupId.toString(), uin.toString()) || info == null || info.troopnick == null) {
|
if (refresh || !service.isMemberInCache(groupId.toString(), uin.toString()) || info == null || info.troopnick == null) {
|
||||||
|
@ -30,7 +30,7 @@ internal object NtMsgElementConverter {
|
|||||||
MsgConstant.KELEMTYPEMARKETFACE to NtMsgElementConverter::convertMarketFaceElem,
|
MsgConstant.KELEMTYPEMARKETFACE to NtMsgElementConverter::convertMarketFaceElem,
|
||||||
MsgConstant.KELEMTYPEARKSTRUCT to NtMsgElementConverter::convertStructJsonElem,
|
MsgConstant.KELEMTYPEARKSTRUCT to NtMsgElementConverter::convertStructJsonElem,
|
||||||
MsgConstant.KELEMTYPEREPLY to NtMsgElementConverter::convertReplyElem,
|
MsgConstant.KELEMTYPEREPLY to NtMsgElementConverter::convertReplyElem,
|
||||||
MsgConstant.KELEMTYPEGRAYTIP to NtMsgElementConverter::convertGrayTipsElem,
|
//MsgConstant.KELEMTYPEGRAYTIP to NtMsgElementConverter::convertGrayTipsElem,
|
||||||
MsgConstant.KELEMTYPEFILE to NtMsgElementConverter::convertFileElem,
|
MsgConstant.KELEMTYPEFILE to NtMsgElementConverter::convertFileElem,
|
||||||
MsgConstant.KELEMTYPEMARKDOWN to NtMsgElementConverter::convertMarkdownElem,
|
MsgConstant.KELEMTYPEMARKDOWN to NtMsgElementConverter::convertMarkdownElem,
|
||||||
//MsgConstant.KELEMTYPEMULTIFORWARD to MsgElementConverter::convertXmlMultiMsgElem,
|
//MsgConstant.KELEMTYPEMULTIFORWARD to MsgElementConverter::convertXmlMultiMsgElem,
|
||||||
|
@ -15,6 +15,7 @@ import com.tencent.qqnt.kernel.nativeinterface.VideoElement
|
|||||||
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
|
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
|
||||||
import kotlinx.atomicfu.atomic
|
import kotlinx.atomicfu.atomic
|
||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.withTimeoutOrNull
|
import kotlinx.coroutines.withTimeoutOrNull
|
||||||
import moe.fuqiuluo.qqinterface.servlet.TicketSvc
|
import moe.fuqiuluo.qqinterface.servlet.TicketSvc
|
||||||
import moe.fuqiuluo.qqinterface.servlet.transfile.data.TryUpPicData
|
import moe.fuqiuluo.qqinterface.servlet.transfile.data.TryUpPicData
|
||||||
@ -45,6 +46,7 @@ import protobuf.oidb.cmd0x11c5.IndexNode
|
|||||||
import protobuf.oidb.cmd0x11c5.MultiMediaReqHead
|
import protobuf.oidb.cmd0x11c5.MultiMediaReqHead
|
||||||
import protobuf.oidb.cmd0x11c5.NtV2RichMediaReq
|
import protobuf.oidb.cmd0x11c5.NtV2RichMediaReq
|
||||||
import protobuf.oidb.cmd0x11c5.NtV2RichMediaRsp
|
import protobuf.oidb.cmd0x11c5.NtV2RichMediaRsp
|
||||||
|
import protobuf.oidb.cmd0x11c5.RKeyInfo
|
||||||
import protobuf.oidb.cmd0x11c5.SceneInfo
|
import protobuf.oidb.cmd0x11c5.SceneInfo
|
||||||
import protobuf.oidb.cmd0x11c5.UploadInfo
|
import protobuf.oidb.cmd0x11c5.UploadInfo
|
||||||
import protobuf.oidb.cmd0x11c5.UploadReq
|
import protobuf.oidb.cmd0x11c5.UploadReq
|
||||||
@ -63,6 +65,8 @@ import kotlin.time.Duration
|
|||||||
import kotlin.time.Duration.Companion.seconds
|
import kotlin.time.Duration.Companion.seconds
|
||||||
|
|
||||||
internal object NtV2RichMediaSvc: QQInterfaces() {
|
internal object NtV2RichMediaSvc: QQInterfaces() {
|
||||||
|
private lateinit var cacheRKeyInfo: DownloadRkeyRsp
|
||||||
|
private var lastRefreshRKeyTime = 0L
|
||||||
private val requestIdSeq = atomic(2L)
|
private val requestIdSeq = atomic(2L)
|
||||||
|
|
||||||
fun fetchGroupResUploadTo(): String {
|
fun fetchGroupResUploadTo(): String {
|
||||||
@ -325,6 +329,9 @@ internal object NtV2RichMediaSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suspend fun getTempNtRKey(): Result<DownloadRkeyRsp> {
|
suspend fun getTempNtRKey(): Result<DownloadRkeyRsp> {
|
||||||
|
if (System.currentTimeMillis() - lastRefreshRKeyTime < 60 * 60_000 && ::cacheRKeyInfo.isInitialized) {
|
||||||
|
return Result.success(cacheRKeyInfo)
|
||||||
|
}
|
||||||
runCatching {
|
runCatching {
|
||||||
val req = NtV2RichMediaReq(
|
val req = NtV2RichMediaReq(
|
||||||
head = MultiMediaReqHead(
|
head = MultiMediaReqHead(
|
||||||
@ -350,6 +357,8 @@ internal object NtV2RichMediaSvc: QQInterfaces() {
|
|||||||
}
|
}
|
||||||
val trpc = fromServiceMsg.decodeToTrpcOidb()
|
val trpc = fromServiceMsg.decodeToTrpcOidb()
|
||||||
trpc.buffer.decodeProtobuf<NtV2RichMediaRsp>().downloadRkeyRsp?.let {
|
trpc.buffer.decodeProtobuf<NtV2RichMediaRsp>().downloadRkeyRsp?.let {
|
||||||
|
cacheRKeyInfo = it
|
||||||
|
lastRefreshRKeyTime = System.currentTimeMillis()
|
||||||
return Result.success(it)
|
return Result.success(it)
|
||||||
}
|
}
|
||||||
}.onFailure {
|
}.onFailure {
|
||||||
|
@ -11,6 +11,7 @@ import com.tencent.qqnt.kernel.nativeinterface.PicElement
|
|||||||
import kotlinx.coroutines.suspendCancellableCoroutine
|
import kotlinx.coroutines.suspendCancellableCoroutine
|
||||||
import kotlinx.serialization.ExperimentalSerializationApi
|
import kotlinx.serialization.ExperimentalSerializationApi
|
||||||
import moe.fuqiuluo.qqinterface.servlet.transfile.NtV2RichMediaSvc.getNtPicRKey
|
import moe.fuqiuluo.qqinterface.servlet.transfile.NtV2RichMediaSvc.getNtPicRKey
|
||||||
|
import moe.fuqiuluo.qqinterface.servlet.transfile.NtV2RichMediaSvc.getTempNtRKey
|
||||||
import moe.fuqiuluo.shamrock.helper.ContactHelper
|
import moe.fuqiuluo.shamrock.helper.ContactHelper
|
||||||
import moe.fuqiuluo.shamrock.helper.Level
|
import moe.fuqiuluo.shamrock.helper.Level
|
||||||
import moe.fuqiuluo.shamrock.helper.LogCenter
|
import moe.fuqiuluo.shamrock.helper.LogCenter
|
||||||
@ -160,7 +161,7 @@ internal object RichProtoSvc: QQInterfaces() {
|
|||||||
): String {
|
): String {
|
||||||
val isNtServer = originalUrl.startsWith("/download")
|
val isNtServer = originalUrl.startsWith("/download")
|
||||||
if (isNtServer) {
|
if (isNtServer) {
|
||||||
val tmpRKey = NtV2RichMediaSvc.getTempNtRKey()
|
val tmpRKey = getTempNtRKey()
|
||||||
if (tmpRKey.isSuccess) {
|
if (tmpRKey.isSuccess) {
|
||||||
val tmpRKeyRsp = tmpRKey.getOrThrow()
|
val tmpRKeyRsp = tmpRKey.getOrThrow()
|
||||||
val tmpRKeyMap = hashMapOf<UInt, String>()
|
val tmpRKeyMap = hashMapOf<UInt, String>()
|
||||||
@ -168,10 +169,10 @@ internal object RichProtoSvc: QQInterfaces() {
|
|||||||
tmpRKeyMap[rKeyInfo.type] = rKeyInfo.rkey
|
tmpRKeyMap[rKeyInfo.type] = rKeyInfo.rkey
|
||||||
}
|
}
|
||||||
val rkey = tmpRKeyMap[when(chatType) {
|
val rkey = tmpRKeyMap[when(chatType) {
|
||||||
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> 10u
|
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> 20u
|
||||||
MsgConstant.KCHATTYPEC2C -> 20u
|
MsgConstant.KCHATTYPEC2C -> 10u
|
||||||
MsgConstant.KCHATTYPEGUILD -> 10u
|
MsgConstant.KCHATTYPEGUILD -> 20u
|
||||||
else -> 0u
|
else -> 20u
|
||||||
}]
|
}]
|
||||||
if (rkey != null) {
|
if (rkey != null) {
|
||||||
return "https://$MULTIMEDIA_DOMAIN$originalUrl$rkey"
|
return "https://$MULTIMEDIA_DOMAIN$originalUrl$rkey"
|
||||||
@ -231,6 +232,23 @@ internal object RichProtoSvc: QQInterfaces() {
|
|||||||
val isNtServer = originalUrl.startsWith("/download")
|
val isNtServer = originalUrl.startsWith("/download")
|
||||||
val domain = if (isNtServer) MULTIMEDIA_DOMAIN else GPRO_PIC
|
val domain = if (isNtServer) MULTIMEDIA_DOMAIN else GPRO_PIC
|
||||||
if (originalUrl.isNotEmpty()) {
|
if (originalUrl.isNotEmpty()) {
|
||||||
|
// 高于QQ9.0.70,可以直接请求获取rkey
|
||||||
|
val tmpRKey = getTempNtRKey().onFailure {
|
||||||
|
LogCenter.log("getTempNtRKey: ${it.stackTraceToString()}", Level.WARN)
|
||||||
|
}
|
||||||
|
if (tmpRKey.isSuccess) {
|
||||||
|
val tmpRKeyRsp = tmpRKey.getOrThrow()
|
||||||
|
val tmpRKeyMap = hashMapOf<UInt, String>()
|
||||||
|
tmpRKeyRsp.rkeys?.forEach { rKeyInfo ->
|
||||||
|
tmpRKeyMap[rKeyInfo.type] = rKeyInfo.rkey
|
||||||
|
}
|
||||||
|
val rkey = tmpRKeyMap[20u]
|
||||||
|
if (rkey != null) {
|
||||||
|
return "https://$MULTIMEDIA_DOMAIN$originalUrl$rkey"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 低于QQ9.0.70但是支持nt资源的客户端支持
|
||||||
if (isNtServer && !originalUrl.contains("rkey=")) {
|
if (isNtServer && !originalUrl.contains("rkey=")) {
|
||||||
getNtPicRKey(
|
getNtPicRKey(
|
||||||
fileId = fileId,
|
fileId = fileId,
|
||||||
@ -267,6 +285,21 @@ internal object RichProtoSvc: QQInterfaces() {
|
|||||||
val isNtServer = storeId == 1 || originalUrl.startsWith("/download")
|
val isNtServer = storeId == 1 || originalUrl.startsWith("/download")
|
||||||
val domain = if (isNtServer) MULTIMEDIA_DOMAIN else C2C_PIC
|
val domain = if (isNtServer) MULTIMEDIA_DOMAIN else C2C_PIC
|
||||||
if (originalUrl.isNotEmpty()) {
|
if (originalUrl.isNotEmpty()) {
|
||||||
|
// 高于QQ9.0.70,可以直接请求获取rkey
|
||||||
|
val tmpRKey = getTempNtRKey()
|
||||||
|
if (tmpRKey.isSuccess) {
|
||||||
|
val tmpRKeyRsp = tmpRKey.getOrThrow()
|
||||||
|
val tmpRKeyMap = hashMapOf<UInt, String>()
|
||||||
|
tmpRKeyRsp.rkeys?.forEach { rKeyInfo ->
|
||||||
|
tmpRKeyMap[rKeyInfo.type] = rKeyInfo.rkey
|
||||||
|
}
|
||||||
|
val rkey = tmpRKeyMap[10u]
|
||||||
|
if (rkey != null) {
|
||||||
|
return "https://$MULTIMEDIA_DOMAIN$originalUrl$rkey"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 低于QQ9.0.70但是支持nt资源的客户端支持
|
||||||
if (fileId.isNotEmpty()) getNtPicRKey(
|
if (fileId.isNotEmpty()) getNtPicRKey(
|
||||||
fileId = fileId,
|
fileId = fileId,
|
||||||
md5 = md5,
|
md5 = md5,
|
||||||
|
@ -17,7 +17,7 @@ internal object BanTroopMember: IActionHandler() {
|
|||||||
return invoke(groupId, userId, duration, session.echo)
|
return invoke(groupId, userId, duration, session.echo)
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun invoke(
|
suspend operator fun invoke(
|
||||||
groupId: Long,
|
groupId: Long,
|
||||||
userId: Long,
|
userId: Long,
|
||||||
duration: Int = 30 * 60,
|
duration: Int = 30 * 60,
|
||||||
|
@ -1,15 +1,18 @@
|
|||||||
package moe.fuqiuluo.shamrock.remote.action.handlers
|
package moe.fuqiuluo.shamrock.remote.action.handlers
|
||||||
|
|
||||||
import com.tencent.mobileqq.data.Card
|
import com.tencent.mobileqq.data.Card
|
||||||
|
import com.tencent.mobileqq.data.troop.TroopMemberInfo
|
||||||
|
import com.tencent.qqnt.kernelpublic.nativeinterface.MemberRole as NtMemberRole
|
||||||
import kotlinx.serialization.json.JsonElement
|
import kotlinx.serialization.json.JsonElement
|
||||||
import moe.fuqiuluo.qqinterface.servlet.GroupSvc
|
import moe.fuqiuluo.qqinterface.servlet.GroupSvc
|
||||||
import moe.fuqiuluo.shamrock.remote.action.ActionSession
|
import moe.fuqiuluo.shamrock.remote.action.ActionSession
|
||||||
import moe.fuqiuluo.shamrock.remote.action.IActionHandler
|
import moe.fuqiuluo.shamrock.remote.action.IActionHandler
|
||||||
import moe.fuqiuluo.shamrock.remote.service.data.SimpleTroopMemberInfo
|
import moe.fuqiuluo.shamrock.remote.service.data.SimpleTroopMemberInfo
|
||||||
|
import moe.fuqiuluo.shamrock.remote.service.data.push.MemberRole
|
||||||
import moe.fuqiuluo.shamrock.tools.EmptyJsonString
|
import moe.fuqiuluo.shamrock.tools.EmptyJsonString
|
||||||
import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty
|
import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty
|
||||||
import moe.fuqiuluo.shamrock.utils.PlatformUtils
|
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
|
import moe.fuqiuluo.symbols.OneBotHandler
|
||||||
|
|
||||||
@OneBotHandler("get_group_member_info")
|
@OneBotHandler("get_group_member_info")
|
||||||
@ -32,13 +35,60 @@ internal object GetTroopMemberInfo : IActionHandler() {
|
|||||||
return error(it.message ?: "unknown error", echo)
|
return error(it.message ?: "unknown error", echo)
|
||||||
}.getOrThrow()
|
}.getOrThrow()
|
||||||
|
|
||||||
return ok(
|
val code = PlatformUtils.getQQVersionCode()
|
||||||
SimpleTroopMemberInfo(
|
return ok(when {
|
||||||
|
(code >= QQ_9_0_71_VER) -> ntQQApiData(groupId, userId, info)
|
||||||
|
else -> oldQQApiData(groupId, userId, info)
|
||||||
|
}, echo)
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun ntQQApiData(groupId: Long, userId: Long, info: TroopMemberInfo): SimpleTroopMemberInfo {
|
||||||
|
return SimpleTroopMemberInfo(
|
||||||
uin = info.memberuin.toLong(),
|
uin = info.memberuin.toLong(),
|
||||||
name = info.friendnick.ifNullOrEmpty(info.autoremark) ?: "",
|
name = info.friendnick.ifNullOrEmpty(info.autoremark) ?: "",
|
||||||
showName = info.troopnick.ifNullOrEmpty(info.troopColorNick),
|
showName = info.troopnick.ifNullOrEmpty(info.troopColorNick),
|
||||||
cardName = info.troopnick.ifNullOrEmpty(info.troopColorNick),
|
cardName = info.troopnick.ifNullOrEmpty(info.troopColorNick),
|
||||||
distance = info.distance,
|
distance = 0,
|
||||||
|
honor = GroupSvc.parseHonor(info.honorList),
|
||||||
|
joinTime = info.join_time,
|
||||||
|
lastActiveTime = info.last_active_time,
|
||||||
|
uniqueName = null,
|
||||||
|
groupId = groupId,
|
||||||
|
nick = info.friendnick.ifNullOrEmpty(info.autoremark) ?: "",
|
||||||
|
sex = "unknown",
|
||||||
|
area = "",
|
||||||
|
lastSentTime = info.last_active_time,
|
||||||
|
level = info.level,
|
||||||
|
role = when(info.role) {
|
||||||
|
NtMemberRole.UNSPECIFIED -> MemberRole.Unknown
|
||||||
|
NtMemberRole.STRANGER -> MemberRole.Stranger
|
||||||
|
NtMemberRole.MEMBER -> MemberRole.Member
|
||||||
|
NtMemberRole.ADMIN -> MemberRole.Admin
|
||||||
|
NtMemberRole.OWNER -> MemberRole.Owner
|
||||||
|
null -> MemberRole.Unknown
|
||||||
|
},
|
||||||
|
unfriendly = false,
|
||||||
|
title = "",
|
||||||
|
titleExpireTime = 0,
|
||||||
|
cardChangeable = info.role == NtMemberRole.OWNER || info.role == NtMemberRole.ADMIN,
|
||||||
|
age = 0,
|
||||||
|
shutUpTimestamp = 0L
|
||||||
|
).also {
|
||||||
|
if (info.specialTitleInfo != null) {
|
||||||
|
it.uniqueName = info.specialTitleInfo?.specialTitle ?: ""
|
||||||
|
it.title = info.specialTitleInfo?.specialTitle ?: ""
|
||||||
|
it.titleExpireTime = info.specialTitleInfo?.expireTimeSec ?: 0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private suspend fun oldQQApiData(groupId: Long, userId: Long, info: TroopMemberInfo): SimpleTroopMemberInfo {
|
||||||
|
return SimpleTroopMemberInfo(
|
||||||
|
uin = info.memberuin.toLong(),
|
||||||
|
name = info.friendnick.ifNullOrEmpty(info.autoremark) ?: "",
|
||||||
|
showName = info.troopnick.ifNullOrEmpty(info.troopColorNick),
|
||||||
|
cardName = info.troopnick.ifNullOrEmpty(info.troopColorNick),
|
||||||
|
distance = 0,
|
||||||
honor = GroupSvc.parseHonor(info.honorList),
|
honor = GroupSvc.parseHonor(info.honorList),
|
||||||
joinTime = info.join_time,
|
joinTime = info.join_time,
|
||||||
lastActiveTime = info.last_active_time,
|
lastActiveTime = info.last_active_time,
|
||||||
@ -50,7 +100,7 @@ internal object GetTroopMemberInfo : IActionHandler() {
|
|||||||
Card.MALE -> "male"
|
Card.MALE -> "male"
|
||||||
else -> "unknown"
|
else -> "unknown"
|
||||||
},
|
},
|
||||||
area = info.alias ?: "",
|
area = "",
|
||||||
lastSentTime = info.last_active_time,
|
lastSentTime = info.last_active_time,
|
||||||
level = info.level,
|
level = info.level,
|
||||||
role = GroupSvc.getMemberRole(groupId, userId),
|
role = GroupSvc.getMemberRole(groupId, userId),
|
||||||
@ -60,8 +110,12 @@ internal object GetTroopMemberInfo : IActionHandler() {
|
|||||||
cardChangeable = GroupSvc.isAdmin(groupId),
|
cardChangeable = GroupSvc.isAdmin(groupId),
|
||||||
age = info.age.toInt(),
|
age = info.age.toInt(),
|
||||||
shutUpTimestamp = 0L
|
shutUpTimestamp = 0L
|
||||||
), echo
|
).also {
|
||||||
)
|
if (PlatformUtils.getQQVersionCode() <= QQ_9_0_71_VER) {
|
||||||
|
it.distance = info.distance
|
||||||
|
it.area = info.alias
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override val requiredParams: Array<String> = arrayOf("user_id", "group_id")
|
override val requiredParams: Array<String> = arrayOf("user_id", "group_id")
|
||||||
|
@ -17,7 +17,7 @@ internal object ModifyTroopMemberName: IActionHandler() {
|
|||||||
return invoke(groupId, userId, name, session.echo)
|
return invoke(groupId, userId, name, session.echo)
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun invoke(groupId: Long, userId: Long, card: String, echo: JsonElement = EmptyJsonString): String {
|
suspend operator fun invoke(groupId: Long, userId: Long, card: String, echo: JsonElement = EmptyJsonString): String {
|
||||||
if (!GroupSvc.isAdmin(groupId) && userId != TicketSvc.getUin().toLong()) {
|
if (!GroupSvc.isAdmin(groupId) && userId != TicketSvc.getUin().toLong()) {
|
||||||
return logic("you are not admin", echo)
|
return logic("you are not admin", echo)
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ internal object ModifyTroopName: IActionHandler() {
|
|||||||
return invoke(groupId, groupName, session.echo)
|
return invoke(groupId, groupName, session.echo)
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun invoke(groupId: Long, name: String, echo: JsonElement = EmptyJsonString): String {
|
suspend operator fun invoke(groupId: Long, name: String, echo: JsonElement = EmptyJsonString): String {
|
||||||
return if (GroupSvc.isAdmin(groupId)) {
|
return if (GroupSvc.isAdmin(groupId)) {
|
||||||
GroupSvc.modifyTroopName(groupId, name)
|
GroupSvc.modifyTroopName(groupId, name)
|
||||||
ok("成功", echo)
|
ok("成功", echo)
|
||||||
|
@ -27,18 +27,18 @@ internal data class SimpleTroopMemberInfo(
|
|||||||
@SerialName("user_name") val name: String,
|
@SerialName("user_name") val name: String,
|
||||||
@SerialName("sex") val sex: String,
|
@SerialName("sex") val sex: String,
|
||||||
@SerialName("age") val age: Int,
|
@SerialName("age") val age: Int,
|
||||||
@SerialName("title") val title: String,
|
@SerialName("title") var title: String?,
|
||||||
@SerialName("title_expire_time") val titleExpireTime: Int,
|
@SerialName("title_expire_time") var titleExpireTime: Int,
|
||||||
@SerialName("nickname") val nick: String,
|
@SerialName("nickname") val nick: String,
|
||||||
@SerialName("user_displayname") val showName: String?,
|
@SerialName("user_displayname") val showName: String?,
|
||||||
@SerialName("card") val cardName: String?,
|
@SerialName("card") val cardName: String?,
|
||||||
@SerialName("distance") val distance: Int,
|
@SerialName("distance") var distance: Int,
|
||||||
@SerialName("honor") val honor: List<Int>,
|
@SerialName("honor") val honor: List<Int>,
|
||||||
@SerialName("join_time") val joinTime: Long,
|
@SerialName("join_time") val joinTime: Long,
|
||||||
@SerialName("last_active_time") val lastActiveTime: Long,
|
@SerialName("last_active_time") val lastActiveTime: Long,
|
||||||
@SerialName("last_sent_time") val lastSentTime: Long,
|
@SerialName("last_sent_time") val lastSentTime: Long,
|
||||||
@SerialName("unique_name") val uniqueName: String?,
|
@SerialName("unique_name") var uniqueName: String?,
|
||||||
@SerialName("area") val area: String,
|
@SerialName("area") var area: String,
|
||||||
@SerialName("level") val level: Int,
|
@SerialName("level") val level: Int,
|
||||||
@SerialName("role") val role: MemberRole,
|
@SerialName("role") val role: MemberRole,
|
||||||
@SerialName("unfriendly") val unfriendly: Boolean,
|
@SerialName("unfriendly") val unfriendly: Boolean,
|
||||||
|
@ -42,6 +42,7 @@ internal object AioListener : IKernelMsgListener {
|
|||||||
try {
|
try {
|
||||||
if (MessageTempHandler.notify(record)) return
|
if (MessageTempHandler.notify(record)) return
|
||||||
if (record.msgSeq < 0) return
|
if (record.msgSeq < 0) return
|
||||||
|
if (record.chatType == MsgConstant.KCHATTYPETEMPPUBLICACCOUNT) return // 订阅号不处理
|
||||||
|
|
||||||
val msgHash = MessageHelper.generateMsgIdHash(record.chatType, record.msgId)
|
val msgHash = MessageHelper.generateMsgIdHash(record.chatType, record.msgId)
|
||||||
|
|
||||||
|
@ -12,12 +12,12 @@ import com.tencent.qqnt.kernel.nativeinterface.GProCreateGuildGuideInfo
|
|||||||
import com.tencent.qqnt.kernel.nativeinterface.GProDailyRecommendPush
|
import com.tencent.qqnt.kernel.nativeinterface.GProDailyRecommendPush
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProDiscoveryStateChangedMsg
|
import com.tencent.qqnt.kernel.nativeinterface.GProDiscoveryStateChangedMsg
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGlobalBanner
|
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.GProGuildData
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuildInit
|
import com.tencent.qqnt.kernel.nativeinterface.GProGuildInit
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuildListSortInfo
|
import com.tencent.qqnt.kernel.nativeinterface.GProGuildListSortInfo
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuildMemberCountInfo
|
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.GProGuildSpeakableThreshold
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuildStateRspInfo
|
import com.tencent.qqnt.kernel.nativeinterface.GProGuildStateRspInfo
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProGuildUserProfile
|
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.GProWorldState
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.GProYLGameTeamInfo
|
import com.tencent.qqnt.kernel.nativeinterface.GProYLGameTeamInfo
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.IKernelGuildListener
|
import com.tencent.qqnt.kernel.nativeinterface.IKernelGuildListener
|
||||||
import moe.fuqiuluo.shamrock.helper.LogCenter
|
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
import java.util.HashMap
|
import java.util.HashMap
|
||||||
|
|
||||||
|
@ -17,7 +17,8 @@ import kotlin.random.Random
|
|||||||
|
|
||||||
internal object PlatformUtils {
|
internal object PlatformUtils {
|
||||||
const val QQ_9_0_8_VER = 5540
|
const val QQ_9_0_8_VER = 5540
|
||||||
const val QQ_9_0_65_VER = 6566
|
const val QQ_9_0_71_VER = 6702
|
||||||
|
const val QQ_9_0_80_VER = 6869
|
||||||
|
|
||||||
fun getQUA(): String {
|
fun getQUA(): String {
|
||||||
return "V1_AND_SQ_${getQQVersion(MobileQQ.getContext())}_${getQQVersionCode()}_YYB_D"
|
return "V1_AND_SQ_${getQQVersion(MobileQQ.getContext())}_${getQQVersionCode()}_YYB_D"
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
package moe.fuqiuluo.shamrock.xposed.helper
|
package moe.fuqiuluo.shamrock.xposed.helper
|
||||||
|
|
||||||
import com.tencent.qqnt.kernel.api.IKernelService
|
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.api.impl.MsgService
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.IOperateCallback
|
import com.tencent.qqnt.kernel.nativeinterface.IOperateCallback
|
||||||
import com.tencent.qqnt.kernel.nativeinterface.IQQNTWrapperSession
|
import com.tencent.qqnt.kernel.nativeinterface.IQQNTWrapperSession
|
||||||
|
import com.tencent.qqnt.ntstartup.nativeinterface.IQQNTStartupSessionWrapper
|
||||||
import kotlinx.coroutines.sync.Mutex
|
import kotlinx.coroutines.sync.Mutex
|
||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
import moe.fuqiuluo.shamrock.helper.Level
|
import moe.fuqiuluo.shamrock.helper.Level
|
||||||
@ -15,6 +17,7 @@ import moe.fuqiuluo.shamrock.utils.PlatformUtils
|
|||||||
|
|
||||||
internal object NTServiceFetcher {
|
internal object NTServiceFetcher {
|
||||||
private lateinit var iKernelService: IKernelService
|
private lateinit var iKernelService: IKernelService
|
||||||
|
private lateinit var startupSession: IQQNTStartupSessionWrapper
|
||||||
private val lock = Mutex()
|
private val lock = Mutex()
|
||||||
private var curKernelHash = 0
|
private var curKernelHash = 0
|
||||||
|
|
||||||
@ -30,7 +33,13 @@ internal object NTServiceFetcher {
|
|||||||
LogCenter.log("Fetch kernel service successfully: $curKernelHash,$curHash,${PlatformUtils.isMainProcess()}")
|
LogCenter.log("Fetch kernel service successfully: $curKernelHash,$curHash,${PlatformUtils.isMainProcess()}")
|
||||||
curKernelHash = curHash
|
curKernelHash = curHash
|
||||||
this.iKernelService = service
|
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)
|
initNTKernelListener(msgService)
|
||||||
antiBackgroundMode(sessionService)
|
antiBackgroundMode(sessionService)
|
||||||
@ -99,4 +108,6 @@ internal object NTServiceFetcher {
|
|||||||
|
|
||||||
val kernelService: IKernelService
|
val kernelService: IKernelService
|
||||||
get() = iKernelService
|
get() = iKernelService
|
||||||
|
val startupSessionWrapper: IQQNTStartupSessionWrapper
|
||||||
|
get() = startupSession
|
||||||
}
|
}
|
Reference in New Issue
Block a user