QQ浏览器 v12.2.3.7053版本的 MD5 值为:8285ab3059e5c8b521a264dfbc5c3685
以下内容为反编译后的 x.java 源代码,内容仅作参考
package c.t.m.sapp.g;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.IntentFilter;
import android.net.ConnectivityManager;
import android.net.LinkProperties;
import android.net.NetworkInfo;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.os.PowerManager;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import com.tencent.common.http.Apn;
import com.tencent.mtt.apkplugin.impl.IAPInjectService;
import com.tencent.mtt.compliance.MethodDelegate;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.Proxy;
import java.util.Iterator;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import tmsdk.common.gourd.vine.IMessageCenter;
public final class x {
private static volatile byte f2503a = 0;
private static volatile boolean f2504b = true;
private static String f2505c = "";
private static String f2506d = "unknown";
private static volatile int e = 0;
private static volatile boolean f = false;
private static volatile int g = -1;
private static Map<String, ac> h = new ConcurrentHashMap();
private static BroadcastReceiver i = new y();
private static String j = "";
private static String k = Apn.APN_CMWAP;
private static String l = Apn.APN_3GWAP;
private static String m = Apn.APN_UNIWAP;
private static String n = Apn.APN_CTWAP;
private static byte a(String str) {
NetworkInterface byName;
try {
byName = NetworkInterface.getByName(str);
} catch (Exception unused) {
}
if (!byName.isUp()) {
return (byte) 1;
}
Iterator<InterfaceAddress> it = byName.getInterfaceAddresses().iterator();
boolean z = false;
boolean z2 = false;
while (it.hasNext()) {
InetAddress address = it.next().getAddress();
if (!address.isLoopbackAddress()) {
String hostAddress = MethodDelegate.getHostAddress(address);
if (hostAddress.contains("%")) {
hostAddress = hostAddress.split("%")[0];
}
if (ab.c(hostAddress)) {
z = true;
} else if (!z2 && ab.d(hostAddress) && ab.b(hostAddress)) {
z2 = true;
}
}
}
if (z && z2) {
return (byte) 2;
}
if (z2) {
return (byte) 3;
}
return z ? (byte) 1 : (byte) 0;
}
public static void a() {
try {
o();
e();
m.a().registerReceiver(i, new IntentFilter(IMessageCenter.MSG_SYS_CONNECTIVITY_ACTION));
} catch (Throwable unused) {
}
}
public static void a(String str, ac acVar) {
synchronized (h) {
h.put(str, acVar);
}
}
public static String b() {
return f2506d;
}
public static String c() {
int i2 = e;
return i2 != 1 ? i2 != 2 ? i2 != 3 ? i2 != 4 ? "" : "4g" : "3g" : "2g" : "wifi";
}
public static String d() {
int i2 = e;
return i2 != 1 ? (i2 == 2 || i2 == 3 || i2 == 4) ? f2505c : IAPInjectService.EP_NULL : "wifi";
}
public static synchronized void e() {
boolean contains;
synchronized (x.class) {
int i2 = e;
try {
NetworkInfo activeNetworkInfo = ((ConnectivityManager) m.a().getSystemService("connectivity")).getActiveNetworkInfo();
if (activeNetworkInfo != null && activeNetworkInfo.isAvailable() && activeNetworkInfo.isConnected()) {
f2504b = true;
int type = activeNetworkInfo.getType();
if (type == 1) {
e = 1;
g = 0;
f = false;
WifiInfo connectionInfo = MethodDelegate.getConnectionInfo((WifiManager) m.a().getApplicationContext().getSystemService("wifi"));
f2506d = "ssid_" + connectionInfo.getSSID() + connectionInfo.getBSSID();
} else {
String extraInfo = activeNetworkInfo.getExtraInfo();
if (extraInfo != null) {
f2505c = extraInfo.trim().toLowerCase();
if (type == 0) {
f2506d = "apn_" + f2505c;
int subtype = activeNetworkInfo.getSubtype();
g = subtype;
if (subtype != 1 && subtype != 2 && subtype != 4) {
if (subtype != 13 && subtype != 19) {
e = 3;
contains = f2505c.contains("wap");
f = contains;
if (contains) {
j = f2505c.contains(l) ? "10.0.0.172" : f2505c.contains(k) ? "10.0.0.172" : f2505c.contains(m) ? "10.0.0.172" : f2505c.contains(n) ? "10.0.0.200" : "";
}
}
e = 4;
contains = f2505c.contains("wap");
f = contains;
if (contains) {
}
}
e = 2;
contains = f2505c.contains("wap");
f = contains;
if (contains) {
}
} else {
f2505c = "unknown";
e = 0;
g = -1;
f2506d = "unknown";
}
} else {
f2505c = "unknown";
e = 0;
g = -1;
f2506d = "unknown";
}
f = false;
}
} else {
f2505c = "unknown";
e = 0;
g = -1;
f2506d = "unknown";
f = false;
f2504b = false;
f2503a = (byte) 0;
}
if (i2 != e) {
synchronized (h) {
Iterator<ac> it = h.values().iterator();
while (it.hasNext()) {
if (it.next() != null) {
ac.a(e, f2506d);
}
}
}
}
} catch (Throwable th) {
try {
th.printStackTrace();
if (i2 != e) {
synchronized (h) {
Iterator<ac> it2 = h.values().iterator();
while (it2.hasNext()) {
if (it2.next() != null) {
ac.a(e, f2506d);
}
}
}
}
} catch (Throwable th2) {
if (i2 != e) {
synchronized (h) {
Iterator<ac> it3 = h.values().iterator();
while (it3.hasNext()) {
if (it3.next() != null) {
ac.a(e, f2506d);
}
}
}
}
throw th2;
}
}
}
}
public static String f() {
if (g == -1) {
return "unknown";
}
switch (g) {
case 0:
return "wifi";
case 1:
return "GPRS";
case 2:
return "EDGE";
case 3:
return "UMTS";
case 4:
return "CDMA";
case 5:
return "EVDO_0";
case 6:
return "EVDO_A";
case 7:
return "1xRTT";
case 8:
return "HSDPA";
case 9:
return "HSUPA";
case 10:
return "HSPA";
case 11:
return "iDen";
case 12:
return "EVDO_B";
case 13:
return "LTE";
case 14:
return "EHRPD";
case 15:
return "HSPAP";
default:
return "unknown";
}
}
public static int g() {
return e;
}
public static byte h() {
return f2503a;
}
public static boolean i() {
return f2504b;
}
public static boolean j() {
return f;
}
public static Integer k() {
e();
Integer num = 3;
boolean z = true;
int i2 = 0;
if (e != 2 && e != 3 && e != 4) {
z = false;
}
if (z) {
Context a2 = m.a();
String str = f2505c;
TelephonyManager telephonyManager = (TelephonyManager) a2.getSystemService("phone");
if (telephonyManager != null && telephonyManager.getSimState() == 5) {
String simOperator = telephonyManager.getSimOperator();
if (simOperator.length() > 0) {
if (!simOperator.equals("46000") && !simOperator.equals("46002")) {
if (!simOperator.equals("46001")) {
}
num = 2;
i2 = num.intValue();
}
num = 1;
i2 = num.intValue();
}
}
if (str != null) {
String lowerCase = str.toLowerCase();
if (!lowerCase.contains("cmnet") && !lowerCase.contains(Apn.APN_CMWAP)) {
if (!lowerCase.contains(Apn.APN_UNINET) && !lowerCase.contains(Apn.APN_UNIWAP) && !lowerCase.contains(Apn.APN_3GNET) && !lowerCase.contains(Apn.APN_3GWAP)) {
if (!lowerCase.contains(Apn.APN_CTNET)) {
}
i2 = num.intValue();
}
num = 2;
i2 = num.intValue();
}
num = 1;
i2 = num.intValue();
}
num = 0;
i2 = num.intValue();
}
return Integer.valueOf(i2);
}
public static Proxy l() {
if (!f || TextUtils.isEmpty(j)) {
return null;
}
return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(j, 80));
}
public static boolean m() {
try {
PowerManager powerManager = (PowerManager) m.a().getSystemService("power");
if (Build.VERSION.SDK_INT < 23 || powerManager == null) {
return false;
}
return ((Boolean) PowerManager.class.getDeclaredMethod("isDeviceIdleMode", new Class[0]).invoke(powerManager, new Object[0])).booleanValue();
} catch (Throwable unused) {
return false;
}
}
public static boolean o() {
if (Build.VERSION.SDK_INT < 21) {
f2503a = (byte) 1;
return false;
}
ConnectivityManager connectivityManager = (ConnectivityManager) m.a().getSystemService("connectivity");
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
if (activeNetworkInfo == null || !activeNetworkInfo.isAvailable() || !activeNetworkInfo.isConnected()) {
f2503a = (byte) 0;
return false;
}
try {
LinkProperties linkProperties = (LinkProperties) ConnectivityManager.class.getDeclaredMethod("getActiveLinkProperties", new Class[0]).invoke(connectivityManager, new Object[0]);
if (linkProperties == null) {
f2503a = (byte) 0;
} else {
f2503a = a(linkProperties.getInterfaceName());
}
} catch (Exception unused) {
f2503a = (byte) 0;
}
return true;
}
}