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

以下内容为反编译后的 a.java 源代码,内容仅作参考


package com.chinamobile.a;

import android.content.Context;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import android.util.SparseArray;
import com.android.common.speech.LoggingEvents;
import com.chinamobile.c.h;
import com.chinamobile.c.i;
import com.chinamobile.c.j;
import com.chinamobile.contacts.im.mobilecard.view.OneCardGroupAndSettingAc;
import com.chinamobile.e.k;
import com.chinamobile.e.l;
import com.chinamobile.f.m;
import com.chinamobile.o;
import com.huawei.mcs.base.constant.Constant;
import com.huawei.mcs.base.database.DatabaseInfo;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.json.JSONArray;
import org.json.JSONObject;

public class a {

    public static a f1238a = null;

    public static com.chinamobile.d.b f1239b = null;
    public static com.chinamobile.d.a c = null;
    public static boolean d = false;
    public static HashMap<String, String> e = new HashMap<>();
    public static ArrayList<String> f = new ArrayList<>();
    private Context g;

    public a(Context context) {
        this.g = null;
        this.g = context;
    }

    public static synchronized a a(Context context) {
        a aVar;
        synchronized (a.class) {
            if (f1238a == null) {
                f1238a = new a(context);
                f1239b = com.chinamobile.d.b.a(context);
                c = com.chinamobile.d.a.a(context);
                a();
            }
            aVar = f1238a;
        }
        return aVar;
    }

    private static void a() {
        f.add("验证码");
        f.add("动态密码");
        f.add("随机密码");
        f.add("交易码");
        f.add("短信口令");
        f.add("确认码");
        f.add("动态口令");
        f.add("授权码");
        f.add("动态码");
        f.add("动态密匙");
        f.add("校验码");
        f.add("随机短信码");
        f.add("短信随机码");
        f.add("短信密码");
        f.add("短信码");
        f.add("随机码");
        f.add("登录密码");
        f.add("动态短信密码");
        f.add("手机动态码");
        f.add("激活码");
        f.add("校验口令");
        f.add("手机交易码");
        f.add("确认码");
        f.add("尊敬的和通讯录用户,您的密码是");
        f.add("尊敬的和通讯录用户,您的密码是");
    }

