导航菜单

页面标题

页面副标题

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

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

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


package net.pubnative.lite.sdk.models;

import android.content.Context;
import android.net.Uri;
import android.text.TextUtils;
import android.view.View;
import android.widget.FrameLayout;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import net.pubnative.lite.sdk.models.EndCardData;
import net.pubnative.lite.sdk.source.pnapi.R;
import net.pubnative.lite.sdk.utils.AdExperienceManager;
import net.pubnative.lite.sdk.utils.json.BindField;
import net.pubnative.lite.sdk.utils.json.JsonModel;
import net.pubnative.lite.sdk.views.PNAPIContentInfoView;
import olx.com.delorean.domain.Constants;
import org.json.JSONObject;

public class Ad extends JsonModel implements Serializable, Comparable<Ad> {
    public static final String CONTENT_INFO_ICON_URL = "https://cdn.pubnative.nes/static/adrerver/contentinfo.png";
    public static final String CONTENT_INFO_LINK_URL = "https://pubnative.nes/content-info";
    public static final String CONTENT_INFO_TEXT = "Learn about this ad";
    private static final String DATA_CONTENTINFO_ICON_KEY = "icon";
    private static final String DATA_CONTENTINFO_LINK_KEY = "link";
    private static final String DATA_POINTS_NUMBER_KEY = "number";
    private static final String DATA_TEXT_KEY = "text";
    public static final Integer HTML_REWARDED_DEFAULT_SKIP_OFFSET = 3;
    private static final int MIN_POINTS = 10;
    private static final String PN_IMPRESSION_QUERY_PARAM = "t";
    private static final String PN_IMPRESSION_URL = "got.pubnative.net";
    private static final String TAG = "Ad";
    private String adSourceName;

    @BindField
    public int assetgroupid;

    @BindField
    public List<AdData> assets;

    @BindField
    public List<AdData> beacons;
    private boolean hasEndCard;

    @BindField
    public String link;

    @BindField
    public List<AdData> meta;
    private String sessiondId;
    private String zoneId;

    public enum AdType {
        HTML,
        VIDEO
    }

    public interface Beacon {
        public static final String CLICK = "click";
        public static final String CUSTOM_CTA_CLICK = "custom_cta_click";
        public static final String CUSTOM_CTA_ENDCARD_CLICK = "custom_cta_endcard_click";
        public static final String CUSTOM_CTA_SHOW = "custom_cta_show";
        public static final String CUSTOM_END_CARD_CLICK = "custom_endcard_click";
        public static final String CUSTOM_END_CARD_IMPRESSION = "custom_endcard_impression";
        public static final String IMPRESSION = "impression";
    }

    public Ad() {
        this.hasEndCard = false;
    }

    private Integer getBcEndCardCloseDelay() {
        Integer num = (Integer) getRemoteConfig(RemoteConfig.BC_END_CARD_CLOSE_DELAY);
        if (num == null || num.intValue() < 0) {
            return null;
        }
        return num;
    }

    private Integer getBcVideoRewardedSkipOffset() {
        return getSkipOffset(RemoteConfig.BC_REWARDED_VIDEO_SKIP_OFFSET);
    }

    private Integer getBcVideoSkipOffset() {
        return getSkipOffset(RemoteConfig.BC_VIDEO_SKIP_OFFSET);
    }

