导航菜单

页面标题

页面副标题

Jurassic World v1.83.4 - v9.java 源代码

正在查看: Jurassic World v1.83.4 应用的 v9.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.applovin.impl;

import android.R;
import android.app.Activity;
import android.content.Context;
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.rr;
import com.applovin.impl.sdk.utils.ImageViewUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.tm;
import com.applovin.impl.v4;
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.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

public class v9 extends p9 implements AppLovinCommunicatorSubscriber {
    private final w9 L;
    private MediaPlayer M;
    protected final AppLovinVideoView N;
    protected final o O;
    protected final com.applovin.impl.adview.g P;
    protected h3 Q;
    protected final ImageView R;
    protected com.applovin.impl.adview.l S;
    protected final ProgressBar T;
    protected ProgressBar U;
    protected ImageView V;
    private final e W;
    private final d X;
    private final Handler Y;
    private final Handler Z;
    protected final v4 a0;
    protected final v4 b0;
    private final boolean c0;
    protected boolean d0;
    protected long e0;
    private int f0;
    private int g0;
    protected boolean h0;
    private boolean i0;
    private final AtomicBoolean j0;
    private final AtomicBoolean k0;
    private long l0;
    private long m0;

    public void X() {
        if (com.applovin.impl.sdk.n.a()) {
            this.c.a("AppLovinFullscreenActivity", "Showing postitial...");
        }
        f(this.a.f1());
        long T = this.a.T();
        if (T > 0) {
            this.r = 0L;
            Long l = (Long) this.b.a(sj.M2);
            Integer num = (Integer) this.b.a(sj.P2);
            ProgressBar progressBar = new ProgressBar(this.d, null, R.attr.progressBarStyleHorizontal);
            this.U = progressBar;
            a(progressBar, this.a.S(), num.intValue());
            this.b0.a("POSTITIAL_PROGRESS_BAR", l.longValue(), new c(T, num, l));
            this.b0.b();
        }
        this.L.a(this.k, this.j, this.i, this.U);
        a("javascript:al_onPoststitialShow(" + this.y + "," + this.z + ");", this.a.D());
        if (this.k != null) {
            if (this.a.p() >= 0) {
                a(this.k, this.a.p(), new Runnable() {
                    @Override
                    public final void run() {
                        v9.this.O();
                    }
                });
            } else {
                this.k.setVisibility(0);
            }
        }
        ArrayList arrayList = new ArrayList();
        com.applovin.impl.adview.g gVar = this.k;
        if (gVar != null) {
            arrayList.add(new og(gVar, FriendlyObstructionPurpose.CLOSE_AD, "close button"));
        }
        com.applovin.impl.adview.k kVar = this.j;
        if (kVar != null && kVar.a()) {
            com.applovin.impl.adview.k kVar2 = this.j;
            arrayList.add(new og(kVar2, FriendlyObstructionPurpose.NOT_VISIBLE, kVar2.getIdentifier()));
        }
        ProgressBar progressBar2 = this.U;
        if (progressBar2 != null) {
            arrayList.add(new og(progressBar2, FriendlyObstructionPurpose.OTHER, "postitial progress bar"));
        }
        this.a.getAdEventTracker().b((View) this.i, (List) arrayList);
        t();
        this.h0 = true;
    }

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

    @Override
    public void v() {
        if (com.applovin.impl.sdk.n.a()) {
            this.c.d("AppLovinFullscreenActivity", "Destroying video components");
        }
        try {
            if (((Boolean) this.b.a(sj.g6)).booleanValue()) {
                tr.b(this.S);
                this.S = null;
            }
            if (this.c0) {
                AppLovinCommunicator.getInstance(this.d).unsubscribe(this, "video_caching_failed");
            }
            AppLovinVideoView appLovinVideoView = this.N;
            if (appLovinVideoView != null) {
                appLovinVideoView.pause();
                this.N.stopPlayback();
            }
            MediaPlayer mediaPlayer = this.M;
            if (mediaPlayer != null) {
                mediaPlayer.release();
            }
        } catch (Throwable th) {
            com.applovin.impl.sdk.n.c("AppLovinFullscreenActivity", "Unable to destroy presenter", th);
        }
        super.v();
    }

