工作空间 v3.6.5.2版本的 MD5 值为:58e65af156c65a63bf64ed2e64960853

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


package com.loc;

import android.content.Context;
import android.os.Bundle;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import com.amap.api.location.AMapLocation;
import com.amap.api.location.AMapLocationClientOption;
import com.loc.rb;
import com.uusafe.base.modulesdk.module.global.CommGlobal;
import com.uusafe.emm.policy.DevicePolicyWrapper;
import com.uusafe.emm.policy.PolicyProtocol;
import com.uusafe.emm.uunetprotocol.base.SandboxSharedPref;
import com.zhizhangyi.platform.location.db.LocationData;
import java.util.HashMap;
import java.util.Locale;
import org.json.JSONObject;
public final class Sa {
    static String f5729a = "http://apilocate.amap.com/mobile/binary";
    static String f5730b = "";
    static String j;
    static HashMap<String, String> k;
    private static final String[] f5731c = {"com.amap.api.location", "com.loc", "com.amap.api.fence"};
    static String f5732d = "001;11B;11C;11F;11G;11H;11I;11K;121;122;135;13J;13S;14S";
    public static String f5733e = null;
    public static String f = null;
    public static int g = 30000;
    public static String h = null;
    public static String i = null;
    private static rb l = null;
    public static boolean m = false;
    public static boolean n = false;
    static boolean o = false;
    static boolean p = false;

    public static AMapLocationClientOption a(Bundle bundle) {
        AMapLocationClientOption aMapLocationClientOption = new AMapLocationClientOption();
        if (bundle == null) {
            return aMapLocationClientOption;
        }
        try {
            bundle.setClassLoader(AMapLocationClientOption.class.getClassLoader());
            return (AMapLocationClientOption) bundle.getParcelable("opt");
        } catch (Throwable th) {
            a(th, "CoreUtil", "getOptionFromBundle");
            return aMapLocationClientOption;
        }
    }

    public static rb a(String str, String str2) {
        try {
            rb.a aVar = new rb.a(str, str2, "AMAP_Location_SDK_Android 3.8.0");
            aVar.a(d());
            return aVar.a();
        } catch (Throwable th) {
            a(th, "CoreUtil", "getSDKInfo");
            return null;
        }
    }

    public static String a() {
        return f5729a;
    }

    public static JSONObject a(AMapLocationClientOption aMapLocationClientOption) {
        String str = DevicePolicyWrapper.DEFAULT_ID;
        JSONObject jSONObject = new JSONObject();
        if (aMapLocationClientOption == null) {
            aMapLocationClientOption = new AMapLocationClientOption();
        }
        try {
            jSONObject.put("nbssid", DevicePolicyWrapper.DEFAULT_ID);
            jSONObject.put("reversegeo", aMapLocationClientOption.h());
            jSONObject.put("isOffset", aMapLocationClientOption.i());
            jSONObject.put("wifiactivescan", aMapLocationClientOption.m() ? "1" : DevicePolicyWrapper.DEFAULT_ID);
            jSONObject.put("httptimeout", aMapLocationClientOption.b());
            jSONObject.put("isLocationCacheEnable", aMapLocationClientOption.f());
            jSONObject.put("isOnceLocationLatest", aMapLocationClientOption.k());
            if (aMapLocationClientOption.e()) {
                str = "1";
            }
            jSONObject.put("isKillProcess", str);
            boolean z = true;
            if (aMapLocationClientOption.d().ordinal() != 1) {
                z = false;
            }
            jSONObject.put("locationProtocol", z);
            jSONObject.put("sensorEnable", aMapLocationClientOption.l());
            jSONObject.put("isWifiPassiveScan", aMapLocationClientOption.n());
            jSONObject.put("isMock", aMapLocationClientOption.g());
        } catch (Throwable th) {
            a(th, "CoreUtil", "getOptionJson");
        }
        return jSONObject;
    }

