百度手机卫士 v8.1.5版本的 MD5 值为:15af71eae74e2f2b5b9f845fe77a4804

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


package dxoptimizer;

import android.content.Context;
import android.text.TextUtils;
import android.util.Pair;
import com.baidu.sapi2.utils.SapiUtils;
import com.dianxinos.optimizer.module.netflowmgr.util.Constant;
import com.dianxinos.optimizer.utils.HttpUtils;
import com.quickbird.mini.vpn.vpn.VpnWatchdogThread;
import com.quickbird.sdk.internal.HttpsClient;
import java.io.UnsupportedEncodingException;
import java.net.SocketTimeoutException;
import java.net.URLEncoder;
import java.util.ArrayList;
import org.json.JSONArray;
import org.json.JSONObject;

public class fef {
    public static void a(Context context, String str, String str2, fdr fdrVar) {
        int i;
        int i2;
        String str3;
        String str4 = null;
        if (!hki.c(context)) {
            if (fdrVar != null) {
                fdrVar.a(null, 2);
                return;
            }
            return;
        }
        try {
            try {
                hmb.a(90117);
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("mobile", str);
                jSONObject.put("productCode", str2);
                JSONObject jSONObject2 = new JSONObject();
                long currentTimeMillis = System.currentTimeMillis();
                jSONObject2.put("createTime", currentTimeMillis);
                jSONObject2.put("msg", hbj.a(hbe.b, currentTimeMillis, jSONObject.toString()));
                String jSONObject3 = jSONObject2.toString();
                JSONObject jSONObject4 = new JSONObject(HttpUtils.b(context, hbe.X, jSONObject3, a(jSONObject3)));
                str3 = jSONObject4.optJSONObject("response").optString("orderNumber");
                JSONObject optJSONObject = jSONObject4.optJSONObject("responseHeader");
                int optInt = optJSONObject.optInt("errcode");
                if (optJSONObject != null) {
                    str4 = optJSONObject.toString();
                }
                if (optInt == 200) {
                    i2 = 0;
                } else {
                    String str5 = str4;
                    i2 = 1;
                    str3 = str5;
                }
            } catch (Exception e) {
                if (e instanceof SocketTimeoutException) {
                    i = 3;
                } else {
                    i = 4;
                }
                hmb.a();
                i2 = i;
                str3 = null;
            }
            if (fdrVar != null) {
                fdrVar.a(str3, i2);
            }
        } finally {
            hmb.a();
        }
    }

    private static String a(String str) {
        if (str.length() > 50) {
            str = str.substring(0, 50);
        }
        return "checkStr=" + hji.a(str + "AYUEJ1AWWHKTYENYUG1RP1B52SY5R1OJ");
    }

    public static void a(Context context, String str, fdr fdrVar) {
        int i;
        int i2;
        String str2;
        if (!hki.c(context)) {
            if (fdrVar != null) {
                fdrVar.a(null, 2);
                return;
            }
            return;
        }
        try {
            try {
                hmb.a(90118);
                JSONObject jSONObject = new JSONObject();
                JSONArray jSONArray = new JSONArray();
                jSONArray.put(str);
                jSONObject.put("phones", jSONArray);
                JSONObject jSONObject2 = new JSONObject();
                long currentTimeMillis = System.currentTimeMillis();
                jSONObject2.put("createTime", currentTimeMillis);
                jSONObject2.put("msg", hbj.a(hbe.b, currentTimeMillis, jSONObject.toString()));
                String jSONObject3 = jSONObject2.toString();
                JSONObject jSONObject4 = new JSONObject(HttpUtils.b(context, hbe.ab, jSONObject3, a(jSONObject3)));
                JSONObject optJSONObject = jSONObject4.optJSONObject("responseHeader");
                if (optJSONObject.optInt(VpnWatchdogThread.VPN_WATCHDOG_STATUS) == 200) {
                    str2 = jSONObject4.optJSONObject("response").optJSONObject("datas").optJSONObject(str).getString("operation");
                    i2 = 0;
                } else {
                    str2 = optJSONObject.toString();
                    i2 = 1;
                }
            } catch (Exception e) {
                if (e instanceof SocketTimeoutException) {
                    i = 3;
                } else {
                    i = 4;
                }
                hmb.a();
                i2 = i;
                str2 = null;
            }
            if (fdrVar != null) {
                fdrVar.a(str2, i2);
            }
        } finally {
            hmb.a();
        }
    }

