百度手机卫士 v8.8.0版本的 MD5 值为:a85894a6923c8a39f0c3a3a686ad7443
以下内容为反编译后的 gfq.java 源代码,内容仅作参考
package dxoptimizer;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Bundle;
import android.text.TextUtils;
import com.baidu.location.BDLocation;
import com.baidu.mobads.interfaces.utils.IXAdSystemUtils;
import com.dianxinos.optimizer.engine.dxmaster.DxbbReporter;
import com.dianxinos.optimizer.utils.HttpUtils;
import com.quickbird.mini.utils.Constants;
import java.io.File;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
public class gfq {
private static final String[] a = {"<!--STATUS OK-->"};
private String[] b;
private String[] c;
private String[] d;
private String[] e;
private String f;
private String g;
private String h;
private File i;
private Context j;
private String k;
private gfv m;
private File n;
private boolean l = false;
private int o = gfu.b;
public gfq(Context context) {
this.b = gft.b(context);
this.c = gft.a(context);
this.d = gft.c(context);
this.e = gft.d(context);
this.j = context.getApplicationContext();
}
public void a() {
if (this.b != null && this.c != null) {
this.m = gfv.a(this.j);
try {
int a2 = hzq.a(this.j);
if ((1 == a2 || gfs.h(this.j)) && -1 != a2) {
this.n = new File(this.j.getFilesDir(), "bdurl");
if (!this.n.exists()) {
this.n.mkdirs();
}
try {
this.m.a(g());
this.m.init(this.n);
this.o = this.m.startDetect(c());
} catch (Exception e) {
icu.a(this.j);
icu.a("bdsc", "bdsple", (Number) 1);
}
if (this.o >= gfs.n(this.j)) {
a(this.m.getResponseFile());
}
this.m.release();
this.l = this.o != gfu.b;
gft.a(this.j, this.g, this.k, this.l, this.o);
}
} catch (Exception e2) {
}
}
}
private String b() {
if (this.c == null || this.c.length <= 0) {
return null;
}
this.g = this.c[a(this.c.length)];
try {
return "http://m.baidu.com/s?word=" + URLEncoder.encode(this.g, "gb2312") + "&from=1009717f&mon=1";
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
return null;
}
}
private int a(int i) {
if (i > 0) {
return (int) Math.round((i - 1) * Math.random());
}
return i;
}
private Bundle c() {
this.f = b();
this.h = (this.d == null || this.d.length == 0) ? "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_2 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A501 Safari/9537.53" : this.d[a(this.d.length)];
this.k = e();
Bundle bundle = new Bundle();
bundle.putString("url", this.f);
bundle.putInt("requestType", gfu.l);
bundle.putString("channelInfo", "1009717f");
bundle.putStringArray("headerKeyWords", this.b);
bundle.putStringArray("pageKeyWords", this.e != null ? this.e : a);
bundle.putInt("checkSet", gfs.l(this.j));
bundle.putString("userAgent", this.h);
bundle.putLong("request_timeout", Constants.MINUTE_MS);
return bundle;
}
private void a(File file) {
this.i = new File(file.getParent(), file.getName() + ".gz");
if (hyx.a(file, this.i) && hyw.c(this.i) < 536870912) {
String a2 = hyr.a(hyw.d(this.i));
DxbbReporter.a(this.j, a(iay.a(this.j, this.i, a2 + ".gz"), a2));
}
}
private JSONArray a(String str, String str2) {
WifiInfo f;
try {
JSONArray jSONArray = new JSONArray();
JSONObject jSONObject = new JSONObject();
jSONObject.put("type", 24);
jSONObject.put("hasroot", hxu.a());
jSONObject.put("haspermission", iao.a());
jSONObject.put("network", this.k);
if (IXAdSystemUtils.NT_WIFI.equals(this.k) && (f = f()) != null) {
jSONObject.put("bssid", f.getBSSID());
jSONObject.put("ssid", f.getSSID());
}
jSONObject.put("hotword", this.g);
jSONObject.put("ua", this.h);
Object[] d = d();
jSONObject.put("long", d[0]);
jSONObject.put("lat", d[1]);
jSONObject.put("fileurl", str);
jSONObject.put("filemd5", str2);
jSONObject.put("level", this.o);
jSONObject.put("timestamp", System.currentTimeMillis());
jSONObject.put("requrl", this.f);
jSONObject.put("date", a(System.currentTimeMillis()));
avs avsVar = new avs();
avsVar.d = false;
avsVar.c = false;
ArrayList<avn> a2 = avo.a(this.j).a(avsVar);
if (a2 != null) {
JSONArray jSONArray2 = new JSONArray();
for (avn avnVar : a2) {
JSONObject jSONObject2 = new JSONObject();
jSONObject2.put("pkg", avnVar.d());
jSONObject2.put("vc", avnVar.h());
jSONArray2.put(jSONObject2);
}
jSONObject.put("pkglist", jSONArray2);
}
jSONArray.put(jSONObject);
return jSONArray;
} catch (JSONException e) {
return null;
}
}
public static String a(long j) {
return new SimpleDateFormat("yyyy-mm-dd'T'HH:mm:ssZ").format(new Date(j));
}
private String[] d() {
String[] strArr = new String[2];
CountDownLatch countDownLatch = new CountDownLatch(1);
try {
bog bogVar = new bog();
bogVar.a = BDLocation.BDLOCATION_GCJ02_TO_BD09LL;
bogVar.b = 2000;
bogVar.c = 60000;
bogVar.d = false;
bnz.a(new gfr(this, strArr, countDownLatch), bogVar);
countDownLatch.await(60L, TimeUnit.SECONDS);
} catch (Exception e) {
}
return strArr;
}
private String e() {
switch (hzq.a(this.j)) {
case 1:
return IXAdSystemUtils.NT_WIFI;
case 2:
return "2g";
case 3:
return "3g";
case 4:
return "mobile";
case 5:
return "4g";
default:
return IXAdSystemUtils.NT_NONE;
}
}
private WifiInfo f() {
return ((WifiManager) this.j.getApplicationContext().getSystemService(IXAdSystemUtils.NT_WIFI)).getConnectionInfo();
}
private String g() {
iak a2;
try {
ibo.a(5552);
String j = gfs.j(this.j);
JSONObject jSONObject = new JSONObject(gfs.k(this.j));
if (TextUtils.isEmpty(j) || (a2 = iaj.a(this.j, j)) == null || jSONObject.optInt("vc", 0) > a2.e) {
String optString = jSONObject.optString("url");
File file = new File(this.n, "antihijack-" + jSONObject.optInt("vc", 0) + ".apk");
try {
HttpUtils.a(this.j, optString, file);
String j2 = gfs.j(this.j);
gfs.e(this.j, file.getAbsolutePath());
hyw.a(new File(j2));
icu.a(this.j);
icu.a("bdsc", "bdspls", (Number) 1);
} catch (IOException e) {
e.printStackTrace();
icu.a(this.j);
icu.a("bdsc", "bdsdpr", (Number) 1);
}
}
} catch (JSONException e2) {
e2.printStackTrace();
} finally {
ibo.a();
}
return gfs.j(this.j);
}
}