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

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


package com.loc;

import android.content.Context;
import anet.channel.util.HttpConstant;
import com.google.common.net.HttpHeaders;
import com.umeng.message.util.HttpRequest;
import com.xiaomi.mipush.sdk.Constants;
import java.util.HashMap;
import java.util.Locale;
public final class db {
    private static db b;
    bk a;
    private int c = 0;
    private int d = dg.f;
    private boolean e = false;
    private int f = 0;

    private db() {
        this.a = null;
        this.a = bk.a();
    }

    public static db a() {
        if (b == null) {
            b = new db();
        }
        return b;
    }

    public final bp a(dc dcVar) throws Throwable {
        long b2 = Cdo.b();
        bp a = bk.a(dcVar, this.e);
        this.c = Long.valueOf(Cdo.b() - b2).intValue();
        return a;
    }

    public final dc a(Context context, byte[] bArr, String str, boolean z) {
        String str2;
        try {
            HashMap hashMap = new HashMap(16);
            dc dcVar = new dc(context, dg.b());
            try {
                hashMap.put("Content-Type", "application/octet-stream");
                hashMap.put("Accept-Encoding", "gzip");
                hashMap.put("gzipped", "1");
                hashMap.put(HttpHeaders.CONNECTION, "Keep-Alive");
                hashMap.put("User-Agent", "AMAP_Location_SDK_Android 4.2.0");
                hashMap.put("KEY", l.f(context));
                hashMap.put("enginever", "4.9");
                String a = n.a();
                String a2 = n.a(context, a, "key=" + l.f(context));
                hashMap.put("ts", a);
                hashMap.put("scode", a2);
                hashMap.put("encr", "1");
                dcVar.f = hashMap;
                String str3 = z ? "loc" : "locf";
                dcVar.m = true;
                dcVar.k = String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "4.2.0", str3, 3);
                dcVar.j = z;
                dcVar.g = str;
                dcVar.h = Cdo.a(bArr);
                dcVar.a(s.a(context));
                HashMap hashMap2 = new HashMap(16);
                hashMap2.put("output", "bin");
                hashMap2.put("policy", "3103");
                int i = this.f;
                if (i != 0) {
                    if (i != 1) {
                        str2 = i == 2 ? "language:en" : "language:cn";
                    }
                    hashMap2.put("custom", str2);
                    dcVar.l = hashMap2;
                    dcVar.a(this.d);
                    dcVar.b(this.d);
                    if (this.e) {
                        return dcVar;
                    }
                    dcVar.g = dcVar.c().replace(HttpConstant.HTTP, HttpConstant.HTTPS);
                    return dcVar;
                }
                hashMap2.remove("custom");
                dcVar.l = hashMap2;
                dcVar.a(this.d);
                dcVar.b(this.d);
                if (this.e) {
                }
            } catch (Throwable unused) {
                return dcVar;
            }
        } catch (Throwable unused2) {
            return null;
        }
    }

    public final String a(Context context, double d, double d2) {
        String str;
        try {
            HashMap hashMap = new HashMap(16);
            dc dcVar = new dc(context, dg.b());
            hashMap.clear();
            hashMap.put("Content-Type", HttpRequest.CONTENT_TYPE_FORM);
            hashMap.put(HttpHeaders.CONNECTION, "Keep-Alive");
            hashMap.put("User-Agent", "AMAP_Location_SDK_Android 4.2.0");
            HashMap hashMap2 = new HashMap(16);
            hashMap2.put("custom", "26260A1F00020002");
            hashMap2.put("key", l.f(context));
            int i = this.f;
            if (i != 0) {
                if (i != 1) {
                    str = i == 2 ? "en" : "zh-CN";
                }
                hashMap2.put(com.umeng.analytics.pro.ax.M, str);
                String a = n.a();
                String a2 = n.a(context, a, v.b(hashMap2));
                hashMap2.put("ts", a);
                hashMap2.put("scode", a2);
                dcVar.b(("output=json&radius=1000&extensions=all&location=" + d2 + Constants.ACCEPT_TIME_SEPARATOR_SP + d).getBytes("UTF-8"));
                dcVar.m = false;
                dcVar.j = true;
                dcVar.k = String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "4.2.0", "loc", 3);
                dcVar.l = hashMap2;
                dcVar.f = hashMap;
                dcVar.g = "http://restapi.amap.com/v3/geocode/regeo";
                dcVar.a(s.a(context));
                dcVar.a(dg.f);
                dcVar.b(dg.f);
                return new String(bk.b(dcVar), "utf-8");
            }
            hashMap2.remove(com.umeng.analytics.pro.ax.M);
            String a3 = n.a();
            String a22 = n.a(context, a3, v.b(hashMap2));
            hashMap2.put("ts", a3);
            hashMap2.put("scode", a22);
            dcVar.b(("output=json&radius=1000&extensions=all&location=" + d2 + Constants.ACCEPT_TIME_SEPARATOR_SP + d).getBytes("UTF-8"));
            dcVar.m = false;
            dcVar.j = true;
            dcVar.k = String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "4.2.0", "loc", 3);
            dcVar.l = hashMap2;
            dcVar.f = hashMap;
            dcVar.g = "http://restapi.amap.com/v3/geocode/regeo";
            dcVar.a(s.a(context));
            dcVar.a(dg.f);
            dcVar.b(dg.f);
            return new String(bk.b(dcVar), "utf-8");
        } catch (Throwable unused) {
            return null;
        }
    }

    public final void a(long j, boolean z, int i) {
        try {
            this.e = z;
            this.d = Long.valueOf(j).intValue();
            this.f = i;
        } catch (Throwable th) {
            dg.a(th, "netmanager", "setOption");
        }
    }

    public final int b() {
        return this.c;
    }
}