百度手机卫士 v8.6.2版本的 MD5 值为:fa60cb367e40201705a2d9f9ce2cbfdf
以下内容为反编译后的 hmi.java 源代码,内容仅作参考
package dxoptimizer;
import android.content.Context;
import android.text.TextUtils;
import com.dianxinos.optimizer.utils.HttpUtils;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class hmi {
public static hmi a;
private static final String b = "https://sjws-ompapi.baidu.com";
private Context c;
private hmm d;
private hmi(Context context) {
this.c = context;
this.d = hmm.a(context);
}
public static hmi a(Context context) {
if (a == null) {
synchronized (hmi.class) {
if (a == null) {
a = new hmi(context.getApplicationContext());
}
}
}
return a;
}
public hms a(String str) {
String b2 = b(str);
if (!TextUtils.isEmpty(b2)) {
try {
return new hms(new JSONObject(b2));
} catch (JSONException e) {
e.printStackTrace();
}
}
return null;
}
private String b(String str) {
return c(d(str));
}
public List<hmr> a(hmt hmtVar) {
ArrayList arrayList;
JSONException e;
String b2 = b(hmtVar);
if (TextUtils.isEmpty(b2)) {
return null;
}
try {
arrayList = new ArrayList();
try {
JSONArray jSONArray = new JSONArray(b2);
int length = jSONArray.length();
for (int i = 0; i < length; i++) {
arrayList.add(new hmr(jSONArray.optJSONObject(i)));
}
return arrayList;
} catch (JSONException e2) {
e = e2;
e.printStackTrace();
return arrayList;
}
} catch (JSONException e3) {
arrayList = null;
e = e3;
}
}
private String b(hmt hmtVar) {
return c(c(hmtVar));
}
public hmn a(long j, int i, String str) {
String b2 = b(j, i, str);
if (TextUtils.isEmpty(b2)) {
return null;
}
try {
return hmn.a(new JSONObject(b2));
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
public String b(long j, int i, String str) {
return c(c(j, i, str));
}
private String b(hmr hmrVar, int i, int i2) {
return c(c(hmrVar, i, i2));
}
public List<hmn> a(hmr hmrVar, int i) {
return a(hmrVar, i, 30);
}
public List<hmn> a(hmr hmrVar, int i, int i2) {
String b2 = b(hmrVar, i, i2);
if (TextUtils.isEmpty(b2)) {
return null;
}
try {
return hmn.a(new JSONArray(b2));
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
private String c(String str) {
String str2;
hvm hvmVar = new hvm();
hvmVar.k = new HashMap<>();
hvmVar.j = new ArrayList();
String a2 = huz.a(str);
hmj a3 = this.d.a(a2);
hvmVar.j.add("ETag");
try {
if (a3 == null) {
hmj hmjVar = new hmj();
str2 = HttpUtils.a(this.c, str, hvmVar);
hmjVar.a = str2;
hmjVar.b = a(hvmVar);
this.d.a(a2, hmjVar);
} else {
a(hvmVar, a3);
try {
str2 = HttpUtils.a(this.c, str, hvmVar);
} catch (IOException e) {
e = e;
str2 = null;
}
try {
if (hvmVar.l == 200) {
a3.a = str2;
a3.b = a(hvmVar);
this.d.a(a2, a3);
}
} catch (IOException e2) {
e = e2;
if ((e instanceof HttpUtils.HttpStatusException) && ((HttpUtils.HttpStatusException) e).getStatusCode() == 304) {
str2 = a3.a;
}
hvb hvbVar = new hvb();
JSONObject a4 = hvbVar.a(str2);
if (a4 == null) {
}
return TextUtils.isEmpty(r0) ? hmf.a(hmd.b, hvbVar.c(), r0) : null;
}
}
hvb hvbVar2 = new hvb();
JSONObject a42 = hvbVar2.a(str2);
String optString = a42 == null ? a42.optString("datas") : null;
return TextUtils.isEmpty(optString) ? hmf.a(hmd.b, hvbVar2.c(), optString) : null;
} catch (Exception e3) {
e3.printStackTrace();
return null;
}
}
private String a(hvm hvmVar) {
List<String> list = hvmVar.k.get("ETag");
return (list == null || list.size() <= 0) ? "" : list.get(0);
}
private void a(hvm hvmVar, hmj hmjVar) {
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("If-None-Match", hmjVar.b);
hvmVar.i = hashMap;
}
private String c(hmr hmrVar, int i, int i2) {
StringBuilder sb = new StringBuilder();
sb.append(b).append("/omp/cms/2.0").append("/materials").append("?gid=").append(hmrVar.a).append("&lc=").append(hmu.a(this.c)).append("&pn=").append(i).append("&ps=").append(i2);
return sb.toString();
}
private String c(hmt hmtVar) {
StringBuilder sb = new StringBuilder();
sb.append(b).append("/omp/cms/2.0").append("/materialGroup").append("?tid=").append(hmtVar.a).append("&pn=").append(1).append("&ps=").append(30);
return sb.toString();
}
private String c(long j, int i, String str) {
StringBuilder sb = new StringBuilder();
sb.append(b).append("/omp/cms/2.0").append("/detail").append("?mid=").append(j).append("&type=").append(i).append("&source=").append(str);
return sb.toString();
}
private String d(String str) {
StringBuilder sb = new StringBuilder();
sb.append(b).append("/omp/cms/2.0").append("/project").append("?lc=").append(hmu.a(this.c)).append("&pkg=").append(hmu.b(this.c)).append("&vn=").append(hmu.c(this.c)).append("&child=").append(str);
return sb.toString();
}
}