CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e
以下内容为反编译后的 y.java 源代码,内容仅作参考
package y0;
import ak.im.module.AKSessionBean;
import ak.im.utils.Log;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.asim.protobuf.Akeychat;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.xmlpull.v1.XmlPullParser;
public class y extends b {
private final String f49023a;
private String f49024b;
Akeychat.ChangedMessageSyncResponse f49025c;
private ConcurrentMap<String, AKSessionBean> f49026d;
private boolean f49027e;
public static class a extends IQProvider {
@Override
public IQ parse(XmlPullParser xmlPullParser, int i10) throws Exception {
y yVar = new y();
boolean z10 = false;
while (!z10) {
int next = xmlPullParser.next();
if (next == 4) {
yVar.parseResults(xmlPullParser);
} else if (next == 3 && xmlPullParser.getName().equals("changedmessagesync")) {
z10 = true;
}
}
return yVar;
}
}
public y(ConcurrentHashMap<String, AKSessionBean> concurrentHashMap, q1 q1Var) {
super("changedmessagesync", "http://akey.im/protocol/xmpp/iq/changedmessagesync", q1Var);
this.f49023a = "ChangedMessageSyncIQ";
setType(IQ.Type.get);
this.f49027e = true;
this.f49026d = concurrentHashMap;
}
@Override
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder iQChildElementXmlStringBuilder) {
iQChildElementXmlStringBuilder.append(">");
if (this.f49027e) {
Akeychat.ChangedMessageSyncRequest.b newBuilder = Akeychat.ChangedMessageSyncRequest.newBuilder();
ConcurrentMap<String, AKSessionBean> concurrentMap = this.f49026d;
if (concurrentMap != null && concurrentMap.size() > 0) {
for (String str : this.f49026d.keySet()) {
AKSessionBean aKSessionBean = this.f49026d.get(str);
if (ak.im.utils.q5.isEmptyString(aKSessionBean.getSessionId())) {
Log.i("ChangedMessageSyncIQ", "old session without session id:" + str);
} else {
Akeychat.ChangedChatSessionInfo.b newBuilder2 = Akeychat.ChangedChatSessionInfo.newBuilder();
newBuilder2.setSessionId(aKSessionBean.getSessionId());
newBuilder2.setUnReadCount(aKSessionBean.getUnread());
newBuilder2.setFirstMessageSeqNo(aKSessionBean.getFirstMessageSeqNo());
newBuilder2.setLastMessageSeqNo(aKSessionBean.getLastMessageSeqNo());
String lastMessage = aKSessionBean.getLastMessage();
try {
if (lastMessage.contains("message")) {
long longValue = ((JSONObject) JSON.parseObject(lastMessage).getJSONArray("message").get(0)).getLong("seq_no").longValue();
Log.d("ChangedMessageSyncIQ", "seq no is " + longValue);
if (longValue > 0) {
newBuilder2.setActualMessageSeqNo(longValue);
}
}
} catch (Exception e10) {
Log.d("ChangedMessageSyncIQ", "error is " + e10.getMessage());
e10.printStackTrace();
}
newBuilder.addChangedSessionList(newBuilder2.build());
}
}
}
newBuilder.setEnableChannel(true);
newBuilder.setEnableBot(true);
newBuilder.setEnableNotifycation(true);
Log.debug("ChangedMessageSyncIQ", "changedMessageSyncRequestBuilder " + newBuilder.build());
iQChildElementXmlStringBuilder.optElement(HiAnalyticsConstant.Direction.REQUEST, e.e.encodeBytes(newBuilder.build().toByteArray()));
}
return iQChildElementXmlStringBuilder;
}
public Akeychat.ChangedMessageSyncResponse getmMessageSyncResponse() {
return this.f49025c;
}
protected void parseResults(XmlPullParser xmlPullParser) throws Exception {
try {
String text = xmlPullParser.getText();
this.f49024b = text;
this.f49025c = Akeychat.ChangedMessageSyncResponse.parseFrom(e.e.decode(text));
} catch (Exception e10) {
this.f49025c = null;
e10.printStackTrace();
}
}
public y() {
super("changedmessagesync", "http://akey.im/protocol/xmpp/iq/changedmessagesync", null);
this.f49023a = "ChangedMessageSyncIQ";
}
}