package com.amap.api.col.p0003s; import android.content.Context; import com.taobao.weex.performance.WXInstanceApm; import io.dcloud.common.DHInterface.IApp; import io.dcloud.common.DHInterface.IWebview; import java.util.Hashtable; import java.util.List; import java.util.Locale; import java.util.Map; /* renamed from: com.amap.api.col.3s.cf reason: invalid package */ /* compiled from: CustomStyleRequest */ public final class cf extends gw<String, a> { private String j; private String k = "1.0"; private String l = WXInstanceApm.VALUE_ERROR_CODE_DEFAULT; private final String m = "lastModified"; private boolean n = false; private String o = null; /* renamed from: com.amap.api.col.3s.cf$a */ /* compiled from: CustomStyleRequest */ public static class a { public byte[] a; public int b = -1; public String c = null; public boolean d = false; } /* Return type fixed from 'java.lang.Object' to match base method */ /* access modifiers changed from: protected */ @Override // com.amap.api.col.p0003s.gw public final /* bridge */ /* synthetic */ a a(String str) throws gv { return null; } /* access modifiers changed from: protected */ @Override // com.amap.api.col.p0003s.gw public final String c() { return null; } @Override // com.amap.api.col.p0003s.jq public final boolean isSupportIPV6() { return true; } public cf(Context context, String str) { super(context, str); this.h = "/map/styles"; this.i = true; } public cf(Context context, String str, boolean z) { super(context, str); this.n = z; if (z) { this.h = "/sdk/map/styles"; this.isPostFlag = false; } else { this.h = "/map/styles"; } this.i = true; } public final void b(String str) { this.o = str; } /* access modifiers changed from: private */ /* renamed from: b */ public a a(jr jrVar) throws gv { List<String> list; if (jrVar == null) { return null; } a b = a(jrVar.a); b.d = b.a != null; if (jrVar.b == null || !jrVar.b.containsKey("lastModified") || (list = jrVar.b.get("lastModified")) == null || list.size() <= 0) { return b; } b.c = list.get(0); return b; } /* access modifiers changed from: private */ /* renamed from: b */ public a a(byte[] bArr) throws gv { a aVar = new a(); aVar.a = bArr; if (this.n && bArr != null) { if (bArr.length == 0) { aVar.a = null; } else if (aVar.a.length <= 1024) { try { if (new String(bArr, "utf-8").contains("errcode")) { aVar.a = null; } } catch (Exception e) { il.c(e, "CustomStyleRequest", "loadData"); } } } return aVar; } @Override // com.amap.api.col.p0003s.gw, com.amap.api.col.p0003s.jq public final Map<String, String> getRequestHead() { hq a2 = dl.a(); String b = a2 != null ? a2.b() : null; Hashtable hashtable = new Hashtable(16); hashtable.put(IWebview.USER_AGENT, l.c); hashtable.put("Accept-Encoding", "gzip"); hashtable.put("platinfo", String.format(Locale.US, "platform=Android&sdkversion=%s&product=%s", b, "3dmap")); hashtable.put("x-INFO", hh.a(this.g)); hashtable.put(IApp.ConfigProperty.CONFIG_KEY, he.f(this.g)); hashtable.put("logversion", "2.1"); return hashtable; } @Override // com.amap.api.col.p0003s.cp, com.amap.api.col.p0003s.jq public final Map<String, String> getParams() { Hashtable hashtable = new Hashtable(16); hashtable.put(IApp.ConfigProperty.CONFIG_KEY, he.f(this.g)); if (!this.n) { hashtable.put("output", "bin"); } else { hashtable.put("sdkType", this.o); } hashtable.put("styleid", this.j); hashtable.put("protocol", this.k); hashtable.put("ispublic", "1"); hashtable.put("lastModified", this.l); String a2 = hh.a(); String a3 = hh.a(this.g, a2, hr.b(hashtable)); hashtable.put("ts", a2); hashtable.put("scode", a3); return hashtable; } @Override // com.amap.api.col.p0003s.jq public final String getURL() { return "http://restsdk.amap.com/v4" + this.h; } @Override // com.amap.api.col.p0003s.jq public final String getIPV6URL() { return dl.a(getURL()); } public final void c(String str) { this.j = str; } public final void d(String str) { this.l = str; } }