package com.tencent.klevin.config.b; import android.text.TextUtils; import com.bytedance.sdk.openadsdk.TTAdConstant; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; public class a { private long a; private final b b; private final c c; private final List<d> d; /* access modifiers changed from: private */ public static class b { String a; int b; long c; int d; /* renamed from: e reason: collision with root package name */ int f16187e; /* renamed from: f reason: collision with root package name */ int f16188f; /* renamed from: g reason: collision with root package name */ int f16189g; /* renamed from: h reason: collision with root package name */ int f16190h; /* renamed from: i reason: collision with root package name */ int f16191i; int j; int k; String l; int m; int n; int o; int p; long q; private b() { this.b = 1; this.c = 10800; this.d = 4; this.f16187e = 1; this.f16188f = TTAdConstant.SHOW_POLL_TIME_SPLASH_DEFAULT; this.f16189g = TTAdConstant.SHOW_POLL_TIME_SPLASH_DEFAULT; this.f16190h = 5000; this.f16191i = 1; this.j = 30; this.k = 0; this.l = "https://static.yky.qq.com/bridge-h5/latest/dist/js-bridge-h5.umd.js"; this.m = 0; this.n = 0; this.o = 0; this.p = 0; this.q = 200; } } /* access modifiers changed from: private */ public static class c { int a; int b; int c; int d; /* renamed from: e reason: collision with root package name */ int f16192e; /* renamed from: f reason: collision with root package name */ int f16193f; private c() { this.a = 1; this.b = 1; this.c = 1; this.d = 1; this.f16192e = 0; this.f16193f = 1; } } /* access modifiers changed from: private */ public static class d { List<Long> a; int b; int c; int d; /* renamed from: e reason: collision with root package name */ String f16194e; /* renamed from: f reason: collision with root package name */ int f16195f; /* renamed from: g reason: collision with root package name */ int f16196g; /* renamed from: h reason: collision with root package name */ int f16197h; /* renamed from: i reason: collision with root package name */ int f16198i; int j; int k; int l; Map<Long, String> m; Map<Long, String> n; private d() { this.a = new ArrayList(); this.b = 5; this.c = 0; this.d = 0; this.f16194e = "点击跳转至详情页 >"; this.f16195f = 0; this.f16196g = 1; this.f16197h = 0; this.f16198i = 0; this.j = 0; this.k = -1; this.l = -1; this.m = new LinkedHashMap(); this.n = new LinkedHashMap(); } } /* access modifiers changed from: private */ public static class e { private static final a a = new a(); } public static a b() { return e.a; } public long a() { return this.a; } /* JADX WARNING: Removed duplicated region for block: B:12:0x0027 */ /* JADX WARNING: Removed duplicated region for block: B:16:0x0031 */ public long c(String str) { char c2; int hashCode = str.hashCode(); if (hashCode != -1788299311) { if (hashCode == 1523819489 && str.equals("ad_exposure_interval")) { c2 = 1; if (c2 == 0) { return this.b.c; } if (c2 != 1) { return 0; } return this.b.q; } } else if (str.equals("ad_expire_time")) { c2 = 0; if (c2 == 0) { } } c2 = 65535; if (c2 == 0) { } } public String d(String str) { if (((str.hashCode() == -1750371902 && str.equals("jsbridge_url")) ? (char) 0 : 65535) != 0) { return null; } return this.b.l; } public boolean e(String str) { try { JSONObject jSONObject = new JSONObject(str); this.a = jSONObject.optLong("request_interval", 86400); JSONObject optJSONObject = jSONObject.optJSONObject("klevinsdk"); if (optJSONObject != null) { this.b.a = optJSONObject.optString("config_ver"); this.b.b = optJSONObject.optInt("ad_total_status", 1); this.b.c = optJSONObject.optLong("ad_expire_time", 10800); this.b.d = optJSONObject.optInt("file_log_level", 4); this.b.f16187e = optJSONObject.optInt("x5_enable", 1); this.b.f16188f = optJSONObject.optInt("interactive_vibrate_time", TTAdConstant.SHOW_POLL_TIME_SPLASH_DEFAULT); this.b.f16189g = optJSONObject.optInt("interactive_vibrate_interval_time", TTAdConstant.SHOW_POLL_TIME_SPLASH_DEFAULT); this.b.f16190h = optJSONObject.optInt("ad_imp_end_countdown", 5000); this.b.f16191i = optJSONObject.optInt("webp_status", 1); this.b.j = optJSONObject.optInt("ssp_report_interval", 30); this.b.k = optJSONObject.optInt("interstitial_web_enable", 0); this.b.l = optJSONObject.optString("jsbridge_url", "https://static.yky.qq.com/bridge-h5/latest/dist/js-bridge-h5.umd.js"); this.b.m = optJSONObject.optInt("webview_pool", 0); this.b.n = optJSONObject.optInt("endCard_web_enable", 0); this.b.o = optJSONObject.optInt("disable_report_privacy", 0); this.b.p = optJSONObject.optInt("disable_webview_share", 0); this.b.q = optJSONObject.optLong("imp_check_interval", 200); } JSONObject optJSONObject2 = jSONObject.optJSONObject("ad_site_status"); if (optJSONObject2 != null) { this.c.b = optJSONObject2.optInt("ad_reward", 1); this.c.c = optJSONObject2.optInt("ad_interstial", 1); this.c.d = optJSONObject2.optInt("ad_native", 1); this.c.f16192e = optJSONObject2.optInt("ad_download_diog", 0); this.c.f16193f = optJSONObject2.optInt("ad_template", 1); this.c.a = optJSONObject2.optInt("ad_newSplash", 1); } JSONArray optJSONArray = jSONObject.optJSONArray("ad_strategy"); this.d.clear(); if (optJSONArray != null && optJSONArray.length() > 0) { for (int i2 = 0; i2 < optJSONArray.length(); i2++) { JSONObject optJSONObject3 = optJSONArray.optJSONObject(i2); if (optJSONObject3 != null) { d dVar = new d(); JSONArray optJSONArray2 = optJSONObject3.optJSONArray("teamplate"); if (optJSONArray2 != null && optJSONArray2.length() > 0) { for (int i3 = 0; i3 < optJSONArray2.length(); i3++) { dVar.a.add(Long.valueOf(optJSONArray2.getLong(i3))); } } dVar.c = optJSONObject3.optInt("skip_show_time", 0); dVar.f16194e = optJSONObject3.optString("click_info_text", "点击跳转至详情页 >"); dVar.f16195f = optJSONObject3.optInt("click_type", 0); dVar.d = optJSONObject3.optInt("click_area", 0); dVar.f16196g = optJSONObject3.optInt("disable_stream_video", 1); dVar.f16197h = optJSONObject3.optInt("ad_download_diog", 0); dVar.f16198i = optJSONObject3.optInt("interactive_auto_play", 0); dVar.j = optJSONObject3.optInt("auto_download", 0); dVar.b = optJSONObject3.optInt("splash_skip_time", 5); dVar.k = optJSONObject3.optInt("imp_check_area", -1); dVar.l = optJSONObject3.optInt("imp_check_alpha", -1); JSONArray optJSONArray3 = optJSONObject3.optJSONArray("template_list"); if (optJSONArray3 != null && optJSONArray3.length() > 0) { for (int i4 = 0; i4 < optJSONArray3.length(); i4++) { JSONObject jSONObject2 = optJSONArray3.getJSONObject(i4); long optLong = jSONObject2.optLong("template_id"); String optString = jSONObject2.optString("template_url", ""); String optString2 = jSONObject2.optString("template_url_endCard", ""); if (!TextUtils.isEmpty(optString)) { dVar.m.put(Long.valueOf(optLong), optString); } if (!TextUtils.isEmpty(optString2)) { dVar.n.put(Long.valueOf(optLong), optString2); } } } this.d.add(dVar); } } } return true; } catch (JSONException e2) { e2.printStackTrace(); return false; } catch (Exception e3) { e3.printStackTrace(); return false; } } private a() { this.a = 86400; this.b = new b(); this.c = new c(); this.d = new ArrayList(); } private d a(long j) { for (d dVar : this.d) { if (dVar.a.contains(Long.valueOf(j))) { return dVar; } } return null; } /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */ public int b(String str) { char c2; switch (str.hashCode()) { case -1917518374: if (str.equals("interactive_vibrate_time")) { c2 = 3; break; } c2 = 65535; break; case -1499967679: if (str.equals("ssp_report_interval")) { c2 = 1; break; } c2 = 65535; break; case -665982082: if (str.equals("ad_imp_end_countdown")) { c2 = 2; break; } c2 = 65535; break; case -495530598: if (str.equals("interactive_vibrate_interval_time")) { c2 = 4; break; } c2 = 65535; break; case -18193466: if (str.equals("file_log_level")) { c2 = 0; break; } c2 = 65535; break; default: c2 = 65535; break; } if (c2 == 0) { return this.b.d; } if (c2 == 1) { return this.b.j; } if (c2 == 2) { return this.b.f16190h; } if (c2 == 3) { return this.b.f16188f; } if (c2 != 4) { return 0; } return this.b.f16189g; } /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */ public boolean a(String str) { char c2; switch (str.hashCode()) { case -1913132778: if (str.equals("ad_template")) { c2 = 4; break; } c2 = 65535; break; case -1758888181: if (str.equals("ad_newSplash")) { c2 = 0; break; } c2 = 65535; break; case -1470820606: if (str.equals("disable_webview_share")) { c2 = 11; break; } c2 = 65535; break; case -1453282367: if (str.equals("interstitial_web_enable")) { c2 = '\t'; break; } c2 = 65535; break; case 183762690: if (str.equals("endCard_web_enable")) { c2 = '\b'; break; } c2 = 65535; break; case 613802931: if (str.equals("ad_native")) { c2 = 3; break; } c2 = 65535; break; case 732095179: if (str.equals("ad_reward")) { c2 = 1; break; } c2 = 65535; break; case 943498741: if (str.equals("webp_status")) { c2 = 6; break; } c2 = 65535; break; case 1130400403: if (str.equals("ad_interstial")) { c2 = 2; break; } c2 = 65535; break; case 1438086469: if (str.equals("x5_enable")) { c2 = 5; break; } c2 = 65535; break; case 1570097588: if (str.equals("disable_report_privacy")) { c2 = '\n'; break; } c2 = 65535; break; case 2015864994: if (str.equals("webview_pool")) { c2 = 7; break; } c2 = 65535; break; default: c2 = 65535; break; } switch (c2) { case 0: if (this.b.b == 0 || this.c.a == 0) { return false; } return true; case 1: if (this.b.b == 0 || this.c.b == 0) { return false; } return true; case 2: if (this.b.b == 0 || this.c.c == 0) { return false; } return true; case 3: if (this.b.b == 0 || this.c.d == 0) { return false; } return true; case 4: if (this.b.b != 0) { c cVar = this.c; if (cVar.d == 0 || cVar.f16193f == 0) { return false; } return true; } return false; case 5: if (this.b.f16187e != 0) { return true; } return false; case 6: if (this.b.f16191i != 0) { return true; } return false; case 7: if (this.b.m != 0) { return true; } return false; case '\b': if (this.b.n != 0) { return true; } return false; case '\t': if (this.b.k != 0) { return true; } return false; case '\n': if (this.b.o != 0) { return true; } return false; case 11: if (this.b.p != 0) { return true; } return false; default: return false; } } /* JADX WARNING: Removed duplicated region for block: B:17:0x003b */ /* JADX WARNING: Removed duplicated region for block: B:37:0x007f */ public String c(String str, long j) { char c2; Map<Long, String> map; Map<Long, String> map2; d a2 = a(j); int hashCode = str.hashCode(); if (hashCode != -975637462) { if (hashCode != 52218919) { if (hashCode == 664429430 && str.equals("template_url_endCard")) { c2 = 2; if (c2 != 0) { return (a2 == null || TextUtils.isEmpty(a2.f16194e)) ? "点击跳转至详情页 >" : a2.f16194e; } if (c2 != 1) { if (c2 != 2) { return null; } if (a2 == null || (map2 = a2.n) == null || !map2.containsKey(Long.valueOf(j))) { return ""; } return a2.n.get(Long.valueOf(j)); } else if (a2 == null || (map = a2.m) == null || !map.containsKey(Long.valueOf(j))) { return ""; } else { return a2.m.get(Long.valueOf(j)); } } } else if (str.equals("click_info_text")) { c2 = 0; if (c2 != 0) { } } } else if (str.equals("template_url")) { c2 = 1; if (c2 != 0) { } } c2 = 65535; if (c2 != 0) { } } /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */ public int b(String str, long j) { char c2; int i2; int i3; int i4; d a2 = a(j); switch (str.hashCode()) { case -1457597425: if (str.equals("skip_show_time")) { c2 = 2; break; } c2 = 65535; break; case -777455388: if (str.equals("click_area")) { c2 = 0; break; } c2 = 65535; break; case -776882287: if (str.equals("click_type")) { c2 = 3; break; } c2 = 65535; break; case 823792604: if (str.equals("exposure_alpha_prop")) { c2 = 5; break; } c2 = 65535; break; case 1211889309: if (str.equals("exposure_area_prop")) { c2 = 4; break; } c2 = 65535; break; case 1670139317: if (str.equals("splash_skip_time")) { c2 = 1; break; } c2 = 65535; break; default: c2 = 65535; break; } if (c2 != 0) { if (c2 != 1) { if (c2 != 2) { if (c2 != 3) { if (c2 != 4) { if (c2 != 5) { return 0; } if (a2 != null) { return a2.l; } return -1; } else if (a2 != null) { return a2.k; } else { return -1; } } else if (a2 != null) { return a2.f16195f; } else { return 0; } } else if (a2 == null || (i4 = a2.c) < 0) { return 0; } else { return i4; } } else if (a2 == null || (i3 = a2.b) <= 0) { return 5; } else { return i3; } } else if (a2 == null || (i2 = a2.d) < 0 || i2 > 1) { return 0; } else { return i2; } } /* JADX WARNING: Removed duplicated region for block: B:22:0x004c */ /* JADX WARNING: Removed duplicated region for block: B:40:0x006d */ public boolean a(String str, long j) { char c2; d a2 = a(j); int hashCode = str.hashCode(); if (hashCode != -1580265192) { if (hashCode != 359379623) { if (hashCode != 1422878451) { if (hashCode == 1697085272 && str.equals("ad_download_diog")) { c2 = 0; if (c2 != 0) { if (c2 != 1) { if (c2 != 2) { if (c2 == 3 && a2 != null && a2.j == 1) { return true; } return false; } else if (a2 == null || a2.f16198i == 0) { return true; } else { return false; } } else if (a2 == null || a2.f16196g == 1) { return true; } else { return false; } } else if (a2 != null) { if (this.c.f16192e == 0 || a2.f16197h == 0) { return false; } return true; } else if (this.c.f16192e != 0) { return true; } else { return false; } } } else if (str.equals("disable_stream_video")) { c2 = 1; if (c2 != 0) { } } } else if (str.equals("interactive_auto_play")) { c2 = 2; if (c2 != 0) { } } } else if (str.equals("auto_download")) { c2 = 3; if (c2 != 0) { } } c2 = 65535; if (c2 != 0) { } } }