九游游戏中心HD v4.6.8.1版本的 MD5 值为:78c397802cc5ffdcc7f5502ede90502e
以下内容为反编译后的 c.java 源代码,内容仅作参考
package com.taobao.wireless.security.adapter.a;
import android.content.Context;
import com.taobao.dp.DeviceSecuritySDK;
import com.taobao.dp.http.DefaultUrlRequestService;
import com.taobao.wireless.security.sdk.SecurityGuardManager;
import com.taobao.wireless.security.sdk.datacollection.IDataCollectionComponent;
import com.taobao.wireless.security.sdk.staticdatastore.IStaticDataStoreComponent;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.http.HttpEntity;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
import org.json.JSONObject;
public final class c {
private static String f4319a = "((((ftp:|https:|http:)([\\Q/\\\\E])*)|())(((%[0-9a-fA-F][0-9a-fA-F])|([a-zA-Z0-9])|([\\Q$-_.+!*'(),;?&=\\E]))+(:((%[0-9a-fA-F][0-9a-fA-F])|([a-zA-Z0-9])|([\\Q$-_.+!*'(),;?&=\\E]))*)?@)?(((((([a-zA-Z0-9]){1}([a-zA-Z0-9\\-])*([a-zA-Z0-9]{1}))|([a-zA-Z0-9]))\\.)+(biz|com|edu|gov|info|int|mil|name|net|org|pro|aero|cat|coop|jobs|museum|travel|arpa|root|mobi|post|tel|asia|geo|kid|mail|sco|web|xxx|nato|example|invalid|test|bitnet|csnet|onion|uucp|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw))|([0-9]{1,3}(\\.[0-9]{1,3}){3}))(\\:([0-9]+))?(([\\Q/\\\\E])+((((%[0-9a-fA-F][0-9a-fA-F])|([a-zA-Z0-9])|([\\Q$-_.+\\!*'(),;:@&=\\E]))*)(([\\Q/\\\\E])*((%[0-9a-fA-F]{2})|([a-zA-Z0-9])|([\\Q$-_.+\\!*'(),;:@&=\\E]))*)*)(\\?((%[0-9a-fA-F]{2})|([a-zA-Z0-9])|([\\Q$-_.+!*'(),;:@&=<>#\"{}[] ^`~|\\/\\E]))*)*)*)";
private static String b = "";
private static String c = "http://wlc.alibaba-inc.com/kgbreport";
public static int a(String str, Context context) {
if (context == null || str == null) {
return 3;
}
DeviceSecuritySDK.getInstance(context).init(new DefaultUrlRequestService());
String securityToken = DeviceSecuritySDK.getInstance(context).getSecurityToken();
if (securityToken == null) {
return 1;
}
Matcher matcher = Pattern.compile(f4319a).matcher(str);
HashSet hashSet = new HashSet();
while (matcher.find()) {
hashSet.add(matcher.group());
}
return a(hashSet, securityToken, context);
}
private static int a(HashSet hashSet, String str, Context context) {
JSONObject jSONObject;
SecurityGuardManager securityGuardManager;
String str2;
String str3;
String str4;
String str5;
String str6;
String staticSafeEncrypt;
if (hashSet.size() <= 0) {
return 4;
}
try {
JSONArray jSONArray = new JSONArray((Collection) hashSet);
jSONObject = new JSONObject();
jSONObject.put("urls", jSONArray);
jSONObject.put("token", str);
jSONObject.put("appname", "mobileclient");
jSONObject.put("type", "3");
securityGuardManager = SecurityGuardManager.getInstance(context);
str2 = "";
str3 = "";
} catch (Throwable th) {
}
if (securityGuardManager != null) {
IDataCollectionComponent dataCollectionComp = securityGuardManager.getDataCollectionComp();
str2 = dataCollectionComp != null ? dataCollectionComp.getNick() : "";
IStaticDataStoreComponent staticDataStoreComp = securityGuardManager.getStaticDataStoreComp();
str3 = staticDataStoreComp.getAppKeyByIndex(0);
if (b != null && b.length() > 0) {
String extraData = staticDataStoreComp.getExtraData(b);
str4 = str3;
str5 = str2;
str6 = extraData;
if (str5 == null) {
str5 = "";
}
jSONObject.put("sendertbaccount", str5);
staticSafeEncrypt = securityGuardManager == null ? securityGuardManager.getStaticDataEncryptComp().staticSafeEncrypt(16, str4, jSONObject.toString()) : "";
if (staticSafeEncrypt != null) {
return 5;
}
JSONObject jSONObject2 = new JSONObject();
String str7 = "";
if (str6 != null && str6.length() > 0) {
str7 = b(str6);
}
long currentTimeMillis = System.currentTimeMillis() / 1000;
String b2 = b(currentTimeMillis + "alibaba_antitrojan_client" + currentTimeMillis);
jSONObject2.put("t", currentTimeMillis);
jSONObject2.put("sign", b2);
jSONObject2.put("appkey", str4);
jSONObject2.put("keymd5", str7);
jSONObject2.put("content", staticSafeEncrypt);
ArrayList arrayList = new ArrayList();
Iterator<String> keys = jSONObject2.keys();
while (keys.hasNext()) {
String next = keys.next();
arrayList.add(new BasicNameValuePair(next, jSONObject2.getString(next)));
}
com.taobao.wireless.security.adapter.common.b a2 = com.taobao.wireless.security.adapter.common.c.a(c, (Map) null, (HttpEntity) new UrlEncodedFormEntity(arrayList, "UTF-8"));
if (a2.b() == 200) {
int i = new JSONObject(new String(a2.a(), "UTF-8")).getInt("code");
if (i == 0) {
return 0;
}
return i + 100;
}
return 2;
}
}
str4 = str3;
str5 = str2;
str6 = "";
if (str5 == null) {
}
jSONObject.put("sendertbaccount", str5);
if (securityGuardManager == null) {
}
if (staticSafeEncrypt != null) {
}
}
public static void a(String str) {
b = str;
}
private static String b(String str) {
try {
MessageDigest messageDigest = MessageDigest.getInstance("MD5");
if (str != null && !"".equals(str)) {
byte[] digest = messageDigest.digest(str.getBytes());
StringBuffer stringBuffer = new StringBuffer();
for (byte b2 : digest) {
stringBuffer.append(Integer.toHexString((b2 & 255) | 256).substring(1, 3));
}
return stringBuffer.toString();
}
} catch (NoSuchAlgorithmException e) {
}
return "";
}
}