    @Override
    public void z() {
        if (com.applovin.impl.sdk.n.a()) {
            this.c.a("AppLovinFullscreenActivity", "Pausing video");
        }
        this.g0 = this.N.getCurrentPosition();
        this.N.pause();
        this.a0.c();
        if (com.applovin.impl.sdk.n.a()) {
            this.c.a("AppLovinFullscreenActivity", "Paused video at position " + this.g0 + "ms");
        }
    }

    protected void d(String str) {
        if (com.applovin.impl.sdk.n.a()) {
            this.c.b("AppLovinFullscreenActivity", "Encountered media error: " + str + " for ad: " + this.a);
        }
        if (this.j0.compareAndSet(false, true)) {
            if (yp.a(sj.j1, this.b)) {
                this.b.B().d(this.a, com.applovin.impl.sdk.j.l());
            }
            AppLovinAdDisplayListener appLovinAdDisplayListener = this.D;
            if (appLovinAdDisplayListener instanceof qb) {
                ((qb) appLovinAdDisplayListener).onAdDisplayFailed(str);
            }
            this.b.E().a(this.a instanceof aq ? "handleVastVideoError" : "handleVideoError", str, this.a);
            f();
        }
    }

    public v9(com.applovin.impl.sdk.ad.b bVar, Activity activity, Map map, com.applovin.impl.sdk.j jVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
        super(bVar, activity, map, jVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
        this.L = new w9(this.a, this.d, this.b);
        a aVar = null;
        this.V = null;
        e eVar = new e(this, aVar);
        this.W = eVar;
        d dVar = new d(this, aVar);
        this.X = dVar;
        Handler handler = new Handler(Looper.getMainLooper());
        this.Y = handler;
        Handler handler2 = new Handler(Looper.getMainLooper());
        this.Z = handler2;
        v4 v4Var = new v4(handler, this.b);
        this.a0 = v4Var;
        this.b0 = new v4(handler2, this.b);
        boolean H0 = this.a.H0();
        this.c0 = H0;
        this.d0 = yp.e(this.b);
        this.g0 = -1;
        this.j0 = new AtomicBoolean();
        this.k0 = new AtomicBoolean();
        this.l0 = -2L;
        this.m0 = 0L;
        if (bVar.hasVideoUrl()) {
            if (yp.a(sj.n1, jVar)) {
                a(!H0);
            }
            AppLovinVideoView appLovinVideoView = new AppLovinVideoView(activity);
            this.N = appLovinVideoView;
            appLovinVideoView.setOnPreparedListener(eVar);
            appLovinVideoView.setOnCompletionListener(eVar);
            appLovinVideoView.setOnErrorListener(eVar);
            appLovinVideoView.setOnTouchListener(new AppLovinTouchToClickListener(jVar, sj.F0, activity, eVar));
            bVar.e().putString("video_view_address", zq.a(appLovinVideoView));
            f fVar = new f(this, aVar);
            if (bVar.k0() >= 0) {
                com.applovin.impl.adview.g gVar = new com.applovin.impl.adview.g(bVar.b0(), activity);
                this.P = gVar;
                gVar.setVisibility(8);
                gVar.setOnClickListener(fVar);
            } else {
                this.P = null;
            }
            if (a(this.d0, jVar)) {
                ImageView imageView = new ImageView(activity);
                this.R = imageView;
                imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);
                imageView.setClickable(true);
                imageView.setOnClickListener(fVar);
                e(this.d0);
            } else {
                this.R = null;
            }
            String g0 = bVar.g0();
            if (StringUtils.isValidString(g0)) {
                rr rrVar = new rr(jVar);
                rrVar.a(new WeakReference(dVar));
                com.applovin.impl.adview.l lVar = new com.applovin.impl.adview.l(bVar.f0(), bVar, rrVar, activity);
                this.S = lVar;
                lVar.a(g0);
            } else {
                this.S = null;
            }
            if (H0) {
                o oVar = new o(activity, ((Integer) jVar.a(sj.G2)).intValue(), R.attr.progressBarStyleLarge);
                this.O = oVar;
                oVar.setColor(Color.parseColor("#75FFFFFF"));
                oVar.setBackgroundColor(Color.parseColor("#00000000"));
                oVar.setVisibility(8);
                AppLovinCommunicator.getInstance(activity).subscribe(this, "video_caching_failed");
            } else {
                this.O = null;
            }
            int g = g();
            boolean z = ((Boolean) jVar.a(sj.n2)).booleanValue() && g > 0;
            if (this.Q == null && z) {
                this.Q = new h3(activity);
                int q = bVar.q();
                this.Q.setTextColor(q);
                this.Q.setTextSize(((Integer) jVar.a(sj.m2)).intValue());
                this.Q.setFinishedStrokeColor(q);
                this.Q.setFinishedStrokeWidth(((Integer) jVar.a(sj.l2)).intValue());
                this.Q.setMax(g);
                this.Q.setProgress(g);
                v4Var.a("COUNTDOWN_CLOCK", TimeUnit.SECONDS.toMillis(1L), new a(g));
            }
            if (bVar.r0()) {
                Long l = (Long) jVar.a(sj.D2);
                Integer num = (Integer) jVar.a(sj.E2);
                ProgressBar progressBar = new ProgressBar(activity, null, R.attr.progressBarStyleHorizontal);
                this.T = progressBar;
                a(progressBar, bVar.q0(), num.intValue());
                v4Var.a("PROGRESS_BAR", l.longValue(), new b(num));
                return;
            }
            this.T = null;
            return;
        }
        throw new IllegalStateException("Attempting to use fullscreen video ad presenter for non-video ad");
    }

