导航菜单

页面标题

页面副标题

All File Recovery v1.0.2 - AbstractC0646r1.java 源代码

正在查看: All File Recovery v1.0.2 应用的 AbstractC0646r1.java JAVA 源代码文件

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


package com.applovin.impl;

import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.Configuration;
import android.database.ContentObserver;
import android.os.Bundle;
import android.os.Handler;
import android.os.Looper;
import android.os.SystemClock;
import android.provider.Settings;
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.AbstractC0646r1;
import com.applovin.impl.C0500c2;
import com.applovin.impl.C0507d0;
import com.applovin.impl.C0537g4;
import com.applovin.impl.C0650r5;
import com.applovin.impl.adview.AbstractC0483e;
import com.applovin.impl.adview.C0479a;
import com.applovin.impl.adview.C0480b;
import com.applovin.impl.adview.C0485g;
import com.applovin.impl.sdk.AppLovinBroadcastManager;
import com.applovin.impl.sdk.C0670i;
import com.applovin.impl.sdk.C0672k;
import com.applovin.impl.sdk.C0676o;
import com.applovin.impl.sdk.ad.AbstractC0662b;
import com.applovin.impl.sdk.ad.AppLovinAdImpl;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
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 com.facebook.internal.C0752a;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONObject;

public abstract class AbstractC0646r1 implements C0500c2.a, AppLovinBroadcastManager.Receiver, C0479a.b {
    protected int A;
    protected boolean B;
    private ContentObserver C;
    private Float D;
    protected AppLovinAdClickListener E;
    protected AppLovinAdDisplayListener F;
    protected AppLovinAdVideoPlaybackListener G;
    protected final C0500c2 H;
    protected C0694t6 I;
    protected C0694t6 J;
    protected boolean K;
    private final C0507d0 L;
    private boolean M;
    protected final AbstractC0662b a;
    protected final C0672k b;
    protected final C0676o c;
    protected Activity d;
    private final int e;
    private final Handler f;
    private final AbstractC0488b g;
    private final C0670i.a h;
    protected AppLovinAdView i;
    protected com.applovin.impl.adview.k j;
    protected final C0485g k;
    protected final C0485g l;
    protected final long m;
    private final AtomicBoolean n;
    private final AtomicBoolean o;
    private boolean p;
    protected long q;
    protected long r;
    private boolean s;
    protected boolean t;
    protected int u;
    protected boolean v;
    private int w;
    private final ArrayList x;
    protected int y;
    protected int z;

    public class a implements AppLovinAdDisplayListener {
        public a() {
        }

        @Override
        public void adDisplayed(AppLovinAd appLovinAd) {
            C0676o c0676o = AbstractC0646r1.this.c;
            if (C0676o.a()) {
                AbstractC0646r1.this.c.a("AppLovinFullscreenActivity", "Web content rendered");
            }
        }

        @Override
        public void adHidden(AppLovinAd appLovinAd) {
            C0676o c0676o = AbstractC0646r1.this.c;
            if (C0676o.a()) {
                AbstractC0646r1.this.c.a("AppLovinFullscreenActivity", "Closing from WebView");
            }
            AbstractC0646r1.this.a("web_view");
        }
    }

    public class b implements C0670i.a {
        public b() {
        }

        @Override
        public void a(int i) {
            AbstractC0646r1 abstractC0646r1 = AbstractC0646r1.this;
            if (abstractC0646r1.A != C0670i.h) {
                abstractC0646r1.B = true;
            }
            C0480b f = abstractC0646r1.i.getController().f();
            if (f == null) {
                C0676o c0676o = AbstractC0646r1.this.c;
                if (C0676o.a()) {
                    AbstractC0646r1.this.c.k("AppLovinFullscreenActivity", "Unable to handle ringer mode change: no valid web view.");
                }
            } else if (C0670i.a(i) && !C0670i.a(AbstractC0646r1.this.A)) {
                f.a("javascript:al_muteSwitchOn();");
            } else if (i == 2) {
                f.a("javascript:al_muteSwitchOff();");
            }
            AbstractC0646r1.this.A = i;
        }
    }

    public class c extends AbstractC0488b {
        final C0672k a;

        public c(C0672k c0672k) {
            this.a = c0672k;
        }

