TIM v2.3.1版本的 MD5 值为:d6957e3ee7ce901ccc491cefdea0da8c
以下内容为反编译后的 MessageProtoCodec.java 源代码,内容仅作参考
package com.tencent.mobileqq.service.message;
import IMMsgBodyPack.SlaveMasterMsg;
import NS_MOBILE_FEEDS.e_attribute;
import OnlinePushPack.MsgInfo;
import android.app.KeyguardManager;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Pair;
import com.tencent.arrange.op.ArrangeHandler;
import com.tencent.av.SharpReport_OffLine;
import com.tencent.av.VideoConstants;
import com.tencent.av.VideoController;
import com.tencent.av.core.AbstractNetChannel;
import com.tencent.av.core.VcSystemInfo;
import com.tencent.av.gaudio.GaInviteDialogActivity;
import com.tencent.av.hd_video_2;
import com.tencent.av.service.QavWrapper;
import com.tencent.av.ui.MultiIncomingCallsActivity;
import com.tencent.av.utils.CharacterUtil;
import com.tencent.av.utils.TroopMemberUtil;
import com.tencent.av.utils.VideoMsgTools;
import com.tencent.biz.bmqq.util.BmqqSegmentUtil;
import com.tencent.biz.pubaccount.util.PAMessageUtil;
import com.tencent.common.app.AppInterface;
import com.tencent.common.app.BaseApplicationImpl;
import com.tencent.common.config.AppSetting;
import com.tencent.device.devicemgr.DeviceMgrConstants;
import com.tencent.device.devicemgr.SmartDeviceProxyMgr;
import com.tencent.mobileqq.activity.ChatActivityUtils;
import com.tencent.mobileqq.activity.NotifyPCActiveActivity;
import com.tencent.mobileqq.activity.TroopNotificationCache;
import com.tencent.mobileqq.app.AppConstants;
import com.tencent.mobileqq.app.DataLineHandler;
import com.tencent.mobileqq.app.FriendListHandler;
import com.tencent.mobileqq.app.FriendsManager;
import com.tencent.mobileqq.app.LBSHandler;
import com.tencent.mobileqq.app.LogTag;
import com.tencent.mobileqq.app.MayknowRecommendManager;
import com.tencent.mobileqq.app.MessageHandler;
import com.tencent.mobileqq.app.PublicAccountDataManager;
import com.tencent.mobileqq.app.PublicAccountHandler;
import com.tencent.mobileqq.app.QPayHandler;
import com.tencent.mobileqq.app.QQAppInterface;
import com.tencent.mobileqq.app.RecommendTroopManagerImp;
import com.tencent.mobileqq.app.ShieldListHandler;
import com.tencent.mobileqq.app.ThreadManager;
import com.tencent.mobileqq.app.TroopHandler;
import com.tencent.mobileqq.app.TroopManager;
import com.tencent.mobileqq.app.VipInfoHandler;
import com.tencent.mobileqq.app.automator.StepFactory;
import com.tencent.mobileqq.app.message.OnLinePushMessageProcessor;
import com.tencent.mobileqq.app.message.ProcessorDispatcherInterface;
import com.tencent.mobileqq.app.message.QQMessageFacade;
import com.tencent.mobileqq.app.readinjoy.ReadInJoyHandler;
import com.tencent.mobileqq.app.utils.DingdongPluginBizHandler;
import com.tencent.mobileqq.app.utils.MessagePkgUtils;
import com.tencent.mobileqq.data.ApolloMessage;
import com.tencent.mobileqq.data.AppShareID;
import com.tencent.mobileqq.data.ChatMessage;
import com.tencent.mobileqq.data.Emoticon;
import com.tencent.mobileqq.data.FunnyFaceMessage;
import com.tencent.mobileqq.data.MarkFaceMessage;
import com.tencent.mobileqq.data.MessageForApollo;
import com.tencent.mobileqq.data.MessageForArkApp;
import com.tencent.mobileqq.data.MessageForFile;
import com.tencent.mobileqq.data.MessageForFunnyFace;
import com.tencent.mobileqq.data.MessageForLongTextMsg;
import com.tencent.mobileqq.data.MessageForMarketFace;
import com.tencent.mobileqq.data.MessageForMixedMsg;
import com.tencent.mobileqq.data.MessageForPic;
import com.tencent.mobileqq.data.MessageForPtt;
import com.tencent.mobileqq.data.MessageForReplyText;
import com.tencent.mobileqq.data.MessageForRichText;
import com.tencent.mobileqq.data.MessageForShakeWindow;
import com.tencent.mobileqq.data.MessageForStructing;
import com.tencent.mobileqq.data.MessageForText;
import com.tencent.mobileqq.data.MessageRecord;
import com.tencent.mobileqq.data.PAMessage;
import com.tencent.mobileqq.data.SubAccountMessage;
import com.tencent.mobileqq.emosm.EmosmUtils;
import com.tencent.mobileqq.filemanager.data.FMConstants;
import com.tencent.mobileqq.filemanager.data.FMDataCache;
import com.tencent.mobileqq.filemanager.data.FileManagerEntity;
import com.tencent.mobileqq.filemanager.data.OnlineFileSessionInfo;
import com.tencent.mobileqq.model.EmoticonManager;
import com.tencent.mobileqq.msf.sdk.SettingCloneUtil;
import com.tencent.mobileqq.pb.ByteStringMicro;
import com.tencent.mobileqq.pb.InvalidProtocolBufferMicroException;
import com.tencent.mobileqq.persistence.Entity;
import com.tencent.mobileqq.persistence.EntityManager;
import com.tencent.mobileqq.revokemsg.RevokeMsgInfo;
import com.tencent.mobileqq.secspy.SecSpyFileManager;
import com.tencent.mobileqq.service.troop.TroopConstants;
import com.tencent.mobileqq.statistics.ReportController;
import com.tencent.mobileqq.streamtransfile.StreamDataManager;
import com.tencent.mobileqq.structmsg.AbsShareMsg;
import com.tencent.mobileqq.structmsg.AbsStructMsgElement;
import com.tencent.mobileqq.structmsg.AbsStructMsgItem;
import com.tencent.mobileqq.structmsg.StructMsgUtils;
import com.tencent.mobileqq.structmsg.view.StructMsgItemVideo;
import com.tencent.mobileqq.stt.SttManager;
import com.tencent.mobileqq.subaccount.SubAccountControll;
import com.tencent.mobileqq.subaccount.datamanager.SubAccountManager;
import com.tencent.mobileqq.subaccount.logic.SubAccountBackProtocData;
import com.tencent.mobileqq.text.QQText;
import com.tencent.mobileqq.transfile.PttInfoCollector;
import com.tencent.mobileqq.transfile.TransfileUtile;
import com.tencent.mobileqq.troop.data.MessageInfo;
import com.tencent.mobileqq.troop.text.AtTroopMemberSpan;
import com.tencent.mobileqq.troop.utils.TroopBarUtils;
import com.tencent.mobileqq.troop.utils.TroopNotificationHelper;
import com.tencent.mobileqq.util.Utils;
import com.tencent.mobileqq.utils.AppShareIDUtil;
import com.tencent.mobileqq.utils.ContactUtils;
import com.tencent.mobileqq.utils.HexUtil;
import com.tencent.mobileqq.utils.RecordParams;
import com.tencent.mobileqq.utils.TimeFormatterUtils;
import com.tencent.mobileqq.utils.httputils.PkgTools;
import com.tencent.mobileqq.widget.IndexView;
import com.tencent.mqp.app.sec.MQPSensitiveMsgUtil;
import com.tencent.qphone.base.remote.ToServiceMsg;
import com.tencent.qphone.base.util.BaseApplication;
import com.tencent.qphone.base.util.QLog;
import com.tencent.smtt.sdk.TbsListener;
import com.tencent.tim.R;
import cooperation.dingdong.DingdongPluginManager;
import java.io.ByteArrayOutputStream;
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import localpb.richMsg.MixedMsg;
import localpb.richMsg.RichMsg;
import mqq.app.AccountNotMatchException;
import mqq.app.NewIntent;
import mqq.manager.TicketManager;
import msf.msgcomm.msg_comm;
import msf.msgsvc.msg_svc;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import tencent.im.cs.head;
import tencent.im.cs.ptt_reserve.ptt_reserve;
import tencent.im.msg.im_msg_body;
import tencent.im.msg.resv21.hummer_resv_21;
import tencent.im.msgrevoke.msgrevoke_userdef;
import tencent.im.msgsync.cmd0x100.Submsgtype0x8a;
import tencent.im.s2c.msgtype0x210.submsgtype0x35.Submsgtype0x35;
import tencent.im.s2c.msgtype0x210.submsgtype0x4e.Submsgtype0x4e;
import tencent.im.s2c.msgtype0x210.submsgtype0x67.submsgtype0x67;
import tencent.im.s2c.msgtype0x210.submsgtype0x6b.SubMsgType0x6b;
import tencent.im.s2c.msgtype0x210.submsgtype0x6f.SubMsgType0x6f;
import tencent.im.s2c.msgtype0x210.submsgtype0x7a.submsgtype0x7a;
import tencent.im.s2c.msgtype0x210.submsgtype0x7c.submsgtype0x7c;
import tencent.im.s2c.msgtype0x210.submsgtype0x8f.submsgtype0x8f;
import tencent.im.s2c.msgtype0x210.submsgtype0x9b.SubMsgType0x9b;
import tencent.im.s2c.msgtype0x210.submsgtype0xaa.SubMsgType0xaa;
import tencent.im.s2c.msgtype0x210.submsgtype0xae.SubMsgType0xae;
import tencent.im.s2c.msgtype0x210.submsgtype0xb1.submsgtype0xb1;
import tencent.im.s2c.msgtype0x211.submsgtype0x3.SubMsgType0x3;
import tencent.im.s2c.msgtype0x211.submsgtype0x4.SubMsgType0x4;
import tencent.im.s2c.msgtype0x211.submsgtype0x7.SubMsgType0x7;
import tencent.im.s2c.msgtype0x211.submsgtype0x9.C2CType0x211_SubC2CType0x9;
public class MessageProtoCodec {
public static final int f92300a = 30;
public static final long f28172a = 4294967295L;
private static final String f28173a = "Q.msg.MessageHandler";
private static HashMap f28174a = new HashMap();
public interface ROUTING_TYPE {
public static final int f92301a = 1;
public static final int f92302b = 2;
public static final int f92303c = 3;
public static final int d = 4;
public static final int e = 5;
public static final int f = 6;
public static final int g = 7;
public static final int h = 8;
public static final int i = 9;
public static final int j = 10;
public static final int k = 11;
public static final int l = 12;
public static final int m = 13;
public static final int n = 14;
public static final int o = 15;
public static final int p = 16;
public static final int q = 17;
public static final int r = 18;
public static final int s = 19;
public static final int t = 20;
public static final int u = 21;
public static final int v = 22;
}
public static im_msg_body.RichText a(String str, ArrayList arrayList) {
return a(str, arrayList, (im_msg_body.SourceMsg) null);
}
public static im_msg_body.RichText a(String str, ArrayList arrayList, im_msg_body.SourceMsg sourceMsg) {
im_msg_body.RichText richText = new im_msg_body.RichText();
if (sourceMsg != null) {
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.src_msg.set(sourceMsg);
richText.elems.add(elem);
}
if (a(richText, str, arrayList) <= 0) {
return null;
}
return richText;
}
public static im_msg_body.RichText a(MessageForText messageForText) {
return a(messageForText.f88923msg, messageForText.atInfoList);
}
public static im_msg_body.RichText a(MessageForReplyText messageForReplyText) {
MessageForReplyText.SourceMsgInfo sourceMsgInfo;
im_msg_body.RichText a2;
String extInfoFromExtStr = messageForReplyText.getExtInfoFromExtStr(MQPSensitiveMsgUtil.u);
if (TextUtils.isEmpty(extInfoFromExtStr)) {
try {
extInfoFromExtStr = HexUtil.a(MessagePkgUtils.a(messageForReplyText.mSourceMsgInfo));
if (!TextUtils.isEmpty(extInfoFromExtStr)) {
messageForReplyText.saveExtInfoToExtStr(MQPSensitiveMsgUtil.u, extInfoFromExtStr);
}
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, QLog.getStackTraceString(e));
}
}
}
if (QLog.isColorLevel()) {
QLog.d(LogTag.n, 2, "getSourceMsgInfo data = " + extInfoFromExtStr + ", mSourceMsgInfo = " + messageForReplyText.mSourceMsgInfo);
}
if (!TextUtils.isEmpty(extInfoFromExtStr)) {
try {
sourceMsgInfo = (MessageForReplyText.SourceMsgInfo) MessagePkgUtils.a(HexUtil.m9188a(extInfoFromExtStr));
} catch (Exception e2) {
if (QLog.isColorLevel()) {
QLog.d(LogTag.n, 2, "getSourceMsgInfo exception:" + e2.getMessage());
}
}
if (sourceMsgInfo != null) {
im_msg_body.SourceMsg sourceMsg = new im_msg_body.SourceMsg();
sourceMsg.uint32_orig_seqs.add(Integer.valueOf((int) sourceMsgInfo.mSourceMsgSeq));
sourceMsg.elems.set(a(sourceMsgInfo.mSourceMsgText, (ArrayList) null).elems.get());
if (!TextUtils.isEmpty(sourceMsgInfo.mAnonymousNickName)) {
im_msg_body.AnonymousGroupMsg anonymousGroupMsg = new im_msg_body.AnonymousGroupMsg();
anonymousGroupMsg.str_anon_nick.set(ByteStringMicro.copyFromUtf8(sourceMsgInfo.mAnonymousNickName));
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.anon_group_msg.set(anonymousGroupMsg);
sourceMsg.elems.add(elem);
}
sourceMsg.uint64_sender_uin.set(sourceMsgInfo.mSourceMsgSenderUin);
sourceMsg.uint32_time.set(sourceMsgInfo.mSourceMsgTime);
sourceMsg.uint32_flag.set(sourceMsgInfo.mSourceSummaryFlag);
sourceMsg.uint32_type.set(sourceMsgInfo.mType);
if (sourceMsgInfo.mRichMsg != null) {
sourceMsg.bytes_richMsg.set(ByteStringMicro.copyFromUtf8(sourceMsgInfo.mRichMsg));
} else {
sourceMsg.uint32_type.set(0);
}
a2 = a(messageForReplyText.f88923msg, messageForReplyText.atInfoList, sourceMsg);
if (a2 != null) {
return a(messageForReplyText.f88923msg, messageForReplyText.atInfoList);
}
return a2;
}
}
a2 = null;
if (a2 != null) {
}
}
public static im_msg_body.RichText a(ChatMessage chatMessage) {
if (chatMessage == null || !(chatMessage instanceof MessageForRichText)) {
return null;
}
return ((MessageForRichText) chatMessage).richText;
}
public static im_msg_body.RichText b(ChatMessage chatMessage) {
MessageForArkApp messageForArkApp;
byte[] pbData;
byte[] b2;
String string;
im_msg_body.RichText richText = null;
if (chatMessage != null && (chatMessage instanceof MessageForArkApp) && (messageForArkApp = (MessageForArkApp) chatMessage) != null && messageForArkApp.ark_app_message != null && (pbData = messageForArkApp.ark_app_message.toPbData()) != null && pbData.length != 0 && (b2 = StructMsgUtils.b(pbData)) != null && b2.length != 0) {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
try {
byteArrayOutputStream.write(1);
byteArrayOutputStream.write(b2);
richText = new im_msg_body.RichText();
im_msg_body.LightAppElem lightAppElem = new im_msg_body.LightAppElem();
lightAppElem.bytes_data.set(ByteStringMicro.copyFrom(byteArrayOutputStream.toByteArray()));
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.light_app.set(lightAppElem);
richText.elems.add(elem);
if (messageForArkApp.ark_app_message.compatibleText != null) {
string = messageForArkApp.ark_app_message.compatibleText;
} else {
String summery = messageForArkApp.getSummery();
if (summery == null || summery.length() == 0) {
string = BaseApplication.getContext().getString(R.string.f65020name_res_0x7f0a19e0);
} else {
string = String.format(BaseApplication.getContext().getString(R.string.f65021name_res_0x7f0a19e1), summery);
}
}
if (string != null && string.length() > 0) {
im_msg_body.Text text = new im_msg_body.Text();
text.str.set(ByteStringMicro.copyFromUtf8(string));
im_msg_body.Elem elem2 = new im_msg_body.Elem();
elem2.text.set(text);
richText.elems.add(elem2);
}
} catch (Exception e) {
}
}
return richText;
}
public static im_msg_body.RichText c(ChatMessage chatMessage) {
im_msg_body.CommonElem commonElem = new im_msg_body.CommonElem();
commonElem.uint32_service_type.set(2);
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.common_elem.set(commonElem);
im_msg_body.Text text = new im_msg_body.Text();
text.str.set(ByteStringMicro.copyFromUtf8("[戳一戳]请使用最新版手机QQ体验新功能。"));
im_msg_body.Elem elem2 = new im_msg_body.Elem();
elem2.text.set(text);
im_msg_body.RichText richText = new im_msg_body.RichText();
richText.elems.add(elem);
richText.elems.add(elem2);
if (QLog.isColorLevel()) {
QLog.d("PokeMsg", 2, "getSendPokeMsgBody");
}
return richText;
}
public static im_msg_body.RichText a(MessageForMarketFace messageForMarketFace) {
String str;
if (messageForMarketFace == null || messageForMarketFace.mMarkFaceMessage == null) {
return null;
}
if (TextUtils.isEmpty(messageForMarketFace.mMarkFaceMessage.faceName)) {
str = "[原创表情]";
} else {
str = StepFactory.f18876a + messageForMarketFace.mMarkFaceMessage.faceName + StepFactory.f18879b;
}
boolean z = true;
if (messageForMarketFace.istroop == 3000) {
z = false;
}
return a(messageForMarketFace.mMarkFaceMessage, str, z);
}
public static im_msg_body.RichText a(MessageForFunnyFace messageForFunnyFace) {
if (messageForFunnyFace == null || messageForFunnyFace.mFunnyFaceMessage == null) {
return null;
}
return a(messageForFunnyFace.mFunnyFaceMessage);
}
public static im_msg_body.RichText a(MessageForFile messageForFile) {
QQAppInterface qQAppInterface = (QQAppInterface) BaseApplicationImpl.a().m1871a();
if (messageForFile == null || qQAppInterface == null || messageForFile.uniseq == -1) {
return null;
}
FileManagerEntity a2 = qQAppInterface.m4644a().a(messageForFile.uniseq, messageForFile.senderuin, messageForFile.istroop);
if (a2 == null) {
return null;
}
im_msg_body.NotOnlineFile notOnlineFile = new im_msg_body.NotOnlineFile();
if (!TextUtils.isEmpty(a2.strFileMd5)) {
notOnlineFile.bytes_file_md5.set(ByteStringMicro.copyFromUtf8(a2.strFileMd5));
}
if (!TextUtils.isEmpty(a2.fileName)) {
notOnlineFile.bytes_file_name.set(ByteStringMicro.copyFromUtf8(a2.fileName));
}
if (!TextUtils.isEmpty(a2.Uuid)) {
notOnlineFile.bytes_file_uuid.set(ByteStringMicro.copyFromUtf8(a2.Uuid));
}
notOnlineFile.uint64_file_size.set(a2.fileSize);
notOnlineFile.uint32_upload_time.set((int) (a2.srvTime / 1000));
im_msg_body.RichText richText = new im_msg_body.RichText();
richText.not_online_file.set(notOnlineFile);
return richText;
}
public static im_msg_body.RichText a(MessageForShakeWindow messageForShakeWindow) {
if (messageForShakeWindow == null || messageForShakeWindow.mShakeWindowMsg == null) {
return null;
}
im_msg_body.RichText richText = new im_msg_body.RichText();
im_msg_body.ShakeWindow shakeWindow = new im_msg_body.ShakeWindow();
shakeWindow.uint32_type.set(messageForShakeWindow.mShakeWindowMsg.mType);
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.shake_window.set(shakeWindow);
richText.elems.add(elem);
return richText;
}
public static im_msg_body.RichText a(MessageForApollo messageForApollo) {
if (messageForApollo == null || messageForApollo.mApolloMessage == null) {
return null;
}
return b(messageForApollo);
}
public static im_msg_body.RichText b(MessageForApollo messageForApollo) {
im_msg_body.ApolloActMsg apolloActMsg = new im_msg_body.ApolloActMsg();
ApolloMessage apolloMessage = messageForApollo.mApolloMessage;
apolloActMsg.uint32_action_id.set(apolloMessage.id);
apolloActMsg.uint32_flag.set(apolloMessage.flag);
apolloActMsg.uint32_peer_uin.set(Utils.a(apolloMessage.peer_uin));
apolloActMsg.uint32_sender_ts.set(Utils.a(apolloMessage.sender_ts));
apolloActMsg.uint32_peer_ts.set(Utils.a(apolloMessage.peer_ts));
apolloActMsg.int32_sender_status.set(apolloMessage.sender_status);
apolloActMsg.int32_peer_status.set(apolloMessage.peer_status);
if (apolloMessage.name != null) {
apolloActMsg.bytes_action_name.set(ByteStringMicro.copyFrom(apolloMessage.name));
}
if (apolloMessage.text != null) {
apolloActMsg.bytes_action_text.set(ByteStringMicro.copyFrom(apolloMessage.text));
}
if (!TextUtils.isEmpty(messageForApollo.inputText)) {
apolloActMsg.input_text.set(ByteStringMicro.copyFrom(messageForApollo.inputText.getBytes()));
}
im_msg_body.Text text = new im_msg_body.Text();
text.str.set(ByteStringMicro.copyFromUtf8(apolloMessage.name != null ? "[动作消息]" + new String(apolloMessage.name) : "[动作消息]"));
im_msg_body.RichText richText = new im_msg_body.RichText();
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.apollo_msg.set(apolloActMsg);
richText.elems.add(elem);
im_msg_body.Elem elem2 = new im_msg_body.Elem();
elem2.text.set(text);
richText.elems.add(elem2);
return richText;
}
public static im_msg_body.RichText a(MessageForLongTextMsg messageForLongTextMsg, boolean z) {
byte[] xmlBytes;
if (messageForLongTextMsg == null) {
return null;
}
if (z) {
if (messageForLongTextMsg.structingMsg == null || (xmlBytes = messageForLongTextMsg.structingMsg.getXmlBytes()) == null) {
return null;
}
im_msg_body.RichMsg richMsg = new im_msg_body.RichMsg();
richMsg.bytes_template_1.set(ByteStringMicro.copyFrom(xmlBytes));
richMsg.uint32_service_id.set(messageForLongTextMsg.structingMsg.mMsgServiceID);
im_msg_body.RichText richText = new im_msg_body.RichText();
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.rich_msg.set(richMsg);
richText.elems.add(elem);
if (!TextUtils.isEmpty(messageForLongTextMsg.structingMsg.mCompatibleText)) {
im_msg_body.Elem elem2 = new im_msg_body.Elem();
im_msg_body.Text text = new im_msg_body.Text();
text.str.set(ByteStringMicro.copyFrom(messageForLongTextMsg.structingMsg.mCompatibleText.getBytes()));
elem2.text.set(text);
richText.elems.add(elem2);
return richText;
}
return richText;
}
im_msg_body.RichText a2 = a(messageForLongTextMsg.f88923msg, messageForLongTextMsg.atInfoList);
im_msg_body.GeneralFlags generalFlags = new im_msg_body.GeneralFlags();
generalFlags.long_text_flag.set(2);
im_msg_body.Elem elem3 = new im_msg_body.Elem();
elem3.general_flags.set(generalFlags);
a2.elems.add(elem3);
return a2;
}
public static im_msg_body.RichText a(MessageForMixedMsg messageForMixedMsg) {
im_msg_body.RichText a2;
if (messageForMixedMsg == null) {
return null;
}
im_msg_body.RichText richText = new im_msg_body.RichText();
int size = messageForMixedMsg.msgElemList.size();
for (int i = 0; i < size; i++) {
MessageRecord messageRecord = (MessageRecord) messageForMixedMsg.msgElemList.get(i);
if (messageRecord instanceof MessageForText) {
im_msg_body.RichText a3 = a((MessageForText) messageRecord);
if (a3 == null) {
return null;
}
for (int i2 = 0; i2 < a3.elems.size(); i2++) {
richText.elems.add(a3.elems.get(i2));
}
} else if (messageRecord instanceof MessageForRichText) {
im_msg_body.RichText richText2 = ((MessageForPic) messageRecord).richText;
if (richText2 == null) {
return null;
}
richText.elems.add(richText2.elems.get(0));
} else if ((messageRecord instanceof MessageForReplyText) && (a2 = a((MessageForReplyText) messageRecord)) != null) {
for (int i3 = 0; i3 < a2.elems.size(); i3++) {
richText.elems.add(a2.elems.get(i3));
}
}
}
return richText;
}
public static im_msg_body.RichText a(MessageForStructing messageForStructing) {
List<AbsStructMsgElement> structMsgItemLists;
ArrayList arrayList;
if (messageForStructing == null || messageForStructing.structingMsg == null) {
return null;
}
if (messageForStructing.richText != null) {
return messageForStructing.richText;
}
byte[] xmlBytes = messageForStructing.structingMsg.getXmlBytes();
if (xmlBytes != null) {
im_msg_body.RichMsg richMsg = new im_msg_body.RichMsg();
richMsg.bytes_template_1.set(ByteStringMicro.copyFrom(xmlBytes));
richMsg.uint32_service_id.set(messageForStructing.structingMsg.mMsgServiceID);
if ((messageForStructing.structingMsg instanceof AbsShareMsg) && (structMsgItemLists = ((AbsShareMsg) messageForStructing.structingMsg).getStructMsgItemLists()) != null) {
for (AbsStructMsgElement absStructMsgElement : structMsgItemLists) {
if ((absStructMsgElement instanceof AbsStructMsgItem) && (arrayList = ((AbsStructMsgItem) absStructMsgElement).f92934a) != null) {
Iterator it = arrayList.iterator();
while (true) {
if (it.hasNext()) {
AbsStructMsgElement absStructMsgElement2 = (AbsStructMsgElement) it.next();
if (absStructMsgElement2 instanceof StructMsgItemVideo) {
if (((StructMsgItemVideo) absStructMsgElement2).a()) {
richMsg.uint32_flags.set(4);
} else {
richMsg.uint32_flags.set(2);
}
}
}
}
}
}
}
im_msg_body.RichText richText = new im_msg_body.RichText();
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.rich_msg.set(richMsg);
richText.elems.add(elem);
if (TextUtils.isEmpty(messageForStructing.structingMsg.mCompatibleText)) {
messageForStructing.structingMsg.mCompatibleText = messageForStructing.structingMsg.mMsgUrl;
}
if (!TextUtils.isEmpty(messageForStructing.structingMsg.mCompatibleText)) {
im_msg_body.Elem elem2 = new im_msg_body.Elem();
im_msg_body.Text text = new im_msg_body.Text();
text.str.set(ByteStringMicro.copyFrom(messageForStructing.structingMsg.mCompatibleText.getBytes()));
elem2.text.set(text);
richText.elems.add(elem2);
return richText;
}
return richText;
}
return null;
}
private static int a(im_msg_body.RichText richText, String str, ArrayList arrayList) {
int i;
int i2;
AppInterface appInterface;
String str2;
Emoticon emoticon;
int i3 = 0;
int i4 = 0;
StringBuilder sb = new StringBuilder();
int i5 = 0;
while (true) {
int i6 = i5;
int i7 = i4;
int i8 = i6;
if (i8 >= str.length()) {
break;
}
MessageForText.AtTroopMemberInfo atTroopMemberInfo = null;
if (arrayList != null) {
int i9 = i7;
MessageForText.AtTroopMemberInfo atTroopMemberInfo2 = null;
while (true) {
if (i9 >= arrayList.size()) {
i = i9;
atTroopMemberInfo = atTroopMemberInfo2;
break;
}
MessageForText.AtTroopMemberInfo atTroopMemberInfo3 = (MessageForText.AtTroopMemberInfo) arrayList.get(i9);
if (atTroopMemberInfo3 != null && atTroopMemberInfo3.isValid()) {
i = i9;
atTroopMemberInfo = atTroopMemberInfo3;
break;
}
atTroopMemberInfo2 = null;
i9++;
}
} else {
i = i7;
}
if (atTroopMemberInfo != null && atTroopMemberInfo.startPos <= i8) {
if (sb.length() > 0) {
a(richText, sb.toString());
sb.delete(0, sb.length());
i3++;
}
im_msg_body.Elem a2 = a(richText, str.substring(atTroopMemberInfo.startPos, atTroopMemberInfo.startPos + atTroopMemberInfo.textLen));
atTroopMemberInfo.startPos = (short) 0;
a(atTroopMemberInfo, a2);
sb.delete(0, sb.length());
i3++;
int i10 = i8 + (atTroopMemberInfo.textLen - 1);
i4 = i + 1;
i2 = i10;
} else if (str.charAt(i8) == 20 && i8 + 1 < str.length()) {
if (sb.length() > 0) {
a(richText, sb.toString());
sb.delete(0, sb.length());
i3++;
}
char charAt = str.charAt(i8 + 1);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "localeCode value:" + ((int) charAt) + ",max len:" + MessageUtils.f28179a.length);
}
if (charAt >= 0 && charAt < MessageUtils.f28179a.length) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "---faceIndex:" + ((int) MessageUtils.f28179a[charAt]));
}
im_msg_body.Face face = new im_msg_body.Face();
face.index.set(MessageUtils.f28179a[charAt]);
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.face.set(face);
richText.elems.add(elem);
i3++;
i8++;
} else if (i8 + 4 < str.length()) {
char[] cArr = new char[4];
cArr[3] = str.charAt(i8 + 1);
cArr[2] = str.charAt(i8 + 2);
cArr[1] = str.charAt(i8 + 3);
cArr[0] = str.charAt(i8 + 4);
for (int i11 = 0; i11 < 4; i11++) {
if (cArr[i11] == 250) {
cArr[i11] = '\n';
} else if (cArr[i11] == 254) {
cArr[i11] = QQText.d;
}
}
int[] a3 = EmosmUtils.a(cArr);
try {
appInterface = (AppInterface) BaseApplicationImpl.a().getAppRuntime(BaseApplicationImpl.getContext().getSharedPreferences("Last_Login", Build.VERSION.SDK_INT > 10 ? 4 : 0).getString("uin", ""));
} catch (AccountNotMatchException e) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "[AccountNotMatchException]," + e.getMessage());
}
appInterface = null;
}
if (appInterface != null) {
EmoticonManager emoticonManager = (EmoticonManager) appInterface.getManager(13);
if (emoticonManager == null) {
emoticon = null;
} else {
emoticon = emoticonManager.a(Integer.toString(a3[0]), Integer.toString(a3[1]));
}
if (emoticon != null) {
str2 = emoticon.character;
int i12 = (a3[0] << 16) + a3[1];
im_msg_body.SmallEmoji smallEmoji = new im_msg_body.SmallEmoji();
smallEmoji.packIdSum.set(i12);
im_msg_body.Elem elem2 = new im_msg_body.Elem();
elem2.small_emoji.set(smallEmoji);
richText.elems.add(elem2);
im_msg_body.Text text = new im_msg_body.Text();
text.str.set(ByteStringMicro.copyFromUtf8(str2));
im_msg_body.Elem elem3 = new im_msg_body.Elem();
elem3.text.set(text);
richText.elems.add(elem3);
i3 = i3 + 1 + 1;
i8 += 4;
}
}
str2 = QQText.f30383e;
int i122 = (a3[0] << 16) + a3[1];
im_msg_body.SmallEmoji smallEmoji2 = new im_msg_body.SmallEmoji();
smallEmoji2.packIdSum.set(i122);
im_msg_body.Elem elem22 = new im_msg_body.Elem();
elem22.small_emoji.set(smallEmoji2);
richText.elems.add(elem22);
im_msg_body.Text text2 = new im_msg_body.Text();
text2.str.set(ByteStringMicro.copyFromUtf8(str2));
im_msg_body.Elem elem32 = new im_msg_body.Elem();
elem32.text.set(text2);
richText.elems.add(elem32);
i3 = i3 + 1 + 1;
i8 += 4;
}
i2 = i8;
i4 = i;
} else {
sb.append(str.charAt(i8));
i2 = i8;
i4 = i;
}
i5 = i2 + 1;
}
if (sb.length() > 0) {
a(richText, sb.toString());
return i3 + 1;
}
return i3;
}
private static im_msg_body.Elem a(im_msg_body.RichText richText, String str) {
im_msg_body.Text text = new im_msg_body.Text();
text.str.set(ByteStringMicro.copyFromUtf8(str));
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.text.set(text);
richText.elems.add(elem);
return elem;
}
private static void a(MessageForText.AtTroopMemberInfo atTroopMemberInfo, im_msg_body.Elem elem) {
if (atTroopMemberInfo != null) {
byte[] bArr = new byte[13];
PkgTools.a(bArr, 0, (short) 1);
atTroopMemberInfo.writeTo(bArr, 2);
elem.text.attr_6_buf.set(ByteStringMicro.copyFrom(bArr));
}
}
public static im_msg_body.RichText a(FunnyFaceMessage funnyFaceMessage) {
im_msg_body.FunFace funFace = new im_msg_body.FunFace();
if (funnyFaceMessage.faceId == 1) {
im_msg_body.FunFace.Turntable turntable = new im_msg_body.FunFace.Turntable();
for (String str : funnyFaceMessage.turntable.uinList) {
turntable.rpt_uint64_uin_list.add(Long.valueOf(str));
}
turntable.uint64_hit_uin.set(Long.valueOf(funnyFaceMessage.turntable.hitUin).longValue());
funFace.msg_turntable.set(turntable);
} else if (funnyFaceMessage.faceId == 2) {
im_msg_body.FunFace.Bomb bomb = new im_msg_body.FunFace.Bomb();
bomb.bool_burst.set(funnyFaceMessage.bomb.isBurst);
funFace.msg_bomb.set(bomb);
}
im_msg_body.RichText richText = new im_msg_body.RichText();
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.fun_face.set(funFace);
richText.elems.add(elem);
return richText;
}
public static im_msg_body.RichText a(MarkFaceMessage markFaceMessage, String str, boolean z) {
im_msg_body.MarketFace marketFace = new im_msg_body.MarketFace();
if (markFaceMessage.sbufID != null) {
marketFace.bytes_face_id.set(ByteStringMicro.copyFrom(markFaceMessage.sbufID));
}
if (z && str != null) {
marketFace.bytes_face_name.set(ByteStringMicro.copyFromUtf8(str));
}
if (markFaceMessage.sbfKey != null) {
marketFace.bytes_key.set(ByteStringMicro.copyFrom(markFaceMessage.sbfKey));
}
marketFace.uint32_face_info.set(markFaceMessage.cFaceInfo);
marketFace.uint32_item_type.set(markFaceMessage.dwMSGItemType);
marketFace.uint32_sub_type.set(markFaceMessage.cSubType);
marketFace.uint32_tab_id.set(markFaceMessage.dwTabID);
marketFace.uint32_media_type.set(markFaceMessage.mediaType);
marketFace.uint32_image_width.set(markFaceMessage.imageWidth);
marketFace.uint32_image_height.set(markFaceMessage.imageHeight);
if (markFaceMessage.mobileparam != null && markFaceMessage.mobileparam.length > 0) {
marketFace.bytes_mobileparam.set(ByteStringMicro.copyFrom(markFaceMessage.mobileparam));
}
if (markFaceMessage.resvAttr != null && markFaceMessage.resvAttr.length > 0) {
marketFace.bytes_ext_info.set(ByteStringMicro.copyFrom(markFaceMessage.resvAttr));
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "encodeMarketFace : mf epid = " + marketFace.uint32_tab_id.get() + " csubtype = " + marketFace.uint32_sub_type.get() + ";mediaType = " + marketFace.uint32_media_type.get());
}
im_msg_body.Text text = new im_msg_body.Text();
if (str != null) {
text.str.set(ByteStringMicro.copyFromUtf8(str));
} else {
text.str.set(ByteStringMicro.copyFromUtf8(""));
}
im_msg_body.RichText richText = new im_msg_body.RichText();
im_msg_body.Elem elem = new im_msg_body.Elem();
elem.market_face.set(marketFace);
richText.elems.add(elem);
im_msg_body.Elem elem2 = new im_msg_body.Elem();
elem2.text.set(text);
richText.elems.add(elem2);
return richText;
}
public static void a(MessageHandler messageHandler, List list, msg_comm.Msg msg2, long j, boolean z, boolean z2, boolean z3) {
if (msg2.msg_body.has() && ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has() && ((msg_comm.MsgHead) msg2.msg_head.get()).c2c_cmd.has()) {
if (!msg2.content_head.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMessagePackage: msg doesn't has the contentHead.");
return;
}
return;
}
msg_comm.ContentHead contentHead = (msg_comm.ContentHead) msg2.content_head.get();
boolean z4 = contentHead.auto_reply.has() && contentHead.auto_reply.get() == 1;
List<im_msg_body.Elem> list2 = ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get();
if (QLog.isColorLevel()) {
StringBuilder sb = new StringBuilder(128);
sb.append("<---decodeC2CMsgPkg_Buddy:elems size:").append(list2.size()).append(" isAutoReply:").append(z4);
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
}
if (z4) {
if (list2 != null && list2.size() > 0) {
String string = BaseApplication.getContext().getString(R.string.f64309name_res_0x7f0a1714);
for (im_msg_body.Elem elem : list2) {
if (elem.text.has()) {
im_msg_body.Text text = (im_msg_body.Text) elem.text.get();
if (!z) {
String str = string + TroopBarUtils.y + text.str.get().toStringUtf8();
MessageRecord a2 = MessageRecordFactory.a(-10000);
a2.msgtype = -10000;
a2.f88923msg = str;
list.add(a2);
return;
}
return;
}
}
return;
}
return;
}
a(messageHandler, list, msg2, true, z, (MessageInfo) null);
}
}
public static int a(msg_comm.Msg msg2) {
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
return 0;
}
for (im_msg_body.Elem elem : ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get()) {
if (elem.general_flags.has() && ((im_msg_body.GeneralFlags) elem.general_flags.get()).uint32_bubble_diy_text_id.has()) {
int i = ((im_msg_body.GeneralFlags) elem.general_flags.get()).uint32_bubble_diy_text_id.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "decodeC2CMsgPkg_BubbleDiyTextID->" + i);
return i;
}
return i;
}
}
return 0;
}
public static Pair a(MessageHandler messageHandler, msg_comm.Msg msg2, String str, String str2) {
long j;
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
return new Pair(0L, 0L);
}
Iterator it = ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get().iterator();
while (true) {
if (!it.hasNext()) {
j = -1;
break;
}
im_msg_body.Elem elem = (im_msg_body.Elem) it.next();
if (elem.elem_flags2.has() && ((im_msg_body.ElemFlags2) elem.elem_flags2.get()).uint32_color_text_id.has()) {
j = ((im_msg_body.ElemFlags2) elem.elem_flags2.get()).uint32_color_text_id.get() & 4294967295L;
break;
} else if (elem.secret_file.has()) {
im_msg_body.SecretFileMsg secretFileMsg = elem.secret_file;
if (secretFileMsg.elem_flags2.has() && secretFileMsg.elem_flags2.uint32_color_text_id.has()) {
j = ((im_msg_body.ElemFlags2) secretFileMsg.elem_flags2.get()).uint32_color_text_id.get() & 4294967295L;
break;
}
}
}
return new Pair(Long.valueOf(j), Long.valueOf(j == 4294967295L ? messageHandler.f87244b.m4635a().m5033a(str, str2) : -1L));
}
public static void a(MessageHandler messageHandler, List list, msg_comm.Msg msg2, long j, long j2, boolean z) {
boolean z2;
boolean z3;
RichMsg.PicRec picRec;
String str;
String str2;
im_msg_body.Text text;
RichMsg.PicRec picRec2;
String str3;
msg_comm.AppShareInfo appShareInfo = (msg_comm.AppShareInfo) msg2.appshare_info.get();
if (msg2.appshare_info.has()) {
long j3 = appShareInfo.appshare_id.get() & 4294967295L;
msg_comm.PluginInfo pluginInfo = (msg_comm.PluginInfo) appShareInfo.appshare_resource.get();
if (!appShareInfo.appshare_resource.has() || pluginInfo == null || z) {
z2 = false;
} else {
AppShareID a2 = AppShareIDUtil.a(pluginInfo);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared appShareID:" + a2.toString());
}
AppShareID appShareID = (AppShareID) messageHandler.m4435a().a(AppShareID.class, "strPkgName=?", new String[]{a2.strPkgName});
if (appShareID == null) {
messageHandler.m4435a().m7242a((Entity) a2);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared Persist DB appid = " + a2.strPkgName);
}
} else if (a2.uiNewVer != appShareID.uiNewVer || Math.abs(appShareID.updateTime - a2.updateTime) > 86400000) {
messageHandler.m4435a().m7248b((Entity) appShareID);
messageHandler.m4435a().m7242a((Entity) a2);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared Update DB appid = " + a2.strPkgName);
}
} else if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared Not need update DB appid = " + a2.strPkgName);
}
messageHandler.f87244b.m4654a().a(a2.strPkgName, a2);
z2 = true;
}
if (msg2.msg_body.has() && ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
List<im_msg_body.Elem> list2 = ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get();
String str4 = null;
String string = BaseApplication.getContext().getString(R.string.f65098name_res_0x7f0a1a2e);
RichMsg.PicRec picRec3 = null;
boolean z4 = false;
boolean z5 = false;
for (im_msg_body.Elem elem : list2) {
boolean has = elem.text.has();
boolean has2 = elem.not_online_image.has();
boolean z6 = has2 ? true : z4;
boolean z7 = has ? true : z5;
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared hasText:" + has + ",hasNotOnlineImage:" + has2);
}
if (has2) {
im_msg_body.NotOnlineImage notOnlineImage = (im_msg_body.NotOnlineImage) elem.not_online_image.get();
int i = notOnlineImage.file_len.get();
String str5 = null;
if (notOnlineImage.download_path.has()) {
str5 = notOnlineImage.download_path.get().toStringUtf8();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared: serverPath:" + str5);
}
}
if (str5 != null) {
RichMsg.PicRec picRec4 = new RichMsg.PicRec();
picRec4.localPath.set(str5 != null ? str5 : "");
picRec4.size.set(i);
picRec4.type.set(1);
picRec4.uuid.set(str5 != null ? str5 : "");
str3 = TransfileUtile.a(str5, i, 1, false, str5);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared: content:" + str3);
}
picRec2 = picRec4;
} else {
picRec2 = picRec3;
str3 = string;
}
str = str3;
str2 = str4;
picRec = picRec2;
z3 = z6;
} else if (has) {
String stringUtf8 = ((im_msg_body.Text) elem.text.get()).str.get().toStringUtf8();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared actionUrl:" + stringUtf8 + ",hasLink:" + text.link.has() + ",str:" + text.str.has() + ",strC:" + text.str.get().toStringUtf8());
QLog.d("Q.msg.MessageHandler", 2, "<--decodeC2CMsgPkg_AppShared : bytes:" + text.str.get().size() + ",cont:" + text.str.get() + ",content:" + Arrays.toString(text.str.get().toByteArray()));
}
z3 = z6;
RichMsg.PicRec picRec5 = picRec3;
str = string;
str2 = stringUtf8;
picRec = picRec5;
} else if (elem.custom_face.has()) {
im_msg_body.CustomFace customFace = (im_msg_body.CustomFace) elem.custom_face.get();
String str6 = customFace.str_file_path.get();
String str7 = customFace.str_shortcut.get();
String str8 = customFace.str_big_url.get();
String str9 = customFace.str_orig_url.get();
String str10 = customFace.str_thumb_url.get();
customFace.str_400_url.get();
long j4 = customFace.uint32_file_id.get() & 4294967295L;
long j5 = customFace.uint32_file_type.get() & 4294967295L;
long j6 = customFace.uint32_server_ip.get() & 4294967295L;
long j7 = customFace.uint32_server_port.get() & 4294967295L;
long j8 = customFace.uint32_useful.get() & 4294967295L;
byte[] byteArray = customFace.bytes_md5.get().toByteArray();
byte[] byteArray2 = customFace.bytes_signature.get().toByteArray();
customFace.bytes_buffer.get().toByteArray();
byte[] byteArray3 = customFace.bytes_flag.get().toByteArray();
String a3 = HexUtil.a(byteArray);
String a4 = HexUtil.a(byteArray2);
String a5 = HexUtil.a(byteArray3);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgElems: decode CustomFace, dump customFace info: filePath:" + str6 + ", shortCut:" + str7 + ", fileID:" + j4 + ", fileType:" + j5 + ", serverIP:" + j6 + ", serverPort" + j7 + ", useful" + j8 + ",md5:" + a3 + ",signature:" + a4 + ",flag:" + a5 + ",downURLBig:" + str8 + ",downURLOri:" + str9 + ",downURLThum:" + str10);
}
String str11 = "http://quntu.3g.qq.com/cgi/svr/chatimg/get?pic=" + str6 + "&gid=" + j + "&time=" + j2 + "&msfid=" + messageHandler.f87244b.getCurrentAccountUin();
RichMsg.PicRec picRec6 = new RichMsg.PicRec();
picRec6.localPath.set(str11 != null ? str11 : "");
picRec6.size.set(0L);
picRec6.type.set(1);
picRec6.uuid.set(str11 != null ? str11 : "");
z3 = true;
str = TransfileUtile.a(str11, 0L, 1, false, str11);
str2 = str4;
picRec = picRec6;
} else {
z3 = z6;
picRec = picRec3;
str = string;
str2 = str4;
}
z4 = z3;
str4 = str2;
string = str;
picRec3 = picRec;
z5 = z7;
}
if (z4 && !z5) {
MessageForPic messageForPic = (MessageForPic) MessageRecordFactory.a(-2000);
messageForPic.msgtype = -2000;
messageForPic.msgData = picRec3.toByteArray();
messageForPic.f88923msg = string;
messageForPic.parse();
list.add(messageForPic);
} else if (!z4 && z5) {
MessageForText messageForText = (MessageForText) MessageRecordFactory.a(-1000);
messageForText.msgtype = -1000;
messageForText.f88923msg = str4;
list.add(messageForText);
return;
}
}
if (!z2) {
messageHandler.a(Long.valueOf(j3));
}
}
}
public static void a(MessageHandler messageHandler, List list, msg_comm.Msg msg2, boolean z, boolean z2, MessageInfo messageInfo) {
a(messageHandler, list, msg2, z, z2, messageInfo, (TempSessionInfo) null);
}
public static void a(MessageHandler messageHandler, List list, msg_comm.Msg msg2, boolean z, boolean z2, MessageInfo messageInfo, TempSessionInfo tempSessionInfo) {
List list2 = ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodePBMsgElems: elems: " + (list2 == null ? null : Integer.valueOf(list2.size())));
}
if (list2 != null && list2.size() > 0) {
StringBuilder sb = new StringBuilder("<---decodePBMsgElems:");
ArrayList a2 = MessagePBDecoderConfig.a(list2);
int a3 = MessagePBDecoderConfig.a(a2);
if (QLog.isColorLevel()) {
sb.append("decodeElemType:").append(a3).append(" ElemStrs:").append(a2.toString()).append("\n");
}
MessagePBElemDecoder messagePBElemDecoder = new MessagePBElemDecoder();
if (QLog.isColorLevel()) {
QLog.d("flash", 2, "decodePBMsgElems decodeElemType=" + a3);
}
switch (a3) {
case 1:
messagePBElemDecoder.a(list2, list, sb, z2);
break;
case 4:
messagePBElemDecoder.b(list2, list, sb, z);
break;
case 5:
messagePBElemDecoder.a(list2, list, sb, msg2);
break;
case 6:
messagePBElemDecoder.b(list2, list, sb, msg2, messageInfo);
break;
case 7:
messagePBElemDecoder.b(list2, list, sb);
break;
case 8:
messagePBElemDecoder.a(list2, list, sb);
break;
case 10:
messagePBElemDecoder.c(list2, list, sb);
break;
case 11:
messagePBElemDecoder.b(list2, list, sb, msg2);
break;
case 12:
messagePBElemDecoder.e(list2, list, sb, msg2, messageInfo);
break;
case 13:
messagePBElemDecoder.c(list2, list, sb, msg2);
break;
case 14:
messagePBElemDecoder.c(list2, list, sb, msg2, messageInfo);
break;
case 15:
messagePBElemDecoder.d(list2, list, sb);
break;
case 16:
messagePBElemDecoder.e(list2, list, sb);
break;
case 17:
messagePBElemDecoder.d(list2, list, sb, msg2, messageInfo);
break;
case 18:
messagePBElemDecoder.a(list2, list, sb, msg2, messageInfo, z);
break;
case 19:
messagePBElemDecoder.b(list2, list, sb, msg2, messageInfo, z);
break;
case 20:
messagePBElemDecoder.f(list2, list, sb, msg2, messageInfo);
break;
case 21:
messagePBElemDecoder.g(list2, list, sb, msg2, messageInfo);
break;
case 22:
messagePBElemDecoder.a(list2, list, sb, msg2, z);
break;
case 23:
messagePBElemDecoder.b(list2, list, sb, msg2, z);
break;
}
if (list.isEmpty()) {
messagePBElemDecoder.d(list2, list, sb, msg2, messageInfo);
}
if (list.isEmpty()) {
messagePBElemDecoder.g(list2, list, sb, msg2, messageInfo);
}
if (MessagePBDecoderConfig.m7801a(a2)) {
messagePBElemDecoder.a(a2, list2, list, sb, msg2, messageInfo, tempSessionInfo);
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
}
}
}
public static MessageRecord a(List list, byte[] bArr, MessageInfo messageInfo) {
boolean z;
MixedMsg.Msg msg2 = new MixedMsg.Msg();
JSONObject jSONObject = new JSONObject();
String str = "";
Iterator it = list.iterator();
boolean z2 = false;
int i = 0;
while (it.hasNext()) {
MessageRecord messageRecord = (MessageRecord) it.next();
MixedMsg.Elem elem = new MixedMsg.Elem();
if (messageRecord.msgtype == -1000) {
if (!TextUtils.isEmpty(messageRecord.f88923msg)) {
elem.textMsg.set(messageRecord.f88923msg);
try {
if (messageRecord.atInfoList != null && messageRecord.atInfoList.size() > 0) {
JSONArray jSONArray = new JSONArray();
Iterator it2 = messageRecord.atInfoList.iterator();
int i2 = 0;
while (it2.hasNext()) {
jSONArray.put(i2, ((MessageForText.AtTroopMemberInfo) it2.next()).toJsonObject());
i2++;
}
jSONObject.put("" + i, jSONArray);
z2 = true;
}
z = z2;
} catch (JSONException e) {
QLog.e("Q.msg.MessageHandler", 1, "disc mixMsg create atInfos error:", e);
z = z2;
}
}
} else if (messageRecord.msgtype == -2000) {
try {
elem.picMsg.set((RichMsg.PicRec) new RichMsg.PicRec().mergeFrom(messageRecord.msgData));
} catch (InvalidProtocolBufferMicroException e2) {
e2.printStackTrace();
}
z = z2;
} else {
if (messageRecord.msgtype == -1049) {
try {
MessageForReplyText messageForReplyText = (MessageForReplyText) messageRecord;
elem.sourceMsgInfo.set(HexUtil.a(MessagePkgUtils.a(messageForReplyText.mSourceMsgInfo)));
if (!TextUtils.isEmpty(messageForReplyText.f88923msg)) {
elem.textMsg.set(messageForReplyText.f88923msg);
}
z = z2;
} catch (Exception e3) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, e3.getMessage());
}
}
}
z = z2;
}
msg2.elems.get().add(elem);
int i3 = i + 1;
String extInfoFromExtStr = messageRecord.getExtInfoFromExtStr(QQText.n);
i = i3;
str = !TextUtils.isEmpty(extInfoFromExtStr) ? str + "|" + extInfoFromExtStr : str;
z2 = z;
}
MessageForMixedMsg messageForMixedMsg = (MessageForMixedMsg) MessageRecordFactory.a((int) MessageRecord.MSG_TYPE_MIX);
messageForMixedMsg.msgtype = MessageRecord.MSG_TYPE_MIX;
messageForMixedMsg.msgData = msg2.toByteArray();
if (messageInfo != null && (messageInfo.f32014a == 3000 || messageInfo.f32014a == 1)) {
messageForMixedMsg.frienduin = messageInfo.f32016a;
messageForMixedMsg.istroop = messageInfo.f32014a;
}
if (z2) {
AtTroopMemberSpan.a(messageInfo.f32014a, jSONObject.toString(), messageForMixedMsg);
}
if (bArr != null) {
messageForMixedMsg.saveExtInfoToExtStr(MQPSensitiveMsgUtil.g, HexUtil.a(bArr));
}
if (!TextUtils.isEmpty(str)) {
messageForMixedMsg.saveExtInfoToExtStr(QQText.n, str);
}
messageForMixedMsg.parse();
return messageForMixedMsg;
}
public static msg_svc.PbSendMsgReq a(QQAppInterface qQAppInterface, int i, MessageRecord messageRecord, im_msg_body.RichText richText, msg_comm.AppShareInfo appShareInfo, int i2) {
byte[] m7748a;
if (i == 9 || i == 13 || messageRecord == null) {
return null;
}
long j = messageRecord.msgUid;
int i3 = ((short) messageRecord.msgseq) & 65535;
int a2 = MessageUtils.a(j);
MessageCache m4654a = qQAppInterface.m4654a();
msg_svc.RoutingHead routingHead = new msg_svc.RoutingHead();
boolean z = false;
switch (i) {
case 1:
msg_svc.C2C c2c = new msg_svc.C2C();
c2c.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
routingHead.c2c.set(c2c);
z = true;
break;
case 2:
msg_svc.Grp grp = new msg_svc.Grp();
grp.group_code.set(Long.valueOf(messageRecord.frienduin).longValue());
routingHead.grp.set(grp);
z = true;
break;
case 3:
if (TextUtils.isEmpty(messageRecord.senderuin) || Long.valueOf(messageRecord.senderuin).longValue() == 0 || TextUtils.equals(messageRecord.senderuin, messageRecord.selfuin) || TextUtils.equals(messageRecord.senderuin, messageRecord.frienduin)) {
}
msg_svc.GrpTmp grpTmp = new msg_svc.GrpTmp();
if (TextUtils.isEmpty(messageRecord.senderuin)) {
grpTmp.group_uin.set(Long.valueOf(messageRecord.selfuin).longValue());
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "createSendRichTextMsgReq, senderuin error, senderuin: " + messageRecord.senderuin + " frienduin: " + messageRecord.frienduin + " msgtype: " + messageRecord.msgtype);
}
} else {
grpTmp.group_uin.set(Long.valueOf(messageRecord.senderuin).longValue());
}
grpTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
routingHead.grp_tmp.set(grpTmp);
z = true;
break;
case 4:
msg_svc.Dis dis = new msg_svc.Dis();
dis.dis_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
routingHead.dis.set(dis);
z = true;
break;
case 5:
msg_svc.DisTmp disTmp = new msg_svc.DisTmp();
disTmp.dis_uin.set(Long.valueOf(messageRecord.senderuin).longValue());
disTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
routingHead.dis_tmp.set(disTmp);
z = true;
break;
case 6:
byte[] m7767b = m4654a.m7767b(messageRecord.frienduin);
msg_svc.WPATmp wPATmp = new msg_svc.WPATmp();
wPATmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
if (m7767b != null) {
byte[] bArr = new byte[m7767b.length - 2];
PkgTools.a(bArr, 0, m7767b, 2, m7767b.length - 2);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "wpa------>" + HexUtil.a(bArr) + ",length:" + bArr.length);
}
wPATmp.sig.set(ByteStringMicro.copyFrom(bArr));
}
routingHead.wpa_tmp.set(wPATmp);
z = true;
break;
case 8:
byte[] m7749a = m4654a.m7749a(messageRecord.frienduin);
msg_svc.PublicPlat publicPlat = new msg_svc.PublicPlat();
publicPlat.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
if (m7749a != null) {
byte[] bArr2 = new byte[m7749a.length - 2];
PkgTools.a(bArr2, 0, m7749a, 2, m7749a.length - 2);
publicPlat.sig.set(ByteStringMicro.copyFrom(bArr2));
}
routingHead.public_plat.set(publicPlat);
z = true;
break;
case 10:
msg_svc.AddressListTmp addressListTmp = new msg_svc.AddressListTmp();
addressListTmp.from_phone.set(messageRecord.senderuin);
addressListTmp.to_phone.set(messageRecord.frienduin);
byte[] m7791f = m4654a.m7791f(messageRecord.frienduin);
if (m7791f != null) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "sameState------>" + HexUtil.a(m7791f) + ",length:" + m7791f.length);
}
addressListTmp.sig.set(ByteStringMicro.copyFrom(m7791f));
}
routingHead.address_list.set(addressListTmp);
z = true;
break;
case 11:
msg_svc.RichStatusTmp richStatusTmp = new msg_svc.RichStatusTmp();
richStatusTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
byte[] m7797i = m4654a.m7797i(messageRecord.frienduin);
if (m7797i != null) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "sameState------>" + HexUtil.a(m7797i) + ",length:" + m7797i.length);
}
richStatusTmp.sig.set(ByteStringMicro.copyFrom(m7797i));
}
routingHead.rich_status_tmp.set(richStatusTmp);
z = true;
break;
case 12:
msg_svc.AccostTmp accostTmp = new msg_svc.AccostTmp();
accostTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
QQMessageFacade.Message m5041a = qQAppInterface.m4635a().m5041a(messageRecord.frienduin, 1001);
accostTmp.reply.set(m5041a.hasReply);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "LBSFriend------>reply=" + m5041a.hasReply);
}
byte[] j2 = m4654a.j(messageRecord.frienduin);
if (j2 != null) {
if (QLog.isDevelopLevel()) {
QLog.d("fight_accost", 4, "发送附近人临时会消息 有keyLBSFriend------>" + HexUtil.a(j2) + ",length:" + j2.length);
}
accostTmp.sig.set(ByteStringMicro.copyFrom(j2));
}
routingHead.accost_tmp.set(accostTmp);
z = true;
break;
case 14:
msg_svc.PubGroupTmp pubGroupTmp = new msg_svc.PubGroupTmp();
pubGroupTmp.group_uin.set(Long.valueOf(messageRecord.senderuin).longValue());
pubGroupTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
routingHead.pub_group_tmp.set(pubGroupTmp);
z = true;
break;
case 15:
byte[] m7781d = m4654a.m7781d(messageRecord.frienduin);
msg_svc.BusinessWPATmp businessWPATmp = new msg_svc.BusinessWPATmp();
businessWPATmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
if (m7781d != null) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "conversation------>sig:" + HexUtil.a(m7781d) + ",length:" + m7781d.length);
}
businessWPATmp.sig.set(ByteStringMicro.copyFrom(m7781d));
} else {
byte[] m7786e = m4654a.m7786e(messageRecord.frienduin);
if (m7786e != null) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "conversation------>sigt:" + HexUtil.a(m7786e) + ",length:" + m7786e.length);
}
businessWPATmp.sigt.set(ByteStringMicro.copyFrom(m7786e));
}
}
routingHead.business_wpa_tmp.set(businessWPATmp);
z = true;
break;
case 17:
msg_svc.AuthTmp authTmp = new msg_svc.AuthTmp();
authTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
byte[] m7795h = m4654a.m7795h(messageRecord.frienduin);
if (m7795h != null) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "friendValidation------>" + HexUtil.a(m7795h) + ",length:" + m7795h.length);
}
authTmp.sig.set(ByteStringMicro.copyFrom(m7795h));
}
routingHead.auth_tmp.set(authTmp);
z = true;
break;
case 18:
byte[] m7776c = m4654a.m7776c(messageRecord.frienduin);
msg_svc.QQQueryBusinessTmp qQQueryBusinessTmp = new msg_svc.QQQueryBusinessTmp();
qQQueryBusinessTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
if (m7776c != null) {
byte[] bArr3 = new byte[m7776c.length - 2];
PkgTools.a(bArr3, 0, m7776c, 2, m7776c.length - 2);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "wpa------>" + HexUtil.a(bArr3) + ",length:" + bArr3.length);
}
qQQueryBusinessTmp.sig.set(ByteStringMicro.copyFrom(bArr3));
}
routingHead.qq_querybusiness_tmp.set(qQQueryBusinessTmp);
z = true;
break;
case 19:
msg_svc.NearByDatingTmp nearByDatingTmp = new msg_svc.NearByDatingTmp();
nearByDatingTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
nearByDatingTmp.reply.set(qQAppInterface.m4635a().m5041a(messageRecord.frienduin, 1010).hasReply);
byte[] m = m4654a.m(messageRecord.frienduin);
if (m != null) {
if (QLog.isDevelopLevel()) {
QLog.d("nearby_dating", 4, "发送附近人约会临时会话消息 有keyNearbyDating------>" + HexUtil.a(m) + ",length:" + m.length);
}
nearByDatingTmp.sig.set(ByteStringMicro.copyFrom(m));
}
routingHead.nearby_dating_tmp.set(nearByDatingTmp);
z = true;
break;
case 20:
msg_svc.NearByAssistantTmp nearByAssistantTmp = new msg_svc.NearByAssistantTmp();
nearByAssistantTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
byte[] l = m4654a.l(messageRecord.frienduin);
if (l != null) {
if (QLog.isDevelopLevel()) {
QLog.d("nearby_assistant", 4, "发送附近人助手临时会话消息 有NearbyAssistantKey------>" + HexUtil.a(l) + ",length:" + l.length);
}
nearByAssistantTmp.sig.set(ByteStringMicro.copyFrom(l));
}
routingHead.nearby_assistant_tmp.set(nearByAssistantTmp);
z = true;
break;
case 21:
msg_svc.Grp grp2 = new msg_svc.Grp();
grp2.group_code.set(Long.valueOf(messageRecord.frienduin).longValue());
routingHead.grp.set(grp2);
z = true;
break;
case 22:
msg_svc.CommTmp commTmp = new msg_svc.CommTmp();
commTmp.c2c_type.set(1);
commTmp.svr_type.set(144);
commTmp.to_uin.set(Long.valueOf(messageRecord.frienduin).longValue());
byte[] k = m4654a.k(messageRecord.frienduin);
if (k != null) {
commTmp.sig.set(ByteStringMicro.copyFrom(k));
}
routingHead.comm_tmp.set(commTmp);
z = true;
break;
}
if (!z) {
return null;
}
msg_comm.ContentHead contentHead = new msg_comm.ContentHead();
contentHead.pkg_num.set(messageRecord.longMsgCount);
contentHead.div_seq.set(messageRecord.longMsgId);
contentHead.pkg_index.set(messageRecord.longMsgIndex);
im_msg_body.MsgBody msgBody = new im_msg_body.MsgBody();
msgBody.rich_text.set(richText);
msg_svc.PbSendMsgReq pbSendMsgReq = new msg_svc.PbSendMsgReq();
pbSendMsgReq.routing_head.set(routingHead);
pbSendMsgReq.content_head.set(contentHead);
pbSendMsgReq.msg_body.set(msgBody);
pbSendMsgReq.msg_seq.set(i3);
pbSendMsgReq.msg_rand.set(a2);
if (i != 2 && i != 4 && i != 21 && (m7748a = m4654a.m7748a()) != null) {
pbSendMsgReq.sync_cookie.set(ByteStringMicro.copyFrom(m7748a));
}
if (appShareInfo != null) {
pbSendMsgReq.app_share.set(appShareInfo);
}
pbSendMsgReq.msg_via.set(i2);
return pbSendMsgReq;
}
public static msg_svc.PbSendMsgReq a(QQAppInterface qQAppInterface, int i, String str, TransMsgContext transMsgContext, long j, int i2) {
long length;
if (transMsgContext == null) {
return null;
}
short s = (short) j;
int i3 = 65535 & s;
if (i == 9 || i == 13) {
length = 144115188075855872L | (transMsgContext.f28184a.length << 16) | 166;
} else {
length = 72057594037927936L | i2;
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<PbSendMsg><S>--->createPbSendMsgReq: routingType:" + i + ",toUin:" + str + ",msgUid:" + length + ",msgSeq:" + j + ",uint32Seq:" + i3 + ",shortSeq:" + ((int) s) + ",randomNum:" + i2 + ",msgContext:" + transMsgContext);
}
MessageCache m4654a = qQAppInterface.m4654a();
msg_svc.RoutingHead routingHead = new msg_svc.RoutingHead();
boolean z = false;
switch (i) {
case 9:
msg_svc.TransMsg transMsg = new msg_svc.TransMsg();
transMsg.c2c_cmd.set(transMsgContext.f92312a);
transMsg.to_uin.set(Long.valueOf(str).longValue());
routingHead.trans_msg.set(transMsg);
z = true;
break;
case 13:
msg_svc.Trans0x211 trans0x211 = new msg_svc.Trans0x211();
trans0x211.cc_cmd.set(transMsgContext.f92312a);
String str2 = "";
if (!TextUtils.isEmpty(str)) {
str2 = str.replace(IndexView.f95330c, "");
}
trans0x211.to_uin.set(CharacterUtil.m762a(str2));
routingHead.trans_0x211.set(trans0x211);
z = true;
break;
}
if (!z) {
return null;
}
msg_comm.ContentHead contentHead = new msg_comm.ContentHead();
contentHead.pkg_num.set(1);
contentHead.div_seq.set(s);
contentHead.pkg_index.set(0);
im_msg_body.MsgBody msgBody = new im_msg_body.MsgBody();
msgBody.msg_content.set(ByteStringMicro.copyFrom(transMsgContext.f28184a));
msg_svc.PbSendMsgReq pbSendMsgReq = new msg_svc.PbSendMsgReq();
pbSendMsgReq.routing_head.set(routingHead);
pbSendMsgReq.content_head.set(contentHead);
pbSendMsgReq.msg_body.set(msgBody);
pbSendMsgReq.msg_seq.set(i3);
pbSendMsgReq.msg_rand.set(i2);
byte[] m7748a = m4654a.m7748a();
if (m7748a != null) {
pbSendMsgReq.sync_cookie.set(ByteStringMicro.copyFrom(m7748a));
return pbSendMsgReq;
}
return pbSendMsgReq;
}
public static msg_svc.PbSendMsgReq a(MessageHandler messageHandler, String str, byte[] bArr, int i, int i2, TransMsgContext transMsgContext, long j, int i3) {
if (transMsgContext == null) {
return null;
}
short s = (short) j;
int i4 = 65535 & s;
long length = 144115188075855872L | (transMsgContext.f28184a.length << 16) | 166;
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<PbSendMsg><S>--->createTempSessionSendMsgReq: routingType:13,toUin:" + str + ",msgUid:" + length + ",msgSeq:" + j + ",uint32Seq:" + i4 + ",shortSeq:" + ((int) s) + ",randomNum:" + i3 + ",msgContext:" + transMsgContext);
}
MessageCache m4654a = messageHandler.f87244b.m4654a();
msg_svc.RoutingHead routingHead = new msg_svc.RoutingHead();
msg_svc.Trans0x211 trans0x211 = new msg_svc.Trans0x211();
trans0x211.cc_cmd.set(transMsgContext.f92312a);
trans0x211.to_uin.set(Long.valueOf(str).longValue());
if (bArr != null) {
trans0x211.sig.set(ByteStringMicro.copyFrom(bArr));
}
trans0x211.c2c_type.set(i);
trans0x211.service_type.set(i2);
routingHead.trans_0x211.set(trans0x211);
msg_comm.ContentHead contentHead = new msg_comm.ContentHead();
contentHead.pkg_num.set(1);
contentHead.div_seq.set(s);
contentHead.pkg_index.set(0);
im_msg_body.MsgBody msgBody = new im_msg_body.MsgBody();
msgBody.msg_content.set(ByteStringMicro.copyFrom(transMsgContext.f28184a));
msg_svc.PbSendMsgReq pbSendMsgReq = new msg_svc.PbSendMsgReq();
pbSendMsgReq.routing_head.set(routingHead);
pbSendMsgReq.content_head.set(contentHead);
pbSendMsgReq.msg_body.set(msgBody);
pbSendMsgReq.msg_seq.set(i4);
pbSendMsgReq.msg_rand.set(i3);
byte[] m7748a = m4654a.m7748a();
if (m7748a != null) {
pbSendMsgReq.sync_cookie.set(ByteStringMicro.copyFrom(m7748a));
return pbSendMsgReq;
}
return pbSendMsgReq;
}
public static TempSessionInfo a(QQAppInterface qQAppInterface, msg_comm.Msg msg2) {
int i;
String str;
TempSessionInfo tempSessionInfo = new TempSessionInfo();
msg_comm.C2CTmpMsgHead c2CTmpMsgHead = (msg_comm.C2CTmpMsgHead) ((msg_comm.MsgHead) msg2.msg_head.get()).c2c_tmp_msg_head.get();
if (!c2CTmpMsgHead.c2c_type.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "It doesn't has a c2cType.");
}
} else if (!c2CTmpMsgHead.service_type.has() && QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "Invalid service type, the pb data has no service type.");
}
tempSessionInfo.f92311c = c2CTmpMsgHead.direction_flag.get();
int i2 = c2CTmpMsgHead.c2c_type.get();
int i3 = c2CTmpMsgHead.service_type.get();
switch (i3) {
case 0:
i = 1000;
break;
case 1:
i = 1004;
break;
case 58:
i = 1024;
if (BmqqSegmentUtil.c(String.valueOf(msg2.msg_head.from_uin.get())) || BmqqSegmentUtil.c(String.valueOf(msg2.msg_head.to_uin.get()))) {
i = 1025;
break;
}
break;
case 124:
i = 1001;
break;
case 129:
case 140:
case 142:
i = 1008;
break;
case 130:
i = 1006;
break;
case 131:
i = 1009;
break;
case 132:
i = 1020;
break;
case 133:
i = 1023;
break;
case 134:
i = 1022;
break;
case 137:
i = 1010;
break;
case 141:
i = AppConstants.VALUE.aa;
break;
case 144:
i = AppConstants.VALUE.ag;
break;
case 201:
i = 1005;
break;
default:
i = -1;
break;
}
tempSessionInfo.f92310b = i;
tempSessionInfo.f28182b = -1L;
tempSessionInfo.f28183c = -1L;
switch (i3) {
case 0:
tempSessionInfo.f28182b = c2CTmpMsgHead.group_code.get();
tempSessionInfo.f28183c = c2CTmpMsgHead.group_uin.get();
break;
case 1:
tempSessionInfo.f28182b = c2CTmpMsgHead.group_code.get();
tempSessionInfo.f28183c = c2CTmpMsgHead.group_code.get();
break;
case 132:
tempSessionInfo.f28182b = c2CTmpMsgHead.group_code.get();
tempSessionInfo.f28183c = c2CTmpMsgHead.group_uin.get();
break;
}
if (QLog.isColorLevel()) {
StringBuilder sb = new StringBuilder("<---getC2CMsgPkgTempInfo: dump info:");
sb.append(" c2cType:").append(i2).append(" serviceType:").append(i3).append("direction_flag:").append(tempSessionInfo.f92311c).append(" info:").append(tempSessionInfo.toString());
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
}
if (tempSessionInfo.f92310b == 1008) {
if (!msg2.msg_head.has()) {
str = "";
} else {
str = String.valueOf(((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get());
}
PublicAccountDataManager publicAccountDataManager = (PublicAccountDataManager) qQAppInterface.getManager(55);
if (publicAccountDataManager != null && !publicAccountDataManager.a(tempSessionInfo.f92310b, str)) {
tempSessionInfo.f92310b = -1;
}
}
return tempSessionInfo;
}
public static void a(MessageHandler messageHandler, MsgInfo msgInfo, SlaveMasterMsg slaveMasterMsg) {
try {
SubMsgType0x4.MsgBody msgBody = (SubMsgType0x4.MsgBody) new SubMsgType0x4.MsgBody().mergeFrom(slaveMasterMsg.vOrigMsg);
if (!msgBody.msg_not_online_file.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : MsgBody has not NotOnlineFile");
return;
}
return;
}
im_msg_body.NotOnlineFile notOnlineFile = (im_msg_body.NotOnlineFile) msgBody.msg_not_online_file.get();
hummer_resv_21.FileImgInfo fileImgInfo = null;
if (msgBody.file_image_info.has()) {
fileImgInfo = (hummer_resv_21.FileImgInfo) msgBody.file_image_info.get();
}
ArrayList arrayList = new ArrayList();
msg_comm.Msg msg2 = new msg_comm.Msg();
msg2.msg_head.msg_uid.set(msgInfo.lMsgUid);
msg2.msg_head.msg_time.set(msgInfo.uRealMsgTime);
msg2.msg_head.from_uin.set(slaveMasterMsg.lFromUin);
msg2.msg_head.msg_seq.set((int) slaveMasterMsg.uSeq);
messageHandler.f87244b.m4643a().a(messageHandler, arrayList, msg2, notOnlineFile, String.valueOf(slaveMasterMsg.lToUin), true, false, -100L, -1, fileImgInfo);
} catch (InvalidProtocolBufferMicroException e) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : subMsgType[0x4] failed", e);
}
}
}
public static void a(MessageHandler messageHandler, List list, msg_comm.Msg msg2, long j, boolean z, boolean z2, boolean z3, long j2, boolean z4, int i) {
int i2;
String str;
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211");
}
if (msg2.msg_body.has() && ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has()) {
try {
byte[] byteArray = ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray();
int i3 = ((msg_comm.MsgHead) msg2.msg_head.get()).c2c_cmd.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : subMsgType[" + i3 + StepFactory.f18879b);
}
switch (i3) {
case 3:
SubMsgType0x3.MsgBody msgBody = new SubMsgType0x3.MsgBody();
try {
msgBody.mergeFrom(byteArray);
if (msgBody.msg_fail_notify.has()) {
int i4 = 0;
SubMsgType0x3.FailNotify failNotify = (SubMsgType0x3.FailNotify) msgBody.msg_fail_notify.get();
if (failNotify.uint32_sessionid.has()) {
int i5 = failNotify.uint32_sessionid.get();
if (failNotify.uint32_retCode.has()) {
i4 = failNotify.uint32_retCode.get();
} else if (QLog.isColorLevel()) {
QLog.w("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : sessionId[" + i5 + "], failNotify has not RetCode");
}
if (failNotify.bytes_reason.has()) {
str = new String(failNotify.bytes_reason.get().toStringUtf8());
} else {
if (QLog.isColorLevel()) {
QLog.w("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : sessionId[" + i5 + "], failNotify has not reason");
}
str = "";
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : FailNotify sessionId[" + i5 + "], retCode[" + i4 + "], reason[" + str + StepFactory.f18879b);
}
messageHandler.f87244b.m4643a().a(String.valueOf(j), i5, i4, str);
return;
} else if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : failNotify has not sessionId");
return;
} else {
return;
}
} else if (msgBody.msg_progress_notify.has()) {
int i6 = 0;
SubMsgType0x3.ProgressNotify progressNotify = (SubMsgType0x3.ProgressNotify) msgBody.msg_progress_notify.get();
if (progressNotify.uint32_sessionid.has()) {
int i7 = progressNotify.uint32_sessionid.get();
if (progressNotify.uint32_progress.has()) {
i6 = progressNotify.uint32_progress.get();
} else if (QLog.isColorLevel()) {
QLog.w("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : sessionId[" + i7 + "], progressNotify has not Progress");
}
if (progressNotify.uint32_average_speed.has()) {
i2 = progressNotify.uint32_average_speed.get();
} else {
if (QLog.isColorLevel()) {
QLog.w("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : sessionId[" + i7 + "], progressNotify has not AverageSpeed");
}
i2 = 0;
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : progressNotify sessionId[" + i7 + "], progress[" + i6 + "], speed[" + i2 + StepFactory.f18879b);
}
messageHandler.f87244b.m4643a().a(String.valueOf(j), i7, i6, i2);
return;
} else if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : progressNotify has not sessionId");
return;
} else {
return;
}
} else if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : progressNotify has neither failNotify not progressNotify");
return;
} else {
return;
}
} catch (InvalidProtocolBufferMicroException e) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : subMsgType[0x3] failed", e);
return;
}
return;
}
case 4:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<FileAssistant>offlineFile come: cmd[0x211, 0x4]");
}
try {
SubMsgType0x4.MsgBody msgBody2 = (SubMsgType0x4.MsgBody) new SubMsgType0x4.MsgBody().mergeFrom(byteArray);
if (!msgBody2.msg_not_online_file.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : MsgBody has not NotOnlineFile");
return;
}
return;
}
im_msg_body.NotOnlineFile notOnlineFile = (im_msg_body.NotOnlineFile) msgBody2.msg_not_online_file.get();
hummer_resv_21.FileImgInfo fileImgInfo = null;
if (msgBody2.file_image_info.has()) {
fileImgInfo = (hummer_resv_21.FileImgInfo) msgBody2.file_image_info.get();
}
if (z4) {
MessageRecord messageRecord = new MessageRecord();
long j3 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
long j4 = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
messageRecord.f88923msg = notOnlineFile.bytes_file_name.get().toStringUtf8();
messageRecord.senderuin = Long.toString(j4);
messageRecord.msgtype = -2005;
messageRecord.frienduin = Long.toString(j);
messageRecord.time = j3;
if (fileImgInfo != null) {
messageRecord.saveExtInfoToExtStr(FMConstants.f23465cC, String.valueOf(fileImgInfo.uint32_file_width.get()));
messageRecord.saveExtInfoToExtStr(FMConstants.f23466cD, String.valueOf(fileImgInfo.uint32_file_height.get()));
}
list.add(messageRecord);
return;
}
messageHandler.f87244b.m4643a().a(messageHandler, list, msg2, notOnlineFile, String.valueOf(j), z, z2, j2, i, fileImgInfo);
return;
} catch (InvalidProtocolBufferMicroException e2) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : subMsgType[0x4] failed", e2);
return;
}
return;
}
case 5:
case 6:
case 10:
case 11:
case 12:
case 14:
case 15:
case 16:
default:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : subMsgType[" + i3 + "] is not implemented");
return;
}
return;
case 7:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<dataline> message come: cmd[0x211, 0x7]");
}
try {
SubMsgType0x7.MsgBody msgBody3 = (SubMsgType0x7.MsgBody) new SubMsgType0x7.MsgBody().mergeFrom(byteArray);
if (!z4) {
((DataLineHandler) messageHandler.f87244b.getBusinessHandler(8)).a(msg2, msgBody3);
return;
}
return;
} catch (InvalidProtocolBufferMicroException e3) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<dataline><---decodeC2CMsgPkg_MsgType0x211 : subMsgType[0x7] failed", e3);
return;
}
return;
}
case 8:
long j5 = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
int i8 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get();
long j6 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_uid.get();
long j7 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
byte[] bArr = null;
if (((msg_comm.MsgHead) msg2.msg_head.get()).c2c_tmp_msg_head.has()) {
bArr = ((msg_comm.C2CTmpMsgHead) ((msg_comm.MsgHead) msg2.msg_head.get()).c2c_tmp_msg_head.get()).toByteArray();
try {
byte[] byteArray2 = ((msg_comm.C2CTmpMsgHead) ((msg_comm.MsgHead) msg2.msg_head.get()).c2c_tmp_msg_head.get()).sig.get().toByteArray();
if (byteArray2 != null) {
FMDataCache.a(String.valueOf(j5), byteArray2);
}
} catch (Exception e4) {
}
}
messageHandler.f87244b.m4660a().a(j5, i8, j6, j7, bArr, byteArray);
return;
case 9:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<dataline printer> message come: cmd[0x211, 0x9]");
}
try {
((DataLineHandler) messageHandler.f87244b.getBusinessHandler(8)).a(msg2, (C2CType0x211_SubC2CType0x9.MsgBody) new C2CType0x211_SubC2CType0x9.MsgBody().mergeFrom(byteArray));
return;
} catch (InvalidProtocolBufferMicroException e5) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<dataline><---decodeC2CMsgPkg_MsgType0x211 : subMsgType[0x9] failed", e5);
return;
}
return;
}
case 13:
case 17:
long j8 = msg2.msg_head.from_uin.get();
long j9 = msg2.msg_head.to_uin.get();
int i9 = msg2.msg_head.msg_seq.get();
long j10 = msg2.msg_head.msg_uid.get();
int i10 = msg2.msg_head.msg_type.get();
long j11 = msg2.msg_head.msg_time.get();
((SmartDeviceProxyMgr) messageHandler.f87244b.getBusinessHandler(51)).a(j8, j9, i9, j10, i10, DeviceMgrConstants.m, byteArray);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "device msg push, receive 0x11,0xd msg, fromuin2:" + j8 + ",touin:" + j9 + ", msg seq:" + i9 + ",msg_uid:" + j10 + ",msg_time:" + j11 + ",msgtype:" + i10);
return;
}
return;
}
} catch (Exception e6) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<FileAssistant><---decodeC2CMsgPkg_MsgType0x211 : failed.", e6);
}
}
}
}
public static void a(MessageHandler messageHandler, long j, msg_comm.Msg msg2, boolean z, boolean z2) {
msg_comm.MsgType0x210 msgType0x210;
int i;
int i2;
if (msg2.msg_body.has() && ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has()) {
try {
msgType0x210 = (msg_comm.MsgType0x210) new msg_comm.MsgType0x210().mergeFrom(((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray());
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_MsgType0x210 : failed.", e);
}
msgType0x210 = null;
}
if (msgType0x210 == null) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_MsgType0x210 : msgType0x210 is null.");
}
} else if (!msgType0x210.sub_msg_type.has() || !msgType0x210.msg_content.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_MsgType0x210 : msgType0x210 require more info: hasType:" + msgType0x210.sub_msg_type.has() + ",hasMsgContent:" + msgType0x210.msg_content.has());
}
} else {
int i3 = msgType0x210.sub_msg_type.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_MsgType0x210 : msgType0x210 type:" + i3);
}
switch (i3) {
case 0:
a(messageHandler, msg2, z);
return;
case 26:
case 64:
default:
return;
case 38:
if (QLog.isColorLevel()) {
QLog.d("Q.troopgetnews..troop.notification_center", 2, "decodeC2CMsgPkg_MsgType0x210, receive troop news push");
}
((TroopHandler) messageHandler.f87244b.getBusinessHandler(20)).a(msgType0x210.msg_content.get().toByteArray());
return;
case 48:
((ShieldListHandler) messageHandler.f87244b.getBusinessHandler(18)).a(msgType0x210.msg_content.get().toByteArray());
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 53:
a(messageHandler, msgType0x210);
return;
case 61:
((SttManager) messageHandler.f87244b.getManager(16)).a(msgType0x210.msg_content.get().toByteArray());
return;
case 63:
((PublicAccountHandler) messageHandler.f87244b.getBusinessHandler(11)).a(i3, msgType0x210.msg_content.get().toByteArray());
return;
case 78:
if (QLog.isColorLevel()) {
QLog.d(TroopNotificationHelper.f32640a, 2, "get notice from decodeC2CMsgPkg_MsgType0x210");
}
a(messageHandler.f87244b, msgType0x210.msg_content.get().toByteArray());
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 81:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_MsgType0x210 : subtype 0x51");
}
messageHandler.a(msgType0x210, msg2);
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 103:
if (QLog.isColorLevel()) {
QLog.d("nearbyTroopPush", 2, "receive offline msgtype0x210.submsgtype0x67 group recmd msg");
}
submsgtype0x67.MsgBody msgBody = new submsgtype0x67.MsgBody();
try {
msgBody.mergeFrom(msgType0x210.msg_content.get().toByteArray());
} catch (Exception e2) {
if (QLog.isColorLevel()) {
QLog.d("nearbyTroopPush", 2, "receive offline msgtype0x210.submsgtype0x67 mergeFrom exception: " + e2.toString());
}
}
if (msgBody.rpt_msg_grpinfo.has()) {
List list = msgBody.rpt_msg_grpinfo.get();
LBSHandler lBSHandler = (LBSHandler) messageHandler.f87244b.getBusinessHandler(3);
if (lBSHandler != null) {
lBSHandler.a(list);
}
}
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 107:
if (QLog.isColorLevel()) {
QLog.d("Push_PCActive_Notice_Decode", 2, "get notice from decodeC2CMsgPkg_MsgType0x210");
}
byte[] byteArray = msgType0x210.msg_content.get().toByteArray();
String str = null;
String str2 = null;
String str3 = null;
try {
SubMsgType0x6b.MsgBody msgBody2 = new SubMsgType0x6b.MsgBody();
msgBody2.mergeFrom(byteArray);
long j2 = msgBody2.uint64_to_uin.get();
if (!SettingCloneUtil.readValue((Context) BaseApplicationImpl.a(), Long.toString(j2), (String) null, AppConstants.dW, false)) {
if (msgBody2.bytes_tips_content.has()) {
str = new String(msgBody2.bytes_tips_content.get().toByteArray(), "utf-8");
}
if (msgBody2.bytes_yes_text.has()) {
str2 = new String(msgBody2.bytes_yes_text.get().toByteArray(), "utf-8");
}
if (msgBody2.bytes_no_text.has()) {
str3 = new String(msgBody2.bytes_no_text.get().toByteArray(), "utf-8");
}
BaseApplicationImpl.a().a(Long.toString(j2), str, str3, str2);
Intent intent = new Intent(NewIntent.ACTION_PCACTIVE_TIPS);
intent.putExtra("uin", Long.toString(j2));
intent.putExtra("Message", str);
intent.putExtra("lButton", str3);
intent.putExtra("rButton", str2);
if (NotifyPCActiveActivity.f10341a == null) {
BaseApplicationImpl.a().startActivity(intent);
}
}
} catch (InvalidProtocolBufferMicroException e3) {
if (QLog.isColorLevel()) {
QLog.d("Push_PCActive_Notice_Decode", 2, "failed to get msg0x210.SubMsgType0x6b");
}
} catch (UnsupportedEncodingException e4) {
if (QLog.isColorLevel()) {
QLog.d("Push_PCActive_Notice_Decode", 2, "failed to parse msg0x210.SubMsgType0x6b");
}
}
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 110:
if (QLog.isColorLevel()) {
QLog.d("TurnBrand", 2, "decode recv msg0x210.Submsgtype0x6e");
}
RecommendTroopManagerImp recommendTroopManagerImp = (RecommendTroopManagerImp) messageHandler.f87244b.getManager(21);
if (recommendTroopManagerImp != null) {
recommendTroopManagerImp.m4748a();
}
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 111:
if (QLog.isColorLevel()) {
QLog.d("msg0x210.SubMsgType0x6f", 2, "decodeTurnBrandTipsPush recv msg0x210.Submsgtype0x6f");
}
if (msgType0x210.msg_content == null) {
if (QLog.isColorLevel()) {
QLog.d("msg0x210.SubMsgType0x6f", 2, "decodeTurnBrandTipsPush msg_content is null");
return;
}
return;
}
byte[] byteArray2 = msgType0x210.msg_content.get().toByteArray();
if (byteArray2 == null) {
if (QLog.isColorLevel()) {
QLog.d("msg0x210.SubMsgType0x6f", 2, "decodeTurnBrandTipsPush msg_content.toByteArray is null");
return;
}
return;
}
try {
SubMsgType0x6f.MsgBody msgBody3 = new SubMsgType0x6f.MsgBody();
msgBody3.mergeFrom(byteArray2);
SubMsgType0x6f.ForwardBody forwardBody = (SubMsgType0x6f.ForwardBody) msgBody3.rpt_msg_mod_infos.get().get(0);
int i4 = -1;
if (forwardBody.uint32_op_type.has()) {
i4 = forwardBody.uint32_op_type.get();
}
if (i4 == 2001 && forwardBody.msg_mcard_notification_like.has()) {
SubMsgType0x6f.MCardNotificationLike mCardNotificationLike = (SubMsgType0x6f.MCardNotificationLike) forwardBody.msg_mcard_notification_like.get();
String str4 = "";
long j3 = 0;
int i5 = 0;
if (mCardNotificationLike.str_wording.has()) {
str4 = mCardNotificationLike.str_wording.get();
}
if (mCardNotificationLike.uint32_counter_new.has()) {
i5 = mCardNotificationLike.uint32_counter_new.get();
}
if (mCardNotificationLike.uint64_from_uin.has()) {
j3 = mCardNotificationLike.uint64_from_uin.get();
}
if (!mCardNotificationLike.uint32_counter_total.has()) {
i2 = 0;
} else {
i2 = mCardNotificationLike.uint32_counter_total.get();
}
if (QLog.isColorLevel()) {
QLog.d("msg0x210.SubMsgType0x6f", 2, "card_notification_like : wording: " + str4 + " totalCount: " + i2 + " newCount: " + i5 + " fromUin: " + j3);
}
} else if (i4 == 2002 && forwardBody.vip_info_notify.has()) {
SubMsgType0x6f.VipInfoNotify vipInfoNotify = (SubMsgType0x6f.VipInfoNotify) forwardBody.vip_info_notify.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "vip info notify: " + vipInfoNotify.toString());
}
long j4 = 0;
int i6 = 0;
if (vipInfoNotify.uint64_uin.has()) {
j4 = vipInfoNotify.uint64_uin.get();
}
String l = Long.toString(j4);
if (vipInfoNotify.uint32_vip_identify.has()) {
i6 = vipInfoNotify.uint32_vip_identify.get();
}
if (!vipInfoNotify.uint32_vip_level.has()) {
i = 0;
} else {
i = vipInfoNotify.uint32_vip_level.get();
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "UIN " + l + " vip info changed.");
}
if (i6 != 0 || i != 0) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "need pull vip info from svr. vipIdentiy=" + i6 + "; vipLevel=" + i);
}
((VipInfoHandler) messageHandler.f87244b.getBusinessHandler(27)).a(((TicketManager) messageHandler.f87244b.getManager(2)).getSkey(l), l);
}
} else if (i4 == 2003 && forwardBody.msg_push_lost_dev_found.has()) {
if (QLog.isColorLevel()) {
QLog.d("QFindBLE", 2, "offlinePush receive ...");
}
SubMsgType0x6f.PushLostDevFound pushLostDevFound = (SubMsgType0x6f.PushLostDevFound) forwardBody.msg_push_lost_dev_found.get();
Bundle bundle = new Bundle();
if (pushLostDevFound.uint32_msg_type.has()) {
bundle.putInt("msgtype", pushLostDevFound.uint32_msg_type.get());
}
if (pushLostDevFound.uint32_dev_time.has()) {
bundle.putInt("devtime", pushLostDevFound.uint32_dev_time.get());
}
if (pushLostDevFound.uint64_din.has()) {
bundle.putLong("din", pushLostDevFound.uint64_din.get());
}
((SmartDeviceProxyMgr) messageHandler.f87244b.getBusinessHandler(51)).a(111, bundle);
}
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
} catch (Exception e5) {
if (QLog.isColorLevel()) {
QLog.d("TurnBrand", 2, "failed to get msg0x210.SubMsgType0x6f", e5);
return;
}
return;
}
case 114:
((QPayHandler) messageHandler.f87244b.getBusinessHandler(47)).a(true);
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 118:
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 122:
msg2.msg_head.from_uin.get();
int i7 = msg2.msg_head.msg_seq.get();
msg2.msg_head.msg_uid.get();
int i8 = msg2.msg_head.msg_type.get();
if (QLog.isDevelopLevel()) {
QLog.d("Q.msg.MessageHandler", 4, "decodeC2CMsgPkg_MsgType0x210 receive 0x7a push message, seq = " + i7 + ", submsgtype:" + i8);
}
submsgtype0x7a.MsgBody msgBody4 = new submsgtype0x7a.MsgBody();
try {
msgBody4.mergeFrom(msgType0x210.msg_content.get().toByteArray());
((ArrangeHandler) messageHandler.f87244b.getBusinessHandler(61)).a(msgBody4);
return;
} catch (InvalidProtocolBufferMicroException e6) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "parse 0x7a push msg error", e6);
return;
}
return;
}
case 124:
msg2.msg_head.from_uin.get();
int i9 = msg2.msg_head.msg_seq.get();
msg2.msg_head.msg_uid.get();
int i10 = msg2.msg_head.msg_type.get();
if (QLog.isDevelopLevel()) {
QLog.d("Q.msg.MessageHandler", 4, "decodeC2CMsgPkg_MsgType0x210 receive 0x7c push message, seq = " + i9 + ", submsgtype:" + i10);
}
submsgtype0x7c.MsgBody msgBody5 = new submsgtype0x7c.MsgBody();
try {
msgBody5.mergeFrom(msgType0x210.msg_content.get().toByteArray());
if (messageHandler.f87244b.getCurrentAccountUin().equals(String.valueOf(msgBody5.uint64_uin.get()))) {
((SecSpyFileManager) messageHandler.f87244b.getManager(93)).a(msgBody5, 1);
return;
}
return;
} catch (InvalidProtocolBufferMicroException e7) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "parse 0x7c push msg error", e7);
return;
}
return;
}
case 138:
case 139:
if (!z2) {
Submsgtype0x8a.ReqBody reqBody = new Submsgtype0x8a.ReqBody();
try {
reqBody.mergeFrom(msgType0x210.msg_content.get().toByteArray());
a(messageHandler.f87244b, reqBody, 0L, false);
return;
} catch (Exception e8) {
if (QLog.isColorLevel()) {
QLog.d("revokeMsg", 2, "recv 0x210_0x8a_8b offline msg, prase reqBody error");
return;
}
return;
}
}
return;
case 141:
((ReadInJoyHandler) messageHandler.f87244b.getBusinessHandler(62)).a(msgType0x210.msg_content.get().toByteArray());
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 143:
submsgtype0x8f.MsgBody msgBody6 = new submsgtype0x8f.MsgBody();
try {
msgBody6.mergeFrom(msgType0x210.msg_content.get().toByteArray());
DingdongPluginBizHandler dingdongPluginBizHandler = (DingdongPluginBizHandler) messageHandler.f87244b.getBusinessHandler(75);
if (dingdongPluginBizHandler != null) {
dingdongPluginBizHandler.a(msgBody6);
return;
}
return;
} catch (Exception e9) {
QLog.e("Dingdong", 2, "handleMsgType0x210SubMsgType0x8f : fail to parse 0x211_0x8f.");
return;
}
case 155:
SubMsgType0x9b.MsgBody msgBody7 = new SubMsgType0x9b.MsgBody();
try {
msgBody7.mergeFrom(msgType0x210.msg_content.get().toByteArray());
DingdongPluginBizHandler dingdongPluginBizHandler2 = (DingdongPluginBizHandler) messageHandler.f87244b.getBusinessHandler(75);
DingdongPluginManager dingdongPluginManager = (DingdongPluginManager) messageHandler.f87244b.getManager(114);
if (dingdongPluginBizHandler2 != null) {
dingdongPluginBizHandler2.a(msgBody7, true);
}
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
} catch (InvalidProtocolBufferMicroException e10) {
e10.printStackTrace();
return;
}
case TbsListener.ErrorCode.NEEDDOWNLOAD_TRUE:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "handleMsgType0x210SubMsgType0xaa receive 0xaa push message");
}
try {
new SubMsgType0xaa.MsgBody().mergeFrom(msgType0x210.msg_content.get().toByteArray());
} catch (Exception e11) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "handleMsgType0x210SubMsgType0xaa, prase msgBody error");
}
}
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case 174:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "handleMsgType0x210SubMsgType0xae receive 0xae push message");
}
SubMsgType0xae.MsgBody msgBody8 = new SubMsgType0xae.MsgBody();
try {
msgBody8.mergeFrom(msgType0x210.msg_content.get().toByteArray());
((MayknowRecommendManager) messageHandler.f87244b.getManager(158)).a(msgBody8);
} catch (Exception e12) {
if (QLog.isColorLevel()) {
QLog.d(MayknowRecommendManager.f18019a, 2, "recv 0x210_0xae, prase msgBody error");
}
}
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case QQAppInterface.bT:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "processMsg0x210Sub0xb1");
}
a(messageHandler.f87244b, msgType0x210.msg_content.get().toByteArray(), false);
a(messageHandler, msg2.msg_head.from_uin.get(), msg2.msg_head.msg_seq.get(), msg2.msg_head.msg_uid.get(), msg2.msg_head.msg_type.get());
return;
case QQAppInterface.bV:
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "handleMsgType0x210SubMsgType0xb3 receive 0xaa push message");
}
String a2 = ((OnLinePushMessageProcessor) messageHandler.a(ProcessorDispatcherInterface.j)).a(msgType0x210.msg_content.get().toByteArray());
if (!TextUtils.isEmpty(a2)) {
boolean m4354b = ((FriendsManager) messageHandler.f87244b.getManager(50)).m4354b(a2);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "handleMsgType0x210SubMsgType0xb3 isFriend=" + m4354b + ", uin=" + a2);
}
if (!m4354b) {
QLog.d("Q.msg.MessageHandler", 1, "handleMsgType0x210SubMsgType0xb3 not friend, getDetail");
((FriendListHandler) messageHandler.f87244b.getBusinessHandler(1)).m4304a(a2);
return;
}
return;
}
return;
}
}
}
}
public static void a(QQAppInterface qQAppInterface, Submsgtype0x8a.ReqBody reqBody, long j, boolean z) {
SubAccountMessage subAccountMessage;
int i = 0;
long j2 = 0;
ArrayList arrayList = (ArrayList) reqBody.msg_info.get();
msgrevoke_userdef.UinTypeUserDef uinTypeUserDef = new msgrevoke_userdef.UinTypeUserDef();
try {
uinTypeUserDef.mergeFrom(reqBody.bytes_reserved.get().toByteArray());
int i2 = uinTypeUserDef.uint32_from_uin_type.get();
if (i2 == 1) {
i = 1000;
j2 = uinTypeUserDef.uint64_from_group_code.get();
} else if (i2 == 2) {
i = 1004;
j2 = uinTypeUserDef.uint64_from_group_code.get();
}
ArrayList arrayList2 = new ArrayList();
Iterator it = arrayList.iterator();
while (it.hasNext()) {
Submsgtype0x8a.MsgInfo msgInfo = (Submsgtype0x8a.MsgInfo) it.next();
RevokeMsgInfo revokeMsgInfo = new RevokeMsgInfo();
revokeMsgInfo.d = i;
revokeMsgInfo.f27050b = String.valueOf(msgInfo.uint64_from_uin.get());
revokeMsgInfo.f27048a = String.valueOf(msgInfo.uint64_to_uin.get());
revokeMsgInfo.f27052c = String.valueOf(j2);
revokeMsgInfo.f27047a = (short) msgInfo.uint32_msg_seq.get();
revokeMsgInfo.f27049b = msgInfo.uint64_msg_uid.get();
revokeMsgInfo.f27051c = msgInfo.uint64_msg_time.get();
revokeMsgInfo.e = msgInfo.uint32_div_seq.get();
revokeMsgInfo.f = msgInfo.uint32_pkg_num.get();
revokeMsgInfo.g = msgInfo.uint32_pkg_index.get();
arrayList2.add(revokeMsgInfo);
if (QLog.isColorLevel()) {
QLog.d("revokeMsg", 2, "recv 0x210_0x8a_8b msg," + revokeMsgInfo.toString());
}
}
if (!z) {
qQAppInterface.m4635a().a(arrayList2, false);
return;
}
if (QLog.isColorLevel()) {
QLog.d("revokeMsg", 2, "recv 0x210_0x8a_8b subaccount msg");
}
if (!arrayList2.isEmpty()) {
String l = Long.toString(j);
String currentAccountUin = qQAppInterface.getCurrentAccountUin();
SubAccountManager subAccountManager = (SubAccountManager) qQAppInterface.getManager(60);
if (subAccountManager != null) {
List m8198a = subAccountManager.m8198a(l);
RevokeMsgInfo revokeMsgInfo2 = null;
SubAccountMessage subAccountMessage2 = null;
Iterator it2 = arrayList2.iterator();
while (it2.hasNext()) {
RevokeMsgInfo revokeMsgInfo3 = (RevokeMsgInfo) it2.next();
Iterator it3 = m8198a.iterator();
while (true) {
if (!it3.hasNext()) {
subAccountMessage = subAccountMessage2;
revokeMsgInfo3 = revokeMsgInfo2;
break;
}
subAccountMessage = (SubAccountMessage) it3.next();
if (revokeMsgInfo3.f27047a != subAccountMessage.shmsgseq || revokeMsgInfo3.f27049b != subAccountMessage.msgUid) {
}
}
subAccountMessage2 = subAccountMessage;
revokeMsgInfo2 = revokeMsgInfo3;
}
if (revokeMsgInfo2 != null) {
SubAccountMessage subAccountMessage3 = (SubAccountMessage) subAccountMessage2.deepCopyByReflect();
subAccountMessage3.f88927msg = "对方".concat(BaseApplicationImpl.a().getString(R.string.f66203name_res_0x7f0a1e7f));
subAccountMessage3.unreadNum = Math.max(0, subAccountMessage2.unreadNum - 1);
subAccountMessage3.time = revokeMsgInfo2.f27051c;
subAccountMessage3.needNotify = qQAppInterface.isBackground_Pause;
subAccountMessage3.mTimeString = TimeFormatterUtils.a(subAccountMessage3.time * 1000, true, SubAccountControll.f29665c);
subAccountMessage3.mEmoRecentMsg = new QQText(subAccountMessage3.f88927msg, 0);
if (subAccountManager != null) {
subAccountManager.a(subAccountMessage3);
}
SubAccountControll.a(qQAppInterface, l, 6);
MessageRecord convertToMessageRecord = subAccountMessage3.convertToMessageRecord();
convertToMessageRecord.istroop = 7000;
convertToMessageRecord.frienduin = l;
qQAppInterface.m4632a().c(convertToMessageRecord.frienduin, convertToMessageRecord.istroop, -1);
ArrayList arrayList3 = new ArrayList();
arrayList3.add(convertToMessageRecord);
qQAppInterface.m4635a().a(arrayList3, currentAccountUin, false, false, true);
qQAppInterface.C();
SubAccountBackProtocData subAccountBackProtocData = new SubAccountBackProtocData();
subAccountBackProtocData.f29690b = currentAccountUin;
subAccountBackProtocData.f29693c = l;
subAccountBackProtocData.f29695c = true;
subAccountBackProtocData.f29696d = true;
subAccountBackProtocData.p = 0;
qQAppInterface.m4626a().m4430a().a(8003, true, (Object) subAccountBackProtocData);
}
}
}
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.d("revokeMsg", 2, "recv 0x210_0x8a_8b msg, prase uintypeUserdef error");
}
}
}
public static void a(MessageHandler messageHandler, long j, int i, long j2, int i2) {
ToServiceMsg toServiceMsg = new ToServiceMsg("mobileqq.service", messageHandler.f87244b.getCurrentAccountUin(), MessageConstants.af);
msg_svc.PbDeleteMsgReq pbDeleteMsgReq = new msg_svc.PbDeleteMsgReq();
msg_svc.PbDeleteMsgReq.MsgItem msgItem = new msg_svc.PbDeleteMsgReq.MsgItem();
msgItem.from_uin.set(j);
msgItem.msg_seq.set(i);
msgItem.msg_uid.set(j2);
long j3 = 0;
try {
j3 = Long.parseLong(messageHandler.f87244b.getCurrentAccountUin());
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, e.getMessage());
}
}
msgItem.to_uin.set(j3);
msgItem.msg_type.set(i2);
pbDeleteMsgReq.msgItems.add(msgItem);
toServiceMsg.putWupBuffer(pbDeleteMsgReq.toByteArray());
toServiceMsg.extraData.putBoolean(AppConstants.f17366X, true);
messageHandler.f87244b.sendToService(toServiceMsg);
}
public static void a(MessageHandler messageHandler, msg_comm.Msg msg2, boolean z) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_Dataline");
}
if (z) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_Dataline: return isReaded4DataLine:" + z);
return;
}
return;
}
Looper mainLooper = Looper.getMainLooper();
if (Thread.currentThread() != mainLooper.getThread()) {
new Handler(mainLooper).post(new ttm(messageHandler, msg2));
} else {
((DataLineHandler) messageHandler.f87244b.getBusinessHandler(8)).a(msg2);
}
}
public static void a(MessageHandler messageHandler, msg_comm.MsgType0x210 msgType0x210) {
try {
int i = ((Submsgtype0x35.MsgBody) new Submsgtype0x35.MsgBody().mergeFrom(msgType0x210.msg_content.get().toByteArray())).uint32_bubble_timestamp.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "decodeC2CMsgPkg_MsgType0x210 bubble push timestamp=" + i);
}
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_MsgType0x210 : fail to parse SubMsgType0x35.");
}
}
}
public static void a(QQAppInterface qQAppInterface, byte[] bArr, boolean z) {
submsgtype0xb1.MsgBody msgBody = new submsgtype0xb1.MsgBody();
try {
msgBody.mergeFrom(bArr);
long j = 2000;
if (!z) {
j = 10000;
}
ThreadManager.m4817c().postDelayed(new ttn(qQAppInterface, msgBody, z), j);
if (msgBody.deal_info.has()) {
long j2 = msgBody.deal_info.uint64_group_code.get();
long j3 = msgBody.deal_info.uint64_uin.get();
String str = msgBody.deal_info.str_id.get();
int i = msgBody.deal_info.uint32_deal_result.get();
if (qQAppInterface.getCurrentAccountUin().equals(j3 + "")) {
Intent intent = new Intent(VideoConstants.f788ar);
intent.putExtra("groupId", j2);
intent.putExtra("inviteId", str);
qQAppInterface.getApp().sendBroadcast(intent);
}
if (i == 0) {
qQAppInterface.m4627a().a(j2, j3, str);
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.troopgroup_vedio.invite", 2, "recv 0x210_0xb1, msgBody.deal_info.has()==》troopUin:" + j2 + ", memUin:" + j3 + ", invitedId:" + str + ", dealResult:" + i);
}
}
if (msgBody.univite_info.has()) {
long j4 = msgBody.univite_info.uint64_group_code.get();
long j5 = msgBody.univite_info.uint64_uin.get();
String str2 = msgBody.univite_info.str_id.get();
qQAppInterface.m4627a().b(j4, j5, str2);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.troopgroup_vedio.invite", 2, "recv 0x210_0xb1, msgBody.univite_info.has()==》troopUin:" + j4 + ", memUin:" + j5 + ", invitedId:" + str2 + ", dealResult:" + str2);
}
if (!z) {
f28174a.put(str2, Long.valueOf(System.currentTimeMillis() / 1000));
}
}
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "recv 0x210_0xb1, prase msgBody error");
}
}
}
public static void b(QQAppInterface qQAppInterface, submsgtype0xb1.InviteInfo inviteInfo, boolean z) {
Intent intent;
if (inviteInfo.has()) {
submsgtype0xb1.InviteInfo inviteInfo2 = (submsgtype0xb1.InviteInfo) inviteInfo.get();
long currentTimeMillis = System.currentTimeMillis() / 1000;
if (currentTimeMillis - inviteInfo2.uint32_expire_time.get() > 900) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.troopgroup_vedio.invite", 2, "邀请过期了=》troopUin:" + inviteInfo2.uint64_group_code.get() + "|uint32_expire_time:" + inviteInfo2.uint32_expire_time.get() + ", currentTime:" + currentTimeMillis);
return;
}
return;
}
if (!z && f28174a.containsKey(inviteInfo2.str_id.get())) {
long longValue = ((Long) f28174a.get(inviteInfo2.str_id.get())).longValue();
if (currentTimeMillis - longValue < 10) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.troopgroup_vedio.invite", 2, "离线-上线的时候收到邀请的前10s内先收到了取消的邀请=》troopUin:" + inviteInfo2.uint64_group_code.get() + "|receiveUnInviteTime:" + longValue + ", currentTime:" + currentTimeMillis);
return;
}
return;
}
}
boolean c2 = qQAppInterface.m4621a().c(inviteInfo2.uint64_group_code.get());
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.troopgroup_vedio.invite", 2, "msgBody.invite_info.has()==》troopUin:" + inviteInfo2.uint64_group_code.get() + "|uint32_expire_time:" + inviteInfo2.uint32_expire_time.get() + ", currentTime:" + currentTimeMillis + ", hasGroupVideo:" + c2);
}
TroopManager troopManager = (TroopManager) qQAppInterface.getManager(51);
if (c2 && !troopManager.m4878c(inviteInfo2.uint64_group_code.get() + "", inviteInfo2.uint64_uin.get() + "")) {
boolean z2 = qQAppInterface.m4621a().m428b() > 0;
if (troopManager.m4857b() == 2) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.troopgroup_vedio.invite", 2, "只允许同时存在两个邀请框");
return;
}
return;
}
if (troopManager.m4857b() > 0) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.troopgroup_vedio.invite", 2, "hasGroupInviting");
}
intent = new Intent(qQAppInterface.getApp().getApplicationContext(), MultiIncomingCallsActivity.class);
intent.putExtra("uinType", 1);
intent.putExtra("peerUin", String.valueOf(inviteInfo2.uint64_uin.get()));
} else {
intent = new Intent(qQAppInterface.getApp().getApplicationContext(), GaInviteDialogActivity.class);
}
troopManager.m4876c(String.valueOf(inviteInfo2.uint64_group_code.get()), String.valueOf(inviteInfo2.uint64_uin.get()));
if (((KeyguardManager) qQAppInterface.getApp().getApplicationContext().getSystemService("keyguard")).inKeyguardRestrictedInputMode()) {
Intent intent2 = new Intent();
intent2.setAction(VideoConstants.f829o);
intent2.putExtra("revVideoRequest", true);
intent2.setPackage(qQAppInterface.getApp().getPackageName());
qQAppInterface.getApp().sendBroadcast(intent2);
}
intent.addFlags(e_attribute._IsFrdCommentFamousFeed);
intent.putExtra(ChatActivityUtils.g, 1);
intent.putExtra("discussId", inviteInfo2.uint64_group_code.get());
intent.putExtra("friendUin", inviteInfo2.uint64_uin.get());
intent.putExtra("inviteId", inviteInfo2.str_id.get());
intent.putExtra("hasGVideoJoined", z2);
intent.putExtra("memberType", TroopMemberUtil.a((AppInterface) qQAppInterface, qQAppInterface.getCurrentAccountUin(), inviteInfo2.uint64_group_code.get() + ""));
qQAppInterface.getApp().startActivity(intent);
}
}
}
public static void a(QQAppInterface qQAppInterface, byte[] bArr) {
try {
Submsgtype0x4e.MsgBody msgBody = (Submsgtype0x4e.MsgBody) new Submsgtype0x4e.MsgBody().mergeFrom(bArr);
int i = msgBody.uint32_appid.get();
long j = msgBody.uint64_group_id.get();
long j2 = msgBody.uint64_group_code.get();
if (msgBody.msg_group_bulletin.has()) {
long a2 = (int) MessageCache.a();
List<Submsgtype0x4e.GroupBulletin.Content> list = msgBody.msg_group_bulletin.rpt_msg_content.get();
new ArrayList();
EntityManager createEntityManager = qQAppInterface.getEntityManagerFactory().createEntityManager();
for (Submsgtype0x4e.GroupBulletin.Content content : list) {
long j3 = content.uint64_uin.get();
String stringUtf8 = content.bytes_feedid.get().toStringUtf8();
int i2 = content.uint32_time.get();
if (TroopNotificationHelper.m8834b(stringUtf8)) {
if (QLog.isColorLevel()) {
QLog.d(TroopNotificationHelper.f32640a, 2, "notice is loading");
}
} else if (((TroopNotificationCache) createEntityManager.a(TroopNotificationCache.class, "troopUin=? and feedsId=?", new String[]{String.valueOf(j2), stringUtf8})) != null) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "notice has exist!");
}
} else {
TroopNotificationHelper.a(qQAppInterface, i, j, j2, j3, stringUtf8, i2, TroopConstants.D, (short) 23, false, false);
}
}
createEntityManager.m7241a();
}
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_MsgType0x210 : fail to parse SubMsgType0x4e.");
}
}
}
public static long m7803a(msg_comm.Msg msg2) {
byte[] byteArray;
long j = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
if (msg2.msg_body.has() && ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
im_msg_body.Ptt ptt = (im_msg_body.Ptt) ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).ptt.get();
if (ptt.bytes_reserve.has() && (byteArray = ptt.bytes_reserve.get().toByteArray()) != null && byteArray.length > 1) {
byte b2 = byteArray[0];
int i = 1;
while (i < byteArray.length - 1) {
byte b3 = byteArray[i];
int i2 = i + 1;
int m9507a = PkgTools.m9507a(byteArray, i2);
int i3 = i2 + 2;
if (b3 == 3) {
byte[] bArr = new byte[m9507a];
PkgTools.a(bArr, 0, byteArray, i3, m9507a);
long m9501a = PkgTools.m9501a(bArr, 0);
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "--->decodeC2CMsgPkg_msgTime PTT_ROAM : TimeStamp in d0 :" + j);
}
if (m9501a > 0) {
j = m9501a;
}
}
i = i3 + m9507a;
}
}
}
return j;
}
public static void a(MessageHandler messageHandler, List list, msg_comm.Msg msg2) {
String str;
String substring;
ByteStringMicro byteStringMicro;
byte[] byteArray;
long j = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
if (msg2.msg_body.has() && ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
im_msg_body.RichText richText = (im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get();
im_msg_body.Ptt ptt = (im_msg_body.Ptt) richText.ptt.get();
if (!richText.ptt.has() || !ptt.uint32_file_type.has() || ((ptt.uint32_file_type.get() != 4 && ptt.uint32_file_type.get() != 6) || !ptt.bytes_file_uuid.has())) {
if (QLog.isColorLevel()) {
StringBuilder sb = new StringBuilder("<---decodeC2CMsgPkg_PTT return null:");
if (ptt == null) {
sb.append(" ptt is null.");
} else {
sb.append(" HasileType:").append(ptt.uint32_file_type.has()).append(" fileType:").append(ptt.uint32_file_type.get()).append(" hasUUID:").append(ptt.bytes_file_uuid.has());
}
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
return;
}
return;
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "PTT_ROAM : decodeC2CMsgPkg_PTT. fileType : " + ptt.uint32_file_type.get());
}
int i = SttManager.a(messageHandler.f87244b) ? 1 : 0;
long j2 = -1;
int i2 = 0;
int i3 = 0;
int i4 = 0;
if (ptt.bytes_reserve.has() && (byteArray = ptt.bytes_reserve.get().toByteArray()) != null && byteArray.length > 1) {
byte b2 = byteArray[0];
int i5 = 1;
while (i5 < byteArray.length - 1) {
byte b3 = byteArray[i5];
int i6 = i5 + 1;
int m9507a = PkgTools.m9507a(byteArray, i6);
int i7 = i6 + 2;
if (b3 == 3) {
byte[] bArr = new byte[m9507a];
PkgTools.a(bArr, 0, byteArray, i7, m9507a);
long m9501a = PkgTools.m9501a(bArr, 0);
if (m9501a > 0) {
j2 = m9501a;
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "PTT_ROAM : TimeStamp in d0 :" + j2);
}
} else if (b3 == 9) {
byte[] bArr2 = new byte[m9507a];
PkgTools.a(bArr2, 0, byteArray, i7, m9507a);
i3 = RecordParams.b(Utils.a(PkgTools.m9501a(bArr2, 0)));
} else if (b3 == 8) {
byte[] bArr3 = new byte[m9507a];
PkgTools.a(bArr3, 0, byteArray, i7, m9507a);
i2 = (int) PkgTools.m9501a(bArr3, 0);
} else if (b3 == 10) {
byte[] bArr4 = new byte[m9507a];
PkgTools.a(bArr4, 0, byteArray, i7, m9507a);
ptt_reserve.ReserveStruct reserveStruct = new ptt_reserve.ReserveStruct();
try {
reserveStruct.mergeFrom(bArr4);
i4 = reserveStruct.uint32_change_voice.get();
} catch (Exception e) {
}
}
i5 = i7 + m9507a;
}
}
int i8 = i4;
int i9 = i3;
int i10 = i2;
long j3 = j2;
if (!ptt.bytes_down_para.has() || (byteStringMicro = ptt.bytes_down_para.get()) == null) {
str = "";
} else {
str = byteStringMicro.toStringUtf8();
}
ReportController.b(messageHandler.f87244b, "dc01331", "", "", "0X80060E4", "0X80060E4", TextUtils.isEmpty(str) ? 1 : 2, 0, "", "", "", AppSetting.g);
String stringUtf8 = ptt.bytes_file_uuid.get().toStringUtf8();
String stringUtf82 = ptt.bytes_file_name.get().toStringUtf8();
if (!stringUtf82.contains("_")) {
substring = stringUtf82.substring(0, stringUtf82.length() - 4);
} else {
substring = stringUtf82.substring(stringUtf82.lastIndexOf("_") + 1, stringUtf82.length() - 4);
}
String str2 = j + "_" + substring;
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_PTT isPttSuffix offfile key:" + str2 + " fileUuid:" + stringUtf8);
}
RichMsg.PttRec pttRec = new RichMsg.PttRec();
pttRec.localPath.set(stringUtf8);
pttRec.size.set(ptt.uint32_file_size.get());
pttRec.type.set(2);
pttRec.uuid.set(stringUtf8);
pttRec.isRead.set(false);
pttRec.serverStorageSource.set("pttcenter");
pttRec.isReport.set(0);
pttRec.version.set(5);
pttRec.pttFlag.set(i);
long j4 = msg2.msg_head.msg_time.get();
pttRec.msgRecTime.set(System.currentTimeMillis() / 1000);
pttRec.msgTime.set(j4);
pttRec.voiceType.set(i10);
pttRec.voiceLength.set(i9);
pttRec.voiceChangeFlag.set(i8);
if (QLog.isColorLevel()) {
QLog.d(RecordParams.f33878a, 2, "<---decodeC2CMsgPkg_PTT voiceType:" + i10 + " voiceLengh:" + i9);
}
pttRec.longPttVipFlag.set(MessageUtils.a(messageHandler.f87244b, String.valueOf(j)));
pttRec.directUrl.set(str);
MessageRecord a2 = MessageRecordFactory.a((int) MessageRecord.MSG_TYPE_MEDIA_PTT);
a2.msgtype = MessageRecord.MSG_TYPE_MEDIA_PTT;
a2.msgData = pttRec.toByteArray();
a2.time = j3;
((MessageForPtt) a2).parse();
list.add(a2);
}
}
public static void a(MessageHandler messageHandler, msg_comm.Msg msg2, List list) {
MessageRecord messageRecord;
String str;
String str2;
int i;
im_msg_body.Ptt ptt = (im_msg_body.Ptt) ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).ptt.get();
String stringUtf8 = ptt.bytes_file_name.get().toStringUtf8();
if (!stringUtf8.endsWith(".amr")) {
messageRecord = null;
} else {
int i2 = SttManager.a(messageHandler.f87244b) ? 1 : 0;
int b2 = b(msg2);
int i3 = ptt.uint32_file_type.get();
boolean z = ptt.bool_valid.get();
long j = ptt.uint64_src_uin.get();
long j2 = ptt.uint32_file_size.get() & 4294967295L;
long j3 = ptt.uint32_file_id.get() & 4294967295L;
long j4 = ptt.uint32_server_ip.get() & 4294967295L;
long j5 = ptt.uint32_server_port.get() & 4294967295L;
byte[] byteArray = ptt.bytes_file_uuid.get().toByteArray();
byte[] byteArray2 = ptt.bytes_file_md5.get().toByteArray();
int i4 = ptt.uint32_format.has() ? ptt.uint32_format.get() : 0;
long b3 = RecordParams.b(ptt.uint32_time.has() ? ptt.uint32_time.get() : 0);
if (ptt.bytes_down_para.has()) {
if (QLog.isColorLevel()) {
QLog.d(RecordParams.f33882b, 2, "receive ptt msg , bytes_down_para has ! " + ptt.bytes_down_para.get());
}
ByteStringMicro byteStringMicro = ptt.bytes_down_para.get();
if (byteStringMicro != null) {
str = byteStringMicro.toStringUtf8();
if (QLog.isColorLevel()) {
QLog.d(RecordParams.f33882b, 2, "receive ptt msg , url : " + str + " srcuin " + j + "filename" + stringUtf8);
}
if (QLog.isColorLevel()) {
QLog.d(RecordParams.f33878a, 2, "<---decodeGrpDisMsgPkg_PTT voiceType:" + i4 + " voiceLengh:" + b3);
}
String a2 = HexUtil.a(byteArray);
String a3 = HexUtil.a(byteArray2);
if (ptt.bytes_group_file_key.has()) {
str2 = null;
} else {
try {
str2 = new String(ptt.bytes_group_file_key.get().toByteArray(), "utf-8");
} catch (UnsupportedEncodingException e) {
str2 = null;
}
}
String str3 = a3 != null ? "" : a3;
if (QLog.isColorLevel()) {
StringBuilder sb = new StringBuilder("<---decodeSinglePbMsg_GroupDis:");
sb.append(" pttType:").append(i3).append(" isValid:").append(z).append(" srcUin:").append(j).append(" fileSize:").append(j2).append(" fileID").append(j3).append(" serverIP:").append(j4).append(" serverPort:").append(j5).append(" fileName:").append(stringUtf8).append(" uuidStr:").append(a2).append(" md5Str:").append(str3).append(" GrpFileKey:").append(str2);
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
}
if (ptt.bytes_pb_reserve.has()) {
i = 0;
} else {
ptt_reserve.ReserveStruct reserveStruct = new ptt_reserve.ReserveStruct();
try {
reserveStruct.mergeFrom(ptt.bytes_pb_reserve.get().toByteArray());
i = reserveStruct.uint32_change_voice.get();
} catch (Exception e2) {
i = 0;
}
}
TransfileUtile.a(stringUtf8, 0L, 2, false, stringUtf8);
RichMsg.PttRec pttRec = new RichMsg.PttRec();
pttRec.localPath.set(stringUtf8);
pttRec.size.set(0L);
pttRec.type.set(2);
pttRec.uuid.set(stringUtf8);
pttRec.isRead.set(false);
pttRec.md5.set(str3);
pttRec.isReport.set(0);
pttRec.version.set(5);
pttRec.groupFileID.set(j3);
pttRec.pttFlag.set(i2);
pttRec.longPttVipFlag.set(b2);
if (str2 != null) {
pttRec.group_file_key.set(str2);
}
long j6 = msg2.msg_head.msg_time.get();
pttRec.msgRecTime.set(System.currentTimeMillis() / 1000);
pttRec.msgTime.set(j6);
pttRec.voiceType.set(i4);
pttRec.voiceLength.set(Utils.a(b3));
pttRec.voiceChangeFlag.set(i);
pttRec.directUrl.set(str);
MessageRecord a4 = MessageRecordFactory.a((int) MessageRecord.MSG_TYPE_MEDIA_PTT);
a4.msgtype = MessageRecord.MSG_TYPE_MEDIA_PTT;
a4.msgData = pttRec.toByteArray();
((MessageForPtt) a4).parse();
list.add(a4);
messageRecord = a4;
}
}
str = "";
if (QLog.isColorLevel()) {
}
if (QLog.isColorLevel()) {
}
String a22 = HexUtil.a(byteArray);
String a32 = HexUtil.a(byteArray2);
if (ptt.bytes_group_file_key.has()) {
}
if (a32 != null) {
}
if (QLog.isColorLevel()) {
}
if (ptt.bytes_pb_reserve.has()) {
}
TransfileUtile.a(stringUtf8, 0L, 2, false, stringUtf8);
RichMsg.PttRec pttRec2 = new RichMsg.PttRec();
pttRec2.localPath.set(stringUtf8);
pttRec2.size.set(0L);
pttRec2.type.set(2);
pttRec2.uuid.set(stringUtf8);
pttRec2.isRead.set(false);
pttRec2.md5.set(str3);
pttRec2.isReport.set(0);
pttRec2.version.set(5);
pttRec2.groupFileID.set(j3);
pttRec2.pttFlag.set(i2);
pttRec2.longPttVipFlag.set(b2);
if (str2 != null) {
}
long j62 = msg2.msg_head.msg_time.get();
pttRec2.msgRecTime.set(System.currentTimeMillis() / 1000);
pttRec2.msgTime.set(j62);
pttRec2.voiceType.set(i4);
pttRec2.voiceLength.set(Utils.a(b3));
pttRec2.voiceChangeFlag.set(i);
pttRec2.directUrl.set(str);
MessageRecord a42 = MessageRecordFactory.a((int) MessageRecord.MSG_TYPE_MEDIA_PTT);
a42.msgtype = MessageRecord.MSG_TYPE_MEDIA_PTT;
a42.msgData = pttRec2.toByteArray();
((MessageForPtt) a42).parse();
list.add(a42);
messageRecord = a42;
}
if (messageRecord != null) {
List list2 = ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get();
StringBuilder sb2 = new StringBuilder();
if (list2 == null || list2.size() <= 0) {
if (QLog.isColorLevel()) {
sb2.append("elems:null || elems.size() <= 0");
QLog.d("Q.msg.MessageHandler", 2, sb2.toString());
return;
}
return;
}
if (QLog.isColorLevel()) {
sb2.append("elemsSize").append(list2.size()).append("\n");
}
int i5 = 0;
while (true) {
int i6 = i5;
if (i6 >= list2.size()) {
break;
}
im_msg_body.Elem elem = (im_msg_body.Elem) list2.get(i6);
if (elem.near_by_msg.has()) {
if (QLog.isColorLevel()) {
sb2.append("elemType: near_by_msg;");
}
im_msg_body.NearByMessageType nearByMessageType = elem.near_by_msg;
if (nearByMessageType.uint32_identify_type.has() && nearByMessageType.uint32_identify_type.get() == 1) {
messageRecord.saveExtInfoToExtStr("identify_flag", "true");
if (QLog.isColorLevel()) {
sb2.append("has identify;");
}
}
} else if (elem.pub_group.has()) {
im_msg_body.PubGroup pubGroup = (im_msg_body.PubGroup) elem.pub_group.get();
if (pubGroup != null) {
int i7 = pubGroup.uint32_gender.get();
String stringUtf82 = pubGroup.bytes_nickname.get().toStringUtf8();
messageRecord.saveExtInfoToExtStr("hotchat_gender", String.valueOf(i7));
if (stringUtf82 == null) {
stringUtf82 = "";
}
messageRecord.saveExtInfoToExtStr("hotchat_nick", stringUtf82);
if (QLog.isColorLevel()) {
sb2.append("has pub_group;");
}
}
} else if (elem.general_flags.has() && ((im_msg_body.GeneralFlags) elem.general_flags.get()).uint32_olympic_torch.has()) {
int i8 = elem.general_flags.uint32_olympic_torch.get();
if (QLog.isColorLevel()) {
sb2.append("has olympicTorch:").append(i8).append(";");
}
if (i8 > 0) {
messageRecord.saveExtInfoToExtStr("olympic_torch_flg", i8 + "");
}
}
i5 = i6 + 1;
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, sb2.toString());
}
}
}
public static int b(msg_comm.Msg msg2) {
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
return 0;
}
Iterator it = ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get().iterator();
while (true) {
if (!it.hasNext()) {
break;
}
im_msg_body.Elem elem = (im_msg_body.Elem) it.next();
if (elem.elem_flags2.has() && ((im_msg_body.ElemFlags2) elem.elem_flags2.get()).uint32_vip_status.has()) {
int i = ((im_msg_body.ElemFlags2) elem.elem_flags2.get()).uint32_vip_status.get();
if (i == 1) {
return 1;
}
if (i == 2) {
return 2;
}
}
}
return 0;
}
public static void a(MessageHandler messageHandler, List list, msg_comm.Msg msg2, TempSessionInfo tempSessionInfo, DecodeProtoPkgContext decodeProtoPkgContext) {
byte[] bArr;
im_msg_body.TmpPtt tmpPtt;
int i;
msg_comm.MsgHead msgHead = (msg_comm.MsgHead) msg2.msg_head.get();
if (msgHead.c2c_tmp_msg_head.has() && msg2.msg_body.has() && ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
msg_comm.C2CTmpMsgHead c2CTmpMsgHead = (msg_comm.C2CTmpMsgHead) msgHead.c2c_tmp_msg_head.get();
int i2 = c2CTmpMsgHead.c2c_type.get();
int i3 = c2CTmpMsgHead.service_type.get();
if (!decodeProtoPkgContext.f28072d && tempSessionInfo.f92310b == 1006) {
String str = c2CTmpMsgHead.from_phone.get();
if (!c2CTmpMsgHead.from_phone.has() || str == null || str.equals("+0")) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_Temp2 : contact fromPhoneNum error : " + c2CTmpMsgHead.from_phone.get());
return;
}
return;
}
ContactUtils.m9109a(messageHandler.f87244b, c2CTmpMsgHead.from_phone.get(), decodeProtoPkgContext.f28180e + "");
}
if (decodeProtoPkgContext.f28072d || !c2CTmpMsgHead.sig.has()) {
bArr = null;
} else {
bArr = c2CTmpMsgHead.sig.get().toByteArray();
if (QLog.isDevelopLevel()) {
QLog.d("Q.msg.MessageHandler", 4, "tempHead.sig.get()----> sig:" + HexUtil.a(bArr) + ",length:" + bArr.length);
}
}
if (bArr != null) {
switch (tempSessionInfo.f92310b) {
case 1001:
messageHandler.f87244b.m4654a().h(String.valueOf(decodeProtoPkgContext.f28180e), bArr);
break;
case 1005:
byte[] bArr2 = new byte[bArr.length + 2];
bArr2[0] = (byte) i2;
bArr2[1] = (byte) i3;
PkgTools.a(bArr2, 2, bArr, 0, bArr.length);
messageHandler.f87244b.m4654a().a(String.valueOf(decodeProtoPkgContext.f28180e), bArr2);
break;
case 1006:
byte[] bArr3 = new byte[bArr.length + 2];
bArr3[0] = (byte) i2;
bArr3[1] = (byte) i3;
PkgTools.a(bArr3, 2, bArr, 0, bArr.length);
messageHandler.f87244b.m4654a().e(String.valueOf(decodeProtoPkgContext.f28180e), bArr3);
break;
case 1008:
byte[] bArr4 = new byte[bArr.length + 2];
bArr4[0] = (byte) i2;
bArr4[1] = (byte) i3;
PkgTools.a(bArr4, 2, bArr, 0, bArr.length);
messageHandler.f87244b.m4654a().f(String.valueOf(decodeProtoPkgContext.f28180e), bArr4);
break;
case 1009:
messageHandler.f87244b.m4654a().g(String.valueOf(decodeProtoPkgContext.f28180e), bArr);
break;
case 1010:
messageHandler.f87244b.m4654a().k(String.valueOf(decodeProtoPkgContext.f28180e), bArr);
break;
case 1022:
messageHandler.f87244b.m4654a().l(String.valueOf(decodeProtoPkgContext.f28180e), bArr);
break;
case 1023:
byte[] bArr5 = new byte[bArr.length + 2];
bArr5[0] = (byte) i2;
bArr5[1] = (byte) i3;
PkgTools.a(bArr5, 2, bArr, 0, bArr.length);
messageHandler.f87244b.m4654a().b(String.valueOf(decodeProtoPkgContext.f28180e), bArr5);
break;
case 1024:
case 1025:
messageHandler.f87244b.m4654a().c(String.valueOf(decodeProtoPkgContext.f28180e), bArr);
break;
case AppConstants.VALUE.aa:
messageHandler.f87244b.m4654a().j(String.valueOf(decodeProtoPkgContext.f28180e), bArr);
break;
case AppConstants.VALUE.ag:
messageHandler.f87244b.m4654a().i(String.valueOf(decodeProtoPkgContext.f28180e), bArr);
break;
}
}
boolean z = false;
if (msg2.content_head.has() && ((msg_comm.ContentHead) msg2.content_head.get()).auto_reply.has()) {
z = ((msg_comm.ContentHead) msg2.content_head.get()).auto_reply.get() == 1;
}
List list2 = ((im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get()).elems.get();
if (z) {
if (list2 != null && list2.size() > 0) {
im_msg_body.Text text = (im_msg_body.Text) ((im_msg_body.Elem) list2.get(0)).text.get();
if (!decodeProtoPkgContext.f28069b) {
MessageRecord a2 = MessageRecordFactory.a(-10000);
a2.msgtype = -10000;
a2.f88923msg = BaseApplication.getContext().getString(R.string.f64309name_res_0x7f0a1714) + TroopBarUtils.y + text.str.get().toStringUtf8();
list.add(a2);
}
}
} else if (tempSessionInfo != null) {
if (((msg_comm.MsgHead) msg2.msg_head.get()).msg_type.get() == 529 && ((msg_comm.MsgHead) msg2.msg_head.get()).c2c_cmd.get() == 6) {
try {
tmpPtt = (im_msg_body.TmpPtt) new im_msg_body.TmpPtt().mergeFrom(((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray());
} catch (InvalidProtocolBufferMicroException e) {
e.printStackTrace();
tmpPtt = null;
}
if (tmpPtt != null && tmpPtt.uint32_file_type.has() && tmpPtt.uint32_file_type.get() == 4 && tmpPtt.bytes_file_uuid.has()) {
String stringUtf8 = tmpPtt.bytes_file_uuid.get().toStringUtf8();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_Temp2 : ptt uuid:" + stringUtf8);
}
RichMsg.PttRec pttRec = new RichMsg.PttRec();
pttRec.localPath.set(tmpPtt.bytes_file_uuid.get().toStringUtf8());
pttRec.size.set(tmpPtt.uint32_file_size.get());
pttRec.type.set(2);
pttRec.uuid.set(stringUtf8);
pttRec.isRead.set(false);
pttRec.serverStorageSource.set("pttcenter");
pttRec.isReport.set(0);
pttRec.version.set(5);
pttRec.pttFlag.set(0);
int i4 = 0;
if (tmpPtt.uint32_user_type.has() && ((i = tmpPtt.uint32_user_type.get()) == 1 || i == 2)) {
i4 = i;
}
int i5 = 0;
if (tmpPtt.bytes_pb_reserve.has()) {
ptt_reserve.ReserveStruct reserveStruct = new ptt_reserve.ReserveStruct();
try {
reserveStruct.mergeFrom(tmpPtt.bytes_pb_reserve.get().toByteArray());
i5 = reserveStruct.uint32_change_voice.get();
} catch (Exception e2) {
}
}
pttRec.longPttVipFlag.set(i4);
long j = msg2.msg_head.msg_time.get();
pttRec.msgRecTime.set(System.currentTimeMillis() / 1000);
pttRec.msgTime.set(j);
pttRec.voiceChangeFlag.set(i5);
pttRec.busiType.set(tmpPtt.uint32_busi_type.get());
MessageRecord a3 = MessageRecordFactory.a((int) MessageRecord.MSG_TYPE_MEDIA_PTT);
a3.msgtype = MessageRecord.MSG_TYPE_MEDIA_PTT;
a3.msgData = pttRec.toByteArray();
((MessageForPtt) a3).parse();
if (tmpPtt.uint64_msg_id.has() && tmpPtt.uint64_msg_id.get() != 0) {
a3.saveExtInfoToExtStr("pa_msgId", tmpPtt.uint64_msg_id.get() + "");
}
list.add(a3);
return;
}
return;
}
a(messageHandler, list, msg2, true, decodeProtoPkgContext.f28069b, (MessageInfo) null, tempSessionInfo);
}
}
}
public static void a(MessageHandler messageHandler, List list, int i, msg_comm.Msg msg2, long j, boolean z, boolean z2, boolean z3, long j2, boolean z4, int i2) {
String substring;
StringBuilder sb = new StringBuilder("<---decodeC2CMsgPkg_OfflineFile : ");
sb.append(" c2cCmd:").append(i).append(";friendUin:").append(j).append(";isReaded:").append(z).append(";isPullRoam:").append(z2).append(";isSelfSender:").append(z3).append(";\n");
long j3 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
long j4 = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
short s = (short) ((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get();
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OfflineFile return null:hasBody:" + msg2.msg_body.has() + "hasRichT:" + ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.has());
return;
}
return;
}
im_msg_body.RichText richText = (im_msg_body.RichText) ((im_msg_body.MsgBody) msg2.msg_body.get()).rich_text.get();
im_msg_body.NotOnlineFile notOnlineFile = (im_msg_body.NotOnlineFile) richText.not_online_file.get();
if (!richText.not_online_file.has()) {
sb.append("hasNotOnlineFile:").append(richText.not_online_file.has()).append(";hasUUID:").append(notOnlineFile.bytes_file_uuid.has());
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
}
} else if (i == 169 || i == 243) {
if (!z4) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<FileAssistant>offlineFile come: c2cCmd[" + i + StepFactory.f18879b);
}
messageHandler.f87244b.m4643a().a(messageHandler, list, msg2, notOnlineFile, String.valueOf(j), z, z2, j2, i2, null);
}
} else {
String str = null;
String str2 = new String(notOnlineFile.bytes_file_uuid.get().toStringUtf8() + j3);
String stringUtf8 = notOnlineFile.bytes_file_uuid.get().toStringUtf8();
sb.append(" NotOnLineFile info : serverPath:").append(stringUtf8).append(";fileKey :").append(str2).append(";");
if (!messageHandler.m4428a().a(str2)) {
String stringUtf82 = notOnlineFile.bytes_file_name.get().toStringUtf8();
sb.append("strFileName:").append(stringUtf82).append(";");
long j5 = notOnlineFile.uint64_file_size.get();
if (i == 241 || MessageUtils.a(stringUtf82, i)) {
RichMsg.PicRec picRec = new RichMsg.PicRec();
picRec.localPath.set(stringUtf8);
picRec.size.set(j5);
picRec.type.set(1);
picRec.isRead.set(false);
picRec.uuid.set(stringUtf8);
picRec.serverStorageSource.set("ftn");
picRec.version.set(5);
picRec.isReport.set(0);
MessageForPic messageForPic = (MessageForPic) MessageRecordFactory.a(-2000);
messageForPic.msgtype = -2000;
messageForPic.msgData = picRec.toByteArray();
messageForPic.parse();
list.add(messageForPic);
str = null;
} else if (i == 242 || MessageUtils.b(stringUtf82, i)) {
if (stringUtf82 != null && !stringUtf82.equals("")) {
if (!stringUtf82.contains("_")) {
substring = stringUtf82.substring(0, stringUtf82.length() - 4);
} else {
substring = stringUtf82.substring(stringUtf82.lastIndexOf("_") + 1, stringUtf82.length() - 4);
}
String str3 = j4 + substring;
sb.append("c2cCmd:0xf2;key:").append(str3).append(";");
if (!z4) {
if (StreamDataManager.e(str3)) {
sb.append("DuplicateKey:").append(str3).append(";");
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
}
StreamDataManager.m8147d(str3);
return;
}
StreamDataManager.m8146c(str3);
}
} else if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "offline ptt no filename");
}
String a2 = TransfileUtile.a(stringUtf8, j5, 2, false, stringUtf8, null, "ftn");
RichMsg.PttRec pttRec = new RichMsg.PttRec();
pttRec.localPath.set(stringUtf8);
pttRec.size.set(j5);
pttRec.type.set(2);
pttRec.uuid.set(stringUtf8);
pttRec.isRead.set(false);
pttRec.serverStorageSource.set("ftn");
pttRec.isReport.set(0);
pttRec.version.set(5);
pttRec.msgRecTime.set(System.currentTimeMillis() / 1000);
pttRec.msgTime.set(j3);
MessageForPtt messageForPtt = (MessageForPtt) MessageRecordFactory.a((int) MessageRecord.MSG_TYPE_MEDIA_PTT);
messageForPtt.msgtype = MessageRecord.MSG_TYPE_MEDIA_PTT;
messageForPtt.msgData = pttRec.toByteArray();
messageForPtt.parse();
list.add(messageForPtt);
PttInfoCollector.a(messageHandler.f87244b, 1, false, 4);
str = a2;
}
sb.append("protocolStr:").append(str).append(";");
} else {
sb.append("rcv a repeated offline file push msg");
}
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, sb.toString());
}
}
}
public static MessageDecContent a(MessageHandler messageHandler, msg_comm.Msg msg2, long j, boolean z, boolean z2, long j2, int i) {
im_msg_body.MsgBody msgBody = (im_msg_body.MsgBody) msg2.msg_body.get();
int i2 = ((msg_comm.MsgHead) msg2.msg_head.get()).c2c_cmd.get();
Long valueOf = Long.valueOf(((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get());
Long valueOf2 = Long.valueOf(((msg_comm.MsgHead) msg2.msg_head.get()).to_uin.get());
long j3 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
short s = (short) ((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get();
String l = valueOf.toString();
String currentAccountUin = messageHandler.f87244b.getCurrentAccountUin();
if (i2 == 129) {
if (l.equals(String.valueOf(valueOf2)) && l.equals(currentAccountUin)) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile recv a 0x81 that is from self.");
}
return null;
}
} else {
l = currentAccountUin.equals(String.valueOf(valueOf)) ? String.valueOf(valueOf2) : String.valueOf(valueOf);
}
switch (i2) {
case 129:
if (currentAccountUin.equalsIgnoreCase(String.valueOf(valueOf))) {
if (QLog.isColorLevel()) {
QLog.w("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile 0x81 request is error.it is from self!!!");
}
return null;
} else if (z2) {
if (QLog.isColorLevel()) {
QLog.i("Q.msg.MessageHandler", 2, "recv roam online msg, return null!");
}
return null;
} else {
OnlineFileSessionInfo m6197a = messageHandler.f87244b.m4643a().m6197a(msgBody.msg_content.get().toByteArray());
if (m6197a != null) {
if (!messageHandler.f87244b.m4643a().a(m6197a)) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile 0x81 request is error.");
}
return null;
} else if (!m6197a.f23619c) {
if (QLog.isColorLevel()) {
QLog.w("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile 0x81. requset is no mulitend olfile.");
}
return null;
} else {
messageHandler.f87244b.m4643a().b(i2, String.valueOf(j), l, j3, s, z, 0, null, m6197a, j2, i);
break;
}
} else {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile decode 0x81 failed.");
}
return null;
}
}
case 131:
OnlineFileSessionInfo m6197a2 = messageHandler.f87244b.m4643a().m6197a(msgBody.msg_content.get().toByteArray());
if (m6197a2 != null) {
if (!messageHandler.f87244b.m4643a().a(m6197a2)) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile 0x83 is error.");
}
return null;
}
messageHandler.f87244b.m4643a().b(i2, String.valueOf(j), l, j3, s, z, 0, null, m6197a2, j2, i);
break;
} else {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile decode 0x83 failed.");
}
return null;
}
case 133:
OnlineFileSessionInfo b2 = messageHandler.f87244b.m4643a().b(msgBody.msg_content.get().toByteArray());
if (b2 != null) {
if (!messageHandler.f87244b.m4643a().a(b2)) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile 0x85 is error.");
}
return null;
}
messageHandler.f87244b.m4643a().b(i2, String.valueOf(j), l, j3, s, z, 0, null, b2, j2, i);
break;
} else {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_OnlineFile decode 0x85 failed.");
}
return null;
}
}
return null;
}
public static void a(MessageHandler messageHandler, msg_comm.Msg msg2, boolean z, boolean z2, boolean z3, int i) {
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_AddFriend return null:hasBody:" + msg2.msg_body.has() + ",hasMsgContent" + ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has() + ",isReaded:" + z + "syncOther:" + z2);
return;
}
return;
}
long longValue = Long.valueOf(messageHandler.f87244b.getCurrentAccountUin()).longValue();
long j = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
short s = (short) ((msg_comm.MsgHead) msg2.msg_head.get()).msg_type.get();
int i2 = (-1006) - (s - 187);
if (!z && !z2 && !z3) {
messageHandler.m4431a().a(longValue, j, s, i2, msg2, i);
}
msg_comm.MsgHead msgHead = (msg_comm.MsgHead) msg2.msg_head.get();
if (msgHead != null) {
String str = "" + msgHead.auth_uin.get();
String str2 = msgHead.auth_nick.get();
String str3 = msgHead.auth_remark.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.sysnick", 2, "FriendSys auUin:" + str + "aunick:" + str2 + "auRemark:" + str3);
}
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str3)) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.sysremark", 2, "FriendSys saveremark");
}
messageHandler.b(str, str3);
}
if (!TextUtils.isEmpty(str) && !TextUtils.isEmpty(str2)) {
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.sysnick", 2, "FriendSys savenick");
}
messageHandler.a(str, str2);
}
}
}
public static long a(MessageHandler messageHandler, msg_comm.Msg msg2, boolean z, boolean z2, boolean z3) {
long j;
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_GroupSys");
}
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_GroupSys return null:hasBody:" + msg2.msg_body.has() + ",hasMsgContent" + ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has() + ",isReaded:" + z + "syncOther:" + z2);
}
return 0L;
}
long longValue = Long.valueOf(messageHandler.f87244b.getCurrentAccountUin()).longValue();
long j2 = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
short s = (short) ((msg_comm.MsgHead) msg2.msg_head.get()).msg_type.get();
byte[] byteArray = ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray();
if (byteArray == null || byteArray.length <= 0) {
j = 0;
} else {
j = PkgTools.m9501a(byteArray, 0);
}
msg_comm.MsgHead msgHead = (msg_comm.MsgHead) msg2.msg_head.get();
if (msgHead != null) {
String str = msgHead.group_name.get();
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler.sysnick", 2, "TroopCode:" + j + "TroopName:" + str);
}
messageHandler.c("" + j, str);
}
if (!z && !z2 && !z3) {
messageHandler.m4431a().a(longValue, s, byteArray, j2, ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get(), ((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get());
return j;
}
return j;
}
private static void a(long j, long j2, int i) {
SharpReport_OffLine m197a = SharpReport_OffLine.m197a();
m197a.a(0L, j, j2);
m197a.a(i, 2, j2);
}
public static void a(MessageHandler messageHandler, msg_comm.Msg msg2, DecodeProtoPkgContext decodeProtoPkgContext) {
int i;
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_SharpVideo return null:hasBody:" + msg2.msg_body.has() + ",hasMsgContent" + ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has());
return;
}
return;
}
long j = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
long j2 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_uid.get();
long j3 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get();
long j4 = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
((msg_comm.MsgHead) msg2.msg_head.get()).to_uin.get();
String str = j3 + "-" + j2;
if (QLog.isColorLevel()) {
QLog.d("shanezhaiSHARP", 2, "<---decodeC2CMsgPkg_SharpVideo : key:" + str);
}
if (messageHandler.f87244b.m4654a().a(j4, str)) {
if (QLog.isColorLevel()) {
QLog.d("shanezhaiSHARP", 2, "msg has been pulled");
return;
}
return;
}
long a2 = MessageCache.a();
long longValue = Long.valueOf(messageHandler.f87244b.getCurrentAccountUin()).longValue();
byte[] byteArray = ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray();
long j5 = a2 - j;
byte[] bArr = new byte[4];
System.arraycopy(byteArray, 0, bArr, 0, 4);
System.arraycopy(byteArray, 4, new byte[4], 0, 4);
int a3 = VideoController.a(bArr, 4);
int i2 = a3 + 8;
int length = (byteArray.length - 8) - a3;
if (length >= 0) {
byte[] bArr2 = new byte[length];
System.arraycopy(byteArray, i2, bArr2, 0, length);
boolean m369a = AbstractNetChannel.m369a(bArr2);
if (((decodeProtoPkgContext.f28067a || decodeProtoPkgContext.f) && decodeProtoPkgContext.f28065a != decodeProtoPkgContext.f28068b) || (decodeProtoPkgContext.f28065a == decodeProtoPkgContext.f28068b && !m369a)) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_SharpVideo return null:,isReaded:" + decodeProtoPkgContext.f28067a + "syncOther:" + decodeProtoPkgContext.f + ",isSharpRequest" + m369a);
return;
}
return;
}
if (m369a) {
messageHandler.f87244b.m4654a().a(j4, str, a2);
a(longValue, j4, 215);
}
if (!VcSystemInfo.m381e() || !VcSystemInfo.m382f()) {
if (QLog.isColorLevel()) {
QLog.d("shanezhaiSHARP", 2, "Discard video message cause device not support");
}
if (m369a) {
a(longValue, j4, 212);
}
} else if (j5 >= 60) {
if (m369a) {
String valueOf = String.valueOf(j4);
String valueOf2 = String.valueOf(longValue);
hd_video_2.MsgBody msgBody = new hd_video_2.MsgBody();
try {
msgBody.mergeFrom(bArr2);
i = msgBody.msg_invite_body.uint32_new_business_flag.get();
} catch (Exception e) {
e.printStackTrace();
i = -1;
}
if (-1 == i) {
VideoMsgTools.a(messageHandler.f87244b, 0, 6, true, valueOf, valueOf2, false, null, false, msg2);
} else {
VideoMsgTools.a(messageHandler.f87244b, 0, 6, i == 0, valueOf, String.valueOf(j4), false, null, false, msg2);
}
a(longValue, j4, 208);
}
if (QLog.isColorLevel()) {
QLog.d("shanezhaiSHARP", 2, "Discard video message because of time out " + j5 + " s");
}
} else {
if (m369a) {
a(longValue, j4, 211);
}
if (QLog.isColorLevel()) {
QLog.d("shanezhaiSHARP", 2, "===========handleSharpVideoMessageResp 1234========");
}
messageHandler.a(longValue, bArr2, j4, (int) j, m369a);
}
}
}
public static void b(MessageHandler messageHandler, msg_comm.Msg msg2, DecodeProtoPkgContext decodeProtoPkgContext) {
int i;
int i2;
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has()) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_QCall return null:hasBody:" + msg2.msg_body.has() + ",hasMsgContent" + ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has());
return;
}
return;
}
long j = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
long j2 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_uid.get();
long j3 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get();
long j4 = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
((msg_comm.MsgHead) msg2.msg_head.get()).to_uin.get();
String str = j3 + "-" + j2;
if (QLog.isColorLevel()) {
QLog.d("decodeC2CMsgPkg_QCall", 2, "<---decodeC2CMsgPkg_QCall : key:" + str);
}
if (messageHandler.f87244b.m4654a().a(j4, str)) {
if (QLog.isColorLevel()) {
QLog.d("decodeC2CMsgPkg_QCall", 2, "msg has been pulled");
return;
}
return;
}
long a2 = MessageCache.a();
long longValue = Long.valueOf(messageHandler.f87244b.getCurrentAccountUin()).longValue();
byte[] byteArray = ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray();
long j5 = a2 - j;
byte[] bArr = new byte[4];
byte[] bArr2 = new byte[4];
System.arraycopy(byteArray, 0, bArr, 0, 4);
System.arraycopy(byteArray, 4, bArr2, 0, 4);
int a3 = VideoController.a(bArr, 4);
int a4 = VideoController.a(bArr2, 4);
if (a3 <= 0 || a4 <= 0) {
if (QLog.isColorLevel()) {
QLog.d("decodeC2CMsgPkg_QCall", 2, "invalid head length:" + a3 + " or body length:" + a4);
return;
}
return;
}
byte[] bArr3 = null;
try {
head.Head head = new head.Head();
byte[] bArr4 = new byte[a3];
System.arraycopy(byteArray, 8, bArr4, 0, a3);
head.mergeFrom(bArr4);
i = head.msg_msg_head.msg_content_head.uint32_type.get();
i2 = head.msg_msg_head.msg_content_head.uint32_subtype.get();
} catch (Exception e) {
if (QLog.isColorLevel()) {
QLog.d("decodeC2CMsgPkg_QCall", 2, "error when process qcall offline msg", e);
}
}
if (i == 562 && i2 == 17) {
int i3 = a3 + 8;
im_msg_body.MsgBody msgBody = new im_msg_body.MsgBody();
byte[] bArr5 = new byte[a4];
System.arraycopy(byteArray, i3, bArr5, 0, a4);
msgBody.mergeFrom(bArr5);
bArr3 = msgBody.msg_content.get().toByteArray();
if (bArr3 == null) {
if (QLog.isColorLevel()) {
QLog.d("decodeC2CMsgPkg_QCall", 2, "msg sharp content null, return;");
return;
}
return;
}
boolean m369a = AbstractNetChannel.m369a(bArr3);
if (((decodeProtoPkgContext.f28067a || decodeProtoPkgContext.f) && decodeProtoPkgContext.f28065a != decodeProtoPkgContext.f28068b) || (decodeProtoPkgContext.f28065a == decodeProtoPkgContext.f28068b && !m369a)) {
if (QLog.isColorLevel()) {
QLog.e("decodeC2CMsgPkg_QCall", 2, "<---decodeC2CMsgPkg_QCall return null:,isReaded:" + decodeProtoPkgContext.f28067a + "syncOther:" + decodeProtoPkgContext.f + ",isSharpRequest" + m369a);
return;
}
return;
}
try {
new QavWrapper(BaseApplicationImpl.getContext()).a(new tto(bArr3, j5, CharacterUtil.a(longValue), CharacterUtil.a(j4), messageHandler, longValue, j4, j, m369a));
} catch (Exception e2) {
if (QLog.isColorLevel()) {
QLog.d("decodeC2CMsgPkg_QCall", 2, "exception when process qcall offline msg", e2);
}
}
} else if (QLog.isColorLevel()) {
QLog.d("decodeC2CMsgPkg_QCall", 2, "error msgType:" + i + ", or subType:" + i2);
}
}
public static void c(MessageHandler messageHandler, msg_comm.Msg msg2, DecodeProtoPkgContext decodeProtoPkgContext) {
if (!msg2.msg_body.has() || !((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has() || decodeProtoPkgContext.f28067a || decodeProtoPkgContext.f) {
if (QLog.isColorLevel()) {
QLog.e("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_Video return null:hasBody:" + msg2.msg_body.has() + ",hasMsgContent" + ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.has() + ",isReaded:" + decodeProtoPkgContext.f28067a + "syncOther:" + decodeProtoPkgContext.f);
return;
}
return;
}
long j = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
long j2 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_uid.get();
long j3 = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get();
long j4 = ((msg_comm.MsgHead) msg2.msg_head.get()).from_uin.get();
long j5 = ((msg_comm.MsgHead) msg2.msg_head.get()).to_uin.get();
long longValue = Long.valueOf(messageHandler.f87244b.getCurrentAccountUin()).longValue();
String str = j4 + "-" + j5 + "-" + j3 + "-" + j2;
if (QLog.isColorLevel()) {
QLog.d("Q.msg.MessageHandler", 2, "<---decodeC2CMsgPkg_Video : key:" + str);
}
byte[] byteArray = ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray();
long a2 = MessageCache.a() - j;
byte a3 = AbstractNetChannel.a(byteArray);
if (!VcSystemInfo.m381e() || !VcSystemInfo.m382f()) {
if (QLog.isColorLevel()) {
QLog.d("svenxu", 2, "Discard video message cause device not support");
}
} else if (a2 >= 60) {
if (a3 == 1) {
}
if (QLog.isColorLevel()) {
QLog.d("svenxu", 2, "Discard video message because of time out " + a2 + " s");
}
} else {
HashMap hashMap = (HashMap) decodeProtoPkgContext.a(1000);
HashSet hashSet = (HashSet) decodeProtoPkgContext.a(1001);
if (a3 == 1) {
if (!VcSystemInfo.m381e()) {
if (QLog.isColorLevel()) {
QLog.d("shanezhaiSHARP", 2, "discard video push message because the sdk is lower");
}
} else if (hashMap != null) {
hashMap.put(Long.valueOf(j4), msg2);
}
} else if (a3 == 3) {
if (VcSystemInfo.m381e()) {
if (hashSet != null) {
hashSet.add(Long.valueOf(j4));
}
messageHandler.a(longValue, byteArray, j4, (int) j);
}
} else {
messageHandler.a(longValue, byteArray, j4, (int) j);
}
}
}
public static void a(MessageHandler messageHandler, msg_comm.Msg msg2, boolean z, boolean z2) {
long j = ((msg_comm.MsgHead) msg2.msg_head.get()).msg_time.get();
((msg_comm.MsgHead) msg2.msg_head.get()).msg_uid.get();
((msg_comm.MsgHead) msg2.msg_head.get()).msg_seq.get();
MessageCache.a();
Long.valueOf(messageHandler.f87244b.getCurrentAccountUin()).longValue();
byte[] byteArray = ((im_msg_body.MsgBody) msg2.msg_body.get()).msg_content.get().toByteArray();
if (QLog.isColorLevel()) {
QLog.d("shanezhai", 2, "recv MultiVideo offline msg !msgTime is:" + j);
}
messageHandler.f87244b.m4627a().a(byteArray, msg2);
}
private static PAMessage a(String str) {
PAMessage b2 = PAMessageUtil.b(str);
if (b2 != null) {
return b2;
}
return null;
}
public static int a(int i) {
switch (i) {
case 1:
case 7:
case 9:
case 13:
case 16:
case 21:
default:
return 0;
case 2:
return 1;
case 3:
return 1000;
case 4:
return 3000;
case 5:
return 1004;
case 6:
return 1005;
case 8:
return 1008;
case 10:
return 1006;
case 11:
return 1009;
case 12:
return 1001;
case 14:
return 1020;
case 15:
return 1024;
case 17:
return 1022;
case 18:
return 1023;
case 19:
return 1010;
case 20:
return AppConstants.VALUE.aa;
case 22:
return AppConstants.VALUE.ag;
}
}
public static int b(int i) {
switch (i) {
case 0:
default:
return 1;
case 1:
return 2;
case 1000:
return 3;
case 1001:
return 12;
case 1004:
return 5;
case 1005:
return 6;
case 1006:
return 10;
case 1008:
return 8;
case 1009:
return 11;
case 1010:
return 19;
case 1020:
return 14;
case 1022:
return 17;
case 1023:
return 18;
case 1024:
case 1025:
return 15;
case 3000:
return 4;
case AppConstants.VALUE.aa:
return 20;
case AppConstants.VALUE.ag:
return 22;
}
}
}