觅伊 v4.1.7版本的 MD5 值为:2a9d9e87c53524c098d85b78a90aa398

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


package com.loc;

import android.content.Context;
import com.loc.bh;
import com.lzy.okgo.cache.CacheEntity;
import com.meizu.cloud.pushsdk.notification.model.TimeDisplaySetting;
import com.xiaomi.mipush.sdk.Constants;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import tv.danmaku.ijk.media.player.IjkMediaMeta;
public final class fa {
    private static fa b;
    bc a;
    private Context c;
    private int d = ff.i;
    private boolean e = false;
    private int f = 0;

    private fa(Context context) {
        this.a = null;
        this.c = null;
        try {
            p.a().a(context);
        } catch (Throwable unused) {
        }
        this.c = context;
        this.a = bc.a();
    }

    public static fa a(Context context) {
        if (b == null) {
            b = new fa(context);
        }
        return b;
    }

    public final bi a(fb fbVar) throws Throwable {
        if (this.e) {
            fbVar.a(bh.c.HTTPS);
        }
        return bc.a(fbVar);
    }

    public final fb a(Context context, byte[] bArr, String str, String str2, boolean z) {
        String str3;
        try {
            HashMap hashMap = new HashMap(16);
            fb fbVar = new fb(context, ff.c());
            try {
                hashMap.put("Content-Type", "application/octet-stream");
                hashMap.put("Accept-Encoding", "gzip");
                hashMap.put("gzipped", "1");
                hashMap.put("Connection", "Keep-Alive");
                hashMap.put("User-Agent", "AMAP_Location_SDK_Android 5.4.0");
                hashMap.put("KEY", k.f(context));
                hashMap.put("enginever", ff.a);
                String a = m.a();
                String a2 = m.a(context, a, "key=" + k.f(context));
                hashMap.put(TimeDisplaySetting.TIME_DISPLAY_SETTING, a);
                hashMap.put("scode", a2);
                if (Double.valueOf(ff.a).doubleValue() >= 5.3d) {
                    hashMap.put("aps_s_src", "openapi");
                }
                hashMap.put("encr", "1");
                fbVar.b(hashMap);
                String str4 = z ? "loc" : "locf";
                fbVar.c(true);
                fbVar.b(String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "5.4.0", str4, 3));
                fbVar.b(z);
                fbVar.c(str);
                fbVar.d(str2);
                fbVar.c(fm.a(bArr));
                fbVar.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) {
                        str3 = i == 2 ? "language:en" : "language:cn";
                    }
                    hashMap2.put("custom", str3);
                    fbVar.a((Map<String, String>) hashMap2);
                    fbVar.a(this.d);
                    fbVar.b(this.d);
                    if (this.e) {
                        return fbVar;
                    }
                    fbVar.a(bh.c.HTTPS);
                    return fbVar;
                }
                hashMap2.remove("custom");
                fbVar.a((Map<String, String>) hashMap2);
                fbVar.a(this.d);
                fbVar.b(this.d);
                if (this.e) {
                }
            } catch (Throwable unused) {
                return fbVar;
            }
        } catch (Throwable unused2) {
            return null;
        }
    }

    public final String a(Context context, double d, double d2) {
        String str;
        try {
            HashMap hashMap = new HashMap(16);
            fb fbVar = new fb(context, ff.c());
            hashMap.clear();
            hashMap.put("Content-Type", "application/x-www-form-urlencoded");
            hashMap.put("Connection", "Keep-Alive");
            hashMap.put("User-Agent", "AMAP_Location_SDK_Android 5.4.0");
            HashMap hashMap2 = new HashMap(16);
            hashMap2.put("custom", "26260A1F00020002");
            hashMap2.put(CacheEntity.KEY, k.f(context));
            int i = this.f;
            if (i != 0) {
                if (i != 1) {
                    str = i == 2 ? "en" : "zh-CN";
                }
                hashMap2.put(IjkMediaMeta.IJKM_KEY_LANGUAGE, str);
                String a = m.a();
                String a2 = m.a(context, a, u.b(hashMap2));
                hashMap2.put(TimeDisplaySetting.TIME_DISPLAY_SETTING, a);
                hashMap2.put("scode", a2);
                fbVar.b(("output=json&radius=1000&extensions=all&location=" + d2 + Constants.ACCEPT_TIME_SEPARATOR_SP + d).getBytes("UTF-8"));
                fbVar.c(false);
                fbVar.b(true);
                fbVar.b(String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "5.4.0", "loc", 3));
                fbVar.a((Map<String, String>) hashMap2);
                fbVar.b(hashMap);
                fbVar.a(s.a(context));
                fbVar.a(ff.i);
                fbVar.b(ff.i);
                fbVar.d("http://dualstack-arestapi.amap.com/v3/geocode/regeo");
                fbVar.c("http://restsdk.amap.com/v3/geocode/regeo");
                if (this.e) {
                    fbVar.a(bh.c.HTTPS);
                }
                return new String(bc.a(fbVar).a, "utf-8");
            }
            hashMap2.remove(IjkMediaMeta.IJKM_KEY_LANGUAGE);
            String a3 = m.a();
            String a22 = m.a(context, a3, u.b(hashMap2));
            hashMap2.put(TimeDisplaySetting.TIME_DISPLAY_SETTING, a3);
            hashMap2.put("scode", a22);
            fbVar.b(("output=json&radius=1000&extensions=all&location=" + d2 + Constants.ACCEPT_TIME_SEPARATOR_SP + d).getBytes("UTF-8"));
            fbVar.c(false);
            fbVar.b(true);
            fbVar.b(String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "5.4.0", "loc", 3));
            fbVar.a((Map<String, String>) hashMap2);
            fbVar.b(hashMap);
            fbVar.a(s.a(context));
            fbVar.a(ff.i);
            fbVar.b(ff.i);
            fbVar.d("http://dualstack-arestapi.amap.com/v3/geocode/regeo");
            fbVar.c("http://restsdk.amap.com/v3/geocode/regeo");
            if (this.e) {
            }
            return new String(bc.a(fbVar).a, "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) {
            ff.a(th, "LocNetManager", "setOption");
        }
    }
}