CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e
以下内容为反编译后的 m4.java 源代码,内容仅作参考
package y0;
import ak.im.module.User;
import ak.im.sdk.manager.bf;
import ak.im.utils.Log;
import android.text.TextUtils;
import com.asim.protobuf.Akeychat;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.util.ArrayList;
import java.util.List;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.xmlpull.v1.XmlPullParser;
public class m4 extends IQ {
private final String f48542a;
private Akeychat.PublicUserGetResponse f48543b;
private String f48544c;
private List<User> f48545d;
private boolean f48546e;
private int f48547f;
private int f48548g;
private boolean f48549h;
private long f48550i;
public static class b extends IQProvider {
@Override
public IQ parse(XmlPullParser xmlPullParser, int i10) throws Exception {
m4 m4Var = new m4();
boolean z10 = false;
while (!z10) {
int next = xmlPullParser.next();
if (next == 4) {
m4Var.parseResults(xmlPullParser);
} else if (next == 3 && xmlPullParser.getName().equals("publicuser")) {
z10 = true;
}
}
return m4Var;
}
}
private User a(Akeychat.StrangerInfo strangerInfo) {
if (strangerInfo == null) {
Log.w("QueryPublicUser", "info is null");
return null;
}
return bf.getInstance().generateAStranger(strangerInfo, getFrom().getDomain().toString());
}
@Override
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder iQChildElementXmlStringBuilder) {
iQChildElementXmlStringBuilder.append(">");
if (this.f48546e) {
Akeychat.PublicUserGetRequest.b newBuilder = Akeychat.PublicUserGetRequest.newBuilder();
String str = this.f48542a;
if (TextUtils.isEmpty(str)) {
Log.i("QueryPublicUser", "we set null search key");
str = "";
}
newBuilder.setFilter(str);
newBuilder.setIndex(this.f48547f);
newBuilder.setLen(this.f48548g);
newBuilder.setCheckPublicSwitch(this.f48549h);
Log.i("QueryPublicUser", "search key:" + str + ",start:" + this.f48547f + ",offset:" + this.f48548g + ",isCheckPublic:" + this.f48549h + ",is null:" + TextUtils.isEmpty(this.f48542a));
iQChildElementXmlStringBuilder.optElement(HiAnalyticsConstant.Direction.REQUEST, e.e.encodeBytes(newBuilder.build().toByteArray()));
} else {
String str2 = this.f48544c;
if (str2 != null) {
iQChildElementXmlStringBuilder.optElement("result", str2);
}
}
return iQChildElementXmlStringBuilder;
}
public List<User> getPublicUsers() {
if (!getFrom().getDomain().toString().equals(getTo().getDomain().toString()) && this.f48545d != null) {
String part = getFrom().getDomain().toString();
for (User user : this.f48545d) {
user.setJID(user.getName() + "@" + part);
user.setName(user.getName() + "#" + ak.im.sdk.manager.f1.getInstance().getServerIdByDomain(part));
}
}
return this.f48545d;
}
public long getTotalCount() {
return this.f48550i;
}
protected void parseResults(XmlPullParser xmlPullParser) throws Exception {
try {
String text = xmlPullParser.getText();
this.f48544c = text;
this.f48543b = Akeychat.PublicUserGetResponse.parseFrom(e.e.decode(text));
Log.i("QueryPublicUser", "parse public user :" + this.f48543b.toString());
List<Akeychat.StrangerInfo> publicUserListList = this.f48543b.getPublicUserListList();
this.f48550i = this.f48543b.getTotalCount();
for (Akeychat.StrangerInfo strangerInfo : publicUserListList) {
if (strangerInfo != null) {
User a10 = a(strangerInfo);
if (this.f48545d == null) {
this.f48545d = new ArrayList();
}
if (a10 != null) {
this.f48545d.add(a10);
} else {
Log.w("QueryPublicUser", "user is null:" + strangerInfo.toString());
}
}
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
public m4(String str, int i10, int i11, Boolean bool, q1 q1Var) {
super("publicuser", "http://akey.im/protocol/xmpp/iq/publicuser");
setType(IQ.Type.get);
setTo(q1Var.getTo());
setFrom(bf.getInstance().getUserMe().getJID());
this.f48542a = str;
this.f48547f = i10;
this.f48548g = i11;
this.f48549h = bool.booleanValue();
this.f48546e = true;
}
private m4() {
super("publicuser", "http://akey.im/protocol/xmpp/iq/publicuser");
setType(IQ.Type.get);
setTo(ak.im.sdk.manager.f1.getInstance().getServer().getXmppDomain());
setFrom(bf.getInstance().getUserMe().getJID());
this.f48542a = null;
this.f48546e = false;
}
}