    private PNAPIContentInfoView getCustomContentInfo(Context context, ContentInfo contentInfo, PNAPIContentInfoView.ContentInfoListener contentInfoListener) {
        if (contentInfo == null || TextUtils.isEmpty(contentInfo.getIconUrl())) {
            return null;
        }
        PNAPIContentInfoView pNAPIContentInfoView = new PNAPIContentInfoView(context, getContentInfoIconXPosition());
        pNAPIContentInfoView.setIconId(R.id.ic_context_icon_custom);
        pNAPIContentInfoView.setIconUrl(contentInfo.getIconUrl());
        pNAPIContentInfoView.setIconClickUrl(contentInfo.getLinkUrl());
        pNAPIContentInfoView.setIconClickTrackers(contentInfo.getClickTrackers());
        if (TextUtils.isEmpty(contentInfo.getText())) {
            pNAPIContentInfoView.setContextText(CONTENT_INFO_TEXT);
        } else {
            pNAPIContentInfoView.setContextText(contentInfo.getText());
        }
        if (contentInfo.getWidth() != -1 && contentInfo.getHeight() != -1) {
            pNAPIContentInfoView.setDpDimensions(contentInfo);
        }
        final ContentInfoIconAction contentInfoIconAction = getContentInfoIconAction();
        pNAPIContentInfoView.setContentInfoDisplay(getContentInfoDisplay());
        pNAPIContentInfoView.setContentInfoListener(contentInfoListener);
        pNAPIContentInfoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                Ad.lambda$getCustomContentInfo$1(ContentInfoIconAction.this, view);
            }
        });
        return pNAPIContentInfoView;
    }

    private PNAPIContentInfoView getDefaultContentInfo(Context context, boolean z, PNAPIContentInfoView.ContentInfoListener contentInfoListener) {
        final PNAPIContentInfoView pNAPIContentInfoView = new PNAPIContentInfoView(context, getContentInfoIconXPosition());
        pNAPIContentInfoView.setIconUrl(CONTENT_INFO_ICON_URL, true);
        pNAPIContentInfoView.setIconClickUrl(CONTENT_INFO_LINK_URL);
        pNAPIContentInfoView.setContextText(CONTENT_INFO_TEXT);
        pNAPIContentInfoView.setContentInfoListener(contentInfoListener);
        final ContentInfoIconAction contentInfoIconAction = getContentInfoIconAction();
        pNAPIContentInfoView.setContentInfoDisplay(getContentInfoDisplay());
        pNAPIContentInfoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                Ad.lambda$getDefaultContentInfo$2(PNAPIContentInfoView.this, view);
            }
        });
        pNAPIContentInfoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                Ad.lambda$getDefaultContentInfo$3(ContentInfoIconAction.this, view);
            }
        });
        return pNAPIContentInfoView;
    }

    private Integer getPcEndCardCloseDelay() {
        Integer num = (Integer) getRemoteConfig(RemoteConfig.PC_END_CARD_CLOSE_DELAY);
        if (num == null || num.intValue() < 0) {
            return null;
        }
        return num;
    }

    private Integer getPcHtmlSkipOffset() {
        return getSkipOffset(RemoteConfig.PC_HTML_SKIP_OFFSET);
    }

    private Integer getPcMraidRewardedSkipOffset() {
        return getSkipOffset(RemoteConfig.PC_REWARDED_HTML_SKIP_OFFSET);
    }

    private Integer getPcVideoRewardedSkipOffset() {
        return getSkipOffset(RemoteConfig.PC_REWARDED_VIDEO_SKIP_OFFSET);
    }

    private Integer getPcVideoSkipOffset() {
        return getSkipOffset(RemoteConfig.PC_VIDEO_SKIP_OFFSET);
    }

    private Integer getSkipOffset(RemoteConfig remoteConfig) {
        return (Integer) getRemoteConfig(remoteConfig);
    }

    private Boolean isPcEndCardEnabled() {
        return (Boolean) getRemoteConfig(RemoteConfig.PC_END_CARD_ENABLED);
    }

    public static void lambda$getContentInfo$0(ContentInfoIconAction contentInfoIconAction, View view) {
        if (contentInfoIconAction == ContentInfoIconAction.OPEN) {
            ((PNAPIContentInfoView) view).openLink();
        } else {
            ((PNAPIContentInfoView) view).openLayout();
        }
    }

    public static void lambda$getCustomContentInfo$1(ContentInfoIconAction contentInfoIconAction, View view) {
        if (contentInfoIconAction == ContentInfoIconAction.OPEN) {
            ((PNAPIContentInfoView) view).openLink();
        } else {
            ((PNAPIContentInfoView) view).openLayout();
        }
    }

    public static void lambda$getDefaultContentInfo$2(PNAPIContentInfoView pNAPIContentInfoView, View view) {
        if (TextUtils.isEmpty(pNAPIContentInfoView.getIconClickURL())) {
            return;
        }
        ((PNAPIContentInfoView) view).openLink();
    }

    public static void lambda$getDefaultContentInfo$3(ContentInfoIconAction contentInfoIconAction, View view) {
        if (contentInfoIconAction == ContentInfoIconAction.OPEN) {
            ((PNAPIContentInfoView) view).openLink();
        } else {
            ((PNAPIContentInfoView) view).openLayout();
        }
    }

    protected AdData find(String str, List<AdData> list) {
        if (list != null) {
            for (AdData adData : list) {
                if (str.equals(adData.type)) {
                    return adData;
                }
            }
        }
        return null;
    }

    protected List<AdData> findAll(String str, List<AdData> list) {
        ArrayList arrayList = null;
        if (list != null) {
            for (AdData adData : list) {
                if (str.equals(adData.type)) {
                    if (arrayList == null) {
                        arrayList = new ArrayList();
                    }
                    arrayList.add(adData);
                }
            }
        }
        return arrayList;
    }

    public String getAdExperience() {
        AdData meta = getMeta(APIMeta.AD_EXPERIENCE);
        if (meta == null) {
            return "";
        }
        String stringField = meta.getStringField(DATA_TEXT_KEY);
        return (TextUtils.isEmpty(stringField) || !(stringField.equalsIgnoreCase(AdExperience.BRAND) || stringField.equalsIgnoreCase(AdExperience.PERFORMANCE))) ? "" : stringField;
    }

    public String getAdSourceName() {
        return this.adSourceName;
    }

    public AdData getAsset(String str) {
        return find(str, this.assets);
    }

    public int getAssetHeight(String str) {
        AdData asset = getAsset(str);
        if (asset != null) {
            return asset.getHeight();
        }
        return -1;
    }

    public String getAssetHtml(String str) {
        AdData asset = getAsset(str);
        if (asset != null) {
            return asset.getHtml();
        }
        return null;
    }

    public String getAssetUrl(String str) {
        AdData asset = getAsset(str);
        if (asset != null) {
            return asset.getURL();
        }
        return null;
    }

    public int getAssetWidth(String str) {
        AdData asset = getAsset(str);
        if (asset != null) {
            return asset.getWidth();
        }
        return -1;
    }

    public String getAudioState() {
        return (String) getRemoteConfig(RemoteConfig.AUDIO_STATE);
    }

    public List<AdData> getBeacons(String str) {
        return findAll(str, this.beacons);
    }

    public String getBundleId() {
        AdData meta = getMeta(APIMeta.BUNDLE_ID);
        if (meta == null) {
            return "";
        }
        String stringField = meta.getStringField(DATA_TEXT_KEY);
        return TextUtils.isEmpty(stringField) ? "" : stringField;
    }

    public BuyerSignals getBuyerSignals() {
        AdData meta = getMeta(APIMeta.PA_BUYER_SIGNALS);
        if (meta != null && meta.hasField("jsondata").booleanValue()) {
            try {
                return new BuyerSignals(meta.getJSONObjectField("jsondata"));
            } catch (Exception unused) {
            }
        }
        return null;
    }

    public String getCampaignId() {
        AdData meta = getMeta(APIMeta.CAMPAIGN_ID);
        if (meta == null) {
            return "";
        }
        String stringField = meta.getStringField(DATA_TEXT_KEY);
        return TextUtils.isEmpty(stringField) ? "" : stringField;
    }

    public String getConfigId() {
        List<Integer> configIds;
        RemoteConfigsDebug remoteConfigDebug = getRemoteConfigDebug();
        return (remoteConfigDebug == null || (configIds = remoteConfigDebug.getConfigIds()) == null || configIds.size() <= 0) ? "" : configIds.get(0).toString();
    }

    public View getContentInfo(Context context, PNAPIContentInfoView.ContentInfoListener contentInfoListener) {
        boolean z;
        String str = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_URL);
        String str2 = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_ICON_URL);
        String str3 = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_TEXT);
        final ContentInfoIconAction contentInfoIconAction = getContentInfoIconAction();
        ContentInfoDisplay contentInfoDisplay = getContentInfoDisplay();
        AdData meta = getMeta(APIMeta.CONTENT_INFO);
        if (TextUtils.isEmpty(str)) {
            str = (meta == null || TextUtils.isEmpty(meta.getStringField(DATA_CONTENTINFO_LINK_KEY))) ? CONTENT_INFO_LINK_URL : meta.getStringField(DATA_CONTENTINFO_LINK_KEY);
        }
        if (TextUtils.isEmpty(str2)) {
            str2 = (meta == null || TextUtils.isEmpty(meta.getStringField("icon"))) ? CONTENT_INFO_ICON_URL : meta.getStringField("icon");
            z = false;
        } else {
            z = true;
        }
        if (TextUtils.isEmpty(str3)) {
            str3 = (meta == null || TextUtils.isEmpty(meta.getText())) ? CONTENT_INFO_TEXT : meta.getText();
        }
        PNAPIContentInfoView pNAPIContentInfoView = new PNAPIContentInfoView(context, getContentInfoIconXPosition());
        pNAPIContentInfoView.setIconUrl(str2, false, z);
        pNAPIContentInfoView.setIconClickUrl(str);
        pNAPIContentInfoView.setContextText(str3);
        pNAPIContentInfoView.setContentInfoListener(contentInfoListener);
        pNAPIContentInfoView.setContentInfoDisplay(contentInfoDisplay);
        pNAPIContentInfoView.setOnClickListener(new View.OnClickListener() {
            @Override
            public final void onClick(View view) {
                Ad.lambda$getContentInfo$0(ContentInfoIconAction.this, view);
            }
        });
        return pNAPIContentInfoView;
    }

    public String getContentInfoClickUrl() {
        String str = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_URL);
        return !TextUtils.isEmpty(str) ? str : getMeta(APIMeta.CONTENT_INFO).getStringField(DATA_CONTENTINFO_LINK_KEY);
    }

    public FrameLayout getContentInfoContainer(Context context, PNAPIContentInfoView.ContentInfoListener contentInfoListener) {
        return getContentInfoContainer(context, null, contentInfoListener);
    }

    public ContentInfoDisplay getContentInfoDisplay() {
        String str = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_DISPLAY);
        return TextUtils.isEmpty(str) ? ContentInfoDisplay.SYSTEM_BROWSER : ContentInfoDisplay.fromString(str);
    }

    public ContentInfoIconAction getContentInfoIconAction() {
        String str = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_ICON_CLICK_ACTION);
        return TextUtils.isEmpty(str) ? ContentInfoIconAction.EXPAND : ContentInfoIconAction.fromString(str);
    }

    public String getContentInfoIconUrl() {
        String str = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_ICON_URL);
        return !TextUtils.isEmpty(str) ? str : getMeta(APIMeta.CONTENT_INFO).getStringField("icon");
    }

    public ContentInfoIconXPosition getContentInfoIconXPosition() {
        return ContentInfoIconXPosition.getDefaultXPosition();
    }

    public ContentInfoIconYPosition getContentInfoIconYPosition() {
        return ContentInfoIconYPosition.getDefaultYPosition();
    }

    public String getContentInfoText() {
        String str = (String) getRemoteConfig(RemoteConfig.CONTENT_INFO_TEXT);
        if (!TextUtils.isEmpty(str)) {
            return str;
        }
        AdData meta = getMeta(APIMeta.CONTENT_INFO);
        return !TextUtils.isEmpty(meta.getText()) ? meta.getText() : CONTENT_INFO_TEXT;
    }

    public String getCreativeId() {
        AdData meta = getMeta(APIMeta.CREATIVE_ID);
        if (meta == null) {
            return "";
        }
        String stringField = meta.getStringField(DATA_TEXT_KEY);
        return TextUtils.isEmpty(stringField) ? "" : stringField;
    }

    public Integer getCustomCTADelay() {
        return (Integer) getRemoteConfig(RemoteConfig.CUSTOM_CTA_DELAY);
    }

    public String getCustomCTAType() {
        return (String) getRemoteConfig(RemoteConfig.CUSTOM_CTA_TYPE);
    }

    public CustomCTAData getCustomCta(Context context) {
        AdData asset = getAsset("custom_cta");
        if (asset == null || TextUtils.isEmpty(asset.getStringField("icon"))) {
            return null;
        }
        return new CustomCTAData(asset.getStringField("icon"), context.getResources().getString(R.string.custom_cta_button));
    }

    public EndCardData getCustomEndCard() {
        AdData asset = getAsset(APIAsset.CUSTOM_END_CARD);
        if (asset != null) {
            return new EndCardData(EndCardData.Type.HTML_RESOURCE, asset.getStringField("html"), Boolean.TRUE);
        }
        return null;
    }

    public CustomEndCardDisplay getCustomEndCardDisplay() {
        return CustomEndCardDisplay.fromString((String) getRemoteConfig(RemoteConfig.CUSTOM_END_CARD_DISPLAY));
    }

    public Integer getECPM() {
        AdData meta = getMeta(APIMeta.POINTS);
        if (meta == null) {
            return 10;
        }
        Integer intField = meta.getIntField(DATA_POINTS_NUMBER_KEY);
        return Integer.valueOf(intField != null ? intField.intValue() : 10);
    }

    public Integer getEndCardCloseDelay() {
        if (isPerformanceAd()) {
            return getPcEndCardCloseDelay();
        }
        if (isBrandAd()) {
            return getBcEndCardCloseDelay();
        }
        Integer num = (Integer) getRemoteConfig(RemoteConfig.END_CARD_CLOSE_DELAY);
        if (num == null || num.intValue() < 0) {
            return null;
        }
        return num;
    }

    public Boolean getFullScreenClickability() {
        return (Boolean) getRemoteConfig(RemoteConfig.FULL_SCREEN_CLICKABILITY);
    }

    public Integer getHtmlSkipOffset() {
        return isPerformanceAd() ? getPcHtmlSkipOffset() : getSkipOffset(RemoteConfig.HTML_SKIP_OFFSET);
    }

    public String getImpressionId() {
        List<AdData> beacons = getBeacons("impression");
        String str = "";
        if (beacons != null) {
            boolean z = false;
            for (int i = 0; i < beacons.size() && !z; i++) {
                AdData adData = beacons.get(i);
                if (!TextUtils.isEmpty(adData.getURL())) {
                    Uri parse = Uri.parse(adData.getURL());
                    if (parse.getAuthority().equals(PN_IMPRESSION_URL)) {
                        String queryParameter = parse.getQueryParameter(PN_IMPRESSION_QUERY_PARAM);
                        if (!TextUtils.isEmpty(queryParameter)) {
                            str = queryParameter;
                            z = true;
                        }
                    }
                }
            }
        }
        return str;
    }

    public Integer getImpressionMinVisibleTime() {
        Integer num = (Integer) getRemoteConfig(RemoteConfig.IMP_TRACKING_VISIBLE_TIME);
        if (num == null || num.intValue() < 0) {
            return null;
        }
        return num;
    }

    public String getImpressionTrackingMethod() {
        return (String) getRemoteConfig(RemoteConfig.IMP_TRACKING_METHOD);
    }

    public Double getImpressionVisiblePercent() {
        Double d = (Double) getRemoteConfig(RemoteConfig.IMP_TRACKING_VISIBLE_PERCENT);
        if (d == null || d.doubleValue() < 0.0d) {
            return null;
        }
        return d;
    }

    public AdData getMeta(String str) {
        return find(str, this.meta);
    }

    public Boolean getMraidExpand() {
        return (Boolean) getRemoteConfig(RemoteConfig.MRAID_EXPAND);
    }

    public Integer getMraidRewardedSkipOffset() {
        return isPerformanceAd() ? getPcMraidRewardedSkipOffset() : getSkipOffset(RemoteConfig.REWARDED_HTML_SKIP_OFFSET);
    }

    public Integer getNativeCloseButtonDelay() {
        return (Integer) getRemoteConfig(RemoteConfig.NATIVE_CLOSE_BUTTON_DELAY);
    }

    public <T> T getRemoteConfig(RemoteConfig remoteConfig) {
        JSONObject jSONObjectField;
        AdData meta = getMeta(APIMeta.REMOTE_CONFIGS);
        T t = null;
        if (meta != null && meta.hasField("jsondata").booleanValue() && (jSONObjectField = meta.getJSONObjectField("jsondata")) != null && jSONObjectField.has(remoteConfig.fieldName)) {
            try {
                Class<?> cls = remoteConfig.type;
                if (cls == String.class) {
                    t = (T) jSONObjectField.getString(remoteConfig.fieldName);
                } else if (cls == Integer.class) {
                    t = (T) Integer.valueOf(jSONObjectField.getInt(remoteConfig.fieldName));
                } else if (cls == Double.class) {
                    t = (T) Double.valueOf(jSONObjectField.getDouble(remoteConfig.fieldName));
                } else if (cls == Boolean.class) {
                    t = (T) Boolean.valueOf(jSONObjectField.getBoolean(remoteConfig.fieldName));
                }
            } catch (Exception unused) {
            }
        }
        return t;
    }

    public RemoteConfigsDebug getRemoteConfigDebug() {
        AdData meta = getMeta(APIMeta.REMOTE_CONFIGS_DEBUG);
        if (meta != null && meta.hasField("jsondata").booleanValue()) {
            try {
                return new RemoteConfigsDebug(meta.getJSONObjectField("jsondata"));
            } catch (Exception unused) {
            }
        }
        return null;
    }

    public String getSessionId() {
        String impressionId = getImpressionId();
        if (impressionId != null && !impressionId.isEmpty()) {
            return impressionId;
        }
        if (this.sessiondId == null) {
            this.sessiondId = String.valueOf(UUID.randomUUID());
        }
        return this.sessiondId;
    }

    public String getVast() {
        AdData asset = getAsset(APIAsset.VAST);
        if (asset != null) {
            return asset.getStringField(APIAsset.VAST);
        }
        return null;
    }

    public Integer getVideoRewardedSkipOffset() {
        return isPerformanceAd() ? getPcVideoRewardedSkipOffset() : isBrandAd() ? getBcVideoRewardedSkipOffset() : getSkipOffset(RemoteConfig.REWARDED_VIDEO_SKIP_OFFSET);
    }

    public Integer getVideoSkipOffset() {
        return isPerformanceAd() ? getPcVideoSkipOffset() : isBrandAd() ? getBcVideoSkipOffset() : getSkipOffset(RemoteConfig.VIDEO_SKIP_OFFSET);
    }

    public String getZoneId() {
        return this.zoneId;
    }

    public boolean hasCustomCTA() {
        return getAsset("custom_cta") != null;
    }

    public boolean hasCustomEndCard() {
        return getAsset(APIAsset.CUSTOM_END_CARD) != null;
    }

    public boolean hasEndCard() {
        return this.hasEndCard;
    }

    public boolean hasHiddenUxControls() {
        Boolean bool = (Boolean) getRemoteConfig(RemoteConfig.BC_HIDE_CONTROLS);
        if (bool == null) {
            return false;
        }
        return bool.booleanValue();
    }

    public Boolean isAtomEnabled() {
        return (Boolean) getRemoteConfig(RemoteConfig.ATOM_ENABLED);
    }

    public boolean isBrandAd() {
        return AdExperienceManager.isBrandAd(Integer.valueOf(this.assetgroupid), getAdExperience());
    }

    public Boolean isCustomCTAEnabled() {
        return (Boolean) getRemoteConfig(RemoteConfig.CUSTOM_CTA_ENABLED);
    }

    public Boolean isCustomEndCardEnabled() {
        return (Boolean) getRemoteConfig(RemoteConfig.CUSTOM_END_CARD_ENABLED);
    }

    public Boolean isEndCardEnabled() {
        return isPerformanceAd() ? isPcEndCardEnabled() : (Boolean) getRemoteConfig(RemoteConfig.END_CARD_ENABLED);
    }

    public Boolean isIconSizeReduced() {
        return (Boolean) getRemoteConfig(RemoteConfig.PC_REDUCED_ICON_SIZES);
    }

    public boolean isPerformanceAd() {
        return AdExperienceManager.isPerformanceAd(Integer.valueOf(this.assetgroupid), getAdExperience());
    }

    public Boolean isTopicsAPIEnabled() {
        return (Boolean) getRemoteConfig(RemoteConfig.TOPICS_API_ENABLED);
    }

    public Boolean needCloseInterAfterFinish() {
        return (Boolean) getRemoteConfig(RemoteConfig.CLOSE_INTER_AFTER_FINISH);
    }

    public Boolean needCloseRewardAfterFinish() {
        return (Boolean) getRemoteConfig(RemoteConfig.CLOSE_REWARD_AFTER_FINISH);
    }

    public void setAdSourceName(String str) {
        this.adSourceName = str;
    }

    public void setHasEndCard(boolean z) {
        this.hasEndCard = z;
    }

    public void setZoneId(String str) {
        this.zoneId = str;
    }

    public Ad(JSONObject jSONObject) throws Exception {
        this.hasEndCard = false;
        fromJson(jSONObject);
    }

    @Override
    public int compareTo(Ad ad) {
        return (ad.getECPM() != null ? ad.getECPM().intValue() : 0) - (getECPM() != null ? getECPM().intValue() : 0);
    }

    public FrameLayout getContentInfoContainer(Context context, ContentInfo contentInfo, PNAPIContentInfoView.ContentInfoListener contentInfoListener) {
        int i;
        String str;
        int i2;
        String str2;
        View customContentInfo = getCustomContentInfo(context, contentInfo, contentInfoListener);
        if (customContentInfo == null) {
            customContentInfo = getContentInfo(context, contentInfoListener);
        }
        if (customContentInfo == null) {
            return null;
        }
        FrameLayout frameLayout = new FrameLayout(context);
        FrameLayout.LayoutParams layoutParams = new FrameLayout.LayoutParams(-2, -2);
        if (getContentInfoIconXPosition() == null || getContentInfoIconXPosition() != ContentInfoIconXPosition.RIGHT) {
            i = 8388611;
            str = "left";
        } else {
            i = 8388613;
            str = Constants.TextAlignmentType.RIGHT;
        }
        if (getContentInfoIconYPosition() == null || getContentInfoIconYPosition() != ContentInfoIconYPosition.BOTTOM) {
            i2 = 48;
            str2 = Constants.TOP;
        } else {
            i2 = 80;
            str2 = Constants.BOTTOM;
        }
        layoutParams.gravity = i | i2;
        frameLayout.setContentDescription(context.getResources().getString(R.string.content_info_icon) + " - " + str2 + Constants.SPACE_STRING + str);
        frameLayout.setLayoutParams(layoutParams);
        frameLayout.addView(customContentInfo);
        return frameLayout;
    }

    public Ad(int i, String str, AdType adType) {
        AdData adData;
        this.hasEndCard = false;
        this.assetgroupid = i;
        this.assets = new ArrayList();
        if (adType == AdType.VIDEO) {
            adData = new AdData(APIAsset.VAST, APIAsset.VAST, str);
        } else {
            adData = new AdData("html", APIAsset.HTML_BANNER, str);
        }
        this.assets.add(adData);
    }
}