package com.mob.secverify.pure.core.ope.cm.d; import android.text.TextUtils; import cn.jpush.android.local.JPushConstants; import com.mob.secverify.b.c; import com.mob.secverify.pure.b.a; import com.mob.tools.log.NLog; import org.json.JSONObject; import z60.h; /* compiled from: UmcConfigUtil */ public class j { /* JADX WARNING: Removed duplicated region for block: B:126:0x0349 */ /* JADX WARNING: Removed duplicated region for block: B:136:0x0384 */ /* JADX WARNING: Removed duplicated region for block: B:53:0x0153 */ public static void a(JSONObject jSONObject) { String str; String str2; String str3; String str4; String str5; String str6; String str7; String str8; String str9; try { i.b(d.b()); if (jSONObject.has("client_valid")) { i.a(System.currentTimeMillis() + (((long) Integer.valueOf(jSONObject.getString("client_valid")).intValue()) * 60 * 60 * 1000)); } 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 i10 = 0; while (true) { if (i10 >= length) { str8 = null; break; } str8 = split[i10]; if (str8.contains("M005")) { break; } i10++; } if (!TextUtils.isEmpty(str8)) { if (str8.contains(",")) { str9 = str8.substring(str8.indexOf("=") + 1, str8.indexOf(",")); str2 = str8.substring(str8.lastIndexOf("=") + 1); } else if (str8.contains("https") || str8.contains("HTTPS")) { str2 = str8.substring(str8.lastIndexOf("=") + 1); str9 = null; } else if (str8.contains("http") || str8.contains("HTTP")) { str9 = str8.substring(str8.lastIndexOf("=") + 1); str2 = null; } NLog b14 = c.b(); b14.i("[SecPure] ==>%s", "HTTP_HOST:" + ((Object) str9) + "||||||||HTTPS_HOST:" + str2); i.c(str9); i.d(str2); } str9 = null; str2 = null; NLog b142 = c.b(); b142.i("[SecPure] ==>%s", "HTTP_HOST:" + ((Object) str9) + "||||||||HTTPS_HOST:" + str2); i.c(str9); i.d(str2); } else { str2 = null; } if (string.contains("M007")) { String[] split2 = string.split("&"); int length2 = split2.length; int i14 = 0; while (true) { if (i14 >= length2) { str = null; break; } str = split2[i14]; if (str.contains("M007")) { break; } i14++; } if (!TextUtils.isEmpty(str)) { str = str.substring(str.lastIndexOf("=") + 1); } NLog b15 = c.b(); b15.i("[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(":")); NLog b16 = c.b(); b16.i("[SecPure] ==>%s", "logHostWithoutHost:" + str3); } if (TextUtils.isEmpty(str) || !string2.contains(str3)) { str4 = null; } else { int length3 = split3.length; int i15 = 0; while (true) { if (i15 >= length3) { str4 = null; break; } str4 = split3[i15]; if (!TextUtils.isEmpty(str) && str4.contains(str3)) { break; } i15++; } if (!TextUtils.isEmpty(str4)) { str4 = str4.substring(str4.indexOf(":") + 1, str4.indexOf(",")); } c.b().i("[SecPure] ==>%s", "log CERT:"); a.b(JPushConstants.HTTPS_PRE + str + "/log/logReport", str4); } if (string2.contains("log1.cmpassport.com")) { int length4 = split3.length; int i16 = 0; while (true) { if (i16 >= length4) { break; } String str10 = split3[i16]; if (str10.contains("log1.cmpassport.com")) { str4 = str10; break; } i16++; } if (!TextUtils.isEmpty(str4)) { str4 = str4.substring(str4.indexOf(":") + 1, str4.indexOf(",")); } c.b().i("[SecPure] ==>%s", "log1 CERT:"); a.b("https://log1.cmpassport.com:9443/log/logReport", str4); } if (TextUtils.isEmpty(str2) || !str2.contains(":")) { str5 = str4; str6 = str2; } else { str6 = str2.substring(0, str2.indexOf(":")); NLog b17 = c.b(); StringBuilder sb3 = new StringBuilder(); str5 = str4; sb3.append("httpsHostWithoutPort:"); sb3.append(str6); b17.i("[SecPure] ==>%s", sb3.toString()); } if (TextUtils.isEmpty(str2) || !string2.contains(str6)) { str7 = str5; } else { int length5 = split3.length; int i17 = 0; while (true) { if (i17 >= length5) { str7 = str5; break; } String str11 = split3[i17]; if (!TextUtils.isEmpty(str2) && str11.contains(str6)) { str7 = str11; break; } i17++; } if (!TextUtils.isEmpty(str7)) { str7 = str7.substring(str7.indexOf(":") + 1, str7.indexOf(",")); } c.b().i("[SecPure] ==>%s", "str1 CERT:"); a.b(JPushConstants.HTTPS_PRE + str2 + "/unisdk/", str7); } if (string2.contains("onekey.cmpassport.com")) { int length6 = split3.length; int i18 = 0; while (true) { if (i18 >= length6) { break; } String str12 = split3[i18]; if (str12.contains("onekey.cmpassport.com")) { str7 = str12; break; } i18++; } if (!TextUtils.isEmpty(str7)) { str7 = str7.substring(str7.indexOf(":") + 1, str7.indexOf(",")); } c.b().i("[SecPure] ==>%s", "omekey1 CERT:"); a.b("https://onekey.cmpassport.com:443/unisdk/", str7); } } 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.f160753a, "").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 th3) { c.b().d(th3, "[SecPure] ==>%s", th3.getMessage()); } } public static String b() { String b14 = i.b(); return JPushConstants.HTTPS_PRE + b14 + "/unisdk/"; } public static String c() { String c14 = i.c(); if (TextUtils.isEmpty(c14)) { return ""; } return JPushConstants.HTTPS_PRE + c14 + "/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, ""); } }