和通讯录 v4.2.0版本的 MD5 值为:f213fa766dccbfebde0dd8add5534518
以下内容为反编译后的 jk.java 源代码,内容仅作参考
package b.a;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.text.TextUtils;
import com.baidu.location.LocationClientOption;
import com.google.android.mms.pdu.EncodedStringValue;
import com.huawei.mcs.base.constant.Constant;
import com.huawei.tep.component.net.http.HttpConstant;
import com.umeng.analytics.AnalyticsConfig;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.URL;
import java.net.URLEncoder;
public class jk {
private String f237a;
private String f238b = "10.0.0.172";
private int c = 80;
private Context d;
private ji e;
public jk(Context context) {
this.d = context;
this.f237a = a(context);
}
public void a(ji jiVar) {
this.e = jiVar;
}
public byte[] a(byte[] bArr) {
byte[] bArr2 = null;
int i = 0;
while (true) {
if (i >= com.umeng.analytics.a.g.length) {
break;
}
bArr2 = a(bArr, com.umeng.analytics.a.g[i]);
if (bArr2 != null) {
if (this.e != null) {
this.e.m();
}
} else {
if (this.e != null) {
this.e.n();
}
i++;
}
}
return bArr2;
}
private boolean a() {
String extraInfo;
if (this.d.getPackageManager().checkPermission("android.permission.ACCESS_NETWORK_STATE", this.d.getPackageName()) != 0) {
return false;
}
try {
NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.d.getSystemService("connectivity")).getActiveNetworkInfo();
if (activeNetworkInfo != null && activeNetworkInfo.getType() != 1 && (extraInfo = activeNetworkInfo.getExtraInfo()) != null) {
if (!extraInfo.equals("cmwap") && !extraInfo.equals("3gwap")) {
}
return true;
}
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
private byte[] a(byte[] bArr, String str) {
HttpURLConnection httpURLConnection;
HttpURLConnection httpURLConnection2 = null;
try {
try {
if (this.e != null) {
this.e.k();
}
if (a()) {
httpURLConnection = (HttpURLConnection) new URL(str).openConnection(new Proxy(Proxy.Type.HTTP, new InetSocketAddress(this.f238b, this.c)));
} else {
httpURLConnection = (HttpURLConnection) new URL(str).openConnection();
}
try {
httpURLConnection.setRequestProperty("X-Umeng-UTC", String.valueOf(System.currentTimeMillis()));
httpURLConnection.setRequestProperty("X-Umeng-Sdk", this.f237a);
httpURLConnection.setRequestProperty("Msg-Type", "envelope");
httpURLConnection.setConnectTimeout(LocationClientOption.MIN_AUTO_NOTIFY_INTERVAL);
httpURLConnection.setReadTimeout(30000);
httpURLConnection.setRequestMethod(HttpConstant.Method.POST);
httpURLConnection.setDoOutput(true);
httpURLConnection.setDoInput(true);
httpURLConnection.setUseCaches(false);
httpURLConnection.setChunkedStreamingMode(0);
if (Integer.parseInt(Build.VERSION.SDK) < 8) {
System.setProperty("http.keepAlive", "false");
}
OutputStream outputStream = httpURLConnection.getOutputStream();
outputStream.write(bArr);
outputStream.flush();
outputStream.close();
if (this.e != null) {
this.e.l();
}
int responseCode = httpURLConnection.getResponseCode();
if (responseCode != 200) {
gr.d("status code: " + responseCode);
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
return null;
}
String headerField = httpURLConnection.getHeaderField("Content-Type");
boolean z = !TextUtils.isEmpty(headerField) && headerField.equalsIgnoreCase("application/thrift");
gr.a("status code: " + responseCode);
if (!z) {
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
return null;
}
gr.b("Send message to " + str);
InputStream inputStream = httpURLConnection.getInputStream();
try {
byte[] b2 = gq.b(inputStream);
if (httpURLConnection == null) {
return b2;
}
httpURLConnection.disconnect();
return b2;
} finally {
gq.c(inputStream);
}
} catch (Exception e) {
e = e;
gr.b("IOException,Failed to send message.", e);
if (httpURLConnection != null) {
httpURLConnection.disconnect();
}
return null;
}
} catch (Throwable th) {
th = th;
if (0 != 0) {
httpURLConnection2.disconnect();
}
throw th;
}
} catch (Exception e2) {
e = e2;
httpURLConnection = null;
} catch (Throwable th2) {
th = th2;
if (0 != 0) {
}
throw th;
}
}
private String a(Context context) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("Android");
stringBuffer.append(Constant.FilePath.IDND_PATH);
stringBuffer.append(com.umeng.analytics.a.c);
stringBuffer.append(" ");
try {
StringBuffer stringBuffer2 = new StringBuffer();
stringBuffer2.append(gp.q(context));
stringBuffer2.append(Constant.FilePath.IDND_PATH);
stringBuffer2.append(gp.b(context));
stringBuffer2.append(" ");
stringBuffer2.append(Build.MODEL);
stringBuffer2.append(Constant.FilePath.IDND_PATH);
stringBuffer2.append(Build.VERSION.RELEASE);
stringBuffer2.append(" ");
stringBuffer2.append(gq.a(AnalyticsConfig.getAppkey(context)));
stringBuffer.append(URLEncoder.encode(stringBuffer2.toString(), EncodedStringValue.StringEncoding.UTF_8));
} catch (Exception e) {
e.printStackTrace();
}
return stringBuffer.toString();
}
}