- 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
91 lines
3.2 KiB
Java
91 lines
3.2 KiB
Java
package com.google.android.gms.ads.nativead;
|
|
|
|
import android.os.RemoteException;
|
|
import android.view.View;
|
|
import androidx.annotation.NonNull;
|
|
import com.google.android.gms.ads.internal.client.zzbc;
|
|
import com.google.android.gms.ads.internal.util.client.zzo;
|
|
import com.google.android.gms.common.internal.Preconditions;
|
|
import com.google.android.gms.dynamic.IObjectWrapper;
|
|
import com.google.android.gms.dynamic.ObjectWrapper;
|
|
import com.google.android.gms.internal.ads.zzbgg;
|
|
import java.lang.ref.WeakReference;
|
|
import java.util.HashMap;
|
|
import java.util.Map;
|
|
import java.util.WeakHashMap;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class NativeAdViewHolder {
|
|
|
|
@NonNull
|
|
public static final WeakHashMap zza = new WeakHashMap();
|
|
private zzbgg zzb;
|
|
private WeakReference zzc;
|
|
|
|
public NativeAdViewHolder(@NonNull View view, @NonNull Map<String, View> map, @NonNull Map<String, View> map2) {
|
|
Preconditions.checkNotNull(view, "ContainerView must not be null");
|
|
if (view instanceof NativeAdView) {
|
|
zzo.zzg("The provided containerView is of type of NativeAdView, which cannot be usedwith NativeAdViewHolder.");
|
|
return;
|
|
}
|
|
WeakHashMap weakHashMap = zza;
|
|
if (weakHashMap.get(view) != null) {
|
|
zzo.zzg("The provided containerView is already in use with another NativeAdViewHolder.");
|
|
return;
|
|
}
|
|
weakHashMap.put(view, this);
|
|
this.zzc = new WeakReference(view);
|
|
this.zzb = zzbc.zza().zzk(view, zza(map), zza(map2));
|
|
}
|
|
|
|
private static final HashMap zza(Map map) {
|
|
return map == null ? new HashMap() : new HashMap(map);
|
|
}
|
|
|
|
public final void setClickConfirmingView(@NonNull View view) {
|
|
try {
|
|
this.zzb.zzb(ObjectWrapper.wrap(view));
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call setClickConfirmingView on delegate", e);
|
|
}
|
|
}
|
|
|
|
public void setNativeAd(@NonNull NativeAd nativeAd) {
|
|
IObjectWrapper iObjectWrapper = (IObjectWrapper) nativeAd.zza();
|
|
WeakReference weakReference = this.zzc;
|
|
View view = weakReference != null ? (View) weakReference.get() : null;
|
|
if (view == null) {
|
|
zzo.zzj("NativeAdViewHolder.setNativeAd containerView doesn't exist, returning");
|
|
return;
|
|
}
|
|
WeakHashMap weakHashMap = zza;
|
|
if (!weakHashMap.containsKey(view)) {
|
|
weakHashMap.put(view, this);
|
|
}
|
|
zzbgg zzbggVar = this.zzb;
|
|
if (zzbggVar != null) {
|
|
try {
|
|
zzbggVar.zzc(iObjectWrapper);
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call setNativeAd on delegate", e);
|
|
}
|
|
}
|
|
}
|
|
|
|
public void unregisterNativeAd() {
|
|
zzbgg zzbggVar = this.zzb;
|
|
if (zzbggVar != null) {
|
|
try {
|
|
zzbggVar.zzd();
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call unregisterNativeAd on delegate", e);
|
|
}
|
|
}
|
|
WeakReference weakReference = this.zzc;
|
|
View view = weakReference != null ? (View) weakReference.get() : null;
|
|
if (view != null) {
|
|
zza.remove(view);
|
|
}
|
|
}
|
|
}
|