    public static void a(Context context, String str, String str2, String str3, String str4, fdr fdrVar) {
        int i;
        int i2;
        String str5;
        int i3;
        String str6 = null;
        if (!hki.c(context)) {
            if (fdrVar != null) {
                fdrVar.a(null, 2);
                return;
            }
            return;
        }
        try {
            try {
                hmb.a(90119);
                JSONObject jSONObject = new JSONObject();
                jSONObject.put("mobile", str);
                jSONObject.put("productCode", str4);
                jSONObject.put("paymentSmsCode", str2);
                jSONObject.put("orderNumber", str3);
                JSONObject jSONObject2 = new JSONObject();
                long currentTimeMillis = System.currentTimeMillis();
                jSONObject2.put("createTime", currentTimeMillis);
                jSONObject2.put("msg", hbj.a(hbe.b, currentTimeMillis, jSONObject.toString()));
                String jSONObject3 = jSONObject2.toString();
                JSONObject optJSONObject = new JSONObject(HttpUtils.b(context, hbe.ac, jSONObject3, a(jSONObject3))).optJSONObject("responseHeader");
                int optInt = optJSONObject.optInt("errcode");
                if (optJSONObject != null) {
                    str6 = optJSONObject.toString();
                }
                if (optInt == 200) {
                    i3 = 0;
                } else {
                    i3 = 1;
                }
                hmb.a();
                String str7 = str6;
                i2 = i3;
                str5 = str7;
            } catch (Exception e) {
                if (e instanceof SocketTimeoutException) {
                    i = 3;
                } else {
                    i = 4;
                }
                hmb.a();
                i2 = i;
                str5 = null;
            }
            if (fdrVar != null) {
                fdrVar.a(str5, i2);
            }
        } catch (Throwable th) {
            hmb.a();
            throw th;
        }
    }

    public static void a(Context context, String[] strArr, fdr fdrVar) {
        int i;
        String str;
        etk etkVar;
        etk etkVar2 = null;
        int i2 = 4;
        int i3 = 0;
        JSONObject a = fee.a(strArr);
        if (hki.c(context)) {
            try {
                try {
                    JSONObject b = b(a.toString());
                    if (b != null) {
                        hmb.a(90112);
                        str = HttpUtils.b(context, a(), b.toString());
                    } else {
                        str = null;
                    }
                    if (str != null) {
                        JSONObject c = c(str);
                        if (c == null) {
                            fdrVar.a(null, 1);
                            return;
                        }
                        if (c.getString("result").equals(String.valueOf(1))) {
                            JSONObject jSONObject = (JSONObject) new JSONArray(c.getJSONArray("detailinfo").toString()).get(0);
                            String string = jSONObject.getString("warncode");
                            if (string.equals("0")) {
                                try {
                                    etkVar = fee.a(jSONObject);
                                    i = 0;
                                } catch (Exception e) {
                                    e = e;
                                    if (e instanceof SocketTimeoutException) {
                                        i2 = 3;
                                    } else if (e instanceof HttpUtils.HttpStatusException) {
                                        i2 = ((HttpUtils.HttpStatusException) e).getStatusCode() == 404 ? 5 : i3;
                                    }
                                    hmb.a();
                                    i = i2;
                                    if (fdrVar == null) {
                                    }
                                }
                            } else if (string.equals(com.baidu.location.c.d.ai)) {
                                i = 7;
                                etkVar = null;
                            } else if (string.equals("2")) {
                                i = 8;
                                etkVar = null;
                            } else {
                                i = 4;
                                etkVar = null;
                            }
                            hmb.a();
                            etkVar2 = etkVar;
                        }
                    }
                    i = 1;
                    etkVar = null;
                    hmb.a();
                    etkVar2 = etkVar;
                } catch (Exception e2) {
                    e = e2;
                    i3 = 1;
                }
            } finally {
                hmb.a();
            }
        } else {
            i = 2;
        }
        if (fdrVar == null) {
            fdrVar.a(etkVar2, i);
        }
    }

