鳯华 v4.0.0版本的 MD5 值为:e66eea5d0a772ef117f7e252dfbb1dfc

以下内容为反编译后的 k.java 源代码,内容仅作参考


package a2;

import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import com.tencent.open.SocialConstants;
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 class k {
    public static int f319a = -1;
    public static String f320b = "";

    public static class a {
        @Deprecated
        public c A;
        public c B;
        public b C;
        public b D;
        public b E;
        public b F;
        public f G;
        public String f321a;
        public int f322b = -1;
        @Deprecated
        public JSONObject f323c;
        @Deprecated
        public JSONObject f324d;
        @Deprecated
        public JSONObject f325e;
        @Deprecated
        public JSONObject f326f;
        @Deprecated
        public JSONObject f327g;
        @Deprecated
        public JSONObject f328h;
        @Deprecated
        public JSONObject f329i;
        @Deprecated
        public JSONObject f330j;
        @Deprecated
        public JSONObject f331k;
        @Deprecated
        public JSONObject f332l;
        @Deprecated
        public JSONObject f333m;
        @Deprecated
        public JSONObject f334n;
        @Deprecated
        public JSONObject f335o;
        @Deprecated
        public JSONObject f336p;
        @Deprecated
        public JSONObject f337q;
        @Deprecated
        public JSONObject f338r;
        @Deprecated
        public JSONObject f339s;
        @Deprecated
        public JSONObject f340t;
        @Deprecated
        public JSONObject f341u;
        @Deprecated
        public JSONObject f342v;
        public JSONObject f343w;
        public C0004a f344x;
        public d f345y;
        public e f346z;

        public static class C0004a {
            public boolean f347a;
            public boolean f348b;
            public JSONObject f349c;
        }

        public static class b {
            public boolean f350a;
            public String f351b;
            public String f352c;
            public String f353d;
            public boolean f354e;
        }

        public static class c {
            public String f355a;
            public String f356b;
        }

        public static class d {
            public String f357a;
            public String f358b;
            public String f359c;
        }

        public static class e {
            public boolean f360a;
        }

        public static class f {
            public boolean f361a;
            public boolean f362b;
            public boolean f363c;
            public String f364d;
            public String f365e;
            public String f366f;
        }
    }

    public static class b extends i1 {
        private String f367f;
        private Map<String, String> f368g;
        private boolean f369h;

        b(Context context, r rVar, String str, Map<String, String> map) {
            super(context, rVar);
            this.f367f = str;
            this.f368g = map;
            this.f369h = Build.VERSION.SDK_INT != 19;
        }

        private Map<String, String> y() {
            String G = m.G(this.f300d);
            if (TextUtils.isEmpty(G)) {
                G = m.t(this.f300d);
            }
            if (!TextUtils.isEmpty(G)) {
                G = p.d(new StringBuilder(G).reverse().toString());
            }
            HashMap hashMap = new HashMap();
            hashMap.put("authkey", this.f367f);
            hashMap.put("plattype", "android");
            hashMap.put("product", this.f301e.a());
            hashMap.put("version", this.f301e.e());
            hashMap.put("output", "json");
            hashMap.put("androidversion", Build.VERSION.SDK_INT + "");
            hashMap.put("deviceId", G);
            hashMap.put("manufacture", Build.MANUFACTURER);
            Map<String, String> map = this.f368g;
            if (map != null && !map.isEmpty()) {
                hashMap.putAll(this.f368g);
            }
            hashMap.put("abitype", s.d(this.f300d));
            hashMap.put("ext", this.f301e.h());
            return hashMap;
        }

        @Override
        public Map<String, String> e() {
            return null;
        }

        @Override
        public String g() {
            return this.f369h ? "https://restapi.amap.com/v3/iasdkauth" : "http://restapi.amap.com/v3/iasdkauth";
        }

        @Override
        public byte[] o() {
            return null;
        }

        @Override
        public byte[] p() {
            return s.n(s.f(y()));
        }

        @Override
        protected String q() {
            return "3.0";
        }

        public boolean x() {
            return this.f369h;
        }
    }

    public static a a(Context context, r rVar, String str, Map<String, String> map) {
        return b(context, rVar, str, map, false);
    }

    public static a b(Context context, r rVar, String str, Map<String, String> map, boolean z9) {
        o1 o1Var;
        byte[] bArr;
        String str2;
        String str3;
        String str4;
        String str5;
        String str6;
        h1 h1Var;
        String sb;
        byte[] bArr2;
        a aVar = new a();
        aVar.f343w = new JSONObject();
        o.a().c(context);
        String str7 = null;
        try {
            try {
                h1Var = new h1();
            } catch (i e9) {
                e = e9;
                str2 = "off";
                str3 = "001";
                str4 = "11K";
                str5 = "result";
                str6 = str;
                o1Var = null;
                bArr = null;
                aVar.f321a = e.a();
                e0.h(rVar, "/v3/iasdkauth", e);
                String str8 = str6;
                if (bArr == null) {
                }
            } catch (IllegalBlockSizeException unused) {
                str2 = "off";
                str3 = "001";
                str4 = "11K";
                str5 = "result";
                str6 = str;
                o1Var = null;
                bArr = null;
                String str82 = str6;
                if (bArr == null) {
                }
            } catch (Throwable th) {
                th = th;
                str2 = "off";
                str3 = "001";
                str4 = "11K";
                str5 = "result";
                str6 = str;
                o1Var = null;
                bArr = null;
                e0.n(th, "at", "lc");
                String str822 = str6;
                if (bArr == null) {
                }
            }
        } catch (i e10) {
            e = e10;
            o1Var = null;
            bArr = null;
            aVar.f321a = e.a();
            e0.h(rVar, "/v3/iasdkauth", e);
            String str8222 = str6;
            if (bArr == null) {
            }
        } catch (IllegalBlockSizeException unused2) {
            o1Var = null;
            bArr = null;
            String str82222 = str6;
            if (bArr == null) {
            }
        } catch (Throwable th2) {
            th = th2;
            o1Var = null;
            bArr = null;
            e0.n(th, "at", "lc");
            String str822222 = str6;
            if (bArr == null) {
            }
        }
        try {
            StringBuilder sb2 = new StringBuilder();
            str3 = "001";
            try {
                sb2.append(str);
                sb2.append(";14N;");
                sb2.append("15K");
                sb = sb2.toString();
                try {
                    str2 = "off";
                } catch (i e11) {
                    e = e11;
                } catch (Throwable unused3) {
                }
            } catch (i e12) {
                e = e12;
                throw e;
            } catch (Throwable unused4) {
                throw new i("未知的错误");
            }
            try {
                b bVar = new b(context, rVar, sb, map);
                o1Var = h1Var.b(bVar, bVar.x());
                if (o1Var != null) {
                    try {
                        bArr = o1Var.f448a;
                    } catch (i e13) {
                        e = e13;
                        str6 = sb;
                        str4 = "11K";
                        str5 = "result";
                        bArr = null;
                        aVar.f321a = e.a();
                        e0.h(rVar, "/v3/iasdkauth", e);
                        String str8222222 = str6;
                        if (bArr == null) {
                        }
                    } catch (IllegalBlockSizeException unused5) {
                        str6 = sb;
                        str4 = "11K";
                        str5 = "result";
                        bArr = null;
                    } catch (Throwable th3) {
                        th = th3;
                        str6 = sb;
                        str4 = "11K";
                        str5 = "result";
                        bArr = null;
                        e0.n(th, "at", "lc");
                        String str82222222 = str6;
                        if (bArr == null) {
                        }
                    }
                } else {
                    bArr = null;
                }
                try {
                    byte[] bArr3 = new byte[16];
                    str6 = sb;
                    try {
                        bArr2 = new byte[bArr.length - 16];
                        str4 = "11K";
                    } catch (i e14) {
                        e = e14;
                        str4 = "11K";
                        str5 = "result";
                        o1Var = o1Var;
                        aVar.f321a = e.a();
                        e0.h(rVar, "/v3/iasdkauth", e);
                        String str822222222 = str6;
                        if (bArr == null) {
                        }
                    } catch (IllegalBlockSizeException unused6) {
                        str4 = "11K";
                        str5 = "result";
                        o1Var = o1Var;
                        String str8222222222 = str6;
                        if (bArr == null) {
                        }
                    } catch (Throwable th4) {
                        th = th4;
                        str4 = "11K";
                        str5 = "result";
                        o1Var = o1Var;
                        e0.n(th, "at", "lc");
                        String str82222222222 = str6;
                        if (bArr == null) {
                        }
                    }
                    try {
                        System.arraycopy(bArr, 0, bArr3, 0, 16);
                        str5 = "result";
                    } catch (i e15) {
                        e = e15;
                        str5 = "result";
                        o1Var = o1Var;
                        aVar.f321a = e.a();
                        e0.h(rVar, "/v3/iasdkauth", e);
                        String str822222222222 = str6;
                        if (bArr == null) {
                        }
                    } catch (IllegalBlockSizeException unused7) {
                        str5 = "result";
                        o1Var = o1Var;
                        String str8222222222222 = str6;
                        if (bArr == null) {
                        }
                    } catch (Throwable th5) {
                        th = th5;
                        str5 = "result";
                        o1Var = o1Var;
                        e0.n(th, "at", "lc");
                        String str82222222222222 = str6;
                        if (bArr == null) {
                        }
                    }
                    try {
                        System.arraycopy(bArr, 16, bArr2, 0, bArr.length - 16);
                        SecretKeySpec secretKeySpec = new SecretKeySpec(bArr3, "AES");
                        Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
                        cipher.init(2, secretKeySpec, new IvParameterSpec(s.t()));
                        str7 = s.g(cipher.doFinal(bArr2));
                    } catch (i e16) {
                        e = e16;
                        o1Var = o1Var;
                        aVar.f321a = e.a();
                        e0.h(rVar, "/v3/iasdkauth", e);
                        String str822222222222222 = str6;
                        if (bArr == null) {
                        }
                    } catch (IllegalBlockSizeException unused8) {
                    } catch (Throwable th6) {
                        th = th6;
                        o1Var = o1Var;
                        e0.n(th, "at", "lc");
                        String str8222222222222222 = str6;
                        if (bArr == null) {
                        }
                    }
                } catch (i e17) {
                    e = e17;
                    str6 = sb;
                } catch (IllegalBlockSizeException unused9) {
                    str6 = sb;
                } catch (Throwable th7) {
                    th = th7;
                    str6 = sb;
                }
                o1Var = o1Var;
                String str82222222222222222 = str6;
                if (bArr == null) {
                    return aVar;
                }
                if (TextUtils.isEmpty(str7)) {
                    str7 = s.g(bArr);
                }
                try {
                    JSONObject jSONObject = new JSONObject(str7);
                    if (jSONObject.has("status")) {
                        int i9 = jSONObject.getInt("status");
                        if (i9 == 1) {
                            f319a = 1;
                        } else if (i9 == 0) {
                            String str9 = "authcsid";
                            String str10 = "authgsid";
                            if (o1Var != null) {
                                str9 = o1Var.f450c;
                                str10 = o1Var.f451d;
                            }
                            s.i(context, str9, str10, jSONObject);
                            f319a = 0;
                            if (jSONObject.has("info")) {
                                f320b = jSONObject.getString("info");
                            }
                            e0.i(rVar, "/v3/iasdkauth", f320b, str10, jSONObject.has("infocode") ? jSONObject.getString("infocode") : "");
                            if (f319a == 0) {
                                aVar.f321a = f320b;
                                return aVar;
                            }
                        }
                        if (jSONObject.has("ver")) {
                            aVar.f322b = jSONObject.getInt("ver");
                        }
                        String str11 = str5;
                        if (s.m(jSONObject, str11)) {
                            a.C0004a c0004a = new a.C0004a();
                            c0004a.f347a = false;
                            c0004a.f348b = false;
                            aVar.f344x = c0004a;
                            JSONObject jSONObject2 = jSONObject.getJSONObject(str11);
                            String[] split = str82222222222222222.split(";");
                            if (split != null && split.length > 0) {
                                for (String str12 : split) {
                                    if (jSONObject2.has(str12)) {
                                        aVar.f343w.putOpt(str12, jSONObject2.get(str12));
                                    }
                                }
                            }
                            String str13 = str4;
                            if (s.m(jSONObject2, str13)) {
                                JSONObject jSONObject3 = jSONObject2.getJSONObject(str13);
                                c0004a.f347a = k(jSONObject3.getString("able"), false);
                                String str14 = str2;
                                if (jSONObject3.has(str14)) {
                                    c0004a.f349c = jSONObject3.getJSONObject(str14);
                                }
                            }
                            String str15 = str3;
                            if (s.m(jSONObject2, str15)) {
                                JSONObject jSONObject4 = jSONObject2.getJSONObject(str15);
                                a.d dVar = new a.d();
                                h(jSONObject4, dVar);
                                aVar.f345y = dVar;
                            }
                            if (s.m(jSONObject2, "002")) {
                                JSONObject jSONObject5 = jSONObject2.getJSONObject("002");
                                a.c cVar = new a.c();
                                g(jSONObject5, cVar);
                                aVar.A = cVar;
                            }
                            if (s.m(jSONObject2, "14S")) {
                                JSONObject jSONObject6 = jSONObject2.getJSONObject("14S");
                                a.c cVar2 = new a.c();
                                g(jSONObject6, cVar2);
                                aVar.B = cVar2;
                            }
                            d(aVar, jSONObject2);
                            if (s.m(jSONObject2, "14Z")) {
                                JSONObject jSONObject7 = jSONObject2.getJSONObject("14Z");
                                a.f fVar = new a.f();
                                j(jSONObject7, fVar);
                                aVar.G = fVar;
                            }
                            if (s.m(jSONObject2, "151")) {
                                JSONObject jSONObject8 = jSONObject2.getJSONObject("151");
                                a.e eVar = new a.e();
                                i(jSONObject8, eVar);
                                aVar.f346z = eVar;
                            }
                            d(aVar, jSONObject2);
                            if (s.m(jSONObject2, "14N")) {
                                JSONObject jSONObject9 = jSONObject2.getJSONObject("14N");
                                a.b bVar2 = new a.b();
                                bVar2.f350a = k(jSONObject9.optString("able"), false);
                                bVar2.f351b = jSONObject9.optString(SocialConstants.PARAM_URL);
                                bVar2.f352c = jSONObject9.optString("md5");
                                if (bVar2.f350a) {
                                    r a10 = z.a();
                                    if (a10 != null) {
                                        q0 q0Var = new q0(bVar2.f351b, bVar2.f352c, "");
                                        q0Var.b(z9);
                                        new p0(context, q0Var, a10).e();
                                    }
                                } else {
                                    r0.e(context, "aiu");
                                }
                            }
                            e(context, jSONObject2);
                        }
                    }
                } catch (Throwable th8) {
                    b0.e(th8, "at", "lc");
                }
                return aVar;
            } catch (i e18) {
                e = e18;
                throw e;
            } catch (Throwable unused10) {
                throw new i("未知的错误");
            }
        } catch (i e19) {
            e = e19;
        } catch (Throwable unused11) {
        }
    }

    public static String c(JSONObject jSONObject, String str) throws JSONException {
        return (jSONObject == null || !jSONObject.has(str) || jSONObject.getString(str).equals("[]")) ? "" : jSONObject.optString(str);
    }

    private static void d(a aVar, JSONObject jSONObject) {
        try {
            if (s.m(jSONObject, "11B")) {
                aVar.f328h = jSONObject.getJSONObject("11B");
            }
            if (s.m(jSONObject, "11C")) {
                aVar.f331k = jSONObject.getJSONObject("11C");
            }
            if (s.m(jSONObject, "11I")) {
                aVar.f332l = jSONObject.getJSONObject("11I");
            }
            if (s.m(jSONObject, "11H")) {
                aVar.f333m = jSONObject.getJSONObject("11H");
            }
            if (s.m(jSONObject, "11E")) {
                aVar.f334n = jSONObject.getJSONObject("11E");
            }
            if (s.m(jSONObject, "11F")) {
                aVar.f335o = jSONObject.getJSONObject("11F");
            }
            if (s.m(jSONObject, "13A")) {
                aVar.f337q = jSONObject.getJSONObject("13A");
            }
            if (s.m(jSONObject, "13J")) {
                aVar.f329i = jSONObject.getJSONObject("13J");
            }
            if (s.m(jSONObject, "11G")) {
                aVar.f336p = jSONObject.getJSONObject("11G");
            }
            if (s.m(jSONObject, "006")) {
                aVar.f338r = jSONObject.getJSONObject("006");
            }
            if (s.m(jSONObject, "010")) {
                aVar.f339s = jSONObject.getJSONObject("010");
            }
            if (s.m(jSONObject, "11Z")) {
                JSONObject jSONObject2 = jSONObject.getJSONObject("11Z");
                a.b bVar = new a.b();
                f(jSONObject2, bVar);
                aVar.C = bVar;
            }
            if (s.m(jSONObject, "135")) {
                aVar.f330j = jSONObject.getJSONObject("135");
            }
            if (s.m(jSONObject, "13S")) {
                aVar.f327g = jSONObject.getJSONObject("13S");
            }
            if (s.m(jSONObject, "121")) {
                JSONObject jSONObject3 = jSONObject.getJSONObject("121");
                a.b bVar2 = new a.b();
                f(jSONObject3, bVar2);
                aVar.D = bVar2;
            }
            if (s.m(jSONObject, "122")) {
                JSONObject jSONObject4 = jSONObject.getJSONObject("122");
                a.b bVar3 = new a.b();
                f(jSONObject4, bVar3);
                aVar.E = bVar3;
            }
            if (s.m(jSONObject, "123")) {
                JSONObject jSONObject5 = jSONObject.getJSONObject("123");
                a.b bVar4 = new a.b();
                f(jSONObject5, bVar4);
                aVar.F = bVar4;
            }
            if (s.m(jSONObject, "011")) {
                aVar.f323c = jSONObject.getJSONObject("011");
            }
            if (s.m(jSONObject, "012")) {
                aVar.f324d = jSONObject.getJSONObject("012");
            }
            if (s.m(jSONObject, "013")) {
                aVar.f325e = jSONObject.getJSONObject("013");
            }
            if (s.m(jSONObject, "014")) {
                aVar.f326f = jSONObject.getJSONObject("014");
            }
            if (s.m(jSONObject, "145")) {
                aVar.f340t = jSONObject.getJSONObject("145");
            }
            if (s.m(jSONObject, "14B")) {
                aVar.f341u = jSONObject.getJSONObject("14B");
            }
            if (s.m(jSONObject, "14D")) {
                aVar.f342v = jSONObject.getJSONObject("14D");
            }
        } catch (Throwable th) {
            e0.n(th, "at", "pe");
        }
    }

    private static void e(Context context, JSONObject jSONObject) {
        try {
            o.a().d(context, k(jSONObject.getJSONObject("15K").optString("isTargetAble"), false));
        } catch (Throwable th) {
            th.printStackTrace();
        }
    }

    private static void f(JSONObject jSONObject, a.b bVar) {
        if (bVar != null) {
            try {
                String c10 = c(jSONObject, "m");
                String c11 = c(jSONObject, "u");
                String c12 = c(jSONObject, "v");
                String c13 = c(jSONObject, "able");
                String c14 = c(jSONObject, "on");
                bVar.f352c = c10;
                bVar.f351b = c11;
                bVar.f353d = c12;
                bVar.f350a = k(c13, false);
                bVar.f354e = k(c14, true);
            } catch (Throwable th) {
                b0.e(th, "at", "pe");
            }
        }
    }

    private static void g(JSONObject jSONObject, a.c cVar) {
        if (jSONObject != null) {
            try {
                String c10 = c(jSONObject, "md5");
                String c11 = c(jSONObject, SocialConstants.PARAM_URL);
                cVar.f356b = c10;
                cVar.f355a = c11;
            } catch (Throwable th) {
                b0.e(th, "at", "psc");
            }
        }
    }

    private static void h(JSONObject jSONObject, a.d dVar) {
        if (jSONObject != null) {
            try {
                String c10 = c(jSONObject, "md5");
                String c11 = c(jSONObject, SocialConstants.PARAM_URL);
                String c12 = c(jSONObject, "sdkversion");
                if (!TextUtils.isEmpty(c10) && !TextUtils.isEmpty(c11) && !TextUtils.isEmpty(c12)) {
                    dVar.f357a = c11;
                    dVar.f358b = c10;
                    dVar.f359c = c12;
                }
            } catch (Throwable th) {
                b0.e(th, "at", "psu");
            }
        }
    }

    private static void i(JSONObject jSONObject, a.e eVar) {
        if (eVar == null || jSONObject == null) {
            return;
        }
        eVar.f360a = k(jSONObject.optString("able"), false);
    }

    private static void j(JSONObject jSONObject, a.f fVar) {
        if (fVar != null) {
            try {
                String c10 = c(jSONObject, "md5");
                String c11 = c(jSONObject, "md5info");
                String c12 = c(jSONObject, SocialConstants.PARAM_URL);
                String c13 = c(jSONObject, "able");
                String c14 = c(jSONObject, "on");
                String c15 = c(jSONObject, "mobileable");
                fVar.f365e = c10;
                fVar.f366f = c11;
                fVar.f364d = c12;
                fVar.f361a = k(c13, false);
                fVar.f362b = k(c14, false);
                fVar.f363c = k(c15, false);
            } catch (Throwable th) {
                b0.e(th, "at", "pes");
            }
        }
    }

    public static boolean k(String str, boolean z9) {
        try {
            if (TextUtils.isEmpty(str)) {
                return z9;
            }
            String[] split = URLDecoder.decode(str).split("/");
            return split[split.length - 1].charAt(4) % 2 == 1;
        } catch (Throwable unused) {
            return z9;
        }
    }
}