派享便利 v1.0.3版本的 MD5 值为:1fc1776275e6607636a3a1f946b1f976
以下内容为反编译后的 fa.java 源代码,内容仅作参考
package com.loc;
import android.content.Context;
import com.amap.api.maps.AMap;
import com.loc.bh;
import io.dcloud.common.DHInterface.IApp;
import io.dcloud.common.DHInterface.IWebview;
import io.dcloud.common.util.net.NetWork;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
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(NetWork.CONTENT_TYPE, "application/octet-stream");
hashMap.put("Accept-Encoding", "gzip");
hashMap.put("gzipped", "1");
hashMap.put("Connection", "Keep-Alive");
hashMap.put(IWebview.USER_AGENT, "AMAP_Location_SDK_Android 5.5.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("ts", 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.5.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(AMap.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(AMap.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(NetWork.CONTENT_TYPE, "application/x-www-form-urlencoded");
hashMap.put("Connection", "Keep-Alive");
hashMap.put(IWebview.USER_AGENT, "AMAP_Location_SDK_Android 5.5.0");
HashMap hashMap2 = new HashMap(16);
hashMap2.put(AMap.CUSTOM, "26260A1F00020002");
hashMap2.put(IApp.ConfigProperty.CONFIG_KEY, k.f(context));
int i = this.f;
if (i != 0) {
if (i != 1) {
str = i == 2 ? "en" : "zh-CN";
}
hashMap2.put(IApp.ConfigProperty.CONFIG_LANGUAGE, str);
String a = m.a();
String a2 = m.a(context, a, u.b(hashMap2));
hashMap2.put("ts", a);
hashMap2.put("scode", a2);
fbVar.b(("output=json&radius=1000&extensions=all&location=" + d2 + "," + 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.5.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(IApp.ConfigProperty.CONFIG_LANGUAGE);
String a3 = m.a();
String a22 = m.a(context, a3, u.b(hashMap2));
hashMap2.put("ts", a3);
hashMap2.put("scode", a22);
fbVar.b(("output=json&radius=1000&extensions=all&location=" + d2 + "," + 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.5.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");
}
}
}