百度手机卫士 v8.8.0版本的 MD5 值为:a85894a6923c8a39f0c3a3a686ad7443
以下内容为反编译后的 hov.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 hov {
public static hov a;
private static final String b = "https://sjws-ompapi.baidu.com";
private Context c;
private hoz d;
private hov(Context context) {
this.c = context;
this.d = hoz.a(context);
}
public static hov a(Context context) {
if (a == null) {
synchronized (hov.class) {
if (a == null) {
a = new hov(context.getApplicationContext());
}
}
}
return a;
}
public hpf a(String str) {
String b2 = b(str);
if (!TextUtils.isEmpty(b2)) {
try {
return new hpf(new JSONObject(b2));
} catch (JSONException e) {
e.printStackTrace();
}
}
return null;
}
private String b(String str) {
return c(d(str));
}
public List<hpe> a(hpg hpgVar) {
ArrayList arrayList;
JSONException e;
String b2 = b(hpgVar);
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 hpe(jSONArray.optJSONObject(i)));
}
return arrayList;
} catch (JSONException e2) {
e = e2;
e.printStackTrace();
return arrayList;
}
} catch (JSONException e3) {
arrayList = null;
e = e3;
}
}
private String b(hpg hpgVar) {
return c(c(hpgVar));
}
public hpa a(long j, int i, String str) {
String b2 = b(j, i, str);
if (TextUtils.isEmpty(b2)) {
return null;
}
try {
return hpa.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(hpe hpeVar, int i, int i2) {
return c(c(hpeVar, i, i2));
}
public List<hpa> a(hpe hpeVar, int i) {
return a(hpeVar, i, 30);
}
public List<hpa> a(hpe hpeVar, int i, int i2) {
String b2 = b(hpeVar, i, i2);
if (TextUtils.isEmpty(b2)) {
return null;
}
try {
return hpa.a(new JSONArray(b2));
} catch (JSONException e) {
e.printStackTrace();
return null;
}
}
private String c(String str) {
String str2;
hze hzeVar = new hze();
hzeVar.k = new HashMap<>();
hzeVar.j = new ArrayList();
String a2 = hyr.a(str);
how a3 = this.d.a(a2);
hzeVar.j.add("ETag");
try {
if (a3 == null) {
how howVar = new how();
str2 = HttpUtils.a(this.c, str, hzeVar);
howVar.a = str2;
howVar.b = a(hzeVar);
this.d.a(a2, howVar);
} else {
a(hzeVar, a3);
try {
str2 = HttpUtils.a(this.c, str, hzeVar);
} catch (IOException e) {
e = e;
str2 = null;
}
try {
if (hzeVar.l == 200) {
a3.a = str2;
a3.b = a(hzeVar);
this.d.a(a2, a3);
}
} catch (IOException e2) {
e = e2;
if ((e instanceof HttpUtils.HttpStatusException) && ((HttpUtils.HttpStatusException) e).getStatusCode() == 304) {
str2 = a3.a;
}
hyt hytVar = new hyt();
JSONObject a4 = hytVar.a(str2);
if (a4 == null) {
}
return TextUtils.isEmpty(r0) ? hos.a(hoq.b, hytVar.c(), r0) : null;
}
}
hyt hytVar2 = new hyt();
JSONObject a42 = hytVar2.a(str2);
String optString = a42 == null ? a42.optString("datas") : null;
return TextUtils.isEmpty(optString) ? hos.a(hoq.b, hytVar2.c(), optString) : null;
} catch (Exception e3) {
e3.printStackTrace();
return null;
}
}
private String a(hze hzeVar) {
List<String> list = hzeVar.k.get("ETag");
return (list == null || list.size() <= 0) ? "" : list.get(0);
}
private void a(hze hzeVar, how howVar) {
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("If-None-Match", howVar.b);
hzeVar.i = hashMap;
}
private String c(hpe hpeVar, int i, int i2) {
StringBuilder sb = new StringBuilder();
sb.append(b).append("/omp/cms/2.0").append("/materials").append("?gid=").append(hpeVar.a).append("&lc=").append(hph.a(this.c)).append("&pn=").append(i).append("&ps=").append(i2);
return sb.toString();
}
private String c(hpg hpgVar) {
StringBuilder sb = new StringBuilder();
sb.append(b).append("/omp/cms/2.0").append("/materialGroup").append("?tid=").append(hpgVar.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(hph.a(this.c)).append("&pkg=").append(hph.b(this.c)).append("&vn=").append(hph.c(this.c)).append("&child=").append(str);
return sb.toString();
}
}