和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518

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


package com.chinamobile.a;

import android.content.Context;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.SparseArray;
import com.android.common.speech.LoggingEvents;
import com.chinamobile.contacts.im.data.ContactAccessor;
import com.chinamobile.contacts.im.mms2.utils.ParseSmsUtil;
import com.chinamobile.contacts.im.mobilecard.view.OneCardGroupAndSettingAc;
import com.chinamobile.e.h;
import com.chinamobile.e.i;
import com.chinamobile.e.j;
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 f1297a = null;

    public static com.chinamobile.d.b f1298b = 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 (f1297a == null) {
                f1297a = new a(context);
                f1298b = com.chinamobile.d.b.a(context);
                c = com.chinamobile.d.a.a(context);
                b();
            }
            aVar = f1297a;
        }
        return aVar;
    }

    private static void b() {
        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("尊敬的和通讯录用户,您的密码是");
        f.add("尊敬的和通讯录用户,您的密码是");
    }

    public Map<String, Object> a(Context context, String str, String str2, boolean z, String str3) {
        if (TextUtils.isEmpty(str)) {
            return null;
        }
        if (z) {
            o.f4058a.execute(new b(this));
        }
        b(context);
        a("SmsParsingManager", "SmsParsing", "isDEBUG:" + d);
        if (d) {
            str = b(str, str2);
        }
        if (Pattern.compile(ParseSmsUtil.match).matcher(str).find()) {
            HashMap hashMap = new HashMap();
            Iterator<i> it = com.chinamobile.c.i.a(context).a(str, str2).iterator();
            while (it.hasNext()) {
                i next = it.next();
                Matcher matcher = Pattern.compile(next.g, 32).matcher(str2);
                if (matcher.matches()) {
                    a(next);
                    Map<String, String> a2 = a(next, matcher, hashMap);
                    hashMap.put("templatename", next.b());
                    a(context, hashMap, next);
                    a(hashMap, next, a2);
                    a(z, next, str3);
                    return hashMap;
                }
            }
            a(str2, z, str, str3);
            a((i) null);
        }
        return null;
    }

    private void a(boolean z, i iVar, String str) {
        if (z) {
            o.f4058a.execute(new c(this, iVar, str));
        }
    }

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

    public void a(String str) {
        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);
                    f1298b.a(aVar, str);
                    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);
                    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;
                    }
                    String c2 = c(str2, a3);
                    if (a3 == null) {
                        return null;
                    }
                    HashMap hashMap = new HashMap();
                    hashMap.put("_verifycode", a3);
                    hashMap.put("_channelname", c2);
                    hashMap.put(OneCardGroupAndSettingAc.INTENT_TITLE_NAME, next);
                    return hashMap;
                }
            }
        } catch (Exception e2) {
            e2.printStackTrace();
        }
        return null;
    }

    private String c(String str, String str2) {
        if (str2 == null) {
            return null;
        }
        if (!str.contains("[") && !str.contains("【")) {
            return null;
        }
        if (str.contains("[")) {
            str = str.replace("[", "【").replace("]", "】");
        }
        boolean startsWith = str.startsWith("【");
        boolean endsWith = str.endsWith("】");
        if (!startsWith || !endsWith) {
            if (startsWith && !endsWith) {
                String substring = str.substring(str.indexOf("【") + 1, str.indexOf("】"));
                int length = substring.length();
                if (b(substring) || length > 6) {
                    return null;
                }
                return substring;
            }
            if (startsWith || !endsWith) {
                return null;
            }
            String substring2 = str.substring(str.lastIndexOf("【") + 1, str.lastIndexOf("】"));
            int length2 = substring2.length();
            if (b(substring2) || length2 > 10) {
                return null;
            }
            return substring2;
        }
        String substring3 = str.substring(str.indexOf("【") + 1, str.indexOf("】"));
        String substring4 = str.substring(str.lastIndexOf("【") + 1, str.lastIndexOf("】"));
        boolean b2 = b(substring3);
        boolean b3 = b(substring4);
        int length3 = substring3.length();
        int length4 = substring4.length();
        if (!b3 && !b2) {
            if (length3 > 6 || length4 > 10) {
                return null;
            }
            if (length3 >= length4 && length3 != length4) {
                if (length3 > length4) {
                    return substring4;
                }
                return null;
            }
            return substring3;
        }
        if (!b2 && b3) {
            if (length3 <= 6) {
                return substring3;
            }
            return null;
        }
        if (!b3 || b3 || length4 > 10) {
            return null;
        }
        return substring4;
    }

    private boolean b(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;
    }

    public static String b(String str, String str2) {
        if (e != null && !e.isEmpty()) {
            if (str.startsWith(ContactAccessor.PHONE_PREFIX1)) {
                str = str.substring(3);
            }
            if (e.containsKey(str) && e.get(str) != null) {
                return e.get(str);
            }
        }
        return str;
    }

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

    private void a(Map<String, Object> map, i iVar, Map<String, String> map2) {
        com.chinamobile.util.g.a(iVar);
        if (!TextUtils.isEmpty(iVar.n)) {
            com.chinamobile.e.b a2 = com.chinamobile.c.b.a(this.g).a(this.g, iVar, com.chinamobile.c.b.a(this.g).a(com.chinamobile.c.b.a(this.g).b(iVar.n)), map2);
            a(iVar, 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);
                if (b2 != null) {
                    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.f3853b);
                        if (aVar.g == null) {
                            hashMap.put("act_URL", aVar.g);
                        } else {
                            hashMap.put("act_URL", String.valueOf(aVar.g) + "&version=" + com.chinamobile.util.a.e(this.g) + "&from=" + com.chinamobile.util.a.i(this.g) + "&uuid=" + com.chinamobile.util.a.a(this.g) + "&accessmode=SMS_AD&msgtplid=" + iVar.a() + "&adid=" + a2.f3854a);
                            hashMap.put("act_url_title", aVar.j);
                            hashMap.put("act_url_summary", aVar.k);
                            hashMap.put("act_url_thumb", aVar.l);
                        }
                        arrayList.add(hashMap);
                    }
                    map.put("activity", arrayList);
                    com.chinamobile.util.g.a(arrayList, "没有活动");
                }
            }
            if (a2 != null && !TextUtils.isEmpty(a2.o)) {
                ArrayList arrayList2 = new ArrayList();
                ArrayList<h> b3 = com.chinamobile.c.h.a(this.g).b(a2.o);
                for (int i2 = 0; i2 < b3.size(); i2++) {
                    HashMap hashMap2 = new HashMap();
                    h hVar = b3.get(i2);
                    hashMap2.put("serviceId", hVar.a());
                    hashMap2.put("name", hVar.b());
                    hashMap2.put("subName", hVar.c());
                    hashMap2.put("logo", hVar.e());
                    hashMap2.put(DatabaseInfo.GlobalDbVerColumn.DESC, hVar.d());
                    hashMap2.put("source", hVar.g());
                    hashMap2.put("showType", hVar.h());
                    if (hVar.f() != null) {
                        hashMap2.put("type", hVar.f().a());
                        if (hVar.f().b() == null) {
                            hashMap2.put("path", hVar.f().b());
                        } else {
                            hashMap2.put("path", String.valueOf(hVar.f().b()) + "&version=" + com.chinamobile.util.a.e(this.g) + "&from=" + com.chinamobile.util.a.i(this.g) + "&uuid=" + com.chinamobile.util.a.a(this.g) + "&accessmode=SMS_AD&msgtplid=" + iVar.a() + "&adid=" + a2.f3854a);
                        }
                        hashMap2.put("data", hVar.f().c());
                    }
                    arrayList2.add(hashMap2);
                }
                map.put("service", arrayList2);
                com.chinamobile.util.g.b(arrayList2, "没有服务");
            }
        }
    }

    private Map<String, String> a(i iVar, Matcher matcher, Map<String, Object> map) {
        String[] split;
        HashMap hashMap = null;
        String i = iVar.i();
        if (TextUtils.isEmpty(i)) {
            return null;
        }
        try {
            JSONArray jSONArray = new JSONArray();
            HashMap hashMap2 = new HashMap();
            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.f3858a = jSONObject2.optString(next);
                        } else if (LoggingEvents.VoiceSearch.EXTRA_QUERY_UPDATED_VALUE.equals(next)) {
                            dVar.f3859b = jSONObject2.optString(next);
                        }
                    }
                    if (dVar.f3859b.contains(",") || dVar.f3859b.contains("-")) {
                        StringBuffer stringBuffer = new StringBuffer();
                        if (dVar.f3859b.contains(",")) {
                            split = dVar.f3859b.split(",");
                        } else {
                            split = dVar.f3859b.contains("-") ? dVar.f3859b.split("-") : null;
                        }
                        for (String str : split) {
                            stringBuffer.append(matcher.group(Integer.parseInt(str)));
                        }
                        dVar.f3859b = stringBuffer.toString();
                        jSONObject.put("key", dVar.f3858a);
                        jSONObject.put(LoggingEvents.VoiceSearch.EXTRA_QUERY_UPDATED_VALUE, dVar.f3859b);
                        jSONArray.put(jSONObject);
                        hashMap2.put(dVar.f3858a, dVar.f3859b);
                    } else {
                        dVar.f3859b = matcher.group(Integer.parseInt(dVar.f3859b));
                        jSONObject.put("key", dVar.f3858a);
                        jSONObject.put(LoggingEvents.VoiceSearch.EXTRA_QUERY_UPDATED_VALUE, dVar.f3859b);
                        jSONArray.put(jSONObject);
                        hashMap2.put(dVar.f3858a, dVar.f3859b);
                    }
                }
                map.put("keyvaluejson", jSONArray.toString());
                return hashMap2;
            } catch (Exception e2) {
                e = e2;
                hashMap = hashMap2;
                e.printStackTrace();
                return hashMap;
            }
        } catch (Exception e3) {
            e = e3;
        }
    }

    public Map<String, Object> a(Context context, String str) {
        HashMap hashMap = new HashMap();
        ArrayList<i> a2 = com.chinamobile.c.i.a(context).a(str, "");
        if (a2.size() > 0 && a2.get(0) != null) {
            ArrayList<j> b2 = com.chinamobile.c.j.a(this.g).b(a2.get(0).m());
            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<j> it = b2.iterator();
                while (true) {
                    if (!it.hasNext()) {
                        break;
                    }
                    j 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.util.a.e(this.g) + "&from=" + com.chinamobile.util.a.i(this.g) + "&uuid=" + com.chinamobile.util.a.a(context));
                        break;
                    }
                }
            }
        }
        return hashMap;
    }

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

    private static void b(Context context) {
        if (com.chinamobile.util.j.a(context).a()) {
            o.f4058a.execute(new e(context));
        }
    }

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

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

    private void a(i iVar) {
        try {
            o.f4058a.execute(new g(this, iVar));
        } catch (Exception e2) {
        }
    }

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

    public void a() {
        com.chinamobile.util.d.b(this.g, System.currentTimeMillis());
        com.chinamobile.util.d.b(this.g, (Boolean) true);
        com.chinamobile.d.b.a(this.g).b(new com.chinamobile.b.a());
    }
}