package com.amap.api.col.p0003nsl; import android.content.Context; import com.alibaba.idst.nui.Constants; import java.util.Hashtable; import java.util.List; import java.util.Locale; import java.util.Map; /* renamed from: com.amap.api.col.3nsl.co reason: invalid package */ /* compiled from: CustomStyleRequest */ public final class co extends kt<String, a> { private String j; private String k = "1.0"; private String l = Constants.ModeFullMix; private final String m = "lastModified"; private boolean n = false; private String o = null; /* renamed from: com.amap.api.col.3nsl.co$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.p0003nsl.kt public final /* bridge */ /* synthetic */ a a(String str) throws ks { return null; } /* access modifiers changed from: protected */ @Override // com.amap.api.col.p0003nsl.kt public final String c() { return null; } @Override // com.amap.api.col.p0003nsl.nq public final boolean isSupportIPV6() { return true; } public co(Context context, String str) { super(context, str); this.h = "/map/styles"; this.i = true; } public co(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(nr nrVar) throws ks { List<String> list; if (nrVar == null) { return null; } a b = a(nrVar.a); b.d = b.a != null; if (nrVar.b == null || !nrVar.b.containsKey("lastModified") || (list = nrVar.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 ks { 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) { mk.c(e, "CustomStyleRequest", "loadData"); } } } return aVar; } @Override // com.amap.api.col.p0003nsl.kt, com.amap.api.col.p0003nsl.nq public final Map<String, String> getRequestHead() { ln a2 = du.a(); String b = a2 != null ? a2.b() : null; Hashtable hashtable = new Hashtable(16); hashtable.put("User-Agent", u.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", le.a(this.g)); hashtable.put("key", lb.f(this.g)); hashtable.put("logversion", "2.1"); return hashtable; } @Override // com.amap.api.col.p0003nsl.cy, com.amap.api.col.p0003nsl.nq public final Map<String, String> getParams() { Hashtable hashtable = new Hashtable(16); hashtable.put("key", lb.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", Constants.ModeFullCloud); hashtable.put("lastModified", this.l); String a2 = le.a(); String a3 = le.a(this.g, a2, lo.b(hashtable)); hashtable.put("ts", a2); hashtable.put("scode", a3); return hashtable; } @Override // com.amap.api.col.p0003nsl.nq public final String getURL() { return "http://restsdk.amap.com/v4" + this.h; } @Override // com.amap.api.col.p0003nsl.nq public final String getIPV6URL() { return du.a(getURL()); } public final void c(String str) { this.j = str; } public final void d(String str) { this.l = str; } }