Idle Egg Factory v2.1.5版本的 MD5 值为:7d2ba6677008ca521af0101bb927d72a
以下内容为反编译后的 f.java 源代码,内容仅作参考
package com.applovin.impl.adview.activity.b;
import android.R;
import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.media.MediaPlayer;
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.util.Log;
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.impl.adview.AppLovinTouchToClickListener;
import com.applovin.impl.adview.AppLovinVideoView;
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.AppLovinSdkExtraParameterKey;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.Utils;
import com.applovin.impl.sdk.utils.h;
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.analytics.brandsafety.creatives.CreativeInfoManager;
import com.safedk.android.internal.partials.AppLovinVideoBridge;
import com.safedk.android.internal.special.SpecialsBridge;
import com.safedk.android.utils.Logger;
import java.lang.ref.WeakReference;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public class f extends com.applovin.impl.adview.activity.b.a implements AppLovinCommunicatorSubscriber {
protected ImageView A;
protected final j B;
protected boolean C;
protected long D;
protected boolean E;
private final com.applovin.impl.adview.activity.a.c F;
private MediaPlayer G;
private final b H;
private final a I;
private final Handler J;
private final boolean K;
private int L;
private int M;
private boolean N;
private final AtomicBoolean O;
private final AtomicBoolean P;
private long Q;
private long R;
protected final AppLovinVideoView u;
protected final com.applovin.impl.adview.a v;
protected final m w;
protected final ImageView x;
protected final t y;
protected final ProgressBar z;
private class a implements u.a {
private a() {
}
@Override
public void a(t tVar) {
v vVar = f.this.c;
if (v.a()) {
f.this.c.b("AppLovinFullscreenActivity", "Clicking through from video button...");
}
f.this.a(tVar.getAndClearLastClickLocation());
}
@Override
public void b(t tVar) {
v vVar = f.this.c;
if (v.a()) {
f.this.c.b("AppLovinFullscreenActivity", "Closing ad from video button...");
}
f.this.h();
}
@Override
public void c(t tVar) {
v vVar = f.this.c;
if (v.a()) {
f.this.c.b("AppLovinFullscreenActivity", "Skipping video from video button...");
}
f.this.c();
}
}
private class b implements MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener, MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, AppLovinTouchToClickListener.OnClickListener {
private b() {
}
@Override
public void onClick(View view, PointF pointF) {
f.this.a(pointF);
}
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
Logger.d("AppLovin|SafeDK: Execution> Lcom/applovin/impl/adview/activity/b/f$b;->onCompletion(Landroid/media/MediaPlayer;)V");
CreativeInfoManager.onVideoCompleted(com.safedk.android.utils.f.f6887a, mediaPlayer);
safedk_f$b_onCompletion_f3c9649e1b61d3e6546d4a4e14acd82a(mediaPlayer);
}
@Override
public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
f.this.c("Video view error (" + i + "," + i2 + ")");
AppLovinVideoBridge.VideoViewPlay(f.this.u);
return true;
}
@Override
public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
v vVar = f.this.c;
if (v.a()) {
f.this.c.b("AppLovinFullscreenActivity", "MediaPlayer Info: (" + i + ", " + i2 + ")");
}
if (i == 701) {
f.this.x();
f.this.d.g();
return false;
}
if (i != 3) {
if (i != 702) {
return false;
}
f.this.y();
return false;
}
f.this.B.a();
if (f.this.w != null) {
f.this.C();
}
f.this.y();
if (!f.this.s.c()) {
return false;
}
f.this.e();
return false;
}
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
f.this.G = mediaPlayer;
mediaPlayer.setOnInfoListener(f.this.H);
mediaPlayer.setOnErrorListener(f.this.H);
float f = !f.this.C ? 1 : 0;
mediaPlayer.setVolume(f, f);
f.this.c(mediaPlayer.getDuration());
f.this.u();
v vVar = f.this.c;
if (v.a()) {
f.this.c.b("AppLovinFullscreenActivity", "MediaPlayer prepared: " + f.this.G);
}
}
public void safedk_f$b_onCompletion_f3c9649e1b61d3e6546d4a4e14acd82a(MediaPlayer p0) {
v vVar = f.this.c;
if (v.a()) {
f.this.c.b("AppLovinFullscreenActivity", "Video completed");
}
f.this.N = true;
if (!f.this.k) {
f.this.A();
} else if (f.this.t()) {
f.this.F();
}
}
}
private class c implements View.OnClickListener {
private c() {
}
@Override
public void onClick(View view) {
if (view == f.this.w) {
if (!f.this.s()) {
f.this.c();
return;
}
f.this.e();
f.this.p();
f.this.s.b();
return;
}
if (view == f.this.x) {
f.this.z();
return;
}
v vVar = f.this.c;
if (v.a()) {
f.this.c.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
}
}
}
public f(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.F = new com.applovin.impl.adview.activity.a.c(this.f1237a, this.e, this.b);
this.A = null;
this.H = new 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.M = -1;
this.O = new AtomicBoolean();
this.P = new AtomicBoolean();
this.Q = -2L;
this.R = 0L;
if (!eVar.hasVideoUrl()) {
throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
}
AppLovinVideoView appLovinVideoView = new AppLovinVideoView(activity);
this.u = appLovinVideoView;
appLovinVideoView.setOnPreparedListener(this.H);
this.u.setOnCompletionListener(this.H);
this.u.setOnErrorListener(this.H);
this.u.setOnTouchListener(new AppLovinTouchToClickListener(nVar, com.applovin.impl.sdk.c.b.aV, activity, this.H));
c cVar = new c();
if (eVar.r() >= 0) {
m mVar = new m(eVar.x(), activity);
this.w = mVar;
mVar.setVisibility(8);
this.w.setOnClickListener(cVar);
} else {
this.w = null;
}
if (a(this.C, nVar)) {
ImageView imageView = new ImageView(activity);
this.x = imageView;
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
this.x.setClickable(true);
this.x.setOnClickListener(cVar);
e(this.C);
} else {
this.x = 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.y = tVar;
tVar.a(C);
} else {
this.y = 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.v = aVar;
aVar.setColor(Color.parseColor("#75FFFFFF"));
this.v.setBackgroundColor(Color.parseColor("#00000000"));
this.v.setVisibility(8);
AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
} else {
this.v = null;
}
if (!eVar.O()) {
this.z = null;
return;
}
ProgressBar progressBar = new ProgressBar(activity, null, R.attr.progressBarStyleHorizontal);
this.z = progressBar;
progressBar.setMax(10000);
this.z.setPadding(0, 0, 0, 0);
if (h.d()) {
this.z.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 (f.this.E) {
f.this.z.setVisibility(8);
} else {
f.this.z.setProgress((int) ((f.this.u.getCurrentPosition() / ((float) f.this.D)) * 10000.0f));
}
}
@Override
public boolean b() {
return !f.this.E;
}
});
}
public void C() {
if (this.P.compareAndSet(false, true)) {
a(this.w, this.f1237a.r(), new Runnable() {
@Override
public void run() {
f.this.Q = -1L;
f.this.R = SystemClock.elapsedRealtime();
}
});
}
}
private void D() {
t tVar;
s D = this.f1237a.D();
if (D == null || !D.e() || this.E || (tVar = this.y) == 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(f.this.y, f, (Runnable) null);
} else {
r.b(f.this.y, f, null);
}
}
});
}
public void E() {
if (this.E) {
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;
}
if (this.M < 0) {
v vVar3 = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Invalid last video position");
return;
}
return;
}
v vVar4 = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Resuming video at position " + this.M + "ms for MediaPlayer: " + this.G);
}
this.u.seekTo(this.M);
AppLovinVideoBridge.VideoViewPlay(this.u);
this.B.a();
this.M = -1;
a(new Runnable() {
@Override
public void run() {
if (f.this.v != null) {
f.this.v.a();
f.this.a(new Runnable() {
@Override
public void run() {
f.this.v.b();
}
}, 2000L);
}
}
}, 250L);
}
public void F() {
this.F.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();
}
private void d(boolean z) {
this.L = B();
if (z) {
this.u.pause();
} else {
AppLovinVideoBridge.VideoViewStop(this.u);
}
}
private void e(boolean z) {
if (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.x.setScaleType(ImageView.ScaleType.FIT_XY);
this.x.setImageDrawable(animatedVectorDrawable);
animatedVectorDrawable.start();
return;
}
}
Uri aC = z ? this.f1237a.aC() : this.f1237a.aD();
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
this.x.setImageURI(aC);
StrictMode.setThreadPolicy(allowThreadDiskReads);
}
public void A() {
v vVar = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Showing postitial...");
}
d(this.f1237a.aJ());
this.F.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() {
f.this.j = SystemClock.elapsedRealtime();
}
});
} else {
mVar.setVisibility(0);
}
}
v();
this.E = true;
}
public int B() {
long currentPosition = this.u.getCurrentPosition();
if (this.N) {
return 100;
}
return currentPosition > 0 ? (int) ((((float) currentPosition) / ((float) this.D)) * 100.0f) : this.L;
}
@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() {
f.this.E();
}
}, j);
}
public void a(PointF pointF) {
if (!this.f1237a.E()) {
D();
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) {
String str;
this.F.a(this.x, this.w, this.y, this.v, this.z, this.u, this.f, this.A, viewGroup);
if (h.g() && (str = this.b.q().getExtraParameters().get(AppLovinSdkExtraParameterKey.AUDIO_FOCUS_REQUEST)) != null) {
this.u.setAudioFocusRequest(Integer.parseInt(str));
}
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
a(!this.K);
AppLovinVideoBridge.VideoViewSetVideoUri(this.u, this.f1237a.h());
StrictMode.setThreadPolicy(allowThreadDiskReads);
if (this.f1237a.am()) {
this.s.a(this.f1237a, new Runnable() {
@Override
public void run() {
f.this.a(250L);
}
});
}
AppLovinVideoBridge.VideoViewPlay(this.u);
if (this.K) {
x();
}
SpecialsBridge.appLovinAdViewRenderAd(this.f, this.f1237a);
this.d.b(this.K ? 1L : 0L);
if (this.w != null) {
this.b.V().a(new z(this.b, new Runnable() {
@Override
public void run() {
f.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.Q = SystemClock.elapsedRealtime() - this.R;
v vVar = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Skipping video with skip time: " + this.Q + "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.O.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.E) {
return;
}
e();
}
}
@Override
public void d() {
a((ViewGroup) null);
}
@Override
public void e() {
v vVar = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Pausing video");
}
this.M = this.u.getCurrentPosition();
this.u.pause();
this.B.c();
v vVar2 = this.c;
if (v.a()) {
this.c.b("AppLovinFullscreenActivity", "Paused video at position " + this.M + "ms");
}
}
@Override
public String getCommunicatorId() {
return "FullscreenVideoAdPresenter";
}
@Override
public void h() {
this.B.b();
this.J.removeCallbacksAndMessages(null);
m();
super.h();
}
@Override
public void k() {
v vVar = this.c;
if (v.a()) {
this.c.c("AppLovinFullscreenActivity", "Destroying video components");
}
try {
if (this.K) {
AppLovinCommunicator.getInstance(this.e).unsubscribe(this, "video_caching_failed");
}
if (this.u != null) {
this.u.pause();
AppLovinVideoBridge.VideoViewStop(this.u);
}
if (this.G != null) {
this.G.release();
}
} catch (Throwable th) {
Log.e("AppLovinFullscreenActivity", "Unable to destroy presenter", th);
}
super.k();
}
@Override
protected void m() {
super.a(B(), this.K, r(), this.Q);
}
@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.N || this.u.isPlaying()) {
return;
}
c("Video cache error during stream. ResponseCode=" + i + ", exception=" + string);
}
}
}
@Override
public boolean r() {
return B() >= 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.F.a(this.y);
this.F.a((View) this.w);
if (!t() || this.E) {
F();
}
}
public void x() {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (f.this.v != null) {
f.this.v.a();
}
}
});
}
public void y() {
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (f.this.v != null) {
f.this.v.b();
}
}
});
}
public void z() {
if (this.G == null) {
return;
}
try {
float f = !this.C ? 0 : 1;
this.G.setVolume(f, f);
boolean z = this.C ? false : true;
this.C = z;
e(z);
a(this.C, 0L);
} catch (Throwable unused) {
}
}
}