CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e
以下内容为反编译后的 v3.java 源代码,内容仅作参考
package y0;
import ak.im.module.Group;
import ak.im.module.JoinGroupRequestModel;
import ak.im.utils.Log;
import android.util.SparseArray;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smack.provider.IQProvider;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.xmlpull.v1.XmlPullParser;
public class v3 extends IQ {
private static String f48936c = "mucroomname";
private static String f48937d = "reason";
private static String f48938e = "direction";
private static String f48939f = "requester";
private final String f48940a;
private SparseArray<JoinGroupRequestModel> f48941b;
public static class a extends IQProvider {
public static JoinGroupRequestModel createRequestResultFormJson(JSONObject jSONObject) throws Exception {
boolean z10;
String str;
try {
String string = jSONObject.getString(v3.f48936c);
String string2 = jSONObject.getString(v3.f48939f);
String string3 = jSONObject.getString(v3.f48937d);
String string4 = jSONObject.getString(v3.f48938e);
if ("to".equals(string4)) {
String string5 = jSONObject.getString("description");
String string6 = jSONObject.getString("subject");
JSONObject jSONObject2 = new JSONObject(string5);
boolean parseBoolean = Boolean.parseBoolean(jSONObject2.getString(Group.SECURITY));
String string7 = jSONObject2.getString(Group.NEWS);
String string8 = jSONObject2.getString(Group.AVATAR_URL);
boolean z11 = false;
try {
z10 = Boolean.parseBoolean(jSONObject2.getString(Group.ONLY_OWNER_VOICE));
} catch (JSONException unused) {
z10 = false;
}
try {
z11 = Boolean.parseBoolean(jSONObject2.getString(Group.ONLY_AUDIO));
} catch (JSONException unused2) {
}
try {
str = jSONObject.getString("akeyid");
} catch (JSONException unused3) {
str = "";
}
JoinGroupRequestModel joinGroupRequestModel = new JoinGroupRequestModel(string, string2, string3, string4);
joinGroupRequestModel.setSecurity(parseBoolean);
joinGroupRequestModel.setNews(string7);
joinGroupRequestModel.setAvatarUrl(string8);
joinGroupRequestModel.setPushStatus(null);
joinGroupRequestModel.setBannedStatus(z10);
joinGroupRequestModel.setAudioStatus(z11);
joinGroupRequestModel.setmAkeyId(str);
if (string8 != null && string8.length() > 4) {
try {
joinGroupRequestModel.setmAvatar(ak.im.utils.h4.getBitmapFromUrl(string8, 5000));
} catch (Exception unused4) {
Log.w("QueryJoinGroupRequestExtension", "group avatarUrl download failed");
}
} else {
joinGroupRequestModel.setmAvatar(null);
}
joinGroupRequestModel.setmGroupNickname(string6);
return joinGroupRequestModel;
}
return new JoinGroupRequestModel(string, string2, string3, string4);
} catch (Exception e10) {
e10.printStackTrace();
Log.w("QueryJoinGroupRequestExtension", "encounter excp,data maybe error." + e10.getMessage());
throw new RuntimeException("get join-group-request info excp");
}
}
@Override
public IQ parse(XmlPullParser xmlPullParser, int i10) throws Exception {
v3 v3Var = new v3();
boolean z10 = false;
while (!z10) {
int next = xmlPullParser.next();
if (next == 4) {
v3Var.parseResults(xmlPullParser);
} else if (next == 3 && xmlPullParser.getName().equals("mucroom")) {
z10 = true;
}
}
return v3Var;
}
}
public v3() {
super("mucroom", "http://akey.im/protocol/xmpp/iq/mucroom#request_new");
this.f48940a = "QueryJoinGroupRequestExtension";
this.f48941b = new SparseArray<>(10);
}
@Override
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder iQChildElementXmlStringBuilder) {
iQChildElementXmlStringBuilder.append(">");
iQChildElementXmlStringBuilder.optElement(HiAnalyticsConstant.Direction.REQUEST, "");
return iQChildElementXmlStringBuilder;
}
public SparseArray<JoinGroupRequestModel> getmRequests() {
return this.f48941b;
}
protected void parseResults(XmlPullParser xmlPullParser) throws Exception {
try {
JSONArray jSONArray = new JSONArray(xmlPullParser.getText());
for (int i10 = 0; i10 < jSONArray.length(); i10++) {
try {
JoinGroupRequestModel createRequestResultFormJson = a.createRequestResultFormJson(jSONArray.getJSONObject(i10));
if (createRequestResultFormJson != null) {
this.f48941b.put((createRequestResultFormJson.getmSimpleName() + createRequestResultFormJson.getmRequester()).hashCode(), createRequestResultFormJson);
}
} catch (Exception e10) {
e10.printStackTrace();
}
}
} catch (JSONException e11) {
e11.printStackTrace();
Log.w("QueryJoinGroupRequestExtension", "encounter excp in parse results" + e11.getMessage());
} catch (Exception e12) {
Log.w("QueryJoinGroupRequestExtension", "encounter excp in parse results" + e12.getMessage());
}
}
}