米多多 v3.0.1版本的 MD5 值为:f69e79dbe1787218a397ad907fb8f3ab
以下内容为反编译后的 j2.java 源代码,内容仅作参考
package c.i;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.os.Build;
import android.text.TextUtils;
import com.alipay.alipaysecuritysdk.common.config.Constant;
import java.lang.reflect.Field;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import okhttp3.HttpUrl;
import org.json.JSONObject;
public final class j2 {
public static int f5356a = -1;
public static String f5357b = "";
public static class a {
public int f5358a = -1;
public JSONObject f5359b;
public JSONObject f5360c;
public JSONObject f5361d;
public JSONObject f5362e;
public JSONObject f5363f;
public JSONObject f5364g;
public JSONObject f5365h;
public JSONObject f5366i;
public JSONObject f5367j;
public C0136a f5368k;
public d l;
public c m;
public b n;
public b o;
public b p;
public static class C0136a {
public boolean f5369a;
public JSONObject f5370b;
}
public static class b {
public boolean f5371a;
public String f5372b;
public String f5373c;
public String f5374d;
}
public static class c {
public String f5375a;
public String f5376b;
}
public static class d {
public String f5377a;
public String f5378b;
public String f5379c;
}
}
public static class b extends l0 {
public String f5380f;
public Map<String, String> f5381g;
public b(Context context, q2 q2Var, String str) {
super(context, q2Var);
this.f5380f = str;
this.f5381g = null;
}
@Override
public final Map<String, String> a() {
return null;
}
@Override
public final String d() {
return "https://restapi.amap.com/v3/iasdkauth";
}
@Override
public final byte[] i() {
return null;
}
@Override
public final byte[] j() {
return r2.j(r2.c(r()));
}
@Override
public final String k() {
return "3.0";
}
public final Map<String, String> r() {
String x = l2.x(this.f5400d);
if (!TextUtils.isEmpty(x)) {
x = n2.d(new StringBuilder(x).reverse().toString());
}
HashMap hashMap = new HashMap();
hashMap.put("authkey", this.f5380f);
hashMap.put("plattype", Constant.SDK_OS);
hashMap.put("product", this.f5401e.a());
hashMap.put("version", this.f5401e.e());
hashMap.put("output", "json");
StringBuilder sb = new StringBuilder();
sb.append(Build.VERSION.SDK_INT);
hashMap.put("androidversion", sb.toString());
hashMap.put("deviceId", x);
Map<String, String> map = this.f5381g;
if (map != null && !map.isEmpty()) {
hashMap.putAll(this.f5381g);
}
String str = null;
if (Build.VERSION.SDK_INT >= 21) {
try {
ApplicationInfo applicationInfo = this.f5400d.getApplicationInfo();
Field declaredField = Class.forName(ApplicationInfo.class.getName()).getDeclaredField("primaryCpuAbi");
declaredField.setAccessible(true);
str = (String) declaredField.get(applicationInfo);
} catch (Throwable th) {
u2.d(th, "ConfigManager", "getcpu");
}
}
if (TextUtils.isEmpty(str)) {
str = Build.CPU_ABI;
}
hashMap.put("abitype", str);
hashMap.put("ext", this.f5401e.h());
return hashMap;
}
}
public static a a(Context context, q2 q2Var, String str) {
byte[] bArr;
q0 q0Var;
String str2;
String str3;
String str4;
List<String> list;
byte[] bArr2;
a aVar = new a();
String str5 = null;
try {
try {
} catch (com.loc.j e2) {
e = e2;
} catch (Throwable unused) {
}
} catch (com.loc.j e3) {
e = e3;
bArr = null;
q0Var = null;
} catch (IllegalBlockSizeException unused2) {
bArr = null;
q0Var = null;
} catch (Throwable th) {
th = th;
bArr = null;
q0Var = null;
}
try {
q0Var = k0.b(new b(context, q2Var, str), true);
if (q0Var != null) {
try {
bArr = q0Var.f5464a;
} catch (com.loc.j e4) {
e = e4;
str2 = "off";
str4 = "11C";
str3 = "11B";
bArr = null;
e.a();
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused3) {
str2 = "off";
str4 = "11C";
str3 = "11B";
bArr = null;
} catch (Throwable th2) {
th = th2;
str2 = "off";
str4 = "11C";
str3 = "11B";
bArr = null;
u2.d(th, "ConfigManager", "loadConfig");
if (bArr != null) {
}
}
} else {
bArr = null;
}
try {
bArr2 = new byte[16];
str4 = "11C";
} catch (com.loc.j e5) {
e = e5;
str2 = "off";
str4 = "11C";
} catch (IllegalBlockSizeException unused4) {
str2 = "off";
str4 = "11C";
} catch (Throwable th3) {
th = th3;
str2 = "off";
str4 = "11C";
}
try {
byte[] bArr3 = new byte[bArr.length - 16];
str3 = "11B";
try {
System.arraycopy(bArr, 0, bArr2, 0, 16);
str2 = "off";
try {
System.arraycopy(bArr, 16, bArr3, 0, bArr.length - 16);
SecretKeySpec secretKeySpec = new SecretKeySpec(bArr2, "AES");
Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
cipher.init(2, secretKeySpec, new IvParameterSpec(r2.i()));
str5 = r2.d(cipher.doFinal(bArr3));
} catch (com.loc.j e6) {
e = e6;
q0Var = q0Var;
e.a();
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused5) {
} catch (Throwable th4) {
th = th4;
q0Var = q0Var;
u2.d(th, "ConfigManager", "loadConfig");
if (bArr != null) {
}
}
} catch (com.loc.j e7) {
e = e7;
str2 = "off";
} catch (IllegalBlockSizeException unused6) {
str2 = "off";
} catch (Throwable th5) {
th = th5;
str2 = "off";
}
} catch (com.loc.j e8) {
e = e8;
str2 = "off";
str3 = "11B";
q0Var = q0Var;
e.a();
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused7) {
str2 = "off";
str3 = "11B";
q0Var = q0Var;
if (bArr != null) {
}
} catch (Throwable th6) {
th = th6;
str2 = "off";
str3 = "11B";
q0Var = q0Var;
u2.d(th, "ConfigManager", "loadConfig");
if (bArr != null) {
}
}
q0Var = q0Var;
if (bArr != null) {
return aVar;
}
if (TextUtils.isEmpty(str5)) {
str5 = r2.d(bArr);
}
try {
JSONObject jSONObject = new JSONObject(str5);
if (jSONObject.has("status")) {
int i2 = jSONObject.getInt("status");
if (i2 == 1) {
f5356a = 1;
} else if (i2 == 0) {
String str6 = "authcsid";
String str7 = "authgsid";
if (q0Var != null) {
str6 = q0Var.f5466c;
if (q0Var.f5465b != null && (list = q0Var.f5465b.get("gsid")) != null && list.size() > 0) {
str7 = list.get(0);
}
}
r2.e(context, str6, str7, jSONObject.toString());
f5356a = 0;
if (jSONObject.has("info")) {
f5357b = jSONObject.getString("info");
}
if (f5356a == 0) {
return aVar;
}
}
if (jSONObject.has("ver")) {
aVar.f5358a = jSONObject.getInt("ver");
}
if (r2.h(jSONObject, "result")) {
a.C0136a c0136a = new a.C0136a();
c0136a.f5369a = false;
aVar.f5368k = c0136a;
JSONObject jSONObject2 = jSONObject.getJSONObject("result");
if (r2.h(jSONObject2, "11K")) {
JSONObject jSONObject3 = jSONObject2.getJSONObject("11K");
c0136a.f5369a = e(jSONObject3.getString("able"), false);
String str8 = str2;
if (jSONObject3.has(str8)) {
c0136a.f5370b = jSONObject3.getJSONObject(str8);
}
}
String str9 = str3;
if (r2.h(jSONObject2, str9)) {
aVar.f5360c = jSONObject2.getJSONObject(str9);
}
String str10 = str4;
if (r2.h(jSONObject2, str10)) {
aVar.f5363f = jSONObject2.getJSONObject(str10);
}
if (r2.h(jSONObject2, "11I")) {
aVar.f5364g = jSONObject2.getJSONObject("11I");
}
if (r2.h(jSONObject2, "11H")) {
aVar.f5365h = jSONObject2.getJSONObject("11H");
}
if (r2.h(jSONObject2, "11E")) {
jSONObject2.getJSONObject("11E");
}
if (r2.h(jSONObject2, "11F")) {
aVar.f5366i = jSONObject2.getJSONObject("11F");
}
if (r2.h(jSONObject2, "13A")) {
jSONObject2.getJSONObject("13A");
}
if (r2.h(jSONObject2, "13J")) {
aVar.f5361d = jSONObject2.getJSONObject("13J");
}
if (r2.h(jSONObject2, "11G")) {
aVar.f5367j = jSONObject2.getJSONObject("11G");
}
if (r2.h(jSONObject2, "001")) {
JSONObject jSONObject4 = jSONObject2.getJSONObject("001");
a.d dVar = new a.d();
if (jSONObject4 != null) {
String b2 = b(jSONObject4, Constant.IN_KEY_FACE_MD5);
String b3 = b(jSONObject4, "url");
String b4 = b(jSONObject4, "sdkversion");
if (!TextUtils.isEmpty(b2) && !TextUtils.isEmpty(b3) && !TextUtils.isEmpty(b4)) {
dVar.f5377a = b3;
dVar.f5378b = b2;
dVar.f5379c = b4;
}
}
aVar.l = dVar;
}
if (r2.h(jSONObject2, "002")) {
JSONObject jSONObject5 = jSONObject2.getJSONObject("002");
a.c cVar = new a.c();
if (jSONObject5 != null) {
String b5 = b(jSONObject5, Constant.IN_KEY_FACE_MD5);
String b6 = b(jSONObject5, "url");
cVar.f5376b = b5;
cVar.f5375a = b6;
}
aVar.m = cVar;
}
if (r2.h(jSONObject2, "006")) {
jSONObject2.getJSONObject("006");
}
if (r2.h(jSONObject2, "010")) {
jSONObject2.getJSONObject("010");
}
if (r2.h(jSONObject2, "11Z")) {
JSONObject jSONObject6 = jSONObject2.getJSONObject("11Z");
a.b bVar = new a.b();
d(jSONObject6, bVar);
aVar.n = bVar;
}
if (r2.h(jSONObject2, "135")) {
aVar.f5362e = jSONObject2.getJSONObject("135");
}
if (r2.h(jSONObject2, "13S")) {
aVar.f5359b = jSONObject2.getJSONObject("13S");
}
if (r2.h(jSONObject2, "121")) {
JSONObject jSONObject7 = jSONObject2.getJSONObject("121");
a.b bVar2 = new a.b();
d(jSONObject7, bVar2);
aVar.o = bVar2;
}
if (r2.h(jSONObject2, "122")) {
JSONObject jSONObject8 = jSONObject2.getJSONObject("122");
a.b bVar3 = new a.b();
d(jSONObject8, bVar3);
aVar.p = bVar3;
}
if (r2.h(jSONObject2, "123")) {
d(jSONObject2.getJSONObject("123"), new a.b());
}
}
return aVar;
}
} catch (Throwable th7) {
u2.d(th7, "AuthConfigManager", "loadConfig");
}
return aVar;
} catch (com.loc.j e9) {
e = e9;
throw e;
} catch (Throwable unused8) {
throw new com.loc.j("未知的错误");
}
}
public static String b(JSONObject jSONObject, String str) {
return (jSONObject == null || !jSONObject.has(str) || jSONObject.getString(str).equals(HttpUrl.PATH_SEGMENT_ENCODE_SET_URI)) ? "" : jSONObject.optString(str);
}
@Deprecated
public static void c(String str) {
i2.d(str);
}
public static void d(JSONObject jSONObject, a.b bVar) {
if (bVar != null) {
try {
String b2 = b(jSONObject, "m");
String b3 = b(jSONObject, "u");
String b4 = b(jSONObject, "v");
String b5 = b(jSONObject, "able");
bVar.f5373c = b2;
bVar.f5372b = b3;
bVar.f5374d = b4;
bVar.f5371a = e(b5, false);
} catch (Throwable th) {
u2.d(th, "ConfigManager", "parsePluginEntity");
}
}
}
public static boolean e(String str, boolean z) {
try {
String[] split = URLDecoder.decode(str).split("/");
return split[split.length - 1].charAt(4) % 2 == 1;
} catch (Throwable unused) {
return z;
}
}
}