光速虚拟机 v3.8.2版本的 MD5 值为:68970fb34f75fa0f2632de9e93032f55

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


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

import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.view.KeyEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewParent;
import com.applovin.adview.AppLovinAdView;
import com.applovin.adview.AppLovinFullscreenActivity;
import com.applovin.impl.adview.j;
import com.applovin.impl.adview.n;
import com.applovin.impl.adview.p;
import com.applovin.impl.adview.q;
import com.applovin.impl.adview.v;
import com.applovin.impl.sdk.AppLovinBroadcastManager;
import com.applovin.impl.sdk.b.b;
import com.applovin.impl.sdk.e.ac;
import com.applovin.impl.sdk.e.r;
import com.applovin.impl.sdk.j;
import com.applovin.impl.sdk.k;
import com.applovin.impl.sdk.o;
import com.applovin.impl.sdk.s;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.t;
import com.applovin.impl.sdk.utils.w;
import com.applovin.impl.sdk.utils.x;
import com.applovin.impl.sdk.y;
import com.applovin.sdk.AppLovinAd;
import com.applovin.sdk.AppLovinAdClickListener;
import com.applovin.sdk.AppLovinAdDisplayListener;
import com.applovin.sdk.AppLovinAdSize;
import com.applovin.sdk.AppLovinAdType;
import com.applovin.sdk.AppLovinAdVideoPlaybackListener;
import com.applovin.sdk.AppLovinSdkUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
public abstract class a implements AppLovinBroadcastManager.Receiver, b.a {
    private final j.a A;
    private long D;
    private boolean E;
    private final k H;
    protected final com.applovin.impl.sdk.ad.e a;
    protected final o b;
    protected final y c;
    protected final com.applovin.impl.sdk.d.d d;
    protected Activity e;
    protected AppLovinAdView f;
    protected v g;
    protected final n h;
    protected final n i;
    protected long l;
    protected boolean m;
    protected int n;
    protected boolean o;
    protected boolean s;
    protected AppLovinAdClickListener t;
    protected AppLovinAdDisplayListener u;
    protected AppLovinAdVideoPlaybackListener v;
    protected final com.applovin.impl.sdk.b.b w;
    protected t x;
    private final com.applovin.impl.sdk.utils.a z;
    private final Handler y = new Handler(Looper.getMainLooper());
    protected final long j = SystemClock.elapsedRealtime();
    private final AtomicBoolean B = new AtomicBoolean();
    private final AtomicBoolean C = new AtomicBoolean();
    protected long k = -1;
    private int F = 0;
    private final ArrayList<Long> G = new ArrayList<>();
    protected int p = 0;
    protected int q = 0;
    protected int r = j.a;
    private boolean I = false;

    public class AnonymousClass6 implements Runnable {
        final n a;
        final Runnable b;

        AnonymousClass6(n nVar, Runnable runnable) {
            this.a = nVar;
            this.b = runnable;
        }