    class a implements v4.b {
        final int a;

        a(int i) {
            this.a = i;
        }

        @Override
        public void a() {
            if (v9.this.Q != null) {
                long seconds = this.a - TimeUnit.MILLISECONDS.toSeconds(r0.N.getCurrentPosition());
                if (seconds <= 0) {
                    v9.this.v = true;
                } else if (v9.this.T()) {
                    v9.this.Q.setProgress((int) seconds);
                }
            }
        }

        @Override
        public boolean b() {
            return v9.this.T();
        }
    }

    class b implements v4.b {
        final Integer a;

        b(Integer num) {
            this.a = num;
        }

        @Override
        public void a() {
            v9 v9Var = v9.this;
            if (v9Var.h0) {
                v9Var.T.setVisibility(8);
            } else {
                v9.this.T.setProgress((int) ((v9Var.N.getCurrentPosition() / v9.this.e0) * this.a.intValue()));
            }
        }

        @Override
        public boolean b() {
            return !v9.this.h0;
        }
    }

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

    public void M() {
        a(250L);
    }

    public void e(String str) {
        tr.a(this.S, str, "AppLovinFullscreenActivity", this.b);
    }

    private void e(boolean z) {
        if (z3.f()) {
            AnimatedVectorDrawable animatedVectorDrawable = (AnimatedVectorDrawable) this.d.getDrawable(z ? com.applovin.sdk.R.drawable.applovin_ic_unmute_to_mute : com.applovin.sdk.R.drawable.applovin_ic_mute_to_unmute);
            if (animatedVectorDrawable != null) {
                this.R.setScaleType(ImageView.ScaleType.FIT_XY);
                this.R.setImageDrawable(animatedVectorDrawable);
                animatedVectorDrawable.start();
                return;
            }
        }
        ImageViewUtils.setImageUri(this.R, z ? this.a.L() : this.a.e0(), this.b);
    }

