Currency Plus v2.10.8版本的 MD5 值为:8586f74edd9ace5aa261a19c9da51484
以下内容为反编译后的 e.java 源代码,内容仅作参考
package com.applovin.impl.adview.activity.b;
import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.Color;
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.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import com.applovin.adview.AppLovinAdView;
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.c0;
import com.applovin.exoplayer2.h.ad;
import com.applovin.exoplayer2.h.u;
import com.applovin.exoplayer2.l.ai;
import com.applovin.exoplayer2.ui.f;
import com.applovin.impl.adview.AppLovinTouchToClickListener;
import com.applovin.impl.adview.k;
import com.applovin.impl.adview.w;
import com.applovin.impl.adview.x;
import com.applovin.impl.sdk.e.q;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.s;
import com.applovin.impl.sdk.utils.u;
import com.applovin.impl.sdk.utils.v;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
import com.applovin.sdk.R;
import com.google.ads.mediation.applovin.AppLovinMediationAdapter;
import com.iab.omid.library.applovin.adsession.FriendlyObstructionPurpose;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Map;
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 agb;
private final Handler ajA;
protected final com.applovin.impl.adview.k ajB;
protected boolean ajC;
private final AtomicBoolean ajD;
private long ajE;
private long ajF;
private final com.applovin.impl.adview.activity.a.c ajt;
protected final com.applovin.impl.adview.a aju;
protected final com.applovin.impl.adview.n ajv;
protected com.applovin.impl.adview.h ajw;
protected w ajx;
protected ProgressBar ajy;
private final a ajz;
private final Handler countdownHandler;
protected final com.applovin.impl.adview.k countdownManager;
protected boolean isVideoMuted;
private final boolean isVideoStream;
private long lastVideoPositionFromPauseMillis;
private final AtomicBoolean mediaErrorHandled;
protected final aw mediaPlayer;
protected final ImageView muteButtonImageView;
protected int savedVideoPercentViewed;
protected long videoDurationMillis;
protected final com.applovin.exoplayer2.ui.g videoView;
protected boolean videoWasCompleted;
public class a implements x.a {
private a() {
e.this = r1;
}
@Override
public void a(Uri uri, w wVar) {
com.applovin.impl.sdk.x xVar = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
e.this.logger.f("AppLovinFullscreenActivity", "Attempting to load a url from video button...");
}
s.a(uri, e.this.aiQ.getController(), e.this.sdk);
}
@Override
public void a(w wVar) {
com.applovin.impl.sdk.x xVar = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
e.this.logger.f("AppLovinFullscreenActivity", "Clicking through from video button...");
}
e.this.a(wVar.getAndClearLastClickEvent(), (Bundle) null);
}
@Override
public void a(w wVar, Bundle bundle) {
com.applovin.impl.sdk.x xVar = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
e.this.logger.f("AppLovinFullscreenActivity", "Attempting to launch Direct Download from video button...");
}
e.this.a(wVar.getAndClearLastClickEvent(), bundle);
}
@Override
public void b(Uri uri, w wVar) {
com.applovin.impl.sdk.x xVar = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
e.this.logger.f("AppLovinFullscreenActivity", "Attempting to report a template error from video button...");
}
s.b(uri, e.this.aiQ.getController().getCurrentAd(), e.this.sdk);
}
@Override
public void b(w wVar) {
com.applovin.impl.sdk.x xVar = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
e.this.logger.f("AppLovinFullscreenActivity", "Closing ad from video button...");
}
e.this.dismiss();
}
@Override
public void c(w wVar) {
com.applovin.impl.sdk.x xVar = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
e.this.logger.f("AppLovinFullscreenActivity", "Skipping video from video button...");
}
e.this.th();
}
}
public class b implements an.b, f.d, AppLovinTouchToClickListener.OnClickListener {
private b() {
e.this = r1;
}
@Override
public void Z(int i10) {
com.applovin.impl.sdk.x xVar = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar2 = e.this.logger;
StringBuilder v10 = ag.a.v("Player state changed to state ", i10, " and will play when ready: ");
v10.append(e.this.mediaPlayer.aE());
xVar2.f("AppLovinFullscreenActivity", v10.toString());
}
if (i10 == 2) {
e.this.sZ();
e.this.agj.JR();
} else if (i10 != 3) {
if (i10 == 4) {
com.applovin.impl.sdk.x xVar3 = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
e.this.logger.f("AppLovinFullscreenActivity", "Video completed");
}
e eVar = e.this;
eVar.videoWasCompleted = true;
if (!eVar.aiY) {
eVar.tc();
} else if (eVar.sK()) {
e.this.sT();
}
}
} else {
e eVar2 = e.this;
eVar2.mediaPlayer.h(!eVar2.isVideoMuted ? 1 : 0);
e eVar3 = e.this;
eVar3.aiZ = (int) TimeUnit.MILLISECONDS.toSeconds(eVar3.mediaPlayer.aM());
e eVar4 = e.this;
eVar4.bG(eVar4.mediaPlayer.aM());
e.this.sL();
com.applovin.impl.sdk.x xVar4 = e.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar5 = e.this.logger;
xVar5.f("AppLovinFullscreenActivity", "MediaPlayer prepared: " + e.this.mediaPlayer);
}
e.this.countdownManager.start();
e eVar5 = e.this;
if (eVar5.ajv != null) {
eVar5.te();
}
e.this.ta();
if (e.this.ajh.Jy()) {
e.this.pauseVideo();
}
}
}
@Override
public final void a(ab abVar, int i10) {
c0.b(this, abVar, i10);
}
@Override
public final void a(ac acVar) {
c0.c(this, acVar);
}
@Override
public void a(ak akVar) {
e eVar = e.this;
eVar.handleMediaError("Video view error (" + u.a(akVar, e.this.sdk) + ")");
e.this.dismiss();
}
@Override
public final void a(an.e eVar, an.e eVar2, int i10) {
c0.e(this, eVar, eVar2, i10);
}
@Override
public final void a(an anVar, an.c cVar) {
c0.f(this, anVar, cVar);
}
@Override
public final void a(ad adVar, com.applovin.exoplayer2.j.h hVar) {
c0.g(this, adVar, hVar);
}
@Override
public final void aa(int i10) {
c0.h(this, i10);
}
@Override
public final void ab(int i10) {
c0.i(this, i10);
}
@Override
public final void ac(int i10) {
c0.j(this, i10);
}
@Override
public final void b(ak akVar) {
c0.k(this, akVar);
}
@Override
public final void b(am amVar) {
c0.l(this, amVar);
}
@Override
public final void b(ba baVar, int i10) {
c0.m(this, baVar, i10);
}
@Override
public final void cD() {
c0.n(this);
}
@Override
public final void d(an.a aVar) {
c0.o(this, aVar);
}
@Override
public final void d(boolean z10, int i10) {
c0.p(this, z10, i10);
}
@Override
public final void e(boolean z10, int i10) {
c0.q(this, z10, i10);
}
@Override
public void eZ(int i10) {
if (i10 == 0) {
e.this.videoView.nG();
}
}
@Override
public void onClick(View view, MotionEvent motionEvent) {
e.this.a(motionEvent, (Bundle) null);
}
@Override
public final void w(boolean z10) {
c0.r(this, z10);
}
@Override
public final void x(boolean z10) {
c0.s(this, z10);
}
@Override
public final void y(boolean z10) {
c0.t(this, z10);
}
@Override
public final void z(boolean z10) {
c0.u(this, z10);
}
}
public class c implements View.OnClickListener {
private c() {
e.this = r1;
}
@Override
public void onClick(View view) {
e eVar = e.this;
if (view == eVar.ajv) {
eVar.th();
} else if (view == eVar.muteButtonImageView) {
eVar.tb();
} else {
com.applovin.impl.sdk.x xVar = eVar.logger;
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar2 = e.this.logger;
xVar2.i("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
}
}
}
}
public e(com.applovin.impl.sdk.ad.e eVar, Activity activity, Map<String, Object> map, com.applovin.impl.sdk.n nVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
super(eVar, activity, map, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
this.ajt = new com.applovin.impl.adview.activity.a.c(this.aiL, this.ahM, this.sdk);
a aVar = new a();
this.ajz = aVar;
Handler handler = new Handler(Looper.getMainLooper());
this.countdownHandler = handler;
Handler handler2 = new Handler(Looper.getMainLooper());
this.ajA = handler2;
com.applovin.impl.adview.k kVar = new com.applovin.impl.adview.k(handler, this.sdk);
this.countdownManager = kVar;
this.ajB = new com.applovin.impl.adview.k(handler2, this.sdk);
boolean FF = this.aiL.FF();
this.isVideoStream = FF;
this.isVideoMuted = u.P(this.sdk);
this.lastVideoPositionFromPauseMillis = -1L;
this.mediaErrorHandled = new AtomicBoolean();
this.ajD = new AtomicBoolean();
this.ajE = -2L;
this.ajF = 0L;
if (!eVar.hasVideoUrl()) {
throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
}
if (u.a(com.applovin.impl.sdk.c.b.aMb, nVar)) {
checkCachedAdResourcesAsync(!FF);
}
c cVar = new c();
if (eVar.Gc() >= 0) {
com.applovin.impl.adview.n nVar2 = new com.applovin.impl.adview.n(eVar.Gj(), activity);
this.ajv = nVar2;
nVar2.setVisibility(8);
nVar2.setOnClickListener(cVar);
} else {
this.ajv = null;
}
boolean z10 = true;
if (a(this.isVideoMuted, nVar)) {
ImageView imageView = new ImageView(activity);
this.muteButtonImageView = imageView;
imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
imageView.setClickable(true);
imageView.setOnClickListener(cVar);
av(this.isVideoMuted);
} else {
this.muteButtonImageView = null;
}
String Go = eVar.Go();
if (StringUtils.isValidString(Go)) {
x xVar = new x(nVar);
xVar.a(new WeakReference<>(aVar));
w wVar = new w(xVar, activity);
this.ajx = wVar;
wVar.bs(Go);
} else {
this.ajx = null;
}
if (FF) {
com.applovin.impl.adview.a aVar2 = new com.applovin.impl.adview.a(activity, ((Integer) nVar.a(com.applovin.impl.sdk.c.b.aNp)).intValue(), 16842874);
this.aju = aVar2;
aVar2.setColor(Color.parseColor("#75FFFFFF"));
aVar2.setBackgroundColor(Color.parseColor("#00000000"));
aVar2.setVisibility(8);
AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
} else {
this.aju = null;
}
final int sC = sC();
z10 = (!((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aMZ)).booleanValue() || sC <= 0) ? false : z10;
if (this.ajw == null && z10) {
this.ajw = new com.applovin.impl.adview.h(activity);
int Gu = eVar.Gu();
this.ajw.setTextColor(Gu);
this.ajw.setTextSize(((Integer) nVar.a(com.applovin.impl.sdk.c.b.aMY)).intValue());
this.ajw.setFinishedStrokeColor(Gu);
this.ajw.setFinishedStrokeWidth(((Integer) nVar.a(com.applovin.impl.sdk.c.b.aMX)).intValue());
this.ajw.setMax(sC);
this.ajw.setProgress(sC);
kVar.a("COUNTDOWN_CLOCK", TimeUnit.SECONDS.toMillis(1L), new k.a() {
{
e.this = this;
}
@Override
public void rB() {
e eVar2 = e.this;
if (eVar2.ajw != null) {
long seconds = sC - TimeUnit.MILLISECONDS.toSeconds(eVar2.videoView.getPlayer().aN());
if (seconds <= 0) {
e.this.aja = true;
} else if (e.this.tg()) {
e.this.ajw.setProgress((int) seconds);
}
}
}
@Override
public boolean rC() {
return e.this.tg();
}
});
}
if (eVar.GC()) {
final Integer num = (Integer) nVar.a(com.applovin.impl.sdk.c.b.aNn);
ProgressBar progressBar = new ProgressBar(activity, null, 16842872);
this.agb = progressBar;
a(progressBar, eVar.GD(), num.intValue());
kVar.a("PROGRESS_BAR", ((Long) nVar.a(com.applovin.impl.sdk.c.b.aNm)).longValue(), new k.a() {
{
e.this = this;
}
@Override
public void rB() {
e eVar2 = e.this;
if (eVar2.ajC) {
eVar2.agb.setVisibility(8);
return;
}
e.this.agb.setProgress((int) ((((float) eVar2.mediaPlayer.aN()) / ((float) e.this.videoDurationMillis)) * num.intValue()));
}
@Override
public boolean rC() {
return !e.this.ajC;
}
});
} else {
this.agb = null;
}
aw cY = new aw.a(activity).cY();
this.mediaPlayer = cY;
b bVar = new b();
cY.f(bVar);
cY.u(0);
com.applovin.exoplayer2.ui.g gVar = new com.applovin.exoplayer2.ui.g(activity);
this.videoView = gVar;
gVar.nG();
gVar.setControllerVisibilityListener(bVar);
gVar.setPlayer(cY);
gVar.setOnTouchListener(new AppLovinTouchToClickListener(nVar, com.applovin.impl.sdk.c.b.aLm, activity, bVar));
prepareMediaPlayer();
}
private void a(ProgressBar progressBar, int i10, int i11) {
progressBar.setMax(i11);
progressBar.setPadding(0, 0, 0, 0);
if (com.applovin.impl.sdk.utils.h.KX()) {
progressBar.setProgressTintList(ColorStateList.valueOf(i10));
}
}
private static boolean a(boolean z10, com.applovin.impl.sdk.n nVar) {
if (((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aNe)).booleanValue()) {
if (!((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aNf)).booleanValue() || z10) {
return true;
}
return ((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aNh)).booleanValue();
}
return false;
}
public void e(boolean z10, long j10) {
if (z10) {
v.a(this.ajx, j10, null);
} else {
v.b(this.ajx, j10, null);
}
}
public void sT() {
this.ajt.a(this.aiS);
this.aiV = SystemClock.elapsedRealtime();
}
public void sX() {
bE(250L);
}
private void tf() {
w wVar;
com.applovin.impl.adview.u Gp = this.aiL.Gp();
if (Gp == null || !Gp.sa() || this.ajC || (wVar = this.ajx) == null) {
return;
}
AppLovinSdkUtils.runOnUiThread(new o(this, wVar.getVisibility() == 4, Gp.sb(), 0));
}
public void tk() {
this.aiV = SystemClock.elapsedRealtime();
}
public void tl() {
com.applovin.impl.adview.a aVar = this.aju;
if (aVar != null) {
aVar.qO();
}
}
public void tm() {
com.applovin.impl.adview.a aVar = this.aju;
if (aVar != null) {
aVar.qN();
}
}
public void tn() {
this.ajE = -1L;
this.ajF = SystemClock.elapsedRealtime();
}
public void a(MotionEvent motionEvent, Bundle bundle) {
if (!this.aiL.Gq()) {
tf();
return;
}
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Clicking through video");
}
Uri FL = this.aiL.FL();
if (FL != null) {
AppLovinAdView appLovinAdView = this.aiQ;
this.sdk.BD().trackAndLaunchVideoClick(this.aiL, FL, motionEvent, bundle, this, appLovinAdView != null ? appLovinAdView.getContext() : com.applovin.impl.sdk.n.getApplicationContext());
com.applovin.impl.sdk.utils.m.a(this.agC, this.aiL);
this.agj.JN();
this.aje++;
}
}
@Override
public void a(ViewGroup viewGroup) {
this.ajt.a(this.muteButtonImageView, this.ajv, this.ajx, this.aju, this.agb, this.ajw, this.videoView, this.aiQ, this.agn, null, viewGroup);
com.applovin.impl.adview.v vVar = this.agn;
if (vVar != null) {
vVar.sg();
}
this.mediaPlayer.k(true);
if (this.aiL.Hc()) {
this.ajh.a(this.aiL, new n(this, 5));
}
if (this.isVideoStream) {
sZ();
}
this.aiQ.renderAd(this.aiL);
this.agj.bT(this.isVideoStream ? 1L : 0L);
if (this.ajv != null) {
this.sdk.BO().a(new com.applovin.impl.sdk.e.ab(this.sdk, "scheduleSkipButton", new n(this, 6)), q.b.MAIN, this.aiL.Gd(), true);
}
super.au(this.isVideoMuted);
}
public void av(boolean z10) {
if (com.applovin.impl.sdk.utils.h.KX()) {
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.ahM.getDrawable(z10 ? R.drawable.applovin_ic_unmute_to_mute : R.drawable.applovin_ic_mute_to_unmute);
if (animatedVectorDrawable != null) {
this.muteButtonImageView.setScaleType(ImageView.ScaleType.FIT_XY);
this.muteButtonImageView.setImageDrawable(animatedVectorDrawable);
animatedVectorDrawable.start();
return;
}
}
Uri Hv = z10 ? this.aiL.Hv() : this.aiL.Hw();
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
this.muteButtonImageView.setImageURI(Hv);
StrictMode.setThreadPolicy(allowThreadDiskReads);
}
@Override
public void bE(long j10) {
a(new n(this, 2), j10);
}
public void bG(long j10) {
this.videoDurationMillis = j10;
}
@Override
public void dismiss() {
this.countdownManager.rA();
this.ajB.rA();
this.countdownHandler.removeCallbacksAndMessages(null);
this.ajA.removeCallbacksAndMessages(null);
sD();
super.dismiss();
}
@Override
public String getCommunicatorId() {
return "FullscreenVideoAdExoPlayerPresenter";
}
public int getVideoPercentViewed() {
aw awVar = this.mediaPlayer;
if (awVar == null) {
return 0;
}
long aN = awVar.aN();
if (this.videoWasCompleted) {
return 100;
}
return aN > 0 ? (int) ((((float) aN) / ((float) this.videoDurationMillis)) * 100.0f) : this.savedVideoPercentViewed;
}
public void handleMediaError(String str) {
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar = this.logger;
StringBuilder s10 = android.support.v4.media.a.s("Encountered media error: ", str, " for ad: ");
s10.append(this.aiL);
xVar.i("AppLovinFullscreenActivity", s10.toString());
}
if (this.mediaErrorHandled.compareAndSet(false, true)) {
if (u.a(com.applovin.impl.sdk.c.b.aLV, this.sdk)) {
this.sdk.Cc().c(this.aiL, com.applovin.impl.sdk.n.getApplicationContext());
}
AppLovinAdDisplayListener appLovinAdDisplayListener = this.agA;
if (appLovinAdDisplayListener instanceof com.applovin.impl.sdk.ad.h) {
((com.applovin.impl.sdk.ad.h) appLovinAdDisplayListener).onAdDisplayFailed(str);
}
dismiss();
}
}
@Override
public void onDestroy() {
if (((Boolean) this.sdk.a(com.applovin.impl.sdk.c.b.aQM)).booleanValue()) {
com.applovin.impl.sdk.utils.x.k(this.ajx);
this.ajx = null;
}
this.mediaPlayer.release();
if (this.isVideoStream) {
AppLovinCommunicator.getInstance(this.ahM).unsubscribe(this, "video_caching_failed");
}
super.onDestroy();
}
@Override
public void onMessageReceived(AppLovinCommunicatorMessage appLovinCommunicatorMessage) {
if ("video_caching_failed".equals(appLovinCommunicatorMessage.getTopic())) {
Bundle messageData = appLovinCommunicatorMessage.getMessageData();
if (messageData.getLong("ad_id") == this.aiL.getAdIdNumber() && this.isVideoStream) {
int i10 = messageData.getInt("load_response_code");
String string = messageData.getString("load_exception_message");
if ((string == null && i10 >= 200 && i10 < 300) || this.videoWasCompleted || this.mediaPlayer.v()) {
return;
}
handleMediaError("Video cache error during stream. ResponseCode=" + i10 + ", exception=" + string);
}
}
}
@Override
public void onWindowFocusChanged(boolean z10) {
super.onWindowFocusChanged(z10);
if (z10) {
bE(0L);
if (this.ajC) {
this.ajB.start();
}
} else if (this.ajC) {
this.ajB.W();
} else {
pauseVideo();
}
}
@Override
public void pauseVideo() {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Pausing video");
}
if (!this.mediaPlayer.v()) {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Nothing to pause");
return;
}
return;
}
this.lastVideoPositionFromPauseMillis = this.mediaPlayer.aN();
this.mediaPlayer.k(false);
this.countdownManager.W();
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", ag.a.q(new StringBuilder("Paused video at position "), this.lastVideoPositionFromPauseMillis, "ms"));
}
}
public void prepareMediaPlayer() {
if (!u.a(com.applovin.impl.sdk.c.b.aMb, this.sdk)) {
checkCachedAdResourcesImmediately(!this.isVideoStream);
}
Activity activity = this.ahM;
com.applovin.exoplayer2.h.u c10 = new u.a(new com.applovin.exoplayer2.k.p(activity, ai.a(activity, AppLovinMediationAdapter.APPLOVIN_SDK_ERROR_DOMAIN))).c(ab.a(this.aiL.FI()));
this.mediaPlayer.h(!this.isVideoMuted ? 1 : 0);
this.mediaPlayer.a(c10);
this.mediaPlayer.aD();
this.mediaPlayer.k(false);
}
@Override
public void rl() {
super.rl();
sT();
}
@Override
public void sA() {
a((ViewGroup) null);
}
@Override
public void sD() {
super.a(getVideoPercentViewed(), this.isVideoStream, sI(), this.ajE);
}
@Override
public boolean sI() {
return this.aiL != null && getVideoPercentViewed() >= this.aiL.GE();
}
@Override
public boolean sJ() {
return sK() && !sI();
}
@Override
public void sL() {
long GU;
long millis;
if (this.aiL.GT() >= 0 || this.aiL.GU() >= 0) {
if (this.aiL.GT() >= 0) {
GU = this.aiL.GT();
} else {
com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) this.aiL;
long j10 = this.videoDurationMillis;
long j11 = j10 > 0 ? j10 : 0L;
if (aVar.GV()) {
int FM = (int) ((com.applovin.impl.sdk.ad.a) this.aiL).FM();
if (FM > 0) {
millis = TimeUnit.SECONDS.toMillis(FM);
} else {
int Ge = (int) aVar.Ge();
if (Ge > 0) {
millis = TimeUnit.SECONDS.toMillis(Ge);
}
}
j11 += millis;
}
GU = (long) ((this.aiL.GU() / 100.0d) * j11);
}
bF(GU);
}
}
@Override
public void sN() {
super.sN();
this.ajt.k(this.ajx);
this.ajt.k(this.ajv);
if (!sK() || this.ajC) {
sT();
}
}
@Override
public void sR() {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
}
}
@Override
public void sS() {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Skipping video from prompt");
}
sY();
}
public void sY() {
this.ajd++;
this.agj.JQ();
if (this.aiL.Gk()) {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Dismissing ad on video skip...");
}
dismiss();
return;
}
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Skipping video...");
}
tc();
}
public void sZ() {
AppLovinSdkUtils.runOnUiThread(new n(this, 4));
}
public void ta() {
AppLovinSdkUtils.runOnUiThread(new n(this, 1));
}
public void tb() {
boolean z10 = this.isVideoMuted;
this.isVideoMuted = !z10 ? 1 : 0;
this.mediaPlayer.h(z10 ? 1.0f : 0.0f);
av(this.isVideoMuted);
d(this.isVideoMuted, 0L);
}
public void tc() {
ti();
final long GH = this.aiL.GH();
if (GH > 0) {
this.aiW = 0L;
final Long l10 = (Long) this.sdk.a(com.applovin.impl.sdk.c.b.aNv);
final Integer num = (Integer) this.sdk.a(com.applovin.impl.sdk.c.b.aNy);
ProgressBar progressBar = new ProgressBar(this.ahM, null, 16842872);
this.ajy = progressBar;
a(progressBar, this.aiL.GG(), num.intValue());
this.ajB.a("POSTITIAL_PROGRESS_BAR", l10.longValue(), new k.a() {
{
e.this = this;
}
@Override
public void rB() {
e.this.ajy.setProgress((int) ((((float) e.this.aiW) / ((float) GH)) * num.intValue()));
e eVar = e.this;
eVar.aiW = l10.longValue() + eVar.aiW;
}
@Override
public boolean rC() {
return e.this.aiW < GH;
}
});
this.ajB.start();
}
this.ajt.a(this.aiR, this.agn, this.aiQ, this.ajy);
StringBuilder sb2 = new StringBuilder("javascript:al_onPoststitialShow(");
sb2.append(this.ajd);
sb2.append(",");
d(android.support.v4.media.a.p(sb2, this.aje, ");"), this.aiL.GI());
if (this.aiR != null) {
if (this.aiL.Ge() >= 0) {
a(this.aiR, this.aiL.Ge(), new n(this, 3));
} else {
this.aiR.setVisibility(0);
}
}
ArrayList arrayList = new ArrayList();
com.applovin.impl.adview.n nVar = this.aiR;
if (nVar != null) {
arrayList.add(new com.applovin.impl.sdk.a.d(nVar, FriendlyObstructionPurpose.CLOSE_AD, "close button"));
}
com.applovin.impl.adview.v vVar = this.agn;
if (vVar != null && vVar.sh()) {
com.applovin.impl.adview.v vVar2 = this.agn;
arrayList.add(new com.applovin.impl.sdk.a.d(vVar2, FriendlyObstructionPurpose.NOT_VISIBLE, vVar2.getIdentifier()));
}
ProgressBar progressBar2 = this.ajy;
if (progressBar2 != null) {
arrayList.add(new com.applovin.impl.sdk.a.d(progressBar2, FriendlyObstructionPurpose.OTHER, "postitial progress bar"));
}
this.aiL.getAdEventTracker().a(this.aiQ, arrayList);
sM();
this.ajC = true;
}
public void te() {
if (this.ajD.compareAndSet(false, true)) {
a(this.ajv, this.aiL.Gc(), new n(this, 0));
}
}
public boolean tg() {
return (this.aja || this.ajC || !this.videoView.getPlayer().v()) ? false : true;
}
public void th() {
this.ajE = SystemClock.elapsedRealtime() - this.ajF;
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", ag.a.q(new StringBuilder("Attempting to skip video with skip time: "), this.ajE, "ms"));
}
if (!sJ()) {
sY();
return;
}
pauseVideo();
sG();
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Prompting incentivized ad close warning");
}
this.ajh.Jx();
}
public void ti() {
this.savedVideoPercentViewed = getVideoPercentViewed();
this.mediaPlayer.k(false);
}
public void tj() {
if (this.ajC) {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.h("AppLovinFullscreenActivity", "Skip video resume - postitial shown");
}
} else if (this.sdk.Ce().isApplicationPaused()) {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.h("AppLovinFullscreenActivity", "Skip video resume - app paused");
}
} else {
long j10 = this.lastVideoPositionFromPauseMillis;
if (j10 < 0) {
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar = this.logger;
xVar.f("AppLovinFullscreenActivity", "Invalid last video position, isVideoPlaying=" + this.mediaPlayer.v());
return;
}
return;
}
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar2 = this.logger;
StringBuilder p10 = ag.d.p("Resuming video at position ", j10, "ms for MediaPlayer: ");
p10.append(this.mediaPlayer);
xVar2.f("AppLovinFullscreenActivity", p10.toString());
}
this.mediaPlayer.k(true);
this.countdownManager.start();
this.lastVideoPositionFromPauseMillis = -1L;
if (this.mediaPlayer.v()) {
return;
}
sZ();
}
}
}