Idle Egg Factory v2.1.5版本的 MD5 值为:7d2ba6677008ca521af0101bb927d72a
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.applovin.impl.adview.activity.b;
import android.R;
import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.StrictMode;
import android.os.SystemClock;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import com.applovin.communicator.AppLovinCommunicator;
import com.applovin.communicator.AppLovinCommunicatorMessage;
import com.applovin.communicator.AppLovinCommunicatorSubscriber;
import com.applovin.exoplayer2.ab;
import com.applovin.exoplayer2.ac;
import com.applovin.exoplayer2.ak;
import com.applovin.exoplayer2.am;
import com.applovin.exoplayer2.an;
import com.applovin.exoplayer2.aw;
import com.applovin.exoplayer2.ba;
import com.applovin.exoplayer2.h.ad;
import com.applovin.exoplayer2.h.u;
import com.applovin.exoplayer2.j.h;
import com.applovin.exoplayer2.k.p;
import com.applovin.exoplayer2.l.ai;
import com.applovin.exoplayer2.ui.f;
import com.applovin.impl.adview.AppLovinTouchToClickListener;
import com.applovin.impl.adview.j;
import com.applovin.impl.adview.m;
import com.applovin.impl.adview.s;
import com.applovin.impl.adview.t;
import com.applovin.impl.adview.u;
import com.applovin.impl.sdk.e.o;
import com.applovin.impl.sdk.e.z;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.Utils;
import com.applovin.impl.sdk.utils.k;
import com.applovin.impl.sdk.utils.r;
import com.applovin.impl.sdk.v;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
import com.safedk.android.internal.special.SpecialsBridge;
import java.lang.ref.WeakReference;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public class e extends com.applovin.impl.adview.activity.b.a implements AppLovinCommunicatorSubscriber {
protected final ProgressBar A;
protected final j B;
protected boolean C;
protected long D;
protected int E;
protected boolean F;
protected boolean G;
private final com.applovin.impl.adview.activity.a.c H;
private final a I;
private final Handler J;
private final boolean K;
private long L;
private final AtomicBoolean M;
private final AtomicBoolean N;
private long O;
private long P;
protected final com.applovin.exoplayer2.ui.g u;
protected final aw v;
protected final com.applovin.impl.adview.a w;
protected final m x;
protected final ImageView y;
protected final t z;
private class a implements u.a {
private a() {
}
@Override
public void a(t tVar) {
v vVar = e.this.c;
if (v.a()) {
e.this.c.b("AppLovinFullscreenActivity", "Clicking through from video button...");
}
e.this.a(tVar.getAndClearLastClickLocation());
}
@Override
public void b(t tVar) {
v vVar = e.this.c;
if (v.a()) {
e.this.c.b("AppLovinFullscreenActivity", "Closing ad from video button...");
}
e.this.h();
}
@Override
public void c(t tVar) {
v vVar = e.this.c;
if (v.a()) {
e.this.c.b("AppLovinFullscreenActivity", "Skipping video from video button...");
}
e.this.c();
}
}
private class b implements an.b, f.d, AppLovinTouchToClickListener.OnClickListener {
private b() {
}
@Override
public void a(int i) {
if (i == 0) {
e.this.u.b();
}
}
@Override
public void a(ab abVar, int i) {
an.b.CC.$default$a(this, abVar, i);
}
@Override
public void a(ac acVar) {
an.b.CC.$default$a(this, acVar);
}
@Override
public void a(ak akVar) {
e.this.c("Video view error (" + akVar + ")");
e.this.h();
}
@Override
public void a(am amVar) {
an.b.CC.$default$a(this, amVar);
}
@Override
public void a(an.a aVar) {
an.b.CC.$default$a(this, aVar);
}
@Override
public void a(an.e eVar, an.e eVar2, int i) {
an.b.CC.$default$a(this, eVar, eVar2, i);
}
@Override
public void a(an anVar, an.c cVar) {
an.b.CC.$default$a(this, anVar, cVar);
}
@Override
public void a(ba baVar, int i) {
an.b.CC.$default$a(this, baVar, i);
}
@Override
public void a(ad adVar, h hVar) {
an.b.CC.$default$a(this, adVar, hVar);
}
@Override
@Deprecated
public void a(boolean z, int i) {
an.b.CC.$default$a(this, z, i);
}
@Override
@Deprecated
public void b() {
an.b.CC.$default$b(this);
}
@Override
public void b(int i) {
v vVar = e.this.c;
if (v.a()) {
e.this.c.b("AppLovinFullscreenActivity", "Player state changed to state " + i + " and will play when ready: " + e.this.v.x());
}
if (i == 2) {
e.this.x();
e.this.d.g();
return;
}
if (i != 3) {
if (i == 4) {
v vVar2 = e.this.c;
if (v.a()) {
e.this.c.b("AppLovinFullscreenActivity", "Video completed");
}
e.this.G = true;
if (!e.this.k) {
e.this.A();
return;
} else {
if (e.this.t()) {
e.this.H();
return;
}
return;
}
}
return;
}
e.this.v.a(!e.this.C ? 1 : 0);
e eVar = e.this;
eVar.c(eVar.v.H());
e.this.u();
v vVar3 = e.this.c;
if (v.a()) {
e.this.c.b("AppLovinFullscreenActivity", "MediaPlayer prepared: " + e.this.v);
}
e.this.B.a();
if (e.this.x != null) {
e.this.C();
}
e.this.y();
if (e.this.s.c()) {
e.this.e();
}
}
@Override
public void b(ak akVar) {
an.b.CC.$default$b(this, akVar);
}
@Override
public void b(boolean z, int i) {
an.b.CC.$default$b(this, z, i);
}
@Override
public void b_(boolean z) {
an.b.CC.$default$b_(this, z);
}
@Override
public void c(int i) {
an.b.CC.$default$c(this, i);
}
@Override
@Deprecated
public void c(boolean z) {
an.b.CC.$default$c(this, z);
}
@Override
public void d(int i) {
an.b.CC.$default$d(this, i);
}
@Override
public void d(boolean z) {
an.b.CC.$default$d(this, z);
}
@Override
@Deprecated
public void e(int i) {
an.b.CC.$default$e(this, i);
}
@Override
public void e(boolean z) {
an.b.CC.$default$e(this, z);
}
@Override
public void onClick(View view, PointF pointF) {
e.this.a(pointF);
}
}
private class c implements View.OnClickListener {
private c() {
}
@Override
public void onClick(View view) {
if (view == e.this.x) {
if (!e.this.s()) {
e.this.c();
return;
}
e.this.e();
e.this.p();
e.this.s.b();
return;
}
if (view == e.this.y) {
e.this.z();
return;
}
v vVar = e.this.c;
if (v.a()) {
e.this.c.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
}
}
}
public e(com.applovin.impl.sdk.ad.e eVar, Activity activity, n nVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
super(eVar, activity, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
this.H = new com.applovin.impl.adview.activity.a.c(this.f1237a, this.e, this.b);
this.I = new a();
Handler handler = new Handler(Looper.getMainLooper());
this.J = handler;
this.B = new j(handler, this.b);
this.K = this.f1237a.f();
this.C = Utils.isVideoMutedInitially(this.b);
this.L = -1L;
this.M = new AtomicBoolean();
this.N = new AtomicBoolean();
this.O = -2L;
this.P = 0L;
if (!eVar.hasVideoUrl()) {
throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
}
c cVar = new c();
if (eVar.r() >= 0) {
m mVar = new m(eVar.x(), activity);
this.x = mVar;
mVar.setVisibility(8);
this.x.setOnClickListener(cVar);
} else {
this.x = null;
}
if (a(this.C, nVar)) {
ImageView imageView = new ImageView(activity);
this.y = imageView;
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
this.y.setClickable(true);
this.y.setOnClickListener(cVar);
d(this.C);
} else {
this.y = null;
}
String C = eVar.C();
if (StringUtils.isValidString(C)) {
u uVar = new u(nVar);
uVar.a(new WeakReference<>(this.I));
t tVar = new t(uVar, activity);
this.z = tVar;
tVar.a(C);
} else {
this.z = null;
}
if (this.K) {
com.applovin.impl.adview.a aVar = new com.applovin.impl.adview.a(activity, ((Integer) nVar.a(com.applovin.impl.sdk.c.b.cJ)).intValue(), R.attr.progressBarStyleLarge);
this.w = aVar;
aVar.setColor(Color.parseColor("#75FFFFFF"));
this.w.setBackgroundColor(Color.parseColor("#00000000"));
this.w.setVisibility(8);
AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
} else {
this.w = null;
}
if (eVar.O()) {
ProgressBar progressBar = new ProgressBar(activity, null, R.attr.progressBarStyleHorizontal);
this.A = progressBar;
progressBar.setMax(10000);
this.A.setPadding(0, 0, 0, 0);
if (com.applovin.impl.sdk.utils.h.d()) {
this.A.setProgressTintList(ColorStateList.valueOf(eVar.P()));
}
this.B.a("PROGRESS_BAR", ((Long) nVar.a(com.applovin.impl.sdk.c.b.cG)).longValue(), new j.a() {
@Override
public void a() {
if (e.this.F) {
e.this.A.setVisibility(8);
} else {
e.this.A.setProgress((int) ((((float) e.this.v.I()) / ((float) e.this.D)) * 10000.0f));
}
}
@Override
public boolean b() {
return !e.this.F;
}
});
} else {
this.A = null;
}
this.v = new aw.a(activity).a();
b bVar = new b();
this.v.a((an.b) bVar);
this.v.c(0);
com.applovin.exoplayer2.ui.g gVar = new com.applovin.exoplayer2.ui.g(activity);
this.u = gVar;
gVar.b();
this.u.setControllerVisibilityListener(bVar);
this.u.setPlayer(this.v);
this.u.setOnTouchListener(new AppLovinTouchToClickListener(nVar, com.applovin.impl.sdk.c.b.aV, activity, bVar));
B();
}
private void G() {
t tVar;
s D = this.f1237a.D();
if (D == null || !D.e() || this.F || (tVar = this.z) == null) {
return;
}
final boolean z = tVar.getVisibility() == 4;
final long f = D.f();
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (z) {
r.a(e.this.z, f, (Runnable) null);
} else {
r.b(e.this.z, f, null);
}
}
});
}
public void H() {
this.H.a(this.h);
this.j = SystemClock.elapsedRealtime();
}
private static boolean a(boolean z, n nVar) {
if (!((Boolean) nVar.a(com.applovin.impl.sdk.c.b.cy)).booleanValue()) {
return false;
}
if (!((Boolean) nVar.a(com.applovin.impl.sdk.c.b.cz)).booleanValue() || z) {
return true;
}
return ((Boolean) nVar.a(com.applovin.impl.sdk.c.b.cB)).booleanValue();
}
public void A() {
D();
this.H.a(this.g, this.f);
a("javascript:al_onPoststitialShow(" + this.l + "," + this.m + ");", this.f1237a.S());
if (this.g != null) {
long t = this.f1237a.t();
m mVar = this.g;
if (t >= 0) {
a(mVar, this.f1237a.t(), new Runnable() {
@Override
public void run() {
e.this.j = SystemClock.elapsedRealtime();
}
});
} else {
mVar.setVisibility(0);
}
}
v();
this.F = true;
}
protected void B() {
a(!this.K);
com.applovin.exoplayer2.h.u a2 = new u.a(new p(this.e, ai.a((Context) this.e, "com.applovin.sdk"))).a(ab.a(this.f1237a.h()));
this.v.a(!this.C ? 1 : 0);
this.v.a((com.applovin.exoplayer2.h.p) a2);
this.v.w();
this.v.a(false);
}
protected void C() {
if (this.N.compareAndSet(false, true)) {
a(this.x, this.f1237a.r(), new Runnable() {
@Override
public void run() {
e.this.O = -1L;
e.this.P = SystemClock.elapsedRealtime();
}
});
}
}
protected void D() {
this.E = F();
this.v.a(false);
}
protected void E() {
if (this.F) {
v vVar = this.c;
if (v.a()) {
this.c.d("AppLovinFullscreenActivity", "Skip video resume - postitial shown");
return;
}
return;
}
if (this.b.ag().isApplicationPaused()) {
v vVar2 = this.c;
if (v.a()) {
this.c.d("AppLovinFullscreenActivity", "Skip video resume - app paused");
return;
}
return;
}
long j = this.L;
if (j < 0) {
v vVar3 = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Invalid last video position, isVideoPlaying=" + this.v.a());
return;
}
return;
}
v vVar4 = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Resuming video at position " + j + "ms for MediaPlayer: " + this.v);
}
this.v.a(true);
this.B.a();
this.L = -1L;
if (this.v.a()) {
return;
}
x();
}
public int F() {
aw awVar = this.v;
if (awVar == null) {
return 0;
}
long I = awVar.I();
if (this.G) {
return 100;
}
return I > 0 ? (int) ((((float) I) / ((float) this.D)) * 100.0f) : this.E;
}
@Override
public void a() {
v vVar = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
}
}
@Override
public void a(long j) {
a(new Runnable() {
@Override
public void run() {
e.this.E();
}
}, j);
}
public void a(PointF pointF) {
if (!this.f1237a.E()) {
G();
return;
}
v vVar = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Clicking through video");
}
Uri k = this.f1237a.k();
if (k != null) {
this.b.v().trackAndLaunchVideoClick(this.f1237a, k, pointF, this, this.f != null ? this.f.getContext() : this.b.P());
k.a(this.p, this.f1237a);
this.d.b();
this.m++;
}
}
@Override
public void a(ViewGroup viewGroup) {
this.H.a(this.y, this.x, this.z, this.w, this.A, this.u, this.f, null, viewGroup);
this.v.a(true);
if (this.f1237a.am()) {
this.s.a(this.f1237a, new Runnable() {
@Override
public void run() {
e.this.a(250L);
}
});
}
if (this.K) {
x();
}
SpecialsBridge.appLovinAdViewRenderAd(this.f, this.f1237a);
this.d.b(this.K ? 1L : 0L);
if (this.x != null) {
this.b.V().a(new z(this.b, new Runnable() {
@Override
public void run() {
e.this.C();
}
}), o.a.MAIN, this.f1237a.s(), true);
}
super.b(this.C);
}
@Override
public void b() {
v vVar = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Skipping video from prompt");
}
c();
}
public void c() {
this.O = SystemClock.elapsedRealtime() - this.P;
v vVar = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Skipping video with skip time: " + this.O + "ms");
}
this.d.f();
this.l++;
if (this.f1237a.y()) {
h();
} else {
A();
}
}
public void c(long j) {
this.D = j;
}
public void c(String str) {
v vVar = this.c;
if (v.a()) {
this.c.e("AppLovinFullscreenActivity", "Encountered media error: " + str + " for ad: " + this.f1237a);
}
if (this.M.compareAndSet(false, true)) {
if (this.q instanceof com.applovin.impl.sdk.ad.g) {
((com.applovin.impl.sdk.ad.g) this.q).onAdDisplayFailed(str);
}
h();
}
}
@Override
public void c(boolean z) {
super.c(z);
if (z) {
a(0L);
} else {
if (this.F) {
return;
}
e();
}
}
@Override
public void d() {
a((ViewGroup) null);
}
protected void d(boolean z) {
if (com.applovin.impl.sdk.utils.h.d()) {
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.e.getDrawable(z ? com.applovin.sdk.R.drawable.applovin_ic_unmute_to_mute : com.applovin.sdk.R.drawable.applovin_ic_mute_to_unmute);
if (animatedVectorDrawable != null) {
this.y.setScaleType(ImageView.ScaleType.FIT_XY);
this.y.setImageDrawable(animatedVectorDrawable);
animatedVectorDrawable.start();
return;
}
}
Uri aC = z ? this.f1237a.aC() : this.f1237a.aD();
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
this.y.setImageURI(aC);
StrictMode.setThreadPolicy(allowThreadDiskReads);
}
@Override
public void e() {
v vVar;
String str;
v vVar2 = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Pausing video");
}
if (this.v.a()) {
this.L = this.v.I();
this.v.a(false);
this.B.c();
v vVar3 = this.c;
if (!v.a()) {
return;
}
vVar = this.c;
str = "Paused video at position " + this.L + "ms";
} else {
v vVar4 = this.c;
if (!v.a()) {
return;
}
vVar = this.c;
str = "Nothing to pause";
}
vVar.b("AppLovinFullscreenActivity", str);
}
@Override
public String getCommunicatorId() {
return "FullscreenVideoAdExoPlayerPresenter";
}
@Override
public void h() {
this.B.b();
this.J.removeCallbacksAndMessages(null);
m();
super.h();
}
@Override
public void k() {
this.v.E();
if (this.K) {
AppLovinCommunicator.getInstance(this.e).unsubscribe(this, "video_caching_failed");
}
super.k();
}
@Override
protected void m() {
super.a(F(), this.K, r(), this.O);
}
@Override
public void onMessageReceived(AppLovinCommunicatorMessage appLovinCommunicatorMessage) {
if ("video_caching_failed".equals(appLovinCommunicatorMessage.getTopic())) {
Bundle messageData = appLovinCommunicatorMessage.getMessageData();
long j = messageData.getLong("ad_id");
if (((Boolean) this.b.a(com.applovin.impl.sdk.c.b.eX)).booleanValue() && j == this.f1237a.getAdIdNumber() && this.K) {
int i = messageData.getInt("load_response_code");
String string = messageData.getString("load_exception_message");
if ((string == null && i >= 200 && i < 300) || this.G || this.v.a()) {
return;
}
c("Video cache error during stream. ResponseCode=" + i + ", exception=" + string);
}
}
}
@Override
public boolean r() {
return this.f1237a != null && F() >= this.f1237a.Q();
}
@Override
protected boolean s() {
return t() && !r();
}
@Override
protected void u() {
long j;
int l;
if (this.f1237a.ad() >= 0 || this.f1237a.ae() >= 0) {
long ad = this.f1237a.ad();
com.applovin.impl.sdk.ad.e eVar = this.f1237a;
if (ad >= 0) {
j = eVar.ad();
} else {
com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) eVar;
long j2 = this.D;
long j3 = j2 > 0 ? 0 + j2 : 0L;
if (aVar.af() && ((l = (int) ((com.applovin.impl.sdk.ad.a) this.f1237a).l()) > 0 || (l = (int) aVar.t()) > 0)) {
j3 += TimeUnit.SECONDS.toMillis(l);
}
double d = j3;
double ae = this.f1237a.ae();
Double.isNaN(ae);
Double.isNaN(d);
j = (long) (d * (ae / 100.0d));
}
b(j);
}
}
@Override
public void w() {
super.w();
this.H.a(this.z);
this.H.a((View) this.x);
if (!t() || this.F) {
H();
}
}
public void x() {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (e.this.w != null) {
e.this.w.a();
}
}
});
}
public void y() {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (e.this.w != null) {
e.this.w.b();
}
}
});
}
public void z() {
boolean z = !this.C;
this.C = z;
this.v.a(!z ? 1 : 0);
d(this.C);
a(this.C, 0L);
}
}