导航菜单

页面标题

页面副标题

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

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

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


package com.applovin.adview;

import android.R;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.os.Process;
import android.text.TextUtils;
import android.view.KeyEvent;
import android.view.View;
import android.webkit.WebView;
import android.window.OnBackInvokedCallback;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.applovin.impl.AbstractC0473a2;
import com.applovin.impl.AbstractC0506d;
import com.applovin.impl.AbstractC0532g;
import com.applovin.impl.AbstractC0565k0;
import com.applovin.impl.AbstractC0646r1;
import com.applovin.impl.AbstractC0742z6;
import com.applovin.impl.C0498c0;
import com.applovin.impl.C0515e;
import com.applovin.impl.C0543h2;
import com.applovin.impl.C0577l4;
import com.applovin.impl.C0618n4;
import com.applovin.impl.C0729y1;
import com.applovin.impl.InterfaceC0550i1;
import com.applovin.impl.adview.activity.FullscreenAdService;
import com.applovin.impl.q7;
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.AppLovinSdk;
import com.applovin.sdk.AppLovinSdkUtils;
import com.facebook.internal.C0752a;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Set;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import o.n;
import o.o;
import o.p;
import org.json.JSONObject;

public class AppLovinFullscreenActivity extends Activity implements InterfaceC0550i1 {
    private static final Set i = Collections.newSetFromMap(new WeakHashMap());
    private static final Object j = new Object();

    @SuppressLint({"StaticFieldLeak"})
    public static C0543h2 parentInterstitialWrapper;
    private C0672k a;
    private AbstractC0646r1 b;
    private final AtomicBoolean c = new AtomicBoolean(true);
    private com.applovin.impl.adview.activity.a d;
    private b e;
    private boolean f;
    private C0498c0 g;
    private long h;

    public static class b implements OnBackInvokedCallback {
        private final Runnable a;

        public b(Runnable runnable) {
            this.a = runnable;
        }

        @Override
        public void onBackInvoked() {
            this.a.run();
        }
    }

    @Override
    public void dismiss(String str) {
        if (AbstractC0565k0.j() && this.e != null) {
            n.a(o.a(this), this.e);
            this.e = null;
        }
        AbstractC0646r1 abstractC0646r1 = this.b;
        if (abstractC0646r1 != null) {
            abstractC0646r1.a(str);
        } else {
            finish();
        }
    }

    @Override
    public void onBackPressed() {
        c();
    }

