- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
904 lines
33 KiB
Java
904 lines
33 KiB
Java
package com.applovin.impl.sdk.nativeAd;
|
|
|
|
import android.content.Context;
|
|
import android.net.Uri;
|
|
import android.os.Bundle;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.Button;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.arch.core.util.Function;
|
|
import com.applovin.impl.adview.AppLovinTouchToClickListener;
|
|
import com.applovin.impl.aq;
|
|
import com.applovin.impl.br;
|
|
import com.applovin.impl.gc;
|
|
import com.applovin.impl.pg;
|
|
import com.applovin.impl.rg;
|
|
import com.applovin.impl.s;
|
|
import com.applovin.impl.sdk.AppLovinAdBase;
|
|
import com.applovin.impl.sdk.array.ArrayService;
|
|
import com.applovin.impl.sdk.j;
|
|
import com.applovin.impl.sdk.n;
|
|
import com.applovin.impl.sdk.network.e;
|
|
import com.applovin.impl.sdk.utils.JsonUtils;
|
|
import com.applovin.impl.sdk.utils.StringUtils;
|
|
import com.applovin.impl.sj;
|
|
import com.applovin.impl.tl;
|
|
import com.applovin.impl.tp;
|
|
import com.applovin.impl.yp;
|
|
import com.applovin.impl.z3;
|
|
import com.applovin.impl.zq;
|
|
import com.applovin.sdk.AppLovinSdkUtils;
|
|
import com.iab.omid.library.applovin.adsession.VerificationScriptResource;
|
|
import java.net.URL;
|
|
import java.util.ArrayList;
|
|
import java.util.Collections;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import org.json.JSONArray;
|
|
import org.json.JSONObject;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public class AppLovinNativeAdImpl extends AppLovinAdBase implements AppLovinNativeAd, View.OnClickListener, AppLovinTouchToClickListener.OnClickListener {
|
|
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 String TAG = "AppLovinNativeAd";
|
|
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 pg adEventTracker;
|
|
private final String advertiser;
|
|
private final String body;
|
|
private final String callToAction;
|
|
private final Uri clickDestinationBackupUri;
|
|
private final Uri clickDestinationUri;
|
|
private final List<e> clickTrackingRequests;
|
|
private final List<String> clickTrackingUrls;
|
|
private AppLovinNativeAdEventListener eventListener;
|
|
private Uri iconUri;
|
|
private final List<e> 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 aq vastAd;
|
|
|
|
@Nullable
|
|
private View videoView;
|
|
private final c viewableMRC100Callback;
|
|
private br viewableMRC100Tracker;
|
|
private final c viewableMRC50Callback;
|
|
private br viewableMRC50Tracker;
|
|
|
|
@Nullable
|
|
private c viewableVideoMRC50Callback;
|
|
|
|
@Nullable
|
|
private br viewableVideoMRC50Tracker;
|
|
|
|
public class a implements ArrayService.DirectDownloadListener {
|
|
final /* synthetic */ Uri a;
|
|
final /* synthetic */ Uri b;
|
|
final /* synthetic */ Context c;
|
|
|
|
public a(Uri uri, Uri uri2, Context context) {
|
|
this.a = uri;
|
|
this.b = uri2;
|
|
this.c = context;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.array.ArrayService.DirectDownloadListener
|
|
public void onAppDetailsDismissed() {
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.array.ArrayService.DirectDownloadListener
|
|
public void onAppDetailsDisplayed() {
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.array.ArrayService.DirectDownloadListener
|
|
public void onFailure() {
|
|
AppLovinNativeAdImpl.this.launchUri(this.a, this.b, this.c);
|
|
}
|
|
}
|
|
|
|
public static class b implements View.OnAttachStateChangeListener {
|
|
private final AppLovinNativeAdImpl a;
|
|
|
|
public b(AppLovinNativeAdImpl appLovinNativeAdImpl) {
|
|
this.a = appLovinNativeAdImpl;
|
|
}
|
|
|
|
public AppLovinNativeAdImpl a() {
|
|
return this.a;
|
|
}
|
|
|
|
public boolean a(Object obj) {
|
|
return obj instanceof b;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof b)) {
|
|
return false;
|
|
}
|
|
b bVar = (b) obj;
|
|
if (!bVar.a(this)) {
|
|
return false;
|
|
}
|
|
AppLovinNativeAdImpl a = a();
|
|
AppLovinNativeAdImpl a2 = bVar.a();
|
|
return a != null ? a.equals(a2) : a2 == null;
|
|
}
|
|
|
|
public int hashCode() {
|
|
AppLovinNativeAdImpl a = a();
|
|
return (a == null ? 43 : a.hashCode()) + 59;
|
|
}
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public void onViewAttachedToWindow(View view) {
|
|
this.a.maybeHandleOnAttachedToWindow(view);
|
|
}
|
|
|
|
@Override // android.view.View.OnAttachStateChangeListener
|
|
public void onViewDetachedFromWindow(View view) {
|
|
}
|
|
|
|
public String toString() {
|
|
return "AppLovinNativeAdImpl.OnAttachStateChangeHandler(ad=" + a() + ")";
|
|
}
|
|
}
|
|
|
|
public class c implements br.a {
|
|
private final List a;
|
|
|
|
public c(List list) {
|
|
this.a = list;
|
|
}
|
|
|
|
public List a() {
|
|
return this.a;
|
|
}
|
|
|
|
public boolean a(Object obj) {
|
|
return obj instanceof c;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof c)) {
|
|
return false;
|
|
}
|
|
c cVar = (c) obj;
|
|
if (!cVar.a(this)) {
|
|
return false;
|
|
}
|
|
List a = a();
|
|
List a2 = cVar.a();
|
|
return a != null ? a.equals(a2) : a2 == null;
|
|
}
|
|
|
|
public int hashCode() {
|
|
List a = a();
|
|
return (a == null ? 43 : a.hashCode()) + 59;
|
|
}
|
|
|
|
@Override // com.applovin.impl.br.a
|
|
public void onLogVisibilityImpression() {
|
|
Iterator it = this.a.iterator();
|
|
while (it.hasNext()) {
|
|
((AppLovinAdBase) AppLovinNativeAdImpl.this).sdk.Y().dispatchPostbackRequest((e) it.next(), null);
|
|
}
|
|
}
|
|
|
|
public String toString() {
|
|
return "AppLovinNativeAdImpl.VisibilityCallback(requests=" + a() + ")";
|
|
}
|
|
}
|
|
|
|
public /* synthetic */ AppLovinNativeAdImpl(Builder builder, a aVar) {
|
|
this(builder);
|
|
}
|
|
|
|
private List<String> getPrivacySandboxClickAttributionUrls() {
|
|
return getStringListFromAdObject("privacy_sandbox_click_attribution_urls", Collections.emptyList());
|
|
}
|
|
|
|
private List<String> getPrivacySandboxImpressionAttributionUrls() {
|
|
return getStringListFromAdObject("privacy_sandbox_impression_attribution_urls", Collections.emptyList());
|
|
}
|
|
|
|
private boolean isDspAd() {
|
|
return AD_RESPONSE_TYPE_ORTB.equalsIgnoreCase(getType());
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ List lambda$getOpenMeasurementVerificationScriptResources$2(JSONArray jSONArray) {
|
|
if (jSONArray == null) {
|
|
return Collections.emptyList();
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
for (int i = 0; i < jSONArray.length(); i++) {
|
|
JSONObject jSONObject = JsonUtils.getJSONObject(jSONArray, i, (JSONObject) null);
|
|
try {
|
|
URL url = new URL(JsonUtils.getString(jSONObject, "url", null));
|
|
String string = JsonUtils.getString(jSONObject, "vendor_key", null);
|
|
String string2 = JsonUtils.getString(jSONObject, "parameters", null);
|
|
if (StringUtils.isValidString(string) && StringUtils.isValidString(string2)) {
|
|
arrayList.add(VerificationScriptResource.createVerificationScriptResourceWithParameters(string, url, string2));
|
|
} else {
|
|
arrayList.add(VerificationScriptResource.createVerificationScriptResourceWithoutParameters(url));
|
|
}
|
|
} catch (Throwable th) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Failed to parse OMID verification script resource", th);
|
|
}
|
|
}
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ void lambda$unregisterViewsForInteraction$0() {
|
|
for (View view : this.registeredViews) {
|
|
view.setOnTouchListener(null);
|
|
view.setOnClickListener(null);
|
|
}
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Unregistered views: " + this.registeredViews);
|
|
}
|
|
this.registeredViews.clear();
|
|
br brVar = this.viewableMRC50Tracker;
|
|
if (brVar != null) {
|
|
brVar.b();
|
|
}
|
|
br brVar2 = this.viewableMRC100Tracker;
|
|
if (brVar2 != null) {
|
|
brVar2.b();
|
|
}
|
|
br brVar3 = this.viewableVideoMRC50Tracker;
|
|
if (brVar3 != null) {
|
|
brVar3.b();
|
|
}
|
|
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();
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void launchUri(Uri uri, @Nullable Uri uri2, Context context) {
|
|
if (tp.a(uri, context, this.sdk)) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Opening URL: " + uri);
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
if (tp.a(uri2, context, this.sdk)) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Opening backup URL: " + uri2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public void maybeHandleOnAttachedToWindow(View view) {
|
|
if (this.impressionTracked.compareAndSet(false, true)) {
|
|
br brVar = new br(this.nativeAdView, this.sdk, this.viewableMRC50Callback);
|
|
this.viewableMRC50Tracker = brVar;
|
|
TimeUnit timeUnit = TimeUnit.SECONDS;
|
|
brVar.a(0, 50.0f, 50.0f, timeUnit.toMillis(1L), this.nativeAdView);
|
|
br brVar2 = new br(this.nativeAdView, this.sdk, this.viewableMRC100Callback);
|
|
this.viewableMRC100Tracker = brVar2;
|
|
brVar2.a(0, 100.0f, 100.0f, timeUnit.toMillis(1L), this.nativeAdView);
|
|
aq aqVar = this.vastAd;
|
|
if (aqVar != null && aqVar.hasVideoUrl()) {
|
|
br brVar3 = new br(this.nativeAdView, this.sdk, this.viewableVideoMRC50Callback);
|
|
this.viewableVideoMRC50Tracker = brVar3;
|
|
brVar3.a(0, 50.0f, 50.0f, timeUnit.toMillis(2L), this.videoView);
|
|
}
|
|
List<String> list = this.jsTrackers;
|
|
if (list != null) {
|
|
Iterator<String> it = list.iterator();
|
|
while (it.hasNext()) {
|
|
this.sdk.r0().b(it.next());
|
|
}
|
|
}
|
|
Iterator<e> it2 = this.impressionRequests.iterator();
|
|
while (it2.hasNext()) {
|
|
this.sdk.Y().dispatchPostbackRequest(it2.next(), null);
|
|
}
|
|
this.adEventTracker.a(view);
|
|
this.adEventTracker.g();
|
|
if (this.sdk.Z() != null) {
|
|
this.sdk.Z().b(getPrivacySandboxImpressionAttributionUrls());
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public void destroy() {
|
|
unregisterViewsForInteraction();
|
|
this.eventListener = null;
|
|
this.adEventTracker.f();
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.AppLovinAdBase, com.applovin.impl.lg
|
|
public pg getAdEventTracker() {
|
|
return this.adEventTracker;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.AppLovinAdBase
|
|
public long getAdIdNumber() {
|
|
return getLongFromAdObject("ad_id", -1L);
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public String getAdvertiser() {
|
|
return this.advertiser;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public String getBody() {
|
|
return this.body;
|
|
}
|
|
|
|
@Nullable
|
|
public String getCachePrefix() {
|
|
return getStringFromAdObject("cache_prefix", null);
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public String getCallToAction() {
|
|
return this.callToAction;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.array.ArrayDirectDownloadAd
|
|
@Nullable
|
|
public String getDirectDownloadToken() {
|
|
return getStringFromAdObject("ah_dd_token", null);
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public Uri getIconUri() {
|
|
return this.iconUri;
|
|
}
|
|
|
|
public Uri getMainImageUri() {
|
|
return this.mainImageUri;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public AppLovinMediaView getMediaView() {
|
|
return this.mediaView;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.AppLovinAdBase, com.applovin.impl.lg
|
|
@Nullable
|
|
public String getOpenMeasurementContentUrl() {
|
|
return getStringFromAdObject("omid_content_url", null);
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.AppLovinAdBase, com.applovin.impl.lg
|
|
public String getOpenMeasurementCustomReferenceData() {
|
|
return getStringFromAdObject("omid_custom_ref_data", "");
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.AppLovinAdBase, com.applovin.impl.lg
|
|
public List<VerificationScriptResource> getOpenMeasurementVerificationScriptResources() {
|
|
List<VerificationScriptResource> list;
|
|
if (this.sdk.W().e()) {
|
|
return Collections.singletonList(VerificationScriptResource.createVerificationScriptResourceWithParameters(rg.c(), rg.b(), rg.a()));
|
|
}
|
|
final Function function = new Function() { // from class: com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl$$ExternalSyntheticLambda0
|
|
@Override // androidx.arch.core.util.Function
|
|
public final Object apply(Object obj) {
|
|
List lambda$getOpenMeasurementVerificationScriptResources$2;
|
|
lambda$getOpenMeasurementVerificationScriptResources$2 = AppLovinNativeAdImpl.this.lambda$getOpenMeasurementVerificationScriptResources$2((JSONArray) obj);
|
|
return lambda$getOpenMeasurementVerificationScriptResources$2;
|
|
}
|
|
};
|
|
tl tlVar = this.synchronizedAdObject;
|
|
if (tlVar != null) {
|
|
return (List) tlVar.a(new Function() { // from class: com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl$$ExternalSyntheticLambda1
|
|
@Override // androidx.arch.core.util.Function
|
|
public final Object apply(Object obj) {
|
|
List lambda$getOpenMeasurementVerificationScriptResources$3;
|
|
lambda$getOpenMeasurementVerificationScriptResources$3 = AppLovinNativeAdImpl.lambda$getOpenMeasurementVerificationScriptResources$3(Function.this, (tl) obj);
|
|
return lambda$getOpenMeasurementVerificationScriptResources$3;
|
|
}
|
|
});
|
|
}
|
|
synchronized (this.adObjectLock) {
|
|
list = (List) function.apply(getJsonArrayFromAdObject("omid_verification_script_resources", null));
|
|
}
|
|
return list;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public AppLovinOptionsView getOptionsView() {
|
|
return this.optionsView;
|
|
}
|
|
|
|
public Uri getPrivacyDestinationUri() {
|
|
return this.privacyDestinationUri;
|
|
}
|
|
|
|
public Uri getPrivacyIconUri() {
|
|
return this.privacyIconUri;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public Double getStarRating() {
|
|
return this.starRating;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public String getTitle() {
|
|
return this.title;
|
|
}
|
|
|
|
public String getType() {
|
|
return getStringFromAdObject("type", "undefined");
|
|
}
|
|
|
|
public aq getVastAd() {
|
|
return this.vastAd;
|
|
}
|
|
|
|
public void handleNativeAdClick(Uri uri, @Nullable Uri uri2, MotionEvent motionEvent, Context context) {
|
|
if (this.sdk.Z() != null) {
|
|
this.sdk.Z().b(getPrivacySandboxClickAttributionUrls(), motionEvent);
|
|
}
|
|
handleNativeAdClick(uri, uri2, context);
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.array.ArrayDirectDownloadAd
|
|
public boolean isDirectDownloadEnabled() {
|
|
return StringUtils.isValidString(getDirectDownloadToken());
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.AppLovinAdBase, com.applovin.impl.lg
|
|
public boolean isOpenMeasurementEnabled() {
|
|
if (this.sdk.W().e()) {
|
|
return true;
|
|
}
|
|
return getBooleanFromAdObject("omsdk_enabled", Boolean.FALSE);
|
|
}
|
|
|
|
@Override // android.view.View.OnClickListener
|
|
public void onClick(View view) {
|
|
Context context;
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Handle view clicked");
|
|
}
|
|
this.sdk.i().maybeSubmitPersistentPostbacks(getDirectClickTrackingPostbacks());
|
|
if (((Boolean) this.sdk.a(sj.F)).booleanValue()) {
|
|
context = zq.a(this.nativeAdView, this.sdk);
|
|
if (context == null) {
|
|
context = view.getContext();
|
|
}
|
|
} else {
|
|
context = view.getContext();
|
|
}
|
|
handleNativeAdClick(this.clickDestinationUri, this.clickDestinationBackupUri, context);
|
|
}
|
|
|
|
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() {
|
|
aq aqVar = this.vastAd;
|
|
if (aqVar == null || !aqVar.hasVideoUrl()) {
|
|
this.mediaView = new AppLovinMediaView(this, this.sdk, j.l());
|
|
} else {
|
|
try {
|
|
this.mediaView = new AppLovinVastMediaView(this, this.sdk, j.l());
|
|
} catch (Throwable th) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().d(this.tag, "Failed to create ExoPlayer VAST media view. Falling back to static image for media view.", th);
|
|
}
|
|
this.sdk.E().a(TAG, "createExoPlayerVASTMediaView", th);
|
|
this.mediaView = new AppLovinMediaView(this, this.sdk, j.l());
|
|
}
|
|
}
|
|
if (this.privacyDestinationUri != null) {
|
|
this.optionsView = new AppLovinOptionsView(this, this.sdk, j.l());
|
|
return;
|
|
}
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Privacy icon will not render because no native ad privacy URL is provided.");
|
|
}
|
|
}
|
|
|
|
public void setVideoView(@Nullable View view) {
|
|
this.videoView = view;
|
|
}
|
|
|
|
@NonNull
|
|
public String toString() {
|
|
return "AppLovinNativeAd{adIdNumber=" + getAdIdNumber() + " - " + getTitle() + "}";
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public void unregisterViewsForInteraction() {
|
|
AppLovinSdkUtils.runOnUiThread(new Runnable() { // from class: com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl$$ExternalSyntheticLambda2
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
AppLovinNativeAdImpl.this.lambda$unregisterViewsForInteraction$0();
|
|
}
|
|
});
|
|
}
|
|
|
|
private AppLovinNativeAdImpl(Builder builder) {
|
|
super(builder.adObject, builder.fullResponse, builder.sdk);
|
|
this.impressionTracked = new AtomicBoolean();
|
|
this.registeredViews = new ArrayList();
|
|
this.onAttachStateChangeHandler = new b(this);
|
|
this.adEventTracker = new pg(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;
|
|
aq aqVar = builder.vastAd;
|
|
this.vastAd = aqVar;
|
|
this.clickDestinationUri = builder.clickDestinationUri;
|
|
this.clickDestinationBackupUri = builder.clickDestinationBackupUri;
|
|
this.clickTrackingUrls = builder.clickTrackingUrls;
|
|
this.jsTrackers = builder.jsTrackers;
|
|
this.clickTrackingRequests = builder.clickTrackingRequests;
|
|
this.impressionRequests = builder.impressionRequests;
|
|
Double d = builder.starRating;
|
|
this.starRating = (d == null || d.doubleValue() < 3.0d) ? null : d;
|
|
if (builder.privacyDestinationUri != null) {
|
|
this.privacyDestinationUri = builder.privacyDestinationUri;
|
|
} else if (!isDspAd() || getSdk().l0().c()) {
|
|
this.privacyDestinationUri = Uri.parse(DEFAULT_APPLOVIN_PRIVACY_URL);
|
|
}
|
|
this.viewableMRC50Callback = new c(builder.viewableMRC50Requests);
|
|
this.viewableMRC100Callback = new c(builder.viewableMRC100Requests);
|
|
if (aqVar != null && aqVar.hasVideoUrl()) {
|
|
this.viewableVideoMRC50Callback = new c(builder.viewableVideo50Requests);
|
|
}
|
|
this.tag = "AppLovinNativeAd:" + getAdIdNumber();
|
|
}
|
|
|
|
private List<s> getDirectClickTrackingPostbacks() {
|
|
List<s> a2;
|
|
tl tlVar = this.synchronizedAdObject;
|
|
if (tlVar != null) {
|
|
return (List) tlVar.a(new Function() { // from class: com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl$$ExternalSyntheticLambda3
|
|
@Override // androidx.arch.core.util.Function
|
|
public final Object apply(Object obj) {
|
|
List lambda$getDirectClickTrackingPostbacks$1;
|
|
lambda$getDirectClickTrackingPostbacks$1 = AppLovinNativeAdImpl.this.lambda$getDirectClickTrackingPostbacks$1((tl) obj);
|
|
return lambda$getDirectClickTrackingPostbacks$1;
|
|
}
|
|
});
|
|
}
|
|
synchronized (this.adObjectLock) {
|
|
a2 = yp.a(getJsonObjectFromAdObject("click_tracking_urls", new JSONObject()), getClCode(), getStringFromAdObject("click_tracking_url", null), this.sdk);
|
|
}
|
|
return a2;
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.array.ArrayDirectDownloadAd
|
|
public Bundle getDirectDownloadParameters() {
|
|
tl tlVar = this.synchronizedAdObject;
|
|
if (tlVar != null) {
|
|
return (Bundle) tlVar.a(new Function() { // from class: com.applovin.impl.sdk.nativeAd.AppLovinNativeAdImpl$$ExternalSyntheticLambda4
|
|
@Override // androidx.arch.core.util.Function
|
|
public final Object apply(Object obj) {
|
|
Bundle lambda$getDirectDownloadParameters$4;
|
|
lambda$getDirectDownloadParameters$4 = AppLovinNativeAdImpl.lambda$getDirectDownloadParameters$4((tl) obj);
|
|
return lambda$getDirectDownloadParameters$4;
|
|
}
|
|
});
|
|
}
|
|
return JsonUtils.toBundle(getJsonObjectFromAdObject("ah_parameters", null));
|
|
}
|
|
|
|
@Override // com.applovin.impl.sdk.nativeAd.AppLovinNativeAd
|
|
public void registerViewsForInteraction(List<View> list, ViewGroup viewGroup) {
|
|
this.nativeAdView = viewGroup;
|
|
if (z3.e() && this.nativeAdView.isAttachedToWindow()) {
|
|
maybeHandleOnAttachedToWindow(this.nativeAdView);
|
|
} else if (!z3.e() && this.nativeAdView.getParent() != null) {
|
|
maybeHandleOnAttachedToWindow(this.nativeAdView);
|
|
} else {
|
|
this.nativeAdView.addOnAttachStateChangeListener(this.onAttachStateChangeHandler);
|
|
}
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Registered ad view for impressions: " + this.nativeAdView);
|
|
}
|
|
if (this.clickDestinationUri == null && this.clickDestinationBackupUri == null) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Skipping click registration - no click URLs provided");
|
|
return;
|
|
}
|
|
return;
|
|
}
|
|
for (View view : list) {
|
|
if (view.hasOnClickListeners()) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().k(this.tag, "View has an onClickListener already - " + view);
|
|
}
|
|
}
|
|
if (!view.isClickable()) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().k(this.tag, "View is not clickable - " + view);
|
|
}
|
|
}
|
|
if (!view.isEnabled()) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().b(this.tag, "View is not enabled - " + view);
|
|
}
|
|
}
|
|
if (view instanceof Button) {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Registering click for button: " + view);
|
|
}
|
|
} else {
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Registering click for view: " + view);
|
|
}
|
|
}
|
|
if (((Boolean) this.sdk.a(sj.Y2)).booleanValue()) {
|
|
view.setOnTouchListener(new AppLovinTouchToClickListener(this.sdk, sj.G0, viewGroup.getContext(), this));
|
|
} else {
|
|
view.setOnClickListener(this);
|
|
}
|
|
this.registeredViews.add(view);
|
|
}
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Registered views: " + this.registeredViews);
|
|
}
|
|
}
|
|
|
|
private void handleNativeAdClick(Uri uri, @Nullable Uri uri2, Context context) {
|
|
if (this.clickTrackingRequests.size() > 0) {
|
|
Iterator<e> it = this.clickTrackingRequests.iterator();
|
|
while (it.hasNext()) {
|
|
this.sdk.Y().dispatchPostbackRequest(it.next(), null);
|
|
}
|
|
} else {
|
|
Iterator<String> it2 = this.clickTrackingUrls.iterator();
|
|
while (it2.hasNext()) {
|
|
this.sdk.Y().dispatchPostbackAsync(it2.next(), null);
|
|
}
|
|
}
|
|
gc.b(this.eventListener, this);
|
|
if (isDirectDownloadEnabled()) {
|
|
this.sdk.m().startDirectInstallOrDownloadProcess(this, null, new a(uri, uri2, context));
|
|
} else {
|
|
launchUri(uri, uri2, context);
|
|
}
|
|
}
|
|
|
|
@Override // com.applovin.impl.adview.AppLovinTouchToClickListener.OnClickListener
|
|
public void onClick(View view, MotionEvent motionEvent) {
|
|
Context context;
|
|
this.sdk.J();
|
|
if (n.a()) {
|
|
this.sdk.J().a(this.tag, "Handle view clicked");
|
|
}
|
|
this.sdk.i().maybeSubmitPersistentPostbacks(getDirectClickTrackingPostbacks());
|
|
if (((Boolean) this.sdk.a(sj.F)).booleanValue()) {
|
|
context = zq.a(this.nativeAdView, this.sdk);
|
|
if (context == null) {
|
|
context = view.getContext();
|
|
}
|
|
} else {
|
|
context = view.getContext();
|
|
}
|
|
handleNativeAdClick(this.clickDestinationUri, this.clickDestinationBackupUri, motionEvent, context);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public /* synthetic */ List lambda$getDirectClickTrackingPostbacks$1(tl tlVar) {
|
|
return yp.a(tlVar.a("click_tracking_urls", new JSONObject()), getClCode(), tlVar.a("click_tracking_url", (String) null), this.sdk);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ List lambda$getOpenMeasurementVerificationScriptResources$3(Function function, tl tlVar) {
|
|
return (List) function.apply(tlVar.a("omid_verification_script_resources", (JSONArray) null));
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
public static /* synthetic */ Bundle lambda$getDirectDownloadParameters$4(tl tlVar) {
|
|
return JsonUtils.toBundle(tlVar.a("ah_parameters", (JSONObject) null));
|
|
}
|
|
|
|
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<e> clickTrackingRequests;
|
|
private List<String> clickTrackingUrls;
|
|
private final JSONObject fullResponse;
|
|
private Uri iconUri;
|
|
private List<e> impressionRequests;
|
|
private List<String> jsTrackers;
|
|
private Uri mainImageUri;
|
|
private Uri privacyDestinationUri;
|
|
private Uri privacyIconUri;
|
|
private final j sdk;
|
|
private Double starRating;
|
|
private String title;
|
|
private aq vastAd;
|
|
private List<e> viewableMRC100Requests;
|
|
private List<e> viewableMRC50Requests;
|
|
private List<e> viewableVideo50Requests;
|
|
|
|
public Builder(JSONObject jSONObject, JSONObject jSONObject2, j jVar) {
|
|
this.adObject = jSONObject;
|
|
this.fullResponse = jSONObject2;
|
|
this.sdk = jVar;
|
|
}
|
|
|
|
public AppLovinNativeAdImpl build() {
|
|
return new AppLovinNativeAdImpl(this, null);
|
|
}
|
|
|
|
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 setClickTrackingRequests(List<e> list) {
|
|
this.clickTrackingRequests = list;
|
|
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<e> 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(aq aqVar) {
|
|
this.vastAd = aqVar;
|
|
return this;
|
|
}
|
|
|
|
public Builder setViewableMRC100Requests(List<e> list) {
|
|
this.viewableMRC100Requests = list;
|
|
return this;
|
|
}
|
|
|
|
public Builder setViewableMRC50Requests(List<e> list) {
|
|
this.viewableMRC50Requests = list;
|
|
return this;
|
|
}
|
|
|
|
public Builder setViewableVideo50Requests(List<e> list) {
|
|
this.viewableVideo50Requests = list;
|
|
return this;
|
|
}
|
|
}
|
|
}
|