- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
188 lines
8.3 KiB
Java
188 lines
8.3 KiB
Java
package com.fyber.inneractive.sdk.player.controller;
|
|
|
|
import android.content.Context;
|
|
import android.text.TextUtils;
|
|
import android.webkit.WebSettings;
|
|
import com.fyber.inneractive.sdk.R;
|
|
import com.fyber.inneractive.sdk.config.IAConfigManager;
|
|
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
|
|
import com.fyber.inneractive.sdk.external.InneractiveErrorCode;
|
|
import com.fyber.inneractive.sdk.external.InneractiveInfrastructureError;
|
|
import com.fyber.inneractive.sdk.ui.IAmraidWebViewController;
|
|
import com.fyber.inneractive.sdk.util.b0;
|
|
import com.fyber.inneractive.sdk.util.q0;
|
|
import com.fyber.inneractive.sdk.web.f;
|
|
import com.fyber.inneractive.sdk.web.g0;
|
|
import com.fyber.inneractive.sdk.web.j;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class c {
|
|
public g0 a;
|
|
public UnitDisplayType c;
|
|
public boolean e;
|
|
public j.g b = j.g.INLINE;
|
|
public j.d d = j.d.ENABLED;
|
|
|
|
public static /* synthetic */ class a {
|
|
public static final /* synthetic */ int[] a;
|
|
public static final /* synthetic */ int[] b;
|
|
|
|
static {
|
|
int[] iArr = new int[com.fyber.inneractive.sdk.model.vast.h.values().length];
|
|
b = iArr;
|
|
try {
|
|
iArr[com.fyber.inneractive.sdk.model.vast.h.Static.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
b[com.fyber.inneractive.sdk.model.vast.h.Html.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
b[com.fyber.inneractive.sdk.model.vast.h.FMP_End_Card.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
b[com.fyber.inneractive.sdk.model.vast.h.Iframe.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
int[] iArr2 = new int[UnitDisplayType.values().length];
|
|
a = iArr2;
|
|
try {
|
|
iArr2[UnitDisplayType.INTERSTITIAL.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
try {
|
|
a[UnitDisplayType.REWARDED.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
}
|
|
}
|
|
|
|
public c(Context context, com.fyber.inneractive.sdk.flow.vast.b bVar, com.fyber.inneractive.sdk.model.vast.h hVar, com.fyber.inneractive.sdk.web.a aVar) {
|
|
a(bVar.c(), bVar.e());
|
|
try {
|
|
this.a = a(aVar, hVar, com.fyber.inneractive.sdk.util.j.a(bVar.c(), IAConfigManager.c().a()));
|
|
a(hVar);
|
|
if (this.a.f() != null) {
|
|
b0.b().a(context, this.a.f(), this.a);
|
|
}
|
|
this.a.i();
|
|
q0 a2 = com.fyber.inneractive.sdk.renderers.h.a(bVar.d(), bVar.a(), bVar.b());
|
|
this.a.setAdDefaultSize(a2.a, a2.b);
|
|
} catch (Throwable unused) {
|
|
this.a = null;
|
|
}
|
|
}
|
|
|
|
public final g0 a(com.fyber.inneractive.sdk.web.a aVar, com.fyber.inneractive.sdk.model.vast.h hVar, boolean z) {
|
|
if (hVar == com.fyber.inneractive.sdk.model.vast.h.FMP_End_Card) {
|
|
return new com.fyber.inneractive.sdk.web.b(aVar, z);
|
|
}
|
|
return new IAmraidWebViewController(null, null, this.d, this.b, j.h.AD_CONTROLLED, z, true);
|
|
}
|
|
|
|
public final void b() {
|
|
com.fyber.inneractive.sdk.web.h hVar;
|
|
g0 g0Var = this.a;
|
|
if (g0Var == null || (hVar = g0Var.b) == null) {
|
|
return;
|
|
}
|
|
WebSettings settings = hVar.getSettings();
|
|
settings.setMediaPlaybackRequiresUserGesture(false);
|
|
settings.setLoadWithOverviewMode(true);
|
|
settings.setUseWideViewPort(true);
|
|
}
|
|
|
|
public final com.fyber.inneractive.sdk.web.h a() {
|
|
g0 g0Var = this.a;
|
|
if (g0Var == null) {
|
|
return null;
|
|
}
|
|
return g0Var.b;
|
|
}
|
|
|
|
public final void a(String str, f.b bVar, boolean z) {
|
|
String str2;
|
|
if (this.a != null && !TextUtils.isEmpty(str)) {
|
|
g0 g0Var = this.a;
|
|
UnitDisplayType unitDisplayType = this.c;
|
|
g0Var.setAutoplayMRAIDVideos(unitDisplayType != null && unitDisplayType.isFullscreenUnit());
|
|
this.a.setCenteringTagsRequired(false);
|
|
g0 g0Var2 = this.a;
|
|
int i = com.fyber.inneractive.sdk.config.g.a;
|
|
String property = System.getProperty("ia.testEnvironmentConfiguration.name");
|
|
if (TextUtils.isEmpty(property)) {
|
|
str2 = "wv.inner-active.mobi/simpleM2M/";
|
|
} else {
|
|
str2 = property + ".inner-active.mobi/simpleM2M/";
|
|
}
|
|
String str3 = str2;
|
|
UnitDisplayType unitDisplayType2 = this.c;
|
|
boolean z2 = this.e;
|
|
StringBuilder sb = new StringBuilder();
|
|
if (unitDisplayType2 != null && unitDisplayType2.isFullscreenUnit() && !z2) {
|
|
sb.append("<script type=\"text/javascript\"> var IaCloseBtnHelper = (function initIaCloseBtnHelper(){ var styleContent = '.celtra-close-button {display:none !important;} .close-button {display:none !important;}'; function getStyle(doc){ var style = doc.createElement('style'); style.type = 'text/css'; if (style.styleSheet){ style.styleSheet.cssText = styleContent; } else { style.appendChild(doc.createTextNode(styleContent)); } return style; } function onDomReady(){ var iframes = window.document.getElementsByTagName('iframe'), i = 0, len = iframes && iframes.length || 0; for(; i < len; ++i){ if(!iframes[i].src){ try { iframes[i].contentDocument.body.appendChild(getStyle(iframes[i].contentDocument)); }catch(e){ }}}} function registerWindowEvents(){ window.addEventListener('load', function onWindowLoad(){ window.removeEventListener('load', onWindowLoad); onDomReady(); }); } return { init: function init(){ if(window.document.readyState != 'complete'){ registerWindowEvents(); }else{ onDomReady(); }}}})(); IaCloseBtnHelper.init();</script>");
|
|
}
|
|
String sb2 = sb.toString();
|
|
UnitDisplayType unitDisplayType3 = this.c;
|
|
StringBuilder sb3 = new StringBuilder();
|
|
if (unitDisplayType3 != null && !unitDisplayType3.isFullscreenUnit()) {
|
|
if (unitDisplayType3 == UnitDisplayType.BANNER) {
|
|
sb3.append(" body {display: flex;} #iawrapper { position:unset !important; display: unset !important; } ");
|
|
} else {
|
|
sb3.append(" #iawrapper { position:unset !important; display: unset !important; }");
|
|
}
|
|
}
|
|
String sb4 = sb3.toString();
|
|
g0Var2.f = bVar;
|
|
try {
|
|
g0Var2.h();
|
|
com.fyber.inneractive.sdk.web.e eVar = new com.fyber.inneractive.sdk.web.e(g0Var2, str, z, sb2, sb4, str3);
|
|
g0Var2.o = eVar;
|
|
eVar.b(null);
|
|
return;
|
|
} catch (Throwable th) {
|
|
g0Var2.a(new InneractiveInfrastructureError(InneractiveErrorCode.SDK_INTERNAL_ERROR, com.fyber.inneractive.sdk.flow.g.COULD_NOT_CONFIGURE_WEBVIEW, th));
|
|
return;
|
|
}
|
|
}
|
|
bVar.a(new InneractiveInfrastructureError(InneractiveErrorCode.UNSPECIFIED, com.fyber.inneractive.sdk.flow.g.NO_WEBVIEW_CONTROLLER_AVAILABLE));
|
|
}
|
|
|
|
public final void a(UnitDisplayType unitDisplayType, boolean z) {
|
|
this.c = unitDisplayType;
|
|
this.e = z;
|
|
int i = a.a[unitDisplayType.ordinal()];
|
|
if (i != 1 && i != 2) {
|
|
this.d = j.d.ENABLED;
|
|
return;
|
|
}
|
|
this.d = j.d.ENABLED;
|
|
if (z) {
|
|
this.b = j.g.INTERSTITIAL;
|
|
}
|
|
}
|
|
|
|
public final void a(com.fyber.inneractive.sdk.model.vast.h hVar) {
|
|
g0 g0Var = this.a;
|
|
com.fyber.inneractive.sdk.web.h hVar2 = g0Var != null ? g0Var.b : null;
|
|
if (hVar2 == null) {
|
|
return;
|
|
}
|
|
int i = a.b[hVar.ordinal()];
|
|
if (i == 1) {
|
|
hVar2.setId(R.id.ia_inneractive_vast_endcard_gif);
|
|
return;
|
|
}
|
|
if (i == 2 || i == 3) {
|
|
hVar2.setId(R.id.ia_inneractive_vast_endcard_html);
|
|
} else {
|
|
if (i != 4) {
|
|
return;
|
|
}
|
|
hVar2.setId(R.id.ia_inneractive_vast_endcard_iframe);
|
|
}
|
|
}
|
|
}
|