和通讯录 v3.9.6版本的 MD5 值为:669178e2ee1b2311daf378bd20c6bbe1

以下内容为反编译后的 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.f.f;
import com.chinamobile.f.l;
import com.huawei.mcs.api.McsApi;
import com.huawei.mcs.cloud.msg.base.mms.Telephony;
import com.iflytek.cloud.SpeechConstant;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.simpleframework.xml.strategy.Name;

public class b {

    public static String f3820a = "http://a.cytxl.com.cn/pim/jsonrpc_api.php";

    public static b f3821b = null;
    public static a e = null;
    public static String f = "mcontact_dxjx_htxl_sdk_android";
    public static String g = "1.1.0";
    public Context c;
    public SQLiteDatabase d;

    public b(Context context) {
        this.c = null;
        this.d = null;
        this.c = context;
        this.d = e.b(context);
    }

    public static synchronized b a(Context context) {
        b bVar;
        synchronized (b.class) {
            if (f3821b == null) {
                f3821b = new b(context);
                e = a.a(context);
            }
            bVar = f3821b;
        }
        return bVar;
    }

    public String a(com.chinamobile.b.a aVar) {
        String str;
        JSONException e2;
        try {
            try {
                String c = c(aVar);
                com.chinamobile.a.a.a("report", "短信模板查询(请求)", c);
                String a2 = f.a(f3820a, c);
                this.d.beginTransaction();
                if (a2 != null) {
                    str = e.a(a2, aVar, true);
                } else {
                    a(this.c, aVar);
                    str = null;
                }
            } catch (JSONException e3) {
                str = null;
                e2 = e3;
            }
            try {
                this.d.setTransactionSuccessful();
            } catch (JSONException e4) {
                e2 = e4;
                a(this.c, aVar);
                e2.printStackTrace();
                return str;
            }
            return str;
        } finally {
            this.d.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.f1250a, aVar.f1251b);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public String b(com.chinamobile.b.a aVar) {
        String str;
        JSONException e2;
        String str2 = null;
        try {
            String b2 = b(this.c, aVar);
            com.chinamobile.a.a.a("downloadUpdate", "短信模板更新(请求)", b2);
            String a2 = f.a(f3820a, b2);
            this.d.beginTransaction();
            if (a2 == null) {
                str = null;
            } else {
                try {
                    str = e.a(a2, aVar, false);
                } catch (Throwable th) {
                    th = th;
                    try {
                        this.d.endTransaction();
                        throw th;
                    } catch (JSONException e3) {
                        str = str2;
                        e2 = e3;
                        e2.printStackTrace();
                        return str;
                    }
                }
            }
            try {
                this.d.setTransactionSuccessful();
                try {
                    this.d.endTransaction();
                } catch (JSONException e4) {
                    e2 = e4;
                    e2.printStackTrace();
                    return str;
                }
            } catch (Throwable th2) {
                str2 = str;
                th = th2;
                this.d.endTransaction();
                throw th;
            }
        } catch (JSONException e5) {
            str = null;
            e2 = e5;
        }
        return str;
    }

    private String b(Context context, com.chinamobile.b.a aVar) {
        JSONObject jSONObject = new JSONObject();
        jSONObject.put(Name.MARK, com.chinamobile.f.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, f);
        jSONObject2.put("version", g);
        jSONObject2.put("device_id", com.chinamobile.f.a.a(context));
        jSONObject2.put("terminal", com.chinamobile.f.a.e(context));
        jSONObject2.put("attribution", new l(this.c).b("city"));
        jSONObject2.put("number", com.chinamobile.f.a.f(context));
        jSONObject2.put("condition", aVar.c);
        jSONObject.put(SpeechConstant.PARAMS, jSONObject2);
        return jSONObject.toString();
    }

    private String c(com.chinamobile.b.a aVar) {
        JSONObject jSONObject = new JSONObject();
        jSONObject.put(Name.MARK, com.chinamobile.f.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, f);
        jSONObject2.put("version", g);
        jSONObject2.put("device_id", com.chinamobile.f.a.a(this.c));
        jSONObject2.put("terminal", com.chinamobile.f.a.e(this.c));
        jSONObject2.put("attribution", new l(this.c).b("city"));
        jSONObject2.put("number", com.chinamobile.f.a.f(this.c));
        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.f1250a);
            jSONObject2.put("msgContent", aVar.f1251b);
            jSONArray.put(jSONObject2);
            jSONObject.put("condition", jSONArray);
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }
}