    public void S() {
        if (this.k0.compareAndSet(false, true)) {
            a(this.P, this.a.k0(), new Runnable() {
                @Override
                public final void run() {
                    v9.this.L();
                }
            });
        }
    }

    public void L() {
        this.l0 = -1L;
        this.m0 = SystemClock.elapsedRealtime();
    }

    @Override
    public void f() {
        this.a0.a();
        this.b0.a();
        this.Y.removeCallbacksAndMessages(null);
        this.Z.removeCallbacksAndMessages(null);
        q();
        super.f();
    }

    @Override
    public void c(boolean z) {
        super.c(z);
        if (z) {
            a(0L);
            if (this.h0) {
                this.b0.b();
                return;
            }
            return;
        }
        if (this.h0) {
            this.b0.c();
        } else {
            z();
        }
    }

    private void P() {
        com.applovin.impl.adview.l lVar;
        qq i0 = this.a.i0();
        if (i0 == null || !i0.j() || this.h0 || (lVar = this.S) == null) {
            return;
        }
        final boolean z = lVar.getVisibility() == 4;
        final long h = i0.h();
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                v9.this.b(z, h);
            }
        });
    }

    protected boolean T() {
        return (this.v || this.h0 || !this.N.isPlaying()) ? false : true;
    }

    public void Y() {
        this.l0 = SystemClock.elapsedRealtime() - this.m0;
        if (com.applovin.impl.sdk.n.a()) {
            this.c.a("AppLovinFullscreenActivity", "Attempting to skip video with skip time: " + this.l0 + "ms");
        }
        if (U()) {
            z();
            r();
            if (com.applovin.impl.sdk.n.a()) {
                this.c.a("AppLovinFullscreenActivity", "Prompting incentivized ad close warning");
            }
            this.F.e();
            return;
        }
        F();
    }

    public void F() {
        this.y++;
        if (this.a.B()) {
            if (com.applovin.impl.sdk.n.a()) {
                this.c.a("AppLovinFullscreenActivity", "Dismissing ad on video skip...");
            }
            f();
        } else {
            if (com.applovin.impl.sdk.n.a()) {
                this.c.a("AppLovinFullscreenActivity", "Skipping video...");
            }
            X();
        }
    }

    public void b(boolean z, long j) {
        if (z) {
            zq.a(this.S, j, (Runnable) null);
        } else {
            zq.b(this.S, j, null);
        }
    }

    @Override
    public void b() {
        if (com.applovin.impl.sdk.n.a()) {
            this.c.a("AppLovinFullscreenActivity", "Skipping video from prompt");
        }
        F();
    }

    public void Q() {
        if (this.h0) {
            if (com.applovin.impl.sdk.n.a()) {
                this.c.k("AppLovinFullscreenActivity", "Skip video resume - postitial shown");
                return;
            }
            return;
        }
        if (this.b.f0().isApplicationPaused()) {
            if (com.applovin.impl.sdk.n.a()) {
                this.c.k("AppLovinFullscreenActivity", "Skip video resume - app paused");
            }
        } else {
            if (this.g0 >= 0) {
                if (com.applovin.impl.sdk.n.a()) {
                    this.c.a("AppLovinFullscreenActivity", "Resuming video at position " + this.g0 + "ms for MediaPlayer: " + this.M);
                }
                this.N.seekTo(this.g0);
                this.N.start();
                this.a0.b();
                this.g0 = -1;
                a(new Runnable() {
                    @Override
                    public final void run() {
                        v9.this.K();
                    }
                }, 250L);
                return;
            }
            if (com.applovin.impl.sdk.n.a()) {
                this.c.a("AppLovinFullscreenActivity", "Invalid last video position");
            }
        }
    }

    public void K() {
        o oVar = this.O;
        if (oVar != null) {
            oVar.a();
            final o oVar2 = this.O;
            Objects.requireNonNull(oVar2);
            a(new Runnable() {
                @Override
                public final void run() {
                    o.this.b();
                }
            }, 2000L);
        }
    }

    protected void W() {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                v9.this.N();
            }
        });
    }

    public void N() {
        o oVar = this.O;
        if (oVar != null) {
            oVar.a();
        }
    }

    protected void G() {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                v9.this.J();
            }
        });
    }

    public void J() {
        o oVar = this.O;
        if (oVar != null) {
            oVar.b();
        }
    }

    protected boolean H() {
        if (this.I && this.a.Y0()) {
            return true;
        }
        return I();
    }

    protected boolean I() {
        return E() >= this.a.m0();
    }

    protected void a(MotionEvent motionEvent, Bundle bundle) {
        Context context;
        if (this.a.G0()) {
            if (com.applovin.impl.sdk.n.a()) {
                this.c.a("AppLovinFullscreenActivity", "Clicking through video");
            }
            Uri j0 = this.a.j0();
            if (j0 != null) {
                if (!((Boolean) this.b.a(sj.H)).booleanValue() || (context = this.d) == null) {
                    AppLovinAdView appLovinAdView = this.i;
                    context = appLovinAdView != null ? appLovinAdView.getContext() : com.applovin.impl.sdk.j.l();
                }
                this.b.i().trackAndLaunchVideoClick(this.a, j0, motionEvent, bundle, this, context);
                gc.a(this.C, this.a);
                this.z++;
                return;
            }
            return;
        }
        P();
    }

    protected int E() {
        long currentPosition = this.N.getCurrentPosition();
        if (this.i0) {
            return 100;
        }
        if (currentPosition > 0) {
            return (int) ((currentPosition / this.e0) * 100.0f);
        }
        return this.f0;
    }

    protected boolean U() {
        return l() && !H();
    }

    class c implements v4.b {
        final long a;
        final Integer b;
        final Long c;

        c(long j, Integer num, Long l) {
            this.a = j;
            this.b = num;
            this.c = l;
        }

        @Override
        public void a() {
            v9.this.U.setProgress((int) ((v9.this.r / this.a) * this.b.intValue()));
            v9.this.r += this.c.longValue();
        }

        @Override
        public boolean b() {
            return v9.this.r < this.a;
        }
    }

    public void O() {
        this.q = SystemClock.elapsedRealtime();
    }

    protected void Z() {
        MediaPlayer mediaPlayer = this.M;
        if (mediaPlayer == null) {
            return;
        }
        try {
            float f2 = this.d0 ? 1.0f : 0.0f;
            mediaPlayer.setVolume(f2, f2);
            boolean z = !this.d0;
            this.d0 = z;
            e(z);
            a(this.d0, 0L);
        } catch (Throwable unused) {
        }
    }

    protected void c(long j) {
        this.e0 = j;
    }

    @Override
    public void c() {
        if (com.applovin.impl.sdk.n.a()) {
            this.c.a("AppLovinFullscreenActivity", "Continue video from prompt - will resume in onWindowFocusChanged(true) when alert dismisses");
        }
    }

    @Override
    protected void q() {
        super.a(E(), this.c0, H(), this.l0);
    }

    protected void R() {
        long V;
        long millis;
        if (this.a.U() >= 0 || this.a.V() >= 0) {
            if (this.a.U() >= 0) {
                V = this.a.U();
            } else {
                com.applovin.impl.sdk.ad.a aVar = (com.applovin.impl.sdk.ad.a) this.a;
                long j = this.e0;
                long j2 = j > 0 ? j : 0L;
                if (aVar.V0()) {
                    int j1 = (int) ((com.applovin.impl.sdk.ad.a) this.a).j1();
                    if (j1 > 0) {
                        millis = TimeUnit.SECONDS.toMillis(j1);
                    } else {
                        int p = (int) aVar.p();
                        if (p > 0) {
                            millis = TimeUnit.SECONDS.toMillis(p);
                        }
                    }
                    j2 += millis;
                }
                V = (long) (j2 * (this.a.V() / 100.0d));
            }
            b(V);
        }
    }

    @Override
    public void j() {
        super.j();
        this.L.a(this.S);
        this.L.a((View) this.P);
        if (!l() || this.h0) {
            V();
        }
    }

    @Override
    public void i() {
        super.i();
        V();
    }

    public void V() {
        this.L.a(this.l);
        this.q = SystemClock.elapsedRealtime();
    }

    public void onMessageReceived(AppLovinCommunicatorMessage appLovinCommunicatorMessage) {
        if ("video_caching_failed".equals(appLovinCommunicatorMessage.getTopic())) {
            Bundle messageData = appLovinCommunicatorMessage.getMessageData();
            if (messageData.getLong("ad_id") == this.a.getAdIdNumber() && this.c0) {
                int i = messageData.getInt("load_response_code");
                String string = messageData.getString("load_exception_message");
                if ((string == null && i >= 200 && i < 300) || this.i0 || this.N.isPlaying()) {
                    return;
                }
                d("Video cache error during stream. ResponseCode=" + i + ", exception=" + string);
            }
        }
    }

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

        @Override
        public void onPrepared(MediaPlayer mediaPlayer) {
            v9.this.M = mediaPlayer;
            mediaPlayer.setOnInfoListener(v9.this.W);
            mediaPlayer.setOnErrorListener(v9.this.W);
            float f = !v9.this.d0 ? 1 : 0;
            mediaPlayer.setVolume(f, f);
            v9.this.u = (int) TimeUnit.MILLISECONDS.toSeconds(mediaPlayer.getDuration());
            v9.this.c(mediaPlayer.getDuration());
            v9.this.R();
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "MediaPlayer prepared: " + v9.this.M);
            }
        }

        @Override
        public boolean onInfo(MediaPlayer mediaPlayer, int i, int i2) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "MediaPlayer Info: (" + i + ", " + i2 + ")");
            }
            if (i == 701) {
                v9.this.W();
                return false;
            }
            if (i != 3) {
                if (i != 702) {
                    return false;
                }
                v9.this.G();
                return false;
            }
            v9.this.a0.b();
            v9 v9Var = v9.this;
            if (v9Var.P != null) {
                v9Var.S();
            }
            v9.this.G();
            if (!v9.this.F.b()) {
                return false;
            }
            v9.this.z();
            return false;
        }

        @Override
        public boolean onError(MediaPlayer mediaPlayer, int i, int i2) {
            v9.this.d("Video view error (" + i + "," + i2 + ")");
            v9.this.N.start();
            return true;
        }

        @Override
        public void onCompletion(MediaPlayer mediaPlayer) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Video completed");
            }
            v9.this.i0 = true;
            v9 v9Var = v9.this;
            if (!v9Var.t) {
                v9Var.X();
            } else if (v9Var.l()) {
                v9.this.V();
            }
        }

        @Override
        public void onClick(View view, MotionEvent motionEvent) {
            v9.this.a(motionEvent, (Bundle) null);
        }

        e(v9 v9Var, a aVar) {
            this();
        }
    }

    private void f(boolean z) {
        this.f0 = E();
        if (z) {
            this.N.pause();
        } else {
            this.N.stopPlayback();
        }
    }

    private class f implements View.OnClickListener {
        private f() {
        }

        @Override
        public void onClick(View view) {
            v9 v9Var = v9.this;
            if (view == v9Var.P) {
                v9Var.Y();
                return;
            }
            if (view == v9Var.R) {
                v9Var.Z();
                return;
            }
            com.applovin.impl.sdk.n nVar = v9Var.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.b("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
            }
        }

        f(v9 v9Var, a aVar) {
            this();
        }
    }

    private class d implements rr.a {
        private d() {
        }

        @Override
        public void b(com.applovin.impl.adview.l lVar) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Clicking through from video button...");
            }
            v9.this.a(lVar.getAndClearLastClickEvent(), (Bundle) null);
        }

        @Override
        public void a(com.applovin.impl.adview.l lVar) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Closing ad from video button...");
            }
            v9.this.f();
        }

        @Override
        public void d(com.applovin.impl.adview.l lVar) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Skipping video from video button...");
            }
            v9.this.Y();
        }

        @Override
        public void c(com.applovin.impl.adview.l lVar) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Fully Watched from video button...");
            }
            v9.this.I = true;
        }

        d(v9 v9Var, a aVar) {
            this();
        }

        @Override
        public void a(com.applovin.impl.adview.l lVar, Bundle bundle) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Attempting to launch Direct Download from video button...");
            }
            v9.this.a(lVar.getAndClearLastClickEvent(), bundle);
        }

        @Override
        public void b(Uri uri, com.applovin.impl.adview.l lVar) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Attempting to report a template error from video button...");
            }
            tp.b(uri, v9.this.i.getController().i(), v9.this.b);
        }

        @Override
        public void a(Uri uri, com.applovin.impl.adview.l lVar) {
            com.applovin.impl.sdk.n nVar = v9.this.c;
            if (com.applovin.impl.sdk.n.a()) {
                v9.this.c.a("AppLovinFullscreenActivity", "Attempting to load a url from video button...");
            }
            tp.a(uri, v9.this.i.getController(), v9.this.b);
        }
    }

    private static boolean a(boolean z, com.applovin.impl.sdk.j jVar) {
        if (!((Boolean) jVar.a(sj.v2)).booleanValue()) {
            return false;
        }
        if (!((Boolean) jVar.a(sj.w2)).booleanValue() || z) {
            return true;
        }
        return ((Boolean) jVar.a(sj.y2)).booleanValue();
    }

    @Override
    protected void a(final String str, long j) {
        super.a(str, j);
        if (this.S == null || j < 0 || !StringUtils.isValidString(str) || !((Boolean) this.b.a(sj.S2)).booleanValue()) {
            return;
        }
        a(new Runnable() {
            @Override
            public final void run() {
                v9.this.e(str);
            }
        }, j);
    }

    private void a(ProgressBar progressBar, int i, int i2) {
        progressBar.setMax(i2);
        progressBar.setPadding(0, 0, 0, 0);
        if (z3.f()) {
            progressBar.setProgressTintList(ColorStateList.valueOf(i));
        }
    }

    @Override
    public void a(ViewGroup viewGroup) {
        String str;
        this.L.a(this.R, this.P, this.S, this.O, this.T, this.Q, this.N, this.i, this.j, this.V, viewGroup);
        if (z3.i() && (str = this.b.g0().getExtraParameters().get("audio_focus_request")) != null) {
            this.N.setAudioFocusRequest(Integer.parseInt(str));
        }
        StrictMode.ThreadPolicy allowThreadDiskReads = StrictMode.allowThreadDiskReads();
        if (!yp.a(sj.n1, this.b)) {
            b(!this.c0);
        }
        this.N.setVideoURI(this.a.s0());
        StrictMode.setThreadPolicy(allowThreadDiskReads);
        if (this.a.b1()) {
            this.F.b(this.a, new Runnable() {
                @Override
                public final void run() {
                    v9.this.M();
                }
            });
        }
        com.applovin.impl.adview.k kVar = this.j;
        if (kVar != null) {
            kVar.b();
        }
        this.N.start();
        if (this.c0) {
            W();
        }
        this.i.renderAd(this.a);
        if (this.P != null) {
            this.b.j0().a(new jn(this.b, "scheduleSkipButton", new Runnable() {
                @Override
                public final void run() {
                    v9.this.S();
                }
            }), tm.b.TIMEOUT, this.a.l0(), true);
        }
        super.d(this.d0);
    }

    @Override
    public void a(long j) {
        a(new Runnable() {
            @Override
            public final void run() {
                v9.this.Q();
            }
        }, j);
    }
}