百度手机卫士 v8.4.5版本的 MD5 值为:c65ef854a40bb6200c4d8c4603c58403

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


package dxoptimizer;

import android.content.Context;
import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import com.baidu.sapi2.utils.SapiUtils;
import com.baidu.security.plugin.alarm.AlarmUtil;
import com.dianxinos.optimizer.utils.HttpUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class czh {
    private Context a;

    public czh(Context context) {
        this.a = context.getApplicationContext();
    }

    public void a(boolean z) {
        a(z, (String) null);
    }

    public void a(boolean z, String str) {
        if (hqo.c(this.a)) {
            SQLiteDatabase a = cyr.a(this.a);
            czb czbVar = new czb(this.a, a);
            if (TextUtils.isEmpty(str)) {
                long b = czbVar.b("https://mobsec-aip.baidu.com/aip/official/chk?detail=true");
                if (z && System.currentTimeMillis() - b < AlarmUtil.DAY) {
                    return;
                }
            }
            try {
                String a2 = a(str);
                if (a2 == null) {
                    return;
                }
                hsk.a(4100);
                String a3 = HttpUtils.a(this.a, "https://mobsec-aip.baidu.com/aip/official/chk?detail=true", a2);
                hpr hprVar = new hpr();
                JSONArray b2 = hprVar.b(a3);
                if (hprVar.a()) {
                    new cyt(this.a, a).a(a(b2));
                    czbVar.a("https://mobsec-aip.baidu.com/aip/official/chk?detail=true", System.currentTimeMillis(), null);
                    Intent intent = new Intent("com.dianxinos.optimizer.appmanager.action.COUNT_CHANGED");
                    intent.setPackage(this.a.getPackageName());
                    htl.a(this.a, intent);
                    fqv.a(this.a).a(true);
                }
            } catch (HttpUtils.HttpStatusException e) {
            } catch (IOException e2) {
            } catch (JSONException e3) {
            } finally {
                hsk.a();
            }
        }
    }

    public cys a(awv awvVar) {
        cys cysVar = null;
        if (hqo.c(this.a)) {
            new czb(this.a, cyr.a(this.a));
            try {
                String b = b(awvVar);
                if (b != null) {
                    hsk.a(4101);
                    String a = HttpUtils.a(this.a, "https://mobsec-aip.baidu.com/aip/official/chk?detail=true", b);
                    hpr hprVar = new hpr();
                    JSONArray b2 = hprVar.b(a);
                    if (hprVar.a()) {
                        cysVar = a(b2, awvVar);
                    }
                }
            } catch (HttpUtils.HttpStatusException e) {
            } catch (IOException e2) {
            } catch (JSONException e3) {
            } finally {
                hsk.a();
            }
        }
        return cysVar;
    }

    private String b(awv awvVar) {
        JSONArray jSONArray = new JSONArray();
        String b = awvVar.b(this.a);
        long c = awvVar.c(this.a);
        if (b == null || c == 0) {
            return null;
        }
        JSONObject jSONObject = new JSONObject();
        jSONObject.put("pkg", awvVar.d());
        jSONObject.put(SapiUtils.KEY_QR_LOGIN_SIGN, b);
        jSONObject.put("ver", awvVar.h());
        jSONObject.put("vername", awvVar.g());
        jSONObject.put("signmd5", c);
        jSONArray.put(jSONObject);
        if (jSONArray.length() <= 0) {
            return null;
        }
        JSONObject jSONObject2 = new JSONObject();
        jSONObject2.put("apps", jSONArray);
        return jSONObject2.toString();
    }

    private String a(String str) {
        ArrayList<awv> arrayList = new ArrayList();
        if (TextUtils.isEmpty(str)) {
            arrayList.addAll(aww.a(this.a).d());
        } else {
            arrayList.add(aww.a(this.a).b(str));
        }
        JSONArray jSONArray = new JSONArray();
        for (awv awvVar : arrayList) {
            if (!awvVar.p() || awvVar.q()) {
                String b = awvVar.b(this.a);
                long c = awvVar.c(this.a);
                if (b != null && c != 0) {
                    JSONObject jSONObject = new JSONObject();
                    jSONObject.put("pkg", awvVar.d());
                    jSONObject.put(SapiUtils.KEY_QR_LOGIN_SIGN, b);
                    jSONObject.put("ver", awvVar.h());
                    jSONObject.put("vername", awvVar.g());
                    jSONObject.put("signmd5", c);
                    jSONArray.put(jSONObject);
                }
            }
        }
        if (jSONArray.length() <= 0) {
            return null;
        }
        JSONObject jSONObject2 = new JSONObject();
        jSONObject2.put("apps", jSONArray);
        return jSONObject2.toString();
    }

    private cys a(JSONArray jSONArray, awv awvVar) {
        int length = jSONArray.length();
        for (int i = 0; i < length; i++) {
            JSONObject jSONObject = jSONArray.getJSONObject(i);
            String string = jSONObject.getString("pkg");
            if (awvVar != null && string.equals(awvVar.d())) {
                cys cysVar = new cys();
                cysVar.a = jSONObject.getString("pkg");
                cysVar.f = awvVar.m();
                cysVar.h = jSONObject.optDouble("signrate", 0.0d);
                if (!jSONObject.isNull("isofficial")) {
                    if (jSONObject.getBoolean("isofficial")) {
                        cysVar.g = 1;
                    } else {
                        cysVar.g = 2;
                    }
                } else {
                    cysVar.g = -1;
                }
                cysVar.i = false;
                if (cysVar.g == 2 && !jSONObject.isNull("official")) {
                    JSONObject jSONObject2 = jSONObject.getJSONObject("official");
                    if (jSONObject2.getBoolean("isofficial")) {
                        cysVar.i = true;
                        cysVar.j = jSONObject2.getString("downurl");
                        cysVar.k = jSONObject2.getLong("size");
                        cysVar.l = jSONObject2.getInt("vercode");
                        cysVar.m = jSONObject2.getLong("signmd5");
                        cysVar.n = jSONObject2.getString(SapiUtils.KEY_QR_LOGIN_SIGN);
                        cysVar.o = jSONObject2.optDouble("signrate", 0.0d);
                        return cysVar;
                    }
                    return cysVar;
                }
                return cysVar;
            }
        }
        return null;
    }

    private List a(JSONArray jSONArray) {
        aww a = aww.a(this.a);
        ArrayList arrayList = new ArrayList();
        int length = jSONArray.length();
        for (int i = 0; i < length; i++) {
            JSONObject jSONObject = jSONArray.getJSONObject(i);
            awv c = a.c(jSONObject.getString("pkg"));
            if (c != null) {
                cys cysVar = new cys();
                cysVar.a = jSONObject.getString("pkg");
                cysVar.f = c.m();
                cysVar.h = jSONObject.optDouble("signrate", 0.0d);
                if (!jSONObject.isNull("isofficial")) {
                    if (jSONObject.getBoolean("isofficial")) {
                        cysVar.g = 1;
                    } else {
                        cysVar.g = 2;
                    }
                } else {
                    cysVar.g = -1;
                }
                cysVar.i = false;
                if (cysVar.g == 2 && !jSONObject.isNull("official")) {
                    JSONObject jSONObject2 = jSONObject.getJSONObject("official");
                    if (jSONObject2.getBoolean("isofficial")) {
                        cysVar.i = true;
                        cysVar.j = jSONObject2.getString("downurl");
                        cysVar.k = jSONObject2.getLong("size");
                        cysVar.l = jSONObject2.getInt("vercode");
                        cysVar.m = jSONObject2.getLong("signmd5");
                        cysVar.n = jSONObject2.getString(SapiUtils.KEY_QR_LOGIN_SIGN);
                        cysVar.o = jSONObject2.optDouble("signrate", 0.0d);
                    }
                }
                arrayList.add(cysVar);
            }
        }
        return arrayList;
    }
}