package com.fyber.inneractive.sdk.web; import android.text.TextUtils; import com.fyber.inneractive.sdk.config.IAConfigManager; import com.fyber.inneractive.sdk.external.InneractiveErrorCode; import com.fyber.inneractive.sdk.external.InneractiveInfrastructureError; import com.fyber.inneractive.sdk.util.IAlog; import com.fyber.inneractive.sdk.web.f; import com.iab.omid.library.fyber.ScriptInjector; import com.ironsource.nb; /* loaded from: classes2.dex */ public final class e extends com.fyber.inneractive.sdk.util.b { public final /* synthetic */ String g; public final /* synthetic */ boolean h; public final /* synthetic */ String i; public final /* synthetic */ String j; public final /* synthetic */ String k; public final /* synthetic */ f l; public e(g0 g0Var, String str, boolean z, String str2, String str3, String str4) { this.l = g0Var; this.g = str; this.h = z; this.i = str2; this.j = str3; this.k = str4; } @Override // com.fyber.inneractive.sdk.util.b public final String a(Void[] voidArr) { long currentTimeMillis = System.currentTimeMillis(); String str = this.g; if (this.h) { f fVar = this.l; String str2 = this.i; String str3 = this.j; g0 g0Var = (g0) fVar; g0Var.getClass(); StringBuilder sb = new StringBuilder("DigitalTurbine Ad"); boolean z = false; if (TextUtils.isEmpty(str)) { IAlog.a("loadHtml called with an empty HTML!", new Object[0]); } else { if (g0Var.F) { String c = com.fyber.inneractive.sdk.util.o.c("ia_js_load_monitor.txt"); if (!TextUtils.isEmpty(c)) { sb.append(c); } } sb.append(""); IAConfigManager iAConfigManager = IAConfigManager.L; boolean a = iAConfigManager.t.b.a(false, "use_js_inline"); if (!a || iAConfigManager.F.b == null) { sb.append(""); } else { sb.append(""); } if (!TextUtils.isEmpty(str2)) { sb.append(str2); } sb.append(""); if (g0Var.B && g0Var.p()) { if (!a || iAConfigManager.F.c == null) { sb.append(""); } else { sb.append(""); } if (!a || iAConfigManager.F.d == null) { sb.append(""); } else { sb.append(""); } } String c2 = com.fyber.inneractive.sdk.util.o.c("ia_mraid_bridge.txt"); if (!TextUtils.isEmpty(c2)) { sb.append(""); if (IAlog.a >= 2) { sb.append(""); } } sb.append(str); sb.append(""); if (g0Var.I != null) { com.fyber.inneractive.sdk.flow.q qVar = g0Var.s; if (qVar != null) { com.fyber.inneractive.sdk.response.e d = qVar.d(); if (d != null && d.H) { z = true; } com.fyber.inneractive.sdk.measurement.a aVar = g0Var.I; String sb2 = sb.toString(); com.fyber.inneractive.sdk.measurement.b bVar = (com.fyber.inneractive.sdk.measurement.b) aVar; if (z) { StringBuilder sb3 = new StringBuilder(); if (!TextUtils.isEmpty(bVar.c)) { sb3.append(bVar.c); } if (!TextUtils.isEmpty(bVar.d)) { sb3.append(bVar.d); } sb2 = ScriptInjector.injectScriptContentIntoHtml(sb3.toString(), sb2); } str = !TextUtils.isEmpty(bVar.b) ? ScriptInjector.injectScriptContentIntoHtml(bVar.b, sb2) : sb2; } } else { str = sb.toString(); } } str = null; } f fVar2 = this.l; fVar2.getClass(); IAlog.a("%sbuild html string took %d msec", IAlog.a(fVar2), Long.valueOf(System.currentTimeMillis() - currentTimeMillis)); return str; } @Override // com.fyber.inneractive.sdk.util.b public final void a(String str) { String str2 = str; String str3 = com.fyber.inneractive.sdk.util.s.a() ? "http://" : "https://"; if (!TextUtils.isEmpty(str2) && !a()) { if (!TextUtils.isEmpty(this.k)) { this.l.p = str3 + this.k; } else { this.l.p = str3.concat("wv.inner-active.mobi/"); } if (this.f) { return; } f fVar = this.l; h hVar = fVar.b; if (hVar != null) { hVar.loadDataWithBaseURL(fVar.p, str2, "text/html", nb.N, null); this.l.q = str2; } else { InneractiveInfrastructureError inneractiveInfrastructureError = new InneractiveInfrastructureError(InneractiveErrorCode.SDK_INTERNAL_ERROR, com.fyber.inneractive.sdk.flow.g.COULD_NOT_LOAD_TO_WEBVIEW); f.b bVar = fVar.f; if (bVar != null) { bVar.a(inneractiveInfrastructureError); } fVar.b(true); } } else if (!a()) { f fVar2 = this.l; InneractiveInfrastructureError inneractiveInfrastructureError2 = new InneractiveInfrastructureError(InneractiveErrorCode.SDK_INTERNAL_ERROR, com.fyber.inneractive.sdk.flow.g.EMPTY_FINAL_HTML); f.b bVar2 = fVar2.f; if (bVar2 != null) { bVar2.a(inneractiveInfrastructureError2); } fVar2.b(true); } b(); this.l.o = null; } }