Files
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

1296 lines
49 KiB
Java

package com.fyber.inneractive.sdk.player.controller;
import android.app.Application;
import android.content.Context;
import android.graphics.Bitmap;
import android.media.AudioManager;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.view.GestureDetector;
import android.view.TextureView;
import android.view.View;
import android.widget.FrameLayout;
import com.fyber.inneractive.sdk.R;
import com.fyber.inneractive.sdk.config.IAConfigManager;
import com.fyber.inneractive.sdk.config.e0;
import com.fyber.inneractive.sdk.config.enums.Skip;
import com.fyber.inneractive.sdk.config.enums.UnitDisplayType;
import com.fyber.inneractive.sdk.config.f0;
import com.fyber.inneractive.sdk.config.g0;
import com.fyber.inneractive.sdk.config.i0;
import com.fyber.inneractive.sdk.external.InneractiveAdManager;
import com.fyber.inneractive.sdk.external.InneractiveAdRequest;
import com.fyber.inneractive.sdk.network.s;
import com.fyber.inneractive.sdk.player.controller.i;
import com.fyber.inneractive.sdk.player.controller.y;
import com.fyber.inneractive.sdk.player.e;
import com.fyber.inneractive.sdk.player.enums.VideoClickOrigin;
import com.fyber.inneractive.sdk.util.IAlog;
import com.fyber.inneractive.sdk.util.a0;
import com.fyber.inneractive.sdk.util.b;
import com.fyber.inneractive.sdk.util.p0;
import com.fyber.inneractive.sdk.util.s0;
import com.iab.omid.library.fyber.adsession.AdSession;
import com.iab.omid.library.fyber.adsession.FriendlyObstructionPurpose;
import com.iab.omid.library.fyber.adsession.media.InteractionType;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import org.json.JSONObject;
/* loaded from: classes2.dex */
public abstract class o<ListenerT extends y> implements com.fyber.inneractive.sdk.player.controller.b<ListenerT>, i.e, i.d, com.fyber.inneractive.sdk.player.ui.m {
public final Skip A;
public boolean B;
public final com.fyber.inneractive.sdk.player.c a;
public final f0 b;
public final com.fyber.inneractive.sdk.config.global.s c;
public final com.fyber.inneractive.sdk.player.ui.s d;
public n e;
public int f;
public ListenerT g;
public boolean h;
public float i;
public Runnable j;
public boolean k;
public boolean l;
public s m;
public final boolean n;
public boolean o;
public Bitmap p;
public final LinkedList q;
public boolean r;
public boolean s;
public boolean t;
public boolean u;
public boolean v;
public com.fyber.inneractive.sdk.ignite.l w;
public com.fyber.inneractive.sdk.player.ui.f x;
public final String y;
public final boolean z;
public static /* synthetic */ class a {
public static final /* synthetic */ int[] a;
static {
int[] iArr = new int[com.fyber.inneractive.sdk.player.enums.b.values().length];
a = iArr;
try {
iArr[com.fyber.inneractive.sdk.player.enums.b.Prepared.ordinal()] = 1;
} catch (NoSuchFieldError unused) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Buffering.ordinal()] = 2;
} catch (NoSuchFieldError unused2) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Playing.ordinal()] = 3;
} catch (NoSuchFieldError unused3) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Paused.ordinal()] = 4;
} catch (NoSuchFieldError unused4) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Completed.ordinal()] = 5;
} catch (NoSuchFieldError unused5) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Error.ordinal()] = 6;
} catch (NoSuchFieldError unused6) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Preparing.ordinal()] = 7;
} catch (NoSuchFieldError unused7) {
}
try {
a[com.fyber.inneractive.sdk.player.enums.b.Seeking.ordinal()] = 8;
} catch (NoSuchFieldError unused8) {
}
}
}
public class b implements s0 {
public b() {
}
@Override // com.fyber.inneractive.sdk.util.s0
public final void a(Bitmap bitmap) {
o.a(o.this.d, bitmap, true, true);
}
}
public class d implements Runnable {
public final /* synthetic */ boolean a;
public final /* synthetic */ s0 b;
public class a implements Runnable {
public final /* synthetic */ Bitmap a;
public a(Bitmap bitmap) {
this.a = bitmap;
}
@Override // java.lang.Runnable
public final void run() {
s0 s0Var = d.this.b;
if (s0Var != null) {
s0Var.a(this.a);
}
}
}
public d(boolean z, s0 s0Var) {
this.a = z;
this.b = s0Var;
}
@Override // java.lang.Runnable
public final void run() {
com.fyber.inneractive.sdk.util.p.b.post(new a(o.this.g(this.a)));
}
}
public o(com.fyber.inneractive.sdk.player.e eVar, com.fyber.inneractive.sdk.player.ui.p pVar, f0 f0Var, com.fyber.inneractive.sdk.config.global.s sVar, boolean z, String str, boolean z2) {
this(eVar, pVar, f0Var, sVar, z, null, str, z2);
}
public static Bitmap a(o oVar, int i, int i2) {
oVar.getClass();
Application application = com.fyber.inneractive.sdk.util.o.a;
Bitmap bitmap = null;
if (application != null && application.getResources() != null && application.getResources().getDisplayMetrics() != null) {
DisplayMetrics displayMetrics = application.getResources().getDisplayMetrics();
try {
bitmap = Bitmap.createBitmap(i, i2, Bitmap.Config.ARGB_8888);
if (bitmap != null) {
bitmap.setDensity(displayMetrics.densityDpi);
}
} catch (Throwable unused) {
}
}
return bitmap;
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final void a(ListenerT listenert) {
this.g = listenert;
}
public abstract void a(p0 p0Var);
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void a(Exception exc) {
}
public void b() {
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final void b(boolean z) {
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
int i;
com.fyber.inneractive.sdk.config.global.features.b bVar;
g0 g0Var;
f0 f0Var = this.b;
boolean z2 = (f0Var == null || (g0Var = ((e0) f0Var).f) == null || g0Var.j != UnitDisplayType.REWARDED) ? false : true;
if (InneractiveAdManager.isCurrentUserAChild() && z2 && this.d != null && (cVar = this.a) != null && (iVar = cVar.b) != null) {
int c2 = iVar.c() / 1000;
try {
i = Integer.parseInt(IAConfigManager.L.t.b.a("max_rv_tsec", Integer.toString(30)));
} catch (Throwable unused) {
i = 30;
}
int i2 = i >= 1 ? i : 30;
if ((this.a.b.d() / 1000) - c2 <= 0 || c2 < i2) {
Context context = this.d.getContext();
com.fyber.inneractive.sdk.config.global.s sVar = this.c;
if (sVar != null && sVar.a(com.fyber.inneractive.sdk.config.global.features.b.class) != null) {
com.fyber.inneractive.sdk.config.global.features.b bVar2 = (com.fyber.inneractive.sdk.config.global.features.b) this.c.a(com.fyber.inneractive.sdk.config.global.features.b.class);
bVar2.getClass();
if (new ArrayList(bVar2.c.values()).size() > 0) {
bVar = (com.fyber.inneractive.sdk.config.global.features.b) this.c.a(com.fyber.inneractive.sdk.config.global.features.b.class);
new x(context, bVar, new t(this, z)).c.show();
return;
}
}
bVar = null;
new x(context, bVar, new t(this, z)).c.show();
return;
}
}
f(z);
}
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void c(boolean z) {
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final boolean h() {
return this.z;
}
public final void l() {
if (v()) {
com.fyber.inneractive.sdk.config.global.s sVar = this.c;
String str = null;
com.fyber.inneractive.sdk.config.global.features.c cVar = sVar != null ? (com.fyber.inneractive.sdk.config.global.features.c) sVar.a(com.fyber.inneractive.sdk.config.global.features.c.class) : null;
if (cVar != null) {
cVar.d(IAConfigManager.L.o);
com.fyber.inneractive.sdk.model.vast.a aVar = cVar.e;
if (aVar != null && aVar.d) {
str = aVar.b;
}
}
if (!TextUtils.isEmpty(this.y) || str == null) {
com.fyber.inneractive.sdk.player.ui.s sVar2 = this.d;
sVar2.setSkipText(sVar2.getContext().getString(R.string.ia_video_skip_text));
} else {
this.d.setSkipText(str);
}
this.d.g();
this.f = 0;
ListenerT listenert = this.g;
if (listenert != null) {
listenert.e();
}
}
}
public abstract int m();
public abstract int n();
public abstract void p();
public abstract void q();
public abstract void s();
public void t() {
}
public void u() {
i iVar;
T t;
this.d.a(false);
this.d.f(false);
com.fyber.inneractive.sdk.player.ui.s sVar = this.d;
com.fyber.inneractive.sdk.player.ui.c cVar = new com.fyber.inneractive.sdk.player.ui.c();
cVar.b = false;
sVar.c(new com.fyber.inneractive.sdk.player.ui.b(cVar));
Runnable runnable = this.j;
if (runnable != null) {
this.d.removeCallbacks(runnable);
this.j = null;
}
if (this.a != null && v() && !this.h) {
int d2 = this.a.b.d();
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
f0 f0Var = ((com.fyber.inneractive.sdk.player.e) cVar2).y;
com.fyber.inneractive.sdk.flow.g0 g0Var = cVar2.e;
if (com.fyber.inneractive.sdk.player.c.a(d2, (g0Var == null || (t = g0Var.b) == 0) ? -1 : ((com.fyber.inneractive.sdk.response.g) t).w, f0Var)) {
if (this.f <= 0) {
this.d.h(true);
l();
} else {
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
if (cVar3 != null && (iVar = cVar3.b) != null) {
if (this.f >= iVar.d() / 1000) {
this.d.h(false);
}
}
if (!this.s) {
this.d.h(true);
c(this.f);
this.s = true;
}
}
}
}
ListenerT listenert = this.g;
if (listenert != null && !this.k) {
this.k = true;
listenert.i();
}
this.o = false;
this.t = false;
}
public abstract boolean v();
public final void w() {
com.fyber.inneractive.sdk.config.global.s sVar = this.c;
com.fyber.inneractive.sdk.config.global.features.r rVar = sVar != null ? (com.fyber.inneractive.sdk.config.global.features.r) sVar.a(com.fyber.inneractive.sdk.config.global.features.r.class) : null;
boolean a2 = rVar != null ? rVar.a(true, "show_cta") : true;
ListenerT listenert = this.g;
if (listenert != null) {
this.w = listenert.j();
}
com.fyber.inneractive.sdk.ignite.l lVar = this.w;
this.d.a(lVar == com.fyber.inneractive.sdk.ignite.l.NONE ? a2 : true, lVar);
}
public o(com.fyber.inneractive.sdk.player.e eVar, com.fyber.inneractive.sdk.player.ui.s sVar, f0 f0Var, com.fyber.inneractive.sdk.config.global.s sVar2, boolean z, Skip skip, String str, boolean z2) {
this.f = 0;
this.h = false;
this.i = -0.1f;
this.l = false;
this.o = false;
this.p = null;
this.q = new LinkedList();
this.r = false;
this.s = false;
this.t = false;
this.u = false;
this.v = false;
this.w = com.fyber.inneractive.sdk.ignite.l.NONE;
this.B = false;
this.A = skip;
this.a = eVar;
this.b = f0Var;
this.c = sVar2;
this.d = sVar;
this.n = z;
this.y = str;
this.z = z2;
sVar.setListener(this);
i();
new GestureDetector(sVar.getContext(), new p());
}
public void d() {
IAlog.a("%sonVideoViewDetachedFromWindow", IAlog.a(this));
k();
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public void e(boolean z) {
IAlog.a("%sinitUI", IAlog.a(this));
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || cVar.b == null) {
return;
}
this.d.setUnitConfig(this.b);
this.d.a(this.n, this.a.b.h(), this.a.b.g());
if (this.a.b.h() > 0 && this.a.b.g() > 0) {
a(this.a.b.h(), this.a.b.g());
}
if (v()) {
this.f = n();
} else {
this.d.h(false);
}
if (!z) {
a(this.a.b.c());
a(this.a.b.e, false);
}
this.d.setMuteButtonState(o());
}
public final void f(boolean z) {
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
g0 g0Var;
ListenerT listenert;
com.fyber.inneractive.sdk.player.c cVar2;
i iVar2;
int i;
i iVar3;
com.fyber.inneractive.sdk.measurement.d dVar;
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor;
f0 f0Var;
g0 g0Var2;
this.t = true;
i0 i0Var = IAConfigManager.L.w;
if (z && i0Var != null && (f0Var = this.b) != null && (g0Var2 = ((e0) f0Var).f) != null) {
i0Var.a(g0Var2.j, "LAST_VAST_SKIPED", "1");
}
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
if (cVar3 != null && (iVar3 = cVar3.b) != null) {
com.fyber.inneractive.sdk.player.d dVar2 = iVar3.h;
if (dVar2 != null && (scheduledThreadPoolExecutor = dVar2.b) != null) {
scheduledThreadPoolExecutor.shutdownNow();
dVar2.b = null;
}
this.a.b.k();
if (z && (dVar = this.a.h) != null && dVar.c != null) {
IAlog.a("%s skipped", "OMVideo");
try {
dVar.c.skipped();
} catch (Throwable th) {
dVar.a(th);
}
}
}
if (!this.d.i()) {
this.d.a(false);
Runnable runnable = this.j;
if (runnable != null) {
this.d.removeCallbacks(runnable);
this.j = null;
}
x();
this.k = false;
this.h = true;
f0 f0Var2 = this.b;
if (f0Var2 != null && (g0Var = ((e0) f0Var2).f) != null && g0Var.j == UnitDisplayType.REWARDED && (listenert = this.g) != null) {
if (!this.t || (cVar2 = this.a) == null || (iVar2 = cVar2.b) == null) {
listenert.onCompleted();
} else {
int c2 = iVar2.c();
int d2 = iVar2.d() - c2;
try {
i = Integer.parseInt(IAConfigManager.L.t.b.a("max_rv_tsec", Integer.toString(30)));
} catch (Throwable unused) {
i = 30;
}
int i2 = (i >= 1 ? i : 30) * 1000;
if (d2 <= 0 || c2 >= i2) {
this.g.onCompleted();
} else {
this.B = true;
}
}
}
}
if (this.g != null && (this.f <= 0 || this.h || ((cVar = this.a) != null && (iVar = cVar.b) != null && iVar.e.equals(com.fyber.inneractive.sdk.player.enums.b.Completed)))) {
this.g.a(z);
}
k();
}
public final Bitmap g(boolean z) {
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
Bitmap bitmap;
if (this.p != null && (cVar = this.a) != null && (iVar = cVar.b) != null) {
if (this.o) {
return cVar.k;
}
TextureView textureView = iVar.j;
Object[] objArr = new Object[3];
objArr[0] = IAlog.a(this);
objArr[1] = textureView;
objArr[2] = Boolean.valueOf(textureView != null && textureView.isAvailable());
IAlog.a("%sSave snapshot entered: tv = %s avail = %s", objArr);
if (textureView != null && textureView.isAvailable()) {
try {
IAlog.e("creating bitmap on object - %s", this.p);
Bitmap bitmap2 = textureView.getBitmap(this.p);
if (this.d.getVideoWidth() > 0 && this.d.getVideoHeight() > 0) {
this.p = null;
a(this.d.getVideoWidth(), this.d.getVideoHeight());
}
if (z) {
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
Context context = this.d.getContext();
if (bitmap2 != null) {
com.fyber.inneractive.sdk.util.f fVar = new com.fyber.inneractive.sdk.util.f();
fVar.c = 20;
fVar.d = 1;
fVar.a = bitmap2.getWidth();
fVar.b = bitmap2.getHeight();
bitmap = com.fyber.inneractive.sdk.util.e.a(context, bitmap2, fVar);
} else {
bitmap = null;
}
cVar2.getClass();
IAlog.a("IAMediaPlayerFlowManager: saving snapshot %s", bitmap);
cVar2.k = bitmap;
this.o = true;
} else {
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
cVar3.getClass();
IAlog.a("IAMediaPlayerFlowManager: saving snapshot %s", bitmap2);
cVar3.k = bitmap2;
}
IAlog.e("%ssave snapshot succeeded", IAlog.a(this));
return this.a.k;
} catch (Exception unused) {
IAlog.e("%ssave snapshot failed with exception", IAlog.a(this));
}
}
}
return null;
}
public void h(boolean z) {
i iVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null) {
if (!cVar.j) {
x();
return;
}
if (z && (iVar = cVar.b) != null) {
iVar.b(0);
return;
}
i iVar2 = cVar.b;
if (iVar2 != null) {
com.fyber.inneractive.sdk.player.enums.b bVar = iVar2.e;
if (bVar == com.fyber.inneractive.sdk.player.enums.b.Completed || bVar == com.fyber.inneractive.sdk.player.enums.b.Prepared) {
iVar2.b(1);
} else {
iVar2.l();
}
}
}
}
public final void i() {
i iVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null) {
return;
}
if (!iVar.b.contains(this)) {
iVar.b.add(this);
}
i iVar2 = this.a.b;
if (iVar2.c.contains(this)) {
return;
}
iVar2.c.add(this);
}
public void j() {
i iVar;
i iVar2;
com.fyber.inneractive.sdk.measurement.d dVar;
if (this.x == null) {
this.x = new com.fyber.inneractive.sdk.player.ui.f(this.d);
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null && (dVar = cVar.h) != null) {
com.fyber.inneractive.sdk.player.ui.s sVar = this.d;
View[] trackingFriendlyView = sVar.getTrackingFriendlyView();
AdSession adSession = dVar.a;
if (adSession != null) {
try {
adSession.registerAdView(sVar);
} catch (Throwable th) {
dVar.a(th);
}
}
if (dVar.a != null && trackingFriendlyView != null) {
for (View view : trackingFriendlyView) {
if (view != null) {
try {
dVar.a.addFriendlyObstruction(view, FriendlyObstructionPurpose.VIDEO_CONTROLS, null);
} catch (Throwable th2) {
dVar.a(th2);
}
}
}
}
View[] trackingFriendlyViewObstructionPurposeOther = this.d.getTrackingFriendlyViewObstructionPurposeOther();
if (dVar.a != null) {
for (View view2 : trackingFriendlyViewObstructionPurposeOther) {
if (view2 != null) {
try {
dVar.a.addFriendlyObstruction(view2, FriendlyObstructionPurpose.OTHER, null);
} catch (Throwable th3) {
dVar.a(th3);
}
}
}
}
}
}
IAlog.a("%sconnectToTextureView called %s", IAlog.a(this), this.d.getTextureHost());
if (this.x != null && this.d.getTextureHost().equals(this.x.getParent())) {
IAlog.a("%sconnectToTextureView called but already connected", IAlog.a(this));
return;
}
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
if (cVar2 != null && (iVar2 = cVar2.b) != null) {
iVar2.a(this.x);
}
com.fyber.inneractive.sdk.player.ui.f fVar = this.x;
if (fVar != null) {
fVar.setId(R.id.ia_inn_texture_view);
}
IAlog.a("%supdateView adding texture to parent", IAlog.a(this));
FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
layoutParams.setMargins(0, 0, 0, 0);
layoutParams.gravity = 17;
if (this.x.getParent() == null) {
this.d.getTextureHost().addView(this.x, layoutParams);
}
this.l = false;
n nVar = new n(this);
this.e = nVar;
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
if (cVar3 == null || (iVar = cVar3.b) == null) {
return;
}
iVar.d = nVar;
}
public final boolean o() {
i iVar;
float f;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null) {
return false;
}
if (iVar.i()) {
return true;
}
try {
f = ((AudioManager) this.d.getContext().getSystemService("audio")).getStreamVolume(3);
} catch (Throwable unused) {
f = 1.0f;
}
return ((double) f) == 0.0d;
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public void pauseVideo() {
i iVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null) {
return;
}
if (iVar.e == com.fyber.inneractive.sdk.player.enums.b.Paused) {
IAlog.a("%spauseVideo called in bad state! %s", IAlog.a(this), this.a.b.e);
return;
}
IAlog.a("%spauseVideo %s", IAlog.a(this), this.d);
TextureView textureView = this.a.b.j;
if (textureView == null || textureView.getParent() == null || !textureView.getParent().equals(this.d.getTextureHost())) {
return;
}
this.a.b.k();
}
public void r() {
Runnable runnable = this.j;
if (runnable != null) {
this.d.removeCallbacks(runnable);
this.j = null;
}
this.d.a(false);
x();
}
/* JADX WARN: Removed duplicated region for block: B:214:0x030a */
/* JADX WARN: Removed duplicated region for block: B:216:0x0314 */
/* JADX WARN: Removed duplicated region for block: B:223:0x033d */
/* JADX WARN: Removed duplicated region for block: B:226:0x032b */
/* JADX WARN: Removed duplicated region for block: B:227:0x0311 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public void x() {
/*
Method dump skipped, instructions count: 872
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.controller.o.x():void");
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public void destroy() {
i iVar;
Application application;
s sVar = this.m;
if (sVar != null && (application = com.fyber.inneractive.sdk.util.o.a) != null) {
application.unregisterActivityLifecycleCallbacks(sVar);
}
IAlog.a("%sdestroy called", IAlog.a(this));
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null && (iVar = cVar.b) != null) {
iVar.b.remove(this);
this.a.b.c.remove(this);
}
k();
Runnable runnable = this.j;
if (runnable != null) {
this.d.removeCallbacks(runnable);
this.j = null;
}
while (this.q.peek() != null) {
com.fyber.inneractive.sdk.util.b bVar = (com.fyber.inneractive.sdk.util.b) this.q.poll();
if (bVar != null && !bVar.a()) {
bVar.b();
}
}
this.g = null;
}
public void k() {
if (this.x != null) {
IAlog.a("%sdestroyTextureView", IAlog.a(this));
if (this.p != null) {
a(false, (s0) new b());
}
}
}
public class c extends com.fyber.inneractive.sdk.util.b<Integer, Void, Bitmap> {
public c() {
}
@Override // com.fyber.inneractive.sdk.util.b
public final Bitmap a(Integer[] numArr) {
Integer[] numArr2 = numArr;
if (numArr2 != null) {
Bitmap a = o.a(o.this, numArr2[0].intValue(), numArr2[1].intValue());
if (!a()) {
return a;
}
}
return null;
}
@Override // com.fyber.inneractive.sdk.util.b
public final void a(Bitmap bitmap) {
Bitmap bitmap2 = bitmap;
o oVar = o.this;
boolean a = a();
oVar.getClass();
if (!a || bitmap2 != null) {
oVar.p = bitmap2;
}
while (oVar.q.peek() != null) {
com.fyber.inneractive.sdk.util.b bVar = (com.fyber.inneractive.sdk.util.b) oVar.q.poll();
if (bVar != null && !bVar.a()) {
bVar.b();
}
}
}
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public boolean c() {
com.fyber.inneractive.sdk.player.ui.s sVar;
T t;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null) {
return false;
}
if (!this.h && cVar.b != null && ((sVar = this.d) == null || !sVar.j())) {
int d2 = this.a.b.d();
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
f0 f0Var = ((com.fyber.inneractive.sdk.player.e) cVar2).y;
com.fyber.inneractive.sdk.flow.g0 g0Var = cVar2.e;
if (!com.fyber.inneractive.sdk.player.c.a(d2, (g0Var == null || (t = g0Var.b) == 0) ? -1 : ((com.fyber.inneractive.sdk.response.g) t).w, f0Var) || this.h || this.f != 0) {
return false;
}
}
return true;
}
public final void a(int i, int i2) {
Bitmap bitmap = this.p;
if (!(bitmap != null && bitmap.getWidth() == i && this.p.getHeight() == i2) && i2 > 0 && i > 0) {
while (this.q.peek() != null) {
com.fyber.inneractive.sdk.util.b bVar = (com.fyber.inneractive.sdk.util.b) this.q.poll();
if (bVar != null && !bVar.a()) {
bVar.b();
}
}
this.p = null;
c cVar = new c();
this.q.offer(cVar);
Integer[] numArr = {Integer.valueOf(i), Integer.valueOf(i2)};
if (cVar.b == null) {
synchronized (cVar.e) {
cVar.b = new Handler(Looper.getMainLooper());
}
}
cVar.b.post(new b.RunnableC0109b(numArr));
}
}
public final void c(int i) {
if (this.d != null) {
com.fyber.inneractive.sdk.config.global.s sVar = this.c;
String str = null;
com.fyber.inneractive.sdk.config.global.features.c cVar = sVar != null ? (com.fyber.inneractive.sdk.config.global.features.c) sVar.a(com.fyber.inneractive.sdk.config.global.features.c.class) : null;
if (cVar != null) {
cVar.d(IAConfigManager.L.o);
com.fyber.inneractive.sdk.model.vast.a aVar = cVar.e;
if (aVar != null && aVar.d) {
str = aVar.c;
}
}
if (TextUtils.isEmpty(this.y) && str != null) {
this.d.setSkipText(str.replaceFirst("\\[TIME\\]", Integer.toString(i)));
} else {
this.d.setSkipText(String.valueOf(i));
}
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void e() {
if (this.r && !this.l) {
this.l = true;
this.d.d(false);
}
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final com.fyber.inneractive.sdk.flow.vast.e g() {
com.fyber.inneractive.sdk.flow.m mVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (mVar = ((com.fyber.inneractive.sdk.player.e) cVar).z) == null) {
return null;
}
return mVar.m;
}
public final void a(boolean z, s0 s0Var) {
com.fyber.inneractive.sdk.util.p.a(new d(z, s0Var));
}
public final void a(String str) {
g0 g0Var;
i0 i0Var = IAConfigManager.L.w;
f0 f0Var = this.b;
if (f0Var == null || (g0Var = ((e0) f0Var).f) == null) {
return;
}
i0Var.a(g0Var.j, "LAST_VAST_CLICKED_TYPE", str);
}
@Override // com.fyber.inneractive.sdk.player.controller.i.e
public final void a(com.fyber.inneractive.sdk.player.enums.b bVar) {
IAlog.a("%sonPlayerStateChanged with %s", IAlog.a(this), bVar);
a(bVar, true);
}
public final void a(com.fyber.inneractive.sdk.player.enums.b bVar, boolean z) {
ListenerT listenert;
switch (a.a[bVar.ordinal()]) {
case 1:
if (this.r) {
this.d.d(true);
x();
t();
break;
}
break;
case 2:
if (this.r) {
this.d.a(true);
this.d.f(false);
Runnable runnable = this.j;
if (runnable == null) {
if (runnable == null) {
this.j = new q(this);
}
int m = m();
IAlog.a("%s Starting buffering timeout with %d", IAlog.a(this), Integer.valueOf(m));
this.d.postDelayed(this.j, m);
break;
}
}
break;
case 3:
if (this.r) {
u();
break;
}
break;
case 4:
r();
break;
case 5:
if (this.r || (!this.z && !this.v)) {
this.v = true;
if (!this.d.i()) {
this.d.a(false);
Runnable runnable2 = this.j;
if (runnable2 != null) {
this.d.removeCallbacks(runnable2);
this.j = null;
}
x();
this.k = false;
this.h = true;
}
if (z && (listenert = this.g) != null) {
listenert.onCompleted();
break;
}
}
break;
case 6:
if (this.r) {
b(false);
break;
}
break;
}
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final void f() {
com.fyber.inneractive.sdk.player.ui.f fVar;
com.fyber.inneractive.sdk.player.ui.s sVar = this.d;
if (sVar != null) {
sVar.q();
}
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null && cVar.b != null && (fVar = this.x) != null) {
fVar.invalidate();
this.x.requestLayout();
}
com.fyber.inneractive.sdk.player.ui.s sVar2 = this.d;
if (sVar2 != null) {
sVar2.invalidate();
this.d.requestLayout();
}
}
@Override // com.fyber.inneractive.sdk.player.controller.i.d
public final void a(int i) {
float f;
int i2;
f0 f0Var;
g0 g0Var;
T t;
i iVar;
i iVar2;
i iVar3;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || cVar.b == null) {
return;
}
try {
f = ((AudioManager) this.d.getContext().getSystemService("audio")).getStreamVolume(3);
} catch (Throwable unused) {
f = 1.0f;
}
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
if (cVar2 != null && (iVar = cVar2.b) != null && iVar.j()) {
float f2 = this.i;
if (f != f2) {
if (f > 0.0f && f2 >= 0.0f && o()) {
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
if (cVar3 != null && (iVar3 = cVar3.b) != null) {
iVar3.d(true);
}
this.d.setMuteButtonState(false);
} else if (f == 0.0d) {
com.fyber.inneractive.sdk.player.c cVar4 = this.a;
if (cVar4 != null && (iVar2 = cVar4.b) != null) {
iVar2.b(true);
}
this.d.setMuteButtonState(true);
}
}
this.d.setMuteButtonState(o());
}
this.i = f;
int d2 = this.a.b.d();
int c2 = this.a.b.c();
int i3 = c2 / 1000;
int i4 = d2 / 1000;
int i5 = i4 - i3;
if (i5 < 0 || (!this.a.b.j() && c2 == d2)) {
i5 = 0;
}
if (this.d.n()) {
return;
}
this.d.setRemainingTime(Integer.toString(i5));
if (this.f < i4) {
if (v()) {
int d3 = this.a.b.d();
com.fyber.inneractive.sdk.player.c cVar5 = this.a;
f0 f0Var2 = ((com.fyber.inneractive.sdk.player.e) cVar5).y;
com.fyber.inneractive.sdk.flow.g0 g0Var2 = cVar5.e;
if (com.fyber.inneractive.sdk.player.c.a(d3, (g0Var2 == null || (t = g0Var2.b) == 0) ? -1 : ((com.fyber.inneractive.sdk.response.g) t).w, f0Var2) && !this.h) {
int i6 = this.f;
if (i3 < i6) {
c(i6 - i3);
} else {
this.f = 0;
l();
}
this.d.h(true);
}
}
this.d.h(false);
} else {
this.d.h(false);
c(i5);
}
if (this.a.b.e != com.fyber.inneractive.sdk.player.enums.b.Paused) {
this.d.b(d2, c2);
try {
i2 = Integer.parseInt(IAConfigManager.L.t.b.a("max_rv_tsec", Integer.toString(30)));
} catch (Throwable unused2) {
i2 = 30;
}
int i7 = i2 >= 1 ? i2 : 30;
if (i4 > i7 && i3 > i7 && (f0Var = this.b) != null && (g0Var = ((e0) f0Var).f) != null && g0Var.j == UnitDisplayType.REWARDED) {
l();
this.d.h(true);
}
}
ListenerT listenert = this.g;
if (listenert != null) {
listenert.onProgress(d2, c2);
}
}
public void a(boolean z) {
com.fyber.inneractive.sdk.player.c cVar;
i iVar;
i.f fVar;
com.fyber.inneractive.sdk.player.ui.s sVar;
Application application;
if (this.r == z || (cVar = this.a) == null || cVar.b == null) {
return;
}
IAlog.a("%sonVisibilityChanged: %s my video view is%s", IAlog.a(this), Boolean.valueOf(z), this.d);
if (z) {
this.r = true;
com.fyber.inneractive.sdk.player.enums.b bVar = this.a.b.e;
if (bVar.equals(com.fyber.inneractive.sdk.player.enums.b.Completed) || this.d.i()) {
if (!this.v) {
this.v = true;
if (!this.B) {
if (!this.d.i()) {
this.d.a(false);
Runnable runnable = this.j;
if (runnable != null) {
this.d.removeCallbacks(runnable);
this.j = null;
}
x();
this.k = false;
this.h = true;
}
ListenerT listenert = this.g;
if (listenert != null) {
listenert.onCompleted();
}
}
}
com.fyber.inneractive.sdk.player.ui.s sVar2 = this.d;
if (sVar2 != null) {
sVar2.l();
return;
}
return;
}
if (!bVar.equals(com.fyber.inneractive.sdk.player.enums.b.Error)) {
if (!bVar.equals(com.fyber.inneractive.sdk.player.enums.b.Idle)) {
if (bVar == com.fyber.inneractive.sdk.player.enums.b.Start_in_progress || bVar == com.fyber.inneractive.sdk.player.enums.b.Playing) {
u();
}
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
if (!cVar2.p) {
com.fyber.inneractive.sdk.player.e eVar = (com.fyber.inneractive.sdk.player.e) cVar2;
eVar.a(eVar.v, VideoClickOrigin.InvalidOrigin, com.fyber.inneractive.sdk.model.vast.v.EVENT_CREATIVE_VIEW);
cVar2.p = true;
}
j();
if (this.m != null || (application = com.fyber.inneractive.sdk.util.o.a) == null) {
return;
}
s sVar3 = new s(this);
this.m = sVar3;
application.registerActivityLifecycleCallbacks(sVar3);
return;
}
this.a.getClass();
}
b(false);
return;
}
this.r = false;
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
if (cVar3 != null && (iVar = cVar3.b) != null && (fVar = iVar.d) != null && fVar.equals(this.e)) {
IAlog.a("%sonVisibilityChanged pausing video", IAlog.a(this));
pauseVideo();
if (this.a.b.e == com.fyber.inneractive.sdk.player.enums.b.Completed || ((sVar = this.d) != null && sVar.i())) {
this.d.k();
}
}
k();
}
/* JADX WARN: Removed duplicated region for block: B:47:0x00ae */
/* JADX WARN: Removed duplicated region for block: B:50:0x00b5 */
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
public final void a(int r7, com.fyber.inneractive.sdk.util.p0 r8) {
/*
Method dump skipped, instructions count: 316
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.player.controller.o.a(int, com.fyber.inneractive.sdk.util.p0):void");
}
public final void a(com.fyber.inneractive.sdk.model.vast.h hVar, int i) {
com.fyber.inneractive.sdk.config.global.s sVar;
com.fyber.inneractive.sdk.flow.vast.c cVar;
com.fyber.inneractive.sdk.web.a aVar;
com.fyber.inneractive.sdk.flow.m mVar;
com.fyber.inneractive.sdk.model.vast.c cVar2;
com.fyber.inneractive.sdk.player.c cVar3 = this.a;
if (cVar3 != null) {
com.fyber.inneractive.sdk.player.e eVar = (com.fyber.inneractive.sdk.player.e) cVar3;
IAlog.a("notifyCompanionDisplayed", new Object[0]);
int i2 = e.b.a[hVar.ordinal()];
if (i2 == 1) {
if (eVar.A) {
return;
}
com.fyber.inneractive.sdk.network.r rVar = com.fyber.inneractive.sdk.network.r.VAST_DEFAULT_COMPANION_DISPLAYED;
InneractiveAdRequest inneractiveAdRequest = eVar.f;
com.fyber.inneractive.sdk.flow.g0 g0Var = eVar.e;
new s.a(rVar, inneractiveAdRequest, g0Var != null ? (com.fyber.inneractive.sdk.response.g) g0Var.b : null, (g0Var == null || (sVar = g0Var.c) == null) ? null : sVar.c()).a((String) null);
eVar.A = true;
return;
}
if (i2 != 2) {
if (eVar.c() == null || (mVar = eVar.z) == null || mVar.g || (cVar2 = eVar.v.i) == null) {
return;
}
eVar.a(cVar2, VideoClickOrigin.COMPANION, com.fyber.inneractive.sdk.model.vast.v.EVENT_CREATIVE_VIEW);
com.fyber.inneractive.sdk.flow.m mVar2 = eVar.z;
if (!mVar2.g) {
com.fyber.inneractive.sdk.network.r rVar2 = com.fyber.inneractive.sdk.network.r.VAST_COMPANION_DISPLAYED;
InneractiveAdRequest inneractiveAdRequest2 = mVar2.b;
com.fyber.inneractive.sdk.response.g gVar = mVar2.c;
com.fyber.inneractive.sdk.config.global.s sVar2 = mVar2.d;
s.a aVar2 = new s.a(rVar2, inneractiveAdRequest2, gVar, sVar2 == null ? null : sVar2.c());
aVar2.a("companion_data", mVar2.e.i.a());
aVar2.a((String) null);
}
mVar2.g = true;
return;
}
com.fyber.inneractive.sdk.flow.m mVar3 = eVar.z;
if (mVar3 == null || (cVar = mVar3.m) == null) {
return;
}
cVar.c = true;
InneractiveAdRequest inneractiveAdRequest3 = mVar3.b;
com.fyber.inneractive.sdk.response.g gVar2 = mVar3.c;
com.fyber.inneractive.sdk.config.global.s sVar3 = mVar3.d;
cVar.d = i;
com.fyber.inneractive.sdk.web.g0 g0Var2 = cVar.g.a;
String str = (!(g0Var2 instanceof com.fyber.inneractive.sdk.web.b) || (aVar = ((com.fyber.inneractive.sdk.web.b) g0Var2).O) == null) ? null : aVar.b;
cVar.e = str;
if (cVar.h) {
return;
}
s.a aVar3 = new s.a(com.fyber.inneractive.sdk.network.r.FMP_COMPANION_SUCCESSFULLY_SHOWN, inneractiveAdRequest3, gVar2, sVar3 == null ? null : sVar3.c());
JSONObject jSONObject = new JSONObject();
if (!TextUtils.isEmpty(str)) {
try {
jSONObject.put("version", str);
} catch (Exception unused) {
IAlog.f("Got exception adding param to json object: %s, %s", "version", str);
}
}
Boolean valueOf = Boolean.valueOf(cVar.j);
try {
jSONObject.put("loaded_from_cache", valueOf);
} catch (Exception unused2) {
IAlog.f("Got exception adding param to json object: %s, %s", "loaded_from_cache", valueOf);
}
aVar3.f.put(jSONObject);
aVar3.a((String) null);
cVar.h = true;
}
}
public static boolean a(o oVar) {
return oVar.g() != null && oVar.g().c;
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final void a(Bitmap bitmap) {
i iVar;
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar == null || (iVar = cVar.b) == null || iVar.e == com.fyber.inneractive.sdk.player.enums.b.Completed) {
return;
}
this.d.a(cVar.j);
this.d.d(true);
this.d.setLastFrameBitmap(bitmap);
}
@Override // com.fyber.inneractive.sdk.player.controller.b
public final void a(long j) {
com.fyber.inneractive.sdk.player.c cVar = this.a;
this.d.a((cVar != null ? cVar.c() : null) == null, j);
}
public final boolean a(boolean z, VideoClickOrigin videoClickOrigin, p0 p0Var) {
com.fyber.inneractive.sdk.player.ui.s sVar = this.d;
if (sVar != null) {
sVar.f();
}
ListenerT listenert = this.g;
boolean z2 = false;
if (listenert != null) {
if (z) {
com.fyber.inneractive.sdk.player.c cVar = this.a;
if (cVar != null) {
com.fyber.inneractive.sdk.model.vast.b bVar = ((com.fyber.inneractive.sdk.player.e) cVar).v;
listenert.a(bVar != null ? bVar.b : null, p0Var, null, true);
com.fyber.inneractive.sdk.player.e eVar = (com.fyber.inneractive.sdk.player.e) this.a;
eVar.a(eVar.v, videoClickOrigin, com.fyber.inneractive.sdk.model.vast.v.EVENT_CLICK);
}
} else {
a0.a a2 = listenert.a(p0Var, videoClickOrigin == VideoClickOrigin.VIDEO ? com.fyber.inneractive.sdk.util.h.VIDEO_CLICK : videoClickOrigin == VideoClickOrigin.APP_INFO ? com.fyber.inneractive.sdk.util.h.VIDEO_APP_INFO : com.fyber.inneractive.sdk.util.h.VIDEO_CTA);
com.fyber.inneractive.sdk.player.c cVar2 = this.a;
if (cVar2 != null) {
com.fyber.inneractive.sdk.player.e eVar2 = (com.fyber.inneractive.sdk.player.e) cVar2;
eVar2.a(eVar2.v, videoClickOrigin, com.fyber.inneractive.sdk.model.vast.v.EVENT_CLICK);
com.fyber.inneractive.sdk.measurement.d dVar = this.a.h;
if (dVar != null && dVar.c != null) {
IAlog.a("%s click", "OMVideo");
try {
dVar.c.adUserInteraction(InteractionType.CLICK);
} catch (Throwable th) {
dVar.a(th);
}
}
}
if (a2.a != a0.d.FAILED) {
z2 = true;
}
}
}
if (videoClickOrigin == VideoClickOrigin.VIDEO) {
a(i0.b.VIDEO.e());
}
return z2;
}
public static void a(com.fyber.inneractive.sdk.player.ui.s sVar, Bitmap bitmap, boolean z, boolean z2) {
if (bitmap == null) {
IAlog.a("IAVideoUIControllerBase : Unable set bitmap it is null", new Object[0]);
return;
}
if (sVar == null) {
IAlog.a("IAVideoUIControllerBase : Unable set last frame", new Object[0]);
return;
}
sVar.setLastFrameBitmap(bitmap);
if (z) {
sVar.d(z2);
}
}
}