        private boolean a(Activity activity) {
            return activity.getClass().getName().equals(AbstractC0742z6.a(activity.getApplicationContext(), "AppLovinFullscreenActivity", this.a));
        }

        @Override
        public void onActivityCreated(Activity activity, Bundle bundle) {
            if (!AbstractC0646r1.this.A() && a(activity)) {
                AbstractC0646r1.this.e();
            }
        }

        @Override
        public void onActivityStarted(Activity activity) {
            if (AbstractC0646r1.this.A() && a(activity)) {
                AbstractC0646r1.this.e();
            }
        }
    }

    public class d extends ContentObserver {
        final C0672k a;

        public d(Handler handler, C0672k c0672k) {
            super(handler);
            this.a = c0672k;
        }

        @Override
        public void onChange(boolean z) {
            Float b = this.a.q().b();
            if (b == null || AbstractC0646r1.this.D == null || b.equals(AbstractC0646r1.this.D)) {
                return;
            }
            String str = b.floatValue() > AbstractC0646r1.this.D.floatValue() ? "volume_up" : "volume_down";
            JSONObject jSONObject = new JSONObject();
            JsonUtils.putDouble(jSONObject, "volume", b.floatValue());
            AbstractC0646r1.this.e("javascript:al_onVolumeChangedEvent('" + str + "'," + jSONObject + ");");
            AbstractC0646r1.this.D = b;
        }
    }

    public class e extends AbstractC0488b {
        final C0537g4 a;

        public e(C0537g4 c0537g4) {
            this.a = c0537g4;
        }

        @Override
        public void onActivityResumed(Activity activity) {
            if (activity instanceof AppLovinFullscreenActivity) {
                this.a.b(null);
                AbstractC0646r1.this.b.e().b(this);
            }
        }
    }

    public interface f {
        void a(AbstractC0646r1 abstractC0646r1);

        void a(String str, Throwable th);
    }

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

        @Override
        public void adClicked(AppLovinAd appLovinAd) {
            C0676o c0676o = AbstractC0646r1.this.c;
            if (C0676o.a()) {
                AbstractC0646r1.this.c.a("AppLovinFullscreenActivity", "Clicking through graphic");
            }
            AbstractC0575l2.a(AbstractC0646r1.this.E, appLovinAd);
            AbstractC0646r1.this.z++;
        }

