CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05
以下内容为反编译后的 g5.java 源代码,内容仅作参考
package ak.smack;
import ak.im.module.User;
import ak.im.sdk.manager.nf;
import ak.im.sdk.manager.ye;
import ak.im.utils.Log;
import com.asim.protobuf.Akeychat;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import java.util.ArrayList;
import java.util.Iterator;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.xmlpull.v1.XmlPullParser;
public class g5 extends IQ {
private final String a;
private Akeychat.UserSearchGetResponse f4344b;
private String f4345c;
private ArrayList<User> f4346d;
private boolean f4347e;
private String f;
private String g;
private int h;
private Akeychat.UserSearchType i;
public static class b extends IQProvider {
@Override
public IQ parse(XmlPullParser xmlPullParser, int i) throws Exception {
g5 g5Var = new g5();
boolean z = false;
while (!z) {
int next = xmlPullParser.next();
if (next == 4) {
g5Var.parseResults(xmlPullParser);
} else if (next == 3 && xmlPullParser.getName().equals("usersearch")) {
z = true;
}
}
return g5Var;
}
}
public String getDes() {
return this.g;
}
@Override
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder iQChildElementXmlStringBuilder) {
iQChildElementXmlStringBuilder.append(">");
if (this.f4347e) {
Akeychat.UserSearchGetRequest.b newBuilder = Akeychat.UserSearchGetRequest.newBuilder();
Log.i("SearchUserFromOtherServer", "search key is " + this.a);
newBuilder.setFilter(this.a);
newBuilder.setServerId(this.f);
newBuilder.setType(this.i);
Log.i("SearchUserFromOtherServer", "userSearchType is " + this.i.toString());
iQChildElementXmlStringBuilder.optElement(HiAnalyticsConstant.Direction.REQUEST, ak.comm.d.encodeBytes(newBuilder.build().toByteArray()));
} else {
String str = this.f4345c;
if (str != null) {
iQChildElementXmlStringBuilder.optElement("result", str);
}
}
return iQChildElementXmlStringBuilder;
}
public ArrayList<User> getPublicUser() {
if (!getFrom().getDomain().toString().equals(getTo().getDomain().toString()) && this.f4346d != null) {
String part = getFrom().getDomain().toString();
Iterator<User> it = this.f4346d.iterator();
while (it.hasNext()) {
User next = it.next();
next.setJID(next.getName() + "@" + part);
next.setName(next.getName() + "#" + ye.getInstance().getServerIdByDomain(part));
}
}
return this.f4346d;
}
public int getReturnCode() {
return this.h;
}
protected void parseResults(XmlPullParser xmlPullParser) throws Exception {
try {
String text = xmlPullParser.getText();
this.f4345c = text;
this.f4344b = Akeychat.UserSearchGetResponse.parseFrom(ak.comm.d.decode(text));
Log.i("SearchUserFromOtherServer", "parse public user :" + this.f4344b.toString());
this.f4346d = new ArrayList<>();
this.h = this.f4344b.getResult().getReturnCode();
this.g = this.f4344b.getResult().getDescription();
for (Akeychat.StrangerInfo strangerInfo : this.f4344b.getUsersList()) {
User generateAStranger = nf.getInstance().generateAStranger(strangerInfo, "");
if (generateAStranger != null) {
this.f4346d.add(generateAStranger);
}
}
} catch (Exception e2) {
e2.printStackTrace();
}
}
public g5(String str, String str2, Akeychat.UserSearchType userSearchType) {
super("usersearch", "http://akey.im/protocol/xmpp/iq/usersearch");
this.g = "";
this.h = 0;
this.i = Akeychat.UserSearchType.COMMON_SEARCH;
setType(IQ.Type.get);
this.a = str;
this.f4347e = true;
if (userSearchType != null) {
this.i = userSearchType;
}
this.f = str2;
}
private g5() {
super("usersearch", "http://akey.im/protocol/xmpp/iq/usersearch");
this.g = "";
this.h = 0;
this.i = Akeychat.UserSearchType.COMMON_SEARCH;
setType(IQ.Type.get);
setTo(ye.getInstance().getServer().getXmppDomain());
setFrom(nf.getInstance().getUserMe().getJID());
this.a = null;
this.f4347e = false;
}
}