RbChat v4.56630229版本的 MD5 值为:d137f4b55d6b64b50641a810905f5957

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


package com.loc;

import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import androidx.core.app.NotificationCompat;
import com.amap.api.maps.AMapException;
import com.eva.framework.dto.DataFromClient4Web;
import com.loc.r;
import io.netty.handler.codec.rtsp.RtspHeaders;
import java.io.File;
import java.io.FileOutputStream;
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 kotlinx.coroutines.DebugKt;
import okhttp3.HttpUrl;
import org.json.JSONException;
import org.json.JSONObject;
public final class m {
    public static int a = -1;
    public static String b = "";

    public static class a {
        @Deprecated
        public c A;
        public c B;
        public b C;
        public b D;
        public b E;
        public b F;
        public e G;
        private boolean H;
        public String a;
        public int b = -1;
        @Deprecated
        public JSONObject c;
        @Deprecated
        public JSONObject d;
        @Deprecated
        public JSONObject e;
        @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 C0024a x;
        public d y;
        public f z;

        public static class C0024a {
            public boolean a;
            public boolean b;
            public JSONObject c;
        }

        public static class b {
            public boolean a;
            public String b;
            public String c;
            public String d;
            public boolean e;
        }

        public static class c {
            public String a;
            public String b;
        }

        public static class d {
            public String a;
            public String b;
            public String c;
        }

        public static class e {
            public boolean a;
            public boolean b;
            public boolean c;
            public String d;
            public String e;
            public String f;
        }

        public static class f {
            public boolean a;
        }

        public final boolean a() {
            return this.H;
        }
    }

    public static class b extends bk {
        private String f;
        private Map<String, String> g;
        private boolean h;

        b(Context context, v vVar, String str) {
            super(context, vVar);
            this.f = str;
            this.g = null;
            this.h = Build.VERSION.SDK_INT != 19;
        }

        public final boolean a() {
            return this.h;
        }

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