        @Override
        public void run() {
            AppLovinSdkUtils.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    x.a(AnonymousClass6.this.a, 400L, new Runnable() {
                        @Override
                        public void run() {
                            AnonymousClass6.this.a.bringToFront();
                            AnonymousClass6.this.b.run();
                        }
                    });
                }
            });
        }
    }

    public interface InterfaceC0046a {
        void a(a aVar);

        void a(String str, Throwable th);
    }

    private class b implements View.OnClickListener, AppLovinAdClickListener {
        private b() {
        }

        @Override
        public void adClicked(AppLovinAd appLovinAd) {
            y yVar = a.this.c;
            if (y.a()) {
                a.this.c.b("AppLovinFullscreenActivity", "Clicking through graphic");
            }
            com.applovin.impl.sdk.utils.o.a(a.this.t, appLovinAd);
            a.this.d.b();
            a.this.q++;
        }

        @Override
        public void onClick(View view) {
            if (view != a.this.h || !((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.cL)).booleanValue()) {
                y yVar = a.this.c;
                if (y.a()) {
                    y yVar2 = a.this.c;
                    yVar2.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
                    return;
                }
                return;
            }
            a.b(a.this);
            if (a.this.a.aa()) {
                a aVar = a.this;
                aVar.b("javascript:al_onCloseButtonTapped(" + a.this.F + "," + a.this.p + "," + a.this.q + ");");
            }
            List<Integer> u = a.this.a.u();
            y yVar3 = a.this.c;
            if (y.a()) {
                y yVar4 = a.this.c;
                yVar4.b("AppLovinFullscreenActivity", "Handling close button tap " + a.this.F + " with multi close delay: " + u);
            }
            if (u == null || u.size() <= a.this.F) {
                a.this.h();
                return;
            }
            a.this.G.add(Long.valueOf(SystemClock.elapsedRealtime() - a.this.k));
            List<j.a> w = a.this.a.w();
            if (w != null && w.size() > a.this.F) {
                a.this.h.a(w.get(a.this.F));
            }
            y yVar5 = a.this.c;
            if (y.a()) {
                y yVar6 = a.this.c;
                yVar6.b("AppLovinFullscreenActivity", "Scheduling next close button with delay: " + u.get(a.this.F));
            }
            a.this.h.setVisibility(8);
            a aVar2 = a.this;
            aVar2.a(aVar2.h, u.get(a.this.F).intValue(), new Runnable() {
                @Override
                public void run() {
                    a.this.k = SystemClock.elapsedRealtime();
                }
            });
        }
    }

    public a(com.applovin.impl.sdk.ad.e eVar, Activity activity, Map<String, Object> map, o oVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
        this.a = eVar;
        this.b = oVar;
        this.c = oVar.F();
        this.e = activity;
        this.t = appLovinAdClickListener;
        this.u = appLovinAdDisplayListener;
        this.v = appLovinAdVideoPlaybackListener;
        com.applovin.impl.sdk.b.b bVar = new com.applovin.impl.sdk.b.b(activity, oVar);
        this.w = bVar;
        bVar.a(this);
        com.applovin.impl.sdk.d.d dVar = new com.applovin.impl.sdk.d.d(eVar, oVar);
        this.d = dVar;
        this.H = new k(oVar);
        b bVar2 = new b();
        if (((Boolean) oVar.a(com.applovin.impl.sdk.c.b.dd)).booleanValue()) {
            AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.render_process_gone"));
        }
        com.applovin.impl.adview.o oVar2 = new com.applovin.impl.adview.o(oVar.aA(), AppLovinAdSize.INTERSTITIAL, activity);
        this.f = oVar2;
        oVar2.setAdClickListener(bVar2);
        this.f.setAdDisplayListener(new AppLovinAdDisplayListener() {
            @Override
            public void adDisplayed(AppLovinAd appLovinAd) {
                y yVar = a.this.c;
                if (y.a()) {
                    a.this.c.b("AppLovinFullscreenActivity", "Web content rendered");
                }
            }

            @Override
            public void adHidden(AppLovinAd appLovinAd) {
                y yVar = a.this.c;
                if (y.a()) {
                    a.this.c.b("AppLovinFullscreenActivity", "Closing from WebView");
                }
                a.this.h();
            }
        });
        this.f.getController().a(dVar);
        if (((Boolean) oVar.a(com.applovin.impl.sdk.c.b.ay)).booleanValue()) {
            p pVar = new p(map, oVar);
            if (pVar.c()) {
                this.g = new v(pVar, activity);
            }
        }
        oVar.v().trackImpression(eVar);
        List<Integer> u = eVar.u();
        if (eVar.t() >= 0 || u != null) {
            n nVar = new n(eVar.v(), activity);
            this.h = nVar;
            nVar.setVisibility(8);
            nVar.setOnClickListener(bVar2);
        } else {
            this.h = null;
        }
        n nVar2 = new n(j.a.WHITE_ON_TRANSPARENT, activity);
        this.i = nVar2;
        nVar2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                a.this.h();
            }
        });
        if (eVar.aq()) {
            this.A = new j.a() {
                @Override
                public void a(int i) {
                    if (a.this.r != com.applovin.impl.sdk.j.a) {
                        a.this.s = true;
                    }
                    com.applovin.impl.adview.d s = a.this.f.getController().s();
                    if (com.applovin.impl.sdk.j.a(i) && !com.applovin.impl.sdk.j.a(a.this.r)) {
                        s.a("javascript:al_muteSwitchOn();");
                    } else if (i == 2) {
                        s.a("javascript:al_muteSwitchOff();");
                    }
                    a.this.r = i;
                }
            };
        } else {
            this.A = null;
        }
        if (((Boolean) oVar.a(com.applovin.impl.sdk.c.b.gd)).booleanValue()) {
            this.z = new com.applovin.impl.sdk.utils.a() {
                @Override
                public void onActivityCreated(Activity activity2, Bundle bundle) {
                    if (a.this.C.get()) {
                        return;
                    }
                    if (activity2.getClass().getName().equals(w.b(activity2.getApplicationContext()))) {
                        AppLovinSdkUtils.runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                y.j("AppLovinFullscreenActivity", "Dismissing on-screen ad due to app relaunched via launcher.");
                                try {
                                    a.this.h();
                                } catch (Throwable th) {
                                    y.c("AppLovinFullscreenActivity", "Failed to dismiss ad.", th);
                                    try {
                                        a.this.o();
                                    } catch (Throwable unused) {
                                    }
                                }
                            }
                        });
                    }
                }
            };
        } else {
            this.z = null;
        }
    }

    public static void a(com.applovin.impl.sdk.ad.e eVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener, Map<String, Object> map, o oVar, Activity activity, InterfaceC0046a interfaceC0046a) {
        a bVar;
        boolean aO = eVar.aO();
        if (eVar instanceof com.applovin.impl.c.a) {
            if (aO) {
                try {
                    bVar = new c(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                } catch (Throwable th) {
                    oVar.F();
                    if (y.a()) {
                        oVar.F().a("AppLovinFullscreenActivity", "Failed to create ExoPlayer presenter to show the ad. Falling back to using native media player presenter.", th);
                    }
                    try {
                        bVar = new d(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                    } catch (Throwable th2) {
                        interfaceC0046a.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + oVar + " and throwable: " + th2.getMessage(), th2);
                        return;
                    }
                }
            } else {
                try {
                    bVar = new d(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                } catch (Throwable th3) {
                    interfaceC0046a.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + oVar + " and throwable: " + th3.getMessage(), th3);
                    return;
                }
            }
        } else if (!eVar.hasVideoUrl()) {
            try {
                bVar = new com.applovin.impl.adview.activity.b.b(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th4) {
                interfaceC0046a.a("Failed to create FullscreenGraphicAdPresenter with sdk: " + oVar + " and throwable: " + th4.getMessage(), th4);
                return;
            }
        } else if (eVar.aR()) {
            try {
                bVar = new g(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th5) {
                interfaceC0046a.a("Failed to create FullscreenWebVideoAdPresenter with sdk: " + oVar + " and throwable: " + th5.getMessage(), th5);
                return;
            }
        } else if (aO) {
            try {
                bVar = new e(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th6) {
                oVar.F();
                if (y.a()) {
                    oVar.F().a("AppLovinFullscreenActivity", "Failed to create ExoPlayer presenter to show the ad. Falling back to using native media player presenter.", th6);
                }
                try {
                    bVar = new f(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                } catch (Throwable th7) {
                    interfaceC0046a.a("Failed to create FullscreenVideoAdExoPlayerPresenter with sdk: " + oVar + " and throwable: " + th7.getMessage(), th7);
                    return;
                }
            }
        } else {
            try {
                bVar = new f(eVar, activity, map, oVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th8) {
                interfaceC0046a.a("Failed to create FullscreenVideoAdPresenter with sdk: " + oVar + " and throwable: " + th8.getMessage(), th8);
                return;
            }
        }
        bVar.c();
        interfaceC0046a.a(bVar);
    }

    static int b(a aVar) {
        int i = aVar.F;
        aVar.F = i + 1;
        return i;
    }

    private void c() {
        if (this.A != null) {
            this.b.Z().a(this.A);
        }
        if (this.z != null) {
            this.b.E().a(this.z);
        }
    }

    public void a(int i, KeyEvent keyEvent) {
        if (this.c == null || !y.a()) {
            return;
        }
        y yVar = this.c;
        yVar.c("AppLovinFullscreenActivity", "onKeyDown(int, KeyEvent) -  " + i + ", " + keyEvent);
    }

    public void a(int i, boolean z, boolean z2, long j) {
        if (this.B.compareAndSet(false, true)) {
            if (this.a.hasVideoUrl() || u()) {
                com.applovin.impl.sdk.utils.o.a(this.v, this.a, i, z2);
            }
            if (this.a.hasVideoUrl()) {
                this.d.c(i);
            }
            long elapsedRealtime = SystemClock.elapsedRealtime() - this.j;
            this.b.v().trackVideoEnd(this.a, TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime), i, z);
            long elapsedRealtime2 = this.k != -1 ? SystemClock.elapsedRealtime() - this.k : -1L;
            this.b.v().trackFullScreenAdClosed(this.a, elapsedRealtime2, this.G, j, this.s, this.r);
            if (y.a()) {
                y yVar = this.c;
                yVar.b("AppLovinFullscreenActivity", "Video ad ended at percent: " + i + "%, elapsedTime: " + elapsedRealtime + "ms, skipTimeMillis: " + j + "ms, closeTimeMillis: " + elapsedRealtime2 + "ms");
            }
        }
    }

    public abstract void a(long j);

    public void a(Configuration configuration) {
        if (y.a()) {
            y yVar = this.c;
            yVar.c("AppLovinFullscreenActivity", "onConfigurationChanged(Configuration) -  " + configuration);
        }
    }

    public abstract void a(ViewGroup viewGroup);

    public void a(n nVar, long j, Runnable runnable) {
        if (j >= ((Long) this.b.a(com.applovin.impl.sdk.c.b.cK)).longValue()) {
            return;
        }
        this.b.G().a(new ac(this.b, "fadeInCloseButton", new AnonymousClass6(nVar, runnable)), r.b.MAIN, TimeUnit.SECONDS.toMillis(j), true);
    }

    public void a(Runnable runnable, long j) {
        AppLovinSdkUtils.runOnUiThreadDelayed(runnable, j, this.y);
    }

    protected void a(String str) {
        if (this.a.ab()) {
            a(str, 0L);
        }
    }

    public void a(final String str, long j) {
        if (j >= 0) {
            a(new Runnable() {
                @Override
                public void run() {
                    com.applovin.impl.adview.d s;
                    if (!StringUtils.isValidString(str) || a.this.f == null || (s = a.this.f.getController().s()) == null) {
                        return;
                    }
                    s.a(str);
                }
            }, j);
        }
    }

    public void a(boolean z) {
        List<Uri> a = w.a(z, this.a, this.b, this.e);
        if (a.isEmpty()) {
            return;
        }
        if (!((Boolean) this.b.a(com.applovin.impl.sdk.c.b.gi)).booleanValue()) {
            if (y.a()) {
                y yVar = this.c;
                yVar.e("AppLovinFullscreenActivity", "Streaming ad due to missing ad resources: " + a);
            }
            this.a.a();
            return;
        }
        if (y.a()) {
            y yVar2 = this.c;
            yVar2.e("AppLovinFullscreenActivity", "Dismissing ad due to missing resources: " + a);
        }
        q.a(this.a, this.u, "Missing ad resources", null, null);
        h();
    }

    public void a(boolean z, long j) {
        if (this.a.Z()) {
            a(z ? "javascript:al_mute();" : "javascript:al_unmute();", j);
        }
    }

    public void b(long j) {
        if (y.a()) {
            y yVar = this.c;
            yVar.b("AppLovinFullscreenActivity", "Scheduling report reward in " + TimeUnit.MILLISECONDS.toSeconds(j) + " seconds...");
        }
        this.x = t.a(j, this.b, new Runnable() {
            @Override
            public void run() {
                if (a.this.a.al().getAndSet(true)) {
                    return;
                }
                a.this.b.G().a(new com.applovin.impl.sdk.e.y(a.this.a, a.this.b), r.b.REWARD);
            }
        });
    }

    public void b(String str) {
        a(str, 0L);
    }

    public void b(boolean z) {
        a(z, ((Long) this.b.a(com.applovin.impl.sdk.c.b.da)).longValue());
        com.applovin.impl.sdk.utils.o.a(this.u, this.a);
        this.b.V().a(this.a);
        if (this.a.hasVideoUrl() || u()) {
            com.applovin.impl.sdk.utils.o.a(this.v, this.a);
        }
        new com.applovin.impl.adview.activity.b(this.e).a(this.a);
        this.d.a();
        this.a.setHasShown(true);
    }

    public void c(boolean z) {
        if (y.a()) {
            y yVar = this.c;
            yVar.c("AppLovinFullscreenActivity", "onWindowFocusChanged(boolean) - " + z);
        }
        a("javascript:al_onWindowFocusChanged( " + z + " );");
    }

    public abstract void d();

    public abstract void e();

    public void f() {
        if (y.a()) {
            this.c.c("AppLovinFullscreenActivity", "onResume()");
        }
        this.d.d(SystemClock.elapsedRealtime() - this.D);
        a("javascript:al_onAppResumed();");
        r();
        if (this.w.c()) {
            this.w.a();
        }
    }

    public void g() {
        if (y.a()) {
            this.c.c("AppLovinFullscreenActivity", "onPause()");
        }
        this.D = SystemClock.elapsedRealtime();
        a("javascript:al_onAppPaused();");
        if (this.w.c()) {
            this.w.a();
        }
        q();
    }

    public void h() {
        this.E = true;
        if (y.a()) {
            this.c.c("AppLovinFullscreenActivity", "dismiss()");
        }
        com.applovin.impl.sdk.ad.e eVar = this.a;
        if (eVar != null) {
            eVar.o().e();
        }
        this.y.removeCallbacksAndMessages(null);
        a("javascript:al_onPoststitialDismiss();", this.a.Y());
        o();
        this.d.c();
        this.H.a();
        if (this.A != null) {
            this.b.Z().b(this.A);
        }
        if (this.z != null) {
            this.b.E().b(this.z);
        }
        if (p()) {
            this.e.finish();
            return;
        }
        this.b.F();
        if (y.a()) {
            this.b.F().b("AppLovinFullscreenActivity", "Fullscreen ad shown in container view dismissed, destroying the presenter.");
        }
        k();
    }

    public boolean i() {
        return this.E;
    }

    public void j() {
        if (y.a()) {
            this.c.c("AppLovinFullscreenActivity", "onStop()");
        }
    }

    public void k() {
        AppLovinAdView appLovinAdView = this.f;
        if (appLovinAdView != null) {
            ViewParent parent = appLovinAdView.getParent();
            this.f.destroy();
            this.f = null;
            if ((parent instanceof ViewGroup) && p()) {
                ((ViewGroup) parent).removeAllViews();
            }
        }
        n();
        o();
        this.t = null;
        this.u = null;
        this.v = null;
        this.e = null;
        AppLovinBroadcastManager.unregisterReceiver(this);
    }

    public void l() {
        if (y.a()) {
            this.c.c("AppLovinFullscreenActivity", "onBackPressed()");
        }
        if (this.I) {
            h();
        }
        if (this.a.aa()) {
            b("javascript:onBackPressed();");
        }
    }

    public int m() {
        int H = this.a.H();
        return (H <= 0 && ((Boolean) this.b.a(com.applovin.impl.sdk.c.b.cZ)).booleanValue()) ? this.n + 1 : H;
    }

    protected abstract void n();

    protected void o() {
        if (this.C.compareAndSet(false, true)) {
            com.applovin.impl.sdk.utils.o.b(this.u, this.a);
            this.b.V().b(this.a);
        }
    }

    @Override
    public void onReceive(Intent intent, Map<String, Object> map) {
        if (!"com.applovin.render_process_gone".equals(intent.getAction()) || this.m) {
            return;
        }
        x();
    }

    protected boolean p() {
        return this.e instanceof AppLovinFullscreenActivity;
    }

    public void q() {
        t tVar = this.x;
        if (tVar != null) {
            tVar.b();
        }
    }

    protected void r() {
        t tVar = this.x;
        if (tVar != null) {
            tVar.c();
        }
    }

    protected abstract boolean s();

    protected abstract boolean t();

    public boolean u() {
        return AppLovinAdType.INCENTIVIZED == this.a.getType() || AppLovinAdType.AUTO_INCENTIVIZED == this.a.getType();
    }

    protected abstract void v();

    public void w() {
        com.applovin.impl.adview.d s;
        if (this.f == null || !this.a.G() || (s = this.f.getController().s()) == null) {
            return;
        }
        this.H.a(s, new k.a() {
            @Override
            public void a(View view) {
                a.this.b.ag().a(s.a.BLACK_VIEW, CollectionUtils.map("clcode", a.this.a.getClCode()));
                if (((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.gA)).booleanValue()) {
                    a.this.h();
                    return;
                }
                a aVar = a.this;
                aVar.I = ((Boolean) aVar.b.a(com.applovin.impl.sdk.c.b.gB)).booleanValue();
                if (!((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.gC)).booleanValue() || a.this.h == null) {
                    return;
                }
                a.this.h.setVisibility(0);
            }
        });
    }

    public void x() {
        if (y.a()) {
            this.c.c("AppLovinFullscreenActivity", "Handling render process crash");
        }
        this.m = true;
    }
}