百草园 v7.5版本的 MD5 值为:17f49811374a404d232d5b2cc35bf30f
以下内容为反编译后的 C0117d.java 源代码,内容仅作参考
package com.baidu.cyberplayer.utils;
import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Proxy;
public class C0117d {
private static final String a = "d";
private boolean f516a;
private String b;
private String c;
private String d;
private String e;
public C0117d(Context context) {
C0121h.a(context, "android.permission.INTERNET");
C0121h.a(context, "android.permission.ACCESS_NETWORK_STATE");
a(context);
}
private void a(Context context) {
NetworkInfo activeNetworkInfo;
this.e = "connectionless";
this.f516a = false;
ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService("connectivity");
if (connectivityManager == null || (activeNetworkInfo = connectivityManager.getActiveNetworkInfo()) == null) {
return;
}
if ("wifi".equals(activeNetworkInfo.getTypeName().toLowerCase())) {
this.e = "wifi";
this.f516a = false;
} else {
a(context, activeNetworkInfo);
this.e = this.b;
}
}
private void a(Context context, NetworkInfo networkInfo) {
String lowerCase;
if (networkInfo.getExtraInfo() != null && (lowerCase = networkInfo.getExtraInfo().toLowerCase()) != null) {
if (lowerCase.startsWith("cmwap") || lowerCase.startsWith("uniwap") || lowerCase.startsWith("3gwap")) {
this.f516a = true;
this.b = lowerCase;
this.c = "10.0.0.172";
this.d = "80";
return;
}
if (lowerCase.startsWith("ctwap")) {
this.f516a = true;
this.b = lowerCase;
this.c = "10.0.0.200";
this.d = "80";
return;
}
if (lowerCase.startsWith("cmnet") || lowerCase.startsWith("uninet") || lowerCase.startsWith("ctnet") || lowerCase.startsWith("3gnet")) {
this.f516a = false;
this.b = lowerCase;
return;
}
}
String defaultHost = Proxy.getDefaultHost();
int defaultPort = Proxy.getDefaultPort();
if (defaultHost == null || defaultHost.length() <= 0) {
this.f516a = false;
return;
}
this.c = defaultHost;
if ("10.0.0.172".equals(this.c.trim()) || "10.0.0.200".equals(this.c.trim())) {
this.f516a = true;
this.d = "80";
} else {
this.f516a = false;
this.d = Integer.toString(defaultPort);
}
}
public static boolean m502a(Context context) {
ConnectivityManager connectivityManager = (ConnectivityManager) context.getApplicationContext().getSystemService("connectivity");
if (connectivityManager == null) {
return false;
}
NetworkInfo networkInfo = connectivityManager.getNetworkInfo(1);
if (networkInfo != null && networkInfo.isConnected()) {
return true;
}
NetworkInfo networkInfo2 = connectivityManager.getNetworkInfo(0);
if (networkInfo2 != null && networkInfo2.isConnected()) {
return true;
}
NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting();
}
public String a() {
return this.c;
}
public boolean m503a() {
return this.f516a;
}
public String b() {
return this.d;
}
public String c() {
return this.e;
}
}