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

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


package h5;

import android.content.Context;
import com.efs.sdk.base.Constants;
import com.tencent.qcloud.core.http.HttpConstants;
import java.util.HashMap;
import java.util.Locale;
public final class g2 {
    private static g2 f14750g;
    n0 f14751a;
    private Context f14752b;
    private int f14753c = 0;
    private int f14754d = l2.f14963g;
    private boolean f14755e = false;
    private int f14756f = 0;

    private g2(Context context) {
        this.f14751a = null;
        this.f14752b = null;
        try {
            i3.a().c(context);
        } catch (Throwable unused) {
        }
        this.f14752b = context;
        this.f14751a = n0.a();
    }

    public static g2 c(Context context) {
        if (f14750g == null) {
            f14750g = new g2(context);
        }
        return f14750g;
    }

    public final int a() {
        return this.f14753c;
    }

    public final s0 b(h2 h2Var) throws Throwable {
        long y9 = t2.y();
        s0 b10 = n0.b(h2Var, this.f14755e || t2.i0(this.f14752b));
        this.f14753c = Long.valueOf(t2.y() - y9).intValue();
        return b10;
    }

    public final h2 d(Context context, byte[] bArr, String str, boolean z9) {
        String str2;
        try {
            HashMap hashMap = new HashMap(16);
            h2 h2Var = new h2(context, l2.m());
            try {
                hashMap.put("Content-Type", "application/octet-stream");
                hashMap.put("Accept-Encoding", Constants.CP_GZIP);
                hashMap.put("gzipped", "1");
                hashMap.put(HttpConstants.Header.CONNECTION, "Keep-Alive");
                hashMap.put(HttpConstants.Header.USER_AGENT, "AMAP_Location_SDK_Android 4.3.0");
                hashMap.put("KEY", c3.j(context));
                hashMap.put("enginever", "4.9");
                String a10 = e3.a();
                String b10 = e3.b(context, a10, "key=" + c3.j(context));
                hashMap.put("ts", a10);
                hashMap.put("scode", b10);
                hashMap.put("encr", "1");
                h2Var.f14780f = hashMap;
                String str3 = z9 ? "loc" : "locf";
                h2Var.f14788n = true;
                h2Var.f14786l = String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "4.3.0", str3, 3);
                h2Var.f14785k = z9;
                h2Var.f14782h = str;
                h2Var.f14783i = t2.v(bArr);
                h2Var.b(k3.b(context));
                HashMap hashMap2 = new HashMap(16);
                hashMap2.put("output", "bin");
                hashMap2.put("policy", "3103");
                int i9 = this.f14756f;
                if (i9 != 0) {
                    if (i9 != 1) {
                        str2 = i9 == 2 ? "language:en" : "language:cn";
                    }
                    hashMap2.put("custom", str2);
                    h2Var.f14787m = hashMap2;
                    h2Var.a(this.f14754d);
                    h2Var.d(this.f14754d);
                    if ((!this.f14755e || t2.i0(context)) && str.startsWith("http:")) {
                        h2Var.f14782h = h2Var.f().replace("https:", "https:");
                        return h2Var;
                    }
                    return h2Var;
                }
                hashMap2.remove("custom");
                h2Var.f14787m = hashMap2;
                h2Var.a(this.f14754d);
                h2Var.d(this.f14754d);
                if (this.f14755e) {
                }
                h2Var.f14782h = h2Var.f().replace("https:", "https:");
                return h2Var;
            } catch (Throwable unused) {
                return h2Var;
            }
        } catch (Throwable unused2) {
            return null;
        }
    }

    public final String e(Context context, double d10, double d11) {
        byte[] d12;
        String str;
        try {
            HashMap hashMap = new HashMap(16);
            h2 h2Var = new h2(context, l2.m());
            hashMap.clear();
            hashMap.put("Content-Type", "application/x-www-form-urlencoded");
            hashMap.put(HttpConstants.Header.CONNECTION, "Keep-Alive");
            hashMap.put(HttpConstants.Header.USER_AGENT, "AMAP_Location_SDK_Android 4.3.0");
            HashMap hashMap2 = new HashMap(16);
            hashMap2.put("custom", "26260A1F00020002");
            hashMap2.put("key", c3.j(context));
            int i9 = this.f14756f;
            if (i9 != 0) {
                if (i9 != 1) {
                    str = i9 == 2 ? "en" : "zh-CN";
                }
                hashMap2.put("language", str);
                String a10 = e3.a();
                String b10 = e3.b(context, a10, n3.q(hashMap2));
                hashMap2.put("ts", a10);
                hashMap2.put("scode", b10);
                h2Var.v(("output=json&radius=1000&extensions=all&location=" + d11 + "," + d10).getBytes("UTF-8"));
                h2Var.f14788n = false;
                h2Var.f14785k = true;
                h2Var.f14786l = String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "4.3.0", "loc", 3);
                h2Var.f14787m = hashMap2;
                h2Var.f14780f = hashMap;
                h2Var.b(k3.b(context));
                h2Var.a(l2.f14963g);
                h2Var.d(l2.f14963g);
                if (t2.i0(context)) {
                    h2Var.f14782h = "http://restapi.amap.com/v3/geocode/regeo";
                    d12 = n0.d(h2Var);
                } else {
                    h2Var.f14782h = "http://restapi.amap.com/v3/geocode/regeo".replace("http:", "https:");
                    d12 = n0.c(h2Var);
                }
                return new String(d12, "utf-8");
            }
            hashMap2.remove("language");
            String a102 = e3.a();
            String b102 = e3.b(context, a102, n3.q(hashMap2));
            hashMap2.put("ts", a102);
            hashMap2.put("scode", b102);
            h2Var.v(("output=json&radius=1000&extensions=all&location=" + d11 + "," + d10).getBytes("UTF-8"));
            h2Var.f14788n = false;
            h2Var.f14785k = true;
            h2Var.f14786l = String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "4.3.0", "loc", 3);
            h2Var.f14787m = hashMap2;
            h2Var.f14780f = hashMap;
            h2Var.b(k3.b(context));
            h2Var.a(l2.f14963g);
            h2Var.d(l2.f14963g);
            if (t2.i0(context)) {
            }
            return new String(d12, "utf-8");
        } catch (Throwable unused) {
            return null;
        }
    }

    public final void f(long j9, boolean z9, int i9) {
        try {
            this.f14755e = z9;
            try {
                i3.a().e(z9);
            } catch (Throwable unused) {
            }
            this.f14754d = Long.valueOf(j9).intValue();
            this.f14756f = i9;
        } catch (Throwable th) {
            l2.h(th, "LocNetManager", "setOption");
        }
    }
}