GoooBet v1.0版本的 MD5 值为:ff9748f16167bfd7735b669c0a9931c5
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.applovin.impl.adview.activity.b;
import android.R;
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.widget.ImageView;
import android.widget.ProgressBar;
import com.applovin.adview.AppLovinFullscreenActivity;
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.k;
import com.applovin.impl.adview.n;
import com.applovin.impl.adview.u;
import com.applovin.impl.adview.v;
import com.applovin.impl.adview.w;
import com.applovin.impl.sdk.e.o;
import com.applovin.impl.sdk.e.y;
import com.applovin.impl.sdk.r;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.i;
import com.applovin.impl.sdk.utils.o;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.MediaItem;
import com.google.android.exoplayer2.PlaybackParameters;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.Timeline;
import com.google.android.exoplayer2.metadata.Metadata;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.source.TrackGroupArray;
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
import com.google.android.exoplayer2.ui.PlayerControlView;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
import com.google.android.exoplayer2.util.Util;
import java.lang.ref.WeakReference;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public class e extends com.applovin.impl.adview.activity.b.a implements AppLovinCommunicatorSubscriber {
private final com.applovin.impl.adview.a A;
private final n B;
private final ImageView C;
private final v D;
private final ProgressBar E;
private final a F;
private final Handler G;
private final boolean H;
private long I;
private AtomicBoolean J;
private AtomicBoolean K;
private long L;
private long M;
protected final PlayerView r;
protected final SimpleExoPlayer s;
protected final k t;
protected boolean u;
protected long v;
protected int w;
protected boolean x;
protected boolean y;
private final com.applovin.impl.adview.activity.a.c z;
private class a implements w.a {
private a() {
}
@Override
public void a(v vVar) {
e.this.c.b("InterActivityV2", "Clicking through from video button...");
e.this.a(vVar.getAndClearLastClickLocation());
}
@Override
public void b(v vVar) {
e.this.c.b("InterActivityV2", "Closing ad from video button...");
e.this.g();
}
@Override
public void c(v vVar) {
e.this.c.b("InterActivityV2", "Skipping video from video button...");
e.this.u();
}
}
private class b implements AppLovinTouchToClickListener.OnClickListener, Player.EventListener, PlayerControlView.VisibilityListener {
private b() {
}
@Override
public void onClick(View view, PointF pointF) {
e.this.a(pointF);
}
@Override
public void onEvents(Player player, Player.Events events) {
Player.EventListener.CC.$default$onEvents(this, player, events);
}
@Override
public void onExperimentalOffloadSchedulingEnabledChanged(boolean z) {
Player.EventListener.CC.$default$onExperimentalOffloadSchedulingEnabledChanged(this, z);
}
@Override
public void onExperimentalSleepingForOffloadChanged(boolean z) {
Player.EventListener.CC.$default$onExperimentalSleepingForOffloadChanged(this, z);
}
@Override
public void onIsLoadingChanged(boolean z) {
onLoadingChanged(z);
}
@Override
public void onIsPlayingChanged(boolean z) {
Player.EventListener.CC.$default$onIsPlayingChanged(this, z);
}
@Override
@Deprecated
public void onLoadingChanged(boolean z) {
Player.EventListener.CC.$default$onLoadingChanged(this, z);
}
@Override
public void onMediaItemTransition(MediaItem mediaItem, int i) {
Player.EventListener.CC.$default$onMediaItemTransition(this, mediaItem, i);
}
@Override
public void onPlayWhenReadyChanged(boolean z, int i) {
Player.EventListener.CC.$default$onPlayWhenReadyChanged(this, z, i);
}
@Override
public void onPlaybackParametersChanged(PlaybackParameters playbackParameters) {
Player.EventListener.CC.$default$onPlaybackParametersChanged(this, playbackParameters);
}
@Override
public void onPlaybackStateChanged(int i) {
e.this.c.b("InterActivityV2", "Player state changed to state " + i + " and will play when ready: " + e.this.s.getPlayWhenReady());
if (i == 2) {
if (e.this.A != null) {
e.this.A.a();
}
e.this.e.g();
return;
}
if (i != 3) {
if (i == 4) {
e.this.c.b("InterActivityV2", "Video completed");
e.this.y = true;
e.this.w();
return;
}
return;
}
e.this.s.setVolume(!e.this.u ? 1 : 0);
e eVar = e.this;
eVar.v = eVar.s.getDuration();
e.this.s();
e.this.c.b("InterActivityV2", "MediaPlayer prepared: " + e.this.s);
e.this.t.a();
if (e.this.B != null) {
e.this.y();
}
if (e.this.A != null) {
e.this.A.b();
}
if (e.this.o.d()) {
e.this.c();
}
}
@Override
public void onPlaybackSuppressionReasonChanged(int i) {
Player.EventListener.CC.$default$onPlaybackSuppressionReasonChanged(this, i);
}
@Override
public void onPlayerError(ExoPlaybackException exoPlaybackException) {
e.this.c("Video view error (" + exoPlaybackException + ")");
e.this.g();
}
@Override
@Deprecated
public void onPlayerStateChanged(boolean z, int i) {
Player.EventListener.CC.$default$onPlayerStateChanged(this, z, i);
}
@Override
public void onPositionDiscontinuity(int i) {
Player.EventListener.CC.$default$onPositionDiscontinuity(this, i);
}
@Override
public void onRepeatModeChanged(int i) {
Player.EventListener.CC.$default$onRepeatModeChanged(this, i);
}
@Override
@Deprecated
public void onSeekProcessed() {
Player.EventListener.CC.$default$onSeekProcessed(this);
}
@Override
public void onShuffleModeEnabledChanged(boolean z) {
Player.EventListener.CC.$default$onShuffleModeEnabledChanged(this, z);
}
@Override
public void onStaticMetadataChanged(List<Metadata> list) {
Player.EventListener.CC.$default$onStaticMetadataChanged(this, list);
}
@Override
public void onTimelineChanged(Timeline timeline, int i) {
onTimelineChanged(timeline, timeline.getWindowCount() == 1 ? timeline.getWindow(0, new Timeline.Window()).manifest : null, i);
}
@Override
@Deprecated
public void onTimelineChanged(Timeline timeline, Object obj, int i) {
Player.EventListener.CC.$default$onTimelineChanged(this, timeline, obj, i);
}
@Override
public void onTracksChanged(TrackGroupArray trackGroupArray, TrackSelectionArray trackSelectionArray) {
Player.EventListener.CC.$default$onTracksChanged(this, trackGroupArray, trackSelectionArray);
}
@Override
public void onVisibilityChange(int i) {
if (i == 0) {
e.this.r.hideController();
}
}
}
private class c implements View.OnClickListener {
private c() {
}
@Override
public void onClick(View view) {
if (view == e.this.B) {
if (!e.this.q()) {
e.this.u();
return;
}
e.this.c();
e.this.n();
e.this.o.b();
return;
}
if (view == e.this.C) {
e.this.v();
return;
}
e.this.c.e("InterActivityV2", "Unhandled click on widget: " + view);
}
}
public e(com.applovin.impl.sdk.a.g gVar, AppLovinFullscreenActivity appLovinFullscreenActivity, com.applovin.impl.sdk.k kVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
super(gVar, appLovinFullscreenActivity, kVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
this.z = new com.applovin.impl.adview.activity.a.c(this.f403a, this.d, this.b);
this.F = new a();
Handler handler = new Handler(Looper.getMainLooper());
this.G = handler;
this.t = new k(handler, this.b);
this.H = this.f403a.f();
this.u = t();
this.I = -1L;
this.J = new AtomicBoolean();
this.K = new AtomicBoolean();
this.L = -2L;
this.M = 0L;
if (!gVar.hasVideoUrl()) {
throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
}
c cVar = new c();
if (gVar.s() >= 0) {
n nVar = new n(gVar.w(), appLovinFullscreenActivity);
this.B = nVar;
nVar.setVisibility(8);
this.B.setOnClickListener(cVar);
} else {
this.B = null;
}
if (a(this.u, kVar)) {
ImageView imageView = new ImageView(appLovinFullscreenActivity);
this.C = imageView;
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
this.C.setClickable(true);
this.C.setOnClickListener(cVar);
d(this.u);
} else {
this.C = null;
}
String B = gVar.B();
if (StringUtils.isValidString(B)) {
w wVar = new w(kVar);
wVar.a(new WeakReference<>(this.F));
v vVar = new v(wVar, appLovinFullscreenActivity);
this.D = vVar;
vVar.a(B);
} else {
this.D = null;
}
if (this.H) {
com.applovin.impl.adview.a aVar = new com.applovin.impl.adview.a(appLovinFullscreenActivity, ((Integer) kVar.a(com.applovin.impl.sdk.c.b.cH)).intValue(), R.attr.progressBarStyleLarge);
this.A = aVar;
aVar.setColor(Color.parseColor("#75FFFFFF"));
this.A.setBackgroundColor(Color.parseColor("#00000000"));
this.A.setVisibility(8);
AppLovinCommunicator.getInstance(appLovinFullscreenActivity).subscribe(this, "video_caching_failed");
} else {
this.A = null;
}
if (gVar.N()) {
ProgressBar progressBar = new ProgressBar(appLovinFullscreenActivity, null, R.attr.progressBarStyleHorizontal);
this.E = progressBar;
progressBar.setMax(10000);
this.E.setPadding(0, 0, 0, 0);
if (com.applovin.impl.sdk.utils.f.d()) {
this.E.setProgressTintList(ColorStateList.valueOf(gVar.O()));
}
this.t.a("PROGRESS_BAR", ((Long) kVar.a(com.applovin.impl.sdk.c.b.cC)).longValue(), new k.a() {
@Override
public void a() {
if (e.this.x) {
e.this.E.setVisibility(8);
} else {
e.this.E.setProgress((int) ((((float) e.this.s.getCurrentPosition()) / ((float) e.this.v)) * 10000.0f));
}
}
@Override
public boolean b() {
return !e.this.x;
}
});
} else {
this.E = null;
}
this.s = new SimpleExoPlayer.Builder(appLovinFullscreenActivity).build();
b bVar = new b();
this.s.addListener(bVar);
this.s.setRepeatMode(0);
PlayerView playerView = new PlayerView(appLovinFullscreenActivity);
this.r = playerView;
playerView.hideController();
this.r.setControllerVisibilityListener(bVar);
this.r.setPlayer(this.s);
this.r.setOnTouchListener(new AppLovinTouchToClickListener(kVar, com.applovin.impl.sdk.c.b.aK, appLovinFullscreenActivity, bVar));
x();
}
private void C() {
v vVar;
u C = this.f403a.C();
if (C == null || !C.e() || this.x || (vVar = this.D) == null) {
return;
}
final boolean z = vVar.getVisibility() == 4;
final long f = C.f();
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (z) {
o.a(e.this.D, f, (Runnable) null);
} else {
o.b(e.this.D, f, null);
}
}
});
}
private static boolean a(boolean z, com.applovin.impl.sdk.k kVar) {
if (!((Boolean) kVar.a(com.applovin.impl.sdk.c.b.ct)).booleanValue()) {
return false;
}
if (!((Boolean) kVar.a(com.applovin.impl.sdk.c.b.cu)).booleanValue() || z) {
return true;
}
return ((Boolean) kVar.a(com.applovin.impl.sdk.c.b.cw)).booleanValue();
}
protected void A() {
r rVar;
String str;
if (this.x) {
rVar = this.c;
str = "Skip video resume - postitial shown";
} else {
if (!this.b.ab().a()) {
long j = this.I;
if (j < 0) {
this.c.b("InterActivityV2", "Invalid last video position, isVideoPlaying=" + this.s.isPlaying());
return;
}
long aL = this.f403a.aL();
if (aL > 0) {
j = Math.max(0L, j - aL);
this.s.seekTo(j);
}
this.c.b("InterActivityV2", "Resuming video at position " + j + "ms for MediaPlayer: " + this.s);
this.s.setPlayWhenReady(true);
this.t.a();
this.I = -1L;
if (this.s.isPlaying()) {
return;
}
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public void run() {
if (e.this.A != null) {
e.this.A.a();
}
}
});
return;
}
rVar = this.c;
str = "Skip video resume - app paused";
}
rVar.d("InterActivityV2", str);
}
public int B() {
long currentPosition = this.s.getCurrentPosition();
if (this.y) {
return 100;
}
return currentPosition > 0 ? (int) ((((float) currentPosition) / ((float) this.v)) * 100.0f) : this.w;
}
@Override
public void a() {
this.c.b("InterActivityV2", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
}
public void a(PointF pointF) {
if (!this.f403a.D()) {
C();
return;
}
this.c.b("InterActivityV2", "Clicking through video");
Uri k = this.f403a.k();
if (k != null) {
i.a(this.l, this.f403a);
this.b.t().trackAndLaunchVideoClick(this.f403a, this.f, k, pointF);
this.e.b();
}
}
@Override
public void b() {
this.c.b("InterActivityV2", "Skipping video from prompt");
u();
}
public void b(long j) {
a(new Runnable() {
@Override
public void run() {
e.this.A();
}
}, j);
}
public void c() {
r rVar;
String str;
this.c.b("InterActivityV2", "Pausing video");
if (this.s.isPlaying()) {
this.I = this.s.getCurrentPosition();
this.s.setPlayWhenReady(false);
this.t.c();
rVar = this.c;
str = "Paused video at position " + this.I + "ms";
} else {
rVar = this.c;
str = "Nothing to pause";
}
rVar.b("InterActivityV2", str);
}
public void c(String str) {
this.c.e("InterActivityV2", "Encountered media error: " + str + " for ad: " + this.f403a);
if (this.J.compareAndSet(false, true)) {
if (this.m instanceof com.applovin.impl.sdk.a.i) {
((com.applovin.impl.sdk.a.i) this.m).onAdDisplayFailed(str);
}
g();
}
}
@Override
public void c(boolean z) {
super.c(z);
if (z) {
b(((Boolean) this.b.a(com.applovin.impl.sdk.c.b.eP)).booleanValue() ? 0L : 250L);
} else {
if (this.x) {
return;
}
c();
}
}
@Override
public void d() {
this.z.a(this.C, this.B, this.D, this.A, this.E, this.r, this.f);
this.s.setPlayWhenReady(true);
if (this.f403a.am()) {
this.o.a(this.f403a, new Runnable() {
@Override
public void run() {
e.this.b(250L);
}
});
}
if (this.H) {
this.A.a();
}
this.f.renderAd(this.f403a);
this.e.b(this.H ? 1L : 0L);
if (this.B != null) {
this.b.Q().a((com.applovin.impl.sdk.e.a) new y(this.b, new Runnable() {
@Override
public void run() {
e.this.y();
}
}), o.a.MAIN, this.f403a.t(), true);
}
super.b(this.u);
}
protected void d(boolean z) {
if (com.applovin.impl.sdk.utils.f.d()) {
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.d.getDrawable(z ? com.applovin.sdk.R.drawable.unmute_to_mute : com.applovin.sdk.R.drawable.mute_to_unmute);
if (animatedVectorDrawable != null) {
this.C.setScaleType(ImageView.ScaleType.FIT_XY);
this.C.setImageDrawable(animatedVectorDrawable);
animatedVectorDrawable.start();
return;
}
}
Uri aE = z ? this.f403a.aE() : this.f403a.aF();
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
this.C.setImageURI(aE);
StrictMode.setThreadPolicy(allowThreadDiskReads);
}
@Override
public void g() {
this.t.b();
this.G.removeCallbacksAndMessages(null);
l();
super.g();
}
@Override
public String getCommunicatorId() {
return "FullscreenVideoAdExoPlayerPresenter";
}
@Override
public void i() {
this.s.release();
if (this.H) {
AppLovinCommunicator.getInstance(this.d).unsubscribe(this, "video_caching_failed");
}
super.i();
}
@Override
protected void l() {
super.a(B(), this.H, p(), this.L);
}
@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.eQ)).booleanValue() && j == this.f403a.getAdIdNumber() && this.H) {
int i = messageData.getInt("load_response_code");
String string = messageData.getString("load_exception_message");
if ((string == null && i >= 200 && i < 300) || this.y || this.s.isPlaying()) {
return;
}
c("Video cache error during stream. ResponseCode=" + i + ", exception=" + string);
}
}
}
@Override
public boolean p() {
return B() >= this.f403a.P();
}
@Override
protected boolean q() {
return r() && !p();
}
@Override
protected void s() {
long j;
int l;
if (this.f403a.ac() >= 0 || this.f403a.ad() >= 0) {
long ac = this.f403a.ac();
com.applovin.impl.sdk.a.g gVar = this.f403a;
if (ac >= 0) {
j = gVar.ac();
} else {
com.applovin.impl.sdk.a.a aVar = (com.applovin.impl.sdk.a.a) gVar;
long j2 = this.v;
long j3 = j2 > 0 ? 0 + j2 : 0L;
if (aVar.ae() && ((l = (int) ((com.applovin.impl.sdk.a.a) this.f403a).l()) > 0 || (l = (int) aVar.u()) > 0)) {
j3 += TimeUnit.SECONDS.toMillis(l);
}
double d = j3;
double ad = this.f403a.ad();
Double.isNaN(ad);
Double.isNaN(d);
j = (long) (d * (ad / 100.0d));
}
a(j);
}
}
public void u() {
this.L = SystemClock.elapsedRealtime() - this.M;
this.c.b("InterActivityV2", "Skipping video with skip time: " + this.L + "ms");
this.e.f();
if (this.f403a.x()) {
g();
} else {
w();
}
}
public void v() {
boolean z = !this.u;
this.u = z;
this.s.setVolume(!z ? 1 : 0);
d(this.u);
a(this.u, 0L);
}
public void w() {
z();
this.z.a(this.g, this.f);
a("javascript:al_onPoststitialShow();", this.f403a.R());
if (this.g != null) {
long u = this.f403a.u();
n nVar = this.g;
if (u >= 0) {
a(nVar, this.f403a.u(), new Runnable() {
@Override
public void run() {
e.this.i = SystemClock.elapsedRealtime();
}
});
} else {
nVar.setVisibility(0);
}
}
this.x = true;
}
protected void x() {
a(!this.H);
this.s.setMediaSource(new ProgressiveMediaSource.Factory(new DefaultDataSourceFactory(this.d, Util.getUserAgent(this.d, "com.applovin.sdk"))).createMediaSource(MediaItem.fromUri(this.f403a.h())));
this.s.prepare();
this.s.setPlayWhenReady(false);
}
protected void y() {
if (this.K.compareAndSet(false, true)) {
a(this.B, this.f403a.s(), new Runnable() {
@Override
public void run() {
e.this.L = -1L;
e.this.M = SystemClock.elapsedRealtime();
}
});
}
}
protected void z() {
this.w = B();
this.s.setPlayWhenReady(false);
}
}