- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
287 lines
9.7 KiB
Java
287 lines
9.7 KiB
Java
package com.fyber.inneractive.sdk.web;
|
|
|
|
import android.R;
|
|
import android.app.Activity;
|
|
import android.content.Context;
|
|
import android.graphics.Rect;
|
|
import android.util.DisplayMetrics;
|
|
import android.view.View;
|
|
import android.view.ViewTreeObserver;
|
|
import android.view.Window;
|
|
import android.view.WindowManager;
|
|
import com.fyber.inneractive.sdk.util.IAlog;
|
|
import com.fyber.inneractive.sdk.web.h0;
|
|
import com.fyber.inneractive.sdk.web.j;
|
|
import java.util.ArrayList;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public abstract class g0<T extends h0> extends f<T> {
|
|
public boolean A;
|
|
public boolean B;
|
|
public boolean C;
|
|
public boolean D;
|
|
public boolean E;
|
|
public boolean F;
|
|
public com.fyber.inneractive.sdk.mraid.b0 G;
|
|
public final j.g H;
|
|
public com.fyber.inneractive.sdk.measurement.a I;
|
|
public com.fyber.inneractive.sdk.measurement.tracker.c J;
|
|
public final a K;
|
|
public final b L;
|
|
public final c M;
|
|
public final d N;
|
|
public int u;
|
|
public int v;
|
|
public int w;
|
|
public int x;
|
|
public int y;
|
|
public int z;
|
|
|
|
public class a implements Runnable {
|
|
public a() {
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
h hVar = g0.this.b;
|
|
if (hVar != null) {
|
|
hVar.getViewTreeObserver().addOnPreDrawListener(g0.this.L);
|
|
}
|
|
}
|
|
}
|
|
|
|
public class b implements ViewTreeObserver.OnPreDrawListener {
|
|
public b() {
|
|
}
|
|
|
|
@Override // android.view.ViewTreeObserver.OnPreDrawListener
|
|
public final boolean onPreDraw() {
|
|
h hVar;
|
|
h hVar2 = g0.this.b;
|
|
if (hVar2 == null) {
|
|
return false;
|
|
}
|
|
hVar2.getViewTreeObserver().removeOnPreDrawListener(this);
|
|
g0.this.m();
|
|
g0 g0Var = g0.this;
|
|
g0Var.a(new com.fyber.inneractive.sdk.mraid.x(g0Var.H));
|
|
g0 g0Var2 = g0.this;
|
|
if (g0Var2.H == j.g.INTERSTITIAL && (hVar = g0Var2.b) != null) {
|
|
hVar.a("if (window.showInterstitial) { showInterstitial(); }");
|
|
}
|
|
g0.this.k();
|
|
g0 g0Var3 = g0.this;
|
|
g0Var3.a(g0Var3.l(), true);
|
|
g0.this.q();
|
|
com.fyber.inneractive.sdk.util.p.b.postDelayed(g0.this.M, 100L);
|
|
return false;
|
|
}
|
|
}
|
|
|
|
public class c implements Runnable {
|
|
public c() {
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
com.fyber.inneractive.sdk.measurement.tracker.c cVar;
|
|
g0 g0Var = g0.this;
|
|
if (g0Var.I == null || (cVar = g0Var.J) == null) {
|
|
return;
|
|
}
|
|
cVar.a();
|
|
}
|
|
}
|
|
|
|
public class d implements Runnable {
|
|
public d() {
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
h hVar = g0.this.b;
|
|
if (hVar != null) {
|
|
hVar.a("if (FyberMraidVideoController.getCurrentTime() < 0.2) { var ifr = document.createElement('iframe'); var container = document.body || document.documentElement; container.appendChild(ifr); ifr.setAttribute('sandbox', ''); ifr.setAttribute('style', 'position: fixed; bottom: -20px; border: none; visibility: hidden; height: 20px; z-index: -99999'); ifr.setAttribute('src','FyMraidVideo://fyMraidVideoAdPlaybackFailure'); console.log('dispatched closure event'); } else { console.log('video has progressed'); };");
|
|
}
|
|
}
|
|
}
|
|
|
|
public g0(boolean z, j.g gVar, com.fyber.inneractive.sdk.config.global.s sVar) {
|
|
super(z, sVar);
|
|
this.u = -1;
|
|
this.v = -1;
|
|
this.w = -1;
|
|
this.x = -1;
|
|
this.y = -1;
|
|
this.z = -1;
|
|
this.A = false;
|
|
this.B = true;
|
|
this.C = false;
|
|
this.D = false;
|
|
this.E = false;
|
|
this.G = com.fyber.inneractive.sdk.mraid.b0.HIDDEN;
|
|
this.J = null;
|
|
this.K = new a();
|
|
this.L = new b();
|
|
this.M = new c();
|
|
this.N = new d();
|
|
this.H = gVar;
|
|
}
|
|
|
|
public Context l() {
|
|
h hVar = this.b;
|
|
if (hVar != null) {
|
|
return hVar.getContext();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public void m() {
|
|
ArrayList<com.fyber.inneractive.sdk.mraid.u> arrayList = new ArrayList<>();
|
|
h hVar = this.b;
|
|
if (hVar == null || hVar.getScaleX() == 1.0f || this.b.getScaleY() == 1.0f) {
|
|
arrayList.add(new com.fyber.inneractive.sdk.mraid.y(this.w, this.x));
|
|
arrayList.add(new com.fyber.inneractive.sdk.mraid.w(this.u, this.v));
|
|
} else {
|
|
int widthDp = this.b.getWidthDp();
|
|
int heightDp = this.b.getHeightDp();
|
|
arrayList.add(new com.fyber.inneractive.sdk.mraid.y(widthDp, heightDp));
|
|
arrayList.add(new com.fyber.inneractive.sdk.mraid.w(widthDp, heightDp));
|
|
}
|
|
h hVar2 = this.b;
|
|
int b2 = com.fyber.inneractive.sdk.util.o.b(hVar2 != null ? hVar2.getWidth() : this.u);
|
|
h hVar3 = this.b;
|
|
arrayList.add(new com.fyber.inneractive.sdk.mraid.v(b2, com.fyber.inneractive.sdk.util.o.b(hVar3 != null ? hVar3.getHeight() : this.v)));
|
|
a(arrayList);
|
|
com.fyber.inneractive.sdk.mraid.b0 b0Var = com.fyber.inneractive.sdk.mraid.b0.DEFAULT;
|
|
this.G = b0Var;
|
|
a(new com.fyber.inneractive.sdk.mraid.z(b0Var));
|
|
}
|
|
|
|
public boolean o() {
|
|
return this.G == com.fyber.inneractive.sdk.mraid.b0.EXPANDED;
|
|
}
|
|
|
|
public boolean p() {
|
|
j.g gVar = this.H;
|
|
return gVar != null && gVar.equals(j.g.INTERSTITIAL);
|
|
}
|
|
|
|
public void setAdDefaultSize(int i, int i2) {
|
|
this.y = i;
|
|
this.z = i2;
|
|
}
|
|
|
|
public void setAutoplayMRAIDVideos(boolean z) {
|
|
this.A = z;
|
|
}
|
|
|
|
public void setCenteringTagsRequired(boolean z) {
|
|
this.B = z;
|
|
}
|
|
|
|
public final void a(ArrayList<com.fyber.inneractive.sdk.mraid.u> arrayList) {
|
|
if (this.b != null) {
|
|
String obj = arrayList.toString();
|
|
if (obj.length() < 2) {
|
|
return;
|
|
}
|
|
String str = "{" + obj.substring(1, obj.length() - 1) + "}";
|
|
this.b.a("window.mraidbridge.fireChangeEvent(" + str + ");");
|
|
IAlog.e("Fire changes: %s", str);
|
|
}
|
|
}
|
|
|
|
public void k() {
|
|
h hVar = this.b;
|
|
if (hVar != null) {
|
|
hVar.a("window.mraidbridge.fireReadyEvent();");
|
|
}
|
|
}
|
|
|
|
public void q() {
|
|
h hVar;
|
|
if (this.C && this.D && this.A && (hVar = this.b) != null) {
|
|
hVar.a("FyberMraidVideoController.play()");
|
|
d dVar = this.N;
|
|
if (dVar != null) {
|
|
com.fyber.inneractive.sdk.util.p.b.postDelayed(dVar, 5000L);
|
|
}
|
|
if (this.E) {
|
|
this.b.a("FyberMraidVideoController.mute(true)");
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void n() {
|
|
h hVar = this.b;
|
|
if (hVar != null) {
|
|
this.C = true;
|
|
if (this.A) {
|
|
hVar.getSettings().setMediaPlaybackRequiresUserGesture(false);
|
|
}
|
|
com.fyber.inneractive.sdk.util.p.b.postDelayed(this.K, 0L);
|
|
}
|
|
}
|
|
|
|
public final void a(com.fyber.inneractive.sdk.mraid.u uVar) {
|
|
if (this.b != null) {
|
|
String str = "{" + uVar.toString() + "}";
|
|
this.b.a("window.mraidbridge.fireChangeEvent(" + str + ");");
|
|
IAlog.e("Fire changes: %s", str);
|
|
}
|
|
}
|
|
|
|
public void a(Context context, boolean z) {
|
|
Window window;
|
|
Window window2;
|
|
DisplayMetrics displayMetrics = new DisplayMetrics();
|
|
if (context != null) {
|
|
((WindowManager) context.getSystemService("window")).getDefaultDisplay().getRealMetrics(displayMetrics);
|
|
}
|
|
Rect rect = new Rect();
|
|
boolean z2 = context instanceof Activity;
|
|
if (z2 && (window2 = ((Activity) context).getWindow()) != null) {
|
|
window2.getDecorView().getWindowVisibleDisplayFrame(rect);
|
|
}
|
|
int i = rect.top;
|
|
View findViewById = (!z2 || (window = ((Activity) context).getWindow()) == null) ? null : window.findViewById(R.id.content);
|
|
int top = findViewById != null ? findViewById.getTop() - i : 0;
|
|
int i2 = displayMetrics.widthPixels;
|
|
int i3 = displayMetrics.heightPixels;
|
|
double d2 = i2;
|
|
double d3 = 160.0d / displayMetrics.densityDpi;
|
|
int i4 = (int) (d3 * d2);
|
|
int i5 = (int) (d3 * i3);
|
|
int i6 = (i3 - i) - top;
|
|
h hVar = this.b;
|
|
if (hVar == null || hVar.getScaleX() == 1.0f || this.b.getScaleY() == 1.0f) {
|
|
this.u = (int) ((160.0d / displayMetrics.densityDpi) * d2);
|
|
} else {
|
|
i4 = this.b.getWidthDp();
|
|
i5 = this.b.getHeightDp();
|
|
i6 = (com.fyber.inneractive.sdk.util.o.a(this.b.getHeightDp()) - i) - top;
|
|
this.u = this.w;
|
|
}
|
|
this.v = (int) ((160.0d / displayMetrics.densityDpi) * i6);
|
|
if (this.w == i4 && this.x == i5) {
|
|
return;
|
|
}
|
|
this.w = i4;
|
|
this.x = i5;
|
|
a(new com.fyber.inneractive.sdk.mraid.y(i4, i5));
|
|
a(new com.fyber.inneractive.sdk.mraid.w(this.u, this.v));
|
|
a(new com.fyber.inneractive.sdk.mraid.v(this.u, this.v));
|
|
int i7 = this.y;
|
|
if (i7 > 0 && this.z > 0) {
|
|
a(new com.fyber.inneractive.sdk.mraid.t(com.fyber.inneractive.sdk.util.o.b(i7), com.fyber.inneractive.sdk.util.o.b(this.z)));
|
|
return;
|
|
}
|
|
h hVar2 = this.b;
|
|
if (hVar2 == null || hVar2.getWidth() <= 0 || this.b.getHeight() <= 0) {
|
|
return;
|
|
}
|
|
a(new com.fyber.inneractive.sdk.mraid.t(com.fyber.inneractive.sdk.util.o.b(this.b.getWidth()), com.fyber.inneractive.sdk.util.o.b(this.b.getHeight())));
|
|
}
|
|
}
|