百度手机卫士 v8.6.2版本的 MD5 值为:fa60cb367e40201705a2d9f9ce2cbfdf
以下内容为反编译后的 dax.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 dax {
private Context a;
public dax(Context context) {
this.a = context.getApplicationContext();
}
public void a(boolean z) {
a(z, (String) null);
}
public void a(boolean z, String str) {
if (hvy.c(this.a)) {
SQLiteDatabase a = dah.a(this.a);
dar darVar = new dar(this.a, a);
if (TextUtils.isEmpty(str)) {
long b = darVar.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;
}
hxu.a(4100);
String a3 = HttpUtils.a(this.a, "https://mobsec-aip.baidu.com/aip/official/chk?detail=true", a2);
hvb hvbVar = new hvb();
JSONArray b2 = hvbVar.b(a3);
if (hvbVar.a()) {
new daj(this.a, a).a(a(b2));
darVar.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());
hyv.a(this.a, intent);
fvn.a(this.a).a(true);
}
} catch (HttpUtils.HttpStatusException e) {
} catch (IOException e2) {
} catch (JSONException e3) {
} finally {
hxu.a();
}
}
}
public dai a(avi aviVar) {
dai daiVar = null;
if (hvy.c(this.a)) {
new dar(this.a, dah.a(this.a));
try {
String b = b(aviVar);
if (b != null) {
hxu.a(4101);
String a = HttpUtils.a(this.a, "https://mobsec-aip.baidu.com/aip/official/chk?detail=true", b);
hvb hvbVar = new hvb();
JSONArray b2 = hvbVar.b(a);
if (hvbVar.a()) {
daiVar = a(b2, aviVar);
}
}
} catch (HttpUtils.HttpStatusException e) {
} catch (IOException e2) {
} catch (JSONException e3) {
} finally {
hxu.a();
}
}
return daiVar;
}
private String b(avi aviVar) {
JSONArray jSONArray = new JSONArray();
String b = aviVar.b(this.a);
long c = aviVar.c(this.a);
if (b == null || c == 0) {
return null;
}
JSONObject jSONObject = new JSONObject();
jSONObject.put("pkg", aviVar.d());
jSONObject.put(SapiUtils.KEY_QR_LOGIN_SIGN, b);
jSONObject.put("ver", aviVar.h());
jSONObject.put("vername", aviVar.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<avi> arrayList = new ArrayList();
if (TextUtils.isEmpty(str)) {
arrayList.addAll(avj.a(this.a).d());
} else {
arrayList.add(avj.a(this.a).b(str));
}
JSONArray jSONArray = new JSONArray();
for (avi aviVar : arrayList) {
if (!aviVar.p() || aviVar.q()) {
String b = aviVar.b(this.a);
long c = aviVar.c(this.a);
if (b != null && c != 0) {
JSONObject jSONObject = new JSONObject();
jSONObject.put("pkg", aviVar.d());
jSONObject.put(SapiUtils.KEY_QR_LOGIN_SIGN, b);
jSONObject.put("ver", aviVar.h());
jSONObject.put("vername", aviVar.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 dai a(JSONArray jSONArray, avi aviVar) {
int length = jSONArray.length();
for (int i = 0; i < length; i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
String string = jSONObject.getString("pkg");
if (aviVar != null && string.equals(aviVar.d())) {
dai daiVar = new dai();
daiVar.a = jSONObject.getString("pkg");
daiVar.f = aviVar.m();
daiVar.h = jSONObject.optDouble("signrate", 0.0d);
if (!jSONObject.isNull("isofficial")) {
if (jSONObject.getBoolean("isofficial")) {
daiVar.g = 1;
} else {
daiVar.g = 2;
}
} else {
daiVar.g = -1;
}
daiVar.i = false;
if (daiVar.g == 2 && !jSONObject.isNull("official")) {
JSONObject jSONObject2 = jSONObject.getJSONObject("official");
if (jSONObject2.getBoolean("isofficial")) {
daiVar.i = true;
daiVar.j = jSONObject2.getString("downurl");
daiVar.k = jSONObject2.getLong("size");
daiVar.l = jSONObject2.getInt("vercode");
daiVar.m = jSONObject2.getLong("signmd5");
daiVar.n = jSONObject2.getString(SapiUtils.KEY_QR_LOGIN_SIGN);
daiVar.o = jSONObject2.optDouble("signrate", 0.0d);
return daiVar;
}
return daiVar;
}
return daiVar;
}
}
return null;
}
private List<dai> a(JSONArray jSONArray) {
avj a = avj.a(this.a);
ArrayList arrayList = new ArrayList();
int length = jSONArray.length();
for (int i = 0; i < length; i++) {
JSONObject jSONObject = jSONArray.getJSONObject(i);
avi c = a.c(jSONObject.getString("pkg"));
if (c != null) {
dai daiVar = new dai();
daiVar.a = jSONObject.getString("pkg");
daiVar.f = c.m();
daiVar.h = jSONObject.optDouble("signrate", 0.0d);
if (!jSONObject.isNull("isofficial")) {
if (jSONObject.getBoolean("isofficial")) {
daiVar.g = 1;
} else {
daiVar.g = 2;
}
} else {
daiVar.g = -1;
}
daiVar.i = false;
if (daiVar.g == 2 && !jSONObject.isNull("official")) {
JSONObject jSONObject2 = jSONObject.getJSONObject("official");
if (jSONObject2.getBoolean("isofficial")) {
daiVar.i = true;
daiVar.j = jSONObject2.getString("downurl");
daiVar.k = jSONObject2.getLong("size");
daiVar.l = jSONObject2.getInt("vercode");
daiVar.m = jSONObject2.getLong("signmd5");
daiVar.n = jSONObject2.getString(SapiUtils.KEY_QR_LOGIN_SIGN);
daiVar.o = jSONObject2.optDouble("signrate", 0.0d);
}
}
arrayList.add(daiVar);
}
}
return arrayList;
}
}