- 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
339 lines
9.4 KiB
Java
339 lines
9.4 KiB
Java
package com.google.android.gms.ads.nativead;
|
|
|
|
import android.annotation.TargetApi;
|
|
import android.content.Context;
|
|
import android.os.RemoteException;
|
|
import android.util.AttributeSet;
|
|
import android.view.MotionEvent;
|
|
import android.view.View;
|
|
import android.view.ViewGroup;
|
|
import android.widget.FrameLayout;
|
|
import android.widget.ImageView;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import com.google.android.gms.ads.MediaContent;
|
|
import com.google.android.gms.ads.internal.client.zzbc;
|
|
import com.google.android.gms.ads.internal.client.zzbe;
|
|
import com.google.android.gms.ads.internal.client.zzfd;
|
|
import com.google.android.gms.ads.internal.util.client.zzo;
|
|
import com.google.android.gms.dynamic.IObjectWrapper;
|
|
import com.google.android.gms.dynamic.ObjectWrapper;
|
|
import com.google.android.gms.internal.ads.zzbcl;
|
|
import com.google.android.gms.internal.ads.zzbga;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class NativeAdView extends FrameLayout {
|
|
private final FrameLayout zza;
|
|
|
|
@Nullable
|
|
private final zzbga zzb;
|
|
|
|
public NativeAdView(@NonNull Context context) {
|
|
super(context);
|
|
this.zza = zzd(context);
|
|
this.zzb = zze();
|
|
}
|
|
|
|
private final FrameLayout zzd(Context context) {
|
|
FrameLayout frameLayout = new FrameLayout(context);
|
|
frameLayout.setLayoutParams(new FrameLayout.LayoutParams(-1, -1));
|
|
addView(frameLayout);
|
|
return frameLayout;
|
|
}
|
|
|
|
@Nullable
|
|
private final zzbga zze() {
|
|
if (isInEditMode()) {
|
|
return null;
|
|
}
|
|
FrameLayout frameLayout = this.zza;
|
|
return zzbc.zza().zzj(frameLayout.getContext(), this, frameLayout);
|
|
}
|
|
|
|
private final void zzf(String str, @Nullable View view) {
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar == null) {
|
|
return;
|
|
}
|
|
try {
|
|
zzbgaVar.zzdt(str, ObjectWrapper.wrap(view));
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call setAssetView on delegate", e);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public final void addView(@NonNull View view, int i, @NonNull ViewGroup.LayoutParams layoutParams) {
|
|
super.addView(view, i, layoutParams);
|
|
super.bringChildToFront(this.zza);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.ViewParent
|
|
public final void bringChildToFront(@NonNull View view) {
|
|
super.bringChildToFront(view);
|
|
FrameLayout frameLayout = this.zza;
|
|
if (frameLayout != view) {
|
|
super.bringChildToFront(frameLayout);
|
|
}
|
|
}
|
|
|
|
public void destroy() {
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar == null) {
|
|
return;
|
|
}
|
|
try {
|
|
zzbgaVar.zzc();
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to destroy native ad view", e);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.View
|
|
public final boolean dispatchTouchEvent(@NonNull MotionEvent motionEvent) {
|
|
if (this.zzb != null) {
|
|
if (((Boolean) zzbe.zzc().zza(zzbcl.zzls)).booleanValue()) {
|
|
try {
|
|
this.zzb.zzd(ObjectWrapper.wrap(motionEvent));
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call handleTouchEvent on delegate", e);
|
|
}
|
|
}
|
|
}
|
|
return super.dispatchTouchEvent(motionEvent);
|
|
}
|
|
|
|
@Nullable
|
|
public AdChoicesView getAdChoicesView() {
|
|
View zza = zza("3011");
|
|
if (zza instanceof AdChoicesView) {
|
|
return (AdChoicesView) zza;
|
|
}
|
|
return null;
|
|
}
|
|
|
|
@Nullable
|
|
public final View getAdvertiserView() {
|
|
return zza("3005");
|
|
}
|
|
|
|
@Nullable
|
|
public final View getBodyView() {
|
|
return zza("3004");
|
|
}
|
|
|
|
@Nullable
|
|
public final View getCallToActionView() {
|
|
return zza("3002");
|
|
}
|
|
|
|
@Nullable
|
|
public final View getHeadlineView() {
|
|
return zza("3001");
|
|
}
|
|
|
|
@Nullable
|
|
public final View getIconView() {
|
|
return zza("3003");
|
|
}
|
|
|
|
@Nullable
|
|
public final View getImageView() {
|
|
return zza("3008");
|
|
}
|
|
|
|
@Nullable
|
|
public final MediaView getMediaView() {
|
|
View zza = zza("3010");
|
|
if (zza instanceof MediaView) {
|
|
return (MediaView) zza;
|
|
}
|
|
if (zza == null) {
|
|
return null;
|
|
}
|
|
zzo.zze("View is not an instance of MediaView");
|
|
return null;
|
|
}
|
|
|
|
@Nullable
|
|
public final View getPriceView() {
|
|
return zza("3007");
|
|
}
|
|
|
|
@Nullable
|
|
public final View getStarRatingView() {
|
|
return zza("3009");
|
|
}
|
|
|
|
@Nullable
|
|
public final View getStoreView() {
|
|
return zza("3006");
|
|
}
|
|
|
|
@Override // android.view.View
|
|
public final void onVisibilityChanged(@NonNull View view, int i) {
|
|
super.onVisibilityChanged(view, i);
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar == null) {
|
|
return;
|
|
}
|
|
try {
|
|
zzbgaVar.zze(ObjectWrapper.wrap(view), i);
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call onVisibilityChanged on delegate", e);
|
|
}
|
|
}
|
|
|
|
@Override // android.view.ViewGroup
|
|
public final void removeAllViews() {
|
|
super.removeAllViews();
|
|
super.addView(this.zza);
|
|
}
|
|
|
|
@Override // android.view.ViewGroup, android.view.ViewManager
|
|
public final void removeView(@NonNull View view) {
|
|
if (this.zza == view) {
|
|
return;
|
|
}
|
|
super.removeView(view);
|
|
}
|
|
|
|
public void setAdChoicesView(@Nullable AdChoicesView adChoicesView) {
|
|
zzf("3011", adChoicesView);
|
|
}
|
|
|
|
public final void setAdvertiserView(@Nullable View view) {
|
|
zzf("3005", view);
|
|
}
|
|
|
|
public final void setBodyView(@Nullable View view) {
|
|
zzf("3004", view);
|
|
}
|
|
|
|
public final void setCallToActionView(@Nullable View view) {
|
|
zzf("3002", view);
|
|
}
|
|
|
|
public final void setClickConfirmingView(@Nullable View view) {
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar == null) {
|
|
return;
|
|
}
|
|
try {
|
|
zzbgaVar.zzdu(ObjectWrapper.wrap(view));
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call setClickConfirmingView on delegate", e);
|
|
}
|
|
}
|
|
|
|
public final void setHeadlineView(@Nullable View view) {
|
|
zzf("3001", view);
|
|
}
|
|
|
|
public final void setIconView(@Nullable View view) {
|
|
zzf("3003", view);
|
|
}
|
|
|
|
public final void setImageView(@Nullable View view) {
|
|
zzf("3008", view);
|
|
}
|
|
|
|
public final void setMediaView(@Nullable MediaView mediaView) {
|
|
zzf("3010", mediaView);
|
|
if (mediaView == null) {
|
|
return;
|
|
}
|
|
mediaView.zza(new zzb(this));
|
|
mediaView.zzb(new zzc(this));
|
|
}
|
|
|
|
public void setNativeAd(@NonNull NativeAd nativeAd) {
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar == null) {
|
|
return;
|
|
}
|
|
try {
|
|
zzbgaVar.zzdx((IObjectWrapper) nativeAd.zza());
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call setNativeAd on delegate", e);
|
|
}
|
|
}
|
|
|
|
public final void setPriceView(@Nullable View view) {
|
|
zzf("3007", view);
|
|
}
|
|
|
|
public final void setStarRatingView(@Nullable View view) {
|
|
zzf("3009", view);
|
|
}
|
|
|
|
public final void setStoreView(@Nullable View view) {
|
|
zzf("3006", view);
|
|
}
|
|
|
|
@Nullable
|
|
public final View zza(@NonNull String str) {
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar != null) {
|
|
try {
|
|
IObjectWrapper zzb = zzbgaVar.zzb(str);
|
|
if (zzb != null) {
|
|
return (View) ObjectWrapper.unwrap(zzb);
|
|
}
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call getAssetView on delegate", e);
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final /* synthetic */ void zzb(MediaContent mediaContent) {
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar == null) {
|
|
return;
|
|
}
|
|
try {
|
|
if (mediaContent instanceof zzfd) {
|
|
zzbgaVar.zzdv(((zzfd) mediaContent).zzc());
|
|
} else if (mediaContent == null) {
|
|
zzbgaVar.zzdv(null);
|
|
} else {
|
|
zzo.zze("Use MediaContent provided by NativeAd.getMediaContent");
|
|
}
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call setMediaContent on delegate", e);
|
|
}
|
|
}
|
|
|
|
public final /* synthetic */ void zzc(ImageView.ScaleType scaleType) {
|
|
zzbga zzbgaVar = this.zzb;
|
|
if (zzbgaVar == null || scaleType == null) {
|
|
return;
|
|
}
|
|
try {
|
|
zzbgaVar.zzdw(ObjectWrapper.wrap(scaleType));
|
|
} catch (RemoteException e) {
|
|
zzo.zzh("Unable to call setMediaViewImageScaleType on delegate", e);
|
|
}
|
|
}
|
|
|
|
public NativeAdView(@NonNull Context context, @NonNull AttributeSet attributeSet) {
|
|
super(context, attributeSet);
|
|
this.zza = zzd(context);
|
|
this.zzb = zze();
|
|
}
|
|
|
|
public NativeAdView(@NonNull Context context, @NonNull AttributeSet attributeSet, int i) {
|
|
super(context, attributeSet, i);
|
|
this.zza = zzd(context);
|
|
this.zzb = zze();
|
|
}
|
|
|
|
@TargetApi(21)
|
|
public NativeAdView(@NonNull Context context, @NonNull AttributeSet attributeSet, int i, int i2) {
|
|
super(context, attributeSet, i, i2);
|
|
this.zza = zzd(context);
|
|
this.zzb = zze();
|
|
}
|
|
}
|