package com.fyber.inneractive.sdk.config; import android.text.TextUtils; import com.fyber.inneractive.sdk.config.IAConfigManager; import com.fyber.inneractive.sdk.external.InvalidAppIdException; import com.fyber.inneractive.sdk.network.s; import com.fyber.inneractive.sdk.util.IAlog; import com.unity3d.services.UnityAdsConstants; import java.io.Serializable; import org.json.JSONObject; /* loaded from: classes2.dex */ public final class c implements com.fyber.inneractive.sdk.cache.a { public boolean a = false; @Override // com.fyber.inneractive.sdk.cache.a public final String a() { return "IALastModifiedFromHeader"; } @Override // com.fyber.inneractive.sdk.cache.a public final void a(IAConfigManager.b bVar) { IAConfigManager.b bVar2 = bVar; if (bVar2 == null || bVar2.a == null) { return; } com.fyber.inneractive.sdk.util.o.a.getSharedPreferences("IAConfigurationPreferences", 0).edit().putString("cached.config.appid", bVar2.a).apply(); } @Override // com.fyber.inneractive.sdk.cache.a public final String b() { return "inneractive.config"; } @Override // com.fyber.inneractive.sdk.cache.a public final String getUrl() { String str = IAConfigManager.L.c; StringBuilder sb = new StringBuilder("https://"); int i = g.a; String property = System.getProperty("ia.testEnvironmentConfiguration.baseConfigUrl"); if (TextUtils.isEmpty(property)) { sb.append("cdn2.inner-active.mobi/ia-sdk-config/apps/"); } else { sb.append(property); } sb.append(str); sb.append('/'); sb.append(str); sb.append(".json"); return sb.toString(); } @Override // com.fyber.inneractive.sdk.cache.a public final boolean c() { String string = com.fyber.inneractive.sdk.util.o.a.getSharedPreferences("IAConfigurationPreferences", 0).getString("cached.config.appid", null); return string != null && string.equalsIgnoreCase(IAConfigManager.L.c); } public final void a(String str, Throwable th) { String str2; String str3; String str4; if (this.a) { return; } this.a = true; if (TextUtils.isEmpty(str)) { str2 = "Empty Json Data"; } else { str2 = str.substring(0, str.length() > 501 ? 500 : str.length() - 1); } if (th != null) { str3 = th.getClass().getName(); str4 = th.getLocalizedMessage(); } else { str3 = "Bad remote configuration"; str4 = UnityAdsConstants.Messages.MSG_INTERNAL_ERROR; } String str5 = IAConfigManager.L.c; s.a aVar = new s.a(com.fyber.inneractive.sdk.network.q.FATAL_CONFIGURATION_ERROR); Object[] objArr = new Object[8]; objArr[0] = "exception"; objArr[1] = str3; objArr[2] = "message"; if (str4 == null) { str4 = "No message"; } objArr[3] = str4; objArr[4] = "data"; objArr[5] = str2; objArr[6] = "appId"; if (TextUtils.isEmpty(str5)) { str5 = "EMPTY_APP_ID"; } objArr[7] = str5; aVar.a(objArr).a((String) null); } /* JADX WARN: Removed duplicated region for block: B:119:0x01fd */ /* JADX WARN: Removed duplicated region for block: B:123:0x0207 */ /* JADX WARN: Removed duplicated region for block: B:127:0x0216 A[SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:316:0x01e3 A[SYNTHETIC] */ /* JADX WARN: Removed duplicated region for block: B:318:0x020b */ /* JADX WARN: Removed duplicated region for block: B:319:0x0201 */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public static com.fyber.inneractive.sdk.config.IAConfigManager.b a(com.fyber.inneractive.sdk.config.remote.d r23) { /* Method dump skipped, instructions count: 1264 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.config.c.a(com.fyber.inneractive.sdk.config.remote.d):com.fyber.inneractive.sdk.config.IAConfigManager$b"); } public static Object a(Serializable serializable, Object... objArr) { for (Object obj : objArr) { if (obj != null) { return obj; } } return serializable; } @Override // com.fyber.inneractive.sdk.cache.a public final IAConfigManager.b a(String str) throws Exception { try { IAConfigManager iAConfigManager = IAConfigManager.L; iAConfigManager.C.e(); com.fyber.inneractive.sdk.config.remote.d a = com.fyber.inneractive.sdk.config.remote.d.a(new JSONObject(str)); String str2 = iAConfigManager.c; if (a != null && str2.equals(a.a.a)) { return a(a); } IAlog.b("internal error while parsing local configuration", new Object[0]); if (a != null && !str2.equals(a.a.a)) { throw new InvalidAppIdException(); } a(str, (Throwable) null); return null; } catch (Throwable th) { a(str, th); IAlog.b("Exception Error while parsing local configuration", new Object[0]); throw th; } } }