CarrotChat v2.8.80.240429版本的 MD5 值为:fdf98761f01e715a89df24b85b0d206e
以下内容为反编译后的 y2.java 源代码,内容仅作参考
package y0;
import ak.im.BuildConfig;
import ak.im.module.GroupUser;
import ak.im.sdk.manager.BadgeManager;
import ak.im.utils.Log;
import ak.push.AKPushManager;
import android.text.TextUtils;
import com.alibaba.fastjson.JSONObject;
import com.huawei.hms.support.hianalytics.HiAnalyticsConstant;
import com.kinggrid.iapppdf.droids.mupdf.codec.cosobject.PdfBoolean;
import org.jivesoftware.smack.packet.IQ;
import org.jivesoftware.smackx.disco.packet.DiscoverItems;
public class y2 extends IQ {
private static String f49042u = "pushServiceType";
private final String f49043a;
private final String f49044b;
private final String f49045c;
private final String f49046d;
private final String f49047e;
private final String f49048f;
private final String f49049g;
private final String f49050h;
private final String f49051i;
private String f49052j;
private String f49053k;
private String f49054l;
private boolean f49055m;
private boolean f49056n;
private String f49057o;
private boolean f49058p;
private boolean f49059q;
private boolean f49060r;
private boolean f49061s;
private boolean f49062t;
public y2(boolean z10, String str) {
super("xiaomipush", "http://akey.im/protocol/xmpp/iq/xiaomipush");
this.f49043a = "PushClientExtension";
this.f49044b = GroupUser.USER_NAME;
this.f49045c = "phonetype";
this.f49046d = "operation";
this.f49047e = "android";
this.f49048f = "add";
this.f49049g = DiscoverItems.Item.REMOVE_ACTION;
this.f49050h = "chat";
this.f49051i = "away";
this.f49052j = "deviceToken";
this.f49053k = "pushKitDeviceToken";
this.f49054l = "supportMCU";
this.f49055m = false;
this.f49056n = true;
this.f49058p = true;
this.f49059q = true;
this.f49060r = true;
this.f49061s = true;
this.f49062t = false;
this.f49057o = str;
setType(IQ.Type.set);
setTo(ak.im.sdk.manager.f1.getInstance().getServer().getXmppDomain());
setFrom(ak.im.utils.q5.getJidByName(ak.im.sdk.manager.f1.getInstance().getUsername()));
this.f49055m = z10;
a();
}
void a() {
this.f49059q = ak.im.sdk.manager.f1.getInstance().isNormalMessageSwitch();
this.f49060r = ak.im.sdk.manager.f1.getInstance().isSipMessageSwitch();
this.f49058p = ak.im.sdk.manager.f1.getInstance().isSipMessageSwitch();
}
String b(String str) {
if (!BadgeManager.MANUFACTURER_OF_HARDWARE_HUAWEI.equals(str) && !"oppo".equals(str) && !BadgeManager.MANUFACTURER_OF_HARDWARE_VIVO.equals(str) && !"meizu".equals(str) && !"fcm".equals(str)) {
return "xiaomi";
}
return str;
}
@Override
protected IQ.IQChildElementXmlStringBuilder getIQChildElementBuilder(IQ.IQChildElementXmlStringBuilder iQChildElementXmlStringBuilder) {
String str;
String str2;
String str3;
iQChildElementXmlStringBuilder.append(">");
if (!TextUtils.isEmpty(this.f49057o)) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(GroupUser.USER_NAME, (Object) ak.im.sdk.manager.f1.getInstance().getUsername());
if (this.f49055m) {
jSONObject.put("operation", (Object) "add");
jSONObject.put("phonetype", (Object) "android");
String str4 = "";
jSONObject.put(this.f49053k, (Object) "");
jSONObject.put("product_type", (Object) BuildConfig.PRODUCT_TYPE);
if (!"xiaomi".equals(b(this.f49057o))) {
jSONObject.put(f49042u, (Object) b(this.f49057o));
}
String str5 = AKPushManager.INSTANCE.getInstance().getCom.meizu.cloud.pushsdk.constants.PushConstants.KEY_PUSH_ID java.lang.String();
jSONObject.put(this.f49052j, (Object) str5);
jSONObject.put("supportDesktopVoip", (Object) Boolean.TRUE);
jSONObject.put("im_push_type", (Object) b(this.f49057o));
jSONObject.put("im_push_token", (Object) str5);
jSONObject.put("cp_resend_count", (Object) 2);
jSONObject.put("cp_resend_interval", (Object) 20);
if (!"fcm".equals(this.f49057o)) {
str2 = "xiaomi";
} else {
str2 = "fcm_data";
}
jSONObject.put("call_push_type", (Object) str2);
if (!"fcm".equals(this.f49057o)) {
str3 = "";
} else {
str3 = str5;
}
jSONObject.put("call_push_token", (Object) str3);
jSONObject.put("supportIM", (Object) Boolean.valueOf(this.f49059q));
jSONObject.put("supportVoIP", (Object) Boolean.valueOf(this.f49058p));
jSONObject.put(this.f49054l, (Object) Boolean.valueOf(this.f49060r));
if ("xiaomi".equals(this.f49057o)) {
str4 = str5;
}
jSONObject.put("call_push_token_xiaomi", (Object) str4);
jSONObject.put("version", (Object) ak.im.sdk.manager.f1.getInstance().getVersion());
jSONObject.put("package", (Object) BuildConfig.PRODUCT_PKG_NAME);
if (this.f49062t) {
jSONObject.put("feedback", (Object) PdfBoolean.TRUE);
}
} else {
jSONObject.put("operation", (Object) DiscoverItems.Item.REMOVE_ACTION);
}
Log.debug("xiaomipush", jSONObject.toJSONString());
iQChildElementXmlStringBuilder.optElement(HiAnalyticsConstant.Direction.REQUEST, jSONObject.toString());
} else if (this.f49055m) {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put(GroupUser.USER_NAME, (Object) ak.im.sdk.manager.f1.getInstance().getUsername());
if (this.f49056n) {
str = "chat";
} else {
str = "away";
}
jSONObject2.put("operation", (Object) str);
jSONObject2.put("phonetype", (Object) "android");
iQChildElementXmlStringBuilder.optElement(HiAnalyticsConstant.Direction.REQUEST, jSONObject2.toString());
Log.i("PushClientExtension", "generate online status push iq " + this.f49056n);
} else {
Log.i("PushClientExtension", "invalid push iq params: online " + this.f49055m + ", type " + this.f49057o + ", gochat " + this.f49056n);
}
return iQChildElementXmlStringBuilder;
}
public void setFeedback(boolean z10) {
this.f49062t = z10;
}
public void setNormalPush(boolean z10) {
this.f49061s = z10;
}
public void setSupportIM(boolean z10) {
this.f49059q = z10;
}
public void setSupportMcu(boolean z10) {
this.f49060r = z10;
}
public void setSupportVoIP(boolean z10) {
this.f49058p = z10;
}
public y2(boolean z10) {
super("xiaomipush", "http://akey.im/protocol/xmpp/iq/xiaomipush");
this.f49043a = "PushClientExtension";
this.f49044b = GroupUser.USER_NAME;
this.f49045c = "phonetype";
this.f49046d = "operation";
this.f49047e = "android";
this.f49048f = "add";
this.f49049g = DiscoverItems.Item.REMOVE_ACTION;
this.f49050h = "chat";
this.f49051i = "away";
this.f49052j = "deviceToken";
this.f49053k = "pushKitDeviceToken";
this.f49054l = "supportMCU";
this.f49055m = false;
this.f49056n = true;
this.f49058p = true;
this.f49059q = true;
this.f49060r = true;
this.f49061s = true;
this.f49062t = false;
setType(IQ.Type.set);
setTo(ak.im.sdk.manager.f1.getInstance().getServer().getXmppDomain());
setFrom(ak.im.utils.q5.getJidByName(ak.im.sdk.manager.f1.getInstance().getUsername()));
this.f49055m = true;
this.f49056n = z10;
a();
}
public y2() {
super("xiaomipush", "http://akey.im/protocol/xmpp/iq/xiaomipush");
this.f49043a = "PushClientExtension";
this.f49044b = GroupUser.USER_NAME;
this.f49045c = "phonetype";
this.f49046d = "operation";
this.f49047e = "android";
this.f49048f = "add";
this.f49049g = DiscoverItems.Item.REMOVE_ACTION;
this.f49050h = "chat";
this.f49051i = "away";
this.f49052j = "deviceToken";
this.f49053k = "pushKitDeviceToken";
this.f49054l = "supportMCU";
this.f49055m = false;
this.f49056n = true;
this.f49058p = true;
this.f49059q = true;
this.f49060r = true;
this.f49061s = true;
this.f49062t = false;
}
}