English Books v1.2.1.1版本的 MD5 值为:9f4daf2c280cad25d94d488349a089ac

以下内容为反编译后的 AppLovinNativeAdImpl.java 源代码,内容仅作参考


package com.applovin.impl.sdk.nativeAd;

import android.content.Context;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.applovin.impl.sdk.AppLovinAdBase;
import com.applovin.impl.sdk.ad;
import com.applovin.impl.sdk.array.ArrayService;
import com.applovin.impl.sdk.network.l;
import com.applovin.impl.sdk.p;
import com.applovin.impl.sdk.utils.JsonUtils;
import com.applovin.impl.sdk.utils.StringUtils;
import com.applovin.impl.sdk.utils.Utils;
import com.applovin.impl.sdk.utils.h;
import com.applovin.impl.sdk.utils.k;
import com.applovin.impl.sdk.y;
import com.applovin.sdk.AppLovinSdkUtils;
import com.iab.omid.library.applovin.adsession.VerificationScriptResource;
import com.mbridge.msdk.playercommon.exoplayer2.C;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import org.json.JSONArray;
import org.json.JSONObject;
public class AppLovinNativeAdImpl extends AppLovinAdBase implements AppLovinNativeAd {
    private static final String AD_RESPONSE_TYPE_APPLOVIN = "applovin";
    private static final String AD_RESPONSE_TYPE_ORTB = "ortb";
    private static final String AD_RESPONSE_TYPE_UNDEFINED = "undefined";
    private static final String DEFAULT_APPLOVIN_PRIVACY_URL = "https://www.applovin.com/privacy/";
    private static final float MINIMUM_STARS_TO_RENDER = 3.0f;
    private static final int VIEWABLE_MRC100_PERCENTAGE = 100;
    private static final int VIEWABLE_MRC50_PERCENTAGE = 50;
    private static final int VIEWABLE_MRC_REQUIRED_SECONDS = 1;
    private static final int VIEWABLE_VIDEO_MRC_REQUIRED_SECONDS = 2;
    private final com.applovin.impl.sdk.a.e adEventTracker;
    private final String advertiser;
    private final String body;
    private final String callToAction;
    private final Uri clickDestinationBackupUri;
    private final Uri clickDestinationUri;
    private final a clickHandler;
    private final List<String> clickTrackingUrls;
    private AppLovinNativeAdEventListener eventListener;
    private Uri iconUri;
    private final List<l> impressionRequests;
    private final AtomicBoolean impressionTracked;
    private final List<String> jsTrackers;
    private Uri mainImageUri;
    private AppLovinMediaView mediaView;
    private ViewGroup nativeAdView;
    private final b onAttachStateChangeHandler;
    private AppLovinOptionsView optionsView;
    private Uri privacyDestinationUri;
    private Uri privacyIconUri;
    private final List<View> registeredViews;
    private final Double starRating;
    private final String tag;
    private final String title;
    private final com.applovin.impl.c.a vastAd;
    @Nullable
    private View videoView;
    private final c viewableMRC100Callback;
    private ad viewableMRC100Tracker;
    private final c viewableMRC50Callback;
    private ad viewableMRC50Tracker;
    @Nullable
    private c viewableVideoMRC50Callback;
    @Nullable
    private ad viewableVideoMRC50Tracker;

    public static class Builder {
        private final JSONObject adObject;
        private String advertiser;
        private String body;
        private String callToAction;
        private Uri clickDestinationBackupUri;
        private Uri clickDestinationUri;
        private List<String> clickTrackingUrls;
        private final JSONObject fullResponse;
        private Uri iconUri;
        private List<l> impressionRequests;
        private List<String> jsTrackers;
        private Uri mainImageUri;
        private Uri privacyDestinationUri;
        private Uri privacyIconUri;
        private final p sdk;
        private Double starRating;
        private String title;
        private com.applovin.impl.c.a vastAd;
        private List<l> viewableMRC100Requests;
        private List<l> viewableMRC50Requests;
        private List<l> viewableVideo50Requests;

