Recover Files v1.3.9版本的 MD5 值为:27a8b2c239c6cb7111d74d6bb07d21b2

以下内容为反编译后的 f.java 源代码,内容仅作参考


package com.applovin.impl.adview.activity.b;

import android.R;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.graphics.PointF;
import android.graphics.drawable.AnimatedVectorDrawable;
import android.media.MediaPlayer;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.StrictMode;
import android.os.SystemClock;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.ProgressBar;
import androidx.annotation.Nullable;
import androidx.room.z;
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.h;
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.adview.x;
import com.applovin.impl.sdk.e.ac;
import com.applovin.impl.sdk.e.r;
import com.applovin.impl.sdk.o;
import com.applovin.impl.sdk.utils.AppLovinSdkExtraParameterKey;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.y;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
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 f extends com.applovin.impl.adview.activity.b.a implements AppLovinCommunicatorSubscriber {

    @Nullable
    protected final n A;

    @Nullable
    protected h B;

    @Nullable
    protected final ImageView C;

    @Nullable
    protected w D;

    @Nullable
    protected final ProgressBar E;

    @Nullable
    protected ProgressBar F;

    @Nullable
    protected ImageView G;
    protected final k H;
    protected final k I;
    protected boolean J;
    protected long K;
    protected boolean L;
    private final com.applovin.impl.adview.activity.a.c M;
    private MediaPlayer N;
    private final b O;
    private final a P;
    private final Handler Q;
    private final Handler R;
    private final boolean S;
    private int T;
    private int U;
    private boolean V;
    private final AtomicBoolean W;
    private final AtomicBoolean X;
    private long Y;
    private long Z;

    protected final AppLovinVideoView f8847y;

    protected final com.applovin.impl.adview.a f8848z;

    public class b implements MediaPlayer.OnCompletionListener, MediaPlayer.OnErrorListener, MediaPlayer.OnInfoListener, MediaPlayer.OnPreparedListener, AppLovinTouchToClickListener.OnClickListener {
        private b() {
        }

        @Override
        public void onClick(View view, PointF pointF) {
            f.this.a(pointF, false);
        }

        @Override
        public void onCompletion(MediaPlayer mediaPlayer) {
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", "Video completed");
            }
            f.this.V = true;
            f fVar = f.this;
            if (!fVar.f8784m) {
                fVar.B();
            } else if (fVar.u()) {
                f.this.H();
            }
        }

        @Override
        public boolean onError(MediaPlayer mediaPlayer, int i10, int i11) {
            f.this.c(z.a("Video view error (", i10, ",", i11, ")"));
            f.this.f8847y.start();
            return true;
        }

        @Override
        public boolean onInfo(MediaPlayer mediaPlayer, int i10, int i11) {
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", z.a("MediaPlayer Info: (", i10, ", ", i11, ")"));
            }
            if (i10 == 701) {
                f.this.y();
                f.this.f8775d.g();
                return false;
            }
            if (i10 == 3) {
                f.this.H.a();
                f fVar = f.this;
                if (fVar.A != null) {
                    fVar.E();
                }
                f.this.z();
                if (f.this.f8794w.c()) {
                    f.this.e();
                    return false;
                }
                return false;
            }
            if (i10 == 702) {
                f.this.z();
                return false;
            }
            return false;
        }

        @Override
        public void onPrepared(MediaPlayer mediaPlayer) {
            f.this.N = mediaPlayer;
            mediaPlayer.setOnInfoListener(f.this.O);
            mediaPlayer.setOnErrorListener(f.this.O);
            float f10 = !f.this.J ? 1 : 0;
            mediaPlayer.setVolume(f10, f10);
            f.this.f8785n = (int) TimeUnit.MILLISECONDS.toSeconds(mediaPlayer.getDuration());
            f.this.c(mediaPlayer.getDuration());
            f.this.v();
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", "MediaPlayer prepared: " + f.this.N);
            }
        }
    }

    public class c implements View.OnClickListener {
        private c() {
        }

        @Override
        public void onClick(View view) {
            f fVar = f.this;
            if (view == fVar.A) {
                if (fVar.t()) {
                    f.this.e();
                    f.this.q();
                    f.this.f8794w.b();
                    return;
                }
                f.this.c();
                return;
            }
            if (view == fVar.C) {
                fVar.A();
                return;
            }
            y yVar = fVar.f8774c;
            if (y.a()) {
                f.this.f8774c.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
            }
        }
    }

    public f(com.applovin.impl.sdk.ad.e eVar, Activity activity, @Nullable Map<String, Object> map, o oVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
        super(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
        this.M = new com.applovin.impl.adview.activity.a.c(this.f8772a, this.f8776e, this.f8773b);
        this.G = null;
        b bVar = new b();
        this.O = bVar;
        a aVar = new a();
        this.P = aVar;
        Handler handler = new Handler(Looper.getMainLooper());
        this.Q = handler;
        Handler handler2 = new Handler(Looper.getMainLooper());
        this.R = handler2;
        k kVar = new k(handler, this.f8773b);
        this.H = kVar;
        this.I = new k(handler2, this.f8773b);
        boolean f10 = this.f8772a.f();
        this.S = f10;
        this.J = com.applovin.impl.sdk.utils.w.c(this.f8773b);
        this.U = -1;
        this.W = new AtomicBoolean();
        this.X = new AtomicBoolean();
        this.Y = -2L;
        this.Z = 0L;
        if (eVar.hasVideoUrl()) {
            AppLovinVideoView appLovinVideoView = new AppLovinVideoView(activity);
            this.f8847y = appLovinVideoView;
            appLovinVideoView.setOnPreparedListener(bVar);
            appLovinVideoView.setOnCompletionListener(bVar);
            appLovinVideoView.setOnErrorListener(bVar);
            appLovinVideoView.setOnTouchListener(new AppLovinTouchToClickListener(oVar, com.applovin.impl.sdk.c.b.f10784bb, activity, bVar));
            c cVar = new c();
            if (eVar.r() >= 0) {
                n nVar = new n(eVar.x(), activity);
                this.A = nVar;
                nVar.setVisibility(8);
                nVar.setOnClickListener(cVar);
            } else {
                this.A = null;
            }
            if (a(this.J, oVar)) {
                ImageView imageView = new ImageView(activity);
                this.C = imageView;
                imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
                imageView.setClickable(true);
                imageView.setOnClickListener(cVar);
                e(this.J);
            } else {
                this.C = null;
            }
            String C = eVar.C();
            if (StringUtils.isValidString(C)) {
                x xVar = new x(oVar);
                xVar.a(new WeakReference<>(aVar));
                w wVar = new w(xVar, activity);
                this.D = wVar;
                wVar.a(C);
            } else {
                this.D = null;
            }
            if (f10) {
                com.applovin.impl.adview.a aVar2 = new com.applovin.impl.adview.a(activity, ((Integer) oVar.a(com.applovin.impl.sdk.c.b.cY)).intValue(), R.attr.progressBarStyleLarge);
                this.f8848z = aVar2;
                aVar2.setColor(Color.parseColor("#75FFFFFF"));
                aVar2.setBackgroundColor(Color.parseColor("#00000000"));
                aVar2.setVisibility(8);
                AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
            } else {
                this.f8848z = null;
            }
            final int m10 = m();
            boolean z10 = ((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cI)).booleanValue() && m10 > 0;
            if (this.B == null && z10) {
                this.B = new h(activity);
                int I = eVar.I();
                this.B.setTextColor(I);
                this.B.setTextSize(((Integer) oVar.a(com.applovin.impl.sdk.c.b.cH)).intValue());
                this.B.setFinishedStrokeColor(I);
                this.B.setFinishedStrokeWidth(((Integer) oVar.a(com.applovin.impl.sdk.c.b.cG)).intValue());
                this.B.setMax(m10);
                this.B.setProgress(m10);
                kVar.a("COUNTDOWN_CLOCK", TimeUnit.SECONDS.toMillis(1L), new k.a() {
                    @Override
                    public void a() {
                        if (f.this.B != null) {
                            long seconds = m10 - TimeUnit.MILLISECONDS.toSeconds(r0.f8847y.getCurrentPosition());
                            if (seconds <= 0) {
                                f.this.f8786o = true;
                            } else if (f.this.C()) {
                                f.this.B.setProgress((int) seconds);
                            }
                        }
                    }

                    @Override
                    public boolean b() {
                        return f.this.C();
                    }
                });
            }
            if (eVar.R()) {
                Long l10 = (Long) oVar.a(com.applovin.impl.sdk.c.b.cV);
                final Integer num = (Integer) oVar.a(com.applovin.impl.sdk.c.b.cW);
                ProgressBar progressBar = new ProgressBar(activity, null, R.attr.progressBarStyleHorizontal);
                this.E = progressBar;
                a(progressBar, eVar.S(), num.intValue());
                kVar.a("PROGRESS_BAR", l10.longValue(), new k.a() {
                    @Override
                    public void a() {
                        f fVar = f.this;
                        if (fVar.L) {
                            fVar.E.setVisibility(8);
                        } else {
                            f.this.E.setProgress((int) ((fVar.f8847y.getCurrentPosition() / ((float) f.this.K)) * num.intValue()));
                        }
                    }

                    @Override
                    public boolean b() {
                        return !f.this.L;
                    }
                });
                return;
            }
            this.E = null;
            return;
        }
        throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
    }

    public void E() {
        if (this.X.compareAndSet(false, true)) {
            a(this.A, this.f8772a.r(), new Runnable() {
                @Override
                public void run() {
                    f.this.Y = -1L;
                    f.this.Z = SystemClock.elapsedRealtime();
                }
            });
        }
    }

    private void F() {
        w wVar;
        final boolean z10;
        u D = this.f8772a.D();
        if (D != null && D.e() && !this.L && (wVar = this.D) != null) {
            if (wVar.getVisibility() == 4) {
                z10 = true;
            } else {
                z10 = false;
            }
            final long f10 = D.f();
            AppLovinSdkUtils.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    if (z10) {
                        com.applovin.impl.sdk.utils.x.a(f.this.D, f10, (Runnable) null);
                    } else {
                        com.applovin.impl.sdk.utils.x.b(f.this.D, f10, null);
                    }
                }
            });
        }
    }

    public void G() {
        if (this.L) {
            if (y.a()) {
                this.f8774c.d("AppLovinFullscreenActivity", "Skip video resume - postitial shown");
                return;
            }
            return;
        }
        if (this.f8773b.U().isApplicationPaused()) {
            if (y.a()) {
                this.f8774c.d("AppLovinFullscreenActivity", "Skip video resume - app paused");
                return;
            }
            return;
        }
        if (this.U >= 0) {
            if (y.a()) {
                this.f8774c.b("AppLovinFullscreenActivity", "Resuming video at position " + this.U + "ms for MediaPlayer: " + this.N);
            }
            this.f8847y.seekTo(this.U);
            this.f8847y.start();
            this.H.a();
            this.U = -1;
            a(new Runnable() {
                @Override
                public void run() {
                    com.applovin.impl.adview.a aVar = f.this.f8848z;
                    if (aVar != null) {
                        aVar.a();
                        f.this.a(new Runnable() {
                            @Override
                            public void run() {
                                f.this.f8848z.b();
                            }
                        }, 2000L);
                    }
                }
            }, 250L);
            return;
        }
        if (y.a()) {
            this.f8774c.b("AppLovinFullscreenActivity", "Invalid last video position");
        }
    }

    public void H() {
        this.M.a(this.f8780i);
        this.f8782k = SystemClock.elapsedRealtime();
    }

    public void A() {
        int i10;
        MediaPlayer mediaPlayer = this.N;
        if (mediaPlayer == null) {
            return;
        }
        try {
            boolean z10 = false;
            if (!this.J) {
                i10 = 0;
            } else {
                i10 = 1;
            }
            float f10 = i10;
            mediaPlayer.setVolume(f10, f10);
            if (!this.J) {
                z10 = true;
            }
            this.J = z10;
            e(z10);
            a(this.J, 0L);
        } catch (Throwable unused) {
        }
    }

    public void B() {
        if (y.a()) {
            this.f8774c.b("AppLovinFullscreenActivity", "Showing postitial...");
        }
        d(this.f8772a.aQ());
        final long W = this.f8772a.W();
        if (W > 0) {
            this.f8783l = 0L;
            final Long l10 = (Long) this.f8773b.a(com.applovin.impl.sdk.c.b.f10806df);
            final Integer num = (Integer) this.f8773b.a(com.applovin.impl.sdk.c.b.f10809di);
            ProgressBar progressBar = new ProgressBar(this.f8776e, null, R.attr.progressBarStyleHorizontal);
            this.F = progressBar;
            a(progressBar, this.f8772a.V(), num.intValue());
            this.I.a("POSTITIAL_PROGRESS_BAR", l10.longValue(), new k.a() {
                @Override
                public void a() {
                    f.this.F.setProgress((int) ((((float) f.this.f8783l) / ((float) W)) * num.intValue()));
                    f fVar = f.this;
                    fVar.f8783l = l10.longValue() + fVar.f8783l;
                }

                @Override
                public boolean b() {
                    if (f.this.f8783l < W) {
                        return true;
                    }
                    return false;
                }
            });
            this.I.a();
        }
        this.M.a(this.f8779h, this.f8778g, this.f8777f, this.F);
        StringBuilder sb2 = new StringBuilder("javascript:al_onPoststitialShow(");
        sb2.append(this.f8787p);
        sb2.append(",");
        a(android.support.v4.media.e.a(sb2, this.f8788q, ");"), this.f8772a.X());
        if (this.f8779h != null) {
            if (this.f8772a.t() >= 0) {
                a(this.f8779h, this.f8772a.t(), new Runnable() {
                    @Override
                    public void run() {
                        f.this.f8782k = SystemClock.elapsedRealtime();
                    }
                });
            } else {
                this.f8779h.setVisibility(0);
            }
        }
        ArrayList arrayList = new ArrayList();
        n nVar = this.f8779h;
        if (nVar != null) {
            arrayList.add(new com.applovin.impl.sdk.a.d(nVar, FriendlyObstructionPurpose.CLOSE_AD, "close button"));
        }
        v vVar = this.f8778g;
        if (vVar != null && vVar.b()) {
            v vVar2 = this.f8778g;
            arrayList.add(new com.applovin.impl.sdk.a.d(vVar2, FriendlyObstructionPurpose.NOT_VISIBLE, vVar2.getIdentifier()));
        }
        ProgressBar progressBar2 = this.F;
        if (progressBar2 != null) {
            arrayList.add(new com.applovin.impl.sdk.a.d(progressBar2, FriendlyObstructionPurpose.OTHER, "postitial progress bar"));
        }
        this.f8772a.o().a(this.f8777f, arrayList);
        w();
        this.L = true;
    }

    public boolean C() {
        if (!this.f8786o && !this.L && this.f8847y.isPlaying()) {
            return true;
        }
        return false;
    }

    public int D() {
        long currentPosition = this.f8847y.getCurrentPosition();
        if (this.V) {
            return 100;
        }
        if (currentPosition > 0) {
            return (int) ((((float) currentPosition) / ((float) this.K)) * 100.0f);
        }
        return this.T;
    }

    @Override
    public String getCommunicatorId() {
        return "FullscreenVideoAdPresenter";
    }

    @Override
    public void h() {
        this.H.b();
        this.I.b();
        this.Q.removeCallbacksAndMessages(null);
        this.R.removeCallbacksAndMessages(null);
        n();
        super.h();
    }

    @Override
    @SuppressLint({"LongLogTag"})
    public void k() {
        if (y.a()) {
            this.f8774c.c("AppLovinFullscreenActivity", "Destroying video components");
        }
        try {
            if (((Boolean) this.f8773b.a(com.applovin.impl.sdk.c.b.gH)).booleanValue()) {
                com.applovin.impl.sdk.utils.z.a(this.D);
                this.D = null;
            }
            if (this.S) {
                AppLovinCommunicator.getInstance(this.f8776e).unsubscribe(this, "video_caching_failed");
            }
            AppLovinVideoView appLovinVideoView = this.f8847y;
            if (appLovinVideoView != null) {
                appLovinVideoView.pause();
                this.f8847y.stopPlayback();
            }
            MediaPlayer mediaPlayer = this.N;
            if (mediaPlayer != null) {
                mediaPlayer.release();
            }
        } catch (Throwable th2) {
            y.c("AppLovinFullscreenActivity", "Unable to destroy presenter", th2);
        }
        super.k();
    }

    @Override
    public void n() {
        super.a(D(), this.S, s(), this.Y);
    }

    @Override
    public void onMessageReceived(AppLovinCommunicatorMessage appLovinCommunicatorMessage) {
        if ("video_caching_failed".equals(appLovinCommunicatorMessage.getTopic())) {
            Bundle messageData = appLovinCommunicatorMessage.getMessageData();
            long j10 = messageData.getLong("ad_id");
            if (((Boolean) this.f8773b.a(com.applovin.impl.sdk.c.b.go)).booleanValue() && j10 == this.f8772a.getAdIdNumber() && this.S) {
                int i10 = messageData.getInt("load_response_code");
                String string = messageData.getString("load_exception_message");
                if ((string != null || i10 < 200 || i10 >= 300) && !this.V && !this.f8847y.isPlaying()) {
                    c("Video cache error during stream. ResponseCode=" + i10 + ", exception=" + string);
                }
            }
        }
    }

    @Override
    public boolean s() {
        if (D() >= this.f8772a.T()) {
            return true;
        }
        return false;
    }

    @Override
    public boolean t() {
        if (u() && !s()) {
            return true;
        }
        return false;
    }

    @Override
    public void v() {
        long aj;
        long millis;
        long j10 = 0;
        if (this.f8772a.ai() >= 0 || this.f8772a.aj() >= 0) {
            if (this.f8772a.ai() >= 0) {
                aj = this.f8772a.ai();
            } else {
                com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) this.f8772a;
                long j11 = this.K;
                if (j11 > 0) {
                    j10 = 0 + j11;
                }
                if (aVar.ak()) {
                    int l10 = (int) ((com.applovin.impl.sdk.ad.a) this.f8772a).l();
                    if (l10 > 0) {
                        millis = TimeUnit.SECONDS.toMillis(l10);
                    } else {
                        int t10 = (int) aVar.t();
                        if (t10 > 0) {
                            millis = TimeUnit.SECONDS.toMillis(t10);
                        }
                    }
                    j10 += millis;
                }
                aj = (long) ((this.f8772a.aj() / 100.0d) * j10);
            }
            b(aj);
        }
    }

    @Override
    public void x() {
        super.x();
        this.M.a(this.D);
        this.M.a((View) this.A);
        if (!u() || this.L) {
            H();
        }
    }

    public void y() {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                com.applovin.impl.adview.a aVar = f.this.f8848z;
                if (aVar != null) {
                    aVar.a();
                }
            }
        });
    }

    public void z() {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                com.applovin.impl.adview.a aVar = f.this.f8848z;
                if (aVar != null) {
                    aVar.b();
                }
            }
        });
    }

    public class a implements x.a {
        private a() {
        }

        @Override
        public void a(w wVar) {
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", "Clicking through from video button...");
            }
            f.this.a(wVar.getAndClearLastClickLocation(), false);
        }

        @Override
        public void b(w wVar) {
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", "Closing ad from video button...");
            }
            f.this.h();
        }

        @Override
        public void c(w wVar) {
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", "Skipping video from video button...");
            }
            f.this.c();
        }

        @Override
        public void d(w wVar) {
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", "Attempting to install app from video button...");
            }
            f.this.a(wVar.getAndClearLastClickLocation(), true);
        }

        @Override
        public void a(Uri uri, w wVar) {
            y yVar = f.this.f8774c;
            if (y.a()) {
                f.this.f8774c.b("AppLovinFullscreenActivity", "Attempting to load a url from video button...");
            }
            com.applovin.impl.sdk.utils.u.a(uri, f.this.f8777f.getController(), f.this.f8773b);
        }
    }

    public void c(long j10) {
        this.K = j10;
    }

    @Override
    public void d() {
        a((ViewGroup) null);
    }

    @Override
    public void e() {
        if (y.a()) {
            this.f8774c.b("AppLovinFullscreenActivity", "Pausing video");
        }
        this.U = this.f8847y.getCurrentPosition();
        this.f8847y.pause();
        this.H.c();
        if (y.a()) {
            this.f8774c.b("AppLovinFullscreenActivity", "Paused video at position " + this.U + "ms");
        }
    }

    private void d(boolean z10) {
        this.T = D();
        if (z10) {
            this.f8847y.pause();
        } else {
            this.f8847y.stopPlayback();
        }
    }

    @Override
    public void b() {
        if (y.a()) {
            this.f8774c.b("AppLovinFullscreenActivity", "Skipping video from prompt");
        }
        c();
    }

    @Override
    public void c(boolean z10) {
        super.c(z10);
        if (z10) {
            a(0L);
            if (this.L) {
                this.I.a();
                return;
            }
            return;
        }
        if (this.L) {
            this.I.c();
        } else {
            e();
        }
    }

    @Override
    public void a(@Nullable ViewGroup viewGroup) {
        String str;
        this.M.a(this.C, this.A, this.D, this.f8848z, this.E, this.B, this.f8847y, this.f8777f, this.f8778g, this.G, viewGroup);
        if (com.applovin.impl.sdk.utils.h.g() && (str = this.f8773b.ay().getExtraParameters().get(AppLovinSdkExtraParameterKey.AUDIO_FOCUS_REQUEST)) != null) {
            this.f8847y.setAudioFocusRequest(Integer.parseInt(str));
        }
        StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
        a(!this.S);
        this.f8847y.setVideoURI(this.f8772a.h());
        StrictMode.setThreadPolicy(allowThreadDiskReads);
        if (this.f8772a.ar()) {
            this.f8794w.a(this.f8772a, new Runnable() {
                @Override
                public void run() {
                    f.this.a(250L);
                }
            });
        }
        v vVar = this.f8778g;
        if (vVar != null) {
            vVar.a();
        }
        this.f8847y.start();
        if (this.S) {
            y();
        }
        this.f8777f.renderAd(this.f8772a);
        this.f8775d.b(this.S ? 1L : 0L);
        if (this.A != null) {
            this.f8773b.G().a(new ac(this.f8773b, "scheduleSkipButton", new Runnable() {
                @Override
                public void run() {
                    f.this.E();
                }
            }), r.b.MAIN, this.f8772a.s(), true);
        }
        super.b(this.J);
    }

    private void e(boolean z10) {
        if (com.applovin.impl.sdk.utils.h.d()) {
            AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.f8776e.getDrawable(z10 ? com.applovin.sdk.R.drawable.applovin_ic_unmute_to_mute : com.applovin.sdk.R.drawable.applovin_ic_mute_to_unmute);
            if (animatedVectorDrawable != null) {
                this.C.setScaleType(ImageView.ScaleType.FIT_XY);
                this.C.setImageDrawable(animatedVectorDrawable);
                animatedVectorDrawable.start();
                return;
            }
        }
        Uri aJ = z10 ? this.f8772a.aJ() : this.f8772a.aK();
        StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
        this.C.setImageURI(aJ);
        StrictMode.setThreadPolicy(allowThreadDiskReads);
    }

    public void c() {
        this.Y = SystemClock.elapsedRealtime() - this.Z;
        if (y.a()) {
            this.f8774c.b("AppLovinFullscreenActivity", android.support.v4.media.session.h.a(new StringBuilder("Skipping video with skip time: "), this.Y, "ms"));
        }
        this.f8775d.f();
        this.f8787p++;
        if (this.f8772a.y()) {
            h();
        } else {
            B();
        }
    }

    public void c(String str) {
        if (y.a()) {
            y yVar = this.f8774c;
            StringBuilder a10 = androidx.appcompat.view.a.a("Encountered media error: ", str, " for ad: ");
            a10.append(this.f8772a);
            yVar.e("AppLovinFullscreenActivity", a10.toString());
        }
        if (this.W.compareAndSet(false, true)) {
            AppLovinAdDisplayListener appLovinAdDisplayListener = this.f8792u;
            if (appLovinAdDisplayListener instanceof com.applovin.impl.sdk.ad.h) {
                ((com.applovin.impl.sdk.ad.h) appLovinAdDisplayListener).onAdDisplayFailed(str);
            }
            h();
        }
    }

    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.d()) {
            progressBar.setProgressTintList(ColorStateList.valueOf(i10));
        }
    }

    public void a(PointF pointF, boolean z10) {
        if (this.f8772a.E()) {
            if (y.a()) {
                this.f8774c.b("AppLovinFullscreenActivity", "Clicking through video");
            }
            Uri k10 = this.f8772a.k();
            if (k10 != null) {
                AppLovinAdView appLovinAdView = this.f8777f;
                this.f8773b.v().trackAndLaunchVideoClick(this.f8772a, k10, pointF, z10, this, appLovinAdView != null ? appLovinAdView.getContext() : o.au());
                com.applovin.impl.sdk.utils.o.a(this.f8791t, this.f8772a);
                this.f8775d.b();
                this.f8788q++;
                return;
            }
            return;
        }
        F();
    }

    @Override
    public void a(long j10) {
        a(new Runnable() {
            @Override
            public void run() {
                f.this.G();
            }
        }, j10);
    }

    private static boolean a(boolean z10, o oVar) {
        if (!((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cN)).booleanValue()) {
            return false;
        }
        if (!((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cO)).booleanValue() || z10) {
            return true;
        }
        return ((Boolean) oVar.a(com.applovin.impl.sdk.c.b.cQ)).booleanValue();
    }

    @Override
    public void a() {
        if (y.a()) {
            this.f8774c.b("AppLovinFullscreenActivity", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
        }
    }
}