package c.a.b.b; import android.content.Context; import android.text.TextUtils; import c.a.b.f.b; import com.alipay.sdk.util.e; import com.alipay.sdk.util.k; import com.umeng.analytics.pro.ai; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public final class a { /* renamed from: a */ private static a f162a; /* renamed from: b */ private int f163b = 3500; /* renamed from: c */ private String f164c = "https://h5.m.taobao.com/mlapp/olist.html"; /* renamed from: d */ private int f165d = 10; /* renamed from: e */ private boolean f166e = true; /* renamed from: f */ private boolean f167f = true; /* renamed from: g */ public boolean f168g = false; /* renamed from: h */ private List<C0002a> f169h = null; /* renamed from: c.a.b.b.a$a */ public static final class C0002a { /* renamed from: a */ public final String f170a; /* renamed from: b */ public final int f171b; /* renamed from: c */ public final String f172c; public C0002a(String str, int i, String str2) { this.f170a = str; this.f171b = i; this.f172c = str2; } public static C0002a a(JSONObject jSONObject) { if (jSONObject == null) { return null; } return new C0002a(jSONObject.optString("pn"), jSONObject.optInt(ai.aC, 0), jSONObject.optString("pk")); } public static List<C0002a> a(JSONArray jSONArray) { if (jSONArray == null) { return null; } ArrayList arrayList = new ArrayList(); int length = jSONArray.length(); for (int i = 0; i < length; i++) { C0002a a2 = a(jSONArray.optJSONObject(i)); if (a2 != null) { arrayList.add(a2); } } return arrayList; } public static JSONArray a(List<C0002a> list) { if (list == null) { return null; } JSONArray jSONArray = new JSONArray(); for (C0002a aVar : list) { jSONArray.put(a(aVar)); } return jSONArray; } public static JSONObject a(C0002a aVar) { if (aVar == null) { return null; } try { return new JSONObject().put("pn", aVar.f170a).put(ai.aC, aVar.f171b).put("pk", aVar.f172c); } catch (JSONException e2) { e.a(e2); return null; } } public String toString() { return String.valueOf(a(this)); } } private void a(String str) { if (!TextUtils.isEmpty(str)) { try { JSONObject jSONObject = new JSONObject(str); this.f163b = jSONObject.optInt("timeout", 3500); this.f164c = jSONObject.optString("tbreturl", "https://h5.m.taobao.com/mlapp/olist.html").trim(); this.f165d = jSONObject.optInt("configQueryInterval", 10); this.f169h = C0002a.a(jSONObject.optJSONArray("launchAppSwitch")); this.f166e = jSONObject.optBoolean("scheme_pay_2", true); this.f167f = jSONObject.optBoolean("intercept_batch", true); } catch (Throwable th) { e.a(th); } } } /* access modifiers changed from: public */ private void b(String str) { if (!TextUtils.isEmpty(str)) { try { JSONObject optJSONObject = new JSONObject(str).optJSONObject("st_sdk_config"); if (optJSONObject != null) { this.f163b = optJSONObject.optInt("timeout", 3500); this.f164c = optJSONObject.optString("tbreturl", "https://h5.m.taobao.com/mlapp/olist.html").trim(); this.f165d = optJSONObject.optInt("configQueryInterval", 10); this.f169h = C0002a.a(optJSONObject.optJSONArray("launchAppSwitch")); this.f166e = optJSONObject.optBoolean("scheme_pay_2", true); this.f167f = optJSONObject.optBoolean("intercept_batch", true); return; } e.c("msp", "config is null"); } catch (Throwable th) { e.a(th); } } } public static a g() { if (f162a == null) { f162a = new a(); f162a.h(); } return f162a; } private void h() { a(k.b(b.a().b(), "alipay_cashier_dynamic_config", null)); } /* access modifiers changed from: public */ private void i() { try { JSONObject jSONObject = new JSONObject(); jSONObject.put("timeout", a()); jSONObject.put("tbreturl", d()); jSONObject.put("configQueryInterval", e()); jSONObject.put("launchAppSwitch", C0002a.a(f())); jSONObject.put("scheme_pay_2", b()); jSONObject.put("intercept_batch", c()); k.a(b.a().b(), "alipay_cashier_dynamic_config", jSONObject.toString()); } catch (Exception e2) { e.a(e2); } } public int a() { int i = this.f163b; if (i < 1000 || i > 20000) { e.a("", "DynamicConfig::getJumpTimeout(default) >3500"); return 3500; } e.a("", "DynamicConfig::getJumpTimeout >" + this.f163b); return this.f163b; } public void a(Context context) { new Thread(new b(this, context)).start(); } public boolean b() { return this.f166e; } public boolean c() { return this.f167f; } public String d() { return this.f164c; } public int e() { return this.f165d; } public List<C0002a> f() { return this.f169h; } }