    public static void a(Context context) {
        try {
            if (ab.a(e(context))) {
                f5729a = "http://abroad.apilocate.amap.com/mobile/binary";
                return;
            }
            if (k == null) {
                k = new HashMap<>();
            }
            k.clear();
            k.put("a9a9d23668a1a7ea93de9b21d67e436a", "F13160D440C7D0229DA95450F66AF92154AC84DF088F8CA3100B2E8131D57F3DC67124D4C466056E7A3DFBE035E1B9A4B9DA4DB68AE65A43EDFD92F5C60EF0C9");
            k.put("fe643c382e5c3b3962141f1a2e815a78", "FB923EE67A8B4032DAA517DD8CD7A26FF7C25B0C3663F92A0B61251C4FFFA858DF169D61321C3E7919CB67DF8EFEC827");
            k.put("b2e8bd171989cb2c3c13bd89b4c1067a", "239CE372F804D4BE4EAFFD183668379BDF274440E6F246AB16BBE6F5D1D30DEACFBBF0C942485727FF12288228760A9E");
            k.put("9a571aa113ad987d626c0457828962e6", "D2FF99A88BEB04683D89470D4FA72B1749DA456AB0D0F1A476477CE5A6874F53A9106423D905F9D808C0FCE8E7F1E04AC642F01FE41D0C7D933971F45CBA72B7");
            k.put("668319f11506def6208d6afe320dfd52", "53E53D46011A6BBAEA4FAE5442E659E0577CDD336F930C28635C322FB3F51C3C63F7FBAC9EAE448DFA2E5E5D716C4807");
            k.put("256b0f26bb2a9506be6cfdb84028ae08", "AF2228680EDC323FBA035362EB7E1E38A0C33E1CF6F6FB805EE553A230CBA754CD9552EB9B546542CBE619E8293151BE");
            String a2 = Ga.a(hb.f(context));
            j = a2;
            if (a2 == null || a2.length() == 0 || k == null || !k.containsKey(a2)) {
                return;
            }
            String str = k.get(a2);
            String str2 = null;
            if (str != null && str.length() > 0) {
                str2 = new String(Ga.d(a(str), a2), CommGlobal.charsetName);
            }
            if (str2 == null || str2.length() <= 0 || !str2.contains("http:")) {
                return;
            }
            f5730b = str2;
            f5729a = str2;
        } catch (Throwable th) {
            a(th, "CoreUtil", "checkUrl");
        }
    }

    public static void a(AMapLocation aMapLocation, JSONObject jSONObject) {
        if (jSONObject == null || aMapLocation == null) {
            return;
        }
        try {
            aMapLocation.setProvider(jSONObject.optString("provider", aMapLocation.getProvider()));
            aMapLocation.setLatitude(jSONObject.optDouble(LocationData.Columns.LATITUDE, aMapLocation.getLatitude()));
            aMapLocation.setLongitude(jSONObject.optDouble(PolicyProtocol.LONGITUDE, aMapLocation.getLongitude()));
            aMapLocation.setAltitude(jSONObject.optDouble("altitude", aMapLocation.getAltitude()));
            try {
                String optString = jSONObject.optString("accuracy");
                if (!TextUtils.isEmpty(optString)) {
                    aMapLocation.setAccuracy(Float.parseFloat(optString));
                }
            } catch (Throwable unused) {
            }
            try {
                String optString2 = jSONObject.optString("speed");
                if (!TextUtils.isEmpty(optString2)) {
                    aMapLocation.setSpeed(Float.parseFloat(optString2));
                }
            } catch (Throwable unused2) {
            }
            try {
                String optString3 = jSONObject.optString("bearing");
                if (!TextUtils.isEmpty(optString3)) {
                    aMapLocation.setBearing(Float.parseFloat(optString3));
                }
            } catch (Throwable unused3) {
            }
            aMapLocation.a(jSONObject.optString("adcode", aMapLocation.a()));
            aMapLocation.f(jSONObject.optString("citycode", aMapLocation.f()));
            aMapLocation.b(jSONObject.optString("address", aMapLocation.b()));
            String optString4 = jSONObject.optString("desc", "");
            aMapLocation.g(jSONObject.optString("country", aMapLocation.g()));
            aMapLocation.o(jSONObject.optString("province", aMapLocation.p()));
            aMapLocation.e(jSONObject.optString("city", aMapLocation.e()));
            aMapLocation.i(jSONObject.optString("district", aMapLocation.i()));
            aMapLocation.p(jSONObject.optString("road", aMapLocation.q()));
            aMapLocation.q(jSONObject.optString("street", aMapLocation.r()));
            aMapLocation.m(jSONObject.optString("number", aMapLocation.s()));
            aMapLocation.n(jSONObject.optString("poiname", aMapLocation.o()));
            aMapLocation.c(jSONObject.optString("aoiname", aMapLocation.c()));
            aMapLocation.a(jSONObject.optInt("errorCode", aMapLocation.j()));
            aMapLocation.j(jSONObject.optString("errorInfo", aMapLocation.k()));
            aMapLocation.c(jSONObject.optInt("locationType", aMapLocation.n()));
            aMapLocation.l(jSONObject.optString("locationDetail", aMapLocation.m()));
            aMapLocation.setTime(jSONObject.optLong("time", aMapLocation.getTime()));
            aMapLocation.c(jSONObject.optBoolean("isOffset", aMapLocation.t()));
            aMapLocation.d(jSONObject.optString("poiid", aMapLocation.d()));
            aMapLocation.k(jSONObject.optString("floor", aMapLocation.l()));
            aMapLocation.h(jSONObject.optString("description", aMapLocation.h()));
            Bundle bundle = new Bundle();
            bundle.putString("citycode", aMapLocation.f());
            bundle.putString("desc", optString4.toString());
            bundle.putString("adcode", aMapLocation.a());
            aMapLocation.setExtras(bundle);
        } catch (Throwable th) {
            a(th, "CoreUtil", "transformLocation");
        }
    }