        @Override
        public void onClick(View view) {
            AbstractC0646r1 abstractC0646r1 = AbstractC0646r1.this;
            if (view != abstractC0646r1.k || !((Boolean) abstractC0646r1.b.a(C0577l4.V1)).booleanValue()) {
                C0676o c0676o = AbstractC0646r1.this.c;
                if (C0676o.a()) {
                    AbstractC0646r1.this.c.b("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
                    return;
                }
                return;
            }
            AbstractC0646r1.e(AbstractC0646r1.this);
            if (AbstractC0646r1.this.a.a1()) {
                AbstractC0646r1.this.e("javascript:al_onCloseButtonTapped(" + AbstractC0646r1.this.w + "," + AbstractC0646r1.this.y + "," + AbstractC0646r1.this.z + ");");
            }
            List P = AbstractC0646r1.this.a.P();
            C0676o c0676o2 = AbstractC0646r1.this.c;
            if (C0676o.a()) {
                AbstractC0646r1.this.c.a("AppLovinFullscreenActivity", "Handling close button tap " + AbstractC0646r1.this.w + " with multi close delay: " + P);
            }
            if (P == null || P.size() <= AbstractC0646r1.this.w) {
                AbstractC0646r1.this.a("native_close_button");
                return;
            }
            AbstractC0646r1.this.x.add(Long.valueOf(SystemClock.elapsedRealtime() - AbstractC0646r1.this.q));
            List N = AbstractC0646r1.this.a.N();
            if (N != null && N.size() > AbstractC0646r1.this.w) {
                AbstractC0646r1 abstractC0646r12 = AbstractC0646r1.this;
                abstractC0646r12.k.a((AbstractC0483e.a) N.get(abstractC0646r12.w));
            }
            C0676o c0676o3 = AbstractC0646r1.this.c;
            if (C0676o.a()) {
                AbstractC0646r1.this.c.a("AppLovinFullscreenActivity", "Scheduling next close button with delay: " + P.get(AbstractC0646r1.this.w));
            }
            AbstractC0646r1.this.k.setVisibility(8);
            AbstractC0646r1 abstractC0646r13 = AbstractC0646r1.this;
            abstractC0646r13.a(abstractC0646r13.k, ((Integer) P.get(abstractC0646r13.w)).intValue(), new Runnable() {
                @Override
                public final void run() {
                    AbstractC0646r1.g.this.a();
                }
            });
        }

        public g(AbstractC0646r1 abstractC0646r1, a aVar) {
            this();
        }

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

    public AbstractC0646r1(AbstractC0662b abstractC0662b, Activity activity, Map map, C0672k c0672k, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
        Handler handler = new Handler(Looper.getMainLooper());
        this.f = handler;
        this.m = SystemClock.elapsedRealtime();
        this.n = new AtomicBoolean();
        this.o = new AtomicBoolean();
        this.q = -1L;
        this.w = 0;
        this.x = new ArrayList();
        this.y = 0;
        this.z = 0;
        this.A = C0670i.h;
        this.M = false;
        this.a = abstractC0662b;
        this.b = c0672k;
        this.c = c0672k.O();
        this.d = activity;
        this.e = abstractC0662b.b0();
        this.E = appLovinAdClickListener;
        this.F = appLovinAdDisplayListener;
        this.G = appLovinAdVideoPlaybackListener;
        C0500c2 c0500c2 = new C0500c2(activity, c0672k);
        this.H = c0500c2;
        c0500c2.a(this);
        this.L = new C0507d0(c0672k);
        g gVar = new g(this, null);
        if (((Boolean) c0672k.a(C0577l4.r2)).booleanValue()) {
            AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.render_process_gone"));
        }
        if (((Boolean) c0672k.a(C0577l4.x2)).booleanValue()) {
            AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.al_onPoststitialShow_evaluation_error"));
        }
        AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.custom_tabs_shown"));
        AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.custom_tabs_hidden"));
        AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.custom_tabs_failure"));
        AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.external_redirect_success"));
        AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.external_redirect_failure"));
        AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.preload_success"));
        AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.preload_failure"));
        C0631p1 c0631p1 = new C0631p1(c0672k.y0(), AppLovinAdSize.INTERSTITIAL, activity);
        this.i = c0631p1;
        c0631p1.setAdClickListener(gVar);
        this.i.setAdDisplayListener(new a());
        abstractC0662b.h().putString("ad_view_address", q7.a(this.i));
        this.i.getController().a(this);
        C0721x1 c0721x1 = new C0721x1(map, c0672k);
        if (c0721x1.c()) {
            this.j = new com.applovin.impl.adview.k(c0721x1, activity);
        }
        c0672k.k().trackImpression(abstractC0662b);
        List P = abstractC0662b.P();
        if (abstractC0662b.s() >= 0 || P != null) {
            C0485g c0485g = new C0485g(abstractC0662b.q(), activity);
            this.k = c0485g;
            c0485g.setVisibility(8);
            c0485g.setOnClickListener(gVar);
        } else {
            this.k = null;
        }
        C0485g c0485g2 = new C0485g(AbstractC0483e.a.WHITE_ON_TRANSPARENT, activity);
        this.l = c0485g2;
        c0485g2.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AbstractC0646r1.this.b(view);
            }
        });
        if (abstractC0662b.e1()) {
            this.h = new b();
        } else {
            this.h = null;
        }
        this.g = new c(c0672k);
        if (abstractC0662b.d1()) {
            this.D = c0672k.q().b();
            this.C = new d(handler, c0672k);
            activity.getContentResolver().registerContentObserver(Settings.System.CONTENT_URI.buildUpon().appendPath("volume_music_speaker").build(), false, this.C);
        }
    }

    public boolean A() {
        return c() >= 0;
    }

    private void C() {
        if (this.h != null) {
            this.b.q().a(this.h);
        }
        if (this.g != null) {
            this.b.e().a(this.g);
        }
    }

    public abstract void B();

    public abstract void a(ViewGroup viewGroup);

    public abstract void b(long j);

    public abstract void n();

    @Override
    public void onReceive(Intent intent, Map map) {
        String action = intent.getAction();
        if (action == null) {
            return;
        }
        switch (action) {
            case "com.applovin.al_onPoststitialShow_evaluation_error":
                f();
                break;
            case "com.applovin.external_redirect_success":
            case "com.applovin.external_redirect_failure":
                b(action, map);
                break;
            case "com.applovin.custom_tabs_failure":
            case "com.applovin.custom_tabs_hidden":
            case "com.applovin.custom_tabs_shown":
                a(action, map);
                break;
            case "com.applovin.render_process_gone":
                if (!this.t) {
                    g();
                    break;
                }
                break;
            case "com.applovin.preload_success":
            case "com.applovin.preload_failure":
                c(action, map);
                break;
        }
    }

    public void p() {
        C0694t6 c0694t6 = this.I;
        if (c0694t6 != null) {
            c0694t6.e();
        }
    }

    public void q() {
        C0480b f2;
        if (this.i == null || !this.a.F0() || (f2 = this.i.getController().f()) == null) {
            return;
        }
        this.L.a(f2, new C0507d0.c() {
            @Override
            public final void a(View view) {
                AbstractC0646r1.this.a(view);
            }
        });
    }

    public void r() {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "onBackPressed()");
        }
        if (this.M) {
            a("back_button");
        }
        if (this.a.a1()) {
            e("javascript:onBackPressed();");
        }
    }

    public void s() {
        AppLovinAdView appLovinAdView = this.i;
        if (appLovinAdView != null) {
            ViewParent parent = appLovinAdView.getParent();
            this.i.destroy();
            this.i = null;
            if ((parent instanceof ViewGroup) && j()) {
                ((ViewGroup) parent).removeAllViews();
            }
        }
        n();
        m();
        this.E = null;
        this.F = null;
        this.G = null;
        this.d = null;
        AppLovinBroadcastManager.unregisterReceiver(this);
    }

    public void t() {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "onPause()");
        }
        d("javascript:al_onAppPaused();");
        if (this.H.b()) {
            this.H.a();
        }
        o();
    }

    public void u() {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "onResume()");
        }
        d("javascript:al_onAppResumed();");
        p();
        if (this.H.b()) {
            this.H.a();
        }
    }

    public void v() {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "onStop()");
        }
    }

    public abstract void w();

    public abstract void x();

    public void y() {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "Setting ad fully watched");
        }
        this.K = true;
    }

    public boolean z() {
        return this.p;
    }

    public void b(View view) {
        a("backup_close_button");
    }

    public static int e(AbstractC0646r1 abstractC0646r1) {
        int i = abstractC0646r1.w;
        abstractC0646r1.w = i + 1;
        return i;
    }

    private void f(final String str) {
        if (this.o.get()) {
            return;
        }
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                AbstractC0646r1.this.c(str);
            }
        });
    }

    public void k() {
        if (this.a.b0() <= this.e && !AbstractC0506d.a(this.d)) {
            if (C0676o.a()) {
                this.c.d("AppLovinFullscreenActivity", "Ad reshow timed out. Will attempt to bring existing ad activity to front.");
            }
            this.p = false;
            long c2 = this.a.c();
            if (c2 > 0) {
                a(c2).a(C0537g4.h, new C0537g4.b() {
                    @Override
                    public final void a(boolean z, Object obj, Object obj2) {
                        AbstractC0646r1.this.a(z, (Void) obj, (Void) obj2);
                    }
                });
            } else {
                f("app_relaunch_reshow_timed_out");
            }
        }
    }

    public void l() {
        if (this.a.N0().getAndSet(true)) {
            return;
        }
        this.b.q0().a((AbstractRunnableC0716w4) new C0477a6(this.a, this.b), C0650r5.b.OTHER);
    }

    public long c() {
        AbstractC0662b abstractC0662b = this.a;
        if (abstractC0662b == null) {
            return -1L;
        }
        return abstractC0662b.g();
    }

    public void g() {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "Handling render process crash");
        }
        this.t = true;
    }

    public boolean h() {
        return this.s;
    }

    public boolean i() {
        return AppLovinAdType.INCENTIVIZED == this.a.getType();
    }

    public boolean j() {
        return this.d instanceof AppLovinFullscreenActivity;
    }

    public void m() {
        if (!this.p && this.o.compareAndSet(false, true)) {
            AbstractC0575l2.b(this.F, this.a);
            this.b.I().b(this.a);
            HashMap hashMap = new HashMap();
            AbstractC0662b abstractC0662b = this.a;
            if (abstractC0662b != null) {
                CollectionUtils.putStringIfValid("source", abstractC0662b.F(), hashMap);
                CollectionUtils.putStringIfValid("details", AbstractC0473a2.b(this.a), hashMap);
            }
            this.b.g().a(C0729y1.t, this.a, hashMap);
        }
    }

    public void o() {
        C0694t6 c0694t6 = this.I;
        if (c0694t6 != null) {
            c0694t6.d();
        }
    }

    public static void a(AbstractC0662b abstractC0662b, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener, Map map, C0672k c0672k, Activity activity, f fVar) {
        AbstractC0646r1 c0697u1;
        if (abstractC0662b instanceof C0478a7) {
            try {
                c0697u1 = new C0697u1(abstractC0662b, activity, map, c0672k, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th) {
                fVar.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + c0672k + " and throwable: " + th.getMessage(), th);
                return;
            }
        } else if (abstractC0662b.hasVideoUrl()) {
            try {
                c0697u1 = new C0705v1(abstractC0662b, activity, map, c0672k, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th2) {
                fVar.a("Failed to create FullscreenVideoAdPresenter with sdk: " + c0672k + " and throwable: " + th2.getMessage(), th2);
                return;
            }
        } else {
            try {
                c0697u1 = new C0654s1(abstractC0662b, activity, map, c0672k, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th3) {
                fVar.a("Failed to create FullscreenGraphicAdPresenter with sdk: " + c0672k + " and throwable: " + th3.getMessage(), th3);
                return;
            }
        }
        c0697u1.C();
        fVar.a(c0697u1);
    }

    public void e() {
        if (A()) {
            if (C0676o.a()) {
                this.c.d("AppLovinFullscreenActivity", "App relaunch detected with launcher activity. Will attempt to re-show the ad");
            }
            this.p = true;
            long f2 = this.a.f();
            if (f2 < 0) {
                return;
            }
            a(new Runnable() {
                @Override
                public final void run() {
                    AbstractC0646r1.this.k();
                }
            }, f2);
            return;
        }
        f("app_relaunch");
    }

    public void b(boolean z) {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "onWindowFocusChanged(boolean) - " + z);
        }
        d("javascript:al_onWindowFocusChanged( " + z + " );");
        C0694t6 c0694t6 = this.J;
        if (c0694t6 != null) {
            if (z) {
                c0694t6.e();
            } else {
                c0694t6.d();
            }
        }
    }

    public void d(boolean z) {
        this.p = z;
    }

    public void c(String str) {
        C0676o.h("AppLovinFullscreenActivity", "Dismissing on-screen ad due to " + str);
        try {
            a(str);
        } catch (Throwable th) {
            C0676o.c("AppLovinFullscreenActivity", "Failed to dismiss ad.", th);
            try {
                m();
            } catch (Throwable unused) {
            }
        }
    }

    public void d(String str) {
        if (this.a.J0()) {
            a(str, 0L);
        }
    }

    public void f() {
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "Handling al_onPoststitialShow evaluation error");
        }
    }

    public int d() {
        int u = this.a.u();
        return (u <= 0 && ((Boolean) this.b.a(C0577l4.o2)).booleanValue()) ? this.u + 1 : u;
    }

    public void b(String str) {
        C0480b f2;
        AppLovinAdView appLovinAdView = this.i;
        if (appLovinAdView == null || (f2 = appLovinAdView.getController().f()) == null) {
            return;
        }
        f2.a(str);
    }

    public void c(boolean z) {
        a(z, ((Long) this.b.a(C0577l4.p2)).longValue());
        if (!this.a.E0()) {
            AbstractC0575l2.a(this.F, this.a);
        }
        this.b.I().a(this.a);
        if (!this.a.E0() && (this.a.hasVideoUrl() || i())) {
            AbstractC0575l2.a(this.G, this.a);
        }
        new C0475a4(this.d).a(this.a);
        this.a.setHasShown(true);
    }

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

    public static void b(final C0485g c0485g, final Runnable runnable) {
        q7.a(c0485g, 400L, new Runnable() {
            @Override
            public final void run() {
                AbstractC0646r1.a(C0485g.this, runnable);
            }
        });
    }

    private void b(String str, Map map) {
        e(a8.b(str, map));
    }

    public void a(boolean z, Void r2, Void r32) {
        if (z) {
            return;
        }
        f("app_relaunch_bring_to_front_failed");
    }

    private C0537g4 a(long j) {
        final C0537g4 c0537g4 = new C0537g4("bringAdActivityToFront");
        final e eVar = new e(c0537g4);
        this.b.e().a(eVar);
        Intent intent = new Intent(this.d, (Class<?>) AppLovinFullscreenActivity.class);
        intent.setFlags(131072);
        this.d.startActivity(intent);
        a(new Runnable() {
            @Override
            public final void run() {
                AbstractC0646r1.this.a(eVar, c0537g4);
            }
        }, j);
        return c0537g4;
    }

    public static void c(final C0485g c0485g, final Runnable runnable) {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                AbstractC0646r1.b(C0485g.this, runnable);
            }
        });
    }

    public void c(long j) {
        if (C0676o.a()) {
            this.c.a("AppLovinFullscreenActivity", "Scheduling report reward in " + TimeUnit.MILLISECONDS.toSeconds(j) + " seconds...");
        }
        this.I = C0694t6.a(j, this.b, new Runnable() {
            @Override
            public final void run() {
                AbstractC0646r1.this.l();
            }
        });
    }

    public void a(AbstractC0488b abstractC0488b, C0537g4 c0537g4) {
        this.b.e().b(abstractC0488b);
        if (c0537g4.c()) {
            return;
        }
        c0537g4.a((Object) null);
    }

    private void c(String str, Map map) {
        e(a8.c(str, map));
    }

    public boolean a(boolean z) {
        List a2 = AbstractC0742z6.a(z, this.a, this.b, this.d);
        if (a2.isEmpty()) {
            return false;
        }
        if (((Boolean) this.b.a(C0577l4.f449r5)).booleanValue()) {
            if (C0676o.a()) {
                this.c.b("AppLovinFullscreenActivity", "Dismissing ad due to missing resources: " + a2);
            }
            if (((Boolean) this.b.a(C0577l4.f458u5)).booleanValue()) {
                AppLovinAdDisplayListener appLovinAdDisplayListener = this.F;
                if (appLovinAdDisplayListener instanceof InterfaceC0527f2) {
                    AbstractC0575l2.a(appLovinAdDisplayListener, "Missing ad resources");
                }
            } else {
                C0543h2.a(this.a, this.F, "Missing ad resources", (Throwable) null, (AppLovinFullscreenActivity) null);
            }
            a("missing_ad_resources");
            String str = "Missing ad resources: " + a2;
            HashMap<String, String> hashMap = CollectionUtils.hashMap(C0752a.Y, str);
            CollectionUtils.putStringIfValid("details", "Failing ad display", hashMap);
            this.b.E().a(C0729y1.p0, "missingCachedAdResources", hashMap);
            HashMap<String, String> hashMap2 = CollectionUtils.hashMap("source", "missingCachedAdResources");
            CollectionUtils.putStringIfValid(C0752a.Y, str, hashMap2);
            this.b.g().a(C0729y1.s, this.a, hashMap2);
            return ((Boolean) this.b.a(C0577l4.f455t5)).booleanValue();
        }
        if (C0676o.a()) {
            this.c.b("AppLovinFullscreenActivity", "Streaming ad due to missing ad resources: " + a2);
        }
        this.a.S0();
        HashMap hashMap3 = new HashMap();
        CollectionUtils.putStringIfValid(C0752a.Y, "Missing ad resources: " + a2, hashMap3);
        CollectionUtils.putStringIfValid("details", "Streaming ad", hashMap3);
        this.b.E().a(C0729y1.p0, "missingCachedAdResources", hashMap3);
        return false;
    }

    public void a(String str) {
        this.s = true;
        long elapsedRealtime = SystemClock.elapsedRealtime() - this.m;
        if (C0676o.a()) {
            this.c.d("AppLovinFullscreenActivity", "Dismissing ad after " + TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime) + " seconds from source: " + str);
        }
        AbstractC0662b abstractC0662b = this.a;
        if (abstractC0662b != null) {
            abstractC0662b.getAdEventTracker().f();
        }
        this.f.removeCallbacksAndMessages(null);
        a("javascript:al_onPoststitialDismiss();", this.a != null ? r0.G() : 0L);
        if (((Boolean) this.b.a(C0577l4.f434k6)).booleanValue()) {
            AbstractC0662b abstractC0662b2 = this.a;
            if (abstractC0662b2 != null) {
                abstractC0662b2.a(str);
            }
            n();
        }
        m();
        this.L.b();
        if (this.h != null) {
            this.b.q().b(this.h);
        }
        if (this.g != null) {
            this.b.e().b(this.g);
        }
        if (this.C != null) {
            this.d.getContentResolver().unregisterContentObserver(this.C);
            this.C = null;
        }
        if (j()) {
            this.d.finish();
            return;
        }
        this.b.O();
        if (C0676o.a()) {
            this.b.O().a("AppLovinFullscreenActivity", "Fullscreen ad shown in container view dismissed, destroying the presenter.");
        }
        s();
    }

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

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

    public void a(final String str, long j) {
        if (j < 0 || !StringUtils.isValidString(str)) {
            return;
        }
        a(new Runnable() {
            @Override
            public final void run() {
                AbstractC0646r1.this.b(str);
            }
        }, j);
    }

    public void a(final C0485g c0485g, long j, final Runnable runnable) {
        if (j >= ((Long) this.b.a(C0577l4.U1)).longValue()) {
            return;
        }
        this.J = C0694t6.a(TimeUnit.SECONDS.toMillis(j), this.b, new Runnable() {
            @Override
            public final void run() {
                AbstractC0646r1.c(C0485g.this, runnable);
            }
        });
    }

    public static void a(C0485g c0485g, Runnable runnable) {
        c0485g.bringToFront();
        runnable.run();
    }

    public void a(int i, boolean z, boolean z2, long j) {
        if (!this.p && this.n.compareAndSet(false, true)) {
            if (this.a.hasVideoUrl() || i()) {
                AbstractC0575l2.a(this.G, this.a, i, z2);
            }
            long elapsedRealtime = SystemClock.elapsedRealtime() - this.m;
            this.b.k().trackVideoEnd(this.a, TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime), i, z);
            long elapsedRealtime2 = this.q != -1 ? SystemClock.elapsedRealtime() - this.q : -1L;
            this.b.k().trackFullScreenAdClosed(this.a, elapsedRealtime2, this.x, j, this.B, this.A);
            if (C0676o.a()) {
                C0676o c0676o = this.c;
                StringBuilder sb = new StringBuilder("Video ad ended at percent: ");
                sb.append(i);
                sb.append("%, elapsedTime: ");
                sb.append(elapsedRealtime);
                sb.append("ms, skipTimeMillis: ");
                sb.append(j);
                sb.append("ms, closeTimeMillis: ");
                c0676o.a("AppLovinFullscreenActivity", android.support.v4.media.session.g.a(sb, elapsedRealtime2, "ms"));
            }
        }
    }

    @Override
    public void a(C0479a c0479a) {
        if (C0676o.a()) {
            this.c.a("AppLovinFullscreenActivity", "Fully watched from ad web view...");
        }
        this.K = true;
    }

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

    public void a(View view) {
        if (((Boolean) this.b.a(C0577l4.M0)).booleanValue()) {
            this.b.H().c(this.a, C0672k.o());
        }
        Map a2 = AbstractC0473a2.a((AppLovinAdImpl) this.a);
        a2.putAll(AbstractC0473a2.a(this.a));
        this.b.E().d(C0729y1.o0, a2);
        if (((Boolean) this.b.a(C0577l4.f389O5)).booleanValue()) {
            y();
        }
        if (((Boolean) this.b.a(C0577l4.f377K5)).booleanValue()) {
            a("black_view_auto_dismiss");
            return;
        }
        this.M = ((Boolean) this.b.a(C0577l4.f380L5)).booleanValue();
        if (((Boolean) this.b.a(C0577l4.f383M5)).booleanValue()) {
            B();
        }
    }

    private void a(String str, Map map) {
        e(a8.a(str, map));
    }

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