米多多 v3.0.1版本的 MD5 值为:f69e79dbe1787218a397ad907fb8f3ab
以下内容为反编译后的 o2.java 源代码,内容仅作参考
package c.i;
import android.content.Context;
import android.database.Cursor;
import android.net.Proxy;
import android.net.Uri;
import android.os.Build;
import android.text.TextUtils;
import java.net.InetSocketAddress;
import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
import java.util.List;
import java.util.Locale;
public final class o2 {
public static String a() {
String str;
try {
str = Proxy.getDefaultHost();
} catch (Throwable th) {
u2.d(th, "ProxyUtil", "getDefHost");
str = null;
}
return str == null ? "null" : str;
}
public static java.net.Proxy b(Context context) {
try {
return Build.VERSION.SDK_INT >= 11 ? c(context, new URI("http://restapi.amap.com")) : e(context);
} catch (Throwable th) {
u2.d(th, "ProxyUtil", "getProxy");
return null;
}
}
public static java.net.Proxy c(Context context, URI uri) {
java.net.Proxy proxy;
if (f(context)) {
try {
List<java.net.Proxy> select = ProxySelector.getDefault().select(uri);
if (select == null || select.isEmpty() || (proxy = select.get(0)) == null) {
return null;
}
if (proxy.type() == Proxy.Type.DIRECT) {
return null;
}
return proxy;
} catch (Throwable th) {
u2.d(th, "ProxyUtil", "getProxySelectorCfg");
}
}
return null;
}
public static int d() {
try {
return android.net.Proxy.getDefaultPort();
} catch (Throwable th) {
u2.d(th, "ProxyUtil", "getDefPort");
return -1;
}
}
public static java.net.Proxy e(Context context) {
Cursor cursor;
int i2;
String v;
int i3;
Throwable th;
boolean z;
boolean z2;
int d2;
boolean z3;
boolean z4;
if (f(context)) {
Uri parse = Uri.parse("content://telephony/carriers/preferapn");
?? contentResolver = context.getContentResolver();
String str = null;
boolean z5 = false;
try {
try {
cursor = contentResolver.query(parse, null, null, null, null);
} catch (Throwable th2) {
if (contentResolver != 0) {
try {
contentResolver.close();
} catch (Throwable th3) {
u2.d(th3, "ProxyUtil", "getHostProxy2");
th3.printStackTrace();
}
}
throw th2;
}
} catch (SecurityException e2) {
e = e2;
cursor = null;
str = null;
} catch (Throwable th4) {
th = th4;
cursor = null;
str = null;
}
if (cursor != null) {
try {
} catch (SecurityException e3) {
e = e3;
str = null;
i2 = -1;
u2.d(e, "ProxyUtil", "getHostProxy");
v = l2.v(context);
if (v != null) {
}
if (cursor != null) {
}
i2 = i3;
if (str != null) {
}
if (z5) {
}
return null;
} catch (Throwable th5) {
th = th5;
str = null;
i2 = -1;
u2.d(th, "ProxyUtil", "getHostProxy1");
th.printStackTrace();
if (cursor != null) {
}
if (str != null) {
}
if (z5) {
}
return null;
}
if (cursor.moveToFirst()) {
String string = cursor.getString(cursor.getColumnIndex("apn"));
i2 = parse;
if (string != null) {
Locale locale = Locale.US;
string = string.toLowerCase(locale);
i2 = locale;
}
try {
try {
if (string != null && string.contains("ctwap")) {
String a2 = a();
d2 = d();
if (TextUtils.isEmpty(a2) || a2.equals("null")) {
str = null;
z4 = false;
} else {
str = a2;
z4 = true;
}
if (!z4) {
str = r2.o("QMTAuMC4wLjIwMA==");
}
} else if (string != null && string.contains("wap")) {
String a3 = a();
d2 = d();
if (TextUtils.isEmpty(a3) || a3.equals("null")) {
str = null;
z3 = false;
} else {
str = a3;
z3 = true;
}
if (!z3) {
str = r2.o("QMTAuMC4wLjE3Mg==");
}
}
if (cursor != null) {
try {
cursor.close();
} catch (Throwable th6) {
th = th6;
u2.d(th, "ProxyUtil", "getHostProxy2");
th.printStackTrace();
i2 = i3;
if (str != null) {
}
if (z5) {
}
return null;
}
}
} catch (SecurityException e4) {
e = e4;
str = null;
u2.d(e, "ProxyUtil", "getHostProxy");
v = l2.v(context);
if (v != null) {
String lowerCase = v.toLowerCase(Locale.US);
String a4 = a();
int d3 = d();
if (lowerCase.indexOf("ctwap") != -1) {
if (TextUtils.isEmpty(a4) || a4.equals("null")) {
z2 = false;
} else {
str = a4;
z2 = true;
}
if (!z2) {
str = r2.o("QMTAuMC4wLjIwMA==");
}
} else {
if (lowerCase.indexOf("wap") != -1) {
if (TextUtils.isEmpty(a4) || a4.equals("null")) {
z = false;
} else {
str = a4;
z = true;
}
if (!z) {
str = r2.o("QMTAuMC4wLjE3Mg==");
}
i3 = 80;
}
i3 = d3;
}
} else {
i3 = i2;
}
if (cursor != null) {
try {
cursor.close();
} catch (Throwable th7) {
th = th7;
u2.d(th, "ProxyUtil", "getHostProxy2");
th.printStackTrace();
i2 = i3;
if (str != null) {
}
if (z5) {
}
return null;
}
}
i2 = i3;
if (str != null) {
}
if (z5) {
}
return null;
} catch (Throwable th8) {
th = th8;
str = null;
u2.d(th, "ProxyUtil", "getHostProxy1");
th.printStackTrace();
if (cursor != null) {
try {
cursor.close();
} catch (Throwable th9) {
u2.d(th9, "ProxyUtil", "getHostProxy2");
th9.printStackTrace();
}
}
if (str != null) {
}
if (z5) {
}
return null;
}
} catch (SecurityException e5) {
e = e5;
u2.d(e, "ProxyUtil", "getHostProxy");
v = l2.v(context);
if (v != null) {
}
if (cursor != null) {
}
i2 = i3;
if (str != null) {
}
if (z5) {
}
return null;
} catch (Throwable th10) {
th = th10;
u2.d(th, "ProxyUtil", "getHostProxy1");
th.printStackTrace();
if (cursor != null) {
}
if (str != null) {
}
if (z5) {
}
return null;
}
i2 = i3;
if (str != null) {
try {
if (str.length() > 0 && i2 != -1) {
z5 = true;
}
} catch (Throwable th11) {
u2.d(th11, "ProxyUtil", "getHostProxy2");
th11.printStackTrace();
}
}
if (z5) {
return new java.net.Proxy(Proxy.Type.HTTP, InetSocketAddress.createUnresolved(str, i2));
}
}
}
str = null;
i3 = -1;
if (cursor != null) {
}
i2 = i3;
if (str != null) {
}
if (z5) {
}
}
return null;
}
public static boolean f(Context context) {
return l2.t(context) == 0;
}
}