        public Builder(JSONObject jSONObject, JSONObject jSONObject2, p pVar) {
            this.adObject = jSONObject;
            this.fullResponse = jSONObject2;
            this.sdk = pVar;
        }

        public AppLovinNativeAdImpl build() {
            return new AppLovinNativeAdImpl(this);
        }

        public Builder setAdvertiser(String str) {
            this.advertiser = str;
            return this;
        }

        public Builder setBody(String str) {
            this.body = str;
            return this;
        }

        public Builder setCallToAction(String str) {
            this.callToAction = str;
            return this;
        }

        public Builder setClickDestinationBackupUri(Uri uri) {
            this.clickDestinationBackupUri = uri;
            return this;
        }

        public Builder setClickDestinationUri(Uri uri) {
            this.clickDestinationUri = uri;
            return this;
        }

        public Builder setClickTrackingUrls(List<String> list) {
            this.clickTrackingUrls = list;
            return this;
        }

        public Builder setIconUri(Uri uri) {
            this.iconUri = uri;
            return this;
        }

        public Builder setImpressionRequests(List<l> list) {
            this.impressionRequests = list;
            return this;
        }

        public Builder setJsTrackers(List<String> list) {
            this.jsTrackers = list;
            return this;
        }

        public Builder setMainImageUri(Uri uri) {
            this.mainImageUri = uri;
            return this;
        }

        public Builder setPrivacyDestinationUri(Uri uri) {
            this.privacyDestinationUri = uri;
            return this;
        }

        public Builder setPrivacyIconUri(Uri uri) {
            this.privacyIconUri = uri;
            return this;
        }

        public Builder setStarRating(Double d) {
            this.starRating = d;
            return this;
        }

        public Builder setTitle(String str) {
            this.title = str;
            return this;
        }

        public Builder setVastAd(com.applovin.impl.c.a aVar) {
            this.vastAd = aVar;
            return this;
        }

        public Builder setViewableMRC100Requests(List<l> list) {
            this.viewableMRC100Requests = list;
            return this;
        }

        public Builder setViewableMRC50Requests(List<l> list) {
            this.viewableMRC50Requests = list;
            return this;
        }

        public Builder setViewableVideo50Requests(List<l> list) {
            this.viewableVideo50Requests = list;
            return this;
        }
    }

    public static class a implements View.OnClickListener {
        private final AppLovinNativeAdImpl f7823a;

        public a(AppLovinNativeAdImpl appLovinNativeAdImpl) {
            this.f7823a = appLovinNativeAdImpl;
        }

        public void a(AppLovinNativeAdImpl appLovinNativeAdImpl, Context context) {
            y L;
            String str;
            StringBuilder sb2;
            Uri uri;
            if (Utils.openUri(context, appLovinNativeAdImpl.clickDestinationUri, ((AppLovinAdBase) appLovinNativeAdImpl).sdk)) {
                ((AppLovinAdBase) appLovinNativeAdImpl).sdk.L();
                if (!y.a()) {
                    return;
                }
                L = ((AppLovinAdBase) appLovinNativeAdImpl).sdk.L();
                str = appLovinNativeAdImpl.tag;
                sb2 = new StringBuilder("Opening URL: ");
                uri = appLovinNativeAdImpl.clickDestinationUri;
            } else if (!Utils.openUri(context, appLovinNativeAdImpl.clickDestinationBackupUri, ((AppLovinAdBase) appLovinNativeAdImpl).sdk)) {
                return;
            } else {
                ((AppLovinAdBase) appLovinNativeAdImpl).sdk.L();
                if (!y.a()) {
                    return;
                }
                L = ((AppLovinAdBase) appLovinNativeAdImpl).sdk.L();
                str = appLovinNativeAdImpl.tag;
                sb2 = new StringBuilder("Opening backup URL: ");
                uri = appLovinNativeAdImpl.clickDestinationBackupUri;
            }
            sb2.append(uri);
            L.b(str, sb2.toString());
        }

