CEEX v1.0.1版本的 MD5 值为:d20246587215ec3471b0d051724c6d34
以下内容为反编译后的 a2.java 源代码,内容仅作参考
package com.geetest.sdk;
import android.content.Context;
import android.text.TextUtils;
import com.google.common.net.HttpHeaders;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
public class a2 extends aw<JSONObject> {
private com.geetest.sdk.model.beans.b j;
private a2(String str, Context context) {
super(str, context);
}
public static a2 a(Context context, com.geetest.sdk.model.beans.b bVar) {
a2 a2Var = new a2(a(bVar), context);
a2Var.d(0);
a2Var.o("GetCoder");
a2Var.j = bVar;
return a2Var;
}
@Override
protected boolean i(int i, az<String, JSONObject> azVar, JSONObject jSONObject) {
F f;
String optString = jSONObject.optString("user_error");
try {
if (!TextUtils.isEmpty(optString)) {
try {
f = URLDecoder.decode(optString, "utf-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
f = optString;
}
String optString2 = jSONObject.optString("error_code");
if (optString2 != null) {
optString2 = optString2.replaceAll("[a-zA-Z]", "");
}
azVar.a = f;
?? jSONObject2 = new JSONObject();
jSONObject2.put("error_code", optString2);
azVar.b = jSONObject2;
return true;
}
JSONObject optJSONObject = jSONObject.optJSONObject("data");
if (optJSONObject == null) {
azVar.a = jSONObject.toString() + ": " + b("data");
return false;
}
String optString3 = optJSONObject.optString(com.umeng.commonsdk.proguard.g.ap);
String optString4 = optJSONObject.optString("theme_version");
String optString5 = optJSONObject.optString("feedback");
String str = TextUtils.isEmpty(optString5) ? "" : optString5;
String optString6 = optJSONObject.optString("api_server");
if (TextUtils.isEmpty(optString6)) {
azVar.a = jSONObject.toString() + ": " + b("api_server");
return false;
}
String optString7 = optJSONObject.optString("theme");
if (!optJSONObject.has("logo")) {
azVar.a = jSONObject.toString() + ": " + b("logo");
return false;
}
boolean optBoolean = optJSONObject.optBoolean("logo");
com.geetest.sdk.model.beans.f.a(optBoolean);
JSONArray optJSONArray = optJSONObject.optJSONArray("static_servers");
ArrayList arrayList = new ArrayList();
if (optJSONArray != null) {
for (int i2 = 0; optJSONArray.length() > i2; i2++) {
String optString8 = optJSONArray.optString(i2);
if (!TextUtils.isEmpty(optString8)) {
arrayList.add(optString8);
}
}
}
if (arrayList.size() == 0) {
azVar.a = jSONObject.toString() + ": " + b("static_servers");
return false;
}
ArrayList arrayList2 = new ArrayList();
JSONArray optJSONArray2 = optJSONObject.optJSONArray("c");
if (optJSONArray2 != null) {
for (int i3 = 0; i3 < optJSONArray2.length(); i3++) {
arrayList2.add(Integer.valueOf(optJSONArray2.optInt(i3)));
}
}
com.geetest.sdk.model.beans.g gVar = new com.geetest.sdk.model.beans.g();
gVar.a(optString6);
gVar.a(arrayList2);
gVar.b(str);
gVar.a(optBoolean);
gVar.b(arrayList);
gVar.d(optString7);
gVar.e(optString4);
gVar.c(optString3);
this.j.a(gVar);
azVar.a = "OK";
azVar.b = jSONObject;
return true;
} catch (Exception e2) {
e2.printStackTrace();
azVar.a = jSONObject.toString() + ": " + e2.toString();
return false;
}
}
@Override
public Map<String, String> n() {
HashMap hashMap = new HashMap();
hashMap.put(HttpHeaders.CONTENT_TYPE, "application/x-www-form-urlencoded");
com.geetest.sdk.model.beans.b bVar = this.j;
if (bVar != null) {
hashMap.put(HttpHeaders.HOST, bVar.b());
}
byte[] bArr = this.f;
hashMap.put(HttpHeaders.CONTENT_LENGTH, String.valueOf(bArr == null ? 0 : bArr.length));
return hashMap;
}
@Override
public boolean q() {
return false;
}
private static String a(com.geetest.sdk.model.beans.b bVar) {
String str = "&w=";
String a = com.geetest.sdk.utils.q.a();
bVar.a(a);
try {
JSONObject jSONObject = new JSONObject();
jSONObject.put("lang", bVar.m() == null ? "" : bVar.m());
str = "&w=" + a4.b(jSONObject.toString(), a) + a9.b(a);
} catch (Exception e) {
e.printStackTrace();
}
return String.format("https://%s/get.php?gt=", bVar.b()) + bVar.k() + "&challenge=" + bVar.c() + "&client_type=android&lang=" + bVar.m() + "&client_type=android" + str;
}
}