    @Override
    public void onConfigurationChanged(@NonNull Configuration configuration) {
        super.onConfigurationChanged(configuration);
        AbstractC0646r1 abstractC0646r1 = this.b;
        if (abstractC0646r1 != null) {
            abstractC0646r1.a(configuration);
        }
    }

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        if (bundle != null && parentInterstitialWrapper == null) {
            C0676o.j("AppLovinFullscreenActivity", "Dismissing ad. Activity was destroyed while in background.");
            dismiss("activity_destroyed_while_in_background");
            return;
        }
        try {
            requestWindowFeature(1);
        } catch (Throwable th) {
            C0676o.c("AppLovinFullscreenActivity", "Failed to request window feature", th);
        }
        getWindow().setFlags(1024, 1024);
        getWindow().addFlags(16777216);
        getWindow().addFlags(128);
        View findViewById = findViewById(R.id.content);
        findViewById.setBackgroundColor(-16777216);
        if (TextUtils.isEmpty(getIntent().getStringExtra("com.applovin.interstitial.sdk_key"))) {
            C0543h2 c0543h2 = parentInterstitialWrapper;
            if (c0543h2 != null && c0543h2.f() != null) {
                C0543h2.a(parentInterstitialWrapper.f(), parentInterstitialWrapper.c(), "Empty SDK key", (Throwable) null, this);
            }
            finish();
            return;
        }
        C0672k a2 = AppLovinSdk.getInstance(this).a();
        this.a = a2;
        this.f = ((Boolean) a2.a(C0577l4.q2)).booleanValue();
        findViewById.setFitsSystemWindows(true);
        if (AbstractC0565k0.b()) {
            q7.a(findViewById, this.a);
        }
        C0543h2 c0543h22 = parentInterstitialWrapper;
        if (c0543h22 != null && c0543h22.f() != null) {
            AbstractC0662b f = parentInterstitialWrapper.f();
            if (f.C0()) {
                AbstractC0532g.a(f, this, this.a);
            }
        }
        AbstractC0506d.a(this.f, this);
        if (AbstractC0565k0.j() && ((Boolean) this.a.a(C0577l4.f356D5)).booleanValue()) {
            this.e = new b(new Runnable() {
                @Override
                public final void run() {
                    AppLovinFullscreenActivity.this.c();
                }
            });
            p.a(o.a(this), 0, this.e);
        }
        a();
        b();
        Integer num = (Integer) this.a.a(C0577l4.c6);
        if (num.intValue() > 0) {
            synchronized (j) {
                Set set = i;
                set.add(this);
                AbstractC0742z6.a("AppLovinFullscreenActivity", set.size(), num.intValue(), this.a.E());
            }
        }
        C0543h2 c0543h23 = parentInterstitialWrapper;
        if (c0543h23 != null) {
            AbstractC0646r1.a(c0543h23.f(), parentInterstitialWrapper.b(), parentInterstitialWrapper.c(), parentInterstitialWrapper.d(), parentInterstitialWrapper.h(), this.a, this, new a());
            return;
        }
        Intent intent = new Intent(this, (Class<?>) FullscreenAdService.class);
        com.applovin.impl.adview.activity.a aVar = new com.applovin.impl.adview.activity.a(this, this.a);
        this.d = aVar;
        bindService(intent, aVar, 1);
        if (AbstractC0565k0.h()) {
            String str = this.a.n0().getExtraParameters().get("disable_set_data_dir_suffix");
            if (StringUtils.isValidString(str) && Boolean.parseBoolean(str)) {
                return;
            }
            try {
                WebView.setDataDirectorySuffix(String.valueOf(Process.myPid()));
            } catch (Throwable unused) {
            }
        }
    }

    @Override
    public void onDestroy() {
        C0672k c0672k = this.a;
        if (c0672k != null && ((Boolean) c0672k.a(C0577l4.X1)).booleanValue()) {
            this.a.p0().b(C0618n4.J);
            this.a.p0().b(C0618n4.L);
            this.a.p0().b(C0618n4.M);
        }
        if (this.g != null) {
            this.a.p0().b(C0618n4.K);
            this.g.a();
            this.g = null;
        }
        com.applovin.impl.adview.activity.a aVar = this.d;
        if (aVar != null) {
            try {
                unbindService(aVar);
            } catch (Throwable unused) {
            }
        }
        AbstractC0646r1 abstractC0646r1 = this.b;
        if (abstractC0646r1 != null) {
            if (abstractC0646r1.h()) {
                this.b.s();
            } else {
                long c = this.b.c();
                if (c >= 0) {
                    if (c == 0) {
                        this.b.d(true);
                    }
                    final C0543h2 c0543h2 = parentInterstitialWrapper;
                    AppLovinSdkUtils.runOnUiThreadDelayed(new Runnable() {
                        @Override
                        public final void run() {
                            AppLovinFullscreenActivity.this.a(c0543h2);
                        }
                    }, c);
                } else {
                    a(this.b, false, false);
                }
            }
        }
        parentInterstitialWrapper = null;
        super.onDestroy();
    }

    @Override
    public boolean onKeyDown(int i2, KeyEvent keyEvent) {
        AbstractC0646r1 abstractC0646r1 = this.b;
        if (abstractC0646r1 != null) {
            abstractC0646r1.a(i2, keyEvent);
        }
        return super.onKeyDown(i2, keyEvent);
    }

    @Override
    public void onPause() {
        super.onPause();
        AbstractC0646r1 abstractC0646r1 = this.b;
        if (abstractC0646r1 != null) {
            abstractC0646r1.t();
        }
    }

    @Override
    public void onResume() {
        AbstractC0646r1 abstractC0646r1;
        try {
            super.onResume();
            if (this.c.get() || (abstractC0646r1 = this.b) == null) {
                return;
            }
            abstractC0646r1.u();
        } catch (IllegalArgumentException e) {
            this.a.O();
            if (C0676o.a()) {
                this.a.O().a("AppLovinFullscreenActivity", "Error was encountered in onResume().", e);
            }
            this.a.E().a("AppLovinFullscreenActivity", "onResume", e);
            dismiss("activity_on_resume_error");
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        AbstractC0646r1 abstractC0646r1 = this.b;
        if (abstractC0646r1 != null) {
            abstractC0646r1.v();
        }
    }

    @Override
    public void onWindowFocusChanged(boolean z) {
        if (this.b != null) {
            if (!this.c.getAndSet(false)) {
                this.b.b(z);
            }
            if (z) {
                AbstractC0506d.a(this.f, this);
            }
        }
        super.onWindowFocusChanged(z);
    }

    public void setPresenter(@Nullable AbstractC0646r1 abstractC0646r1) {
        this.b = abstractC0646r1;
    }

    public class a implements AbstractC0646r1.f {
        public a() {
        }

        @Override
        public void a(AbstractC0646r1 abstractC0646r1) {
            AppLovinFullscreenActivity.this.b = abstractC0646r1;
            abstractC0646r1.x();
        }

        @Override
        public void a(String str, Throwable th) {
            AbstractC0662b f = AppLovinFullscreenActivity.parentInterstitialWrapper.f();
            C0543h2.a(f, AppLovinFullscreenActivity.parentInterstitialWrapper.c(), str, th, AppLovinFullscreenActivity.this);
            HashMap<String, String> hashMap = CollectionUtils.hashMap("source", "createAppLovinFullscreenActivity");
            CollectionUtils.putStringIfValid(C0752a.Y, str, hashMap);
            CollectionUtils.putStringIfValid("top_main_method", th.toString(), hashMap);
            AppLovinFullscreenActivity.this.a.g().a(C0729y1.s, f, hashMap);
        }
    }

    private void b() {
        C0672k c0672k = this.a;
        if (c0672k == null || !((Boolean) c0672k.a(C0577l4.Y1)).booleanValue()) {
            return;
        }
        final Long l = (Long) this.a.a(C0577l4.Z1);
        this.g = C0498c0.a(l.longValue(), true, this.a, new Runnable() {
            @Override
            public final void run() {
                AppLovinFullscreenActivity.this.a(l);
            }
        });
    }

    public void c() {
        AbstractC0646r1 abstractC0646r1 = this.b;
        if (abstractC0646r1 != null) {
            abstractC0646r1.r();
        }
        if (AbstractC0742z6.e(getApplicationContext())) {
            super.onBackPressed();
        }
    }

    public void a(C0543h2 c0543h2) {
        boolean z = this.b.z();
        boolean z2 = false;
        if (z) {
            boolean i2 = c0543h2.i();
            if (!i2) {
                this.b.d(false);
            }
            z2 = i2;
        }
        a(this.b, z, z2);
    }

    private void a(AbstractC0646r1 abstractC0646r1, boolean z, boolean z2) {
        abstractC0646r1.a("activity_destroyed_by_app_relaunch");
        if (this.a != null) {
            HashMap<String, String> hashMap = CollectionUtils.hashMap("source", "onDestroyAppLovinFullScreenActivity");
            C0543h2 c0543h2 = parentInterstitialWrapper;
            AbstractC0662b f = c0543h2 != null ? c0543h2.f() : null;
            hashMap.putAll(AbstractC0473a2.a((AppLovinAdImpl) f));
            JSONObject jSONObject = new JSONObject();
            JsonUtils.putBoolean(jSONObject, "reshow_attempted", z);
            JsonUtils.putBoolean(jSONObject, "reshow_success", z2);
            if (f != null) {
                JsonUtils.putInt(jSONObject, "reshow_count", f.b0());
            }
            hashMap.put("details", jSONObject.toString());
            this.a.E().d(C0729y1.h0, hashMap);
        }
        abstractC0646r1.s();
    }

    private void a() {
        C0543h2 c0543h2;
        C0672k c0672k = this.a;
        if (c0672k == null || !((Boolean) c0672k.a(C0577l4.X1)).booleanValue() || (c0543h2 = parentInterstitialWrapper) == null || c0543h2.f() == null) {
            return;
        }
        AbstractC0662b f = parentInterstitialWrapper.f();
        List j2 = f.j();
        if (CollectionUtils.isEmpty(j2)) {
            return;
        }
        C0515e c0515e = (C0515e) j2.get(0);
        JSONObject jSONObject = new JSONObject();
        JsonUtils.putStringIfValid(jSONObject, "app_killed_postback_url", c0515e.c());
        JsonUtils.putStringIfValid(jSONObject, "app_killed_postback_backup_url", c0515e.a());
        this.a.p0().b(C0618n4.L, jSONObject.toString());
        this.a.p0().b(C0618n4.J, Long.valueOf(System.currentTimeMillis()));
        this.a.p0().b(C0618n4.M, CollectionUtils.toJsonString(AbstractC0473a2.a((AppLovinAdImpl) f), JsonUtils.EMPTY_JSON));
    }

    public void a(Long l) {
        this.h = l.longValue() + this.h;
        this.a.p0().b(C0618n4.K, Long.valueOf(this.h));
    }
}