        @Override
        public final Map<String, String> b() {
            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() {
            String w = p.w(this.a);
            if (TextUtils.isEmpty(w)) {
                w = p.j(this.a);
            }
            if (!TextUtils.isEmpty(w)) {
                w = s.b(new StringBuilder(w).reverse().toString());
            }
            HashMap hashMap = new HashMap();
            hashMap.put("authkey", this.f);
            hashMap.put("plattype", "android");
            hashMap.put("product", this.b.a());
            hashMap.put("version", this.b.b());
            hashMap.put("output", DataFromClient4Web.RET_FORMAT_JSON);
            StringBuilder sb = new StringBuilder();
            sb.append(Build.VERSION.SDK_INT);
            hashMap.put("androidversion", sb.toString());
            hashMap.put("deviceId", w);
            hashMap.put("manufacture", Build.MANUFACTURER);
            Map<String, String> map = this.g;
            if (map != null && !map.isEmpty()) {
                hashMap.putAll(this.g);
            }
            hashMap.put("abitype", w.a(this.a));
            hashMap.put("ext", this.b.d());
            return w.a(w.a(hashMap));
        }

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

    public static a a(Context context, v vVar, String str, boolean z) {
        return b(context, vVar, str, z);
    }

    private static String a(JSONObject jSONObject, String str) throws JSONException {
        return (jSONObject == null || !jSONObject.has(str) || jSONObject.getString(str).equals(HttpUrl.PATH_SEGMENT_ENCODE_SET_URI)) ? "" : jSONObject.optString(str);
    }

    private static void a(Context context, v vVar, String str) {
        HashMap hashMap = new HashMap();
        hashMap.put("amap_sdk_auth_fail", "1");
        hashMap.put("amap_sdk_auth_fail_type", str);
        hashMap.put("amap_sdk_name", vVar.a());
        hashMap.put("amap_sdk_version", vVar.c());
        String jSONObject = new JSONObject(hashMap).toString();
        if (TextUtils.isEmpty(jSONObject)) {
            return;
        }
        try {
            bu buVar = new bu(context, "core", "1.0", "O001");
            buVar.a(jSONObject);
            bv.a(buVar, context);
        } catch (k unused) {
        }
    }

    private static void a(Context context, v vVar, Throwable th) {
        a(context, vVar, th.getMessage());
    }

    public static void a(Context context, String str) {
        l.a(context, str);
    }

    private static void a(a aVar, JSONObject jSONObject) {
        try {
            if (w.a(jSONObject, "11B")) {
                aVar.h = jSONObject.getJSONObject("11B");
            }
            if (w.a(jSONObject, "11C")) {
                aVar.k = jSONObject.getJSONObject("11C");
            }
            if (w.a(jSONObject, "11I")) {
                aVar.l = jSONObject.getJSONObject("11I");
            }
            if (w.a(jSONObject, "11H")) {
                aVar.m = jSONObject.getJSONObject("11H");
            }
            if (w.a(jSONObject, "11E")) {
                aVar.n = jSONObject.getJSONObject("11E");
            }
            if (w.a(jSONObject, "11F")) {
                aVar.o = jSONObject.getJSONObject("11F");
            }
            if (w.a(jSONObject, "13A")) {
                aVar.q = jSONObject.getJSONObject("13A");
            }
            if (w.a(jSONObject, "13J")) {
                aVar.i = jSONObject.getJSONObject("13J");
            }
            if (w.a(jSONObject, "11G")) {
                aVar.p = jSONObject.getJSONObject("11G");
            }
            if (w.a(jSONObject, "006")) {
                aVar.r = jSONObject.getJSONObject("006");
            }
            if (w.a(jSONObject, "010")) {
                aVar.s = jSONObject.getJSONObject("010");
            }
            if (w.a(jSONObject, "11Z")) {
                JSONObject jSONObject2 = jSONObject.getJSONObject("11Z");
                a.b bVar = new a.b();
                a(jSONObject2, bVar);
                aVar.C = bVar;
            }
            if (w.a(jSONObject, "135")) {
                aVar.j = jSONObject.getJSONObject("135");
            }
            if (w.a(jSONObject, "13S")) {
                aVar.g = jSONObject.getJSONObject("13S");
            }
            if (w.a(jSONObject, "121")) {
                JSONObject jSONObject3 = jSONObject.getJSONObject("121");
                a.b bVar2 = new a.b();
                a(jSONObject3, bVar2);
                aVar.D = bVar2;
            }
            if (w.a(jSONObject, "122")) {
                JSONObject jSONObject4 = jSONObject.getJSONObject("122");
                a.b bVar3 = new a.b();
                a(jSONObject4, bVar3);
                aVar.E = bVar3;
            }
            if (w.a(jSONObject, "123")) {
                JSONObject jSONObject5 = jSONObject.getJSONObject("123");
                a.b bVar4 = new a.b();
                a(jSONObject5, bVar4);
                aVar.F = bVar4;
            }
            if (w.a(jSONObject, "011")) {
                aVar.c = jSONObject.getJSONObject("011");
            }
            if (w.a(jSONObject, "012")) {
                aVar.d = jSONObject.getJSONObject("012");
            }
            if (w.a(jSONObject, "013")) {
                aVar.e = jSONObject.getJSONObject("013");
            }
            if (w.a(jSONObject, "014")) {
                aVar.f = jSONObject.getJSONObject("014");
            }
            if (w.a(jSONObject, "145")) {
                aVar.t = jSONObject.getJSONObject("145");
            }
            if (w.a(jSONObject, "14B")) {
                aVar.u = jSONObject.getJSONObject("14B");
            }
            if (w.a(jSONObject, "14D")) {
                aVar.v = jSONObject.getJSONObject("14D");
            }
        } catch (Throwable th) {
            aj.b(th, "at", "pe");
        }
    }

    private static void a(String str, a aVar, JSONObject jSONObject) throws JSONException {
        a.C0024a c0024a = new a.C0024a();
        c0024a.a = false;
        c0024a.b = false;
        aVar.x = c0024a;
        try {
            String[] split = str.split(";");
            if (split != null && split.length > 0) {
                for (String str2 : split) {
                    if (jSONObject.has(str2)) {
                        aVar.w.putOpt(str2, jSONObject.get(str2));
                    }
                }
            }
        } catch (Throwable th) {
            ag.a(th, "at", "co");
        }
        if (w.a(jSONObject, "16H")) {
            aVar.H = a(jSONObject.getJSONObject("16H").optString("able"), false);
        }
        if (w.a(jSONObject, "11K")) {
            try {
                JSONObject jSONObject2 = jSONObject.getJSONObject("11K");
                c0024a.a = a(jSONObject2.getString("able"), false);
                if (jSONObject2.has(DebugKt.DEBUG_PROPERTY_VALUE_OFF)) {
                    c0024a.c = jSONObject2.getJSONObject(DebugKt.DEBUG_PROPERTY_VALUE_OFF);
                }
            } catch (Throwable th2) {
                ag.a(th2, "AuthConfigManager", "loadException");
            }
        }
        if (w.a(jSONObject, "001")) {
            JSONObject jSONObject3 = jSONObject.getJSONObject("001");
            a.d dVar = new a.d();
            if (jSONObject3 != null) {
                try {
                    String a2 = a(jSONObject3, "md5");
                    String a3 = a(jSONObject3, RtspHeaders.Values.URL);
                    String a4 = a(jSONObject3, "sdkversion");
                    if (!TextUtils.isEmpty(a2) && !TextUtils.isEmpty(a3) && !TextUtils.isEmpty(a4)) {
                        dVar.a = a3;
                        dVar.b = a2;
                        dVar.c = a4;
                    }
                } catch (Throwable th3) {
                    ag.a(th3, "at", "psu");
                }
            }
            aVar.y = dVar;
        }
        if (w.a(jSONObject, "002")) {
            JSONObject jSONObject4 = jSONObject.getJSONObject("002");
            a.c cVar = new a.c();
            a(jSONObject4, cVar);
            aVar.A = cVar;
        }
        if (w.a(jSONObject, "14S")) {
            JSONObject jSONObject5 = jSONObject.getJSONObject("14S");
            a.c cVar2 = new a.c();
            a(jSONObject5, cVar2);
            aVar.B = cVar2;
        }
        a(aVar, jSONObject);
        if (w.a(jSONObject, "14Z")) {
            JSONObject jSONObject6 = jSONObject.getJSONObject("14Z");
            a.e eVar = new a.e();
            try {
                String a5 = a(jSONObject6, "md5");
                String a6 = a(jSONObject6, "md5info");
                String a7 = a(jSONObject6, RtspHeaders.Values.URL);
                String a8 = a(jSONObject6, "able");
                String a9 = a(jSONObject6, DebugKt.DEBUG_PROPERTY_VALUE_ON);
                String a10 = a(jSONObject6, "mobileable");
                eVar.e = a5;
                eVar.f = a6;
                eVar.d = a7;
                eVar.a = a(a8, false);
                eVar.b = a(a9, false);
                eVar.c = a(a10, false);
            } catch (Throwable th4) {
                ag.a(th4, "at", "pes");
            }
            aVar.G = eVar;
        }
        if (w.a(jSONObject, "151")) {
            JSONObject jSONObject7 = jSONObject.getJSONObject("151");
            a.f fVar = new a.f();
            if (jSONObject7 != null) {
                fVar.a = a(jSONObject7.optString("able"), false);
            }
            aVar.z = fVar;
        }
        a(aVar, jSONObject);
    }

    private static void a(JSONObject jSONObject, a.b bVar) {
        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, DebugKt.DEBUG_PROPERTY_VALUE_ON);
            bVar.c = a2;
            bVar.b = a3;
            bVar.d = a4;
            bVar.a = a(a5, false);
            bVar.e = a(a6, true);
        } catch (Throwable th) {
            ag.a(th, "at", "pe");
        }
    }

