package com.mob.secverify.pure.a.a.a.e; import android.text.TextUtils; import com.mob.secverify.b.b; import com.mob.secverify.pure.c.a; import com.tencent.cloud.huiyansdkface.analytics.h; import org.json.JSONObject; /* compiled from: UmcConfigUtil */ public class j { /* JADX WARNING: Removed duplicated region for block: B:125:0x0311 */ /* JADX WARNING: Removed duplicated region for block: B:135:0x034c */ /* JADX WARNING: Removed duplicated region for block: B:53:0x0147 */ public static void a(JSONObject jSONObject) { String str; String str2; String str3; String str4; String str5; String str6; String str7; try { i.b(d.b()); if (jSONObject.has("client_valid")) { i.a((((long) Integer.valueOf(jSONObject.getString("client_valid")).intValue()) * 60 * 60 * 1000) + System.currentTimeMillis()); } if (jSONObject.has("Configlist")) { JSONObject jSONObject2 = jSONObject.getJSONObject("Configlist"); if (jSONObject2.has("CHANGE_HOST")) { String string = jSONObject2.getString("CHANGE_HOST"); if (string.contains("M005")) { String[] split = string.split("&"); int length = split.length; int i = 0; while (true) { if (i >= length) { str6 = null; break; } str6 = split[i]; if (str6.contains("M005")) { break; } i++; } if (!TextUtils.isEmpty(str6)) { if (str6.contains(",")) { str7 = str6.substring(str6.indexOf("=") + 1, str6.indexOf(",")); str2 = str6.substring(str6.lastIndexOf("=") + 1); } else if (str6.contains("https") || str6.contains("HTTPS")) { str2 = str6.substring(str6.lastIndexOf("=") + 1); str7 = null; } else if (str6.contains("http") || str6.contains("HTTP")) { str7 = str6.substring(str6.lastIndexOf("=") + 1); str2 = null; } b a5 = b.a(); a5.a("[SecPure] ==>%s", "HTTP_HOST:" + ((Object) str7) + "||||||||HTTPS_HOST:" + str2); i.c(str7); i.d(str2); } str7 = null; str2 = null; b a52 = b.a(); a52.a("[SecPure] ==>%s", "HTTP_HOST:" + ((Object) str7) + "||||||||HTTPS_HOST:" + str2); i.c(str7); i.d(str2); } else { str2 = null; } if (string.contains("M007")) { String[] split2 = string.split("&"); int length2 = split2.length; int i3 = 0; while (true) { if (i3 >= length2) { str = null; break; } str = split2[i3]; if (str.contains("M007")) { break; } i3++; } if (!TextUtils.isEmpty(str)) { str = str.substring(str.lastIndexOf("=") + 1); } b a12 = b.a(); a12.a("[SecPure] ==>%s", "LOG_HOST:" + str); i.e(str); if (jSONObject2.has("HOST_CERT_INFO")) { String string2 = jSONObject2.getString("HOST_CERT_INFO"); String[] split3 = string2.split("&"); if (TextUtils.isEmpty(str) || !str.contains(":")) { str3 = str; } else { str3 = str.substring(0, str.indexOf(":")); b a13 = b.a(); a13.a("[SecPure] ==>%s", "logHostWithoutHost:" + str3); } if (TextUtils.isEmpty(str) || !string2.contains(str3)) { str4 = null; } else { int length3 = split3.length; int i12 = 0; while (true) { if (i12 >= length3) { str4 = null; break; } String str8 = split3[i12]; if (!TextUtils.isEmpty(str) && str8.contains(str3)) { str4 = str8; break; } i12++; } if (!TextUtils.isEmpty(str4)) { str4 = str4.substring(str4.indexOf(":") + 1, str4.indexOf(",")); } b.a().a("[SecPure] ==>%s", "log CERT:"); a.b("https://" + str + "/log/logReport", str4); } if (string2.contains("log1.cmpassport.com")) { int length4 = split3.length; int i13 = 0; while (true) { if (i13 >= length4) { break; } String str9 = split3[i13]; if (str9.contains("log1.cmpassport.com")) { str4 = str9; break; } i13++; } if (!TextUtils.isEmpty(str4)) { str4 = str4.substring(str4.indexOf(":") + 1, str4.indexOf(",")); } b.a().a("[SecPure] ==>%s", "log1 CERT:"); a.b("https://log1.cmpassport.com:9443/log/logReport", str4); } if (TextUtils.isEmpty(str2) || !str2.contains(":")) { str5 = str2; } else { str5 = str2.substring(0, str2.indexOf(":")); b a14 = b.a(); a14.a("[SecPure] ==>%s", "httpsHostWithoutPort:" + str5); } if (!TextUtils.isEmpty(str2) && string2.contains(str5)) { int length5 = split3.length; int i14 = 0; while (true) { if (i14 >= length5) { break; } String str10 = split3[i14]; if (!TextUtils.isEmpty(str2) && str10.contains(str5)) { str4 = str10; break; } i14++; } if (!TextUtils.isEmpty(str4)) { str4 = str4.substring(str4.indexOf(":") + 1, str4.indexOf(",")); } b.a().a("[SecPure] ==>%s", "str1 CERT:"); a.b("https://" + str2 + "/unisdk/", str4); } if (string2.contains("onekey.cmpassport.com")) { int length6 = split3.length; int i15 = 0; while (true) { if (i15 >= length6) { break; } String str11 = split3[i15]; if (str11.contains("onekey.cmpassport.com")) { str4 = str11; break; } i15++; } if (!TextUtils.isEmpty(str4)) { str4 = str4.substring(str4.indexOf(":") + 1, str4.indexOf(",")); } b.a().a("[SecPure] ==>%s", "omekey1 CERT:"); a.b("https://onekey.cmpassport.com:443/unisdk/", str4); } } a(jSONObject2, "CLOSE_CERT_VERIFY", "0"); a(jSONObject2, "CLOSE_FRIEND_WAPKS", "0"); a(jSONObject2, "CLOSE_LOGS_VERSION", "0"); a(jSONObject2, "CLOSE_IPV4_LIST", "0"); a(jSONObject2, "CLOSE_IPV6_LIST", "1"); a(jSONObject2, "CLOSE_M001_SDKVERSION_LIST", "0"); a(jSONObject2, "CLOSE_M001_APPID_LIST", "0"); a(jSONObject2, "CLOSE_M005_SDKVERSION_LIST", "0"); a(jSONObject2, "CLOSE_M005_APPID_LIST", "0"); if (!jSONObject2.has("LOGS_CONTROL")) { String[] split4 = jSONObject2.getString("LOGS_CONTROL").replace(h.f27021a, "").split("&"); if (split4.length > 0 && !TextUtils.isEmpty(split4[0])) { i.a(Integer.parseInt(split4[0])); } if (1 < split4.length && !TextUtils.isEmpty(split4[1])) { i.b(Integer.parseInt(split4[1])); return; } return; } i.a(0); i.b(0); return; } } else { str2 = null; } str = null; if (jSONObject2.has("HOST_CERT_INFO")) { } a(jSONObject2, "CLOSE_CERT_VERIFY", "0"); a(jSONObject2, "CLOSE_FRIEND_WAPKS", "0"); a(jSONObject2, "CLOSE_LOGS_VERSION", "0"); a(jSONObject2, "CLOSE_IPV4_LIST", "0"); a(jSONObject2, "CLOSE_IPV6_LIST", "1"); a(jSONObject2, "CLOSE_M001_SDKVERSION_LIST", "0"); a(jSONObject2, "CLOSE_M001_APPID_LIST", "0"); a(jSONObject2, "CLOSE_M005_SDKVERSION_LIST", "0"); a(jSONObject2, "CLOSE_M005_APPID_LIST", "0"); if (!jSONObject2.has("LOGS_CONTROL")) { } } } catch (Throwable th2) { b.a().a(th2, "[SecPure] ==>%s", th2.getMessage()); } } public static String b() { return a01.a.g("https://", i.b(), "/unisdk/"); } public static String c() { String c5 = i.c(); return !TextUtils.isEmpty(c5) ? a01.a.g("https://", c5, "/log/logReport") : ""; } public static boolean d() { return "1".equals(a.a("CLOSE_CERT_VERIFY", "1")); } public static boolean e() { return "1".equals(a.a("CLOSE_LOGS_VERSION", "0")); } public static int f() { return i.d(); } public static int g() { return i.e() * 60 * 60 * 1000; } private static void a(JSONObject jSONObject, String str, String str2) { if (jSONObject.has(str)) { a.b(str, jSONObject.optString(str, str2)); } } public static boolean a() { return System.currentTimeMillis() >= a.a("client_valid", 0); } public static String a(String str) { return a.a(str, ""); } }