        public AppLovinNativeAdImpl a() {
            return this.f7823a;
        }

        public boolean a(Object obj) {
            return obj instanceof a;
        }

        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (obj instanceof a) {
                a aVar = (a) obj;
                if (aVar.a((Object) this)) {
                    AppLovinNativeAdImpl a10 = a();
                    AppLovinNativeAdImpl a11 = aVar.a();
                    return a10 != null ? a10.equals(a11) : a11 == null;
                }
                return false;
            }
            return false;
        }

        public int hashCode() {
            AppLovinNativeAdImpl a10 = a();
            return 59 + (a10 == null ? 43 : a10.hashCode());
        }

        @Override
        public void onClick(final View view) {
            ((AppLovinAdBase) this.f7823a).sdk.L();
            if (y.a()) {
                ((AppLovinAdBase) this.f7823a).sdk.L().b(this.f7823a.tag, "Handle view clicked");
            }
            ((AppLovinAdBase) this.f7823a).sdk.E().maybeSubmitPersistentPostbacks(this.f7823a.getDirectClickTrackingPostbacks());
            for (String str : this.f7823a.clickTrackingUrls) {
                ((AppLovinAdBase) this.f7823a).sdk.ak().dispatchPostbackAsync(str, null);
            }
            k.a(this.f7823a.eventListener, this.f7823a);
            if (this.f7823a.isDirectDownloadEnabled()) {
                ((AppLovinAdBase) this.f7823a).sdk.ai().startDirectInstallOrDownloadProcess(this.f7823a, new ArrayService.DirectDownloadListener() {
                    @Override
                    public void onAppDetailsDismissed() {
                    }

                    @Override
                    public void onAppDetailsDisplayed() {
                    }

                    @Override
                    public void onFailure() {
                        a aVar = a.this;
                        aVar.a(aVar.f7823a, view.getContext());
                    }
                });
            } else {
                a(this.f7823a, view.getContext());
            }
        }

