智慧考勤 v1.0.28版本的 MD5 值为:12729d810518c958a6eb8d5a86a946dd

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


package com.loc;

import android.content.Context;
import android.os.Build;
import android.text.TextUtils;
import anet.channel.strategy.dispatch.DispatchConstants;
import com.meizu.cloud.pushsdk.constants.PushConstants;
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 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;
        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 C0059a x;
        public d y;
        public f z;

        public static class C0059a {
            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;
        }
    }

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

        b(Context context, u uVar, String str) {
            super(context, uVar);
            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 u = p.u(this.a);
            if (TextUtils.isEmpty(u)) {
                u = p.c();
            }
            if (!TextUtils.isEmpty(u)) {
                u = r.b(new StringBuilder(u).reverse().toString());
            }
            HashMap hashMap = new HashMap();
            hashMap.put("authkey", this.f);
            hashMap.put("plattype", DispatchConstants.ANDROID);
            hashMap.put("product", this.b.a());
            hashMap.put("version", this.b.b());
            hashMap.put("output", "json");
            StringBuilder sb = new StringBuilder();
            sb.append(Build.VERSION.SDK_INT);
            hashMap.put("androidversion", sb.toString());
            hashMap.put("deviceId", u);
            hashMap.put("manufacture", Build.MANUFACTURER);
            Map<String, String> map = this.g;
            if (map != null && !map.isEmpty()) {
                hashMap.putAll(this.g);
            }
            hashMap.put("abitype", v.a(this.a));
            hashMap.put("ext", this.b.d());
            return v.a(v.a(hashMap));
        }

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

    public static a a(Context context, u uVar, String str, boolean z) {
        bp bpVar;
        byte[] bArr;
        String str2;
        String str3;
        String str4;
        a aVar = new a();
        aVar.w = new JSONObject();
        String str5 = null;
        try {
            try {
                new bk();
            } catch (k e) {
                e = e;
                str2 = "off";
                str3 = "11K";
                str4 = "result";
                bpVar = null;
                bArr = null;
                aVar.a = e.a();
                ai.a(uVar, "/v3/iasdkauth", e);
                if (bArr != null) {
                }
            } catch (IllegalBlockSizeException unused) {
                str2 = "off";
                str3 = "11K";
                str4 = "result";
                bpVar = null;
                bArr = null;
                if (bArr != null) {
                }
            } catch (Throwable th) {
                th = th;
                str2 = "off";
                str3 = "11K";
                str4 = "result";
                bpVar = null;
                bArr = null;
                ai.b(th, "at", "lc");
                if (bArr != null) {
                }
            }
        } catch (k e2) {
            e = e2;
            bpVar = null;
            bArr = null;
            aVar.a = e.a();
            ai.a(uVar, "/v3/iasdkauth", e);
            if (bArr != null) {
            }
        } catch (IllegalBlockSizeException unused2) {
            bpVar = null;
            bArr = null;
            if (bArr != null) {
            }
        } catch (Throwable th2) {
            th = th2;
            bpVar = null;
            bArr = null;
            ai.b(th, "at", "lc");
            if (bArr != null) {
            }
        }
        try {
            StringBuilder sb = new StringBuilder();
            sb.append(str);
            str2 = "off";
            try {
                sb.append(";14N");
                b bVar = new b(context, uVar, sb.toString());
                bpVar = bk.a(bVar, bVar.a());
                if (bpVar != null) {
                    try {
                        bArr = bpVar.a;
                    } catch (k e3) {
                        e = e3;
                        str3 = "11K";
                        str4 = "result";
                        bArr = null;
                        aVar.a = e.a();
                        ai.a(uVar, "/v3/iasdkauth", e);
                        if (bArr != null) {
                        }
                    } catch (IllegalBlockSizeException unused3) {
                        str3 = "11K";
                        str4 = "result";
                        bArr = null;
                    } catch (Throwable th3) {
                        th = th3;
                        str3 = "11K";
                        str4 = "result";
                        bArr = null;
                        ai.b(th, "at", "lc");
                        if (bArr != null) {
                        }
                    }
                } else {
                    bArr = null;
                }
                try {
                    byte[] bArr2 = new byte[16];
                    str3 = "11K";
                    try {
                        byte[] bArr3 = new byte[bArr.length - 16];
                        System.arraycopy(bArr, 0, bArr2, 0, 16);
                        str4 = "result";
                        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(v.b()));
                            str5 = v.a(cipher.doFinal(bArr3));
                        } catch (k e4) {
                            e = e4;
                            bpVar = bpVar;
                            aVar.a = e.a();
                            ai.a(uVar, "/v3/iasdkauth", e);
                            if (bArr != null) {
                            }
                        } catch (IllegalBlockSizeException unused4) {
                        } catch (Throwable th4) {
                            th = th4;
                            bpVar = bpVar;
                            ai.b(th, "at", "lc");
                            if (bArr != null) {
                            }
                        }
                    } catch (k e5) {
                        e = e5;
                        str4 = "result";
                        bpVar = bpVar;
                        aVar.a = e.a();
                        ai.a(uVar, "/v3/iasdkauth", e);
                        if (bArr != null) {
                        }
                    } catch (IllegalBlockSizeException unused5) {
                        str4 = "result";
                        bpVar = bpVar;
                        if (bArr != null) {
                        }
                    } catch (Throwable th5) {
                        th = th5;
                        str4 = "result";
                        bpVar = bpVar;
                        ai.b(th, "at", "lc");
                        if (bArr != null) {
                        }
                    }
                } catch (k e6) {
                    e = e6;
                    str3 = "11K";
                } catch (IllegalBlockSizeException unused6) {
                    str3 = "11K";
                } catch (Throwable th6) {
                    th = th6;
                    str3 = "11K";
                }
                bpVar = bpVar;
                if (bArr != null) {
                    return aVar;
                }
                if (TextUtils.isEmpty(str5)) {
                    str5 = v.a(bArr);
                }
                try {
                    JSONObject jSONObject = new JSONObject(str5);
                    if (jSONObject.has("status")) {
                        int i = jSONObject.getInt("status");
                        if (i == 1) {
                            a = 1;
                        } else if (i == 0) {
                            String str6 = "authcsid";
                            String str7 = "authgsid";
                            if (bpVar != null) {
                                str6 = bpVar.c;
                                str7 = bpVar.d;
                            }
                            v.a(context, str6, str7, jSONObject);
                            a = 0;
                            if (jSONObject.has("info")) {
                                b = jSONObject.getString("info");
                            }
                            ai.a(uVar, "/v3/iasdkauth", b, str7, jSONObject.has("infocode") ? jSONObject.getString("infocode") : "");
                            if (a == 0) {
                                aVar.a = b;
                                return aVar;
                            }
                        }
                        if (jSONObject.has("ver")) {
                            aVar.b = jSONObject.getInt("ver");
                        }
                        String str8 = str4;
                        if (v.a(jSONObject, str8)) {
                            a.C0059a c0059a = new a.C0059a();
                            c0059a.a = false;
                            c0059a.b = false;
                            aVar.x = c0059a;
                            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 (v.a(jSONObject2, str10)) {
                                JSONObject jSONObject3 = jSONObject2.getJSONObject(str10);
                                c0059a.a = a(jSONObject3.getString("able"), false);
                                String str11 = str2;
                                if (jSONObject3.has(str11)) {
                                    c0059a.c = jSONObject3.getJSONObject(str11);
                                }
                            }
                            if (v.a(jSONObject2, "001")) {
                                JSONObject jSONObject4 = jSONObject2.getJSONObject("001");
                                a.d dVar = new a.d();
                                if (jSONObject4 != null) {
                                    String a2 = a(jSONObject4, "md5");
                                    String a3 = a(jSONObject4, PushConstants.WEB_URL);
                                    String a4 = a(jSONObject4, "sdkversion");
                                    if (!TextUtils.isEmpty(a2) && !TextUtils.isEmpty(a3) && !TextUtils.isEmpty(a4)) {
                                        dVar.a = a3;
                                        dVar.b = a2;
                                        dVar.c = a4;
                                    }
                                }
                                aVar.y = dVar;
                            }
                            if (v.a(jSONObject2, "002")) {
                                JSONObject jSONObject5 = jSONObject2.getJSONObject("002");
                                a.c cVar = new a.c();
                                a(jSONObject5, cVar);
                                aVar.A = cVar;
                            }
                            if (v.a(jSONObject2, "14S")) {
                                JSONObject jSONObject6 = jSONObject2.getJSONObject("14S");
                                a.c cVar2 = new a.c();
                                a(jSONObject6, cVar2);
                                aVar.B = cVar2;
                            }
                            a(aVar, jSONObject2);
                            if (v.a(jSONObject2, "14Z")) {
                                JSONObject jSONObject7 = jSONObject2.getJSONObject("14Z");
                                a.e eVar = new a.e();
                                String a5 = a(jSONObject7, "md5");
                                String a6 = a(jSONObject7, "md5info");
                                String a7 = a(jSONObject7, PushConstants.WEB_URL);
                                String a8 = a(jSONObject7, "able");
                                String a9 = a(jSONObject7, "on");
                                String a10 = a(jSONObject7, "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);
                                aVar.G = eVar;
                            }
                            if (v.a(jSONObject2, "151")) {
                                JSONObject jSONObject8 = jSONObject2.getJSONObject("151");
                                a.f fVar = new a.f();
                                if (jSONObject8 != null) {
                                    fVar.a = a(jSONObject8.optString("able"), false);
                                }
                                aVar.z = fVar;
                            }
                            a(aVar, jSONObject2);
                            if (v.a(jSONObject2, "14N")) {
                                JSONObject jSONObject9 = jSONObject2.getJSONObject("14N");
                                a.b bVar2 = new a.b();
                                bVar2.a = a(jSONObject9.optString("able"), false);
                                bVar2.b = jSONObject9.optString(PushConstants.WEB_URL);
                                bVar2.c = jSONObject9.optString("md5");
                                if (bVar2.a) {
                                    u a11 = ad.a();
                                    if (a11 != null) {
                                        au auVar = new au(bVar2.b, bVar2.c);
                                        auVar.a(z);
                                        new at(context, auVar, a11).a();
                                    }
                                } else {
                                    av.a(context, "aiu");
                                }
                            }
                        }
                    }
                } catch (Throwable th7) {
                    af.a(th7, "at", "lc");
                }
                return aVar;
            } catch (k e7) {
                e = e7;
                throw e;
            } catch (Throwable unused7) {
                throw new k("未知的错误");
            }
        } catch (k e8) {
            e = e8;
        } catch (Throwable unused8) {
        }
    }

    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) {
        l.a(context, str);
    }

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

    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.c = a2;
                bVar.b = a3;
                bVar.d = a4;
                bVar.a = a(a5, false);
                bVar.e = a(a6, true);
            } catch (Throwable th) {
                af.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, PushConstants.WEB_URL);
                cVar.b = a2;
                cVar.a = a3;
            } catch (Throwable th) {
                af.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;
        }
    }
}