    public static void a(Throwable th, String str, String str2) {
        if ("reportError".equals(str2)) {
            return;
        }
        try {
            th.printStackTrace();
            if (th instanceof C0431k) {
                return;
            }
            C0417d.b(th, str, str2);
        } catch (Throwable unused) {
        }
    }

    public static boolean a(double d2, double d3) {
        int i2 = (int) ((d3 - 73.0d) / 0.5d);
        int i3 = (int) ((d2 - 3.5d) / 0.5d);
        if (i3 < 0 || i3 >= 101 || i2 < 0 || i2 >= 124) {
            return false;
        }
        try {
            return "00000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000001011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011101010111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111101111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000110111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011010111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001010011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111100110001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111110011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111000000000111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111100000000000010111110100000011000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111110000000001111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111000000111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111101111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000101111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000011110000000001111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000000000000011000011111100000000111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000000001111111100111111111100110111111111111111111111111111111111111111111111110000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000000101111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111011111000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100100000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100011100000000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000111110000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110011111110000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110111111110000000000000000000000111011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111100000000000000000000000011111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111000000000000000000000000011111111111111111111111111111111111111111111111100001111111111111111111111111111111111111111111111111010000000000000000000000111111111111111111111111111111111111111111110000000000000001111111111111111111111111111111111111111111100000000000000000000011111111111111111111111111111111100000000000000000000000000001111111111111111111111111111111111111111110000000000000000000001111111111111111111111111111111100000000000000000000000000000001111111111111111111111111111111111111111000000000000000000000111111111111111111111111111111110000000000000000000000000000001111111111111111111111111111111111111111100000000000000000000111111111111111111111111111111000000000000000000000000000000000111111111111111111111111111111111111111111000000000000000000001111111111111111111111111110000000000000000000000000000000000001110011111111111111111111111111111111111111100000000000000000000011111111111111111100000000000000000000000000000000000000000000000001111111111111111111111111111111111111000000000000000000001111111111111111111000000000000000000000000000000000000000000000000011111111111111111111111111111111111100000000000000000000011111111111111111100000000000000000000000000000000000000000000000000011111111111111111111111111111111111000000000000000000001111111111111111100000000000000000000000000000000000000000000000000000000111111111111111111111111111111110000000000000000000000000111111111100000000000000000000000000000000000000000000000000111111111111111111111111111111111111111000000000000000000000000011111111100000000000000000000000000000000000000000000000000011111111111111111111111111111110001111100000000000000000000000000111110000000000000000000000000000000000000000000000000000001111111111111111111111111111111000000000000000000000000000000000001110000000000000000000000000000000000000000000000000000000011111111111111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010110000000000000000000000".charAt((i3 * 124) + i2) == '1';
        } catch (Throwable th) {
            a(th, "CoreUtil", "isChina");
            return true;
        }
    }

    private static byte[] a(String str) {
        if (str == null || str.length() < 2) {
            return new byte[0];
        }
        String lowerCase = str.toLowerCase(Locale.US);
        int length = lowerCase.length() / 2;
        byte[] bArr = new byte[length];
        for (int i2 = 0; i2 < length; i2++) {
            int i3 = i2 * 2;
            bArr[i2] = (byte) (Integer.parseInt(lowerCase.substring(i3, i3 + 2), 16) & 255);
        }
        return bArr;
    }

    public static rb b() {
        try {
            if (l == null) {
                rb.a aVar = new rb.a("loc", "3.8.0", "AMAP_Location_SDK_Android 3.8.0");
                aVar.a(d());
                aVar.a("3.8.0");
                l = aVar.a();
            }
        } catch (Throwable th) {
            a(th, "CoreUtil", "getSDKInfo");
        }
        return l;
    }

    public static String b(Context context) {
        boolean b2 = _a.b(context, SandboxSharedPref.DEFAULT_SHARED_PREF_FILE_NAME, "colde", false);
        if (b2) {
            n = b2;
            if (!f5732d.contains("11Z")) {
                f5732d += ";11Z";
            }
        }
        return f5732d;
    }

    public static String c(Context context) {
        return ob.b(hb.e(context));
    }

    public static boolean c() {
        if (!o) {
            o = true;
            p = false;
        }
        return p;
    }

    public static void d(Context context) {
        try {
            if (ab.a(e(context))) {
                f5729a = "http://abroad.apilocate.amap.com/mobile/binary";
            } else if (TextUtils.isEmpty(f5730b)) {
                f5729a = "http://apilocate.amap.com/mobile/binary";
            } else {
                f5729a = f5730b;
            }
        } catch (Throwable th) {
            a(th, "CoreUtil", "changeUrl");
        }
    }

    private static String[] d() {
        return (String[]) f5731c.clone();
    }

    private static String e(Context context) {
        try {
            return ab.a((TelephonyManager) context.getSystemService("phone"))[0];
        } catch (Throwable th) {
            a(th, "CoreUtil", "getMcc");
            return "";
        }
    }
}