CarrotChat v2.8.60.240131版本的 MD5 值为:2baf8b9f31830b86b5c5a85ae6b47e05
以下内容为反编译后的 g.java 源代码,内容仅作参考
package ak.smack;
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.List;
import kotlin.text.StringsKt__StringsKt;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.xmlpull.v1.XmlPullParser;
@kotlin.j(d1 = {"\u0000>\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u0018\u0000 \u001f2\u00020\u0001:\u0002\u001f B+\b\u0016\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0005\u0012\b\u0010\u0006\u001a\u0004\u0018\u00010\u0005\u0012\u0006\u0010\u0007\u001a\u00020\u0005¢\u0006\u0002\u0010\bB\u0007\b\u0016¢\u0006\u0002\u0010\tJ\u0010\u0010\u0018\u001a\u00020\u00192\u0006\u0010\u001a\u001a\u00020\u0019H\u0014J\u0010\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001eH\u0004R\u000e\u0010\n\u001a\u00020\u0005X\u0082D¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u000e¢\u0006\u0002\n\u0000R\u0011\u0010\r\u001a\u00020\f8F¢\u0006\u0006\u001a\u0004\b\r\u0010\u000eR\u000e\u0010\u000f\u001a\u00020\u0005X\u0082.¢\u0006\u0002\n\u0000R\u0010\u0010\u0010\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000R\u001c\u0010\u0011\u001a\u0004\u0018\u00010\u0012X\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\u0013\u0010\u0014\"\u0004\b\u0015\u0010\u0016R\u0010\u0010\u0017\u001a\u0004\u0018\u00010\u0005X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006!"}, d2 = {"Lak/smack/AddFriendExtension;", "Lorg/jivesoftware/smack/packet/IQ;", "ft", "Lak/smack/IQFromTo;", "phone", "", "un", "addType", "(Lak/smack/IQFromTo;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V", "()V", "TAG", "isSend", "", "isSuccess", "()Z", "mAddType", "mPhone", "mResult", "Lcom/asim/protobuf/Akeychat$OpBaseResult;", "getMResult", "()Lcom/asim/protobuf/Akeychat$OpBaseResult;", "setMResult", "(Lcom/asim/protobuf/Akeychat$OpBaseResult;)V", "mUserName", "getIQChildElementBuilder", "Lorg/jivesoftware/smack/packet/IQ$IQChildElementXmlStringBuilder;", "xml", "parseResults", "", "parser", "Lorg/xmlpull/v1/XmlPullParser;", "Companion", "Provider", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public final class g extends IQ {
@NotNull
public static final a a = new a(null);
@NotNull
private static final String f4321b = "http://akey.im/protocol/xmpp/iq/addfriend";
@NotNull
private static final String f4322c = "addfriend";
@NotNull
private final String f4323d;
private boolean f4324e;
@Nullable
private String f;
@Nullable
private String g;
private String h;
@Nullable
private Akeychat.OpBaseResult i;
@kotlin.j(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0005\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0014\u0010\u0003\u001a\u00020\u0004X\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006R\u0014\u0010\u0007\u001a\u00020\u0004X\u0086D¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u0006¨\u0006\t"}, d2 = {"Lak/smack/AddFriendExtension$Companion;", "", "()V", "ELEMENT", "", "getELEMENT", "()Ljava/lang/String;", "NAMESPACE", "getNAMESPACE", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public static final class a {
private a() {
}
public a(kotlin.jvm.internal.o oVar) {
this();
}
@NotNull
public final String getELEMENT() {
return g.f4322c;
}
@NotNull
public final String getNAMESPACE() {
return g.f4321b;
}
}
@kotlin.j(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0003J\u0018\u0010\u0004\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\bH\u0016¨\u0006\t"}, d2 = {"Lak/smack/AddFriendExtension$Provider;", "Lorg/jivesoftware/smack/provider/IQProvider;", "Lorg/jivesoftware/smack/packet/IQ;", "()V", "parse", "parser", "Lorg/xmlpull/v1/XmlPullParser;", "initDepth", "", "ak-im_carrotArmV7Release"}, k = 1, mv = {1, 6, 0}, xi = 48)
public static final class b extends IQProvider<IQ> {
@Override
@NotNull
public IQ parse(@NotNull XmlPullParser parser, int i) throws Exception {
kotlin.jvm.internal.r.checkNotNullParameter(parser, "parser");
g gVar = new g();
boolean z = false;
while (!z) {
int next = parser.next();
if (next != 3) {
if (next == 4) {
gVar.parseResults(parser);
}
} else if (kotlin.jvm.internal.r.areEqual(parser.getName(), g.a.getELEMENT())) {
z = true;
}
}
return gVar;
}
}
public g(@NotNull q1 ft, @Nullable String str, @Nullable String str2, @NotNull String addType) {
super(f4322c, f4321b);
List split$default;
kotlin.jvm.internal.r.checkNotNullParameter(ft, "ft");
kotlin.jvm.internal.r.checkNotNullParameter(addType, "addType");
this.f4323d = "AddFriendExtension";
this.f4324e = true;
this.f = str;
if (ak.im.utils.n5.isContainsSplicer(str2)) {
Log.i("AddFriendExtension", kotlin.jvm.internal.r.stringPlus("# username is ", str2));
kotlin.jvm.internal.r.checkNotNull(str2);
split$default = StringsKt__StringsKt.split$default((CharSequence) str2, new String[]{"#"}, false, 0, 6, (Object) null);
this.g = (String) split$default.get(0);
Akeychat.ServerSyncResponseV2 serverById = ye.getInstance().getServerById((String) split$default.get(1));
if (serverById != null) {
setTo(nf.getDomainJid(serverById.getDomain()));
} else {
this.g = "";
Log.i("AddFriendExtension", "serverById is null");
}
} else {
setTo(ft.getTo());
this.g = str2;
}
this.h = addType;
setType(IQ.Type.set);
setFrom(ft.getFrom());
}
@Override
@NotNull
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(@NotNull IQ.IQChildElementXmlStringBuilder xml) {
kotlin.jvm.internal.r.checkNotNullParameter(xml, "xml");
xml.append(">");
if (this.f4324e) {
Akeychat.AddFriendRequest.b newBuilder = Akeychat.AddFriendRequest.newBuilder();
String str = this.h;
if (str == null) {
kotlin.jvm.internal.r.throwUninitializedPropertyAccessException("mAddType");
str = null;
}
if (kotlin.jvm.internal.r.areEqual("phone", str)) {
newBuilder.setPhonenumber(this.f);
} else {
newBuilder.setUsername(this.g);
}
xml.optElement(HiAnalyticsConstant.Direction.REQUEST, ak.comm.d.encodeBytes(newBuilder.build().toByteArray()));
} else {
xml.optElement("result", this.i);
}
return xml;
}
@Nullable
public final Akeychat.OpBaseResult getMResult() {
return this.i;
}
public final boolean isSuccess() {
Akeychat.OpBaseResult opBaseResult = this.i;
if (opBaseResult != null) {
kotlin.jvm.internal.r.checkNotNull(opBaseResult);
if (opBaseResult.getReturnCode() == 0) {
return true;
}
}
return false;
}
protected final void parseResults(@NotNull XmlPullParser parser) throws Exception {
kotlin.jvm.internal.r.checkNotNullParameter(parser, "parser");
try {
this.i = Akeychat.AddFriendResponse.parseFrom(ak.comm.d.decode(parser.getText())).getResult();
String str = this.f4323d;
StringBuilder sb = new StringBuilder();
sb.append("we get add friend request result:");
sb.append(this.i);
sb.append(",des:");
Akeychat.OpBaseResult opBaseResult = this.i;
kotlin.jvm.internal.r.checkNotNull(opBaseResult);
sb.append((Object) opBaseResult.getDescription());
Log.i(str, sb.toString());
} catch (Exception e2) {
e2.printStackTrace();
}
}
public final void setMResult(@Nullable Akeychat.OpBaseResult opBaseResult) {
this.i = opBaseResult;
}
public g() {
super(f4322c, f4321b);
this.f4323d = "AddFriendExtension";
}
}