导航菜单

页面标题

页面副标题

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

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

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


package net.pubnative.lite.sdk.rewarded.activity;

import android.os.Bundle;
import android.view.View;
import net.pubnative.lite.sdk.models.APIAsset;
import net.pubnative.lite.sdk.mraid.MRAIDBanner;
import net.pubnative.lite.sdk.mraid.MRAIDNativeFeature;
import net.pubnative.lite.sdk.mraid.MRAIDNativeFeatureListener;
import net.pubnative.lite.sdk.mraid.MRAIDView;
import net.pubnative.lite.sdk.mraid.MRAIDViewCloseLayoutListener;
import net.pubnative.lite.sdk.mraid.MRAIDViewListener;
import net.pubnative.lite.sdk.rewarded.HyBidRewardedBroadcastReceiver;
import net.pubnative.lite.sdk.utils.SkipOffsetManager;

public class MraidRewardedActivity extends HyBidRewardedActivity implements MRAIDViewListener, MRAIDNativeFeatureListener, MRAIDViewCloseLayoutListener {
    private final String[] mSupportedNativeFeatures = {MRAIDNativeFeature.CALENDAR, MRAIDNativeFeature.INLINE_VIDEO, "sms", MRAIDNativeFeature.STORE_PICTURE, MRAIDNativeFeature.TEL, "location"};
    private MRAIDBanner mView;

    @Override
    public View getAdView() {
        MRAIDBanner mRAIDBanner = null;
        if (getAd() != null) {
            Integer mraidRewardedSkipOffset = getAd().getMraidRewardedSkipOffset();
            Boolean bool = Boolean.FALSE;
            Integer hTMLSkipOffset = SkipOffsetManager.getHTMLSkipOffset(mraidRewardedSkipOffset, bool);
            boolean z = true;
            if (hTMLSkipOffset == null || hTMLSkipOffset.intValue() <= 0) {
                this.mIsSkippable = true;
                showRewardedCloseButton();
                z = false;
            } else {
                this.mIsSkippable = false;
            }
            if (getAd().getAssetUrl(APIAsset.HTML_BANNER) != null) {
                mRAIDBanner = new MRAIDBanner(this, getAd().getAssetUrl(APIAsset.HTML_BANNER), "", Boolean.valueOf(z), bool, this.mSupportedNativeFeatures, this, this, getAd().getContentInfoContainer(this, this));
            } else if (getAd().getAssetHtml(APIAsset.HTML_BANNER) != null) {
                mRAIDBanner = new MRAIDBanner(this, "", getAd().getAssetHtml(APIAsset.HTML_BANNER), Boolean.valueOf(z), bool, this.mSupportedNativeFeatures, this, this, getAd().getContentInfoContainer(this, this));
            }
            if (mRAIDBanner != null) {
                mRAIDBanner.setCloseLayoutListener(this);
            }
            if (hTMLSkipOffset != null && hTMLSkipOffset.intValue() >= 0 && mRAIDBanner != null) {
                mRAIDBanner.setSkipOffset(hTMLSkipOffset);
            }
            Integer nativeCloseButtonDelay = SkipOffsetManager.getNativeCloseButtonDelay(getAd().getNativeCloseButtonDelay());
            if (nativeCloseButtonDelay != null && nativeCloseButtonDelay.intValue() > 0 && mRAIDBanner != null) {
                mRAIDBanner.setNativeCloseButtonDelay(nativeCloseButtonDelay);
            }
        }
        this.mView = mRAIDBanner;
        return mRAIDBanner;
    }

    @Override
    public void mraidNativeFeatureCallTel(String str) {
    }

    @Override
    public void mraidNativeFeatureCreateCalendarEvent(String str) {
    }

    @Override
    public void mraidNativeFeatureOpenBrowser(String str) {
        if (getBroadcastSender() != null) {
            getBroadcastSender().sendBroadcast(HyBidRewardedBroadcastReceiver.Action.CLICK);
        }
        getUrlHandler().handleUrl(str);
    }

    @Override
    public void mraidNativeFeaturePlayVideo(String str) {
    }

    @Override
    public void mraidNativeFeatureSendSms(String str) {
    }

    @Override
    public void mraidNativeFeatureStorePicture(String str) {
    }

    @Override
    public void mraidShowCloseButton() {
        this.mIsSkippable = true;
        showRewardedCloseButton();
    }

    @Override
    public void mraidViewClose(MRAIDView mRAIDView) {
    }

    @Override
    public void mraidViewError(MRAIDView mRAIDView) {
        if (getBroadcastSender() != null) {
            getBroadcastSender().sendBroadcast(HyBidRewardedBroadcastReceiver.Action.ERROR);
        }
        dismiss();
    }

    @Override
    public void mraidViewExpand(MRAIDView mRAIDView) {
    }

    @Override
    public void mraidViewLoaded(MRAIDView mRAIDView) {
        if (getBroadcastSender() != null) {
            getBroadcastSender().sendBroadcast(HyBidRewardedBroadcastReceiver.Action.OPEN);
        }
    }

    @Override
    public boolean mraidViewResize(MRAIDView mRAIDView, int i, int i2, int i3, int i4) {
        return true;
    }

    @Override
    public void onClose() {
        dismiss();
    }

    @Override
    protected void onCreate(Bundle bundle) {
        if (getResources().getConfiguration().orientation == 2) {
            setRequestedOrientation(0);
        }
        if (getResources().getConfiguration().orientation == 1) {
            setRequestedOrientation(1);
        }
        super.onCreate(bundle);
        hideRewardedCloseButton();
    }

    @Override
    protected void onDestroy() {
        MRAIDBanner mRAIDBanner = this.mView;
        if (mRAIDBanner != null) {
            mRAIDBanner.stopAdSession();
            this.mView.destroy();
        }
        super.onDestroy();
    }

    @Override
    public void onExpandedAdClosed() {
    }

    @Override
    protected void onPause() {
        super.onPause();
        pauseAd();
    }

    @Override
    public void onRemoveCloseLayout() {
        hideRewardedCloseButton();
    }

    @Override
    protected void onResume() {
        resumeAd();
        super.onResume();
    }

    @Override
    public void onShowCloseLayout() {
        this.mIsSkippable = true;
        showRewardedCloseButton();
    }

    @Override
    protected void pauseAd() {
        this.mView.pause();
    }

    @Override
    protected void resumeAd() {
        if (this.mIsFeedbackFormOpen) {
            return;
        }
        this.mView.resume();
    }

    @Override
    protected boolean shouldShowContentInfo() {
        return false;
    }
}