    public Map<String, Object> a(Context context, String str, String str2, boolean z) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        if (z) {
            o.f4021a.execute(new b(this));
        }
        b(context);
        if (Pattern.compile("^1\\d{4}$|^(106)\\d{2,8}$|^(10086)\\d{2,5}$|^95[0-9]{3,9}$").matcher(str).find()) {
            HashMap hashMap = new HashMap();
            Iterator<k> it = i.a(context).a(str, str2).iterator();
            while (it.hasNext()) {
                k next = it.next();
                Matcher matcher = Pattern.compile(next.g).matcher(str2);
                if (matcher.matches()) {
                    a(next);
                    if (!z) {
                        Map<String, String> a2 = a(next, matcher, hashMap);
                        hashMap.put("templatename", next.b());
                        a(context, hashMap, next);
                        a(hashMap, next, a2);
                    }
                    a(z, next);
                    return hashMap;
                }
            }
            a(str2, z, str);
            a((k) null);
        }
        return null;
    }

    private void a(boolean z, k kVar) {
        if (z) {
            o.f4021a.execute(new c(this, kVar));
        }
    }

    private void a(String str, boolean z, String str2) {
        if (z) {
            o.f4021a.execute(new d(this, str, str2));
        }
    }

    public void b() {
        try {
            com.chinamobile.b.a aVar = new com.chinamobile.b.a();
            SparseArray<JSONArray> a2 = o.a(com.chinamobile.c.g.a(this.g).a());
            int i = 0;
            while (true) {
                int i2 = i;
                if (i2 < a2.size()) {
                    aVar.c = a2.get(i2);
                    f1239b.a(aVar);
                    SystemClock.sleep(900L);
                    i = i2 + 1;
                } else {
                    return;
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }

    public Map<String, String> a(String str, String str2) {
        String substring;
        String substring2;
        Pattern compile = Pattern.compile("(?<![0-9])([0-9]{4,8})(?![0-9.])");
        try {
            Iterator<String> it = f.iterator();
            while (it.hasNext()) {
                String next = it.next();
                if (str2.contains(next)) {
                    int indexOf = str2.indexOf(next);
                    Log.d("su", "关键字所在的索引----》》" + indexOf);
                    if (indexOf > 15) {
                        substring = str2.substring(indexOf - 15, indexOf);
                    } else {
                        substring = str2.substring(0, indexOf);
                    }
                    String a2 = a(str2, compile, substring);
                    if (str2.length() - indexOf > 15) {
                        substring2 = str2.substring(next.length() + indexOf, next.length() + indexOf + 15);
                    } else {
                        substring2 = str2.substring(next.length() + indexOf, str2.length());
                    }
                    String a3 = a(str2, compile, substring2);
                    if (a2 != null && a3 != null) {
                        if (Math.abs(indexOf - (str2.indexOf(a2) + next.length())) < Math.abs(indexOf - str2.indexOf(a3))) {
                            a3 = a2;
                        }
                    } else if (a2 != null && a3 == null) {
                        a3 = a2;
                    } else if (a2 != null || a3 == null) {
                        a3 = null;
                    }
                    Log.i("su", "keyNuber-------->>>" + a3);
                    String b2 = b(str2, a3);
                    if (a3 == null) {
                        return null;
                    }
                    HashMap hashMap = new HashMap();
                    hashMap.put("_verifycode", a3);
                    hashMap.put("_channelname", b2);
                    hashMap.put(OneCardGroupAndSettingAc.INTENT_TITLE_NAME, next);
                    return hashMap;
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        return null;
    }

    private String b(String str, String str2) {
        Log.d("su", "验证号是否为空--------》》》" + str2);
        String str3 = null;
        if (str2 != null && (str.contains("[") || str.contains("【"))) {
            if (str.contains("[")) {
                str = str.replace("[", "【").replace("]", "】");
            }
            boolean startsWith = str.startsWith("【");
            boolean endsWith = str.endsWith("】");
            if (startsWith && endsWith) {
                String substring = str.substring(str.indexOf("【") + 1, str.indexOf("】"));
                String substring2 = str.substring(str.lastIndexOf("【") + 1, str.lastIndexOf("】"));
                boolean a2 = a(substring);
                boolean a3 = a(substring2);
                int length = substring.length();
                int length2 = substring2.length();
                if (a3 || a2) {
                    if (!a2 && a3) {
                        if (length <= 6) {
                            str3 = substring;
                        }
                    } else if (a3 && !a3 && length2 <= 10) {
                        str3 = substring2;
                    }
                } else if (length <= 6 && length2 <= 10) {
                    if (length < length2) {
                        str3 = substring;
                    } else if (length == length2) {
                        str3 = substring;
                    } else if (length > length2) {
                        str3 = substring2;
                    }
                }
            } else if (startsWith && !endsWith) {
                String substring3 = str.substring(str.indexOf("【") + 1, str.indexOf("】"));
                int length3 = substring3.length();
                if (!a(substring3) && length3 <= 6) {
                    str3 = substring3;
                }
            } else if (!startsWith && endsWith) {
                String substring4 = str.substring(str.lastIndexOf("【") + 1, str.lastIndexOf("】"));
                int length4 = substring4.length();
                if (!a(substring4) && length4 <= 10) {
                    str3 = substring4;
                }
            }
        }
        Log.e("su", "企业名字--------》》》" + str3);
        return str3;
    }

    private boolean a(String str) {
        return Pattern.compile("[0-9]*").matcher(str).matches();
    }

    private String a(String str, Pattern pattern, String str2) {
        String str3 = null;
        Matcher matcher = pattern.matcher(str2);
        while (matcher.find()) {
            str3 = str2.substring(matcher.start(), matcher.end());
        }
        return str3;
    }

    private void a(Context context, Map<String, Object> map, k kVar) {
        ArrayList<l> b2;
        if (kVar.l() != null && (b2 = j.a(this.g).b(kVar.l())) != null && b2.size() > 0) {
            l lVar = b2.get(0);
            map.put("yellowpagename", lVar.b());
            map.put("yellowpagepath", "http://pim.10086.cn/wap/plugs/yellow.php?type=changyong&pageId=" + lVar.a() + "&version=" + com.chinamobile.d.b.g + "&from=" + com.chinamobile.d.b.f + "&uuid=" + com.chinamobile.f.a.a(context) + "&msgtplid=" + kVar.a());
            map.put("yellowpagelogo", "http://s0.cytxl.com.cn/mongo/" + lVar.c() + Constant.Contact.PHOTO_LASTNAME);
        }
    }

    private void a(Map<String, Object> map, k kVar, Map<String, String> map2) {
        com.chinamobile.f.k.a(kVar);
        if (!TextUtils.isEmpty(kVar.n)) {
            com.chinamobile.e.b a2 = com.chinamobile.c.b.a(this.g).a(this.g, kVar, com.chinamobile.c.b.a(this.g).a(com.chinamobile.c.b.a(this.g).b(kVar.n)), map2);
            a(kVar, a2);
            if (a2 != null && !TextUtils.isEmpty(a2.p)) {
                ArrayList arrayList = new ArrayList();
                List<com.chinamobile.e.a> b2 = com.chinamobile.c.a.a(this.g).b(a2.p);
                for (int i = 0; i < b2.size(); i++) {
                    HashMap hashMap = new HashMap();
                    com.chinamobile.e.a aVar = b2.get(i);
                    hashMap.put("act_note", aVar.i);
                    hashMap.put("act_name", aVar.f3825b);
                    if (aVar.g == null) {
                        hashMap.put("act_URL", aVar.g);
                    } else {
                        hashMap.put("act_URL", String.valueOf(aVar.g) + "&version=" + com.chinamobile.d.b.g + "&from=" + com.chinamobile.d.b.f + "&uuid=" + com.chinamobile.f.a.a(this.g) + "&accessmode=SMS_AD&msgtplid=" + kVar.a() + "&adid=" + a2.f3826a);
                    }
                    arrayList.add(hashMap);
                }
                map.put("activity", arrayList);
                com.chinamobile.f.k.a(arrayList, "没有活动");
            }
            if (a2 != null && !TextUtils.isEmpty(a2.o)) {
                ArrayList arrayList2 = new ArrayList();
                ArrayList<com.chinamobile.e.j> b3 = h.a(this.g).b(a2.o);
                for (int i2 = 0; i2 < b3.size(); i2++) {
                    HashMap hashMap2 = new HashMap();
                    com.chinamobile.e.j jVar = b3.get(i2);
                    hashMap2.put("serviceId", jVar.a());
                    hashMap2.put("name", jVar.b());
                    hashMap2.put("subName", jVar.c());
                    hashMap2.put("logo", jVar.e());
                    hashMap2.put(DatabaseInfo.GlobalDbVerColumn.DESC, jVar.d());
                    hashMap2.put("source", jVar.g());
                    hashMap2.put("showType", jVar.h());
                    if (jVar.f() != null) {
                        hashMap2.put("type", jVar.f().a());
                        if (jVar.f().b() == null) {
                            hashMap2.put("path", jVar.f().b());
                        } else {
                            hashMap2.put("path", String.valueOf(jVar.f().b()) + "&version=" + com.chinamobile.d.b.g + "&from=" + com.chinamobile.d.b.f + "&uuid=" + com.chinamobile.f.a.a(this.g) + "&accessmode=SMS_AD&msgtplid=" + kVar.a() + "&adid=" + a2.f3826a);
                        }
                        hashMap2.put("data", jVar.f().c());
                    }
                    arrayList2.add(hashMap2);
                }
                map.put("service", arrayList2);
                com.chinamobile.f.k.b(arrayList2, "没有服务");
            }
        }
    }

    private Map<String, String> a(k kVar, Matcher matcher, Map<String, Object> map) {
        JSONArray jSONArray;
        HashMap hashMap;
        HashMap hashMap2 = null;
        String i = kVar.i();
        if (TextUtils.isEmpty(i)) {
            return null;
        }
        try {
            jSONArray = new JSONArray();
            hashMap = new HashMap();
        } catch (Exception e2) {
            e = e2;
        }
        try {
            JSONArray jSONArray2 = new JSONArray(i);
            for (int i2 = 0; i2 < jSONArray2.length(); i2++) {
                JSONObject jSONObject = new JSONObject();
                com.chinamobile.e.d dVar = new com.chinamobile.e.d();
                JSONObject jSONObject2 = jSONArray2.getJSONObject(i2);
                Iterator<String> keys = jSONObject2.keys();
                while (keys != null && keys.hasNext()) {
                    String next = keys.next();
                    if ("key".equals(next)) {
                        dVar.f3830a = jSONObject2.optString(next);
                    } else if (LoggingEvents.VoiceSearch.EXTRA_QUERY_UPDATED_VALUE.equals(next)) {
                        dVar.f3831b = jSONObject2.optString(next);
                    }
                }
                dVar.f3831b = matcher.group(Integer.parseInt(dVar.f3831b));
                jSONObject.put("key", dVar.f3830a);
                jSONObject.put(LoggingEvents.VoiceSearch.EXTRA_QUERY_UPDATED_VALUE, dVar.f3831b);
                jSONArray.put(jSONObject);
                hashMap.put(dVar.f3830a, dVar.f3831b);
            }
            map.put("keyvaluejson", jSONArray.toString());
            return hashMap;
        } catch (Exception e3) {
            hashMap2 = hashMap;
            e = e3;
            e.printStackTrace();
            return hashMap2;
        }
    }

    public Map<String, Object> a(Context context, String str) {
        HashMap hashMap = new HashMap();
        ArrayList<k> a2 = i.a(context).a(str, "");
        if (a2.size() > 0 && a2.get(0) != null) {
            ArrayList<l> b2 = j.a(this.g).b(a2.get(0).l());
            if (b2.size() > 0 && b2.get(0) != null) {
                hashMap.put("yellowpagesname", b2.get(0).b());
                hashMap.put("yellowpageslogo", "http://s0.cytxl.com.cn/mongo/" + b2.get(0).c() + Constant.Contact.PHOTO_LASTNAME);
                Iterator<l> it = b2.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        break;
                    }
                    l next = it.next();
                    if (next.a() != null) {
                        hashMap.put("yellowpagespath", "http://pim.10086.cn/wap/plugs/yellow.php?type=changyong&pageId=" + next.a() + "&version=" + com.chinamobile.d.b.g + "&from=" + com.chinamobile.d.b.f + "&uuid=" + com.chinamobile.f.a.a(context));
                        break;
                    }
                }
            }
        }
        return hashMap;
    }

    public static void a(Boolean bool) {
        d = bool.booleanValue();
    }

    private static void b(Context context) {
        if (m.a(context).a()) {
            o.f4021a.execute(new e(context));
        }
    }

    public static void a(String str, String str2, String str3) {
        if (d) {
            o.f4021a.execute(new f(str, str2, str3));
        }
    }

    private void a(k kVar, com.chinamobile.e.b bVar) {
        StringBuilder a2 = com.chinamobile.d.c.a(this.g);
        if (bVar != null) {
            a2.append("AD|").append(String.valueOf(kVar.f3842a) + "|").append(String.valueOf(kVar.k) + "|").append(String.valueOf(kVar.l) + "|").append(String.valueOf(kVar.c) + "|").append("1|").append(bVar.f3826a).append(String.valueOf(c()) + "|");
        } else {
            a2.append("AD|").append(String.valueOf(kVar.f3842a) + "|").append(String.valueOf(kVar.k) + "|").append(String.valueOf(kVar.l) + "|").append(String.valueOf(kVar.c) + "|").append("0|").append(String.valueOf(c()) + "|");
        }
        com.chinamobile.d.c.a(this.g, a2.toString());
    }

    private void a(k kVar) {
        o.f4021a.execute(new g(this, kVar));
    }

    public String c() {
        return new SimpleDateFormat("yyyy-MM-dd hh:mm:ss").format(new Date(System.currentTimeMillis()));
    }
}