package k4; import android.content.Context; import android.text.TextUtils; import com.huawei.hms.framework.common.ContainerUtils; import java.util.ArrayList; import java.util.List; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import t4.d; import t4.i; import t4.m; public final class a { public static final boolean A = true; public static final boolean B = false; public static final boolean C = true; public static final boolean D = true; public static final String E = ""; public static final boolean F = false; public static final boolean G = false; public static final boolean H = false; public static final boolean I = false; public static final boolean J = true; public static final String K = ""; public static final boolean L = false; public static final String M = ""; public static final int N = 1000; public static final int O = 20000; public static final String P = "alipay_cashier_dynamic_config"; public static final String Q = "timeout"; public static final String R = "h5_port_degrade"; public static final String S = "st_sdk_config"; public static final String T = "tbreturl"; public static final String U = "launchAppSwitch"; public static final String V = "configQueryInterval"; public static final String W = "deg_log_mcgw"; public static final String X = "deg_start_srv_first"; public static final String Y = "prev_jump_dual"; public static final String Z = "use_sc_only"; /* renamed from: a0 reason: collision with root package name */ public static final String f79148a0 = "bind_use_imp"; /* renamed from: b0 reason: collision with root package name */ public static final String f79149b0 = "retry_bnd_once"; /* renamed from: c0 reason: collision with root package name */ public static final String f79150c0 = "skip_trans"; /* renamed from: d0 reason: collision with root package name */ public static final String f79151d0 = "start_trans"; /* renamed from: e0 reason: collision with root package name */ public static final String f79152e0 = "up_before_pay"; /* renamed from: f0 reason: collision with root package name */ public static final String f79153f0 = "lck_k"; /* renamed from: g0 reason: collision with root package name */ public static final String f79154g0 = "use_sc_lck_a"; /* renamed from: h0 reason: collision with root package name */ public static final String f79155h0 = "utdid_factor"; /* renamed from: i0 reason: collision with root package name */ public static final String f79156i0 = "scheme_pay_2"; /* renamed from: j0 reason: collision with root package name */ public static final String f79157j0 = "intercept_batch"; /* renamed from: k0 reason: collision with root package name */ public static final String f79158k0 = "bind_with_startActivity"; /* renamed from: l0 reason: collision with root package name */ public static a f79159l0 = null; /* renamed from: m0 reason: collision with root package name */ public static final char[] f79160m0 = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '+', '/'}; /* renamed from: v reason: collision with root package name */ public static final String f79161v = "DynCon"; /* renamed from: w reason: collision with root package name */ public static final int f79162w = 10000; /* renamed from: x reason: collision with root package name */ public static final String f79163x = "https://h5.m.taobao.com/mlapp/olist.html"; /* renamed from: y reason: collision with root package name */ public static final int f79164y = 10; /* renamed from: z reason: collision with root package name */ public static final boolean f79165z = true; /* renamed from: a reason: collision with root package name */ public int f79166a = 10000; /* renamed from: b reason: collision with root package name */ public boolean f79167b = false; /* renamed from: c reason: collision with root package name */ public String f79168c = f79163x; /* renamed from: d reason: collision with root package name */ public int f79169d = 10; /* renamed from: e reason: collision with root package name */ public boolean f79170e = true; /* renamed from: f reason: collision with root package name */ public boolean f79171f = true; /* renamed from: g reason: collision with root package name */ public boolean f79172g = false; /* renamed from: h reason: collision with root package name */ public boolean f79173h = false; /* renamed from: i reason: collision with root package name */ public boolean f79174i = true; /* renamed from: j reason: collision with root package name */ public boolean f79175j = true; /* renamed from: k reason: collision with root package name */ public String f79176k = ""; /* renamed from: l reason: collision with root package name */ public boolean f79177l = false; /* renamed from: m reason: collision with root package name */ public boolean f79178m = false; /* renamed from: n reason: collision with root package name */ public boolean f79179n = false; /* renamed from: o reason: collision with root package name */ public boolean f79180o = false; /* renamed from: p reason: collision with root package name */ public boolean f79181p = true; /* renamed from: q reason: collision with root package name */ public String f79182q = ""; /* renamed from: r reason: collision with root package name */ public String f79183r = ""; /* renamed from: s reason: collision with root package name */ public boolean f79184s = false; /* renamed from: t reason: collision with root package name */ public List<b> f79185t = null; /* renamed from: u reason: collision with root package name */ public int f79186u = -1; /* renamed from: k4.a$a reason: collision with other inner class name */ public class RunnableC0690a implements Runnable { /* renamed from: a reason: collision with root package name */ public final /* synthetic */ r4.a f79187a; /* renamed from: b reason: collision with root package name */ public final /* synthetic */ Context f79188b; public RunnableC0690a(r4.a aVar, Context context) { this.f79187a = aVar; this.f79188b = context; } public void run() { try { o4.b e10 = new p4.b().e(this.f79187a, this.f79188b); if (e10 != null) { a.this.o(e10.a()); a.this.f(r4.a.o()); } } catch (Throwable th2) { d.d(th2); } } } public static final class b { /* renamed from: a reason: collision with root package name */ public final String f79190a; /* renamed from: b reason: collision with root package name */ public final int f79191b; /* renamed from: c reason: collision with root package name */ public final String f79192c; public b(String str, int i10, String str2) { this.f79190a = str; this.f79191b = i10; this.f79192c = str2; } public static List<b> a(JSONArray jSONArray) { if (jSONArray == null) { return null; } ArrayList arrayList = new ArrayList(); int length = jSONArray.length(); for (int i10 = 0; i10 < length; i10++) { b b10 = b(jSONArray.optJSONObject(i10)); if (b10 != null) { arrayList.add(b10); } } return arrayList; } public static b b(JSONObject jSONObject) { if (jSONObject == null) { return null; } return new b(jSONObject.optString("pn"), jSONObject.optInt("v", 0), jSONObject.optString("pk")); } public static JSONArray c(List<b> list) { if (list == null) { return null; } JSONArray jSONArray = new JSONArray(); for (b bVar : list) { jSONArray.put(d(bVar)); } return jSONArray; } public static JSONObject d(b bVar) { if (bVar == null) { return null; } try { return new JSONObject().put("pn", bVar.f79190a).put("v", bVar.f79191b).put("pk", bVar.f79192c); } catch (JSONException e10) { d.d(e10); return null; } } public String toString() { return String.valueOf(d(this)); } } public static a H() { if (f79159l0 == null) { a aVar = new a(); f79159l0 = aVar; aVar.D(); } return f79159l0; } public static long a(String str) { return b(str, 6); } public static long b(String str, int i10) { int pow = (int) Math.pow(2.0d, (double) i10); int length = str.length(); long j10 = 0; int i11 = 0; int i12 = length; while (i11 < length) { int i13 = i11 + 1; j10 += ((long) Integer.parseInt(String.valueOf(k(str.substring(i11, i13))))) * ((long) Math.pow((double) pow, (double) (i12 - 1))); i12--; i11 = i13; } return j10; } public static int k(String str) { for (int i10 = 0; i10 < 64; i10++) { if (str.equals(String.valueOf(f79160m0[i10]))) { return i10; } } return 0; } public boolean A() { return this.f79179n; } public String B() { return this.f79168c; } public boolean C() { return this.f79181p; } public void D() { Context c10 = r4.b.e().c(); String b10 = i.b(r4.a.o(), c10, P, null); try { this.f79186u = Integer.parseInt(i.b(r4.a.o(), c10, f79155h0, "-1")); } catch (Exception unused) { } n(b10); } public boolean E() { return this.f79167b; } public boolean F() { return this.f79180o; } public final int G() { String d10 = r4.b.e().d(); if (TextUtils.isEmpty(d10)) { return -1; } String replaceAll = d10.replaceAll(ContainerUtils.KEY_VALUE_DELIMITER, ""); if (replaceAll.length() >= 5) { replaceAll = replaceAll.substring(0, 5); } int a10 = (int) (a(replaceAll) % 10000); return a10 < 0 ? a10 * -1 : a10; } public final JSONObject I() throws JSONException { JSONObject jSONObject = new JSONObject(); jSONObject.put("timeout", v()); jSONObject.put(R, E()); jSONObject.put(T, B()); jSONObject.put(V, m()); jSONObject.put(U, b.c(w())); jSONObject.put(f79156i0, t()); jSONObject.put(f79157j0, s()); jSONObject.put(W, p()); jSONObject.put(X, q()); jSONObject.put(Y, x()); jSONObject.put(Z, r()); jSONObject.put(f79148a0, i()); jSONObject.put(f79149b0, y()); jSONObject.put(f79150c0, A()); jSONObject.put(f79151d0, F()); jSONObject.put(f79152e0, C()); jSONObject.put(f79154g0, z()); jSONObject.put(f79153f0, u()); jSONObject.put(f79158k0, l()); return jSONObject; } public final void e(JSONObject jSONObject) { this.f79166a = jSONObject.optInt("timeout", 10000); this.f79167b = jSONObject.optBoolean(R, false); this.f79168c = jSONObject.optString(T, f79163x).trim(); this.f79169d = jSONObject.optInt(V, 10); this.f79185t = b.a(jSONObject.optJSONArray(U)); this.f79170e = jSONObject.optBoolean(f79156i0, true); this.f79171f = jSONObject.optBoolean(f79157j0, true); this.f79173h = jSONObject.optBoolean(W, false); this.f79174i = jSONObject.optBoolean(X, true); this.f79175j = jSONObject.optBoolean(Y, true); this.f79176k = jSONObject.optString(Z, ""); this.f79177l = jSONObject.optBoolean(f79148a0, false); this.f79178m = jSONObject.optBoolean(f79149b0, false); this.f79179n = jSONObject.optBoolean(f79150c0, false); this.f79180o = jSONObject.optBoolean(f79151d0, false); this.f79181p = jSONObject.optBoolean(f79152e0, true); this.f79182q = jSONObject.optString(f79153f0, ""); this.f79184s = jSONObject.optBoolean(f79154g0, false); this.f79183r = jSONObject.optString(f79158k0, ""); } public final void f(r4.a aVar) { try { JSONObject I2 = I(); i.e(aVar, r4.b.e().c(), P, I2.toString()); } catch (Exception e10) { d.d(e10); } } public void g(r4.a aVar, Context context, boolean z10) { RunnableC0690a aVar2 = new RunnableC0690a(aVar, context); if (!z10) { Thread thread = new Thread(aVar2); thread.setName("AlipayDCP"); thread.start(); } else if (!m.s(600, aVar2, "AlipayDCPBlok")) { i4.a.i(aVar, i4.b.f70893l, i4.b.f70906r0, ""); } } public void h(boolean z10) { this.f79172g = z10; } public boolean i() { return this.f79177l; } public boolean j(Context context, int i10) { if (this.f79186u == -1) { this.f79186u = G(); i.e(r4.a.o(), context, f79155h0, String.valueOf(this.f79186u)); } return this.f79186u < i10; } public String l() { return this.f79183r; } public int m() { return this.f79169d; } public final void n(String str) { if (!TextUtils.isEmpty(str)) { try { e(new JSONObject(str)); } catch (Throwable th2) { d.d(th2); } } } public final void o(String str) { if (!TextUtils.isEmpty(str)) { try { JSONObject optJSONObject = new JSONObject(str).optJSONObject(S); if (optJSONObject != null) { e(optJSONObject); } else { d.j(f79161v, "empty config"); } } catch (Throwable th2) { d.d(th2); } } } public boolean p() { return this.f79173h; } public boolean q() { return this.f79174i; } public String r() { return this.f79176k; } public boolean s() { return this.f79171f; } public boolean t() { return this.f79170e; } public String u() { return this.f79182q; } public int v() { int i10 = this.f79166a; if (i10 < 1000 || i10 > 20000) { d.g(f79161v, "time(def) = 10000"); return 10000; } d.g(f79161v, "time = " + this.f79166a); return this.f79166a; } public List<b> w() { return this.f79185t; } public boolean x() { return this.f79175j; } public boolean y() { return this.f79178m; } public boolean z() { return this.f79184s; } }