FreeShare Geek v3.1.8290版本的 MD5 值为:492ca3ae4cdfab7e2d18d5e1b4428e75
以下内容为反编译后的 fx.java 源代码,内容仅作参考
package u.aly;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.HttpResponse;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.InputStreamEntity;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import u.aly.cr;
public class fx {
private String b;
private Context e;
private gb f;
private fl g;
private final int f2874a = 1;
private String f2875c = "10.0.0.172";
private int d = 80;
public fx(Context context) {
this.e = context;
this.g = fn.b(context);
this.b = a(context);
}
public void a(gb gbVar) {
this.f = gbVar;
}
public int a(byte[] bArr) {
byte[] bArr2 = null;
int i = 0;
while (true) {
if (i >= com.umeng.analytics.j.f2484a.length) {
break;
}
bArr2 = a(bArr, com.umeng.analytics.j.f2484a[i]);
if (bArr2 != null) {
if (this.f != null) {
this.f.b();
}
} else {
if (this.f != null) {
this.f.c();
}
i++;
}
}
if (bArr2 == null) {
return 1;
}
return b(bArr2);
}
private boolean a() {
String extraInfo;
if (this.e.getPackageManager().checkPermission("android.permission.ACCESS_NETWORK_STATE", this.e.getPackageName()) != 0) {
return false;
}
try {
NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.e.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) {
HttpPost httpPost = new HttpPost(str);
BasicHttpParams basicHttpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(basicHttpParams, 10000);
HttpConnectionParams.setSoTimeout(basicHttpParams, 30000);
DefaultHttpClient defaultHttpClient = new DefaultHttpClient(basicHttpParams);
httpPost.addHeader("X-Umeng-Sdk", this.b);
httpPost.addHeader("Msg-Type", "envelope");
try {
if (a()) {
defaultHttpClient.getParams().setParameter("http.route.default-proxy", new HttpHost(this.f2875c, this.d));
}
httpPost.setEntity(new InputStreamEntity(new ByteArrayInputStream(bArr), bArr.length));
if (this.f != null) {
this.f.d();
}
HttpResponse execute = defaultHttpClient.execute(httpPost);
if (this.f != null) {
this.f.e();
}
ef.a("MobclickAgent", "status code : " + execute.getStatusLine().getStatusCode());
if (execute.getStatusLine().getStatusCode() != 200) {
return null;
}
ef.a("MobclickAgent", "Sent message to " + str);
HttpEntity entity = execute.getEntity();
if (entity == null) {
return null;
}
InputStream content = entity.getContent();
try {
return eh.b(content);
} finally {
eh.c(content);
}
} catch (ClientProtocolException e) {
ef.b("MobclickAgent", "ClientProtocolException,Failed to send message.", e);
return null;
} catch (IOException e2) {
ef.b("MobclickAgent", "IOException,Failed to send message.", e2);
return null;
}
}
private String a(Context context) {
StringBuffer stringBuffer = new StringBuffer();
stringBuffer.append("Android");
stringBuffer.append("/");
stringBuffer.append("5.2.4");
stringBuffer.append(" ");
try {
StringBuffer stringBuffer2 = new StringBuffer();
stringBuffer2.append(ee.p(context));
stringBuffer2.append("/");
stringBuffer2.append(ee.b(context));
stringBuffer2.append(" ");
stringBuffer2.append(Build.MODEL);
stringBuffer2.append("/");
stringBuffer2.append(Build.VERSION.RELEASE);
stringBuffer2.append(" ");
stringBuffer2.append(eh.a(com.umeng.analytics.a.a(context)));
stringBuffer.append(URLEncoder.encode(stringBuffer2.toString(), "UTF-8"));
} catch (Exception e) {
e.printStackTrace();
}
return stringBuffer.toString();
}
private int b(byte[] bArr) {
bb bbVar = new bb();
try {
new en(new cr.a()).a(bbVar, bArr);
if (bbVar.f2783a == 1) {
this.g.b(bbVar.j());
this.g.c();
}
ef.a("MobclickAgent", "send log:" + bbVar.f());
} catch (Exception e) {
e.printStackTrace();
}
if (bbVar.f2783a == 1) {
return 2;
}
return 3;
}
}