导航菜单

页面标题

页面副标题

CallApp v2.226 - AppLovinFullscreenActivity.java 源代码

正在查看: CallApp v2.226 应用的 AppLovinFullscreenActivity.java JAVA 源代码文件

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


package com.applovin.adview;

import android.R;
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 androidx.core.app.NotificationCompat;
import com.amazonaws.event.ProgressEvent;
import com.applovin.impl.a2;
import com.applovin.impl.adview.activity.FullscreenAdService;
import com.applovin.impl.c0;
import com.applovin.impl.d;
import com.applovin.impl.e;
import com.applovin.impl.g;
import com.applovin.impl.g1;
import com.applovin.impl.h2;
import com.applovin.impl.k0;
import com.applovin.impl.l4;
import com.applovin.impl.n4;
import com.applovin.impl.p1;
import com.applovin.impl.q7;
import com.applovin.impl.sdk.j;
import com.applovin.impl.sdk.n;
import com.applovin.impl.sdk.utils.CollectionUtils;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.y1;
import com.applovin.impl.z6;
import com.applovin.sdk.AppLovinSdk;
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 org.json.JSONObject;

public class AppLovinFullscreenActivity extends Activity implements g1 {

    private static final Set f8293i = Collections.newSetFromMap(new WeakHashMap());

    private static final Object f8294j = new Object();
    public static h2 parentInterstitialWrapper;

    private j f8295a;

    private p1 f8296b;

    private final AtomicBoolean f8297c = new AtomicBoolean(true);

    private com.applovin.impl.adview.activity.a f8298d;

    private b f8299e;

    private boolean f8300f;

    private c0 f8301g;

    private long f8302h;

    public static class b implements OnBackInvokedCallback {

        private final Runnable f8304a;

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

        public void onBackInvoked() {
            this.f8304a.run();
        }
    }

    public void c() {
        p1 p1Var = this.f8296b;
        if (p1Var != null) {
            p1Var.p();
        }
        if (z6.e(getApplicationContext())) {
            super.onBackPressed();
        }
    }

    @Override
    public void dismiss() {
        if (k0.j() && this.f8299e != null) {
            aa.a.y(aa.a.j(this), this.f8299e);
            this.f8299e = null;
        }
        p1 p1Var = this.f8296b;
        if (p1Var != null) {
            p1Var.c();
        } else {
            finish();
        }
    }

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

    @Override
    public void onConfigurationChanged(@NonNull Configuration configuration) {
        super.onConfigurationChanged(configuration);
        p1 p1Var = this.f8296b;
        if (p1Var != null) {
            p1Var.a(configuration);
        }
    }

