Shandong video conference v3.2.10版本的 MD5 值为:e9e908f971313b4c4bca5737f96781ef
以下内容为反编译后的 a.java 源代码,内容仅作参考
package com.tencent.wxop.stat;
import android.content.Context;
import android.content.IntentFilter;
import com.tencent.wxop.stat.common.StatConstants;
import com.tencent.wxop.stat.common.StatLogger;
import java.net.InetAddress;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import java.util.regex.Pattern;
import org.apache.http.HttpHost;
import org.json.JSONObject;
public class a {
private static a f13475g;
private com.tencent.wxop.stat.common.e f13479e;
private Context f13481h;
private StatLogger f13482i;
private List<String> a = null;
private volatile int f13476b = 2;
private volatile String f13477c = "";
private volatile HttpHost f13478d = null;
private int f13480f = 0;
private a(Context context) {
this.f13479e = null;
this.f13481h = null;
this.f13482i = null;
this.f13481h = context.getApplicationContext();
this.f13479e = new com.tencent.wxop.stat.common.e();
i.a(context);
this.f13482i = com.tencent.wxop.stat.common.l.b();
l();
i();
g();
}
public static a a(Context context) {
if (f13475g == null) {
synchronized (a.class) {
if (f13475g == null) {
f13475g = new a(context);
}
}
}
return f13475g;
}
private boolean b(String str) {
return Pattern.compile("(2[5][0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})\\.(25[0-5]|2[0-4]\\d|1\\d{2}|\\d{1,2})").matcher(str).matches();
}
private void i() {
ArrayList arrayList = new ArrayList(10);
this.a = arrayList;
arrayList.add("117.135.169.101");
this.a.add("140.207.54.125");
this.a.add("180.153.8.53");
this.a.add("120.198.203.175");
this.a.add("14.17.43.18");
this.a.add("163.177.71.186");
this.a.add("111.30.131.31");
this.a.add("123.126.121.167");
this.a.add("123.151.152.111");
this.a.add("113.142.45.79");
this.a.add("123.138.162.90");
this.a.add("103.7.30.94");
}
private String j() {
try {
return !b(StatConstants.MTA_SERVER_HOST) ? InetAddress.getByName(StatConstants.MTA_SERVER_HOST).getHostAddress() : "";
} catch (Exception e2) {
this.f13482i.e((Throwable) e2);
return "";
}
}
private void k() {
String j2 = j();
if (StatConfig.isDebugEnable()) {
StatLogger statLogger = this.f13482i;
statLogger.i("remoteIp ip is " + j2);
}
if (com.tencent.wxop.stat.common.l.c(j2)) {
if (!this.a.contains(j2)) {
String str = this.a.get(this.f13480f);
if (StatConfig.isDebugEnable()) {
StatLogger statLogger2 = this.f13482i;
statLogger2.w(j2 + " not in ip list, change to:" + str);
}
j2 = str;
}
StatConfig.setStatReportUrl("http://" + j2 + ":80/mstat/report");
}
}
private void l() {
this.f13476b = 0;
this.f13478d = null;
this.f13477c = null;
}
public HttpHost a() {
return this.f13478d;
}
public void a(String str) {
String[] split;
if (StatConfig.isDebugEnable()) {
this.f13482i.i("updateIpList " + str);
}
try {
if (com.tencent.wxop.stat.common.l.c(str)) {
JSONObject jSONObject = new JSONObject(str);
if (jSONObject.length() > 0) {
Iterator<String> keys = jSONObject.keys();
while (keys.hasNext()) {
String string = jSONObject.getString(keys.next());
if (com.tencent.wxop.stat.common.l.c(string)) {
for (String str2 : string.split(";")) {
if (com.tencent.wxop.stat.common.l.c(str2)) {
String[] split2 = str2.split(":");
if (split2.length > 1) {
String str3 = split2[0];
if (b(str3) && !this.a.contains(str3)) {
if (StatConfig.isDebugEnable()) {
this.f13482i.i("add new ip:" + str3);
}
this.a.add(str3);
}
}
}
}
}
}
}
}
} catch (Exception e2) {
this.f13482i.e((Throwable) e2);
}
this.f13480f = new Random().nextInt(this.a.size());
}
public String b() {
return this.f13477c;
}
public int c() {
return this.f13476b;
}
public void d() {
this.f13480f = (this.f13480f + 1) % this.a.size();
}
public boolean e() {
return this.f13476b == 1;
}
public boolean f() {
return this.f13476b != 0;
}
public void g() {
if (!com.tencent.wxop.stat.common.r.f(this.f13481h)) {
if (StatConfig.isDebugEnable()) {
this.f13482i.i("NETWORK TYPE: network is close.");
}
l();
return;
}
if (StatConfig.f13453g) {
k();
}
this.f13477c = com.tencent.wxop.stat.common.l.j(this.f13481h);
if (StatConfig.isDebugEnable()) {
StatLogger statLogger = this.f13482i;
statLogger.i("NETWORK name:" + this.f13477c);
}
if (com.tencent.wxop.stat.common.l.c(this.f13477c)) {
this.f13476b = "WIFI".equalsIgnoreCase(this.f13477c) ? 1 : 2;
this.f13478d = com.tencent.wxop.stat.common.l.a(this.f13481h);
}
if (StatServiceImpl.a()) {
StatServiceImpl.d(this.f13481h);
}
}
public void h() {
this.f13481h.getApplicationContext().registerReceiver(new b(this), new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE"));
}
}