Currency Plus v2.10.8版本的 MD5 值为:8586f74edd9ace5aa261a19c9da51484
以下内容为反编译后的 f.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.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.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.impl.adview.AppLovinTouchToClickListener;
import com.applovin.impl.adview.AppLovinVideoView;
import com.applovin.impl.adview.k;
import com.applovin.impl.adview.w;
import com.applovin.impl.adview.x;
import com.applovin.impl.sdk.e.ab;
import com.applovin.impl.sdk.e.q;
import com.applovin.impl.sdk.utils.AppLovinSdkExtraParameterKey;
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.iab.omid.library.applovin.adsession.FriendlyObstructionPurpose;
import j$.util.Objects;
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 f 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 MediaPlayer ajL;
protected final AppLovinVideoView ajM;
private final b ajN;
private final a ajO;
private int ajP;
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 Handler countdownHandler;
protected final com.applovin.impl.adview.k countdownManager;
protected ImageView industryIconImageView;
protected boolean isVideoMuted;
private final boolean isVideoStream;
private final AtomicBoolean mediaErrorHandled;
protected final ImageView muteButtonImageView;
private int savedVideoPercentViewed;
protected long videoDurationMillis;
private boolean videoWasCompleted;
public class a implements x.a {
private a() {
f.this = r1;
}
@Override
public void a(Uri uri, w wVar) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "Attempting to load a url from video button...");
}
s.a(uri, f.this.aiQ.getController(), f.this.sdk);
}
@Override
public void a(w wVar) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "Clicking through from video button...");
}
f.this.a(wVar.getAndClearLastClickEvent(), (Bundle) null);
}
@Override
public void a(w wVar, Bundle bundle) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "Attempting to launch Direct Download from video button...");
}
f.this.a(wVar.getAndClearLastClickEvent(), bundle);
}
@Override
public void b(Uri uri, w wVar) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "Attempting to report a template error from video button...");
}
s.b(uri, f.this.aiQ.getController().getCurrentAd(), f.this.sdk);
}
@Override
public void b(w wVar) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "Closing ad from video button...");
}
f.this.dismiss();
}
@Override
public void c(w wVar) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "Skipping video from video button...");
}
f.this.th();
}
}
public class b implements MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener, MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, AppLovinTouchToClickListener.OnClickListener {
private b() {
f.this = r1;
}
@Override
public void onClick(View view, MotionEvent motionEvent) {
f.this.a(motionEvent, (Bundle) null);
}
@Override
public void onCompletion(MediaPlayer mediaPlayer) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "Video completed");
}
f.this.videoWasCompleted = true;
f fVar = f.this;
if (!fVar.aiY) {
fVar.tc();
} else if (fVar.sK()) {
f.this.sT();
}
}
@Override
public boolean onError(MediaPlayer mediaPlayer, int i10, int i11) {
f.this.handleMediaError(ag.a.m("Video view error (", i10, ",", i11, ")"));
f.this.ajM.start();
return true;
}
@Override
public boolean onInfo(MediaPlayer mediaPlayer, int i10, int i11) {
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", ag.a.m("MediaPlayer Info: (", i10, ", ", i11, ")"));
}
if (i10 == 701) {
f.this.sZ();
f.this.agj.JR();
return false;
} else if (i10 != 3) {
if (i10 == 702) {
f.this.ta();
return false;
}
return false;
} else {
f.this.countdownManager.start();
f fVar = f.this;
if (fVar.ajv != null) {
fVar.te();
}
f.this.ta();
if (f.this.ajh.Jy()) {
f.this.pauseVideo();
return false;
}
return false;
}
}
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
f.this.ajL = mediaPlayer;
mediaPlayer.setOnInfoListener(f.this.ajN);
mediaPlayer.setOnErrorListener(f.this.ajN);
float f10 = !f.this.isVideoMuted ? 1 : 0;
mediaPlayer.setVolume(f10, f10);
f.this.aiZ = (int) TimeUnit.MILLISECONDS.toSeconds(mediaPlayer.getDuration());
f.this.bG(mediaPlayer.getDuration());
f.this.sL();
com.applovin.impl.sdk.x xVar = f.this.logger;
if (com.applovin.impl.sdk.x.Fn()) {
f.this.logger.f("AppLovinFullscreenActivity", "MediaPlayer prepared: " + f.this.ajL);
}
}
}
public class c implements View.OnClickListener {
private c() {
f.this = r1;
}
@Override
public void onClick(View view) {
f fVar = f.this;
if (view == fVar.ajv) {
fVar.th();
} else if (view == fVar.muteButtonImageView) {
fVar.tb();
} else {
com.applovin.impl.sdk.x xVar = fVar.logger;
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar2 = f.this.logger;
xVar2.i("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
}
}
}
}
public f(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);
this.industryIconImageView = null;
b bVar = new b();
this.ajN = bVar;
a aVar = new a();
this.ajO = 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.ajP = -1;
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);
}
AppLovinVideoView appLovinVideoView = new AppLovinVideoView(activity);
this.ajM = appLovinVideoView;
appLovinVideoView.setOnPreparedListener(bVar);
appLovinVideoView.setOnCompletionListener(bVar);
appLovinVideoView.setOnErrorListener(bVar);
appLovinVideoView.setOnTouchListener(new AppLovinTouchToClickListener(nVar, com.applovin.impl.sdk.c.b.aLm, activity, bVar));
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 : false;
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() {
{
f.this = this;
}
@Override
public void rB() {
f fVar = f.this;
if (fVar.ajw != null) {
long seconds = sC - TimeUnit.MILLISECONDS.toSeconds(fVar.ajM.getCurrentPosition());
if (seconds <= 0) {
f.this.aja = true;
} else if (f.this.tg()) {
f.this.ajw.setProgress((int) seconds);
}
}
}
@Override
public boolean rC() {
return f.this.tg();
}
});
}
if (!eVar.GC()) {
this.agb = null;
return;
}
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() {
{
f.this = this;
}
@Override
public void rB() {
f fVar = f.this;
if (fVar.ajC) {
fVar.agb.setVisibility(8);
return;
}
f.this.agb.setProgress((int) ((fVar.ajM.getCurrentPosition() / ((float) f.this.videoDurationMillis)) * num.intValue()));
}
@Override
public boolean rC() {
return !f.this.ajC;
}
});
}
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;
}
private 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);
}
private void aw(boolean z10) {
this.savedVideoPercentViewed = getVideoPercentViewed();
if (z10) {
this.ajM.pause();
} else {
this.ajM.stopPlayback();
}
}
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);
}
public void te() {
if (this.ajD.compareAndSet(false, true)) {
a(this.ajv, this.aiL.Gc(), new p(this, 4));
}
}
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(), 1));
}
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 if (this.ajP < 0) {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Invalid last video position");
}
} else {
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar = this.logger;
xVar.f("AppLovinFullscreenActivity", "Resuming video at position " + this.ajP + "ms for MediaPlayer: " + this.ajL);
}
this.ajM.seekTo(this.ajP);
this.ajM.start();
this.countdownManager.start();
this.ajP = -1;
a(new p(this, 6), 250L);
}
}
public void tn() {
this.ajE = -1L;
this.ajF = SystemClock.elapsedRealtime();
}
public void to() {
this.aiV = SystemClock.elapsedRealtime();
}
public void tp() {
com.applovin.impl.adview.a aVar = this.aju;
if (aVar != null) {
aVar.qO();
}
}
public void tq() {
com.applovin.impl.adview.a aVar = this.aju;
if (aVar != null) {
aVar.qN();
}
}
public void tr() {
com.applovin.impl.adview.a aVar = this.aju;
if (aVar != null) {
aVar.qN();
com.applovin.impl.adview.a aVar2 = this.aju;
Objects.requireNonNull(aVar2);
a(new k(aVar2, 3), 2000L);
}
}
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) {
String str;
this.ajt.a(this.muteButtonImageView, this.ajv, this.ajx, this.aju, this.agb, this.ajw, this.ajM, this.aiQ, this.agn, this.industryIconImageView, viewGroup);
if (com.applovin.impl.sdk.utils.h.La() && (str = this.sdk.getSettings().getExtraParameters().get(AppLovinSdkExtraParameterKey.AUDIO_FOCUS_REQUEST)) != null) {
this.ajM.setAudioFocusRequest(Integer.parseInt(str));
}
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
if (!u.a(com.applovin.impl.sdk.c.b.aMb, this.sdk)) {
checkCachedAdResourcesImmediately(!this.isVideoStream);
}
this.ajM.setVideoURI(this.aiL.FI());
StrictMode.setThreadPolicy(allowThreadDiskReads);
if (this.aiL.Hc()) {
this.ajh.a(this.aiL, new p(this, 0));
}
com.applovin.impl.adview.v vVar = this.agn;
if (vVar != null) {
vVar.sg();
}
this.ajM.start();
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 ab(this.sdk, "scheduleSkipButton", new p(this, 1)), q.b.MAIN, this.aiL.Gd(), true);
}
super.au(this.isVideoMuted);
}
@Override
public void bE(long j10) {
a(new p(this, 3), 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 "FullscreenVideoAdPresenter";
}
public int getVideoPercentViewed() {
long currentPosition = this.ajM.getCurrentPosition();
if (this.videoWasCompleted) {
return 100;
}
return currentPosition > 0 ? (int) ((((float) currentPosition) / ((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 (com.applovin.impl.sdk.x.Fn()) {
this.logger.g("AppLovinFullscreenActivity", "Destroying video components");
}
try {
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;
}
if (this.isVideoStream) {
AppLovinCommunicator.getInstance(this.ahM).unsubscribe(this, "video_caching_failed");
}
AppLovinVideoView appLovinVideoView = this.ajM;
if (appLovinVideoView != null) {
appLovinVideoView.pause();
this.ajM.stopPlayback();
}
MediaPlayer mediaPlayer = this.ajL;
if (mediaPlayer != null) {
mediaPlayer.release();
}
} catch (Throwable th2) {
com.applovin.impl.sdk.x.e("AppLovinFullscreenActivity", "Unable to destroy presenter", th2);
}
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.ajM.isPlaying()) {
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");
}
this.ajP = this.ajM.getCurrentPosition();
this.ajM.pause();
this.countdownManager.W();
if (com.applovin.impl.sdk.x.Fn()) {
com.applovin.impl.sdk.x xVar = this.logger;
xVar.f("AppLovinFullscreenActivity", "Paused video at position " + this.ajP + "ms");
}
}
@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 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 p(this, 2));
}
public void ta() {
AppLovinSdkUtils.runOnUiThread(new p(this, 7));
}
public void tb() {
MediaPlayer mediaPlayer = this.ajL;
if (mediaPlayer == null) {
return;
}
try {
float f10 = this.isVideoMuted ? 1.0f : 0.0f;
mediaPlayer.setVolume(f10, f10);
boolean z10 = !this.isVideoMuted;
this.isVideoMuted = z10;
av(z10);
d(this.isVideoMuted, 0L);
} catch (Throwable unused) {
}
}
public void tc() {
if (com.applovin.impl.sdk.x.Fn()) {
this.logger.f("AppLovinFullscreenActivity", "Showing postitial...");
}
aw(this.aiL.Hy());
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() {
{
f.this = this;
}
@Override
public void rB() {
f.this.ajy.setProgress((int) ((((float) f.this.aiW) / ((float) GH)) * num.intValue()));
f fVar = f.this;
fVar.aiW = l10.longValue() + fVar.aiW;
}
@Override
public boolean rC() {
return f.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 p(this, 5));
} 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 boolean tg() {
return (this.aja || this.ajC || !this.ajM.isPlaying()) ? 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();
}
}