工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853
以下内容为反编译后的 ib.java 源代码,内容仅作参考
package com.loc;
import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import com.uusafe.sandbox.controller.Protocol;
import com.zhizhangyi.platform.network.download.internal.Downloads;
import java.net.URLDecoder;
import java.util.HashMap;
import java.util.Map;
import javax.crypto.Cipher;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
import org.json.JSONException;
import org.json.JSONObject;
public final class ib {
public static int f5838a = -1;
public static String f5839b = "";
public static class a {
public c A;
public b B;
public b C;
public b D;
public b E;
public String f5840a;
public int f5841b = -1;
@Deprecated
public JSONObject f5842c;
@Deprecated
public JSONObject f5843d;
@Deprecated
public JSONObject f5844e;
@Deprecated
public JSONObject f;
@Deprecated
public JSONObject g;
@Deprecated
public JSONObject h;
@Deprecated
public JSONObject i;
@Deprecated
public JSONObject j;
@Deprecated
public JSONObject k;
@Deprecated
public JSONObject l;
@Deprecated
public JSONObject m;
@Deprecated
public JSONObject n;
@Deprecated
public JSONObject o;
@Deprecated
public JSONObject p;
@Deprecated
public JSONObject q;
@Deprecated
public JSONObject r;
@Deprecated
public JSONObject s;
@Deprecated
public JSONObject t;
@Deprecated
public JSONObject u;
@Deprecated
public JSONObject v;
public JSONObject w;
public C0091a x;
public d y;
@Deprecated
public c z;
public static class C0091a {
public boolean f5845a;
public boolean f5846b;
public JSONObject f5847c;
}
public static class b {
public boolean f5848a;
public String f5849b;
public String f5850c;
public String f5851d;
public boolean f5852e;
}
public static class c {
public String f5853a;
public String f5854b;
}
public static class d {
public String f5855a;
public String f5856b;
public String f5857c;
}
}
public static class b extends Y {
private String f;
private Map<String, String> g;
private boolean h;
b(Context context, rb rbVar, String str) {
super(context, rbVar);
this.f = str;
this.g = null;
this.h = Build.VERSION.SDK_INT != 19;
}
@Override
public final Map<String, String> a() {
return null;
}
@Override
public final String c() {
return this.h ? "https://restapi.amap.com/v3/iasdkauth" : "http://restapi.amap.com/v3/iasdkauth";
}
@Override
public final byte[] e() {
return null;
}
@Override
public final byte[] f() {
String t = mb.t(this.f5759d);
if (TextUtils.isEmpty(t)) {
t = mb.c();
}
if (!TextUtils.isEmpty(t)) {
t = ob.b(new StringBuilder(t).reverse().toString());
}
HashMap hashMap = new HashMap();
hashMap.put("authkey", this.f);
hashMap.put("plattype", "android");
hashMap.put("product", this.f5760e.a());
hashMap.put("version", this.f5760e.b());
hashMap.put("output", "json");
StringBuilder sb = new StringBuilder();
sb.append(Build.VERSION.SDK_INT);
hashMap.put("androidversion", sb.toString());
hashMap.put("deviceId", t);
hashMap.put("manufacture", Build.MANUFACTURER);
Map<String, String> map = this.g;
if (map != null && !map.isEmpty()) {
hashMap.putAll(this.g);
}
hashMap.put("abitype", sb.a(this.f5759d));
hashMap.put("ext", this.f5760e.d());
return sb.a(sb.a(hashMap));
}
@Override
protected final String g() {
return "3.0";
}
public final boolean k() {
return this.h;
}
}
public static a a(Context context, rb rbVar, String str) {
String str2;
String str3;
String str4;
byte[] bArr;
C0420ea c0420ea;
String str5;
StringBuilder sb;
byte[] bArr2;
byte[] bArr3;
a aVar = new a();
aVar.w = new JSONObject();
try {
try {
new X();
try {
sb = new StringBuilder();
sb.append(str);
str2 = "001";
} catch (C0431k e2) {
e = e2;
} catch (Throwable unused) {
}
try {
sb.append(";14N");
b bVar = new b(context, rbVar, sb.toString());
c0420ea = X.a(bVar, bVar.k());
if (c0420ea != null) {
try {
bArr = c0420ea.f5802a;
} catch (C0431k e3) {
e = e3;
str3 = "11K";
str4 = "result";
bArr = null;
aVar.f5840a = e.a();
C0417d.a(rbVar, "/v3/iasdkauth", e);
str5 = null;
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused2) {
str3 = "11K";
str4 = "result";
bArr = null;
str5 = null;
if (bArr != null) {
}
} catch (Throwable th) {
th = th;
str3 = "11K";
str4 = "result";
bArr = null;
C0417d.b(th, "at", "lc");
str5 = null;
if (bArr != null) {
}
}
} else {
bArr = null;
}
try {
bArr2 = new byte[16];
str3 = "11K";
try {
bArr3 = new byte[bArr.length - 16];
System.arraycopy(bArr, 0, bArr2, 0, 16);
str4 = "result";
} catch (C0431k e4) {
e = e4;
str4 = "result";
c0420ea = c0420ea;
aVar.f5840a = e.a();
C0417d.a(rbVar, "/v3/iasdkauth", e);
str5 = null;
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused3) {
str4 = "result";
c0420ea = c0420ea;
str5 = null;
if (bArr != null) {
}
} catch (Throwable th2) {
th = th2;
str4 = "result";
c0420ea = c0420ea;
C0417d.b(th, "at", "lc");
str5 = null;
if (bArr != null) {
}
}
} catch (C0431k e5) {
e = e5;
str3 = "11K";
} catch (IllegalBlockSizeException unused4) {
str3 = "11K";
} catch (Throwable th3) {
th = th3;
str3 = "11K";
}
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(sb.b()));
str5 = sb.a(cipher.doFinal(bArr3));
c0420ea = c0420ea;
} catch (C0431k e6) {
e = e6;
c0420ea = c0420ea;
aVar.f5840a = e.a();
C0417d.a(rbVar, "/v3/iasdkauth", e);
str5 = null;
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused5) {
c0420ea = c0420ea;
str5 = null;
if (bArr != null) {
}
} catch (Throwable th4) {
th = th4;
c0420ea = c0420ea;
C0417d.b(th, "at", "lc");
str5 = null;
if (bArr != null) {
}
}
} catch (C0431k e7) {
e = e7;
throw e;
} catch (Throwable unused6) {
throw new C0431k("未知的错误");
}
} catch (C0431k e8) {
e = e8;
bArr = null;
c0420ea = null;
aVar.f5840a = e.a();
C0417d.a(rbVar, "/v3/iasdkauth", e);
str5 = null;
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused7) {
bArr = null;
c0420ea = null;
str5 = null;
if (bArr != null) {
}
} catch (Throwable th5) {
th = th5;
bArr = null;
c0420ea = null;
C0417d.b(th, "at", "lc");
str5 = null;
if (bArr != null) {
}
}
} catch (C0431k e9) {
e = e9;
str2 = "001";
str3 = "11K";
str4 = "result";
bArr = null;
c0420ea = null;
aVar.f5840a = e.a();
C0417d.a(rbVar, "/v3/iasdkauth", e);
str5 = null;
if (bArr != null) {
}
} catch (IllegalBlockSizeException unused8) {
str2 = "001";
str3 = "11K";
str4 = "result";
bArr = null;
c0420ea = null;
str5 = null;
if (bArr != null) {
}
} catch (Throwable th6) {
th = th6;
str2 = "001";
str3 = "11K";
str4 = "result";
bArr = null;
c0420ea = null;
C0417d.b(th, "at", "lc");
str5 = null;
if (bArr != null) {
}
}
if (bArr != null) {
return aVar;
}
if (TextUtils.isEmpty(str5)) {
str5 = sb.a(bArr);
}
try {
JSONObject jSONObject = new JSONObject(str5);
if (jSONObject.has("status")) {
int i = jSONObject.getInt("status");
if (i == 1) {
f5838a = 1;
} else if (i == 0) {
String str6 = "authcsid";
String str7 = "authgsid";
if (c0420ea != null) {
str6 = c0420ea.f5804c;
str7 = c0420ea.f5805d;
}
sb.a(context, str6, str7, jSONObject);
f5838a = 0;
if (jSONObject.has("info")) {
f5839b = jSONObject.getString("info");
}
C0417d.a(rbVar, "/v3/iasdkauth", f5839b, str7, jSONObject.has("infocode") ? jSONObject.getString("infocode") : "");
if (f5838a == 0) {
aVar.f5840a = f5839b;
return aVar;
}
}
if (jSONObject.has(Protocol.Client2Ctrl.BUNDLE_KEY_APP_PACK_ENGINE_VERSION)) {
aVar.f5841b = jSONObject.getInt(Protocol.Client2Ctrl.BUNDLE_KEY_APP_PACK_ENGINE_VERSION);
}
String str8 = str4;
if (sb.a(jSONObject, str8)) {
a.C0091a c0091a = new a.C0091a();
c0091a.f5845a = false;
c0091a.f5846b = false;
aVar.x = c0091a;
JSONObject jSONObject2 = jSONObject.getJSONObject(str8);
String[] split = str.split(";");
if (split != null && split.length > 0) {
for (String str9 : split) {
if (jSONObject2.has(str9)) {
aVar.w.putOpt(str9, jSONObject2.get(str9));
}
}
}
String str10 = str3;
if (sb.a(jSONObject2, str10)) {
JSONObject jSONObject3 = jSONObject2.getJSONObject(str10);
c0091a.f5845a = a(jSONObject3.getString("able"), false);
if (jSONObject3.has("off")) {
c0091a.f5847c = jSONObject3.getJSONObject("off");
}
}
String str11 = str2;
if (sb.a(jSONObject2, str11)) {
JSONObject jSONObject4 = jSONObject2.getJSONObject(str11);
a.d dVar = new a.d();
if (jSONObject4 != null) {
String a2 = a(jSONObject4, Downloads.Impl.COLUMN_FILE_MD5);
String a3 = a(jSONObject4, "url");
String a4 = a(jSONObject4, "sdkversion");
if (!TextUtils.isEmpty(a2) && !TextUtils.isEmpty(a3) && !TextUtils.isEmpty(a4)) {
dVar.f5855a = a3;
dVar.f5856b = a2;
dVar.f5857c = a4;
}
}
aVar.y = dVar;
}
if (sb.a(jSONObject2, "002")) {
JSONObject jSONObject5 = jSONObject2.getJSONObject("002");
a.c cVar = new a.c();
a(jSONObject5, cVar);
aVar.z = cVar;
}
if (sb.a(jSONObject2, "14S")) {
JSONObject jSONObject6 = jSONObject2.getJSONObject("14S");
a.c cVar2 = new a.c();
a(jSONObject6, cVar2);
aVar.A = cVar2;
}
if (sb.a(jSONObject2, "11B")) {
aVar.h = jSONObject2.getJSONObject("11B");
}
if (sb.a(jSONObject2, "11C")) {
aVar.k = jSONObject2.getJSONObject("11C");
}
if (sb.a(jSONObject2, "11I")) {
aVar.l = jSONObject2.getJSONObject("11I");
}
if (sb.a(jSONObject2, "11H")) {
aVar.m = jSONObject2.getJSONObject("11H");
}
if (sb.a(jSONObject2, "11E")) {
aVar.n = jSONObject2.getJSONObject("11E");
}
if (sb.a(jSONObject2, "11F")) {
aVar.o = jSONObject2.getJSONObject("11F");
}
if (sb.a(jSONObject2, "13A")) {
aVar.q = jSONObject2.getJSONObject("13A");
}
if (sb.a(jSONObject2, "13J")) {
aVar.i = jSONObject2.getJSONObject("13J");
}
if (sb.a(jSONObject2, "11G")) {
aVar.p = jSONObject2.getJSONObject("11G");
}
if (sb.a(jSONObject2, "006")) {
aVar.r = jSONObject2.getJSONObject("006");
}
if (sb.a(jSONObject2, "010")) {
aVar.s = jSONObject2.getJSONObject("010");
}
if (sb.a(jSONObject2, "11Z")) {
JSONObject jSONObject7 = jSONObject2.getJSONObject("11Z");
a.b bVar2 = new a.b();
a(jSONObject7, bVar2);
aVar.B = bVar2;
}
if (sb.a(jSONObject2, "135")) {
aVar.j = jSONObject2.getJSONObject("135");
}
if (sb.a(jSONObject2, "13S")) {
aVar.g = jSONObject2.getJSONObject("13S");
}
if (sb.a(jSONObject2, "121")) {
JSONObject jSONObject8 = jSONObject2.getJSONObject("121");
a.b bVar3 = new a.b();
a(jSONObject8, bVar3);
aVar.C = bVar3;
}
if (sb.a(jSONObject2, "122")) {
JSONObject jSONObject9 = jSONObject2.getJSONObject("122");
a.b bVar4 = new a.b();
a(jSONObject9, bVar4);
aVar.D = bVar4;
}
if (sb.a(jSONObject2, "123")) {
JSONObject jSONObject10 = jSONObject2.getJSONObject("123");
a.b bVar5 = new a.b();
a(jSONObject10, bVar5);
aVar.E = bVar5;
}
if (sb.a(jSONObject2, "011")) {
aVar.f5842c = jSONObject2.getJSONObject("011");
}
if (sb.a(jSONObject2, "012")) {
aVar.f5843d = jSONObject2.getJSONObject("012");
}
if (sb.a(jSONObject2, "013")) {
aVar.f5844e = jSONObject2.getJSONObject("013");
}
if (sb.a(jSONObject2, "014")) {
aVar.f = jSONObject2.getJSONObject("014");
}
if (sb.a(jSONObject2, "145")) {
aVar.t = jSONObject2.getJSONObject("145");
}
if (sb.a(jSONObject2, "14B")) {
aVar.u = jSONObject2.getJSONObject("14B");
}
if (sb.a(jSONObject2, "14D")) {
aVar.v = jSONObject2.getJSONObject("14D");
}
if (sb.a(jSONObject2, "14N")) {
JSONObject jSONObject11 = jSONObject2.getJSONObject("14N");
a.b bVar6 = new a.b();
bVar6.f5848a = a(jSONObject11.optString("able"), false);
bVar6.f5849b = jSONObject11.optString("url");
bVar6.f5850c = jSONObject11.optString(Downloads.Impl.COLUMN_FILE_MD5);
if (bVar6.f5848a) {
rb a5 = tb.a();
if (a5 != null) {
new C0456x(context, new C0458y(bVar6.f5849b, bVar6.f5850c), a5).a();
}
} else {
A.a(context, "aiu");
}
}
}
}
} catch (Throwable th7) {
vb.a(th7, "at", "lc");
}
return aVar;
}
private static String a(JSONObject jSONObject, String str) throws JSONException {
return (jSONObject == null || !jSONObject.has(str) || jSONObject.getString(str).equals("[]")) ? "" : jSONObject.optString(str);
}
public static void a(Context context, String str) {
hb.a(context, str);
}
private static void a(JSONObject jSONObject, a.b bVar) {
if (bVar != null) {
try {
String a2 = a(jSONObject, "m");
String a3 = a(jSONObject, "u");
String a4 = a(jSONObject, "v");
String a5 = a(jSONObject, "able");
String a6 = a(jSONObject, "on");
bVar.f5850c = a2;
bVar.f5849b = a3;
bVar.f5851d = a4;
bVar.f5848a = a(a5, false);
bVar.f5852e = a(a6, true);
} catch (Throwable th) {
vb.a(th, "at", "pe");
}
}
}
private static void a(JSONObject jSONObject, a.c cVar) {
if (jSONObject != null) {
try {
String a2 = a(jSONObject, Downloads.Impl.COLUMN_FILE_MD5);
String a3 = a(jSONObject, "url");
cVar.f5854b = a2;
cVar.f5853a = a3;
} catch (Throwable th) {
vb.a(th, "At", "psc");
}
}
}
public static boolean a(String str, boolean z) {
try {
if (TextUtils.isEmpty(str)) {
return z;
}
String[] split = URLDecoder.decode(str).split("/");
return split[split.length - 1].charAt(4) % 2 == 1;
} catch (Throwable unused) {
return z;
}
}
}