Compare commits

..

No commits in common. "master" and "1.1.0-ntrnm" have entirely different histories.

67 changed files with 320 additions and 1635 deletions

View File

@ -21,7 +21,6 @@ labels: bug
## 系统信息
- Shamrock 版本:
- QQ 版本:
- Android 版本:
- LSPosed 框架版本:
- 设备的制造商和型号:

View File

@ -23,13 +23,9 @@
> Riru可能导致封禁请减少使用。
> 如有违反法律,请联系删除。
> 请勿在任何平台宣传,宣扬,转发本项目,请勿恶意修改企业安装包造成相关企业产生损失,如有违背,必将追责到底。
>
> 社区地址:[discord](https://discord.gg/MKR2wz863h)
## 兼容|迁移|替代 说明
仅支持QQ9.0.70以上的版本,低版本问题将不再修复与处理。
- 一键移植:本项目基于 go-cqhttp 的文档进行开发实现。
- 平行部署:可多平台部署。

View File

@ -17,7 +17,7 @@ android {
minSdk = 27
targetSdk = 34
versionCode = getVersionCode()
versionName = "1.1.1" + ".r${getGitCommitCount()}." + getVersionName()
versionName = "1.1.0" + ".r${getGitCommitCount()}." + getVersionName()
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {

View File

@ -162,7 +162,7 @@ private fun FunctionCard(
Function(
title = "主动RPC",
desc = "Kritor协议实现RPC由Shamrock放出rpc服务",
desc = "Kritor协议实现RPC",
isSwitch = ShamrockConfig[ctx, ActiveRPC]
) {
ShamrockConfig[ctx, ActiveRPC] = it
@ -171,7 +171,7 @@ private fun FunctionCard(
Function(
title = "被动RPC",
desc = "Kritor协议实现RPC由客户端提供反向的rpc服务",
desc = "Kritor协议实现RPC",
isSwitch = ShamrockConfig[ctx, PassiveRPC]
) {
ShamrockConfig[ctx, PassiveRPC] = it

@ -1 +1 @@
Subproject commit 3dec747a8ec60aa80d5d7b55bb26244706c769be
Subproject commit 27669a8f5704a8876658a47cc976f1fb3e9cc2f4

View File

@ -8,9 +8,7 @@ import moe.fuqiuluo.symbols.Protobuf
data class TrpcOidb(
@ProtoNumber(1) val cmd: Int = Int.MIN_VALUE,
@ProtoNumber(2) val service: Int = Int.MIN_VALUE,
@ProtoNumber(3) val result: UInt? = null,
@ProtoNumber(4) val buffer: ByteArray? = null,
@ProtoNumber(5) val msg: String? = null,
@ProtoNumber(4) val buffer: ByteArray,
//@ProtoNumber(11) val traceParams: Map<String, String> = mapOf(),
@ProtoNumber(12) val flag: Int = Int.MIN_VALUE,
): Protobuf<TrpcOidb>

View File

@ -94,8 +94,7 @@ data class DeleteReq(
@Serializable
data class DownloadRkeyReq(
@ProtoNumber(1) val types: List<Int>,
@ProtoNumber(2) val downloadType: Int
@ProtoNumber(1) val types: List<Int>
)
@Serializable

View File

@ -52,11 +52,11 @@ data class DownloadRkeyRsp(
@Serializable
data class RKeyInfo(
@ProtoNumber(1) val rkey: String,
@ProtoNumber(1) val rkey: String?,
@ProtoNumber(2) val rkeyTtlSec: ULong?,
@ProtoNumber(3) val storeId: UInt = 0u,
@ProtoNumber(4) val rkeyCreateTime: UInt?,
@ProtoNumber(4) val type: UInt,
@ProtoNumber(4) val type: UInt?,
)
@Serializable

View File

@ -1,9 +1,7 @@
package com.tencent.qphone.base.util;
public abstract class CodecWarpper {
// public abstract void onResponse(int i2, Object obj, int i3);
public abstract void onInvalidData(int i2, int i3, String str);
public abstract void onResponse(int i2, Object obj, int i3);
public abstract void onResponse(int i2, Object obj, int i3, byte[] bArr);

View File

@ -1,7 +1,7 @@
package com.tencent.qqnt.aio.api;
import com.tencent.mobileqq.qroute.QRouteApi;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import com.tencent.qqnt.kernel.nativeinterface.Contact;
import com.tencent.qqnt.kernel.nativeinterface.IOperateCallback;
public interface IAIOFileTransfer extends QRouteApi {

View File

@ -1,4 +0,0 @@
package com.tencent.qqnt.kernel.api.impl;
public class GroupService {
}

View File

@ -1,6 +1,4 @@
package com.tencent.qqnt.kernelpublic.nativeinterface;
import com.tencent.qqnt.kernel.nativeinterface.IKernelModel;
package com.tencent.qqnt.kernel.nativeinterface;
import java.io.Serializable;

View File

@ -1,7 +1,5 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import java.util.ArrayList;

View File

@ -1,4 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class GProGuildTopFeedMsg {
}

View File

@ -1,7 +1,5 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import java.util.ArrayList;

View File

@ -1,36 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
import java.util.ArrayList;
public class GroupMemberCommonListResult {
public long groupCode;
public int identifyFlag;
public long startUin;
public ArrayList<MemberCommonInfo> memberList = new ArrayList<>();
public String strErrorInfo = "";
public long getGroupCode() {
return this.groupCode;
}
public int getIdentifyFlag() {
return this.identifyFlag;
}
public ArrayList<MemberCommonInfo> getMemberList() {
return this.memberList;
}
public long getStartUin() {
return this.startUin;
}
public String getStrErrorInfo() {
return this.strErrorInfo;
}
public String toString() {
return "GroupMemberCommonListResult{groupCode=" + this.groupCode + ",startUin=" + this.startUin + ",identifyFlag=" + this.identifyFlag + ",memberList=" + this.memberList + ",strErrorInfo=" + this.strErrorInfo + ",}";
}
}

View File

@ -1,101 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
import java.util.ArrayList;
public class GroupMemberCommonReq {
public long groupCode;
public int sourceType;
public String startUin = "";
public String identifyFlag = "";
public ArrayList<Long> uinList = new ArrayList<>();
public MemberCommonInfoFilter memberCommonFilter = new MemberCommonInfoFilter();
public String memberNum = "";
public String filterMethod = "";
public String onlineFlag = "";
public String realSpecialTitleFlag = "";
public String getFilterMethod() {
return this.filterMethod;
}
public long getGroupCode() {
return this.groupCode;
}
public String getIdentifyFlag() {
return this.identifyFlag;
}
public MemberCommonInfoFilter getMemberCommonFilter() {
return this.memberCommonFilter;
}
public String getMemberNum() {
return this.memberNum;
}
public String getOnlineFlag() {
return this.onlineFlag;
}
public String getRealSpecialTitleFlag() {
return this.realSpecialTitleFlag;
}
public int getSourceType() {
return this.sourceType;
}
public String getStartUin() {
return this.startUin;
}
public ArrayList<Long> getUinList() {
return this.uinList;
}
public void setFilterMethod(String str) {
this.filterMethod = str;
}
public void setGroupCode(long j2) {
this.groupCode = j2;
}
public void setIdentifyFlag(String str) {
this.identifyFlag = str;
}
public void setMemberCommonFilter(MemberCommonInfoFilter memberCommonInfoFilter) {
this.memberCommonFilter = memberCommonInfoFilter;
}
public void setMemberNum(String str) {
this.memberNum = str;
}
public void setOnlineFlag(String str) {
this.onlineFlag = str;
}
public void setRealSpecialTitleFlag(String str) {
this.realSpecialTitleFlag = str;
}
public void setSourceType(int i2) {
this.sourceType = i2;
}
public void setStartUin(String str) {
this.startUin = str;
}
public void setUinList(ArrayList<Long> arrayList) {
this.uinList = arrayList;
}
public String toString() {
return "GroupMemberCommonReq{groupCode=" + this.groupCode + ",startUin=" + this.startUin + ",identifyFlag=" + this.identifyFlag + ",uinList=" + this.uinList + ",memberCommonFilter=" + this.memberCommonFilter + ",memberNum=" + this.memberNum + ",filterMethod=" + this.filterMethod + ",onlineFlag=" + this.onlineFlag + ",realSpecialTitleFlag=" + this.realSpecialTitleFlag + ",sourceType=" + this.sourceType + ",}";
}
}

View File

@ -1,81 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
import java.util.ArrayList;
public class GroupMemberExtListResult {
public long dataTime;
public long endUin;
public long groupCode;
public int levelNameSeq;
public int memberInfoSeq;
public int sysShowFlag;
public int timeToUpdate;
public int userShowFlag;
public int userShowFlagNew;
public ArrayList<MemberExtInfo> memberLevelInfo = new ArrayList<>();
public ArrayList<MemberLevelName> msgLevelName = new ArrayList<>();
public String strOwnerName = "";
public String strAdminName = "";
public ArrayList<MemberLevelName> msgLevelNameNew = new ArrayList<>();
public long getDataTime() {
return this.dataTime;
}
public long getEndUin() {
return this.endUin;
}
public long getGroupCode() {
return this.groupCode;
}
public int getLevelNameSeq() {
return this.levelNameSeq;
}
public int getMemberInfoSeq() {
return this.memberInfoSeq;
}
public ArrayList<MemberExtInfo> getMemberLevelInfo() {
return this.memberLevelInfo;
}
public ArrayList<MemberLevelName> getMsgLevelName() {
return this.msgLevelName;
}
public ArrayList<MemberLevelName> getMsgLevelNameNew() {
return this.msgLevelNameNew;
}
public String getStrAdminName() {
return this.strAdminName;
}
public String getStrOwnerName() {
return this.strOwnerName;
}
public int getSysShowFlag() {
return this.sysShowFlag;
}
public int getTimeToUpdate() {
return this.timeToUpdate;
}
public int getUserShowFlag() {
return this.userShowFlag;
}
public int getUserShowFlagNew() {
return this.userShowFlagNew;
}
public String toString() {
return "GroupMemberExtListResult{groupCode=" + this.groupCode + ",memberLevelInfo=" + this.memberLevelInfo + ",msgLevelName=" + this.msgLevelName + ",endUin=" + this.endUin + ",dataTime=" + this.dataTime + ",userShowFlag=" + this.userShowFlag + ",sysShowFlag=" + this.sysShowFlag + ",timeToUpdate=" + this.timeToUpdate + ",strOwnerName=" + this.strOwnerName + ",strAdminName=" + this.strAdminName + ",levelNameSeq=" + this.levelNameSeq + ",userShowFlagNew=" + this.userShowFlagNew + ",msgLevelNameNew=" + this.msgLevelNameNew + ",memberInfoSeq=" + this.memberInfoSeq + ",}";
}
}

View File

@ -1,101 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
import java.util.ArrayList;
public class GroupMemberExtReq {
public long groupCode;
public int sourceType;
public String beginUin = "";
public String dataTime = "";
public ArrayList<Long> uinList = new ArrayList<>();
public MemberExtInfoFilter memberExtFilter = new MemberExtInfoFilter();
public String seq = "";
public String uinNum = "";
public String groupType = "";
public String richCardNameVer = "";
public String getBeginUin() {
return this.beginUin;
}
public String getDataTime() {
return this.dataTime;
}
public long getGroupCode() {
return this.groupCode;
}
public String getGroupType() {
return this.groupType;
}
public MemberExtInfoFilter getMemberExtFilter() {
return this.memberExtFilter;
}
public String getRichCardNameVer() {
return this.richCardNameVer;
}
public String getSeq() {
return this.seq;
}
public int getSourceType() {
return this.sourceType;
}
public ArrayList<Long> getUinList() {
return this.uinList;
}
public String getUinNum() {
return this.uinNum;
}
public void setBeginUin(String str) {
this.beginUin = str;
}
public void setDataTime(String str) {
this.dataTime = str;
}
public void setGroupCode(long j2) {
this.groupCode = j2;
}
public void setGroupType(String str) {
this.groupType = str;
}
public void setMemberExtFilter(MemberExtInfoFilter memberExtInfoFilter) {
this.memberExtFilter = memberExtInfoFilter;
}
public void setRichCardNameVer(String str) {
this.richCardNameVer = str;
}
public void setSeq(String str) {
this.seq = str;
}
public void setSourceType(int i2) {
this.sourceType = i2;
}
public void setUinList(ArrayList<Long> arrayList) {
this.uinList = arrayList;
}
public void setUinNum(String str) {
this.uinNum = str;
}
public String toString() {
return "GroupMemberExtReq{groupCode=" + this.groupCode + ",beginUin=" + this.beginUin + ",dataTime=" + this.dataTime + ",uinList=" + this.uinList + ",memberExtFilter=" + this.memberExtFilter + ",seq=" + this.seq + ",uinNum=" + this.uinNum + ",groupType=" + this.groupType + ",richCardNameVer=" + this.richCardNameVer + ",sourceType=" + this.sourceType + ",}";
}
}

View File

@ -1,32 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
import java.util.ArrayList;
import java.util.HashMap;
public class GroupMemberListResult {
public boolean finish;
public boolean hasRobot;
public ArrayList<GroupMemberInfoListId> ids = new ArrayList<>();
public HashMap<String, MemberInfo> infos = new HashMap<>();
public boolean getFinish() {
return this.finish;
}
public boolean getHasRobot() {
return this.hasRobot;
}
public ArrayList<GroupMemberInfoListId> getIds() {
return this.ids;
}
public HashMap<String, MemberInfo> getInfos() {
return this.infos;
}
public String toString() {
return "GroupMemberListResult{ids=" + this.ids + ",infos=" + this.infos + ",finish=" + this.finish + ",hasRobot=" + this.hasRobot + ",}";
}
}

View File

@ -1,6 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public interface IGroupMemberCommonCallback {
void onResult(int i2, String str, GroupMemberCommonListResult groupMemberCommonListResult);
}

View File

@ -1,5 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public interface IGroupMemberExtCallback {
void onResult(int i2, String str, GroupMemberExtListResult groupMemberExtListResult);
}

View File

@ -1,6 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public interface IGroupMemberListCallback {
void onResult(int result, String str, GroupMemberListResult groupMemberListResult);
}

View File

@ -1,25 +1,7 @@
package com.tencent.qqnt.kernel.nativeinterface;
import java.util.ArrayList;
public interface IKernelGroupService {
void getTransferableMemberInfo(long uin, IGetTransferableMemberCallback cb);
long addKernelGroupListener(IKernelGroupListener ln);
void getAllMemberList(long groupCode, boolean refresh, IGroupMemberListCallback iGroupMemberListCallback);
void getMemberCommonInfo(GroupMemberCommonReq groupMemberCommonReq, IGroupMemberCommonCallback iGroupMemberCommonCallback);
void getMemberExtInfo(GroupMemberExtReq groupMemberExtReq, IGroupMemberExtCallback iGroupMemberExtCallback);
void getMemberInfo(long j2, ArrayList<String> arrayList, boolean z, IOperateCallback iOperateCallback);
void getMemberInfoForMqq(long groupCode, ArrayList<String> uids, boolean z, IGroupMemberListCallback iGroupMemberListCallback);
void getNextMemberList(String sceneId, GroupMemberInfoListId groupMemberInfoListId, int i2, IGroupMemberListCallback iGroupMemberListCallback);
void getPrevMemberList(String sceneId, GroupMemberInfoListId groupMemberInfoListId, int i2, IGroupMemberListCallback iGroupMemberListCallback);
}

View File

@ -1,7 +1,5 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import java.util.ArrayList;
import java.util.HashMap;
@ -18,7 +16,7 @@ public interface IKernelMsgListener {
void onCustomWithdrawConfigUpdate(CustomWithdrawConfig customWithdrawConfig);
void onDraftUpdate(Contact contact, ArrayList<MsgElement> arrayList, long j);
void onDraftUpdate(Contact contact, ArrayList<MsgElement> arrayList, long j2);
void onEmojiDownloadComplete(EmojiNotifyInfo emojiNotifyInfo);
@ -32,7 +30,7 @@ public interface IKernelMsgListener {
void onFirstViewGroupGuildMapping(ArrayList<FirstViewGroupGuildInfo> arrayList);
void onGrabPasswordRedBag(int i, String str, int i2, RecvdOrder recvdOrder, MsgRecord msgRecord);
void onGrabPasswordRedBag(int i2, String str, int i3, RecvdOrder recvdOrder, MsgRecord msgRecord);
void onGroupFileInfoAdd(GroupItem groupItem);
@ -50,8 +48,6 @@ public interface IKernelMsgListener {
void onGuildNotificationAbstractUpdate(GuildNotificationAbstractInfo guildNotificationAbstractInfo);
void onGuildTopFeedUpdate(GProGuildTopFeedMsg gProGuildTopFeedMsg);
void onHitCsRelatedEmojiResult(DownloadRelateEmojiResultInfo downloadRelateEmojiResultInfo);
void onHitEmojiKeywordResult(HitRelatedEmojiWordsResult hitRelatedEmojiWordsResult);
@ -66,7 +62,7 @@ public interface IKernelMsgListener {
void onLineDev(ArrayList<DevInfo> arrayList);
void onLogLevelChanged(long j);
void onLogLevelChanged(long j2);
void onMsgAbstractUpdate(ArrayList<MsgAbstract> arrayList);
@ -80,16 +76,14 @@ public interface IKernelMsgListener {
void onMsgInfoListUpdate(ArrayList<MsgRecord> arrayList);
void onMsgQRCodeStatusChanged(int i);
void onMsgQRCodeStatusChanged(int i2);
void onMsgRecall(int i, String str, long j);
void onMsgRecall(int i2, String str, long j2);
void onMsgSecurityNotify(MsgRecord msgRecord);
void onMsgSettingUpdate(MsgSetting msgSetting);
void onMsgWithRichLinkInfoUpdate(ArrayList<MsgRecord> arrayList);
void onNtFirstViewMsgSyncEnd();
void onNtMsgSyncEnd();
@ -98,11 +92,11 @@ public interface IKernelMsgListener {
void onReadFeedEventUpdate(FirstViewDirectMsgNotifyInfo firstViewDirectMsgNotifyInfo);
void onRecvGroupGuildFlag(int i);
void onRecvGroupGuildFlag(int i2);
void onRecvMsg(ArrayList<MsgRecord> arrayList);
void onRecvMsgSvrRspTransInfo(long j, Contact contact, int i, int i2, String str, byte[] bArr);
void onRecvMsgSvrRspTransInfo(long j2, Contact contact, int i2, int i3, String str, byte[] bArr);
void onRecvOnlineFileMsg(ArrayList<MsgRecord> arrayList);
@ -110,9 +104,7 @@ public interface IKernelMsgListener {
void onRecvSysMsg(ArrayList<Byte> arrayList);
void onRecvUDCFlag(int i);
void onRedTouchChanged();
void onRecvUDCFlag(int i2);
void onRichMediaDownloadComplete(FileTransNotifyInfo fileTransNotifyInfo);
@ -122,9 +114,9 @@ public interface IKernelMsgListener {
void onSearchGroupFileInfoUpdate(SearchGroupFileResult searchGroupFileResult);
void onSendMsgError(long j, Contact contact, int i, String str);
void onSendMsgError(long j2, Contact contact, int i2, String str);
void onSysMsgNotification(int i, long j, long j2, boolean z, ArrayList<Byte> arrayList);
void onSysMsgNotification(int i2, long j2, long j3, ArrayList<Byte> arrayList);
void onTempChatInfoUpdate(TempChatInfo tempChatInfo);
@ -136,11 +128,9 @@ public interface IKernelMsgListener {
void onUserOnlineStatusChanged(boolean z);
void onUserSecQualityChanged(QueryUserSecQualityRsp queryUserSecQualityRsp);
void onUserTabStatusChanged(ArrayList<TabStatusInfo> arrayList);
void onlineStatusBigIconDownloadPush(int i, long j, String str);
void onlineStatusBigIconDownloadPush(int i2, long j2, String str);
void onlineStatusSmallIconDownloadPush(int i, long j, String str);
void onlineStatusSmallIconDownloadPush(int i2, long j2, String str);
}

View File

@ -1,7 +1,5 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import org.jetbrains.annotations.NotNull;
import java.util.ArrayList;

View File

@ -1,7 +1,5 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import java.util.ArrayList;
public interface IKernelRichMediaService {

View File

@ -1,63 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class MemberCommonInfo {
public long memberUin;
public int privilege;
public int shutUpTime;
public int uinFlag;
public int uinFlagExt;
public int uinMobileFlag;
public long getMemberUin() {
return this.memberUin;
}
public int getPrivilege() {
return this.privilege;
}
public int getShutUpTime() {
return this.shutUpTime;
}
public int getUinFlag() {
return this.uinFlag;
}
public int getUinFlagExt() {
return this.uinFlagExt;
}
public int getUinMobileFlag() {
return this.uinMobileFlag;
}
public void setMemberUin(long j2) {
this.memberUin = j2;
}
public void setPrivilege(int i2) {
this.privilege = i2;
}
public void setShutUpTime(int i2) {
this.shutUpTime = i2;
}
public void setUinFlag(int i2) {
this.uinFlag = i2;
}
public void setUinFlagExt(int i2) {
this.uinFlagExt = i2;
}
public void setUinMobileFlag(int i2) {
this.uinMobileFlag = i2;
}
public String toString() {
return "MemberCommonInfo{memberUin=" + this.memberUin + ",uinFlag=" + this.uinFlag + ",uinFlagExt=" + this.uinFlagExt + ",uinMobileFlag=" + this.uinMobileFlag + ",shutUpTime=" + this.shutUpTime + ",privilege=" + this.privilege + ",}";
}
}

View File

@ -1,63 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class MemberCommonInfoFilter {
public int memberUin;
public int privilege;
public int shutUpTime;
public int uinFlag;
public int uinFlagExt;
public int uinMobileFlag;
public int getMemberUin() {
return this.memberUin;
}
public int getPrivilege() {
return this.privilege;
}
public int getShutUpTime() {
return this.shutUpTime;
}
public int getUinFlag() {
return this.uinFlag;
}
public int getUinFlagExt() {
return this.uinFlagExt;
}
public int getUinMobileFlag() {
return this.uinMobileFlag;
}
public void setMemberUin(int i2) {
this.memberUin = i2;
}
public void setPrivilege(int i2) {
this.privilege = i2;
}
public void setShutUpTime(int i2) {
this.shutUpTime = i2;
}
public void setUinFlag(int i2) {
this.uinFlag = i2;
}
public void setUinFlagExt(int i2) {
this.uinFlagExt = i2;
}
public void setUinMobileFlag(int i2) {
this.uinMobileFlag = i2;
}
public String toString() {
return "MemberCommonInfoFilter{memberUin=" + this.memberUin + ",uinFlag=" + this.uinFlag + ",uinFlagExt=" + this.uinFlagExt + ",uinMobileFlag=" + this.uinMobileFlag + ",shutUpTime=" + this.shutUpTime + ",privilege=" + this.privilege + ",}";
}
}

View File

@ -1,110 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
import java.util.ArrayList;
public class MemberExtInfo {
public int activeDay;
public int cmdUinFlagExt3Grocery;
public int level;
public int point;
public long specialTitleExpireTime;
public long uin;
public String strName = "";
public String nickName = "";
public String specialTitle = "";
public byte[] msgNeedField = new byte[0];
public ArrayList<MemberIcon> memberIconList = new ArrayList<>();
public int getActiveDay() {
return this.activeDay;
}
public int getCmdUinFlagExt3Grocery() {
return this.cmdUinFlagExt3Grocery;
}
public int getLevel() {
return this.level;
}
public ArrayList<MemberIcon> getMemberIconList() {
return this.memberIconList;
}
public byte[] getMsgNeedField() {
return this.msgNeedField;
}
public String getNickName() {
return this.nickName;
}
public int getPoint() {
return this.point;
}
public String getSpecialTitle() {
return this.specialTitle;
}
public long getSpecialTitleExpireTime() {
return this.specialTitleExpireTime;
}
public String getStrName() {
return this.strName;
}
public long getUin() {
return this.uin;
}
public void setActiveDay(int i2) {
this.activeDay = i2;
}
public void setCmdUinFlagExt3Grocery(int i2) {
this.cmdUinFlagExt3Grocery = i2;
}
public void setLevel(int i2) {
this.level = i2;
}
public void setMemberIconList(ArrayList<MemberIcon> arrayList) {
this.memberIconList = arrayList;
}
public void setMsgNeedField(byte[] bArr) {
this.msgNeedField = bArr;
}
public void setNickName(String str) {
this.nickName = str;
}
public void setPoint(int i2) {
this.point = i2;
}
public void setSpecialTitle(String str) {
this.specialTitle = str;
}
public void setSpecialTitleExpireTime(long j2) {
this.specialTitleExpireTime = j2;
}
public void setStrName(String str) {
this.strName = str;
}
public void setUin(long j2) {
this.uin = j2;
}
public String toString() {
return "MemberExtInfo{uin=" + this.uin + ",point=" + this.point + ",activeDay=" + this.activeDay + ",level=" + this.level + ",strName=" + this.strName + ",nickName=" + this.nickName + ",specialTitle=" + this.specialTitle + ",specialTitleExpireTime=" + this.specialTitleExpireTime + ",msgNeedField=" + this.msgNeedField + ",cmdUinFlagExt3Grocery=" + this.cmdUinFlagExt3Grocery + ",memberIconList=" + this.memberIconList + ",}";
}
}

View File

@ -1,171 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class MemberExtInfoFilter {
public int cmdUinFlagExt3Grocery;
public int dataTime;
public int levelName;
public int levelNameNew;
public int memberIcon;
public int memberInfoSeq;
public int memberLevelInfoActiveDay;
public int memberLevelInfoLevel;
public int memberLevelInfoName;
public int memberLevelInfoPoint;
public int memberLevelInfoUin;
public int msgNeedField;
public int nickName;
public int specialTitle;
public int sysShowFlag;
public int timeToUpdate;
public int userShowFlag;
public int userShowFlagNew;
public int getCmdUinFlagExt3Grocery() {
return this.cmdUinFlagExt3Grocery;
}
public int getDataTime() {
return this.dataTime;
}
public int getLevelName() {
return this.levelName;
}
public int getLevelNameNew() {
return this.levelNameNew;
}
public int getMemberIcon() {
return this.memberIcon;
}
public int getMemberInfoSeq() {
return this.memberInfoSeq;
}
public int getMemberLevelInfoActiveDay() {
return this.memberLevelInfoActiveDay;
}
public int getMemberLevelInfoLevel() {
return this.memberLevelInfoLevel;
}
public int getMemberLevelInfoName() {
return this.memberLevelInfoName;
}
public int getMemberLevelInfoPoint() {
return this.memberLevelInfoPoint;
}
public int getMemberLevelInfoUin() {
return this.memberLevelInfoUin;
}
public int getMsgNeedField() {
return this.msgNeedField;
}
public int getNickName() {
return this.nickName;
}
public int getSpecialTitle() {
return this.specialTitle;
}
public int getSysShowFlag() {
return this.sysShowFlag;
}
public int getTimeToUpdate() {
return this.timeToUpdate;
}
public int getUserShowFlag() {
return this.userShowFlag;
}
public int getUserShowFlagNew() {
return this.userShowFlagNew;
}
public void setCmdUinFlagExt3Grocery(int i2) {
this.cmdUinFlagExt3Grocery = i2;
}
public void setDataTime(int i2) {
this.dataTime = i2;
}
public void setLevelName(int i2) {
this.levelName = i2;
}
public void setLevelNameNew(int i2) {
this.levelNameNew = i2;
}
public void setMemberIcon(int i2) {
this.memberIcon = i2;
}
public void setMemberInfoSeq(int i2) {
this.memberInfoSeq = i2;
}
public void setMemberLevelInfoActiveDay(int i2) {
this.memberLevelInfoActiveDay = i2;
}
public void setMemberLevelInfoLevel(int i2) {
this.memberLevelInfoLevel = i2;
}
public void setMemberLevelInfoName(int i2) {
this.memberLevelInfoName = i2;
}
public void setMemberLevelInfoPoint(int i2) {
this.memberLevelInfoPoint = i2;
}
public void setMemberLevelInfoUin(int i2) {
this.memberLevelInfoUin = i2;
}
public void setMsgNeedField(int i2) {
this.msgNeedField = i2;
}
public void setNickName(int i2) {
this.nickName = i2;
}
public void setSpecialTitle(int i2) {
this.specialTitle = i2;
}
public void setSysShowFlag(int i2) {
this.sysShowFlag = i2;
}
public void setTimeToUpdate(int i2) {
this.timeToUpdate = i2;
}
public void setUserShowFlag(int i2) {
this.userShowFlag = i2;
}
public void setUserShowFlagNew(int i2) {
this.userShowFlagNew = i2;
}
public String toString() {
return "MemberExtInfoFilter{memberLevelInfoUin=" + this.memberLevelInfoUin + ",memberLevelInfoPoint=" + this.memberLevelInfoPoint + ",memberLevelInfoActiveDay=" + this.memberLevelInfoActiveDay + ",memberLevelInfoLevel=" + this.memberLevelInfoLevel + ",memberLevelInfoName=" + this.memberLevelInfoName + ",levelName=" + this.levelName + ",dataTime=" + this.dataTime + ",userShowFlag=" + this.userShowFlag + ",sysShowFlag=" + this.sysShowFlag + ",timeToUpdate=" + this.timeToUpdate + ",nickName=" + this.nickName + ",specialTitle=" + this.specialTitle + ",levelNameNew=" + this.levelNameNew + ",userShowFlagNew=" + this.userShowFlagNew + ",msgNeedField=" + this.msgNeedField + ",cmdUinFlagExt3Grocery=" + this.cmdUinFlagExt3Grocery + ",memberIcon=" + this.memberIcon + ",memberInfoSeq=" + this.memberInfoSeq + ",}";
}
}

View File

@ -1,29 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class MemberIcon {
public int bizId;
public byte[] exInfo = new byte[0];
public long expireTime;
public int resId;
public int getBizId() {
return this.bizId;
}
public byte[] getExInfo() {
return this.exInfo;
}
public long getExpireTime() {
return this.expireTime;
}
public int getResId() {
return this.resId;
}
public String toString() {
return "MemberIcon{resId=" + this.resId + ",expireTime=" + this.expireTime + ",bizId=" + this.bizId + ",exInfo=" + this.exInfo + ",}";
}
}

View File

@ -1,146 +1,51 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.MemberRole;
public final class MemberInfo implements IKernelModel {
public int bigClubFlag;
public int bigClubLevel;
public int cardNameId;
public int cardType;
public int creditLevel;
public int globalGroupLevel;
public int globalGroupPoint;
public boolean isDelete;
public boolean isRobot;
public boolean isSpecialConcerned;
public boolean isSpecialShielded;
public int joinTime;
public int lastSpeakTime;
public int memberFlag;
public int memberFlagExt;
public int memberFlagExt2;
public int memberLevel;
public int memberMobileFlag;
public int memberTitleId;
public int mssVipType;
public int richFlag;
public int shutUpTime;
public long specialTitleExpireTime;
public long uin;
public int userShowFlag;
public int userShowFlagNew;
long serialVersionUID = 1;
public String uid = "";
public String qid = "";
public String nick = "";
public String remark = "";
public String cardName = "";
public MemberRole role = MemberRole.values()[0];
public String avatarPath = "";
public byte[] groupHonor = new byte[0];
public String memberSpecialTitle = "";
public String autoRemark = "";
String avatarPath;
String cardName;
int cardType;
boolean isDelete;
boolean isSpecialConcerned;
String nick;
String qid;
String remark;
MemberRole role;
long serialVersionUID;
int shutUpTime;
String uid;
long uin;
public String getAutoRemark() {
return this.autoRemark;
public MemberInfo() {
this.serialVersionUID = 1L;
this.uid = "";
this.qid = "";
this.nick = "";
this.remark = "";
this.cardName = "";
this.role = MemberRole.values()[0];
this.avatarPath = "";
}
public String getAvatarPath() {
return this.avatarPath;
}
public int getBigClubFlag() {
return this.bigClubFlag;
}
public int getBigClubLevel() {
return this.bigClubLevel;
}
public String getCardName() {
return this.cardName;
}
public int getCardNameId() {
return this.cardNameId;
}
public int getCardType() {
return this.cardType;
}
public int getCreditLevel() {
return this.creditLevel;
}
public int getGlobalGroupLevel() {
return this.globalGroupLevel;
}
public int getGlobalGroupPoint() {
return this.globalGroupPoint;
}
public byte[] getGroupHonor() {
return this.groupHonor;
}
public boolean getIsDelete() {
return this.isDelete;
}
public boolean getIsRobot() {
return this.isRobot;
}
public boolean getIsSpecialConcerned() {
return this.isSpecialConcerned;
}
public boolean getIsSpecialShielded() {
return this.isSpecialShielded;
}
public int getJoinTime() {
return this.joinTime;
}
public int getLastSpeakTime() {
return this.lastSpeakTime;
}
public int getMemberFlag() {
return this.memberFlag;
}
public int getMemberFlagExt() {
return this.memberFlagExt;
}
public int getMemberFlagExt2() {
return this.memberFlagExt2;
}
public int getMemberLevel() {
return this.memberLevel;
}
public int getMemberMobileFlag() {
return this.memberMobileFlag;
}
public String getMemberSpecialTitle() {
return this.memberSpecialTitle;
}
public int getMemberTitleId() {
return this.memberTitleId;
}
public int getMssVipType() {
return this.mssVipType;
}
public String getNick() {
return this.nick;
}
@ -153,10 +58,6 @@ public final class MemberInfo implements IKernelModel {
return this.remark;
}
public int getRichFlag() {
return this.richFlag;
}
public MemberRole getRole() {
return this.role;
}
@ -165,10 +66,6 @@ public final class MemberInfo implements IKernelModel {
return this.shutUpTime;
}
public long getSpecialTitleExpireTime() {
return this.specialTitleExpireTime;
}
public String getUid() {
return this.uid;
}
@ -177,114 +74,26 @@ public final class MemberInfo implements IKernelModel {
return this.uin;
}
public int getUserShowFlag() {
return this.userShowFlag;
}
public int getUserShowFlagNew() {
return this.userShowFlagNew;
}
public void setAutoRemark(String str) {
this.autoRemark = str;
}
public void setAvatarPath(String str) {
this.avatarPath = str;
}
public void setBigClubFlag(int i2) {
this.bigClubFlag = i2;
}
public void setBigClubLevel(int i2) {
this.bigClubLevel = i2;
}
public void setCardName(String str) {
this.cardName = str;
}
public void setCardNameId(int i2) {
this.cardNameId = i2;
}
public void setCardType(int i2) {
this.cardType = i2;
}
public void setCreditLevel(int i2) {
this.creditLevel = i2;
}
public void setGlobalGroupLevel(int i2) {
this.globalGroupLevel = i2;
}
public void setGlobalGroupPoint(int i2) {
this.globalGroupPoint = i2;
}
public void setGroupHonor(byte[] bArr) {
this.groupHonor = bArr;
}
public void setIsDelete(boolean z) {
this.isDelete = z;
}
public void setIsRobot(boolean z) {
this.isRobot = z;
}
public void setIsSpecialConcerned(boolean z) {
this.isSpecialConcerned = z;
}
public void setIsSpecialShielded(boolean z) {
this.isSpecialShielded = z;
}
public void setJoinTime(int i2) {
this.joinTime = i2;
}
public void setLastSpeakTime(int i2) {
this.lastSpeakTime = i2;
}
public void setMemberFlag(int i2) {
this.memberFlag = i2;
}
public void setMemberFlagExt(int i2) {
this.memberFlagExt = i2;
}
public void setMemberFlagExt2(int i2) {
this.memberFlagExt2 = i2;
}
public void setMemberLevel(int i2) {
this.memberLevel = i2;
}
public void setMemberMobileFlag(int i2) {
this.memberMobileFlag = i2;
}
public void setMemberSpecialTitle(String str) {
this.memberSpecialTitle = str;
}
public void setMemberTitleId(int i2) {
this.memberTitleId = i2;
}
public void setMssVipType(int i2) {
this.mssVipType = i2;
}
public void setNick(String str) {
this.nick = str;
}
@ -297,10 +106,6 @@ public final class MemberInfo implements IKernelModel {
this.remark = str;
}
public void setRichFlag(int i2) {
this.richFlag = i2;
}
public void setRole(MemberRole memberRole) {
this.role = memberRole;
}
@ -309,10 +114,6 @@ public final class MemberInfo implements IKernelModel {
this.shutUpTime = i2;
}
public void setSpecialTitleExpireTime(long j2) {
this.specialTitleExpireTime = j2;
}
public void setUid(String str) {
this.uid = str;
}
@ -321,16 +122,30 @@ public final class MemberInfo implements IKernelModel {
this.uin = j2;
}
public void setUserShowFlag(int i2) {
this.userShowFlag = i2;
}
public void setUserShowFlagNew(int i2) {
this.userShowFlagNew = i2;
}
public String toString() {
return "MemberInfo{uid=" + this.uid + ",qid=" + this.qid + ",uin=" + this.uin + ",nick=" + this.nick + ",remark=" + this.remark + ",cardType=" + this.cardType + ",cardName=" + this.cardName + ",role=" + this.role + ",avatarPath=" + this.avatarPath + ",shutUpTime=" + this.shutUpTime + ",isDelete=" + this.isDelete + ",isSpecialConcerned=" + this.isSpecialConcerned + ",isRobot=" + this.isRobot + ",groupHonor=" + this.groupHonor + ",memberLevel=" + this.memberLevel + ",globalGroupLevel=" + this.globalGroupLevel + ",globalGroupPoint=" + this.globalGroupPoint + ",memberTitleId=" + this.memberTitleId + ",memberSpecialTitle=" + this.memberSpecialTitle + ",specialTitleExpireTime=" + this.specialTitleExpireTime + ",userShowFlag=" + this.userShowFlag + ",userShowFlagNew=" + this.userShowFlagNew + ",richFlag=" + this.richFlag + ",mssVipType=" + this.mssVipType + ",bigClubLevel=" + this.bigClubLevel + ",bigClubFlag=" + this.bigClubFlag + ",autoRemark=" + this.autoRemark + ",creditLevel=" + this.creditLevel + ",joinTime=" + this.joinTime + ",lastSpeakTime=" + this.lastSpeakTime + ",memberFlag=" + this.memberFlag + ",memberFlagExt=" + this.memberFlagExt + ",memberMobileFlag=" + this.memberMobileFlag + ",memberFlagExt2=" + this.memberFlagExt2 + ",isSpecialShielded=" + this.isSpecialShielded + ",cardNameId=" + this.cardNameId + ",}";
return "MemberInfo{uid=" + this.uid + ",qid=" + this.qid + ",uin=" + this.uin + ",nick=" + this.nick + ",remark=" + this.remark + ",cardType=" + this.cardType + ",cardName=" + this.cardName + ",role=" + this.role + ",avatarPath=" + this.avatarPath + ",shutUpTime=" + this.shutUpTime + ",isDelete=" + this.isDelete + ",isSpecialConcerned=" + this.isSpecialConcerned + ",}";
}
public MemberInfo(String str, String str2, long j2, String str3, String str4, int i2, String str5, MemberRole memberRole, String str6, int i3, boolean z, boolean z2) {
this.serialVersionUID = 1L;
this.uid = "";
this.qid = "";
this.nick = "";
this.remark = "";
this.cardName = "";
this.role = MemberRole.values()[0];
this.avatarPath = "";
this.uid = str;
this.qid = str2;
this.uin = j2;
this.nick = str3;
this.remark = str4;
this.cardType = i2;
this.cardName = str5;
this.role = memberRole;
this.avatarPath = str6;
this.shutUpTime = i3;
this.isDelete = z;
this.isSpecialConcerned = z2;
}
}

View File

@ -1,19 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class MemberLevelName {
public int level;
public String strName = "";
public int getLevel() {
return this.level;
}
public String getStrName() {
return this.strName;
}
public String toString() {
return "MemberLevelName{level=" + this.level + ",strName=" + this.strName + ",}";
}
}

View File

@ -1,7 +1,5 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import java.io.Serializable;
import java.util.ArrayList;

View File

@ -1,4 +0,0 @@
package com.tencent.qqnt.kernel.nativeinterface;
public class QueryUserSecQualityRsp {
}

View File

@ -1,7 +1,6 @@
package com.tencent.qqnt.kernel.nativeinterface;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
public final class UnreadCntInfo {
UnreadCnt allUnreadCnt;

View File

@ -1,9 +0,0 @@
package com.tencent.qqnt.kernelpublic.nativeinterface;
public enum MemberRole {
UNSPECIFIED,
STRANGER,
MEMBER,
ADMIN,
OWNER
}

View File

@ -2,7 +2,6 @@ package com.tencent.qqnt.msg.api;
import com.tencent.mobileqq.qroute.QRouteApi;
import com.tencent.qqnt.kernel.nativeinterface.*;
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@ -10,6 +9,7 @@ import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.HashMap;
import kotlin.Pair;
import kotlinx.coroutines.flow.Flow;
public interface IMsgService extends QRouteApi {

View File

@ -156,8 +156,8 @@ internal object FriendService : FriendServiceGrpcKt.FriendServiceCoroutineImplBa
val bundle = Bundle()
val service = QQInterfaces.app
.getRuntimeService(IProfileProtocolService::class.java, "all")
if (request.hasNick()) {
bundle.putString(IProfileProtocolConst.KEY_NICK, request.nick)
if (request.hasNickName()) {
bundle.putString(IProfileProtocolConst.KEY_NICK, request.nickName)
}
if (request.hasCompany()) {
bundle.putString(IProfileProtocolConst.KEY_COMPANY, request.company)

View File

@ -3,7 +3,6 @@ package kritor.service
import io.grpc.Status
import io.grpc.StatusRuntimeException
import io.kritor.file.*
import moe.fuqiuluo.shamrock.tools.decodeToOidb
import moe.fuqiuluo.shamrock.tools.slice
import moe.fuqiuluo.symbols.decodeProtobuf
import protobuf.auto.toByteArray
@ -34,7 +33,8 @@ internal object GroupFileService : GroupFileServiceGrpcKt.GroupFileServiceCorout
if (fromServiceMsg.wupBuffer == null) {
throw StatusRuntimeException(Status.INTERNAL.withDescription("oidb request failed"))
}
val oidbPkg = fromServiceMsg.decodeToOidb()
val oidbPkg = oidb_sso.OIDBSSOPkg()
oidbPkg.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val rsp = oidbPkg.bytes_bodybuffer.get()
.toByteArray()
.decodeProtobuf<Oidb0x6d7RespBody>()
@ -61,7 +61,8 @@ internal object GroupFileService : GroupFileServiceGrpcKt.GroupFileServiceCorout
if (fromServiceMsg.wupBuffer == null) {
throw StatusRuntimeException(Status.INTERNAL.withDescription("oidb request failed"))
}
val oidbPkg = fromServiceMsg.decodeToOidb()
val oidbPkg = oidb_sso.OIDBSSOPkg()
oidbPkg.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val rsp = oidbPkg.bytes_bodybuffer.get().toByteArray().decodeProtobuf<Oidb0x6d7RespBody>()
if (rsp.deleteFolder?.retCode != 0) {
throw StatusRuntimeException(Status.INTERNAL.withDescription("unable to delete folder: ${rsp.deleteFolder?.retCode}"))
@ -85,7 +86,8 @@ internal object GroupFileService : GroupFileServiceGrpcKt.GroupFileServiceCorout
if (fromServiceMsg.wupBuffer == null) {
throw StatusRuntimeException(Status.INTERNAL.withDescription("oidb request failed"))
}
val oidbPkg = fromServiceMsg.decodeToOidb()
val oidbPkg = oidb_sso.OIDBSSOPkg()
oidbPkg.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val rsp = oidb_0x6d6.RspBody().apply {
mergeFrom(oidbPkg.bytes_bodybuffer.get().toByteArray())
}
@ -110,7 +112,8 @@ internal object GroupFileService : GroupFileServiceGrpcKt.GroupFileServiceCorout
if (fromServiceMsg.wupBuffer == null) {
throw StatusRuntimeException(Status.INTERNAL.withDescription("oidb request failed"))
}
val oidbPkg = fromServiceMsg.decodeToOidb()
val oidbPkg = oidb_sso.OIDBSSOPkg()
oidbPkg.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val rsp = oidbPkg.bytes_bodybuffer.get().toByteArray().decodeProtobuf<Oidb0x6d7RespBody>()
if (rsp.renameFolder?.retCode != 0) {
throw StatusRuntimeException(Status.INTERNAL.withDescription("unable to rename folder: ${rsp.renameFolder?.retCode}"))

View File

@ -8,7 +8,6 @@ import moe.fuqiuluo.shamrock.helper.TroopHonorHelper.decodeHonor
import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty
import qq.service.contact.ContactHelper
import qq.service.group.GroupHelper
import tencent.im.troop.honor.troop_honor
internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase() {
@Grpc("GroupService", "BanMember")
@ -259,12 +258,12 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase(
.ifNullOrEmpty { memberInfo.friendnick } ?: ""
age = memberInfo.age.toInt()
uniqueTitle = memberInfo.mUniqueTitle ?: ""
uniqueTitleExpireTime = memberInfo.mUniqueTitleExpire.toLong()
uniqueTitleExpireTime = memberInfo.mUniqueTitleExpire
card = memberInfo.troopnick.ifNullOrEmpty { memberInfo.friendnick } ?: ""
joinTime = memberInfo.join_time
lastActiveTime = memberInfo.last_active_time
level = memberInfo.level
shutUpTime = memberInfo.gagTimeStamp
shutUpTimestamp = memberInfo.gagTimeStamp
distance = memberInfo.distance
addAllHonors((memberInfo.honorList ?: "")
@ -280,7 +279,7 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase(
@Grpc("GroupService", "GetGroupMemberList")
override suspend fun getGroupMemberList(request: GetGroupMemberListRequest): GetGroupMemberListResponse {
val memberList = GroupHelper.getGroupMemberList(
request.groupId,
request.groupId.toString(),
if (request.hasRefresh()) request.refresh else false
).onFailure {
throw StatusRuntimeException(
@ -288,28 +287,30 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase(
)
}.getOrThrow()
return GetGroupMemberListResponse.newBuilder().apply {
memberList.values.forEach { memberInfo ->
memberList.forEach { memberInfo ->
this.addGroupMembersInfo(GroupMemberInfo.newBuilder().apply {
uid = memberInfo.uid
uin = memberInfo.uin
nick = memberInfo.nick ?: ""
age = 0
uniqueTitle = memberInfo.memberSpecialTitle ?: ""
uniqueTitleExpireTime = memberInfo.specialTitleExpireTime
card = memberInfo.cardName.ifNullOrEmpty { memberInfo.nick } ?: ""
joinTime = memberInfo.joinTime.toLong()
lastActiveTime = memberInfo.lastSpeakTime.toLong()
level = memberInfo.memberLevel
shutUpTime = memberInfo.shutUpTime.toLong()
uid = ContactHelper.getUidByUinAsync(memberInfo.memberuin?.toLong() ?: 0)
uin = memberInfo.memberuin?.toLong() ?: 0
nick = memberInfo.troopnick
.ifNullOrEmpty { memberInfo.hwName }
.ifNullOrEmpty { memberInfo.troopColorNick }
.ifNullOrEmpty { memberInfo.friendnick } ?: ""
age = memberInfo.age.toInt()
uniqueTitle = memberInfo.mUniqueTitle ?: ""
uniqueTitleExpireTime = memberInfo.mUniqueTitleExpire
card = memberInfo.troopnick.ifNullOrEmpty { memberInfo.friendnick } ?: ""
joinTime = memberInfo.join_time
lastActiveTime = memberInfo.last_active_time
level = memberInfo.level
shutUpTimestamp = memberInfo.gagTimeStamp
distance = 0
addAllHonors(memberInfo.groupHonor.let { bytes ->
val honor = troop_honor.GroupUserCardHonor()
honor.mergeFrom(bytes)
honor.id.get()
})
distance = memberInfo.distance
addAllHonors((memberInfo.honorList ?: "")
.split("|")
.filter { it.isNotBlank() }
.map { it.toInt() })
unfriendly = false
cardChangeable = memberInfo.role == com.tencent.qqnt.kernelpublic.nativeinterface.MemberRole.ADMIN
cardChangeable = GroupHelper.isAdmin(request.groupId.toString())
})
}
}.build()
@ -327,7 +328,7 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase(
this.addProhibitedUsersInfo(ProhibitedUserInfo.newBuilder().apply {
uid = ContactHelper.getUidByUinAsync(it.memberUin)
uin = it.memberUin
prohibitedTime = it.shutuptimestap.toLong()
prohibitedTime = it.shutuptimestap
})
}
}.build()
@ -360,7 +361,7 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase(
maxMemberCount = groupInfo.maxMember
memberCount = groupInfo.memberCount
groupDesc = groupInfo.groupDesc
createTime = groupInfo.createTime
createTime = groupInfo.createTime.toInt()
groupFlag = groupInfo.groupFlag
groupFlagExt = groupInfo.groupFlagExt
}.build()
@ -370,25 +371,24 @@ internal object GroupService : GroupServiceGrpcKt.GroupServiceCoroutineImplBase(
@Grpc("GroupService", "GetGroupHonor")
override suspend fun getGroupHonor(request: GetGroupHonorRequest): GetGroupHonorResponse {
return GetGroupHonorResponse.newBuilder().apply {
GroupHelper.getGroupMemberList(request.groupId, true).onFailure {
GroupHelper.getGroupMemberList(request.groupId.toString(), true).onFailure {
throw StatusRuntimeException(
Status.INTERNAL.withDescription("unable to get group member list").withCause(it)
)
}.onSuccess { memberList ->
memberList.values.forEach { member ->
member.groupHonor.let { bytes ->
val honor = troop_honor.GroupUserCardHonor()
honor.mergeFrom(bytes)
honor.id.get()
}.forEach {
val honor = decodeHonor(member.uin, it, 0)
memberList.forEach { member ->
(member.honorList ?: "").split("|")
.filter { it.isNotBlank() }
.map { it.toInt() }.forEach {
val honor = decodeHonor(member.memberuin.toLong(), it, member.mHonorRichFlag)
if (honor != null) {
addGroupHonorsInfo(GroupHonorInfo.newBuilder().apply {
uid = member.uid
uin = member.uin
nick = member.nick.ifEmpty {
member.cardName
} ?: ""
uid = ContactHelper.getUidByUinAsync(member.memberuin.toLong())
uin = member.memberuin.toLong()
nick = member.troopnick
.ifNullOrEmpty { member.hwName }
.ifNullOrEmpty { member.troopColorNick }
.ifNullOrEmpty { member.friendnick } ?: ""
honorName = honor.honorName
avatar = honor.honorIconUrl
id = honor.honorId

View File

@ -1,7 +1,7 @@
package kritor.service
import com.tencent.mobileqq.qroute.QRoute
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.kernel.nativeinterface.MsgRecord
import com.tencent.qqnt.msg.api.IMsgService
@ -103,12 +103,7 @@ internal object MessageService : MessageServiceGrpcKt.MessageServiceCoroutineImp
Scene.STRANGER -> MsgConstant.KCHATTYPETEMPC2CFROMUNKNOWN
Scene.UNRECOGNIZED -> throw StatusRuntimeException(Status.INVALID_ARGUMENT.withDescription("Unrecognized scene"))
}
service.clearMsgRecords(
Contact(
chatType,
contact.peer,
contact.subPeer
), null)
service.clearMsgRecords(Contact(chatType, contact.peer, contact.subPeer), null)
return SetMessageReadResponse.newBuilder().build()
}
@ -315,7 +310,7 @@ internal object MessageService : MessageServiceGrpcKt.MessageServiceCoroutineImp
throw StatusRuntimeException(Status.INTERNAL.withCause(it))
}.getOrThrow().map { detail ->
PushMessageBody.newBuilder().apply {
this.time = detail.time.toLong()
this.time = detail.time
this.messageId = detail.qqMsgId.toString()
this.messageSeq = detail.msgSeq
this.contact = io.kritor.common.Contact.newBuilder().apply {
@ -335,7 +330,7 @@ internal object MessageService : MessageServiceGrpcKt.MessageServiceCoroutineImp
this.uid = detail.sender.uid
}.build()
detail.message?.elements?.toKritorResponseMessages(
Contact(
com.tencent.qqnt.kernel.nativeinterface.Contact(
detail.msgType,
detail.peerId.toString(),
null
@ -398,10 +393,10 @@ internal object MessageService : MessageServiceGrpcKt.MessageServiceCoroutineImp
this.messageId = it.msgId.toString()
}
this.messageSeq = it.messageSeq
this.messageTime = it.senderTime
this.messageTime = it.senderTime.toInt()
this.senderNick = it.senderNick
this.senderUin = it.senderId
this.operationTime = it.operatorTime
this.operationTime = it.operatorTime.toInt()
this.operatorNick = it.operatorNick
this.operatorUin = it.operatorId
this.jsonElements = it.messageContent.toString()

View File

@ -20,7 +20,6 @@ private val configKeys = setOf(
ResourceGroup,
RPCAddress,
RPCPort,
AliveReply,
)
internal object ShamrockConfig: Properties() {

View File

@ -42,7 +42,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
elements: ArrayList<MsgElement>,
): Boolean {
transMessageEvent(record, PushMessageBody.newBuilder().apply {
this.time = record.msgTime
this.time = record.msgTime.toInt()
this.messageId = record.msgId.toString()
this.messageSeq = record.msgSeq
this.contact = Contact.newBuilder().apply {
@ -65,7 +65,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
elements: ArrayList<MsgElement>,
): Boolean {
transMessageEvent(record, PushMessageBody.newBuilder().apply {
this.time = record.msgTime
this.time = record.msgTime.toInt()
this.messageId = record.msgId.toString()
this.messageSeq = record.msgSeq
this.contact = Contact.newBuilder().apply {
@ -90,7 +90,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
fromNick: String,
): Boolean {
transMessageEvent(record, PushMessageBody.newBuilder().apply {
this.time = record.msgTime
this.time = record.msgTime.toInt()
this.messageId = record.msgId.toString()
this.messageSeq = record.msgSeq
this.contact = Contact.newBuilder().apply {
@ -113,7 +113,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
elements: ArrayList<MsgElement>,
): Boolean {
transMessageEvent(record, PushMessageBody.newBuilder().apply {
this.time = record.msgTime
this.time = record.msgTime.toInt()
this.messageId = record.msgId.toString()
this.messageSeq = record.msgSeq
this.contact = Contact.newBuilder().apply {
@ -152,16 +152,16 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.PRIVATE_FILE_UPLOADED
this.time = msgTime
this.time = msgTime.toInt()
this.privateFileUploaded = PrivateFileUploadedNotice.newBuilder().apply {
this.fileId = fileId
this.fileName = fileName
this.operatorUid = senderUid
this.operatorUin = senderUin
this.fileSize = fileSize
this.expireTime = expireTime
this.fileSubId = fileSubId.toInt() // todo(这玩意真的是一个数字?)
this.fileUrl = url
this.expireTime = expireTime.toInt()
this.fileSubId = fileSubId
this.url = url
}.build()
}.build())
return true
@ -183,7 +183,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_FILE_UPLOADED
this.time = msgTime
this.time = msgTime.toInt()
this.groupFileUploaded = GroupFileUploadedNotice.newBuilder().apply {
this.groupId = groupId
this.operatorUid = senderUid
@ -191,7 +191,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
this.fileId = uuid
this.fileName = fileName
this.fileSize = fileSize
this.fileSubId = bizId
this.busId = bizId
this.fileUrl = url
}.build()
}.build())
@ -212,7 +212,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_SIGN_IN
this.time = time
this.time = time.toInt()
this.groupSignIn = GroupSignInNotice.newBuilder().apply {
this.groupId = groupCode
this.targetUid = ContactHelper.getUidByUinAsync(target)
@ -235,7 +235,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_POKE
this.time = time
this.time = time.toInt()
this.groupPoke = GroupPokeNotice.newBuilder().apply {
this.groupId = groupCode
this.action = action
@ -261,7 +261,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_MEMBER_INCREASE
this.time = time
this.time = time.toInt()
this.groupMemberIncrease = GroupMemberIncreasedNotice.newBuilder().apply {
this.groupId = groupCode
this.operatorUid = operatorUid
@ -285,7 +285,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_MEMBER_DECREASE
this.time = time
this.time = time.toInt()
this.groupMemberDecrease = GroupMemberDecreasedNotice.newBuilder().apply {
this.groupId = groupCode
this.operatorUid = operatorUid
@ -307,7 +307,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_ADMIN_CHANGED
this.time = msgTime
this.time = msgTime.toInt()
this.groupAdminChanged = GroupAdminChangedNotice.newBuilder().apply {
this.groupId = groupCode
this.targetUid = targetUid
@ -327,7 +327,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_WHOLE_BAN
this.time = msgTime
this.time = msgTime.toInt()
this.groupWholeBan = GroupWholeBanNotice.newBuilder().apply {
this.groupId = groupCode
this.isBan = isOpen
@ -349,7 +349,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_MEMBER_BAN
this.time = msgTime
this.time = msgTime.toInt()
this.groupMemberBan = GroupMemberBanNotice.newBuilder().apply {
this.groupId = groupCode
this.operatorUid = operatorUid
@ -376,7 +376,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_RECALL
this.time = time
this.time = time.toInt()
this.groupRecall = GroupRecallNotice.newBuilder().apply {
this.groupId = groupCode
this.operatorUid = operatorUid
@ -398,7 +398,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_CARD_CHANGED
this.time = time
this.time = time.toInt()
this.groupCardChanged = GroupCardChangedNotice.newBuilder().apply {
this.groupId = groupId
this.targetUin = targetId
@ -416,7 +416,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_MEMBER_UNIQUE_TITLE_CHANGED
this.time = time
this.time = time.toInt()
this.groupMemberUniqueTitleChanged = GroupUniqueTitleChangedNotice.newBuilder().apply {
this.groupId = groupId
this.targetUid = ContactHelper.getUidByUinAsync(targetUin)
@ -437,7 +437,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.GROUP_ESSENCE_CHANGED
this.time = time
this.time = time.toInt()
this.groupEssenceChanged = GroupEssenceMessageNotice.newBuilder().apply {
this.groupId = groupId
this.messageId = msgId.toString()
@ -465,7 +465,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.PRIVATE_POKE
this.time = msgTime
this.time = msgTime.toInt()
this.privatePoke = PrivatePokeNotice.newBuilder().apply {
this.action = action ?: ""
this.operatorUid = ContactHelper.getUidByUinAsync(operator)
@ -480,7 +480,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
suspend fun transPrivateRecall(time: Long, operator: Long, msgId: Long, tipText: String): Boolean {
pushNotice(NoticeEvent.newBuilder().apply {
this.type = NoticeEvent.NoticeType.PRIVATE_RECALL
this.time = time
this.time = time.toInt()
this.privateRecall = PrivateRecallNotice.newBuilder().apply {
this.operatorUin = operator
this.messageId = msgId.toString()
@ -499,7 +499,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
suspend fun transFriendApp(time: Long, applierUid: String, operator: Long, tipText: String, flag: String): Boolean {
pushRequest(RequestEvent.newBuilder().apply {
this.type = RequestEvent.RequestType.FRIEND_APPLY
this.time = time
this.time = time.toInt()
this.requestId = flag
this.friendApply = FriendApplyRequest.newBuilder().apply {
this.applierUid = applierUid
@ -520,7 +520,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushRequest(RequestEvent.newBuilder().apply {
this.type = RequestEvent.RequestType.GROUP_APPLY
this.time = time
this.time = time.toInt()
this.requestId = flag
this.groupApply = GroupApplyRequest.newBuilder().apply {
this.applierUid = applierUid
@ -541,7 +541,7 @@ internal object GlobalEventTransmitter : QQInterfaces() {
): Boolean {
pushRequest(RequestEvent.newBuilder().apply {
this.type = RequestEvent.RequestType.GROUP_APPLY
this.time = time
this.time = time.toInt()
this.requestId = flag
this.invitedGroup = InvitedJoinGroupRequest.newBuilder().apply {
this.inviterUid = inviterUid

View File

@ -1,33 +0,0 @@
package moe.fuqiuluo.shamrock.tools
import com.tencent.qphone.base.remote.FromServiceMsg
import moe.fuqiuluo.shamrock.helper.Level
import moe.fuqiuluo.shamrock.helper.LogCenter
import moe.fuqiuluo.shamrock.utils.DeflateTools
import moe.fuqiuluo.symbols.decodeProtobuf
import protobuf.oidb.TrpcOidb
import tencent.im.oidb.oidb_sso
fun FromServiceMsg.decodeToOidb(): oidb_sso.OIDBSSOPkg {
return kotlin.runCatching {
oidb_sso.OIDBSSOPkg().mergeFrom(wupBuffer.slice(4).let {
if (it[0] == 0x78.toByte()) DeflateTools.uncompress(it) else it
})
}.getOrElse {
oidb_sso.OIDBSSOPkg().mergeFrom(wupBuffer.let {
if (it[0] == 0x78.toByte()) DeflateTools.uncompress(it) else it
})
}
}
fun FromServiceMsg.decodeToTrpcOidb(): TrpcOidb {
return kotlin.runCatching {
wupBuffer.slice(4).let {
if (it[0] == 0x78.toByte()) DeflateTools.uncompress(it) else it
}.decodeProtobuf<TrpcOidb>()
}.getOrElse {
wupBuffer.let {
if (it[0] == 0x78.toByte()) DeflateTools.uncompress(it) else it
}.decodeProtobuf<TrpcOidb>()
}
}

View File

@ -6,21 +6,17 @@ import android.content.Context
import android.content.Context.BATTERY_SERVICE
import android.content.Intent
import android.content.IntentFilter
import android.content.pm.ApplicationInfo
import android.content.pm.PackageInfo
import android.os.BatteryManager
import android.os.Build
import android.os.Process
import android.provider.Settings
import kotlinx.serialization.Serializable
import moe.fuqiuluo.shamrock.tools.ShamrockVersion
import mqq.app.MobileQQ
import kotlin.random.Random
internal object PlatformUtils {
const val QQ_9_0_8_VER = 5540
const val QQ_9_0_65_VER = 6566
fun getQUA(): String {
return "V1_AND_SQ_${getQQVersion(MobileQQ.getContext())}_${getQQVersionCode()}_YYB_D"
@ -73,15 +69,6 @@ internal object PlatformUtils {
return MobileQQ.getMobileQQ().qqProcessName == "com.tencent.tim"
}
fun isApkInDebug(context: Context): Boolean {
try {
val info = context.applicationInfo
return (info.flags and ApplicationInfo.FLAG_DEBUGGABLE) != 0
} catch (e: Exception) {
return false
}
}
fun killProcess(context: Context, processName: String) {
for (processInfo in (context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager).runningAppProcesses) {
if (processInfo.processName == processName) {

View File

@ -5,7 +5,7 @@ import androidx.exifinterface.media.ExifInterface
import com.tencent.mobileqq.qroute.QRoute
import com.tencent.qqnt.aio.adapter.api.IAIOPttApi
import com.tencent.qqnt.kernel.nativeinterface.CommonFileInfo
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.FileTransNotifyInfo
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.kernel.nativeinterface.MsgElement
@ -20,12 +20,9 @@ import kotlinx.coroutines.suspendCancellableCoroutine
import kotlinx.coroutines.withTimeoutOrNull
import moe.fuqiuluo.shamrock.config.ResourceGroup
import moe.fuqiuluo.shamrock.config.ShamrockConfig
import moe.fuqiuluo.shamrock.helper.LogCenter
import moe.fuqiuluo.shamrock.tools.decodeToTrpcOidb
import moe.fuqiuluo.shamrock.tools.hex2ByteArray
import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty
import moe.fuqiuluo.shamrock.tools.slice
import moe.fuqiuluo.shamrock.tools.toHexString
import moe.fuqiuluo.shamrock.utils.AudioUtils
import moe.fuqiuluo.shamrock.utils.FileUtils
import moe.fuqiuluo.shamrock.utils.MediaType
@ -37,8 +34,6 @@ import protobuf.oidb.cmd0x11c5.CodecConfigReq
import protobuf.oidb.cmd0x11c5.CommonHead
import protobuf.oidb.cmd0x11c5.DownloadExt
import protobuf.oidb.cmd0x11c5.DownloadReq
import protobuf.oidb.cmd0x11c5.DownloadRkeyReq
import protobuf.oidb.cmd0x11c5.DownloadRkeyRsp
import protobuf.oidb.cmd0x11c5.FileInfo
import protobuf.oidb.cmd0x11c5.FileType
import protobuf.oidb.cmd0x11c5.IndexNode
@ -288,44 +283,6 @@ internal object NtV2RichMediaSvc: QQInterfaces() {
return Result.success(result)
}
suspend fun getTempNtRKey(): Result<DownloadRkeyRsp> {
runCatching {
val req = NtV2RichMediaReq(
head = MultiMediaReqHead(
commonHead = CommonHead(
requestId = requestIdSeq.incrementAndGet().toULong(),
cmd = 202u
),
sceneInfo = SceneInfo(
requestType = 2u,
businessType = 1u,
sceneType = 0u,
),
clientMeta = ClientMeta(2u)
),
downloadRkey = DownloadRkeyReq(
types = listOf(10, 20),
downloadType = 2
)
).toByteArray()
val fromServiceMsg = sendOidbAW("OidbSvcTrpcTcp.0x9067_202", 0x9067, 202, req, true)
if (fromServiceMsg == null || fromServiceMsg.wupBuffer == null) {
return Result.failure(Exception("failed to fetch NtTempRKey: ${fromServiceMsg?.wupBuffer?.toHexString()}"))
}
val trpc = fromServiceMsg.decodeToTrpcOidb()
if (trpc.buffer == null) {
return Result.failure(Exception("failed to fetch NtTempRKey: ${trpc.msg}"))
}
trpc.buffer?.decodeProtobuf<NtV2RichMediaRsp>()?.downloadRkeyRsp?.let {
return Result.success(it)
}
}.onFailure {
return Result.failure(it)
}
return Result.failure(Exception("failed to fetch NtTempRKey"))
}
/**
* 获取NT图片的RKEY
*/
@ -394,14 +351,9 @@ internal object NtV2RichMediaSvc: QQInterfaces() {
).toByteArray()
val fromServiceMsg = sendOidbAW("OidbSvcTrpcTcp.0x11c5_200", 4549, 200, req, true)
if (fromServiceMsg == null || fromServiceMsg.wupBuffer == null) {
return Result.failure(Exception("unable to get multimedia pic info: ${fromServiceMsg?.wupBuffer?.toHexString()}"))
return Result.failure(Exception("unable to get multimedia pic info: ${fromServiceMsg?.wupBuffer}"))
}
val trpc = fromServiceMsg.decodeToTrpcOidb()
if (trpc.buffer == null) {
return Result.failure(Exception("unable to get multimedia pic info: ${trpc.msg}"))
}
trpc.buffer?.decodeProtobuf<NtV2RichMediaRsp>()?.download?.rkeyParam?.let {
fromServiceMsg.wupBuffer.slice(4).decodeProtobuf<TrpcOidb>().buffer.decodeProtobuf<NtV2RichMediaRsp>().download?.rkeyParam?.let {
return Result.success(it)
}
}.onFailure {
@ -494,11 +446,8 @@ internal object NtV2RichMediaSvc: QQInterfaces() {
if (fromServiceMsg == null || fromServiceMsg.wupBuffer == null) {
return Result.failure(Exception("unable to request upload nt pic"))
}
val trpc = fromServiceMsg.decodeToTrpcOidb()
if (trpc.buffer == null) {
return Result.failure(Exception("unable to request upload nt pic: ${trpc.msg}"))
}
val rsp = trpc.buffer!!.decodeProtobuf<NtV2RichMediaRsp>()
val rspBuffer = fromServiceMsg.wupBuffer.slice(4).decodeProtobuf<TrpcOidb>().buffer
val rsp = rspBuffer.decodeProtobuf<NtV2RichMediaRsp>()
if (rsp.upload == null) {
return Result.failure(Exception("unable to request upload nt pic: ${rsp.head}"))
}

View File

@ -6,16 +6,11 @@ import com.tencent.mobileqq.transfile.FileMsg
import com.tencent.mobileqq.transfile.api.IProtoReqManager
import com.tencent.mobileqq.transfile.protohandler.RichProto
import com.tencent.mobileqq.transfile.protohandler.RichProtoProc
import com.tencent.qqnt.kernel.nativeinterface.Image
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.kernel.nativeinterface.MsgRecord
import com.tencent.qqnt.kernel.nativeinterface.PicElement
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlinx.serialization.ExperimentalSerializationApi
import moe.fuqiuluo.shamrock.helper.Level
import moe.fuqiuluo.shamrock.helper.LogCenter
import moe.fuqiuluo.shamrock.tools.decodeToOidb
import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty
import moe.fuqiuluo.shamrock.tools.slice
import moe.fuqiuluo.shamrock.tools.toHexString
import moe.fuqiuluo.shamrock.utils.PlatformUtils
import moe.fuqiuluo.symbols.decodeProtobuf
@ -33,6 +28,7 @@ import qq.service.contact.ContactHelper
import tencent.im.cs.cmd0x346.cmd0x346
import tencent.im.oidb.cmd0x6d6.oidb_0x6d6
import tencent.im.oidb.cmd0xe37.cmd0xe37
import tencent.im.oidb.oidb_sso
import kotlin.coroutines.resume
private const val GPRO_PIC = "gchat.qpic.cn"
@ -57,7 +53,8 @@ internal object RichProtoSvc: QQInterfaces() {
if (fromServiceMsg == null || fromServiceMsg.wupBuffer == null) {
return ""
}
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
body.bytes_bodybuffer
.get().toByteArray()
.decodeProtobuf<Oidb0xfc2RspBody>()
@ -85,7 +82,8 @@ internal object RichProtoSvc: QQInterfaces() {
if (fromServiceMsg == null || fromServiceMsg.wupBuffer == null) {
return ""
}
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val result = oidb_0x6d6.RspBody().mergeFrom(body.bytes_bodybuffer.get().toByteArray())
if (body.uint32_result.get() != 0
|| result.download_file_rsp.int32_ret_code.get() != 0) {
@ -132,7 +130,8 @@ internal object RichProtoSvc: QQInterfaces() {
}
return ""
} else {
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val result = cmd0x346.RspBody().mergeFrom(cmd0xe37.Resp0xe37().mergeFrom(
body.bytes_bodybuffer.get().toByteArray()
).bytes_cmd_0x346_rsp_body.get().toByteArray())
@ -153,75 +152,6 @@ internal object RichProtoSvc: QQInterfaces() {
}
}
suspend fun getTempPicDownloadUrl(
chatType: Int,
originalUrl: String,
md5: String,
image: PicElement,
storeId: Int = 0,
peer: String? = null,
subPeer: String? = null,
): String {
val isNtServer = originalUrl.startsWith("/download")
if (isNtServer) {
val tmpRKey = NtV2RichMediaSvc.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[when(chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> 10u
MsgConstant.KCHATTYPEC2C -> 20u
MsgConstant.KCHATTYPEGUILD -> 10u
else -> 0u
}]
if (rkey != null) {
return "https://$MULTIMEDIA_DOMAIN$originalUrl$rkey"
}
}
}
return when (chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> getGroupPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = peer ?: "0"
)
MsgConstant.KCHATTYPEC2C -> getC2CPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = peer ?: "0",
storeId = storeId
)
MsgConstant.KCHATTYPEGUILD -> getGuildPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = peer ?: "0",
subPeer = subPeer ?: "0"
)
else -> throw UnsupportedOperationException("Not supported chat type: $chatType")
}
}
suspend fun getGroupPicDownUrl(
originalUrl: String,
md5: String,

View File

@ -1,6 +1,6 @@
package qq.service.contact
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import io.kritor.common.Scene

View File

@ -11,7 +11,6 @@ import com.tencent.protofile.join_group_link.join_group_link
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlinx.coroutines.sync.Mutex
import kotlinx.coroutines.sync.withLock
import moe.fuqiuluo.shamrock.tools.decodeToOidb
import moe.fuqiuluo.shamrock.tools.slice
import qq.service.internals.NTServiceFetcher
import qq.service.QQInterfaces
@ -191,7 +190,8 @@ internal object ContactHelper: QQInterfaces() {
val fromServiceMsg = sendOidbAW("OidbSvcTrpcTcp.0x11ca_0", 4790, 0, reqBody.toByteArray())
?: error("unable to fetch contact ark_json_text")
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val rsp = oidb_0x11b2.BusinessCardV3Rsp()
rsp.mergeFrom(body.bytes_bodybuffer.get().toByteArray())
return rsp.signed_ark_msg.get()

View File

@ -1,3 +1,5 @@
@file:OptIn(ExperimentalStdlibApi::class)
package qq.service.file
import com.tencent.mobileqq.pb.ByteStringMicro
@ -7,9 +9,7 @@ import io.kritor.file.*
import moe.fuqiuluo.shamrock.helper.Level
import moe.fuqiuluo.shamrock.helper.LogCenter
import moe.fuqiuluo.shamrock.tools.EMPTY_BYTE_ARRAY
import moe.fuqiuluo.shamrock.tools.decodeToOidb
import moe.fuqiuluo.shamrock.tools.slice
import moe.fuqiuluo.shamrock.tools.toHexString
import moe.fuqiuluo.shamrock.utils.DeflateTools
import qq.service.QQInterfaces
import tencent.im.oidb.cmd0x6d8.oidb_0x6d8
@ -31,9 +31,12 @@ internal object GroupFileHelper: QQInterfaces() {
val fileCnt: Int
val limitCnt: Int
if (fromServiceMsg.wupBuffer != null) {
val oidb1 = fromServiceMsg.decodeToOidb()
oidb_0x6d8.RspBody().mergeFrom(oidb1.bytes_bodybuffer.get().toByteArray()).group_file_cnt_rsp.apply {
oidb_0x6d8.RspBody().mergeFrom(
oidb_sso.OIDBSSOPkg()
.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
.bytes_bodybuffer.get()
.toByteArray()
).group_file_cnt_rsp.apply {
fileCnt = uint32_all_file_count.get()
limitCnt = uint32_limit_count.get()
}
@ -50,9 +53,11 @@ internal object GroupFileHelper: QQInterfaces() {
val totalSpace: Long
val usedSpace: Long
if (fromServiceMsg2.isSuccess && fromServiceMsg2.wupBuffer != null) {
val oidb2 = fromServiceMsg2.decodeToOidb()
oidb_0x6d8.RspBody().mergeFrom(oidb2.bytes_bodybuffer.get().toByteArray()).group_space_rsp.apply {
oidb_0x6d8.RspBody().mergeFrom(
oidb_sso.OIDBSSOPkg()
.mergeFrom(fromServiceMsg2.wupBuffer.slice(4))
.bytes_bodybuffer.get()
.toByteArray()).group_space_rsp.apply {
totalSpace = uint64_total_space.get()
usedSpace = uint64_used_space.get()
}
@ -90,14 +95,16 @@ internal object GroupFileHelper: QQInterfaces() {
uint32_show_onlinedoc_folder.set(0)
})
}.toByteArray(), timeout = 30.seconds) ?: throw StatusRuntimeException(Status.INTERNAL.withDescription("unable to send oidb request"))
}.toByteArray(), timeout = 15.seconds) ?: throw StatusRuntimeException(Status.INTERNAL.withDescription("unable to send oidb request"))
if (fromServiceMsg.wupBuffer == null) {
throw StatusRuntimeException(Status.INTERNAL.withDescription("oidb request failed"))
}
val files = arrayListOf<File>()
val folders = arrayListOf<Folder>()
if (fromServiceMsg.wupBuffer != null) {
val oidb = fromServiceMsg.decodeToOidb()
val oidb = oidb_sso.OIDBSSOPkg().mergeFrom(fromServiceMsg.wupBuffer.slice(4).let {
if (it[0] == 0x78.toByte()) DeflateTools.uncompress(it) else it
})
oidb_0x6d8.RspBody().mergeFrom(oidb.bytes_bodybuffer.get().toByteArray())
.file_list_info_rsp.apply {
@ -109,9 +116,9 @@ internal object GroupFileHelper: QQInterfaces() {
this.fileName = fileInfo.str_file_name.get()
this.fileSize = fileInfo.uint64_file_size.get()
this.busId = fileInfo.uint32_bus_id.get()
this.uploadTime = fileInfo.uint32_upload_time.get().toLong()
this.expireTime = fileInfo.uint32_dead_time.get().toLong()
this.modifyTime = fileInfo.uint32_modify_time.get().toLong()
this.uploadTime = fileInfo.uint32_upload_time.get()
this.expireTime = fileInfo.uint32_dead_time.get()
this.modifyTime = fileInfo.uint32_modify_time.get()
this.downloadTimes = fileInfo.uint32_download_times.get()
this.uploader = fileInfo.uint64_uploader_uin.get()
this.uploaderName = fileInfo.str_uploader_name.get()
@ -126,7 +133,7 @@ internal object GroupFileHelper: QQInterfaces() {
this.folderId = folderInfo.str_folder_id.get()
this.folderName = folderInfo.str_folder_name.get()
this.totalFileCount = folderInfo.uint32_total_file_count.get()
this.createTime = folderInfo.uint32_create_time.get().toLong()
this.createTime = folderInfo.uint32_create_time.get()
this.creator = folderInfo.uint64_create_uin.get()
this.creatorName = folderInfo.str_creator_name.get()
}.build())

View File

@ -19,13 +19,10 @@ import kotlinx.coroutines.sync.withLock
import kotlinx.coroutines.withTimeoutOrNull
import moe.fuqiuluo.shamrock.helper.Level
import moe.fuqiuluo.shamrock.helper.LogCenter
import moe.fuqiuluo.shamrock.tools.decodeToOidb
import qq.service.internals.NTServiceFetcher
import moe.fuqiuluo.shamrock.tools.ifNullOrEmpty
import moe.fuqiuluo.shamrock.tools.putBuf32Long
import moe.fuqiuluo.shamrock.tools.slice
import moe.fuqiuluo.shamrock.utils.PlatformUtils
import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_65_VER
import protobuf.auto.toByteArray
import protobuf.oidb.cmd0xf16.Oidb0xf16
import protobuf.oidb.cmd0xf16.SetGroupRemarkReq
@ -401,46 +398,22 @@ internal object GroupHelper: QQInterfaces() {
sendOidb("OidbSvc.0x89a_0", 2202, 0, reqBody.toByteArray())
}
suspend fun getGroupMemberList(groupId: Long, refresh: Boolean): Result<HashMap<String, MemberInfo>> {
val kernelService = NTServiceFetcher.kernelService
val sessionService = kernelService.wrapperSession
val service = sessionService.groupService
val uids = suspendCancellableCoroutine { continuation ->
service.getAllMemberList(groupId, refresh) { _, _, groupMemberListResult ->
continuation.resume(groupMemberListResult?.ids?.map {
it.uid
})
suspend fun getGroupMemberList(groupId: String, refresh: Boolean): Result<List<TroopMemberInfo>> {
val service = app.getRuntimeService(ITroopMemberInfoService::class.java, "all")
var memberList = service.getAllTroopMembers(groupId)
if (refresh || memberList == null) {
memberList = requestTroopMemberInfo(service, groupId).onFailure {
return Result.failure(Exception("获取群成员列表失败"))
}.getOrThrow()
}
getGroupInfo(groupId, true).onSuccess {
if(it.wMemberNum > memberList.size) {
return getGroupMemberList(groupId, true)
}
}
val memberMap = suspendCancellableCoroutine { continuation ->
service.getMemberInfoForMqq(groupId, ArrayList(uids ?: emptyList()), refresh) { _, _, groupMemberListResult ->
continuation.resume(groupMemberListResult.infos)
}
}
// val extInfo = suspendCancellableCoroutine { continuation ->
// service.getMemberExtInfo(GroupMemberExtReq().apply {
// this.groupCode = groupId
// this.beginUin = 0.toString()
// this.groupType = ""
// this.memberExtFilter = MemberExtInfoFilter().apply {
// this.memberLevelInfoName = 1
// this.memberLevelInfoUin = 1
// this.nickName = 1
// this.specialTitle = 1
// this.memberLevelInfoActiveDay = 1
// }
// this.richCardNameVer = "1"
// this.sourceType = 1
// this.uinList = ArrayList(memberMap.values.toList().map {
// it.uin
// })
// }) { _, _, groupMemberExtListResult ->
// continuation.resume(groupMemberExtListResult)
// }
// }
return Result.success(memberMap)
return Result.success(memberList)
}
suspend fun getProhibitedMemberList(groupId: Long): Result<List<ProhibitedMemberInfo>> {
@ -456,7 +429,8 @@ internal object GroupHelper: QQInterfaces() {
if (fromServiceMsg.wupBuffer == null) {
return Result.failure(RuntimeException("[oidb] failed"))
}
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
if(body.uint32_result.get() != 0) {
return Result.failure(RuntimeException(body.str_error_msg.get()))
}
@ -477,7 +451,8 @@ internal object GroupHelper: QQInterfaces() {
if (fromServiceMsg.wupBuffer == null) {
return Result.failure(RuntimeException("[oidb] failed"))
}
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
if(body.uint32_result.get() != 0) {
return Result.failure(RuntimeException(body.str_error_msg.get()))
}
@ -638,9 +613,6 @@ internal object GroupHelper: QQInterfaces() {
}
private suspend fun requestTroopMemberInfo(service: ITroopMemberInfoService, groupId: String, memberUin: String, timeout: Long = 10_000): Result<TroopMemberInfo> {
if(PlatformUtils.getQQVersionCode() >= QQ_9_0_65_VER) {
return Result.failure(Exception("当前版本不支持该API"))
}
val info = RefreshTroopMemberInfoLock.withLock {
service.deleteTroopMember(groupId, memberUin)

View File

@ -3,24 +3,14 @@
package qq.service.internals
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.kernel.nativeinterface.MsgElement
import com.tencent.qqnt.kernel.nativeinterface.MsgRecord
import com.tencent.qqnt.kernel.nativeinterface.TextElement
import kotlinx.coroutines.DelicateCoroutinesApi
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import moe.fuqiuluo.shamrock.config.AliveReply
import moe.fuqiuluo.shamrock.config.get
import moe.fuqiuluo.shamrock.helper.Level
import moe.fuqiuluo.shamrock.helper.LogCenter
import moe.fuqiuluo.shamrock.helper.db.ImageDB
import moe.fuqiuluo.shamrock.helper.db.ImageMapping
import moe.fuqiuluo.shamrock.internals.GlobalEventTransmitter
import moe.fuqiuluo.shamrock.utils.PlatformUtils
import moe.fuqiuluo.shamrock.utils.PlatformUtils.QQ_9_0_8_VER
import qq.service.bdh.RichProtoSvc
import qq.service.file.GroupFileHelper
import qq.service.group.GroupHelper
import qq.service.kernel.SimpleKernelMsgListener
import qq.service.msg.MessageHelper
@ -37,83 +27,7 @@ object AioListener : SimpleKernelMsgListener() {
}
}
private suspend fun debugTest(record: MsgRecord, text: String) {
if (record.chatType == MsgConstant.KCHATTYPEGROUP && text == ".shamrock.members") {
val contact = MessageHelper.generateContact(record)
GroupHelper.getGroupMemberList(record.peerUin, true).onSuccess {
MessageHelper.sendMessage(contact, arrayListOf(
MsgElement().apply {
elementType = MsgConstant.KELEMTYPETEXT
textElement = TextElement().apply {
content = "memberCount: ${it.size}"
}
}
), 3, MessageHelper.generateMsgId(record.chatType))
}.onFailure {
LogCenter.log("获取群成员列表失败: $it", Level.ERROR)
}
} else if (record.chatType == MsgConstant.KCHATTYPEGROUP && text == ".shamrock.root_files") {
val contact = MessageHelper.generateContact(record)
val files = GroupFileHelper.getGroupFiles(record.peerUin)
MessageHelper.sendMessage(contact, arrayListOf(
MsgElement().apply {
elementType = MsgConstant.KELEMTYPETEXT
textElement = TextElement().apply {
content = "foldersCount: ${files.foldersCount}\nfilesCount: ${files.filesCount}"
}
}
), 3, MessageHelper.generateMsgId(record.chatType))
} else if (record.chatType == MsgConstant.KCHATTYPEGROUP && text == ".shamrock.pic_url") {
val contact = MessageHelper.generateContact(record)
val pic = record.elements.filter {
it.elementType == MsgConstant.KELEMTYPEPIC
}.map {
val image = it.picElement
val md5 = (image.md5HexStr ?: image.fileName
.replace("{", "")
.replace("}", "")
.replace("-", "").split(".")[0])
.uppercase()
var storeId = 0
if (PlatformUtils.getQQVersionCode() > QQ_9_0_8_VER) {
storeId = image.storeID
}
val originalUrl = image.originImageUrl ?: ""
return@map RichProtoSvc.getTempPicDownloadUrl(record.chatType, originalUrl, md5, image, storeId)
}
MessageHelper.sendMessage(contact, arrayListOf(
MsgElement().apply {
elementType = MsgConstant.KELEMTYPETEXT
textElement = TextElement().apply {
content = "picUrl: \n${
pic.joinToString("\n")
}"
}
}
), 3, MessageHelper.generateMsgId(record.chatType))
}
}
private suspend fun onMsg(record: MsgRecord) {
if (AliveReply.get()) {
val texts = record.elements.filter { it.elementType == MsgConstant.KELEMTYPETEXT }
val text = texts.joinToString { it.textElement.content }
if (texts.isNotEmpty() && text == "ping") {
val contact = MessageHelper.generateContact(record)
MessageHelper.sendMessage(contact, arrayListOf(
MsgElement().apply {
elementType = MsgConstant.KELEMTYPETEXT
textElement = TextElement().apply {
content = "pong"
}
}
), 3, MessageHelper.generateMsgId(record.chatType))
return
}
debugTest(record, text)
}
when (record.chatType) {
MsgConstant.KCHATTYPEGROUP -> {
if (record.senderUin == 0L) return

View File

@ -216,13 +216,8 @@ internal object PrimitiveListener {
}.decodeProtobuf<GroupCommonTipsEvent>()
}
val groupId = event.groupCode.toLong()
if (event.uniqueTitleChangeDetail == null) {
return
}
val detail = event.uniqueTitleChangeDetail!!.first()
// todo 贴表情也走的 732 16 这里
//detail = if (detail[5] is ProtoList) {
// (detail[5] as ProtoList).value[0]
//} else {
@ -401,7 +396,7 @@ internal object PrimitiveListener {
val targetUid = event.memberUid
val type = event.type
GroupHelper.getGroupMemberList(groupCode, true).onFailure {
GroupHelper.getGroupMemberList(groupCode.toString(), true).onFailure {
LogCenter.log("新成员加入刷新群成员列表失败: $groupCode", Level.WARN)
}.onSuccess {
LogCenter.log("新成员加入刷新群成员列表成功,群成员数量: ${it.size}", Level.INFO)
@ -438,7 +433,7 @@ internal object PrimitiveListener {
val type = event.type
val operatorUid = event.operatorUid
GroupHelper.getGroupMemberList(groupCode, true).onFailure {
GroupHelper.getGroupMemberList(groupCode.toString(), true).onFailure {
LogCenter.log("新成员加入刷新群成员列表失败: $groupCode", Level.WARN)
}.onSuccess {
LogCenter.log("新成员加入刷新群成员列表成功,群成员数量: ${it.size}", Level.INFO)

View File

@ -1,7 +1,7 @@
package qq.service.kernel
import com.tencent.qqnt.kernel.nativeinterface.BroadcastHelperTransNotifyInfo
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.ContactMsgBoxInfo
import com.tencent.qqnt.kernel.nativeinterface.CustomWithdrawConfig
import com.tencent.qqnt.kernel.nativeinterface.DevInfo
@ -12,7 +12,6 @@ import com.tencent.qqnt.kernel.nativeinterface.FileTransNotifyInfo
import com.tencent.qqnt.kernel.nativeinterface.FirstViewDirectMsgNotifyInfo
import com.tencent.qqnt.kernel.nativeinterface.FirstViewGroupGuildInfo
import com.tencent.qqnt.kernel.nativeinterface.FreqLimitInfo
import com.tencent.qqnt.kernel.nativeinterface.GProGuildTopFeedMsg
import com.tencent.qqnt.kernel.nativeinterface.GroupFileListResult
import com.tencent.qqnt.kernel.nativeinterface.GroupGuildNotifyInfo
import com.tencent.qqnt.kernel.nativeinterface.GroupItem
@ -28,7 +27,6 @@ import com.tencent.qqnt.kernel.nativeinterface.MsgAbstract
import com.tencent.qqnt.kernel.nativeinterface.MsgElement
import com.tencent.qqnt.kernel.nativeinterface.MsgRecord
import com.tencent.qqnt.kernel.nativeinterface.MsgSetting
import com.tencent.qqnt.kernel.nativeinterface.QueryUserSecQualityRsp
import com.tencent.qqnt.kernel.nativeinterface.RecvdOrder
import com.tencent.qqnt.kernel.nativeinterface.RelatedWordEmojiInfo
import com.tencent.qqnt.kernel.nativeinterface.SearchGroupFileResult
@ -137,10 +135,7 @@ abstract class SimpleKernelMsgListener: IKernelMsgListener {
}
override fun onGuildTopFeedUpdate(gProGuildTopFeedMsg: GProGuildTopFeedMsg?) {
}
override fun onHitCsRelatedEmojiResult(downloadRelateEmojiResultInfo: DownloadRelateEmojiResultInfo?) {
override fun onHitCsRelatedEmojiResult(downloadRelateEmojiResultInfo: DownloadRelateEmojiResultInfo?) {
}
@ -212,10 +207,7 @@ abstract class SimpleKernelMsgListener: IKernelMsgListener {
}
override fun onMsgWithRichLinkInfoUpdate(arrayList: ArrayList<MsgRecord>?) {
}
override fun onNtFirstViewMsgSyncEnd() {
override fun onNtFirstViewMsgSyncEnd() {
}
@ -266,10 +258,7 @@ abstract class SimpleKernelMsgListener: IKernelMsgListener {
}
override fun onRedTouchChanged() {
}
override fun onRichMediaDownloadComplete(fileTransNotifyInfo: FileTransNotifyInfo?) {
override fun onRichMediaDownloadComplete(fileTransNotifyInfo: FileTransNotifyInfo?) {
}
@ -289,13 +278,7 @@ abstract class SimpleKernelMsgListener: IKernelMsgListener {
}
override fun onSysMsgNotification(
i2: Int,
j2: Long,
j3: Long,
z: Boolean,
arrayList: ArrayList<Byte>?
) {
override fun onSysMsgNotification(i2: Int, j2: Long, j3: Long, arrayList: ArrayList<Byte>?) {
}
@ -319,10 +302,7 @@ abstract class SimpleKernelMsgListener: IKernelMsgListener {
}
override fun onUserSecQualityChanged(queryUserSecQualityRsp: QueryUserSecQualityRsp?) {
}
override fun onUserTabStatusChanged(arrayList: ArrayList<TabStatusInfo>?) {
override fun onUserTabStatusChanged(arrayList: ArrayList<TabStatusInfo>?) {
}

View File

@ -1,6 +1,6 @@
package qq.service.lightapp
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import qq.service.QQInterfaces
import qq.service.contact.longPeer

View File

@ -2,7 +2,7 @@ package qq.service.lightapp
import com.tencent.biz.map.trpcprotocol.LbsSendInfo
import com.tencent.proto.lbsshare.LBSShare
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import moe.fuqiuluo.shamrock.helper.IllegalParamsException
import moe.fuqiuluo.shamrock.tools.slice

View File

@ -1,6 +1,6 @@
package qq.service.lightapp
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import io.ktor.client.request.get
import io.ktor.client.statement.bodyAsText
import kotlinx.serialization.json.Json

View File

@ -1,12 +1,15 @@
package qq.service.msg
import com.tencent.mobileqq.qroute.QRoute
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.kernel.nativeinterface.MsgRecord
import com.tencent.qqnt.msg.api.IMsgService
import io.grpc.Status
import io.grpc.StatusRuntimeException
import io.kritor.common.ForwardElement
import io.kritor.common.ForwardMessageBody
import io.kritor.common.Scene
import kotlinx.coroutines.suspendCancellableCoroutine
import kotlinx.coroutines.withTimeoutOrNull
import moe.fuqiuluo.shamrock.helper.Level
@ -18,6 +21,7 @@ import protobuf.auto.toByteArray
import protobuf.message.*
import protobuf.message.longmsg.*
import qq.service.QQInterfaces
import qq.service.contact.ContactHelper
import qq.service.msg.MessageHelper.getMultiMsg
import qq.service.ticket.TicketHelper
import java.util.*

View File

@ -3,7 +3,7 @@ package qq.service.msg
import com.tencent.mobileqq.qroute.QRoute
import com.tencent.mobileqq.troop.api.ITroopMemberNameService
import com.tencent.qqnt.kernel.api.IKernelService
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.kernel.nativeinterface.MsgElement
import com.tencent.qqnt.kernel.nativeinterface.MsgRecord
@ -31,7 +31,6 @@ import moe.fuqiuluo.shamrock.tools.asJsonObject
import moe.fuqiuluo.shamrock.tools.asLong
import moe.fuqiuluo.shamrock.tools.asString
import moe.fuqiuluo.shamrock.tools.asStringOrNull
import moe.fuqiuluo.shamrock.tools.decodeToOidb
import moe.fuqiuluo.shamrock.tools.slice
import moe.fuqiuluo.shamrock.tools.toHexString
import moe.fuqiuluo.shamrock.utils.DeflateTools
@ -109,7 +108,8 @@ internal object MessageHelper: QQInterfaces() {
if (fromServiceMsg?.wupBuffer == null) {
return "no response"
}
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val result = oidb_0xeac.RspBody().mergeFrom(body.bytes_bodybuffer.get().toByteArray())
return if (result.wording.has()) {
LogCenter.log("设置群精华失败: ${result.wording.get()}", Level.WARN)
@ -129,7 +129,8 @@ internal object MessageHelper: QQInterfaces() {
if (fromServiceMsg?.wupBuffer == null) {
return "no response"
}
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val result = oidb_0xeac.RspBody().mergeFrom(body.bytes_bodybuffer.get().toByteArray())
return if (result.wording.has()) {
LogCenter.log("移除群精华失败: ${result.wording.get()}", Level.WARN)

View File

@ -78,7 +78,7 @@ private object MsgConvertor {
elem.type = ElementType.POKE
elem.setPoke(PokeElement.newBuilder().apply {
this.id = face.vaspokeId
this.pokeType = face.pokeType
this.type = face.pokeType
this.strength = face.pokeStrength
})
} else {
@ -157,21 +157,45 @@ private object MsgConvertor {
elem.type = ElementType.IMAGE
elem.setImage(ImageElement.newBuilder().apply {
this.file = ByteString.copyFromUtf8(md5)
this.fileUrl = RichProtoSvc.getTempPicDownloadUrl(record.chatType, originalUrl, md5, image, storeId,
peer = when(record.chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> record.peerUin.toString()
MsgConstant.KCHATTYPEC2C -> record.senderUin.toString()
MsgConstant.KCHATTYPEGUILD -> record.channelId.ifNullOrEmpty { record.peerUin.toString() } ?: "0"
else -> null
},
subPeer = when(record.chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> null
MsgConstant.KCHATTYPEC2C -> null
MsgConstant.KCHATTYPEGUILD -> record.guildId ?: "0"
else -> null
}
)
this.fileType =
this.fileUrl = when (record.chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> RichProtoSvc.getGroupPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = record.peerUin.toString()
)
MsgConstant.KCHATTYPEC2C -> RichProtoSvc.getC2CPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = record.senderUin.toString(),
storeId = storeId
)
MsgConstant.KCHATTYPEGUILD -> RichProtoSvc.getGuildPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = record.channelId.ifNullOrEmpty { record.peerUin.toString() } ?: "0",
subPeer = record.guildId ?: "0"
)
else -> throw UnsupportedOperationException("Not supported chat type: ${record.chatType}")
}
this.type =
if (image.isFlashPic == true) ImageElement.ImageType.FLASH else if (image.original) ImageElement.ImageType.ORIGIN else ImageElement.ImageType.COMMON
this.subType = image.picSubType
})

View File

@ -2,7 +2,7 @@
package qq.service.msg
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import io.kritor.common.*
import io.kritor.common.Element.ElementType
@ -65,7 +65,7 @@ suspend fun List<Elem>.toKritorResponseMessages(contact: Contact): ArrayList<Ele
this.type = ElementType.IMAGE
this.image = ImageElement.newBuilder().apply {
this.fileMd5 = md5
this.fileType = if (customFace.origin == true) ImageType.ORIGIN else ImageType.COMMON
this.type = if (customFace.origin == true) ImageType.ORIGIN else ImageType.COMMON
this.fileUrl = when (contact.chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> RichProtoSvc.getGroupPicDownUrl(
origUrl,
@ -85,7 +85,7 @@ suspend fun List<Elem>.toKritorResponseMessages(contact: Contact): ArrayList<Ele
this.type = ElementType.IMAGE
this.image = ImageElement.newBuilder().apply {
this.fileMd5 = md5
this.fileType = if (element.notOnlineImage?.original == true) ImageType.ORIGIN else ImageType.COMMON
this.type = if (element.notOnlineImage?.original == true) ImageType.ORIGIN else ImageType.COMMON
this.fileUrl = when (contact.chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> RichProtoSvc.getGroupPicDownUrl(
origUrl,

View File

@ -8,7 +8,7 @@ import com.tencent.mobileqq.qroute.QRoute
import com.tencent.qphone.base.remote.ToServiceMsg
import com.tencent.qqnt.aio.adapter.api.IAIOPttApi
import com.tencent.qqnt.kernel.nativeinterface.*
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.FaceElement
import com.tencent.qqnt.kernel.nativeinterface.MarkdownElement
import com.tencent.qqnt.kernel.nativeinterface.MarketFaceElement
@ -254,8 +254,8 @@ object NtMsgConvertor {
}
private suspend fun imageConvertor(contact: Contact, msgId: Long, sourceImage: Element): Result<MsgElement> {
val isOriginal = sourceImage.image.fileType == ImageType.ORIGIN
val isFlash = sourceImage.image.fileType == ImageType.FLASH
val isOriginal = sourceImage.image.type == ImageType.ORIGIN
val isFlash = sourceImage.image.type == ImageType.FLASH
val file = when (sourceImage.image.dataCase!!) {
ImageElement.DataCase.FILE_NAME -> {
val fileMd5 = sourceImage.image.fileName.replace(regex = "[{}\\-]".toRegex(), replacement = "")
@ -638,7 +638,7 @@ object NtMsgConvertor {
face.faceText = ""
face.faceType = 5
face.packId = null
face.pokeType = sourcePoke.poke.pokeType
face.pokeType = sourcePoke.poke.type
face.spokeSummary = ""
face.doubleHit = 0
face.vaspokeId = sourcePoke.poke.id

View File

@ -1,7 +1,7 @@
package qq.service.msg
import com.tencent.mobileqq.qroute.QRoute
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.kernel.nativeinterface.MsgElement
import com.tencent.qqnt.msg.api.IMsgService
@ -73,7 +73,7 @@ private object ReqMsgConvertor {
if (face.faceType == 5) {
elem.setPoke(PokeElement.newBuilder().apply {
this.id = face.vaspokeId
this.pokeType = face.pokeType
this.type = face.pokeType
this.strength = face.pokeStrength
})
} else {
@ -136,8 +136,45 @@ private object ReqMsgConvertor {
val elem = Element.newBuilder()
elem.setImage(ImageElement.newBuilder().apply {
this.fileMd5 = md5
this.fileUrl = RichProtoSvc.getTempPicDownloadUrl(contact.chatType, originalUrl, md5, image, storeId, contact.peerUid, contact.guildId)
this.fileType =
this.fileUrl = when (contact.chatType) {
MsgConstant.KCHATTYPEDISC, MsgConstant.KCHATTYPEGROUP -> RichProtoSvc.getGroupPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = contact.longPeer().toString()
)
MsgConstant.KCHATTYPEC2C -> RichProtoSvc.getC2CPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = contact.longPeer().toString(),
storeId = storeId
)
MsgConstant.KCHATTYPEGUILD -> RichProtoSvc.getGuildPicDownUrl(
originalUrl = originalUrl,
md5 = md5,
fileId = image.fileUuid,
width = image.picWidth.toUInt(),
height = image.picHeight.toUInt(),
sha = "",
fileSize = image.fileSize.toULong(),
peer = contact.longPeer().toString(),
subPeer = "0"
)
else -> throw UnsupportedOperationException("Not supported chat type: ${contact.chatType}")
}
this.type =
if (image.isFlashPic == true) ImageElement.ImageType.FLASH else if (image.original) ImageElement.ImageType.ORIGIN else ImageElement.ImageType.COMMON
this.subType = image.picSubType
})

View File

@ -1,9 +1,10 @@
package qq.service.msg
import android.graphics.BitmapFactory
import android.util.Base64
import androidx.exifinterface.media.ExifInterface
import com.tencent.mobileqq.qroute.QRoute
import com.tencent.qqnt.kernelpublic.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.Contact
import com.tencent.qqnt.kernel.nativeinterface.MsgConstant
import com.tencent.qqnt.msg.api.IMsgService
import io.kritor.common.Element
@ -183,7 +184,7 @@ suspend fun List<Element>.toRichText(contact: Contact): Result<Pair<String, Rich
summary.append("[回复消息]")
}
Element.ElementType.IMAGE -> {
val type = it.image.fileType
val type = it.image.type
val isOriginal = type == ImageElement.ImageType.ORIGIN
val file = when(it.image.dataCase!!) {
ImageElement.DataCase.FILE_NAME -> {
@ -391,7 +392,7 @@ suspend fun List<Element>.toRichText(contact: Contact): Result<Pair<String, Rich
commonElem = CommonElem(
serviceType = 2,
elem = PokeExtra(
type = it.poke.pokeType,
type = it.poke.type,
field7 = 0,
field8 = 0
).toByteArray(),

View File

@ -10,7 +10,6 @@ import io.ktor.client.plugins.HttpTimeout
import io.ktor.client.request.get
import io.ktor.client.request.header
import moe.fuqiuluo.shamrock.tools.GlobalClient
import moe.fuqiuluo.shamrock.tools.decodeToOidb
import moe.fuqiuluo.shamrock.tools.slice
import mqq.app.MobileQQ
import mqq.manager.TicketManager
@ -141,7 +140,8 @@ internal object TicketHelper: QQInterfaces() {
val fromServiceMsg = sendOidbAW("OidbSvcTcp.0x102a", 4138, 0, req.toByteArray())
?: return Result.failure(Exception("getLessPSKey failed"))
if (fromServiceMsg.wupBuffer == null) return Result.failure(Exception("getLessPSKey failed: no response"))
val body = fromServiceMsg.decodeToOidb()
val body = oidb_sso.OIDBSSOPkg()
body.mergeFrom(fromServiceMsg.wupBuffer.slice(4))
val rsp = oidb_cmd0x102a.GetPSkeyResponse().mergeFrom(body.bytes_bodybuffer.get().toByteArray())
return Result.success(rsp.private_keys.get())
}