导航菜单

页面标题

页面副标题

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

正在查看: All File Recovery v1.0.2 应用的 AbstractC2906r1.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.AbstractC2906r1;
import com.applovin.impl.C2760c2;
import com.applovin.impl.C2767d0;
import com.applovin.impl.C2797g4;
import com.applovin.impl.C2910r5;
import com.applovin.impl.adview.AbstractC2743e;
import com.applovin.impl.adview.C2739a;
import com.applovin.impl.adview.C2740b;
import com.applovin.impl.adview.C2745g;
import com.applovin.impl.sdk.AppLovinBroadcastManager;
import com.applovin.impl.sdk.C2930i;
import com.applovin.impl.sdk.C2932k;
import com.applovin.impl.sdk.C2936o;
import com.applovin.impl.sdk.ad.AbstractC2922b;
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 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 AbstractC2906r1 implements C2760c2.a, AppLovinBroadcastManager.Receiver, C2739a.b {

    protected int f42372A;

    protected boolean f42373B;

    private ContentObserver f42374C;

    private Float f42375D;

    protected AppLovinAdClickListener f42376E;

    protected AppLovinAdDisplayListener f42377F;

    protected AppLovinAdVideoPlaybackListener f42378G;

    protected final C2760c2 f42379H;

    protected C2954t6 f42380I;

    protected C2954t6 f42381J;

    protected boolean f42382K;

    private final C2767d0 f42383L;

    private boolean f42384M;

    protected final AbstractC2922b f42385a;

    protected final C2932k f42386b;

    protected final C2936o f42387c;

    protected Activity f42388d;

    private final int f42389e;

    private final Handler f42390f;

    private final AbstractC2748b f42391g;

    private final C2930i.a f42392h;

    protected AppLovinAdView f42393i;

    protected com.applovin.impl.adview.k f42394j;

    protected final C2745g f42395k;

    protected final C2745g f42396l;

    protected final long f42397m;

    private final AtomicBoolean f42398n;

    private final AtomicBoolean f42399o;

    private boolean f42400p;

    protected long f42401q;

    protected long f42402r;

    private boolean f42403s;

    protected boolean f42404t;

    protected int f42405u;

    protected boolean f42406v;

    private int f42407w;

    private final ArrayList f42408x;

    protected int f42409y;

    protected int f42410z;

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

        @Override
        public void adDisplayed(AppLovinAd appLovinAd) {
            C2936o c2936o = AbstractC2906r1.this.f42387c;
            if (C2936o.a()) {
                AbstractC2906r1.this.f42387c.a("AppLovinFullscreenActivity", "Web content rendered");
            }
        }

        @Override
        public void adHidden(AppLovinAd appLovinAd) {
            C2936o c2936o = AbstractC2906r1.this.f42387c;
            if (C2936o.a()) {
                AbstractC2906r1.this.f42387c.a("AppLovinFullscreenActivity", "Closing from WebView");
            }
            AbstractC2906r1.this.a("web_view");
        }
    }

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

        @Override
        public void a(int i10) {
            AbstractC2906r1 abstractC2906r1 = AbstractC2906r1.this;
            if (abstractC2906r1.f42372A != C2930i.f42780h) {
                abstractC2906r1.f42373B = true;
            }
            C2740b f10 = abstractC2906r1.f42393i.getController().f();
            if (f10 == null) {
                C2936o c2936o = AbstractC2906r1.this.f42387c;
                if (C2936o.a()) {
                    AbstractC2906r1.this.f42387c.k("AppLovinFullscreenActivity", "Unable to handle ringer mode change: no valid web view.");
                }
            } else if (C2930i.a(i10) && !C2930i.a(AbstractC2906r1.this.f42372A)) {
                f10.a("javascript:al_muteSwitchOn();");
            } else if (i10 == 2) {
                f10.a("javascript:al_muteSwitchOff();");
            }
            AbstractC2906r1.this.f42372A = i10;
        }
    }

    public class c extends AbstractC2748b {

        final C2932k f42413a;

        public c(C2932k c2932k) {
            this.f42413a = c2932k;
        }

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

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

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

    public class d extends ContentObserver {

        final C2932k f42415a;

        public d(Handler handler, C2932k c2932k) {
            super(handler);
            this.f42415a = c2932k;
        }

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

    public class e extends AbstractC2748b {

        final C2797g4 f42417a;

        public e(C2797g4 c2797g4) {
            this.f42417a = c2797g4;
        }

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

    public interface f {
        void a(AbstractC2906r1 abstractC2906r1);

        void a(String str, Throwable th);
    }

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

        @Override
        public void adClicked(AppLovinAd appLovinAd) {
            C2936o c2936o = AbstractC2906r1.this.f42387c;
            if (C2936o.a()) {
                AbstractC2906r1.this.f42387c.a("AppLovinFullscreenActivity", "Clicking through graphic");
            }
            AbstractC2835l2.a(AbstractC2906r1.this.f42376E, appLovinAd);
            AbstractC2906r1.this.f42410z++;
        }

        @Override
        public void onClick(View view) {
            AbstractC2906r1 abstractC2906r1 = AbstractC2906r1.this;
            if (view != abstractC2906r1.f42395k || !((Boolean) abstractC2906r1.f42386b.a(C2837l4.f41256V1)).booleanValue()) {
                C2936o c2936o = AbstractC2906r1.this.f42387c;
                if (C2936o.a()) {
                    AbstractC2906r1.this.f42387c.b("AppLovinFullscreenActivity", "Unhandled click on widget: " + view);
                    return;
                }
                return;
            }
            AbstractC2906r1.e(AbstractC2906r1.this);
            if (AbstractC2906r1.this.f42385a.a1()) {
                AbstractC2906r1.this.e("javascript:al_onCloseButtonTapped(" + AbstractC2906r1.this.f42407w + "," + AbstractC2906r1.this.f42409y + "," + AbstractC2906r1.this.f42410z + ");");
            }
            List P10 = AbstractC2906r1.this.f42385a.P();
            C2936o c2936o2 = AbstractC2906r1.this.f42387c;
            if (C2936o.a()) {
                AbstractC2906r1.this.f42387c.a("AppLovinFullscreenActivity", "Handling close button tap " + AbstractC2906r1.this.f42407w + " with multi close delay: " + P10);
            }
            if (P10 == null || P10.size() <= AbstractC2906r1.this.f42407w) {
                AbstractC2906r1.this.a("native_close_button");
                return;
            }
            AbstractC2906r1.this.f42408x.add(Long.valueOf(SystemClock.elapsedRealtime() - AbstractC2906r1.this.f42401q));
            List N10 = AbstractC2906r1.this.f42385a.N();
            if (N10 != null && N10.size() > AbstractC2906r1.this.f42407w) {
                AbstractC2906r1 abstractC2906r12 = AbstractC2906r1.this;
                abstractC2906r12.f42395k.a((AbstractC2743e.a) N10.get(abstractC2906r12.f42407w));
            }
            C2936o c2936o3 = AbstractC2906r1.this.f42387c;
            if (C2936o.a()) {
                AbstractC2906r1.this.f42387c.a("AppLovinFullscreenActivity", "Scheduling next close button with delay: " + P10.get(AbstractC2906r1.this.f42407w));
            }
            AbstractC2906r1.this.f42395k.setVisibility(8);
            AbstractC2906r1 abstractC2906r13 = AbstractC2906r1.this;
            abstractC2906r13.a(abstractC2906r13.f42395k, ((Integer) P10.get(abstractC2906r13.f42407w)).intValue(), new Runnable() {
                @Override
                public final void run() {
                    AbstractC2906r1.g.this.a();
                }
            });
        }

        public g(AbstractC2906r1 abstractC2906r1, a aVar) {
            this();
        }

        public void a() {
            AbstractC2906r1.this.f42401q = SystemClock.elapsedRealtime();
        }
    }

    public AbstractC2906r1(AbstractC2922b abstractC2922b, Activity activity, Map map, C2932k c2932k, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener) {
        Handler handler = new Handler(Looper.getMainLooper());
        this.f42390f = handler;
        this.f42397m = SystemClock.elapsedRealtime();
        this.f42398n = new AtomicBoolean();
        this.f42399o = new AtomicBoolean();
        this.f42401q = -1L;
        this.f42407w = 0;
        this.f42408x = new ArrayList();
        this.f42409y = 0;
        this.f42410z = 0;
        this.f42372A = C2930i.f42780h;
        this.f42384M = false;
        this.f42385a = abstractC2922b;
        this.f42386b = c2932k;
        this.f42387c = c2932k.O();
        this.f42388d = activity;
        this.f42389e = abstractC2922b.b0();
        this.f42376E = appLovinAdClickListener;
        this.f42377F = appLovinAdDisplayListener;
        this.f42378G = appLovinAdVideoPlaybackListener;
        C2760c2 c2760c2 = new C2760c2(activity, c2932k);
        this.f42379H = c2760c2;
        c2760c2.a(this);
        this.f42383L = new C2767d0(c2932k);
        g gVar = new g(this, null);
        if (((Boolean) c2932k.a(C2837l4.f41426r2)).booleanValue()) {
            AppLovinBroadcastManager.registerReceiver(this, new IntentFilter("com.applovin.render_process_gone"));
        }
        if (((Boolean) c2932k.a(C2837l4.f41474x2)).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"));
        C2891p1 c2891p1 = new C2891p1(c2932k.y0(), AppLovinAdSize.INTERSTITIAL, activity);
        this.f42393i = c2891p1;
        c2891p1.setAdClickListener(gVar);
        this.f42393i.setAdDisplayListener(new a());
        abstractC2922b.h().putString("ad_view_address", q7.a(this.f42393i));
        this.f42393i.getController().a(this);
        C2981x1 c2981x1 = new C2981x1(map, c2932k);
        if (c2981x1.c()) {
            this.f42394j = new com.applovin.impl.adview.k(c2981x1, activity);
        }
        c2932k.k().trackImpression(abstractC2922b);
        List P10 = abstractC2922b.P();
        if (abstractC2922b.s() >= 0 || P10 != null) {
            C2745g c2745g = new C2745g(abstractC2922b.q(), activity);
            this.f42395k = c2745g;
            c2745g.setVisibility(8);
            c2745g.setOnClickListener(gVar);
        } else {
            this.f42395k = null;
        }
        C2745g c2745g2 = new C2745g(AbstractC2743e.a.WHITE_ON_TRANSPARENT, activity);
        this.f42396l = c2745g2;
        c2745g2.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                AbstractC2906r1.this.b(view);
            }
        });
        if (abstractC2922b.e1()) {
            this.f42392h = new b();
        } else {
            this.f42392h = null;
        }
        this.f42391g = new c(c2932k);
        if (abstractC2922b.d1()) {
            this.f42375D = c2932k.q().b();
            this.f42374C = new d(handler, c2932k);
            activity.getContentResolver().registerContentObserver(Settings.System.CONTENT_URI.buildUpon().appendPath("volume_music_speaker").build(), false, this.f42374C);
        }
    }

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

    private void C() {
        if (this.f42392h != null) {
            this.f42386b.q().a(this.f42392h);
        }
        if (this.f42391g != null) {
            this.f42386b.e().a(this.f42391g);
        }
    }

    public abstract void B();

    public abstract void a(ViewGroup viewGroup);

    public abstract void b(long j10);

    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.f42404t) {
                    g();
                    break;
                }
                break;
            case "com.applovin.preload_success":
            case "com.applovin.preload_failure":
                c(action, map);
                break;
        }
    }

    public void p() {
        C2954t6 c2954t6 = this.f42380I;
        if (c2954t6 != null) {
            c2954t6.e();
        }
    }

    public void q() {
        C2740b f10;
        if (this.f42393i == null || !this.f42385a.F0() || (f10 = this.f42393i.getController().f()) == null) {
            return;
        }
        this.f42383L.a(f10, new C2767d0.c() {
            @Override
            public final void a(View view) {
                AbstractC2906r1.this.a(view);
            }
        });
    }

    public void r() {
        if (C2936o.a()) {
            this.f42387c.d("AppLovinFullscreenActivity", "onBackPressed()");
        }
        if (this.f42384M) {
            a("back_button");
        }
        if (this.f42385a.a1()) {
            e("javascript:onBackPressed();");
        }
    }

    public void s() {
        AppLovinAdView appLovinAdView = this.f42393i;
        if (appLovinAdView != null) {
            ViewParent parent = appLovinAdView.getParent();
            this.f42393i.destroy();
            this.f42393i = null;
            if ((parent instanceof ViewGroup) && j()) {
                ((ViewGroup) parent).removeAllViews();
            }
        }
        n();
        m();
        this.f42376E = null;
        this.f42377F = null;
        this.f42378G = null;
        this.f42388d = null;
        AppLovinBroadcastManager.unregisterReceiver(this);
    }

    public void t() {
        if (C2936o.a()) {
            this.f42387c.d("AppLovinFullscreenActivity", "onPause()");
        }
        d("javascript:al_onAppPaused();");
        if (this.f42379H.b()) {
            this.f42379H.a();
        }
        o();
    }

    public void u() {
        if (C2936o.a()) {
            this.f42387c.d("AppLovinFullscreenActivity", "onResume()");
        }
        d("javascript:al_onAppResumed();");
        p();
        if (this.f42379H.b()) {
            this.f42379H.a();
        }
    }

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

    public abstract void w();

    public abstract void x();

    public void y() {
        if (C2936o.a()) {
            this.f42387c.d("AppLovinFullscreenActivity", "Setting ad fully watched");
        }
        this.f42382K = true;
    }

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

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

    public static int e(AbstractC2906r1 abstractC2906r1) {
        int i10 = abstractC2906r1.f42407w;
        abstractC2906r1.f42407w = i10 + 1;
        return i10;
    }

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

    public void k() {
        if (this.f42385a.b0() <= this.f42389e && !AbstractC2766d.a(this.f42388d)) {
            if (C2936o.a()) {
                this.f42387c.d("AppLovinFullscreenActivity", "Ad reshow timed out. Will attempt to bring existing ad activity to front.");
            }
            this.f42400p = false;
            long c10 = this.f42385a.c();
            if (c10 > 0) {
                a(c10).a(C2797g4.f40833h, new C2797g4.b() {
                    @Override
                    public final void a(boolean z10, Object obj, Object obj2) {
                        AbstractC2906r1.this.a(z10, (Void) obj, (Void) obj2);
                    }
                });
            } else {
                f("app_relaunch_reshow_timed_out");
            }
        }
    }

    public void l() {
        if (this.f42385a.N0().getAndSet(true)) {
            return;
        }
        this.f42386b.q0().a((AbstractRunnableC2976w4) new C2737a6(this.f42385a, this.f42386b), C2910r5.b.OTHER);
    }

    public long c() {
        AbstractC2922b abstractC2922b = this.f42385a;
        if (abstractC2922b == null) {
            return -1L;
        }
        return abstractC2922b.g();
    }

    public void g() {
        if (C2936o.a()) {
            this.f42387c.d("AppLovinFullscreenActivity", "Handling render process crash");
        }
        this.f42404t = true;
    }

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

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

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

    public void m() {
        if (!this.f42400p && this.f42399o.compareAndSet(false, true)) {
            AbstractC2835l2.b(this.f42377F, this.f42385a);
            this.f42386b.I().b(this.f42385a);
            HashMap hashMap = new HashMap();
            AbstractC2922b abstractC2922b = this.f42385a;
            if (abstractC2922b != null) {
                CollectionUtils.putStringIfValid("source", abstractC2922b.F(), hashMap);
                CollectionUtils.putStringIfValid("details", AbstractC2733a2.b(this.f42385a), hashMap);
            }
            this.f42386b.g().a(C2989y1.f43501t, this.f42385a, hashMap);
        }
    }

    public void o() {
        C2954t6 c2954t6 = this.f42380I;
        if (c2954t6 != null) {
            c2954t6.d();
        }
    }

    public static void a(AbstractC2922b abstractC2922b, AppLovinAdClickListener appLovinAdClickListener, AppLovinAdDisplayListener appLovinAdDisplayListener, AppLovinAdVideoPlaybackListener appLovinAdVideoPlaybackListener, Map map, C2932k c2932k, Activity activity, f fVar) {
        AbstractC2906r1 c2957u1;
        if (abstractC2922b instanceof C2738a7) {
            try {
                c2957u1 = new C2957u1(abstractC2922b, activity, map, c2932k, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th) {
                fVar.a("Failed to create FullscreenVastVideoAdPresenter with sdk: " + c2932k + " and throwable: " + th.getMessage(), th);
                return;
            }
        } else if (abstractC2922b.hasVideoUrl()) {
            try {
                c2957u1 = new C2965v1(abstractC2922b, activity, map, c2932k, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th2) {
                fVar.a("Failed to create FullscreenVideoAdPresenter with sdk: " + c2932k + " and throwable: " + th2.getMessage(), th2);
                return;
            }
        } else {
            try {
                c2957u1 = new C2914s1(abstractC2922b, activity, map, c2932k, appLovinAdClickListener, appLovinAdDisplayListener, appLovinAdVideoPlaybackListener);
            } catch (Throwable th3) {
                fVar.a("Failed to create FullscreenGraphicAdPresenter with sdk: " + c2932k + " and throwable: " + th3.getMessage(), th3);
                return;
            }
        }
        c2957u1.C();
        fVar.a(c2957u1);
    }

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

    public void b(boolean z10) {
        if (C2936o.a()) {
            this.f42387c.d("AppLovinFullscreenActivity", "onWindowFocusChanged(boolean) - " + z10);
        }
        d("javascript:al_onWindowFocusChanged( " + z10 + " );");
        C2954t6 c2954t6 = this.f42381J;
        if (c2954t6 != null) {
            if (z10) {
                c2954t6.e();
            } else {
                c2954t6.d();
            }
        }
    }

    public void d(boolean z10) {
        this.f42400p = z10;
    }

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

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

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

    public int d() {
        int u10 = this.f42385a.u();
        return (u10 <= 0 && ((Boolean) this.f42386b.a(C2837l4.f41402o2)).booleanValue()) ? this.f42405u + 1 : u10;
    }

    public void b(String str) {
        C2740b f10;
        AppLovinAdView appLovinAdView = this.f42393i;
        if (appLovinAdView == null || (f10 = appLovinAdView.getController().f()) == null) {
            return;
        }
        f10.a(str);
    }

    public void c(boolean z10) {
        a(z10, ((Long) this.f42386b.a(C2837l4.f41410p2)).longValue());
        if (!this.f42385a.E0()) {
            AbstractC2835l2.a(this.f42377F, this.f42385a);
        }
        this.f42386b.I().a(this.f42385a);
        if (!this.f42385a.E0() && (this.f42385a.hasVideoUrl() || i())) {
            AbstractC2835l2.a(this.f42378G, this.f42385a);
        }
        new C2735a4(this.f42388d).a(this.f42385a);
        this.f42385a.setHasShown(true);
    }

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

    public static void b(final C2745g c2745g, final Runnable runnable) {
        q7.a(c2745g, 400L, new Runnable() {
            @Override
            public final void run() {
                AbstractC2906r1.a(C2745g.this, runnable);
            }
        });
    }

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

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

    private C2797g4 a(long j10) {
        final C2797g4 c2797g4 = new C2797g4("bringAdActivityToFront");
        final e eVar = new e(c2797g4);
        this.f42386b.e().a(eVar);
        Intent intent = new Intent(this.f42388d, (Class<?>) AppLovinFullscreenActivity.class);
        intent.setFlags(131072);
        this.f42388d.startActivity(intent);
        a(new Runnable() {
            @Override
            public final void run() {
                AbstractC2906r1.this.a(eVar, c2797g4);
            }
        }, j10);
        return c2797g4;
    }

    public static void c(final C2745g c2745g, final Runnable runnable) {
        AppLovinSdkUtils.runOnUiThread(new Runnable() {
            @Override
            public final void run() {
                AbstractC2906r1.b(C2745g.this, runnable);
            }
        });
    }

    public void c(long j10) {
        if (C2936o.a()) {
            this.f42387c.a("AppLovinFullscreenActivity", "Scheduling report reward in " + TimeUnit.MILLISECONDS.toSeconds(j10) + " seconds...");
        }
        this.f42380I = C2954t6.a(j10, this.f42386b, new Runnable() {
            @Override
            public final void run() {
                AbstractC2906r1.this.l();
            }
        });
    }

    public void a(AbstractC2748b abstractC2748b, C2797g4 c2797g4) {
        this.f42386b.e().b(abstractC2748b);
        if (c2797g4.c()) {
            return;
        }
        c2797g4.a((Object) null);
    }

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

    public boolean a(boolean z10) {
        List a10 = AbstractC3002z6.a(z10, this.f42385a, this.f42386b, this.f42388d);
        if (a10.isEmpty()) {
            return false;
        }
        if (((Boolean) this.f42386b.a(C2837l4.f41429r5)).booleanValue()) {
            if (C2936o.a()) {
                this.f42387c.b("AppLovinFullscreenActivity", "Dismissing ad due to missing resources: " + a10);
            }
            if (((Boolean) this.f42386b.a(C2837l4.f41453u5)).booleanValue()) {
                AppLovinAdDisplayListener appLovinAdDisplayListener = this.f42377F;
                if (appLovinAdDisplayListener instanceof InterfaceC2787f2) {
                    AbstractC2835l2.a(appLovinAdDisplayListener, "Missing ad resources");
                }
            } else {
                C2803h2.a(this.f42385a, this.f42377F, "Missing ad resources", (Throwable) null, (AppLovinFullscreenActivity) null);
            }
            a("missing_ad_resources");
            String str = "Missing ad resources: " + a10;
            HashMap<String, String> hashMap = CollectionUtils.hashMap("error_message", str);
            CollectionUtils.putStringIfValid("details", "Failing ad display", hashMap);
            this.f42386b.E().a(C2989y1.f43494p0, "missingCachedAdResources", hashMap);
            HashMap<String, String> hashMap2 = CollectionUtils.hashMap("source", "missingCachedAdResources");
            CollectionUtils.putStringIfValid("error_message", str, hashMap2);
            this.f42386b.g().a(C2989y1.f43499s, this.f42385a, hashMap2);
            return ((Boolean) this.f42386b.a(C2837l4.f41445t5)).booleanValue();
        }
        if (C2936o.a()) {
            this.f42387c.b("AppLovinFullscreenActivity", "Streaming ad due to missing ad resources: " + a10);
        }
        this.f42385a.S0();
        HashMap hashMap3 = new HashMap();
        CollectionUtils.putStringIfValid("error_message", "Missing ad resources: " + a10, hashMap3);
        CollectionUtils.putStringIfValid("details", "Streaming ad", hashMap3);
        this.f42386b.E().a(C2989y1.f43494p0, "missingCachedAdResources", hashMap3);
        return false;
    }

    public void a(String str) {
        this.f42403s = true;
        long elapsedRealtime = SystemClock.elapsedRealtime() - this.f42397m;
        if (C2936o.a()) {
            this.f42387c.d("AppLovinFullscreenActivity", "Dismissing ad after " + TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime) + " seconds from source: " + str);
        }
        AbstractC2922b abstractC2922b = this.f42385a;
        if (abstractC2922b != null) {
            abstractC2922b.getAdEventTracker().f();
        }
        this.f42390f.removeCallbacksAndMessages(null);
        a("javascript:al_onPoststitialDismiss();", this.f42385a != null ? r0.G() : 0L);
        if (((Boolean) this.f42386b.a(C2837l4.f41374k6)).booleanValue()) {
            AbstractC2922b abstractC2922b2 = this.f42385a;
            if (abstractC2922b2 != null) {
                abstractC2922b2.a(str);
            }
            n();
        }
        m();
        this.f42383L.b();
        if (this.f42392h != null) {
            this.f42386b.q().b(this.f42392h);
        }
        if (this.f42391g != null) {
            this.f42386b.e().b(this.f42391g);
        }
        if (this.f42374C != null) {
            this.f42388d.getContentResolver().unregisterContentObserver(this.f42374C);
            this.f42374C = null;
        }
        if (j()) {
            this.f42388d.finish();
            return;
        }
        this.f42386b.O();
        if (C2936o.a()) {
            this.f42386b.O().a("AppLovinFullscreenActivity", "Fullscreen ad shown in container view dismissed, destroying the presenter.");
        }
        s();
    }

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

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

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

    public void a(final C2745g c2745g, long j10, final Runnable runnable) {
        if (j10 >= ((Long) this.f42386b.a(C2837l4.f41249U1)).longValue()) {
            return;
        }
        this.f42381J = C2954t6.a(TimeUnit.SECONDS.toMillis(j10), this.f42386b, new Runnable() {
            @Override
            public final void run() {
                AbstractC2906r1.c(C2745g.this, runnable);
            }
        });
    }

    public static void a(C2745g c2745g, Runnable runnable) {
        c2745g.bringToFront();
        runnable.run();
    }

    public void a(int i10, boolean z10, boolean z11, long j10) {
        if (!this.f42400p && this.f42398n.compareAndSet(false, true)) {
            if (this.f42385a.hasVideoUrl() || i()) {
                AbstractC2835l2.a(this.f42378G, this.f42385a, i10, z11);
            }
            long elapsedRealtime = SystemClock.elapsedRealtime() - this.f42397m;
            this.f42386b.k().trackVideoEnd(this.f42385a, TimeUnit.MILLISECONDS.toSeconds(elapsedRealtime), i10, z10);
            long elapsedRealtime2 = this.f42401q != -1 ? SystemClock.elapsedRealtime() - this.f42401q : -1L;
            this.f42386b.k().trackFullScreenAdClosed(this.f42385a, elapsedRealtime2, this.f42408x, j10, this.f42373B, this.f42372A);
            if (C2936o.a()) {
                C2936o c2936o = this.f42387c;
                StringBuilder sb2 = new StringBuilder("Video ad ended at percent: ");
                sb2.append(i10);
                sb2.append("%, elapsedTime: ");
                sb2.append(elapsedRealtime);
                sb2.append("ms, skipTimeMillis: ");
                sb2.append(j10);
                sb2.append("ms, closeTimeMillis: ");
                c2936o.a("AppLovinFullscreenActivity", android.support.v4.media.session.g.a(sb2, elapsedRealtime2, "ms"));
            }
        }
    }

    @Override
    public void a(C2739a c2739a) {
        if (C2936o.a()) {
            this.f42387c.a("AppLovinFullscreenActivity", "Fully watched from ad web view...");
        }
        this.f42382K = true;
    }

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

    public void a(View view) {
        if (((Boolean) this.f42386b.a(C2837l4.f41192M0)).booleanValue()) {
            this.f42386b.H().c(this.f42385a, C2932k.o());
        }
        Map a10 = AbstractC2733a2.a((AppLovinAdImpl) this.f42385a);
        a10.putAll(AbstractC2733a2.a(this.f42385a));
        this.f42386b.E().d(C2989y1.f43492o0, a10);
        if (((Boolean) this.f42386b.a(C2837l4.f41211O5)).booleanValue()) {
            y();
        }
        if (((Boolean) this.f42386b.a(C2837l4.f41183K5)).booleanValue()) {
            a("black_view_auto_dismiss");
            return;
        }
        this.f42384M = ((Boolean) this.f42386b.a(C2837l4.f41190L5)).booleanValue();
        if (((Boolean) this.f42386b.a(C2837l4.f41197M5)).booleanValue()) {
            B();
        }
    }

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

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