    @Override
    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        if (bundle != null && parentInterstitialWrapper == null) {
            n.j("AppLovinFullscreenActivity", "Dismissing ad. Activity was destroyed while in background.");
            dismiss();
            return;
        }
        try {
            requestWindowFeature(1);
        } catch (Throwable th) {
            n.c("AppLovinFullscreenActivity", "Failed to request window feature", th);
        }
        getWindow().setFlags(ProgressEvent.PART_STARTED_EVENT_CODE, ProgressEvent.PART_STARTED_EVENT_CODE);
        getWindow().addFlags(16777216);
        getWindow().addFlags(NotificationCompat.FLAG_HIGH_PRIORITY);
        View findViewById = findViewById(R.id.content);
        findViewById.setBackgroundColor(-16777216);
        if (TextUtils.isEmpty(getIntent().getStringExtra("com.applovin.interstitial.sdk_key"))) {
            h2 h2Var = parentInterstitialWrapper;
            if (h2Var != null && h2Var.f() != null) {
                h2.a(parentInterstitialWrapper.f(), parentInterstitialWrapper.c(), "Empty SDK key", null, this);
            }
            finish();
            return;
        }
        j a8 = AppLovinSdk.getInstance(this).a();
        this.f8295a = a8;
        this.f8300f = ((Boolean) a8.a(l4.f9193j2)).booleanValue();
        findViewById.setFitsSystemWindows(true);
        h2 h2Var2 = parentInterstitialWrapper;
        if (h2Var2 != null && h2Var2.f() != null) {
            com.applovin.impl.sdk.ad.b f6 = parentInterstitialWrapper.f();
            if (f6.L0() && k0.b()) {
                q7.a(findViewById, this.f8295a);
            }
            if (f6.u0()) {
                g.a(f6, this, this.f8295a);
            }
        }
        d.a(this.f8300f, this);
        if (k0.j() && ((Boolean) this.f8295a.a(l4.f9297w5)).booleanValue()) {
            this.f8299e = new b(new androidx.core.app.a(this, 16));
            aa.a.C(aa.a.j(this), this.f8299e);
        }
        a();
        b();
        Integer num = (Integer) this.f8295a.a(l4.V5);
        if (num.intValue() > 0) {
            synchronized (f8294j) {
                Set set = f8293i;
                set.add(this);
                z6.a("AppLovinFullscreenActivity", set.size(), num.intValue(), this.f8295a.A());
            }
        }
        h2 h2Var3 = parentInterstitialWrapper;
        if (h2Var3 != null) {
            p1.a(h2Var3.f(), parentInterstitialWrapper.b(), parentInterstitialWrapper.c(), parentInterstitialWrapper.d(), parentInterstitialWrapper.h(), this.f8295a, 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.f8295a);
        this.f8298d = aVar;
        bindService(intent, aVar, 1);
        if (k0.h()) {
            String str = this.f8295a.g0().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() {
        j jVar = this.f8295a;
        if (jVar != null && ((Boolean) jVar.a(l4.Q1)).booleanValue()) {
            this.f8295a.i0().b(n4.H);
            this.f8295a.i0().b(n4.J);
            this.f8295a.i0().b(n4.K);
        }
        if (this.f8301g != null) {
            this.f8295a.i0().b(n4.I);
            this.f8301g.a();
            this.f8301g = null;
        }
        com.applovin.impl.adview.activity.a aVar = this.f8298d;
        if (aVar != null) {
            try {
                unbindService(aVar);
            } catch (Throwable unused) {
            }
        }
        p1 p1Var = this.f8296b;
        if (p1Var != null) {
            if (!p1Var.g()) {
                this.f8296b.c();
                if (this.f8295a != null) {
                    HashMap<String, String> hashMap = CollectionUtils.hashMap("source", "onDestroyAppLovinFullScreenActivity");
                    h2 h2Var = parentInterstitialWrapper;
                    hashMap.putAll(a2.b(h2Var != null ? h2Var.f() : null));
                    this.f8295a.A().d(y1.f10986b0, hashMap);
                }
            }
            this.f8296b.q();
        }
        parentInterstitialWrapper = null;
        super.onDestroy();
    }

    @Override
    public boolean onKeyDown(int i8, KeyEvent keyEvent) {
        p1 p1Var = this.f8296b;
        if (p1Var != null) {
            p1Var.a(i8, keyEvent);
        }
        return super.onKeyDown(i8, keyEvent);
    }

    @Override
    public void onPause() {
        super.onPause();
        p1 p1Var = this.f8296b;
        if (p1Var != null) {
            p1Var.r();
        }
    }

    @Override
    public void onResume() {
        p1 p1Var;
        try {
            super.onResume();
            if (this.f8297c.get() || (p1Var = this.f8296b) == null) {
                return;
            }
            p1Var.s();
        } catch (IllegalArgumentException e6) {
            this.f8295a.I();
            if (n.a()) {
                this.f8295a.I().a("AppLovinFullscreenActivity", "Error was encountered in onResume().", e6);
            }
            this.f8295a.A().a("AppLovinFullscreenActivity", "onResume", e6);
            dismiss();
        }
    }

    @Override
    public void onStop() {
        super.onStop();
        p1 p1Var = this.f8296b;
        if (p1Var != null) {
            p1Var.t();
        }
    }

    @Override
    public void onWindowFocusChanged(boolean z8) {
        if (this.f8296b != null) {
            if (!this.f8297c.getAndSet(false)) {
                this.f8296b.b(z8);
            }
            if (z8) {
                d.a(this.f8300f, this);
            }
        }
        super.onWindowFocusChanged(z8);
    }

    public void setPresenter(@Nullable p1 p1Var) {
        this.f8296b = p1Var;
    }

    public class a implements p1.d {
        public a() {
        }

        @Override
        public void a(p1 p1Var) {
            AppLovinFullscreenActivity.this.f8296b = p1Var;
            p1Var.v();
        }

        @Override
        public void a(String str, Throwable th) {
            h2.a(AppLovinFullscreenActivity.parentInterstitialWrapper.f(), AppLovinFullscreenActivity.parentInterstitialWrapper.c(), str, th, AppLovinFullscreenActivity.this);
        }
    }

    private void b() {
        j jVar = this.f8295a;
        if (jVar == null || !((Boolean) jVar.a(l4.R1)).booleanValue()) {
            return;
        }
        Long l8 = (Long) this.f8295a.a(l4.S1);
        this.f8301g = c0.a(l8.longValue(), true, this.f8295a, new ab.a(16, this, l8));
    }

    private void a() {
        h2 h2Var;
        j jVar = this.f8295a;
        if (jVar == null || !((Boolean) jVar.a(l4.Q1)).booleanValue() || (h2Var = parentInterstitialWrapper) == null || h2Var.f() == null) {
            return;
        }
        com.applovin.impl.sdk.ad.b f6 = parentInterstitialWrapper.f();
        List g9 = f6.g();
        if (CollectionUtils.isEmpty(g9)) {
            return;
        }
        e eVar = (e) g9.get(0);
        JSONObject jSONObject = new JSONObject();
        JsonUtils.putStringIfValid(jSONObject, "app_killed_postback_url", eVar.c());
        JsonUtils.putStringIfValid(jSONObject, "app_killed_postback_backup_url", eVar.a());
        this.f8295a.i0().b(n4.J, jSONObject.toString());
        this.f8295a.i0().b(n4.H, Long.valueOf(System.currentTimeMillis()));
        this.f8295a.i0().b(n4.K, CollectionUtils.toJsonString(a2.b(f6), JsonUtils.EMPTY_JSON));
    }

    public void a(Long l8) {
        this.f8302h = l8.longValue() + this.f8302h;
        this.f8295a.i0().b(n4.I, Long.valueOf(this.f8302h));
    }
}