导航菜单

页面标题

页面副标题

FanCode v7.24.0 - VmaxRewardedVideoActivity.java 源代码

正在查看: FanCode v7.24.0 应用的 VmaxRewardedVideoActivity.java JAVA 源代码文件

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


package com.vmax.ng.videohelper.rewardedvideo;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Bundle;
import android.widget.RelativeLayout;
import androidx.appcompat.app.a;
import androidx.appcompat.app.d;
import com.newrelic.agent.android.api.v2.TraceFieldInterface;
import com.newrelic.agent.android.background.ApplicationStateMonitor;
import com.newrelic.agent.android.instrumentation.Instrumented;
import com.newrelic.agent.android.tracing.Trace;
import com.newrelic.agent.android.tracing.TraceMachine;
import com.vmax.ng.interfaces.VmaxAdHelper;
import com.vmax.ng.utilities.VmaxLogger;
import com.vmax.ng.videohelper.VmaxAdRewardedVideo;
import java.util.ArrayList;
import kotlin.Metadata;
import kotlin.jvm.internal.Intrinsics;

@Metadata
@Instrumented
public final class VmaxRewardedVideoActivity extends d implements TraceFieldInterface {
    public Trace _nr_trace;
    private VmaxAdRewardedVideo.ActivityBackPressedListener activityBackPressedListener;
    private BroadcastReceiver broadcastReceiver;
    private boolean onAdCompleted;
    private boolean onAdStarted;
    private Integer outstreamVideoLayout = -1;
    private RelativeLayout rewardedAdContainer;
    private VmaxAdHelper vmaxVideoAdHelper;

    private final void createCloseAdBroadcast() {
        this.broadcastReceiver = new BroadcastReceiver() {
            @Override
            public void onReceive(Context context, Intent intent) {
                VmaxLogger.Companion.showErrorLog("VmaxRewardedVideoActivity :: onReceive()");
                String stringExtra = intent != null ? intent.getStringExtra("Action_Name") : null;
                if (stringExtra != null) {
                    int hashCode = stringExtra.hashCode();
                    if (hashCode == -1763778533) {
                        if (stringExtra.equals("CloseAd")) {
                            VmaxRewardedVideoActivity.this.finish();
                        }
                    } else if (hashCode == -232532987) {
                        if (stringExtra.equals("StartAd")) {
                            VmaxRewardedVideoActivity.this.onAdStarted = true;
                        }
                    } else if (hashCode == 1586800968 && stringExtra.equals("AdCompleted")) {
                        VmaxRewardedVideoActivity.this.onAdCompleted = true;
                    }
                }
            }
        };
        registerReceiver(this.broadcastReceiver, new IntentFilter(VmaxRewardedVideo.REWARDED_AD_BROADCAST_FILTER));
    }

    public void onBackPressed() {
        VmaxLogger.Companion.showDebugLog("Back key pressed :");
        if (this.onAdCompleted) {
            VmaxAdRewardedVideo.ActivityBackPressedListener activityBackPressedListener = this.activityBackPressedListener;
            if (activityBackPressedListener != null) {
                activityBackPressedListener.onActivityBackPressed();
            }
            super/*androidx.activity.ComponentActivity*/.onBackPressed();
        }
    }

    protected void onCreate(Bundle bundle) {
        TraceMachine.startTracing("VmaxRewardedVideoActivity");
        try {
            TraceMachine.enterMethod(this._nr_trace, "VmaxRewardedVideoActivity#onCreate", (ArrayList) null);
        } catch (NoSuchFieldError unused) {
            TraceMachine.enterMethod((Trace) null, "VmaxRewardedVideoActivity#onCreate", (ArrayList) null);
        }
        requestWindowFeature(1);
        a supportActionBar = getSupportActionBar();
        Intrinsics.checkNotNull(supportActionBar);
        supportActionBar.k();
        super/*androidx.fragment.app.FragmentActivity*/.onCreate(bundle);
        setContentView(getResources().getIdentifier("activity_vmax_rewarded_video", "layout", getPackageName()));
        this.rewardedAdContainer = (RelativeLayout) findViewById(getResources().getIdentifier("rewardedAdContainer", "id", getPackageName()));
        VmaxRewardedVideo instance$VmaxVideoHelper_fancode = VmaxRewardedVideo.Companion.getInstance$VmaxVideoHelper_fancode();
        Intrinsics.checkNotNull(instance$VmaxVideoHelper_fancode);
        this.vmaxVideoAdHelper = instance$VmaxVideoHelper_fancode.getVmaxVideoAdHelper();
        this.outstreamVideoLayout = instance$VmaxVideoHelper_fancode.getOutstreamVideoLayout();
        this.activityBackPressedListener = instance$VmaxVideoHelper_fancode.getActivityBackPressedListener();
        createCloseAdBroadcast();
        VmaxAdHelper vmaxAdHelper = this.vmaxVideoAdHelper;
        if (vmaxAdHelper != null) {
            RelativeLayout relativeLayout = this.rewardedAdContainer;
            Intrinsics.checkNotNull(relativeLayout);
            Integer num = this.outstreamVideoLayout;
            Intrinsics.checkNotNull(num);
            vmaxAdHelper.show(relativeLayout, num.intValue());
        }
        TraceMachine.exitMethod();
    }

    protected void onDestroy() {
        super.onDestroy();
        try {
            unregisterReceiver(this.broadcastReceiver);
        } catch (Exception unused) {
        }
    }

    protected void onPause() {
        VmaxAdHelper vmaxAdHelper;
        super/*androidx.fragment.app.FragmentActivity*/.onPause();
        if (this.onAdCompleted || (vmaxAdHelper = this.vmaxVideoAdHelper) == null) {
            return;
        }
        vmaxAdHelper.pause();
    }

    protected void onResume() {
        VmaxAdHelper vmaxAdHelper;
        super/*androidx.fragment.app.FragmentActivity*/.onResume();
        if (!this.onAdStarted || (vmaxAdHelper = this.vmaxVideoAdHelper) == null) {
            return;
        }
        vmaxAdHelper.resume();
    }

    protected void onStart() {
        super.onStart();
        ApplicationStateMonitor.getInstance().activityStarted();
    }

    protected void onStop() {
        super.onStop();
        ApplicationStateMonitor.getInstance().activityStopped();
    }
}