    public static void a(Context context, etk etkVar, String str, fdr fdrVar) {
        etk etkVar2;
        Exception e;
        int i;
        etk etkVar3;
        String str2;
        int i2 = 1;
        JSONObject a = fee.a(context, etkVar, str);
        if (hki.c(context)) {
            try {
                try {
                    JSONObject b = b(a.toString());
                    if (b != null) {
                        hmb.a(90113);
                        str2 = HttpUtils.b(context, a(), b.toString());
                    } else {
                        str2 = null;
                    }
                    if (str2 != null) {
                        JSONObject c = c(str2);
                        if (c == null) {
                            fdrVar.a(null, 1);
                            return;
                        }
                        if (c.getString("result").equals(String.valueOf(1))) {
                            String string = c.getString("errcode");
                            if (string.equals(String.valueOf(304002))) {
                                etkVar2 = fee.a(new JSONArray(c.getJSONArray("detailinfo").toString()), etkVar);
                                try {
                                    String string2 = c.getString("extparam");
                                    if (!TextUtils.isEmpty(string2)) {
                                        euf.a(context).a(etkVar.a, str, string2);
                                    }
                                    euf.a(context).a(string2, etkVar.a, etkVar.h);
                                    i = 0;
                                    etkVar3 = etkVar2;
                                } catch (Exception e2) {
                                    e = e2;
                                    if (e instanceof SocketTimeoutException) {
                                        i2 = 3;
                                    } else if (!(e instanceof HttpUtils.HttpStatusException)) {
                                        i2 = 4;
                                    } else if (((HttpUtils.HttpStatusException) e).getStatusCode() == 404) {
                                        i2 = 5;
                                    }
                                    hmb.a();
                                    i = i2;
                                    etkVar3 = etkVar2;
                                    if (fdrVar == null) {
                                    }
                                }
                            } else if (string.equals(String.valueOf(304001))) {
                                etkVar3 = euf.a(context).a(etkVar, str);
                                i = 6;
                            }
                        }
                    }
                    etkVar3 = null;
                    i = 1;
                } catch (Exception e3) {
                    etkVar2 = null;
                    e = e3;
                }
            } finally {
                hmb.a();
            }
        } else {
            etkVar3 = null;
            i = 2;
        }
        if (fdrVar == null) {
            fdrVar.a(etkVar3, i);
        }
    }

    public static void a(Context context, etk etkVar, String str, String str2, String str3, fdr fdrVar) {
        Object obj;
        JSONObject c;
        int i = 1;
        if (fdrVar == null) {
            throw new RuntimeException("call back object not allow null.");
        }
        if (context == null || etkVar == null || str == null || str2 == null || str3 == null) {
            fdrVar.a(null, 4);
        }
        if (!hki.c(context)) {
            fdrVar.a(null, 2);
            return;
        }
        JSONObject a = fee.a(context, etkVar, str, str2, str3);
        if (a == null) {
            fdrVar.a(null, 4);
            return;
        }
        try {
            try {
                hmb.a(90114);
                c = c(HttpUtils.b(context, a(), b(a.toString()).toString()));
            } catch (Exception e) {
                i = e instanceof SocketTimeoutException ? 3 : 4;
                hmb.a();
                obj = null;
            }
            if (c == null) {
                fdrVar.a(null, 1);
                return;
            }
            if (c.getString("result").equals(String.valueOf(1))) {
                obj = fee.b(c.getJSONObject("detailinfo"));
                if (obj != null) {
                    i = 0;
                } else {
                    obj = null;
                }
            } else {
                obj = c.getString("errcode");
            }
            fdrVar.a(obj, i);
        } finally {
            hmb.a();
        }
    }

    public static void a(Context context, String str, String str2) {
        JSONObject a;
        if (context != null && str != null && str2 != null && hki.c(context) && (a = fee.a(str, str2)) != null) {
            try {
                hmb.a(90115);
                HttpUtils.b(context, a(), b(a.toString()).toString());
            } catch (Exception e) {
                e.printStackTrace();
            } finally {
                hmb.a();
            }
        }
    }

    public static void b(Context context, String str, fdr fdrVar) {
        etf etfVar;
        etf etfVar2 = null;
        int i = 1;
        if (context == null || str == null || fdrVar == null) {
            fdrVar.a(null, 4);
            return;
        }
        if (!hki.c(context)) {
            fdrVar.a(null, 2);
            return;
        }
        JSONObject a = fee.a(str);
        if (a != null) {
            try {
                hmb.a(90120);
                JSONObject c = c(HttpUtils.b(context, a(), b(a.toString()).toString()));
                if (c == null) {
                    fdrVar.a(null, 1);
                    return;
                }
                String string = c.getString("result");
                if (string == null) {
                    fdrVar.a(null, 1);
                    return;
                }
                if (string.equals(String.valueOf(1))) {
                    JSONObject optJSONObject = c.optJSONObject("detailinfo");
                    if (optJSONObject != null) {
                        etf etfVar3 = new etf();
                        fee.a(etfVar3, optJSONObject);
                        if (!TextUtils.isEmpty(etfVar3.a) && !TextUtils.isEmpty(etfVar3.b) && !TextUtils.isEmpty(etfVar3.c) && !TextUtils.isEmpty(etfVar3.d) && !TextUtils.isEmpty(etfVar3.e) && !TextUtils.isEmpty(etfVar3.f) && !TextUtils.isEmpty(etfVar3.g) && !TextUtils.isEmpty(etfVar3.h)) {
                            Pair a2 = hje.a(context, etfVar3.a);
                            etfVar3.i = (String) a2.first;
                            etfVar3.j = (String) a2.second;
                        }
                        etfVar = etfVar3;
                    } else {
                        etfVar = null;
                    }
                    etfVar2 = etfVar;
                    i = 0;
                }
            } catch (Exception e) {
                i = e instanceof SocketTimeoutException ? 3 : 4;
            } finally {
                hmb.a();
            }
        }
        fdrVar.a(etfVar2, i);
    }