    private static void a(JSONObject jSONObject, a.c cVar) {
        if (jSONObject != null) {
            try {
                String a2 = a(jSONObject, "md5");
                String a3 = a(jSONObject, RtspHeaders.Values.URL);
                cVar.b = a2;
                cVar.a = a3;
            } catch (Throwable th) {
                ag.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;
        }
    }

    private static a b(Context context, v vVar, String str, boolean z) {
        IllegalBlockSizeException illegalBlockSizeException;
        byte[] bArr;
        bo boVar;
        String str2;
        String str3;
        String str4;
        String str5;
        k kVar;
        String str6;
        String str7;
        byte[] bArr2;
        String str8;
        String str9;
        FileOutputStream fileOutputStream;
        File file;
        FileOutputStream fileOutputStream2;
        a aVar = new a();
        aVar.w = new JSONObject();
        r.a.a.a(context);
        try {
            try {
                new bj();
                try {
                    StringBuilder sb = new StringBuilder();
                    try {
                        sb.append(str);
                        sb.append(";14N;15K;16H;17I");
                        str2 = sb.toString();
                        try {
                            b bVar = new b(context, vVar, str2);
                            boVar = bj.a(bVar, bVar.a());
                            if (boVar != null) {
                                try {
                                    str8 = str2;
                                    bArr2 = boVar.a;
                                } catch (k e) {
                                    kVar = e;
                                    str3 = "17I";
                                    str4 = "14N";
                                    str5 = "result";
                                    bArr = null;
                                    aVar.a = kVar.a();
                                    a(context, vVar, kVar.a());
                                    aj.a(vVar, "/v3/iasdkauth", kVar);
                                    str6 = str2;
                                    str7 = null;
                                    bArr2 = bArr;
                                    if (bArr2 != null) {
                                    }
                                } catch (IllegalBlockSizeException e2) {
                                    illegalBlockSizeException = e2;
                                    str3 = "17I";
                                    str4 = "14N";
                                    str5 = "result";
                                    bArr = null;
                                    a(context, vVar, illegalBlockSizeException);
                                    str6 = str2;
                                    str7 = null;
                                    bArr2 = bArr;
                                    if (bArr2 != null) {
                                    }
                                } catch (Throwable th) {
                                    illegalBlockSizeException = th;
                                    str3 = "17I";
                                    str4 = "14N";
                                    str5 = "result";
                                    bArr = null;
                                    aj.b(illegalBlockSizeException, "at", "lc");
                                    a(context, vVar, illegalBlockSizeException);
                                    str6 = str2;
                                    str7 = null;
                                    bArr2 = bArr;
                                    if (bArr2 != null) {
                                    }
                                }
                            } else {
                                str8 = str2;
                                bArr2 = null;
                            }
                            try {
                                byte[] bArr3 = new byte[16];
                                str3 = "17I";
                                try {
                                    byte[] bArr4 = new byte[bArr2.length - 16];
                                    str4 = "14N";
                                    try {
                                        System.arraycopy(bArr2, 0, bArr3, 0, 16);
                                        str5 = "result";
                                        try {
                                            System.arraycopy(bArr2, 16, bArr4, 0, bArr2.length - 16);
                                            SecretKeySpec secretKeySpec = new SecretKeySpec(bArr3, "AES");
                                            Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
                                            cipher.init(2, secretKeySpec, new IvParameterSpec(w.c()));
                                            String a2 = w.a(cipher.doFinal(bArr4));
                                            if (context != null && bArr2 != null) {
                                                try {
                                                    try {
                                                        if (vVar != null) {
                                                            try {
                                                                if (!TextUtils.isEmpty(vVar.a())) {
                                                                    str9 = ah.c(context, ah.e) + File.separator + s.b(vVar.a());
                                                                    file = new File(str9);
                                                                    if (!file.getParentFile().exists()) {
                                                                        file.getParentFile().mkdirs();
                                                                    }
                                                                    fileOutputStream2 = new FileOutputStream(file, false);
                                                                    fileOutputStream2.write(bArr2);
                                                                    fileOutputStream2.close();
                                                                }
                                                            } catch (Throwable unused) {
                                                            }
                                                        }
                                                        fileOutputStream2.write(bArr2);
                                                        fileOutputStream2.close();
                                                    } catch (Throwable th2) {
                                                        th = th2;
                                                        fileOutputStream = fileOutputStream2;
                                                        aj.b(th, "sar", "sar");
                                                        if (fileOutputStream != null) {
                                                            fileOutputStream.close();
                                                        }
                                                        str7 = a2;
                                                        boVar = boVar;
                                                        str6 = str8;
                                                        if (bArr2 != null) {
                                                        }
                                                    }
                                                    file = new File(str9);
                                                    if (!file.getParentFile().exists()) {
                                                    }
                                                    fileOutputStream2 = new FileOutputStream(file, false);
                                                } catch (Throwable th3) {
                                                    th = th3;
                                                    fileOutputStream = null;
                                                }
                                                str9 = null;
                                            }
                                            str7 = a2;
                                            boVar = boVar;
                                            str6 = str8;
                                        } catch (k e3) {
                                            e = e3;
                                            kVar = e;
                                            bArr = bArr2;
                                            boVar = boVar;
                                            str2 = str8;
                                            aVar.a = kVar.a();
                                            a(context, vVar, kVar.a());
                                            aj.a(vVar, "/v3/iasdkauth", kVar);
                                            str6 = str2;
                                            str7 = null;
                                            bArr2 = bArr;
                                            if (bArr2 != null) {
                                            }
                                        } catch (IllegalBlockSizeException e4) {
                                            e = e4;
                                            illegalBlockSizeException = e;
                                            bArr = bArr2;
                                            boVar = boVar;
                                            str2 = str8;
                                            a(context, vVar, illegalBlockSizeException);
                                            str6 = str2;
                                            str7 = null;
                                            bArr2 = bArr;
                                            if (bArr2 != null) {
                                            }
                                        } catch (Throwable th4) {
                                            th = th4;
                                            illegalBlockSizeException = th;
                                            bArr = bArr2;
                                            boVar = boVar;
                                            str2 = str8;
                                            aj.b(illegalBlockSizeException, "at", "lc");
                                            a(context, vVar, illegalBlockSizeException);
                                            str6 = str2;
                                            str7 = null;
                                            bArr2 = bArr;
                                            if (bArr2 != null) {
                                            }
                                        }
                                    } catch (k e5) {
                                        e = e5;
                                        str5 = "result";
                                        kVar = e;
                                        bArr = bArr2;
                                        boVar = boVar;
                                        str2 = str8;
                                        aVar.a = kVar.a();
                                        a(context, vVar, kVar.a());
                                        aj.a(vVar, "/v3/iasdkauth", kVar);
                                        str6 = str2;
                                        str7 = null;
                                        bArr2 = bArr;
                                        if (bArr2 != null) {
                                        }
                                    } catch (IllegalBlockSizeException e6) {
                                        e = e6;
                                        str5 = "result";
                                        illegalBlockSizeException = e;
                                        bArr = bArr2;
                                        boVar = boVar;
                                        str2 = str8;
                                        a(context, vVar, illegalBlockSizeException);
                                        str6 = str2;
                                        str7 = null;
                                        bArr2 = bArr;
                                        if (bArr2 != null) {
                                        }
                                    } catch (Throwable th5) {
                                        th = th5;
                                        str5 = "result";
                                        illegalBlockSizeException = th;
                                        bArr = bArr2;
                                        boVar = boVar;
                                        str2 = str8;
                                        aj.b(illegalBlockSizeException, "at", "lc");
                                        a(context, vVar, illegalBlockSizeException);
                                        str6 = str2;
                                        str7 = null;
                                        bArr2 = bArr;
                                        if (bArr2 != null) {
                                        }
                                    }
                                } catch (k e7) {
                                    e = e7;
                                    str4 = "14N";
                                    str5 = "result";
                                    kVar = e;
                                    bArr = bArr2;
                                    boVar = boVar;
                                    str2 = str8;
                                    aVar.a = kVar.a();
                                    a(context, vVar, kVar.a());
                                    aj.a(vVar, "/v3/iasdkauth", kVar);
                                    str6 = str2;
                                    str7 = null;
                                    bArr2 = bArr;
                                    if (bArr2 != null) {
                                    }
                                } catch (IllegalBlockSizeException e8) {
                                    e = e8;
                                    str4 = "14N";
                                    str5 = "result";
                                    illegalBlockSizeException = e;
                                    bArr = bArr2;
                                    boVar = boVar;
                                    str2 = str8;
                                    a(context, vVar, illegalBlockSizeException);
                                    str6 = str2;
                                    str7 = null;
                                    bArr2 = bArr;
                                    if (bArr2 != null) {
                                    }
                                } catch (Throwable th6) {
                                    th = th6;
                                    str4 = "14N";
                                    str5 = "result";
                                    illegalBlockSizeException = th;
                                    bArr = bArr2;
                                    boVar = boVar;
                                    str2 = str8;
                                    aj.b(illegalBlockSizeException, "at", "lc");
                                    a(context, vVar, illegalBlockSizeException);
                                    str6 = str2;
                                    str7 = null;
                                    bArr2 = bArr;
                                    if (bArr2 != null) {
                                    }
                                }
                            } catch (k e9) {
                                e = e9;
                                str3 = "17I";
                            } catch (IllegalBlockSizeException e10) {
                                e = e10;
                                str3 = "17I";
                            } catch (Throwable th7) {
                                th = th7;
                                str3 = "17I";
                            }
                        } catch (k e11) {
                            e = e11;
                            throw e;
                        } catch (Throwable unused2) {
                            throw new k(AMapException.ERROR_UNKNOWN);
                        }
                    } catch (k e12) {
                        e = e12;
                    } catch (Throwable unused3) {
                        throw new k(AMapException.ERROR_UNKNOWN);
                    }
                } catch (k e13) {
                    e = e13;
                } catch (Throwable unused4) {
                }
            } catch (k e14) {
                e = e14;
                str2 = str;
                str3 = "17I";
                str4 = "14N";
                str5 = "result";
                kVar = e;
                bArr = null;
                boVar = null;
                aVar.a = kVar.a();
                a(context, vVar, kVar.a());
                aj.a(vVar, "/v3/iasdkauth", kVar);
                str6 = str2;
                str7 = null;
                bArr2 = bArr;
                if (bArr2 != null) {
                }
            } catch (IllegalBlockSizeException e15) {
                e = e15;
                str2 = str;
                str3 = "17I";
                str4 = "14N";
                str5 = "result";
                illegalBlockSizeException = e;
                bArr = null;
                boVar = null;
                a(context, vVar, illegalBlockSizeException);
                str6 = str2;
                str7 = null;
                bArr2 = bArr;
                if (bArr2 != null) {
                }
            } catch (Throwable th8) {
                th = th8;
                str2 = str;
                str3 = "17I";
                str4 = "14N";
                str5 = "result";
                illegalBlockSizeException = th;
                bArr = null;
                boVar = null;
                aj.b(illegalBlockSizeException, "at", "lc");
                a(context, vVar, illegalBlockSizeException);
                str6 = str2;
                str7 = null;
                bArr2 = bArr;
                if (bArr2 != null) {
                }
            }
        } catch (k e16) {
            e = e16;
            kVar = e;
            bArr = null;
            boVar = null;
            aVar.a = kVar.a();
            a(context, vVar, kVar.a());
            aj.a(vVar, "/v3/iasdkauth", kVar);
            str6 = str2;
            str7 = null;
            bArr2 = bArr;
            if (bArr2 != null) {
            }
        } catch (IllegalBlockSizeException e17) {
            e = e17;
            illegalBlockSizeException = e;
            bArr = null;
            boVar = null;
            a(context, vVar, illegalBlockSizeException);
            str6 = str2;
            str7 = null;
            bArr2 = bArr;
            if (bArr2 != null) {
            }
        } catch (Throwable th9) {
            th = th9;
            illegalBlockSizeException = th;
            bArr = null;
            boVar = null;
            aj.b(illegalBlockSizeException, "at", "lc");
            a(context, vVar, illegalBlockSizeException);
            str6 = str2;
            str7 = null;
            bArr2 = bArr;
            if (bArr2 != null) {
            }
        }
        if (bArr2 != null) {
            return aVar;
        }
        if (TextUtils.isEmpty(str7)) {
            str7 = w.a(bArr2);
        }
        String str10 = str7;
        if (TextUtils.isEmpty(str10)) {
            a(context, vVar, "result is null");
        }
        try {
            JSONObject jSONObject = new JSONObject(str10);
            if (jSONObject.has(NotificationCompat.CATEGORY_STATUS)) {
                int i = jSONObject.getInt(NotificationCompat.CATEGORY_STATUS);
                if (i == 1) {
                    a = 1;
                } else if (i == 0) {
                    String str11 = "authcsid";
                    String str12 = "authgsid";
                    if (boVar != null) {
                        str11 = boVar.c;
                        str12 = boVar.d;
                    }
                    String str13 = str11;
                    String str14 = str12;
                    w.a(context, str13, str14, jSONObject);
                    a = 0;
                    if (jSONObject.has("info")) {
                        b = jSONObject.getString("info");
                    }
                    aj.a(vVar, "/v3/iasdkauth", b, str14, str13, jSONObject.has("infocode") ? jSONObject.getString("infocode") : "");
                    if (a == 0) {
                        aVar.a = b;
                        return aVar;
                    }
                }
                if (jSONObject.has("ver")) {
                    aVar.b = jSONObject.getInt("ver");
                }
                String str15 = str5;
                if (w.a(jSONObject, str15)) {
                    JSONObject jSONObject2 = jSONObject.getJSONObject(str15);
                    a(str6, aVar, jSONObject2);
                    String str16 = str4;
                    if (w.a(jSONObject2, str16) && TextUtils.isEmpty(p.b(context))) {
                        JSONObject jSONObject3 = jSONObject2.getJSONObject(str16);
                        a.b bVar2 = new a.b();
                        bVar2.a = a(jSONObject3.optString("able"), false);
                        bVar2.b = jSONObject3.optString(RtspHeaders.Values.URL);
                        bVar2.c = jSONObject3.optString("md5");
                        if (bVar2.a) {
                            v a3 = x.a();
                            if (a3 != null) {
                                au auVar = new au(bVar2.b, bVar2.c, aVar.H);
                                auVar.a(z);
                                new at(context, auVar, a3).a();
                            }
                        } else {
                            az.a(context, "aiu");
                        }
                    }
                    String str17 = str3;
                    if (w.a(jSONObject2, str17)) {
                        JSONObject jSONObject4 = jSONObject2.getJSONObject(str17);
                        boolean a4 = a(jSONObject4.optString("na"), false);
                        boolean a5 = a(jSONObject4.optString("aa"), false);
                        x.e = a4;
                        x.f = a5;
                    }
                    try {
                        JSONObject jSONObject5 = jSONObject2.getJSONObject("15K");
                        boolean a6 = a(jSONObject5.optString("isTargetAble"), false);
                        if (a(jSONObject5.optString("able"), false)) {
                            r.a.a.a(context, a6);
                        } else {
                            r.a.a.b(context);
                        }
                    } catch (Throwable unused5) {
                    }
                }
            }
        } catch (Throwable th10) {
            ag.a(th10, "at", "lc");
        }
        return aVar;
    }
}