九游游戏中心HD v4.6.8.1版本的 MD5 值为:78c397802cc5ffdcc7f5502ede90502e
以下内容为反编译后的 ac.java 源代码,内容仅作参考
package anet.channel.strategy;
import android.text.TextUtils;
import java.lang.reflect.Constructor;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
public final class ac {
public static final String[] f216a = {"acs.m.taobao.com", "acs.wapa.taobao.com", "acs.waptest.taobao.com"};
public static final String[][] b = {new String[]{"140.205.160.82", "140.205.163.80"}, new String[]{"110.75.206.79"}, new String[]{"10.125.50.231"}};
public static final String[] c = {"acs4public.m.taobao.com", "acs4public.wapa.taobao.com", "yun.acs.waptest.taobao.com"};
public static final String[][] d = {new String[]{"140.205.166.94"}, new String[]{"140.205.109.98"}, new String[]{"10.125.4.134"}};
public static final String[] e = {"api.m.taobao.com", "api.wapa.taobao.com", "api.waptest.taobao.com"};
public interface a<T> {
boolean a(T t);
}
public static String a() {
return f216a[anet.channel.c.b().d];
}
public static String[] b() {
return b[anet.channel.c.b().d];
}
public static boolean a(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
return str.equalsIgnoreCase(a());
}
public static String b(String str) {
return str + a();
}
public static boolean c(String str) {
if (TextUtils.isEmpty(str)) {
return false;
}
String lowerCase = str.toLowerCase();
String a2 = a();
return lowerCase.equalsIgnoreCase(a2) || (lowerCase.startsWith("un") && lowerCase.endsWith(a2));
}
public static boolean d(String str) {
if (!c(str)) {
if (!(TextUtils.isEmpty(str) ? false : str.toLowerCase().endsWith(e[anet.channel.c.b().d])) && !anet.channel.strategy.b.a.a(str)) {
return false;
}
}
return true;
}
public static String a(String str, String str2) {
return new StringBuilder(str2 != null ? str2.length() + 10 : 32).append(str).append("://").append(str2).toString();
}
public static String e(String str) {
return new StringBuilder(str != null ? str.length() + 10 : 32).append("https://").append(str).toString();
}
public static String f(String str) {
int indexOf = str.indexOf("://");
if (indexOf == -1) {
throw new RuntimeException("invalid key");
}
return str.substring(indexOf + 3);
}
public static boolean g(String str) {
int indexOf = str.indexOf("://");
if (indexOf == -1) {
throw new RuntimeException("invalid key");
}
return str.substring(0, indexOf).equals("https");
}
public static String[] h(String str) {
if (TextUtils.isEmpty(str)) {
return null;
}
if (str.startsWith("//")) {
str = "http:" + str;
}
int indexOf = str.indexOf("://");
if (indexOf != -1) {
String[] strArr = new String[2];
String substring = str.substring(0, indexOf);
if ("http".equalsIgnoreCase(substring) || "https".equalsIgnoreCase(substring)) {
strArr[0] = substring;
int length = str.length();
int i = indexOf + 3;
while (i < length) {
char charAt = str.charAt(i);
if (charAt != '/' && charAt != ':' && charAt != '?' && charAt != '#') {
i++;
} else {
strArr[1] = str.substring(indexOf + 3, i);
return strArr;
}
}
if (i == length) {
strArr[1] = str.substring(indexOf + 3);
return strArr;
}
return null;
}
return null;
}
return null;
}
public static <T> int a(Collection<T> collection, a<T> aVar) {
if (collection == null) {
return -1;
}
int i = 0;
Iterator<T> it = collection.iterator();
while (it.hasNext() && !aVar.a(it.next())) {
i++;
}
if (i == collection.size()) {
return -1;
}
return i;
}
public static <K, V> V a(Map map, K k, Class cls) {
Object obj = map.get(k);
V v = (V) obj;
if (v == null) {
try {
Constructor constructor = cls.getConstructor(new Class[0]);
constructor.setAccessible(true);
v = (V) constructor.newInstance(new Object[0]);
} catch (Exception e2) {
}
map.put(k, v);
}
return v;
}
}