Picsart v24.6版本的 MD5 值为:21a61631d94e54da68d2ad9268b8b9d9
以下内容为反编译后的 f.java 源代码,内容仅作参考
package com.applovin.impl.adview.activity.b;
import android.annotation.SuppressLint;
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.activity.b.f;
import com.applovin.impl.adview.k;
import com.applovin.impl.adview.p;
import com.applovin.impl.adview.w;
import com.applovin.impl.adview.y;
import com.applovin.impl.adview.z;
import com.applovin.impl.sdk.e.ab;
import com.applovin.impl.sdk.e.q;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.AppLovinSdkExtraParameterKey;
import com.applovin.impl.sdk.utils.ImageViewUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.l;
import com.applovin.impl.sdk.utils.r;
import com.applovin.impl.sdk.utils.t;
import com.applovin.impl.sdk.utils.u;
import com.applovin.impl.sdk.x;
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 java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Map;
import java.util.Objects;
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;
protected com.applovin.impl.adview.h ajA;
protected y ajB;
protected ProgressBar ajC;
private final Handler ajE;
protected final k ajF;
protected boolean ajG;
private final AtomicBoolean ajH;
private long ajI;
private long ajJ;
private MediaPlayer ajP;
protected final AppLovinVideoView ajQ;
private final b ajR;
private final a ajS;
private int ajT;
private final com.applovin.impl.adview.activity.a.c ajx;
protected final com.applovin.impl.adview.a ajy;
protected final p ajz;
private final Handler countdownHandler;
protected final 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 z.a {
private a() {
f.this = r1;
}
@Override
public void a(Uri uri, y yVar) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Attempting to load a url from video button...");
}
r.a(uri, f.this.aiT.getController(), f.this.sdk);
}
@Override
public void a(y yVar) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Clicking through from video button...");
}
f.this.a(yVar.getAndClearLastClickEvent(), (Bundle) null);
}
@Override
public void a(y yVar, Bundle bundle) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Attempting to launch Direct Download from video button...");
}
f.this.a(yVar.getAndClearLastClickEvent(), bundle);
}
@Override
public void b(Uri uri, y yVar) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Attempting to report a template error from video button...");
}
r.b(uri, f.this.aiT.getController().getCurrentAd(), f.this.sdk);
}
@Override
public void b(y yVar) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Closing ad from video button...");
}
f.this.dismiss();
}
@Override
public void c(y yVar) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Skipping video from video button...");
}
f.this.tr();
}
@Override
public void d(y yVar) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Fully Watched from video button...");
}
f.this.ajm = true;
}
}
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) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "Video completed");
}
f.this.videoWasCompleted = true;
f fVar = f.this;
if (!fVar.ajb) {
fVar.tm();
} else if (fVar.sS()) {
f.this.tc();
}
}
@Override
public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
f.this.handleMediaError(defpackage.a.h("Video view error (", i, ",", i2, ")"));
f.this.ajQ.start();
return true;
}
@Override
public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", defpackage.a.h("MediaPlayer Info: (", i, ", ", i2, ")"));
}
if (i == 701) {
f.this.tj();
return false;
} else if (i != 3) {
if (i == 702) {
f.this.tk();
return false;
}
return false;
} else {
f.this.countdownManager.start();
f fVar = f.this;
if (fVar.ajz != null) {
fVar.to();
}
f.this.tk();
if (f.this.ajk.Kx()) {
f.this.pauseVideo();
return false;
}
return false;
}
}
@Override
public void onPrepared(MediaPlayer mediaPlayer) {
f.this.ajP = mediaPlayer;
mediaPlayer.setOnInfoListener(f.this.ajR);
mediaPlayer.setOnErrorListener(f.this.ajR);
float f = !f.this.isVideoMuted ? 1 : 0;
mediaPlayer.setVolume(f, f);
f.this.ajc = (int) TimeUnit.MILLISECONDS.toSeconds(mediaPlayer.getDuration());
f.this.bG(mediaPlayer.getDuration());
f.this.sT();
x xVar = f.this.logger;
if (x.FL()) {
f.this.logger.f("AppLovinFullscreenActivity", "MediaPlayer prepared: " + f.this.ajP);
}
}
}
public class c implements View.OnClickListener {
private c() {
f.this = r1;
}
@Override
public void onClick(View view) {
f fVar = f.this;
if (view == fVar.ajz) {
fVar.tr();
} else if (view == fVar.muteButtonImageView) {
fVar.tl();
} else {
x xVar = fVar.logger;
if (x.FL()) {
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, n nVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
super(eVar, activity, map, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
this.ajx = new com.applovin.impl.adview.activity.a.c(this.aiO, this.ahP, this.sdk);
this.industryIconImageView = null;
b bVar = new b();
this.ajR = bVar;
a aVar = new a();
this.ajS = aVar;
Handler handler = new Handler(Looper.getMainLooper());
this.countdownHandler = handler;
Handler handler2 = new Handler(Looper.getMainLooper());
this.ajE = handler2;
k kVar = new k(handler, this.sdk);
this.countdownManager = kVar;
this.ajF = new k(handler2, this.sdk);
boolean Gj = this.aiO.Gj();
this.isVideoStream = Gj;
this.isVideoMuted = t.S(this.sdk);
this.ajT = -1;
this.mediaErrorHandled = new AtomicBoolean();
this.ajH = new AtomicBoolean();
this.ajI = -2L;
this.ajJ = 0L;
if (!eVar.hasVideoUrl()) {
throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
}
if (t.a(com.applovin.impl.sdk.c.b.aNG, nVar)) {
checkCachedAdResourcesAsync(!Gj);
}
AppLovinVideoView appLovinVideoView = new AppLovinVideoView(activity);
this.ajQ = appLovinVideoView;
appLovinVideoView.setOnPreparedListener(bVar);
appLovinVideoView.setOnCompletionListener(bVar);
appLovinVideoView.setOnErrorListener(bVar);
appLovinVideoView.setOnTouchListener(new AppLovinTouchToClickListener(nVar, com.applovin.impl.sdk.c.b.aMQ, activity, bVar));
c cVar = new c();
if (eVar.GG() >= 0) {
p pVar = new p(eVar.GN(), activity);
this.ajz = pVar;
pVar.setVisibility(8);
pVar.setOnClickListener(cVar);
} else {
this.ajz = null;
}
boolean z = 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 GU = eVar.GU();
if (StringUtils.isValidString(GU)) {
z zVar = new z(nVar);
zVar.a(new WeakReference<>(aVar));
y yVar = new y(eVar.HX(), eVar, zVar, activity);
this.ajB = yVar;
yVar.bt(GU);
} else {
this.ajB = null;
}
if (Gj) {
com.applovin.impl.adview.a aVar2 = new com.applovin.impl.adview.a(activity, ((Integer) nVar.a(com.applovin.impl.sdk.c.b.aOT)).intValue(), 16842874);
this.ajy = aVar2;
aVar2.setColor(Color.parseColor("#75FFFFFF"));
aVar2.setBackgroundColor(Color.parseColor("#00000000"));
aVar2.setVisibility(8);
AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
} else {
this.ajy = null;
}
final int sK = sK();
z = (!((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aOD)).booleanValue() || sK <= 0) ? false : false;
if (this.ajA == null && z) {
this.ajA = new com.applovin.impl.adview.h(activity);
int Hb = eVar.Hb();
this.ajA.setTextColor(Hb);
this.ajA.setTextSize(((Integer) nVar.a(com.applovin.impl.sdk.c.b.aOC)).intValue());
this.ajA.setFinishedStrokeColor(Hb);
this.ajA.setFinishedStrokeWidth(((Integer) nVar.a(com.applovin.impl.sdk.c.b.aOB)).intValue());
this.ajA.setMax(sK);
this.ajA.setProgress(sK);
kVar.a("COUNTDOWN_CLOCK", TimeUnit.SECONDS.toMillis(1L), new k.a() {
{
f.this = this;
}
@Override
public void rw() {
f fVar = f.this;
if (fVar.ajA != null) {
long seconds = sK - TimeUnit.MILLISECONDS.toSeconds(fVar.ajQ.getCurrentPosition());
if (seconds <= 0) {
f.this.ajd = true;
} else if (f.this.tq()) {
f.this.ajA.setProgress((int) seconds);
}
}
}
@Override
public boolean rx() {
return f.this.tq();
}
});
}
if (!eVar.Hk()) {
this.agb = null;
return;
}
final Integer num = (Integer) nVar.a(com.applovin.impl.sdk.c.b.aOR);
ProgressBar progressBar = new ProgressBar(activity, null, 16842872);
this.agb = progressBar;
a(progressBar, eVar.Hl(), num.intValue());
kVar.a("PROGRESS_BAR", ((Long) nVar.a(com.applovin.impl.sdk.c.b.aOQ)).longValue(), new k.a() {
{
f.this = this;
}
@Override
public void rw() {
f fVar = f.this;
if (fVar.ajG) {
fVar.agb.setVisibility(8);
return;
}
f.this.agb.setProgress((int) ((fVar.ajQ.getCurrentPosition() / ((float) f.this.videoDurationMillis)) * num.intValue()));
}
@Override
public boolean rx() {
return !f.this.ajG;
}
});
}
private void a(ProgressBar progressBar, int i, int i2) {
progressBar.setMax(i2);
progressBar.setPadding(0, 0, 0, 0);
if (com.applovin.impl.sdk.utils.h.LQ()) {
progressBar.setProgressTintList(ColorStateList.valueOf(i));
}
}
private static boolean a(boolean z, n nVar) {
if (((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aOI)).booleanValue()) {
if (!((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aOJ)).booleanValue() || z) {
return true;
}
return ((Boolean) nVar.a(com.applovin.impl.sdk.c.b.aOL)).booleanValue();
}
return false;
}
private void av(boolean z) {
if (com.applovin.impl.sdk.utils.h.LQ()) {
AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.ahP.getDrawable(z ? 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;
}
}
ImageViewUtils.setImageUri(this.muteButtonImageView, z ? this.aiO.Ir() : this.aiO.Is(), this.sdk);
}
private void aw(boolean z) {
this.savedVideoPercentViewed = getVideoPercentViewed();
if (z) {
this.ajQ.pause();
} else {
this.ajQ.stopPlayback();
}
}
public void e(boolean z, long j) {
if (z) {
u.a(this.ajB, j, null);
} else {
u.b(this.ajB, j, null);
}
}
public void tA() {
com.applovin.impl.adview.a aVar = this.ajy;
if (aVar != null) {
aVar.qO();
}
}
public void tB() {
com.applovin.impl.adview.a aVar = this.ajy;
if (aVar != null) {
aVar.qN();
}
}
public void tC() {
com.applovin.impl.adview.a aVar = this.ajy;
if (aVar != null) {
aVar.qN();
com.applovin.impl.adview.a aVar2 = this.ajy;
Objects.requireNonNull(aVar2);
a(new myobfuscated.w4.a(aVar2, 8), 2000L);
}
}
public void tc() {
this.ajx.a(this.aiV);
this.aiY = SystemClock.elapsedRealtime();
}
public void th() {
bE(250L);
}
public void to() {
if (this.ajH.compareAndSet(false, true)) {
a(this.ajz, this.aiO.GG(), new myobfuscated.y3.g(this, 9));
}
}
private void tp() {
y yVar;
w GW = this.aiO.GW();
if (GW == null || !GW.si() || this.ajG || (yVar = this.ajB) == null) {
return;
}
final boolean z = yVar.getVisibility() == 4;
final long sj = GW.sj();
AppLovinSdkUtils.runOnUiThread(new Runnable() {
@Override
public final void run() {
f.this.e(z, sj);
}
});
}
public void tt() {
if (this.ajG) {
if (x.FL()) {
this.logger.h("AppLovinFullscreenActivity", "Skip video resume - postitial shown");
}
} else if (this.sdk.Cz().isApplicationPaused()) {
if (x.FL()) {
this.logger.h("AppLovinFullscreenActivity", "Skip video resume - app paused");
}
} else if (this.ajT < 0) {
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Invalid last video position");
}
} else {
if (x.FL()) {
x xVar = this.logger;
xVar.f("AppLovinFullscreenActivity", "Resuming video at position " + this.ajT + "ms for MediaPlayer: " + this.ajP);
}
this.ajQ.seekTo(this.ajT);
this.ajQ.start();
this.countdownManager.start();
this.ajT = -1;
a(new h(this, 2), 250L);
}
}
public void ty() {
this.ajI = -1L;
this.ajJ = SystemClock.elapsedRealtime();
}
public void tz() {
this.aiY = SystemClock.elapsedRealtime();
}
public void a(MotionEvent motionEvent, Bundle bundle) {
if (!this.aiO.GX()) {
tp();
return;
}
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Clicking through video");
}
Uri Gp = this.aiO.Gp();
if (Gp != null) {
AppLovinAdView appLovinAdView = this.aiT;
this.sdk.BY().trackAndLaunchVideoClick(this.aiO, Gp, motionEvent, bundle, this, appLovinAdView != null ? appLovinAdView.getContext() : n.getApplicationContext());
l.a(this.agD, this.aiO);
this.ajh++;
}
}
@Override
public void a(ViewGroup viewGroup) {
String str;
this.ajx.a(this.muteButtonImageView, this.ajz, this.ajB, this.ajy, this.agb, this.ajA, this.ajQ, this.aiT, this.ago, this.industryIconImageView, viewGroup);
if (com.applovin.impl.sdk.utils.h.LT() && (str = (String) myobfuscated.b0.b.n(this.sdk, AppLovinSdkExtraParameterKey.AUDIO_FOCUS_REQUEST)) != null) {
this.ajQ.setAudioFocusRequest(Integer.parseInt(str));
}
StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
if (!t.a(com.applovin.impl.sdk.c.b.aNG, this.sdk)) {
checkCachedAdResourcesImmediately(!this.isVideoStream);
}
this.ajQ.setVideoURI(this.aiO.Gm());
StrictMode.setThreadPolicy(allowThreadDiskReads);
if (this.aiO.HL()) {
this.ajk.a(this.aiO, new myobfuscated.w4.a(this, 7));
}
com.applovin.impl.adview.x xVar = this.ago;
if (xVar != null) {
xVar.so();
}
this.ajQ.start();
if (this.isVideoStream) {
tj();
}
this.aiT.renderAd(this.aiO);
if (this.ajz != null) {
this.sdk.Cj().a(new ab(this.sdk, "scheduleSkipButton", new myobfuscated.e.b(this, 9)), q.a.TIMEOUT, this.aiO.GH(), true);
}
super.au(this.isVideoMuted);
}
@Override
public void bE(long j) {
a(new i(this, 2), j);
}
public void bG(long j) {
this.videoDurationMillis = j;
}
@Override
public void dismiss() {
this.countdownManager.rv();
this.ajF.rv();
this.countdownHandler.removeCallbacksAndMessages(null);
this.ajE.removeCallbacksAndMessages(null);
sL();
super.dismiss();
}
@Override
public String getCommunicatorId() {
return "FullscreenVideoAdPresenter";
}
public int getVideoPercentViewed() {
long currentPosition = this.ajQ.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 (x.FL()) {
x xVar = this.logger;
StringBuilder t = defpackage.d.t("Encountered media error: ", str, " for ad: ");
t.append(this.aiO);
xVar.i("AppLovinFullscreenActivity", t.toString());
}
if (this.mediaErrorHandled.compareAndSet(false, true)) {
if (t.a(com.applovin.impl.sdk.c.b.aNA, this.sdk)) {
this.sdk.Cy().c(this.aiO, n.getApplicationContext());
}
AppLovinAdDisplayListener appLovinAdDisplayListener = this.agB;
if (appLovinAdDisplayListener instanceof com.applovin.impl.sdk.ad.h) {
((com.applovin.impl.sdk.ad.h) appLovinAdDisplayListener).onAdDisplayFailed(str);
}
this.sdk.CN().a(this.aiO instanceof com.applovin.impl.b.a ? "handleVastVideoError" : "handleVideoError", str, this.aiO);
dismiss();
}
}
@Override
@SuppressLint({"LongLogTag"})
public void onDestroy() {
if (x.FL()) {
this.logger.g("AppLovinFullscreenActivity", "Destroying video components");
}
try {
if (((Boolean) this.sdk.a(com.applovin.impl.sdk.c.b.aSu)).booleanValue()) {
com.applovin.impl.sdk.utils.w.j(this.ajB);
this.ajB = null;
}
if (this.isVideoStream) {
AppLovinCommunicator.getInstance(this.ahP).unsubscribe(this, "video_caching_failed");
}
AppLovinVideoView appLovinVideoView = this.ajQ;
if (appLovinVideoView != null) {
appLovinVideoView.pause();
this.ajQ.stopPlayback();
}
MediaPlayer mediaPlayer = this.ajP;
if (mediaPlayer != null) {
mediaPlayer.release();
}
} catch (Throwable th) {
x.e("AppLovinFullscreenActivity", "Unable to destroy presenter", th);
}
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.aiO.getAdIdNumber() && this.isVideoStream) {
int i = messageData.getInt("load_response_code");
String string = messageData.getString("load_exception_message");
if ((string == null && i >= 200 && i < 300) || this.videoWasCompleted || this.ajQ.isPlaying()) {
return;
}
handleMediaError("Video cache error during stream. ResponseCode=" + i + ", exception=" + string);
}
}
}
@Override
public void onWindowFocusChanged(boolean z) {
super.onWindowFocusChanged(z);
if (z) {
bE(0L);
if (this.ajG) {
this.ajF.start();
}
} else if (this.ajG) {
this.ajF.W();
} else {
pauseVideo();
}
}
@Override
public void pauseVideo() {
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Pausing video");
}
this.ajT = this.ajQ.getCurrentPosition();
this.ajQ.pause();
this.countdownManager.W();
if (x.FL()) {
x xVar = this.logger;
xVar.f("AppLovinFullscreenActivity", "Paused video at position " + this.ajT + "ms");
}
}
@Override
public void sI() {
a((ViewGroup) null);
}
@Override
public void sL() {
super.a(getVideoPercentViewed(), this.isVideoStream, sQ(), this.ajI);
}
@Override
public boolean sQ() {
return this.aiO.HF() ? this.ajm : tu();
}
@Override
public boolean sR() {
return sS() && !sQ();
}
@Override
public void sT() {
long HC;
long millis;
if (this.aiO.HB() >= 0 || this.aiO.HC() >= 0) {
if (this.aiO.HB() >= 0) {
HC = this.aiO.HB();
} else {
com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) this.aiO;
long j = this.videoDurationMillis;
long j2 = j > 0 ? j : 0L;
if (aVar.HD()) {
int Gq = (int) ((com.applovin.impl.sdk.ad.a) this.aiO).Gq();
if (Gq > 0) {
millis = TimeUnit.SECONDS.toMillis(Gq);
} else {
int GI = (int) aVar.GI();
if (GI > 0) {
millis = TimeUnit.SECONDS.toMillis(GI);
}
}
j2 += millis;
}
HC = (long) ((this.aiO.HC() / 100.0d) * j2);
}
bF(HC);
}
}
@Override
public void sV() {
super.sV();
this.ajx.k(this.ajB);
this.ajx.k(this.ajz);
if (!sS() || this.ajG) {
tc();
}
}
@Override
public void sW() {
super.sW();
tc();
}
@Override
public void ta() {
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
}
}
@Override
public void tb() {
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Skipping video from prompt");
}
ti();
}
public void ti() {
this.ajg++;
if (this.aiO.GO()) {
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Dismissing ad on video skip...");
}
dismiss();
return;
}
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Skipping video...");
}
tm();
}
public void tj() {
AppLovinSdkUtils.runOnUiThread(new myobfuscated.e.f(this, 14));
}
public void tk() {
AppLovinSdkUtils.runOnUiThread(new myobfuscated.e.i(this, 11));
}
public void tl() {
MediaPlayer mediaPlayer = this.ajP;
if (mediaPlayer == null) {
return;
}
try {
float f = this.isVideoMuted ? 1.0f : 0.0f;
mediaPlayer.setVolume(f, f);
boolean z = !this.isVideoMuted;
this.isVideoMuted = z;
av(z);
d(this.isVideoMuted, 0L);
} catch (Throwable unused) {
}
}
public void tm() {
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Showing postitial...");
}
aw(this.aiO.Iu());
final long Hp = this.aiO.Hp();
if (Hp > 0) {
this.aiZ = 0L;
final Long l = (Long) this.sdk.a(com.applovin.impl.sdk.c.b.aOZ);
final Integer num = (Integer) this.sdk.a(com.applovin.impl.sdk.c.b.aPc);
ProgressBar progressBar = new ProgressBar(this.ahP, null, 16842872);
this.ajC = progressBar;
a(progressBar, this.aiO.Ho(), num.intValue());
this.ajF.a("POSTITIAL_PROGRESS_BAR", l.longValue(), new k.a() {
{
f.this = this;
}
@Override
public void rw() {
f.this.ajC.setProgress((int) ((((float) f.this.aiZ) / ((float) Hp)) * num.intValue()));
f fVar = f.this;
fVar.aiZ = l.longValue() + fVar.aiZ;
}
@Override
public boolean rx() {
return f.this.aiZ < Hp;
}
});
this.ajF.start();
}
this.ajx.a(this.aiU, this.ago, this.aiT, this.ajC);
StringBuilder sb = new StringBuilder("javascript:al_onPoststitialShow(");
sb.append(this.ajg);
sb.append(",");
d(defpackage.e.l(sb, this.ajh, ");"), this.aiO.Hq());
if (this.aiU != null) {
if (this.aiO.GI() >= 0) {
a(this.aiU, this.aiO.GI(), new myobfuscated.q3.e(this, 4));
} else {
this.aiU.setVisibility(0);
}
}
ArrayList arrayList = new ArrayList();
p pVar = this.aiU;
if (pVar != null) {
arrayList.add(new com.applovin.impl.sdk.a.d(pVar, FriendlyObstructionPurpose.CLOSE_AD, "close button"));
}
com.applovin.impl.adview.x xVar = this.ago;
if (xVar != null && xVar.sp()) {
com.applovin.impl.adview.x xVar2 = this.ago;
arrayList.add(new com.applovin.impl.sdk.a.d(xVar2, FriendlyObstructionPurpose.NOT_VISIBLE, xVar2.getIdentifier()));
}
ProgressBar progressBar2 = this.ajC;
if (progressBar2 != null) {
arrayList.add(new com.applovin.impl.sdk.a.d(progressBar2, FriendlyObstructionPurpose.OTHER, "postitial progress bar"));
}
this.aiO.getAdEventTracker().a(this.aiT, arrayList);
sU();
this.ajG = true;
}
public boolean tq() {
return (this.ajd || this.ajG || !this.ajQ.isPlaying()) ? false : true;
}
public void tr() {
this.ajI = SystemClock.elapsedRealtime() - this.ajJ;
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", com.appsflyer.internal.c.q(new StringBuilder("Attempting to skip video with skip time: "), this.ajI, "ms"));
}
if (!sR()) {
ti();
return;
}
pauseVideo();
sO();
if (x.FL()) {
this.logger.f("AppLovinFullscreenActivity", "Prompting incentivized ad close warning");
}
this.ajk.Kw();
}
public boolean tu() {
return getVideoPercentViewed() >= this.aiO.Hm();
}
}