Perfume Of Love v2.14.9版本的 MD5 值为:16011aefc5a55805771706ce3b259b4e

以下内容为反编译后的 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.i;
import com.applovin.impl.adview.m;
import com.applovin.impl.sdk.AppLovinBroadcastManager;
import com.applovin.impl.sdk.b.b;
import com.applovin.impl.sdk.e.o;
import com.applovin.impl.sdk.e.z;
import com.applovin.impl.sdk.h;
import com.applovin.impl.sdk.i;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.AppKilledService;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.Utils;
import com.applovin.impl.sdk.utils.k;
import com.applovin.impl.sdk.utils.p;
import com.applovin.impl.sdk.utils.r;
import com.applovin.impl.sdk.v;
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 long A;
    private boolean B;
    private final i E;
    protected final com.applovin.impl.sdk.ad.e a;
    protected final n b;
    protected final v c;
    protected final com.applovin.impl.sdk.d.d d;
    protected Activity e;
    protected AppLovinAdView f;
    protected final m g;
    protected final m h;
    protected boolean k;
    protected boolean o;
    protected AppLovinAdClickListener p;
    protected AppLovinAdDisplayListener q;
    protected AppLovinAdVideoPlaybackListener r;
    protected final com.applovin.impl.sdk.b.b s;
    protected p t;
    private final com.applovin.impl.sdk.utils.a v;
    private final AppLovinBroadcastManager.Receiver w;
    private final h.a x;
    private final Handler u = new Handler(Looper.getMainLooper());
    protected final long i = SystemClock.elapsedRealtime();
    private final AtomicBoolean y = new AtomicBoolean();
    private final AtomicBoolean z = new AtomicBoolean();
    protected long j = -1;
    private int C = 0;
    private final ArrayList<Long> D = new ArrayList<>();
    protected int l = 0;
    protected int m = 0;
    protected int n = h.a;
    private boolean F = false;

    public class AnonymousClass9 implements Runnable {
        final m a;
        final Runnable b;

        AnonymousClass9(m mVar, Runnable runnable) {
            this.a = mVar;
            this.b = runnable;
        }

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

    public interface InterfaceC0065a {
        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) {
            v vVar = a.this.c;
            if (v.a()) {
                a.this.c.b("AppLovinFullscreenActivity", "Clicking through graphic");
            }
            k.a(a.this.p, appLovinAd);
            a.this.d.b();
            a.this.m++;
        }

        @Override
        public void onClick(View view) {
            if (view != a.this.g || !((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.cB)).booleanValue()) {
                v vVar = a.this.c;
                if (v.a()) {
                    v vVar2 = a.this.c;
                    vVar2.e("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
                    return;
                }
                return;
            }
            a.d(a.this);
            if (a.this.a.V()) {
                a aVar = a.this;
                aVar.b("javascript:al_onCloseButtonTapped(" + a.this.C + "," + a.this.l + "," + a.this.m + ");");
            }
            List<Integer> u = a.this.a.u();
            v vVar3 = a.this.c;
            if (v.a()) {
                v vVar4 = a.this.c;
                vVar4.b("AppLovinFullscreenActivity", "Handling close button tap " + a.this.C + " with multi close delay: " + u);
            }
            if (u == null || u.size() <= a.this.C) {
                a.this.h();
                return;
            }
            a.this.D.add(Long.valueOf(SystemClock.elapsedRealtime() - a.this.j));
            List<i.a> w = a.this.a.w();
            if (w != null && w.size() > a.this.C) {
                a.this.g.a(w.get(a.this.C));
            }
            v vVar5 = a.this.c;
            if (v.a()) {
                v vVar6 = a.this.c;
                vVar6.b("AppLovinFullscreenActivity", "Scheduling next close button with delay: " + u.get(a.this.C));
            }
            a.this.g.setVisibility(8);
            a aVar2 = a.this;
            aVar2.a(aVar2.g, u.get(a.this.C).intValue(), new Runnable() {
                @Override
                public void run() {
                    a.this.j = SystemClock.elapsedRealtime();
                }
            });
        }
    }

    public a(final com.applovin.impl.sdk.ad.e eVar, Activity activity, final n nVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
        this.a = eVar;
        this.b = nVar;
        this.c = nVar.J();
        this.e = activity;
        this.p = appLovinAdClickListener;
        this.q = appLovinAdDisplayListener;
        this.r = appLovinAdVideoPlaybackListener;
        com.applovin.impl.sdk.b.b bVar = new com.applovin.impl.sdk.b.b(activity, nVar);
        this.s = bVar;
        bVar.a(this);
        com.applovin.impl.sdk.d.d dVar = new com.applovin.impl.sdk.d.d(eVar, nVar);
        this.d = dVar;
        this.E = new com.applovin.impl.sdk.i(nVar);
        b bVar2 = new b();
        if (((Boolean) nVar.a(com.applovin.impl.sdk.c.b.cT)).booleanValue()) {
            AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.render_process_gone"));
        }
        com.applovin.impl.adview.n nVar2 = new com.applovin.impl.adview.n(nVar.I(), AppLovinAdSize.INTERSTITIAL, activity);
        this.f = nVar2;
        nVar2.setAdClickListener(bVar2);
        this.f.setAdDisplayListener(new AppLovinAdDisplayListener() {
            @Override
            public void adDisplayed(AppLovinAd appLovinAd) {
                v vVar = a.this.c;
                if (v.a()) {
                    a.this.c.b("AppLovinFullscreenActivity", "Web content rendered");
                }
            }

            @Override
            public void adHidden(AppLovinAd appLovinAd) {
                v vVar = a.this.c;
                if (v.a()) {
                    a.this.c.b("AppLovinFullscreenActivity", "Closing from WebView");
                }
                a.this.h();
            }
        });
        this.f.getController().a(dVar);
        nVar.D().trackImpression(eVar);
        List<Integer> u = eVar.u();
        if (eVar.t() >= 0 || u != null) {
            m mVar = new m(eVar.v(), activity);
            this.g = mVar;
            mVar.setVisibility(8);
            mVar.setOnClickListener(bVar2);
        } else {
            this.g = null;
        }
        m mVar2 = new m(i.a.WHITE_ON_TRANSPARENT, activity);
        this.h = mVar2;
        mVar2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                a.this.h();
            }
        });
        if (((Boolean) nVar.a(com.applovin.impl.sdk.c.b.cD)).booleanValue()) {
            this.w = new AppLovinBroadcastManager.Receiver() {
                @Override
                public void onReceive(Intent intent, Map<String, Object> map) {
                    nVar.D().trackAppKilled(eVar);
                    AppLovinBroadcastManager.unregisterReceiver(this);
                }
            };
        } else {
            this.w = null;
        }
        if (eVar.al()) {
            this.x = new h.a() {
                @Override
                public void a(int i) {
                    String str;
                    if (a.this.n != h.a) {
                        a.this.o = true;
                    }
                    com.applovin.impl.adview.d s = a.this.f.getController().s();
                    if (!h.a(i) || h.a(a.this.n)) {
                        str = i == 2 ? "javascript:al_muteSwitchOff();" : "javascript:al_muteSwitchOff();";
                        a.this.n = i;
                    }
                    str = "javascript:al_muteSwitchOn();";
                    s.a(str);
                    a.this.n = i;
                }
            };
        } else {
            this.x = null;
        }
        if (((Boolean) nVar.a(com.applovin.impl.sdk.c.b.eW)).booleanValue()) {
            this.v = new com.applovin.impl.sdk.utils.a() {
                @Override
                public void onActivityCreated(Activity activity2, Bundle bundle) {
                    if (a.this.z.get()) {
                        return;
                    }
                    if (activity2.getClass().getName().equals(Utils.retrieveLauncherActivityFullyQualifiedName(activity2.getApplicationContext()))) {
                        AppLovinSdkUtils.runOnUiThread(new Runnable() {
                            @Override
                            public void run() {
                                v.i("AppLovinFullscreenActivity", "Dismissing on-screen ad due to app relaunched via launcher.");
                                try {
                                    a.this.h();
                                } catch (Throwable th) {
                                    v.c("AppLovinFullscreenActivity", "Failed to dismiss ad.", th);
                                    try {
                                        a.this.n();
                                    } catch (Throwable unused) {
                                    }
                                }
                            }
                        });
                    }
                }
            };
        } else {
            this.v = null;
        }
    }

    public static void a(com.applovin.impl.sdk.ad.e eVar, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener, n nVar, Activity activity, InterfaceC0065a interfaceC0065a) {
        a bVar;
        boolean aH = eVar.aH();
        if (eVar instanceof com.applovin.impl.b.a) {
            if (aH) {
                try {
                    bVar = new c(eVar, activity, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                } catch (Throwable th) {
                    nVar.J();
                    if (v.a()) {
                        nVar.J().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, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                    } catch (Throwable th2) {
                        interfaceC0065a.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + nVar + " and throwable: " + th2.getMessage(), th2);
                        return;
                    }
                }
            } else {
                try {
                    bVar = new d(eVar, activity, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                } catch (Throwable th3) {
                    interfaceC0065a.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + nVar + " and throwable: " + th3.getMessage(), th3);
                    return;
                }
            }
        } else if (!eVar.hasVideoUrl()) {
            try {
                bVar = new com.applovin.impl.adview.activity.b.b(eVar, activity, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th4) {
                interfaceC0065a.a("Failed to create FullscreenGraphicAdPresenter with sdk: " + nVar + " and throwable: " + th4.getMessage(), th4);
                return;
            }
        } else if (eVar.aK()) {
            try {
                bVar = new g(eVar, activity, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th5) {
                interfaceC0065a.a("Failed to create FullscreenWebVideoAdPresenter with sdk: " + nVar + " and throwable: " + th5.getMessage(), th5);
                return;
            }
        } else if (aH) {
            try {
                bVar = new e(eVar, activity, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th6) {
                nVar.J();
                if (v.a()) {
                    nVar.J().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, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
                } catch (Throwable th7) {
                    interfaceC0065a.a("Failed to create FullscreenVideoAdExoPlayerPresenter with sdk: " + nVar + " and throwable: " + th7.getMessage(), th7);
                    return;
                }
            }
        } else {
            try {
                bVar = new f(eVar, activity, nVar, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th8) {
                interfaceC0065a.a("Failed to create FullscreenVideoAdPresenter with sdk: " + nVar + " and throwable: " + th8.getMessage(), th8);
                return;
            }
        }
        bVar.c();
        interfaceC0065a.a(bVar);
    }

    private void c() {
        AppLovinBroadcastManager.Receiver receiver = this.w;
        if (receiver != null) {
            AppLovinBroadcastManager.registerReceiver(receiver, new IntentFilter(AppKilledService.ACTION_APP_KILLED));
        }
        if (this.x != null) {
            this.b.Z().a(this.x);
        }
        if (this.v != null) {
            this.b.v().a(this.v);
        }
    }

    static int d(a aVar) {
        int i = aVar.C;
        aVar.C = i + 1;
        return i;
    }

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

    public void a(int i, boolean z, boolean z2, long j) {
        if (this.y.compareAndSet(false, true)) {
            if (this.a.hasVideoUrl() || t()) {
                k.a(this.r, this.a, i, z2);
            }
            if (this.a.hasVideoUrl()) {
                this.d.c(i);
            }
            long elapsedRealtime = SystemClock.elapsedRealtime() - this.i;
            this.b.D().trackVideoEnd(this.a, TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime), i, z);
            long elapsedRealtime2 = this.j != -1 ? SystemClock.elapsedRealtime() - this.j : -1L;
            this.b.D().trackFullScreenAdClosed(this.a, elapsedRealtime2, this.D, j, this.o, this.n);
            if (v.a()) {
                v vVar = this.c;
                vVar.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 (v.a()) {
            v vVar = this.c;
            vVar.c("AppLovinFullscreenActivity", "onConfigurationChanged(Configuration) -  " + configuration);
        }
    }

    public abstract void a(ViewGroup viewGroup);

    public void a(m mVar, long j, Runnable runnable) {
        if (j >= ((Long) this.b.a(com.applovin.impl.sdk.c.b.cA)).longValue()) {
            return;
        }
        this.b.K().a(new z(this.b, new AnonymousClass9(mVar, runnable)), o.a.MAIN, TimeUnit.SECONDS.toMillis(j), true);
    }

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

    protected void a(String str) {
        if (this.a.W()) {
            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> checkCachedResourcesExist = Utils.checkCachedResourcesExist(z, this.a, this.b, this.e);
        if (checkCachedResourcesExist.isEmpty()) {
            return;
        }
        if (!((Boolean) this.b.a(com.applovin.impl.sdk.c.b.fa)).booleanValue()) {
            if (v.a()) {
                v vVar = this.c;
                vVar.e("AppLovinFullscreenActivity", "Streaming ad due to missing ad resources: " + checkCachedResourcesExist);
            }
            this.a.a();
            return;
        }
        if (v.a()) {
            v vVar2 = this.c;
            vVar2.e("AppLovinFullscreenActivity", "Dismissing ad due to missing resources: " + checkCachedResourcesExist);
        }
        com.applovin.impl.adview.o.a(this.a, this.q, "Missing ad resources", null, null);
        h();
    }

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

    public void b(long j) {
        if (v.a()) {
            v vVar = this.c;
            vVar.b("AppLovinFullscreenActivity", "Scheduling report reward in " + TimeUnit.MILLISECONDS.toSeconds(j) + " seconds...");
        }
        this.t = p.a(j, this.b, new Runnable() {
            @Override
            public void run() {
                if (a.this.a.ag().getAndSet(true)) {
                    return;
                }
                a.this.b.K().a(new com.applovin.impl.sdk.e.v(a.this.a, a.this.b), o.a.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.cQ)).longValue());
        k.a(this.q, this.a);
        this.b.V().a(this.a);
        if (this.a.hasVideoUrl() || t()) {
            k.a(this.r, 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 (v.a()) {
            v vVar = this.c;
            vVar.c("AppLovinFullscreenActivity", "onWindowFocusChanged(boolean) - " + z);
        }
        a("javascript:al_onWindowFocusChanged( " + z + " );");
    }

    public abstract void d();

    public abstract void e();

    public void f() {
        if (v.a()) {
            this.c.c("AppLovinFullscreenActivity", "onResume()");
        }
        this.d.d(SystemClock.elapsedRealtime() - this.A);
        a("javascript:al_onAppResumed();");
        q();
        if (this.s.c()) {
            this.s.a();
        }
    }

    public void g() {
        if (v.a()) {
            this.c.c("AppLovinFullscreenActivity", "onPause()");
        }
        this.A = SystemClock.elapsedRealtime();
        a("javascript:al_onAppPaused();");
        if (this.s.c()) {
            this.s.a();
        }
        p();
    }

    public void h() {
        this.B = true;
        if (v.a()) {
            this.c.c("AppLovinFullscreenActivity", "dismiss()");
        }
        com.applovin.impl.sdk.ad.e eVar = this.a;
        if (eVar != null) {
            eVar.o().e();
        }
        this.u.removeCallbacksAndMessages(null);
        a("javascript:al_onPoststitialDismiss();", this.a.T());
        n();
        this.d.c();
        this.E.a();
        if (this.w != null) {
            p.a(TimeUnit.SECONDS.toMillis(2L), this.b, new Runnable() {
                @Override
                public void run() {
                    a.this.e.stopService(new Intent(a.this.e.getApplicationContext(), AppKilledService.class));
                    AppLovinBroadcastManager.unregisterReceiver(a.this.w);
                }
            });
        }
        if (this.x != null) {
            this.b.Z().b(this.x);
        }
        if (this.v != null) {
            this.b.v().b(this.v);
        }
        if (o()) {
            this.e.finish();
            return;
        }
        this.b.J();
        if (v.a()) {
            this.b.J().b("AppLovinFullscreenActivity", "Fullscreen ad shown in container view dismissed, destroying the presenter.");
        }
        k();
    }

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

    public void j() {
        if (v.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) && o()) {
                ((ViewGroup) parent).removeAllViews();
            }
        }
        m();
        n();
        this.p = null;
        this.q = null;
        this.r = null;
        this.e = null;
        AppLovinBroadcastManager.unregisterReceiver(this);
    }

    public void l() {
        if (v.a()) {
            this.c.c("AppLovinFullscreenActivity", "onBackPressed()");
        }
        if (this.F) {
            h();
        }
        if (this.a.V()) {
            b("javascript:onBackPressed();");
        }
    }

    protected abstract void m();

    protected void n() {
        if (this.z.compareAndSet(false, true)) {
            k.b(this.q, this.a);
            this.b.V().b(this.a);
        }
    }

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

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

    public void p() {
        p pVar = this.t;
        if (pVar != null) {
            pVar.b();
        }
    }

    protected void q() {
        p pVar = this.t;
        if (pVar != null) {
            pVar.c();
        }
    }

    protected abstract boolean r();

    protected abstract boolean s();

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

    protected abstract void u();

    public void v() {
        com.applovin.impl.adview.d s;
        AppLovinAdView appLovinAdView = this.f;
        if (appLovinAdView == null || (s = appLovinAdView.getController().s()) == null) {
            return;
        }
        this.E.a(s, new i.a() {
            @Override
            public void a(View view) {
                a.this.E.a(CollectionUtils.map("clcode", a.this.a.getClCode()));
                if (((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.fu)).booleanValue()) {
                    a.this.h();
                    return;
                }
                a aVar = a.this;
                aVar.F = ((Boolean) aVar.b.a(com.applovin.impl.sdk.c.b.fv)).booleanValue();
                if (!((Boolean) a.this.b.a(com.applovin.impl.sdk.c.b.fw)).booleanValue() || a.this.g == null) {
                    return;
                }
                a.this.g.setVisibility(0);
            }
        });
    }

    public void w() {
        if (v.a()) {
            this.c.c("AppLovinFullscreenActivity", "Handling render process crash");
        }
        this.k = true;
    }
}