百度手机卫士 v8.6.2版本的 MD5 值为:fa60cb367e40201705a2d9f9ce2cbfdf
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.baidu.zeus.g;
import android.content.Context;
import android.text.TextUtils;
import android.util.Log;
import com.baidu.zeus.utils.Base64;
import com.baidu.zeus.utils.b;
import com.baidu.zeus.utils.c;
import com.baidu.zeus.utils.g;
import com.baidu.zeus.utils.h;
import com.baidu.zeus.utils.k;
import com.quickbird.sdk.internal.HttpsClient;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Date;
import java.util.UUID;
import org.json.JSONArray;
public final class a {
private Context a;
private String b = null;
private String c = null;
private a(Context context) {
this.a = context;
}
public static synchronized a a(Context context) {
a aVar;
synchronized (a.class) {
aVar = new a(context);
}
return aVar;
}
private String c(boolean z) {
if (z) {
this.b = "http://180.149.144.168/";
} else if (TextUtils.isEmpty(this.b)) {
this.b = c.a(this.a, "zeus_network.cfg", "domain_all");
}
return this.b;
}
private String d(boolean z) {
if (z) {
return c.a(this.a, "zeus_network.cfg", "domain_v2_report");
}
if (TextUtils.isEmpty(this.c)) {
this.c = c.a(this.a, "zeus_network.cfg", "domain_report");
}
return this.c;
}
public final String[] a(String str, int i, boolean z) {
String[] strArr = new String[2];
String valueOf = String.valueOf(new Date().getTime() / 1000);
String k = c.k(this.a);
String j = c.j(this.a);
String str2 = "appkey:" + k;
if (c.a) {
Log.d("Baidu", "[Protocol] " + str2);
}
String str3 = "secretKey:" + j;
if (c.a) {
Log.d("Baidu", "[Protocol] " + str3);
}
if (TextUtils.isEmpty(k) || TextUtils.isEmpty(j)) {
return null;
}
try {
strArr[0] = c(z) + "v1/zeus/match?appkey=" + k + "×tamp=" + valueOf + "&sign=" + h.a(k + valueOf + "param=" + str + "type=" + i + j);
strArr[1] = "param=" + URLEncoder.encode(str, HttpsClient.HTTP_CHARSET) + "&type=" + i;
String str4 = "req[0]:" + strArr[0] + ",req[1]:" + strArr[1];
if (c.a) {
Log.d("Baidu", "[Protocol] " + str4);
return strArr;
}
return strArr;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public final String[] b(String str, int i, boolean z) {
String[] strArr = new String[2];
String valueOf = String.valueOf(new Date().getTime() / 1000);
String k = c.k(this.a);
String j = c.j(this.a);
if (TextUtils.isEmpty(k) || TextUtils.isEmpty(j)) {
return null;
}
try {
strArr[0] = c(z) + "v1/zeus/download?appkey=" + k + "×tamp=" + valueOf + "&sign=" + h.a(k + valueOf + "param=" + str + "type=" + i + j);
strArr[1] = "param=" + URLEncoder.encode(str, HttpsClient.HTTP_CHARSET) + "&type=" + i;
String str2 = "req[0]:" + strArr[0] + ",req[1]:" + strArr[1];
if (c.a) {
Log.d("Baidu", "[Protocol] " + str2);
return strArr;
}
return strArr;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public final String[] a(String str, boolean z) {
try {
String valueOf = String.valueOf(new Date().getTime() / 1000);
String k = c.k(this.a);
String j = c.j(this.a);
if (TextUtils.isEmpty(k) || TextUtils.isEmpty(j)) {
return null;
}
String[] strArr = {c(z) + "v1/zeus/build?appkey=" + k + "×tamp=" + valueOf + "&sign=" + h.a(k + valueOf + "type=" + str + "vid=0" + j), "type=" + str + "&vid=0"};
String str2 = "req[0]:" + strArr[0] + ",req[1]:" + strArr[1];
if (c.a) {
Log.d("Baidu", "[Protocol] " + str2);
return strArr;
}
return strArr;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public final String a(boolean z) {
String valueOf = String.valueOf(new Date().getTime() / 1000);
String k = c.k(this.a);
return c(z) + "zeus/upgrade?appkey=" + k + "×tamp=" + valueOf + "&sign=" + h.a(k + valueOf + "apk=2vid=0" + c.j(this.a)) + "&apk=2&vid=0";
}
public final String[] a(int i, boolean z) {
try {
String valueOf = String.valueOf(new Date().getTime() / 1000);
String k = c.k(this.a);
String j = c.j(this.a);
if (TextUtils.isEmpty(k) || TextUtils.isEmpty(j)) {
return null;
}
String[] strArr = {c(z) + "v1/zeus/slg?appkey=" + k + "×tamp=" + valueOf + "&sign=" + h.a(k + valueOf + "cmd=" + i + j), "cmd=" + i};
String str = "req[0]:" + strArr[0] + ",req[1]:" + strArr[1];
if (c.a) {
Log.d("Baidu", "[Protocol] " + str);
return strArr;
}
return strArr;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public final String[] b(String str, boolean z) {
try {
String valueOf = String.valueOf(new Date().getTime() / 1000);
String k = c.k(this.a);
String j = c.j(this.a);
if (TextUtils.isEmpty(k) || TextUtils.isEmpty(j)) {
return null;
}
String[] strArr = {c(z) + "v1/zeus/matchstatus?appkey=" + k + "×tamp=" + valueOf + "&sign=" + h.a(k + valueOf + "param=" + str + j), "param=" + URLEncoder.encode(str, HttpsClient.HTTP_CHARSET)};
String str2 = "req :" + strArr;
if (c.a) {
Log.d("Baidu", "[Protocol] " + str2);
return strArr;
}
return strArr;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public final String a(JSONArray jSONArray, String str, String str2, boolean z) {
long currentTimeMillis = System.currentTimeMillis() / 1000;
StringBuilder sb = new StringBuilder();
String str3 = "";
try {
str3 = k.a(str, str2, jSONArray.toString(), currentTimeMillis);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String uuid = UUID.randomUUID().toString();
sb.append(d(z)).append("?appkey=").append(str).append("×tamp=").append(currentTimeMillis);
sb.append("&sign=").append(str3).append("&msg_id=").append(uuid);
if (z) {
sb.append("&status=" + b.a);
}
return sb.toString();
}
public final String c(String str, boolean z) {
long currentTimeMillis = System.currentTimeMillis() / 1000;
String k = c.k(this.a);
String j = c.j(this.a);
StringBuilder sb = new StringBuilder();
String str2 = "";
try {
str2 = k.a(k, j, str, currentTimeMillis);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String uuid = UUID.randomUUID().toString();
sb.append(d(z)).append("?appkey=").append(k).append("×tamp=").append(currentTimeMillis);
sb.append("&sign=").append(str2).append("&msg_id=").append(uuid);
if (z) {
sb.append("&status=" + b.a);
}
return sb.toString();
}
public final String d(String str, boolean z) {
long currentTimeMillis = System.currentTimeMillis() / 1000;
String k = c.k(this.a);
String j = c.j(this.a);
StringBuilder sb = new StringBuilder();
String str2 = "";
try {
str2 = k.a(k, j, str, currentTimeMillis);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
String uuid = UUID.randomUUID().toString();
sb.append(d(z)).append("?appkey=").append(k).append("×tamp=").append(currentTimeMillis);
sb.append("&sign=").append(str2).append("&msg_id=").append(uuid);
if (z) {
sb.append("&status=" + b.a);
}
return sb.toString();
}
public final byte[] a(String str, String str2, boolean z) {
byte[] bArr;
try {
ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(str2.getBytes("utf-8"));
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
g.a(byteArrayInputStream, byteArrayOutputStream);
bArr = byteArrayOutputStream.toByteArray();
byteArrayOutputStream.flush();
byteArrayOutputStream.close();
byteArrayInputStream.close();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
bArr = null;
} catch (IOException e2) {
e2.printStackTrace();
bArr = null;
}
if (z) {
return b.a(this.a, str, bArr);
}
return Base64.encode(bArr, 0);
}
public final String b(boolean z) {
long currentTimeMillis = System.currentTimeMillis() / 1000;
String k = c.k(this.a);
return c(z) + "v1/zeus/ml?appkey=" + k + "×tamp=" + currentTimeMillis + "&sign=" + h.a(k + currentTimeMillis + c.j(this.a));
}
}