导航菜单

页面标题

页面副标题

BetterTogether v3.0.0 - MoPubFullscreenActivity.java 源代码

正在查看: BetterTogether v3.0.0 应用的 MoPubFullscreenActivity.java JAVA 源代码文件

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


package com.mopub.mobileads;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import com.mopub.common.CreativeOrientation;
import com.mopub.common.DataKeys;
import com.mopub.common.IntentActions;
import com.mopub.common.logging.MoPubLog;
import com.mopub.common.util.DeviceUtils;
import com.mopub.common.util.Intents;
import com.mopub.common.util.Utils;
import com.mopub.exceptions.IntentNotResolvableException;

public class MoPubFullscreenActivity extends Activity {
    public static final int e = 0;
    public FullscreenAdController d;

    public static void start(Context context, AdData adData) {
        Intent intent = new Intent(context, (Class<?>) MoPubFullscreenActivity.class);
        intent.putExtra(DataKeys.AD_DATA_KEY, adData);
        intent.setFlags(268435456);
        try {
            Intents.startActivity(context, intent);
        } catch (IntentNotResolvableException unused) {
            Log.d("MoPubFullscreenActivity", "MoPubFullscreenActivity.class not found. Did you declare MoPubFullscreenActivity in your manifest?");
        }
    }

    @Override
    public final void onActivityResult(int i, int i2, Intent intent) {
        FullscreenAdController fullscreenAdController = this.d;
        if (fullscreenAdController != null) {
            fullscreenAdController.onActivityResult(i, i2, intent);
        }
    }

    @Override
    public void onBackPressed() {
        BaseVideoViewController baseVideoViewController;
        FullscreenAdController fullscreenAdController = this.d;
        if (fullscreenAdController != null) {
            ko.l lVar = ko.l.VIDEO;
            ko.l lVar2 = fullscreenAdController.w;
            if (!((!lVar.equals(lVar2) || (baseVideoViewController = fullscreenAdController.e) == null) ? ko.l.MRAID.equals(lVar2) ? fullscreenAdController.P : true : baseVideoViewController.backButtonEnabled())) {
                return;
            }
        }
        super.onBackPressed();
    }

    @Override
    public final void onCreate(Bundle bundle) {
        AdData adData;
        super.onCreate(bundle);
        try {
            adData = (AdData) getIntent().getParcelableExtra(DataKeys.AD_DATA_KEY);
        } catch (ClassCastException unused) {
            adData = null;
        }
        if (adData == null) {
            MoPubLog.log(MoPubLog.SdkLogEvent.CUSTOM, "Ad data to show ad is null. Failed to show fullscreen ad.");
            finish();
            return;
        }
        long broadcastIdentifier = adData.getBroadcastIdentifier();
        try {
            this.d = new FullscreenAdController(this, bundle, getIntent(), adData);
            CreativeOrientation creativeOrientation = CreativeOrientation.DEVICE;
            if (adData.getOrientation() != null) {
                creativeOrientation = adData.getOrientation();
            }
            DeviceUtils.lockOrientation(this, creativeOrientation);
            MoPubLog.log(MoPubLog.AdLogEvent.SHOW_SUCCESS, new Object[0]);
            BaseBroadcastReceiver.broadcastAction(this, adData.getBroadcastIdentifier(), IntentActions.ACTION_FULLSCREEN_SHOW);
            getWindow().setFlags(16777216, 16777216);
        } catch (IllegalStateException unused2) {
            MoPubLog.AdLogEvent adLogEvent = MoPubLog.AdLogEvent.SHOW_FAILED;
            MoPubErrorCode moPubErrorCode = MoPubErrorCode.FULLSCREEN_SHOW_ERROR;
            MoPubLog.log(adLogEvent, moPubErrorCode, Integer.valueOf(moPubErrorCode.getIntCode()));
            BaseBroadcastReceiver.broadcastAction(this, broadcastIdentifier, IntentActions.ACTION_FULLSCREEN_FAIL);
            finish();
        }
    }

    @Override
    public final void onDestroy() {
        FullscreenAdController fullscreenAdController = this.d;
        if (fullscreenAdController != null) {
            fullscreenAdController.destroy();
        }
        super.onDestroy();
    }

    @Override
    public final void onPause() {
        FullscreenAdController fullscreenAdController = this.d;
        if (fullscreenAdController != null) {
            fullscreenAdController.pause();
        }
        super.onPause();
    }

    @Override
    public final void onResume() {
        super.onResume();
        FullscreenAdController fullscreenAdController = this.d;
        if (fullscreenAdController != null) {
            fullscreenAdController.resume();
        }
    }

    @Override
    public final void onStart() {
        super.onStart();
        Utils.hideNavigationBar(this);
    }
}