和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518
以下内容为反编译后的 b.java 源代码,内容仅作参考
package com.chinamobile.d;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import com.chinamobile.c.e;
import com.chinamobile.c.g;
import com.chinamobile.o;
import com.chinamobile.util.d;
import com.chinamobile.util.f;
import com.chinamobile.util.i;
import com.cmcc.sso.sdk.util.SsoSdkConstants;
import com.huawei.mcs.api.McsApi;
import com.huawei.mcs.cloud.msg.base.mms.Telephony;
import com.iflytek.cloud.SpeechConstant;
import java.util.ArrayList;
import java.util.Iterator;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.simpleframework.xml.strategy.Name;
public class b {
public static boolean f3848a = false;
public static String f3849b;
public static b c;
public static a f;
public static String g;
public static String h;
public Context d;
public SQLiteDatabase e;
static {
f3849b = f3848a ? "http://a1.cytxl.com.cn/pim/jsonrpc_api.php" : "http://a.cytxl.com.cn/pim/jsonrpc_api.php";
c = null;
f = null;
g = "mcontact_dxjx_htxl_sdk_android";
h = "1.1.0";
}
public b(Context context) {
this.d = null;
this.e = null;
this.d = context;
this.e = e.b(context);
}
public static synchronized b a(Context context) {
b bVar;
synchronized (b.class) {
if (c == null) {
c = new b(context);
f = a.a(context);
}
bVar = c;
}
return bVar;
}
public String a(com.chinamobile.b.a aVar, String str) {
String str2;
JSONException e;
try {
try {
String a2 = f.a(f3849b, c(aVar, str));
this.e.beginTransaction();
if (a2 != null) {
str2 = f.a(a2, aVar, true);
} else {
a(this.d, aVar);
str2 = null;
}
try {
this.e.setTransactionSuccessful();
} catch (JSONException e2) {
e = e2;
a(this.d, aVar);
e.printStackTrace();
return str2;
}
} catch (JSONException e3) {
str2 = null;
e = e3;
}
return str2;
} finally {
this.e.endTransaction();
}
}
public void a(Context context, com.chinamobile.b.a aVar) {
try {
if (aVar.c != null) {
for (int i = 0; i < aVar.c.length(); i++) {
g.a(context).a(aVar.c.getJSONObject(i).getString("port"), aVar.c.getJSONObject(i).getString("msgContent"));
}
return;
}
g.a(context).a(aVar.f1309a, aVar.f1310b);
} catch (Exception e) {
e.printStackTrace();
}
}
public String b(com.chinamobile.b.a aVar, String str) {
String str2;
JSONException e;
String str3 = null;
try {
String a2 = f.a(f3849b, a(this.d, aVar, str));
this.e.beginTransaction();
if (a2 == null) {
str2 = null;
} else {
try {
str2 = f.a(a2, aVar, false);
} catch (Throwable th) {
th = th;
try {
this.e.endTransaction();
throw th;
} catch (JSONException e2) {
str2 = str3;
e = e2;
e.printStackTrace();
return str2;
}
}
}
} catch (JSONException e3) {
str2 = null;
e = e3;
}
try {
this.e.setTransactionSuccessful();
try {
this.e.endTransaction();
} catch (JSONException e4) {
e = e4;
e.printStackTrace();
return str2;
}
return str2;
} catch (Throwable th2) {
str3 = str2;
th = th2;
this.e.endTransaction();
throw th;
}
}
private String a(Context context, com.chinamobile.b.a aVar, String str) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(Name.MARK, com.chinamobile.util.a.a(4));
jSONObject.put("jsonrpc", McsApi.API_VERSION);
jSONObject.put("method", "sdk/templates/downloadUpdate");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("client_id", "4");
jSONObject2.put(Telephony.BaseMmsColumns.FROM, com.chinamobile.util.a.i(this.d));
jSONObject2.put("version", com.chinamobile.util.a.e(this.d));
jSONObject2.put("device_id", com.chinamobile.util.a.a(context));
jSONObject2.put("terminal", com.chinamobile.util.a.f(context));
jSONObject2.put("attribution", new i(this.d).b("city"));
jSONObject2.put("number", com.chinamobile.util.a.g(context));
jSONObject2.put("area", str);
jSONObject2.put("condition", aVar.c);
jSONObject.put(SpeechConstant.PARAMS, jSONObject2);
return jSONObject.toString();
}
private String c(com.chinamobile.b.a aVar, String str) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(Name.MARK, com.chinamobile.util.a.a(4));
jSONObject.put("jsonrpc", McsApi.API_VERSION);
jSONObject.put("method", "sdk/templates/report");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("client_id", "4");
jSONObject2.put(Telephony.BaseMmsColumns.FROM, com.chinamobile.util.a.i(this.d));
jSONObject2.put("version", com.chinamobile.util.a.e(this.d));
jSONObject2.put("device_id", com.chinamobile.util.a.a(this.d));
jSONObject2.put("terminal", com.chinamobile.util.a.f(this.d));
jSONObject2.put("attribution", new i(this.d).b("city"));
jSONObject2.put("number", com.chinamobile.util.a.g(this.d));
jSONObject2.put("area", str);
if (aVar.c != null) {
jSONObject2.put("condition", aVar.c);
} else {
a(aVar, jSONObject2);
}
jSONObject.put(SpeechConstant.PARAMS, jSONObject2);
return jSONObject.toString();
}
public void a(com.chinamobile.b.a aVar, JSONObject jSONObject) {
try {
JSONObject jSONObject2 = new JSONObject();
JSONArray jSONArray = new JSONArray();
jSONObject2.put("port", aVar.f1309a);
jSONObject2.put("msgContent", aVar.f1310b);
jSONArray.put(jSONObject2);
jSONObject.put("condition", jSONArray);
} catch (Exception e) {
e.printStackTrace();
}
}
public String a(com.chinamobile.b.a aVar) {
String str;
JSONException e;
try {
try {
String a2 = f.a(f3849b, c(aVar));
this.e.beginTransaction();
if (a2 != null) {
String a3 = f.a(a2, aVar, false);
if (a3 != null) {
if (a3 != null) {
try {
} catch (JSONException e2) {
str = a3;
e = e2;
e.printStackTrace();
return str;
}
}
str = a3;
}
d.a(this.d, (Boolean) false);
str = a3;
} else {
d.a(this.d, (Boolean) false);
str = null;
}
} finally {
this.e.endTransaction();
}
} catch (JSONException e3) {
str = null;
e = e3;
}
try {
this.e.setTransactionSuccessful();
} catch (JSONException e4) {
e = e4;
e.printStackTrace();
return str;
}
return str;
}
private String c(com.chinamobile.b.a aVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(Name.MARK, com.chinamobile.util.a.a(4));
jSONObject.put("jsonrpc", McsApi.API_VERSION);
jSONObject.put("method", "sdk/templates/init");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("client_id", "4");
jSONObject2.put(Telephony.BaseMmsColumns.FROM, com.chinamobile.util.a.i(this.d));
jSONObject2.put("version", com.chinamobile.util.a.e(this.d));
jSONObject2.put("device_id", com.chinamobile.util.a.a(this.d));
jSONObject2.put("terminal", com.chinamobile.util.a.f(this.d));
jSONObject2.put("attribution", new i(this.d).b("city"));
jSONObject2.put("number", com.chinamobile.util.a.g(this.d));
if (aVar.d != null) {
jSONObject2.put("condition", aVar.d);
} else {
a(jSONObject2);
}
jSONObject.put(SpeechConstant.PARAMS, jSONObject2);
return jSONObject.toString();
}
public void a(JSONObject jSONObject) {
try {
new JSONArray();
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("ports", o.b(this.d));
jSONObject.put("condition", jSONObject2);
} catch (Exception e) {
e.printStackTrace();
}
}
public String b(com.chinamobile.b.a aVar) {
String str;
Throwable th;
Exception e;
String str2 = null;
try {
try {
try {
String a2 = f.a(f3849b, d(aVar));
try {
try {
this.e.beginTransaction();
if (a2 != null) {
String a3 = f.a(a2, aVar, false);
if (a3 != null) {
if (a3 != null) {
try {
} catch (Exception e2) {
str = a3;
e = e2;
e.printStackTrace();
this.e.endTransaction();
return str;
}
}
str = a3;
}
d.b(this.d, (Boolean) false);
str = a3;
} else {
d.b(this.d, (Boolean) false);
str = null;
}
} catch (Throwable th2) {
th = th2;
try {
this.e.endTransaction();
throw th;
} catch (Exception e3) {
str = str2;
e = e3;
e.printStackTrace();
return str;
}
}
} catch (Exception e4) {
str = null;
e = e4;
}
} catch (Throwable th3) {
str2 = str;
th = th3;
}
} catch (Exception e5) {
str = null;
e = e5;
e.printStackTrace();
return str;
}
} catch (Exception e6) {
e = e6;
e.printStackTrace();
return str;
}
try {
this.e.setTransactionSuccessful();
this.e.endTransaction();
} catch (Exception e7) {
e = e7;
e.printStackTrace();
this.e.endTransaction();
return str;
}
return str;
}
private String d(com.chinamobile.b.a aVar) {
JSONObject jSONObject = new JSONObject();
jSONObject.put(Name.MARK, com.chinamobile.util.a.a(4));
jSONObject.put("jsonrpc", McsApi.API_VERSION);
jSONObject.put("method", "sdk/templates/updateCache");
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("client_id", "4");
jSONObject2.put(Telephony.BaseMmsColumns.FROM, com.chinamobile.util.a.i(this.d));
jSONObject2.put("version", com.chinamobile.util.a.e(this.d));
jSONObject2.put("device_id", com.chinamobile.util.a.a(this.d));
jSONObject2.put("terminal", com.chinamobile.util.a.f(this.d));
jSONObject2.put("attribution", new i(this.d).b("city"));
jSONObject2.put("number", com.chinamobile.util.a.g(this.d));
if (aVar.c == null) {
jSONObject2.put("condition", aVar.c);
b(jSONObject2);
}
jSONObject.put(SpeechConstant.PARAMS, jSONObject2);
return jSONObject.toString();
}
public void b(JSONObject jSONObject) {
new ArrayList();
new ArrayList();
ArrayList arrayList = new ArrayList();
ArrayList<com.chinamobile.e.i> b2 = com.chinamobile.c.i.a(this.d).b("2");
ArrayList<com.chinamobile.e.i> b3 = com.chinamobile.c.i.a(this.d).b(SsoSdkConstants.BUSI_TYPE_SMSLOGIN);
arrayList.addAll(b2);
arrayList.addAll(b3);
JSONArray jSONArray = new JSONArray();
try {
Iterator it = arrayList.iterator();
while (it.hasNext()) {
com.chinamobile.e.i iVar = (com.chinamobile.e.i) it.next();
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put(Name.MARK, iVar.a());
jSONObject2.put("latestOperateTime", iVar.f());
String[] split = iVar.j().split(",");
JSONArray jSONArray2 = new JSONArray();
for (String str : split) {
jSONArray2.put(str);
}
jSONObject2.put("adId", jSONArray2);
jSONArray.put(jSONObject2);
}
jSONObject.put("condition", jSONArray);
} catch (JSONException e) {
e.printStackTrace();
}
}
}