导航菜单

页面标题

页面副标题

OLX India v19.42.007 - ApsInterstitialActivity.java 源代码

正在查看: OLX India v19.42.007 应用的 ApsInterstitialActivity.java JAVA 源代码文件

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


package com.amazon.aps.ads.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import com.amazon.aps.ads.c;
import com.amazon.aps.ads.d;
import com.amazon.aps.ads.f;
import com.amazon.aps.ads.g;
import com.amazon.aps.ads.h;
import com.amazon.device.ads.n;
import java.lang.ref.WeakReference;
import kotlin.Lazy;
import kotlin.LazyKt;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.internal.DefaultConstructorMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;

@Metadata
public class ApsInterstitialActivity extends Activity {
    public static final a e = new a(null);
    private static WeakReference f;
    private final String a = "ApsInterstitialActivity";
    private WeakReference b;
    private final LinearLayout.LayoutParams c;
    private final Lazy d;

    public static final class a {
        public a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }

        private a() {
        }
    }

    static final class b extends Lambda implements Function0 {
        b() {
            super(0);
        }

        public final ImageView invoke() {
            ImageView imageView = new ImageView(ApsInterstitialActivity.this);
            imageView.setImageDrawable(androidx.appcompat.content.res.a.b(ApsInterstitialActivity.this, f.mraid_close));
            return imageView;
        }
    }

    public ApsInterstitialActivity() {
        LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(n.j(24), n.j(24));
        layoutParams.setMargins(n.j(14), n.j(14), 0, 0);
        this.c = layoutParams;
        this.d = LazyKt.b(new b());
    }

    private final void a() {
        WeakReference weakReference = this.b;
        if (weakReference == null) {
            return;
        }
        weakReference.clear();
        this.b = null;
    }

    private final void b() {
        WeakReference weakReference = this.b;
        if (weakReference != null) {
            android.support.v4.media.session.b.a(weakReference.get());
        }
        a();
        finish();
    }

    private final boolean c() {
        try {
            WeakReference weakReference = this.b;
            if (weakReference == null) {
                return false;
            }
            android.support.v4.media.session.b.a(weakReference.get());
            return false;
        } catch (Exception e2) {
            e2.printStackTrace();
            com.amazon.aps.ads.util.a.b(this, Intrinsics.j("Error in using the flag isUseCustomClose:", Unit.a));
            return false;
        }
    }

    private final void d(c cVar) {
    }

    private final void e() {
        try {
            requestWindowFeature(1);
            getWindow().setFlags(1024, 1024);
            setContentView(h.aps_interstitial_activity);
            d.b(this.a, "Init window completed");
        } catch (RuntimeException e2) {
            d.d(this.a, Intrinsics.j("Error in calling the initActivity: ", e2));
        }
    }

    @Override
    public void onBackPressed() {
        try {
            if (c()) {
                return;
            }
            b();
        } catch (RuntimeException e2) {
            com.amazon.aps.shared.a.k(com.amazon.aps.shared.analytics.b.FATAL, com.amazon.aps.shared.analytics.c.EXCEPTION, "Fail to execute onBackPressed method", e2);
        }
    }

    @Override
    public void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        try {
            e();
            WeakReference weakReference = f;
            if (weakReference == null) {
                com.amazon.aps.shared.a.j(com.amazon.aps.shared.analytics.b.FATAL, com.amazon.aps.shared.analytics.c.EXCEPTION, "Fail to create ApsInterstitialActivity as the ad view is null");
                finish();
            } else {
                if (weakReference != null) {
                    android.support.v4.media.session.b.a(weakReference.get());
                }
                d(null);
            }
        } catch (RuntimeException e2) {
            com.amazon.aps.shared.a.k(com.amazon.aps.shared.analytics.b.FATAL, com.amazon.aps.shared.analytics.c.EXCEPTION, "Fail to create ApsInterstitialActivity", e2);
            finish();
        }
    }

    @Override
    public void onDestroy() {
        try {
            RelativeLayout relativeLayout = (RelativeLayout) findViewById(g.inter_container);
            if (relativeLayout != null) {
                WeakReference weakReference = this.b;
                if (weakReference != null) {
                    android.support.v4.media.session.b.a(weakReference.get());
                }
                relativeLayout.removeView(null);
            }
            WeakReference weakReference2 = this.b;
            if (weakReference2 != null) {
                android.support.v4.media.session.b.a(weakReference2.get());
                a();
            }
        } catch (RuntimeException e2) {
            com.amazon.aps.shared.a.k(com.amazon.aps.shared.analytics.b.FATAL, com.amazon.aps.shared.analytics.c.EXCEPTION, "Failed to remove DTBAdView on Activity Destroy", e2);
        }
        super.onDestroy();
    }
}