    public static void c(Context context, String str, fdr fdrVar) {
        ArrayList arrayList;
        ArrayList arrayList2 = null;
        int i = 1;
        if (context == null || str == null || fdrVar == null) {
            fdrVar.a(null, 4);
            return;
        }
        if (!hki.c(context)) {
            fdrVar.a(null, 2);
            return;
        }
        JSONObject b = fee.b(str);
        if (b != null) {
            try {
                hmb.a(90116);
                JSONObject c = c(HttpUtils.b(context, a(), b(b.toString()).toString()));
                if (c == null) {
                    fdrVar.a(null, 1);
                    return;
                }
                String string = c.getString("result");
                if (string == null) {
                    fdrVar.a(null, 1);
                    return;
                }
                if (string.equals(String.valueOf(1))) {
                    JSONArray optJSONArray = c.optJSONArray("detailinfo");
                    if (optJSONArray == null) {
                        fdrVar.a(null, 1);
                        return;
                    }
                    int length = optJSONArray.length();
                    if (length != 0) {
                        ArrayList arrayList3 = new ArrayList();
                        for (int i2 = 0; i2 < length; i2++) {
                            JSONObject jSONObject = (JSONObject) optJSONArray.get(i2);
                            etf etfVar = new etf();
                            fee.a(etfVar, jSONObject);
                            if (!TextUtils.isEmpty(etfVar.a) && !TextUtils.isEmpty(etfVar.b) && !TextUtils.isEmpty(etfVar.c) && !TextUtils.isEmpty(etfVar.d) && !TextUtils.isEmpty(etfVar.e) && !TextUtils.isEmpty(etfVar.f) && !TextUtils.isEmpty(etfVar.g) && !TextUtils.isEmpty(etfVar.h)) {
                                Pair a = hje.a(context, etfVar.a);
                                etfVar.i = (String) a.first;
                                etfVar.j = (String) a.second;
                                arrayList3.add(etfVar);
                            }
                        }
                        arrayList = arrayList3;
                    } else {
                        arrayList = null;
                    }
                    arrayList2 = arrayList;
                    i = 0;
                }
            } catch (Exception e) {
                i = e instanceof SocketTimeoutException ? 3 : 4;
            } finally {
                hmb.a();
            }
        }
        fdrVar.a(arrayList2, i);
    }

    private static JSONObject b(String str) {
        long currentTimeMillis = System.currentTimeMillis();
        JSONObject jSONObject = new JSONObject();
        String a = fed.a(str, Constant.b);
        String a2 = fed.a(new String[]{Constant.a, a, String.valueOf(currentTimeMillis)});
        jSONObject.put("partid", Constant.a);
        jSONObject.put("data", a);
        jSONObject.put(SapiUtils.KEY_QR_LOGIN_SIGN, a2);
        jSONObject.put("time", currentTimeMillis);
        return jSONObject;
    }

    private static JSONObject c(String str) {
        JSONObject jSONObject;
        String string;
        String string2;
        String string3;
        String string4;
        if (str == null) {
            return null;
        }
        try {
            JSONObject jSONObject2 = new JSONObject(str);
            string = jSONObject2.getString(SapiUtils.KEY_QR_LOGIN_SIGN);
            string2 = jSONObject2.getString("partid");
            string3 = jSONObject2.getString("data");
            string4 = jSONObject2.getString("time");
        } catch (Exception e) {
            e.printStackTrace();
        }
        if (!TextUtils.isEmpty(string) && !TextUtils.isEmpty(string2) && !TextUtils.isEmpty(string3) && !TextUtils.isEmpty(string4)) {
            String a = fed.a(new String[]{string2, string3, string4});
            if (!TextUtils.isEmpty(a) && a.equals(string)) {
                jSONObject = new JSONObject(fed.b(string3, Constant.b));
                return jSONObject;
            }
        }
        jSONObject = null;
        return jSONObject;
    }

    private static String a() {
        try {
            StringBuilder sb = new StringBuilder();
            sb.append("https://shoujiweishi.baidu.com/rtsapi/2.0/rd").append("?").append("url").append("=").append(URLEncoder.encode(hbe.ag, HttpsClient.HTTP_CHARSET));
            return sb.toString();
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return null;
        }
    }
}