同程有借 v1.0.0版本的 MD5 值为:e33397cdbab33543d0c134ec96d77fb8
以下内容为反编译后的 fm.java 源代码,内容仅作参考
package com.loc;
import android.content.Context;
import anet.channel.util.HttpConstant;
import com.loc.bt;
import com.umeng.message.entity.UMessage;
import com.xiaomi.mipush.sdk.Constants;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
public final class fm {
private static fm f9918b;
bo f9919a;
private Context f9920c;
private int f9921d = fr.f9997i;
private boolean f9922e = false;
private int f9923f = 0;
private fm(Context context) {
this.f9919a = null;
this.f9920c = null;
try {
q.a().a(context);
} catch (Throwable unused) {
}
this.f9920c = context;
this.f9919a = bo.a();
}
public static fm a(Context context) {
if (f9918b == null) {
f9918b = new fm(context);
}
return f9918b;
}
public final bu a(fn fnVar) throws Throwable {
if (this.f9922e) {
fnVar.a(bt.c.HTTPS);
}
return bo.a(fnVar);
}
public final fn a(Context context, byte[] bArr, String str, String str2, boolean z8) {
String str3;
try {
HashMap hashMap = new HashMap(16);
fn fnVar = new fn(context, fr.c());
try {
hashMap.put(HttpConstant.CONTENT_TYPE, "application/octet-stream");
hashMap.put(HttpConstant.ACCEPT_ENCODING, "gzip");
hashMap.put("gzipped", "1");
hashMap.put("Connection", "Keep-Alive");
hashMap.put("User-Agent", "AMAP_Location_SDK_Android 6.2.0");
hashMap.put("KEY", l.f(context));
hashMap.put("enginever", fr.f9989a);
String a9 = n.a();
String a10 = n.a(context, a9, "key=" + l.f(context));
hashMap.put("ts", a9);
hashMap.put("scode", a10);
if (Double.valueOf(fr.f9989a).doubleValue() >= 5.3d) {
hashMap.put("aps_s_src", "openapi");
}
hashMap.put("encr", "1");
fnVar.b(hashMap);
String str4 = z8 ? "loc" : "locf";
fnVar.c(true);
fnVar.b(String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "6.2.0", str4, 3));
fnVar.b(z8);
fnVar.c(str);
fnVar.d(str2);
fnVar.c(fy.a(bArr));
fnVar.a(v.a(context));
HashMap hashMap2 = new HashMap(16);
hashMap2.put("output", "bin");
hashMap2.put(com.umeng.analytics.pro.bh.bt, "3103");
int i9 = this.f9923f;
if (i9 != 0) {
if (i9 != 1) {
str3 = i9 == 2 ? "language:en" : "language:cn";
}
hashMap2.put(UMessage.DISPLAY_TYPE_CUSTOM, str3);
fnVar.a((Map<String, String>) hashMap2);
fnVar.a(this.f9921d);
fnVar.b(this.f9921d);
if (this.f9922e) {
return fnVar;
}
fnVar.a(bt.c.HTTPS);
return fnVar;
}
hashMap2.remove(UMessage.DISPLAY_TYPE_CUSTOM);
fnVar.a((Map<String, String>) hashMap2);
fnVar.a(this.f9921d);
fnVar.b(this.f9921d);
if (this.f9922e) {
}
} catch (Throwable unused) {
return fnVar;
}
} catch (Throwable unused2) {
return null;
}
}
public final String a(Context context, double d9, double d10) {
String str;
try {
HashMap hashMap = new HashMap(16);
fn fnVar = new fn(context, fr.c());
hashMap.clear();
hashMap.put(HttpConstant.CONTENT_TYPE, "application/x-www-form-urlencoded");
hashMap.put("Connection", "Keep-Alive");
hashMap.put("User-Agent", "AMAP_Location_SDK_Android 6.2.0");
HashMap hashMap2 = new HashMap(16);
hashMap2.put(UMessage.DISPLAY_TYPE_CUSTOM, "26260A1F00020002");
hashMap2.put("key", l.f(context));
int i9 = this.f9923f;
if (i9 != 0) {
if (i9 != 1) {
str = i9 == 2 ? "en" : "zh-CN";
}
hashMap2.put(com.umeng.analytics.pro.bh.N, str);
hashMap2.put("curLocationType", !fy.m(this.f9920c) ? "coarseLoc" : "fineLoc");
String a9 = n.a();
String a10 = n.a(context, a9, x.b(hashMap2));
hashMap2.put("ts", a9);
hashMap2.put("scode", a10);
fnVar.b(("output=json&radius=1000&extensions=all&location=" + d10 + Constants.ACCEPT_TIME_SEPARATOR_SP + d9).getBytes("UTF-8"));
fnVar.c(false);
fnVar.b(true);
fnVar.b(String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "6.2.0", "loc", 3));
fnVar.a((Map<String, String>) hashMap2);
fnVar.b(hashMap);
fnVar.a(v.a(context));
fnVar.a(fr.f9997i);
fnVar.b(fr.f9997i);
fnVar.d("http://dualstack-arestapi.amap.com/v3/geocode/regeo");
fnVar.c("http://restsdk.amap.com/v3/geocode/regeo");
if (this.f9922e) {
fnVar.a(bt.c.HTTPS);
}
return new String(bo.a(fnVar).f9355a, "utf-8");
}
hashMap2.remove(com.umeng.analytics.pro.bh.N);
hashMap2.put("curLocationType", !fy.m(this.f9920c) ? "coarseLoc" : "fineLoc");
String a92 = n.a();
String a102 = n.a(context, a92, x.b(hashMap2));
hashMap2.put("ts", a92);
hashMap2.put("scode", a102);
fnVar.b(("output=json&radius=1000&extensions=all&location=" + d10 + Constants.ACCEPT_TIME_SEPARATOR_SP + d9).getBytes("UTF-8"));
fnVar.c(false);
fnVar.b(true);
fnVar.b(String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s&loc_channel=%s", "6.2.0", "loc", 3));
fnVar.a((Map<String, String>) hashMap2);
fnVar.b(hashMap);
fnVar.a(v.a(context));
fnVar.a(fr.f9997i);
fnVar.b(fr.f9997i);
fnVar.d("http://dualstack-arestapi.amap.com/v3/geocode/regeo");
fnVar.c("http://restsdk.amap.com/v3/geocode/regeo");
if (this.f9922e) {
}
return new String(bo.a(fnVar).f9355a, "utf-8");
} catch (Throwable unused) {
return null;
}
}
public final void a(long j9, boolean z8, int i9) {
try {
this.f9922e = z8;
this.f9921d = Long.valueOf(j9).intValue();
this.f9923f = i9;
} catch (Throwable th) {
fr.a(th, "LocNetManager", "setOption");
}
}
}