        public String toString() {
            return "AppLovinNativeAdImpl.ClickHandler(ad=" + a() + ")";
        }
    }

    public static class b implements View.OnAttachStateChangeListener {
        private final AppLovinNativeAdImpl f7826a;

        public b(AppLovinNativeAdImpl appLovinNativeAdImpl) {
            this.f7826a = appLovinNativeAdImpl;
        }

        public AppLovinNativeAdImpl a() {
            return this.f7826a;
        }

        public boolean a(Object obj) {
            return obj instanceof b;
        }

        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (obj instanceof b) {
                b bVar = (b) obj;
                if (bVar.a(this)) {
                    AppLovinNativeAdImpl a10 = a();
                    AppLovinNativeAdImpl a11 = bVar.a();
                    return a10 != null ? a10.equals(a11) : a11 == null;
                }
                return false;
            }
            return false;
        }

        public int hashCode() {
            AppLovinNativeAdImpl a10 = a();
            return 59 + (a10 == null ? 43 : a10.hashCode());
        }

        @Override
        public void onViewAttachedToWindow(View view) {
            this.f7826a.maybeHandleOnAttachedToWindow(view);
        }

        @Override
        public void onViewDetachedFromWindow(View view) {
        }

        public String toString() {
            return "AppLovinNativeAdImpl.OnAttachStateChangeHandler(ad=" + a() + ")";
        }
    }

    public class c implements ad.a {
        private final List<l> f7828b;

        public c(List<l> list) {
            this.f7828b = list;
        }

        public List<l> a() {
            return this.f7828b;
        }

        public boolean a(Object obj) {
            return obj instanceof c;
        }

        public boolean equals(Object obj) {
            if (obj == this) {
                return true;
            }
            if (obj instanceof c) {
                c cVar = (c) obj;
                if (cVar.a(this)) {
                    List<l> a10 = a();
                    List<l> a11 = cVar.a();
                    return a10 != null ? a10.equals(a11) : a11 == null;
                }
                return false;
            }
            return false;
        }

        public int hashCode() {
            List<l> a10 = a();
            return 59 + (a10 == null ? 43 : a10.hashCode());
        }

        @Override
        public void onLogVisibilityImpression() {
            for (l lVar : this.f7828b) {
                ((AppLovinAdBase) AppLovinNativeAdImpl.this).sdk.ak().dispatchPostbackRequest(lVar, null);
            }
        }

        public String toString() {
            return "AppLovinNativeAdImpl.VisibilityCallback(requests=" + a() + ")";
        }
    }

    private AppLovinNativeAdImpl(Builder builder) {
        super(builder.adObject, builder.fullResponse, builder.sdk);
        Uri parse;
        this.impressionTracked = new AtomicBoolean();
        this.registeredViews = new ArrayList();
        this.clickHandler = new a(this);
        this.onAttachStateChangeHandler = new b(this);
        this.adEventTracker = new com.applovin.impl.sdk.a.e(this);
        this.title = builder.title;
        this.advertiser = builder.advertiser;
        this.body = builder.body;
        this.callToAction = builder.callToAction;
        this.iconUri = builder.iconUri;
        this.mainImageUri = builder.mainImageUri;
        this.privacyIconUri = builder.privacyIconUri;
        com.applovin.impl.c.a aVar = builder.vastAd;
        this.vastAd = aVar;
        this.clickDestinationUri = builder.clickDestinationUri;
        this.clickDestinationBackupUri = builder.clickDestinationBackupUri;
        this.clickTrackingUrls = builder.clickTrackingUrls;
        this.jsTrackers = builder.jsTrackers;
        this.impressionRequests = builder.impressionRequests;
        Double d = builder.starRating;
        this.starRating = (d == null || d.doubleValue() < 3.0d) ? null : null;
        if (builder.privacyDestinationUri == null) {
            parse = (!isDspAd() || getSdk().av().a()) ? Uri.parse(DEFAULT_APPLOVIN_PRIVACY_URL) : parse;
            this.viewableMRC50Callback = new c(builder.viewableMRC50Requests);
            this.viewableMRC100Callback = new c(builder.viewableMRC100Requests);
            if (aVar != null && aVar.hasVideoUrl()) {
                this.viewableVideoMRC50Callback = new c(builder.viewableVideo50Requests);
            }
            this.tag = "AppLovinNativeAd:" + getAdIdNumber();
        }
        parse = builder.privacyDestinationUri;
        this.privacyDestinationUri = parse;
        this.viewableMRC50Callback = new c(builder.viewableMRC50Requests);
        this.viewableMRC100Callback = new c(builder.viewableMRC100Requests);
        if (aVar != null) {
            this.viewableVideoMRC50Callback = new c(builder.viewableVideo50Requests);
        }
        this.tag = "AppLovinNativeAd:" + getAdIdNumber();
    }

    public List<com.applovin.impl.sdk.d.a> getDirectClickTrackingPostbacks() {
        List<com.applovin.impl.sdk.d.a> postbacks;
        synchronized (this.adObjectLock) {
            postbacks = Utils.getPostbacks("click_tracking_urls", this.adObject, getClCode(), getStringFromAdObject("click_tracking_url", null), this.sdk);
        }
        return postbacks;
    }

    private boolean isDspAd() {
        return AD_RESPONSE_TYPE_ORTB.equalsIgnoreCase(getType());
    }

    public void maybeHandleOnAttachedToWindow(View view) {
        if (this.impressionTracked.compareAndSet(false, true)) {
            ad adVar = new ad(this.nativeAdView, this.sdk, this.viewableMRC50Callback);
            this.viewableMRC50Tracker = adVar;
            TimeUnit timeUnit = TimeUnit.SECONDS;
            adVar.a(0, 50.0f, 50.0f, timeUnit.toMillis(1L), this.nativeAdView);
            ad adVar2 = new ad(this.nativeAdView, this.sdk, this.viewableMRC100Callback);
            this.viewableMRC100Tracker = adVar2;
            adVar2.a(0, 100.0f, 100.0f, timeUnit.toMillis(1L), this.nativeAdView);
            com.applovin.impl.c.a aVar = this.vastAd;
            if (aVar != null && aVar.hasVideoUrl()) {
                ad adVar3 = new ad(this.nativeAdView, this.sdk, this.viewableVideoMRC50Callback);
                this.viewableVideoMRC50Tracker = adVar3;
                adVar3.a(0, 50.0f, 50.0f, timeUnit.toMillis(2L), this.videoView);
            }
            List<String> list = this.jsTrackers;
            if (list != null && list.size() > 0) {
                if (((Boolean) this.sdk.a(com.applovin.impl.sdk.c.b.fQ)).booleanValue()) {
                    for (String str : this.jsTrackers) {
                        this.sdk.aa().a(str);
                    }
                } else {
                    String str2 = this.jsTrackers.get(0);
                    if (StringUtils.isValidString(str2)) {
                        final com.applovin.impl.adview.d dVar = new com.applovin.impl.adview.d(null, this.sdk, view.getContext());
                        dVar.loadData(str2, "text/html", C.UTF8_NAME);
                        AppLovinSdkUtils.runOnUiThreadDelayed(new Runnable() {
                            @Override
                            public void run() {
                                dVar.stopLoading();
                            }
                        }, timeUnit.toMillis(5L));
                    }
                }
            }
            for (l lVar : this.impressionRequests) {
                this.sdk.ak().dispatchPostbackRequest(lVar, null);
            }
            this.adEventTracker.a(view);
            this.adEventTracker.d();
        }
    }

    @Override
    public void destroy() {
        unregisterViewsForInteraction();
        this.eventListener = null;
        this.adEventTracker.e();
    }

    public com.applovin.impl.sdk.a.e getAdEventTracker() {
        return this.adEventTracker;
    }

    @Override
    public long getAdIdNumber() {
        return getLongFromAdObject("ad_id", -1L);
    }

    @Override
    public String getAdvertiser() {
        return this.advertiser;
    }

    @Override
    public String getBody() {
        return this.body;
    }

    @Nullable
    public String getCachePrefix() {
        return getStringFromAdObject("cache_prefix", null);
    }

    @Override
    public String getCallToAction() {
        return this.callToAction;
    }

    public a getClickHandler() {
        return this.clickHandler;
    }

    @Override
    @Nullable
    public Bundle getDirectDownloadParameters() {
        JSONObject jsonObjectFromAdObject = getJsonObjectFromAdObject("ah_parameters", null);
        if (jsonObjectFromAdObject != null) {
            return JsonUtils.toBundle(jsonObjectFromAdObject);
        }
        return null;
    }

    @Override
    @Nullable
    public String getDirectDownloadToken() {
        return getStringFromAdObject("ah_dd_token", null);
    }

    @Override
    public Uri getIconUri() {
        return this.iconUri;
    }

    public Uri getMainImageUri() {
        return this.mainImageUri;
    }

    @Override
    public AppLovinMediaView getMediaView() {
        return this.mediaView;
    }

    @Override
    @Nullable
    public String getOpenMeasurementContentUrl() {
        return getStringFromAdObject("omid_content_url", null);
    }

    @Override
    public String getOpenMeasurementCustomReferenceData() {
        return getStringFromAdObject("omid_custom_ref_data", "");
    }

    @Override
    public List<VerificationScriptResource> getOpenMeasurementVerificationScriptResources() {
        ArrayList arrayList = new ArrayList();
        synchronized (this.adObjectLock) {
            JSONArray jSONArray = JsonUtils.getJSONArray(this.adObject, "omid_verification_script_resources", null);
            if (jSONArray != null) {
                for (int i9 = 0; i9 < jSONArray.length(); i9++) {
                    JSONObject jSONObject = JsonUtils.getJSONObject(jSONArray, i9, (JSONObject) null);
                    URL url = new URL(JsonUtils.getString(jSONObject, "url", null));
                    String string = JsonUtils.getString(jSONObject, "vendor_key", null);
                    String string2 = JsonUtils.getString(jSONObject, "parameters", null);
                    arrayList.add((StringUtils.isValidString(string) && StringUtils.isValidString(string2)) ? VerificationScriptResource.createVerificationScriptResourceWithParameters(string, url, string2) : VerificationScriptResource.createVerificationScriptResourceWithoutParameters(url));
                }
            }
        }
        return arrayList;
    }

    @Override
    public AppLovinOptionsView getOptionsView() {
        return this.optionsView;
    }

    public Uri getPrivacyDestinationUri() {
        return this.privacyDestinationUri;
    }

    public Uri getPrivacyIconUri() {
        return this.privacyIconUri;
    }

    @Override
    public Double getStarRating() {
        return this.starRating;
    }

    @Override
    public String getTitle() {
        return this.title;
    }

    public String getType() {
        return getStringFromAdObject("type", AD_RESPONSE_TYPE_UNDEFINED);
    }

    public com.applovin.impl.c.a getVastAd() {
        return this.vastAd;
    }

    @Override
    public boolean isDirectDownloadEnabled() {
        return StringUtils.isValidString(getDirectDownloadToken());
    }

    @Override
    public boolean isOpenMeasurementEnabled() {
        return getBooleanFromAdObject("omsdk_enabled", Boolean.FALSE);
    }

    @Override
    public void registerViewsForInteraction(List<View> list, ViewGroup viewGroup) {
        y L;
        String str;
        StringBuilder sb2;
        this.nativeAdView = viewGroup;
        if (!(h.c() && this.nativeAdView.isAttachedToWindow()) && (h.c() || this.nativeAdView.getParent() == null)) {
            this.nativeAdView.addOnAttachStateChangeListener(this.onAttachStateChangeHandler);
        } else {
            maybeHandleOnAttachedToWindow(this.nativeAdView);
        }
        this.sdk.L();
        if (y.a()) {
            y L2 = this.sdk.L();
            String str2 = this.tag;
            L2.b(str2, "Registered ad view for impressions: " + this.nativeAdView);
        }
        if (this.clickDestinationUri == null && this.clickDestinationBackupUri == null) {
            this.sdk.L();
            if (y.a()) {
                this.sdk.L().b(this.tag, "Skipping click registration - no click URLs provided");
                return;
            }
            return;
        }
        for (View view : list) {
            if (view.hasOnClickListeners()) {
                this.sdk.L();
                if (y.a()) {
                    y L3 = this.sdk.L();
                    String str3 = this.tag;
                    L3.e(str3, "View has an onClickListener already - " + view);
                }
            }
            if (!view.isClickable()) {
                this.sdk.L();
                if (y.a()) {
                    y L4 = this.sdk.L();
                    String str4 = this.tag;
                    L4.e(str4, "View is not clickable - " + view);
                }
            }
            if (!view.isEnabled()) {
                this.sdk.L();
                if (y.a()) {
                    y L5 = this.sdk.L();
                    String str5 = this.tag;
                    L5.e(str5, "View is not enabled - " + view);
                }
            }
            if (view instanceof Button) {
                this.sdk.L();
                if (y.a()) {
                    L = this.sdk.L();
                    str = this.tag;
                    sb2 = new StringBuilder("Registering click for button: ");
                    sb2.append(view);
                    L.b(str, sb2.toString());
                    view.setOnClickListener(this.clickHandler);
                    this.registeredViews.add(view);
                } else {
                    view.setOnClickListener(this.clickHandler);
                    this.registeredViews.add(view);
                }
            } else {
                this.sdk.L();
                if (y.a()) {
                    L = this.sdk.L();
                    str = this.tag;
                    sb2 = new StringBuilder("Registering click for view: ");
                    sb2.append(view);
                    L.b(str, sb2.toString());
                    view.setOnClickListener(this.clickHandler);
                    this.registeredViews.add(view);
                } else {
                    view.setOnClickListener(this.clickHandler);
                    this.registeredViews.add(view);
                }
            }
        }
        this.sdk.L();
        if (y.a()) {
            y L6 = this.sdk.L();
            String str6 = this.tag;
            L6.b(str6, "Registered views: " + this.registeredViews);
        }
    }

    public void setEventListener(AppLovinNativeAdEventListener appLovinNativeAdEventListener) {
        this.eventListener = appLovinNativeAdEventListener;
    }

    public void setIconUri(Uri uri) {
        this.iconUri = uri;
    }

    public void setMainImageUri(Uri uri) {
        this.mainImageUri = uri;
    }

    public void setPrivacyIconUri(Uri uri) {
        this.privacyIconUri = uri;
    }

    public void setUpNativeAdViewComponents() {
        AppLovinMediaView appLovinMediaView;
        com.applovin.impl.c.a aVar = this.vastAd;
        if (aVar != null && aVar.hasVideoUrl()) {
            try {
                this.mediaView = new AppLovinVastMediaView(this, this.sdk, p.y());
            } catch (Throwable th) {
                this.sdk.L();
                if (y.a()) {
                    this.sdk.L().a(this.tag, "Failed to create ExoPlayer VAST media view. Falling back to static image for media view.", th);
                }
                appLovinMediaView = new AppLovinMediaView(this, this.sdk, p.y());
            }
            if (this.privacyDestinationUri == null) {
                this.optionsView = new AppLovinOptionsView(this, this.sdk, p.y());
                return;
            }
            this.sdk.L();
            if (y.a()) {
                this.sdk.L().b(this.tag, "Privacy icon will not render because no native ad privacy URL is provided.");
                return;
            }
            return;
        }
        appLovinMediaView = new AppLovinMediaView(this, this.sdk, p.y());
        this.mediaView = appLovinMediaView;
        if (this.privacyDestinationUri == null) {
        }
    }

    public void setVideoView(@Nullable View view) {
        this.videoView = view;
    }

    public boolean shouldInjectOpenMeasurementScriptDuringCaching() {
        return false;
    }

    @NonNull
    public String toString() {
        return "AppLovinNativeAd{adIdNumber=" + getAdIdNumber() + " - " + getTitle() + "}";
    }

    @Override
    public void unregisterViewsForInteraction() {
        for (View view : this.registeredViews) {
            view.setOnClickListener(null);
        }
        this.sdk.L();
        if (y.a()) {
            y L = this.sdk.L();
            String str = this.tag;
            L.b(str, "Unregistered views: " + this.registeredViews);
        }
        this.registeredViews.clear();
        ad adVar = this.viewableMRC50Tracker;
        if (adVar != null) {
            adVar.a();
        }
        ad adVar2 = this.viewableMRC100Tracker;
        if (adVar2 != null) {
            adVar2.a();
        }
        ad adVar3 = this.viewableVideoMRC50Tracker;
        if (adVar3 != null) {
            adVar3.a();
        }
        ViewGroup viewGroup = this.nativeAdView;
        if (viewGroup != null) {
            viewGroup.removeOnAttachStateChangeListener(this.onAttachStateChangeHandler);
            this.nativeAdView = null;
        }
        AppLovinMediaView appLovinMediaView = this.mediaView;
        if (appLovinMediaView != null) {
            appLovinMediaView.destroy();
        }
        AppLovinOptionsView appLovinOptionsView = this.optionsView;
        if (appLovinOptionsView != null) {
            appLovinOptionsView.destroy();
        }
    }
}