package n7;

import android.content.Context;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import androidx.annotation.Nullable;
import com.google.android.gms.ads.internal.util.client.zzr;
import com.google.android.gms.dynamic.RemoteCreator$RemoteCreatorException;
import com.google.android.gms.dynamite.descriptors.com.google.android.gms.ads.dynamite.ModuleDescriptor;
import com.google.android.gms.internal.ads.aj;
import com.google.android.gms.internal.ads.ao;
import com.google.android.gms.internal.ads.dz;
import com.google.android.gms.internal.ads.ez;
import com.google.android.gms.internal.ads.uv;
import com.google.android.gms.internal.ads.wv;

/* JADX INFO: loaded from: classes2.dex */
public final class p extends w {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ Context f31006a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ wv f31007b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ u f31008c;

    public p(u uVar, Context context, uv uvVar) {
        this.f31006a = context;
        this.f31007b = uvVar;
        this.f31008c = uVar;
    }

    @Override // n7.w
    @Nullable
    public final /* bridge */ /* synthetic */ Object zza() {
        u.a(this.f31006a, "ads_preloader");
        return null;
    }

    @Override // n7.w
    @Nullable
    public final Object zzb() throws RemoteException {
        c1 a1Var;
        Context context = this.f31006a;
        k8.b bVar = new k8.b(context);
        ao.a(context);
        boolean zBooleanValue = ((Boolean) y.f31093e.f31096c.b(ao.Tb)).booleanValue();
        u uVar = this.f31008c;
        wv wvVar = this.f31007b;
        if (zBooleanValue) {
            try {
                d1 d1Var = (d1) hb.a.K0(context, "com.google.android.gms.ads.ChimeraAdPreloaderCreatorImpl", o.f31005a);
                Parcel parcelO = d1Var.O();
                aj.d(parcelO, bVar);
                aj.d(parcelO, wvVar);
                parcelO.writeInt(ModuleDescriptor.MODULE_VERSION);
                Parcel parcelB0 = d1Var.B0(1, parcelO);
                IBinder strongBinder = parcelB0.readStrongBinder();
                parcelB0.recycle();
                if (strongBinder == null) {
                    a1Var = null;
                } else {
                    IInterface iInterfaceQueryLocalInterface = strongBinder.queryLocalInterface("com.google.android.gms.ads.internal.client.IAdPreloader");
                    a1Var = iInterfaceQueryLocalInterface instanceof c1 ? (c1) iInterfaceQueryLocalInterface : new a1(strongBinder);
                }
                a1Var.m0(wvVar);
            } catch (RemoteException e10) {
                e = e10;
                ez ezVarA = dz.a(context);
                uVar.getClass();
                ezVarA.d("ClientApiBroker.getAdPreloader", e);
                return null;
            } catch (zzr e11) {
                e = e11;
                ez ezVarA2 = dz.a(context);
                uVar.getClass();
                ezVarA2.d("ClientApiBroker.getAdPreloader", e);
                return null;
            } catch (NullPointerException e12) {
                e = e12;
                ez ezVarA22 = dz.a(context);
                uVar.getClass();
                ezVarA22.d("ClientApiBroker.getAdPreloader", e);
                return null;
            }
        } else {
            z3 z3Var = uVar.f31046f;
            z3Var.getClass();
            try {
                k8.b bVar2 = new k8.b(context);
                d1 d1Var2 = (d1) z3Var.getRemoteCreatorInstance(context);
                Parcel parcelO2 = d1Var2.O();
                aj.d(parcelO2, bVar2);
                aj.d(parcelO2, wvVar);
                parcelO2.writeInt(ModuleDescriptor.MODULE_VERSION);
                Parcel parcelB02 = d1Var2.B0(1, parcelO2);
                IBinder strongBinder2 = parcelB02.readStrongBinder();
                parcelB02.recycle();
                if (strongBinder2 == null) {
                    return null;
                }
                IInterface iInterfaceQueryLocalInterface2 = strongBinder2.queryLocalInterface("com.google.android.gms.ads.internal.client.IAdPreloader");
                a1Var = iInterfaceQueryLocalInterface2 instanceof c1 ? (c1) iInterfaceQueryLocalInterface2 : new a1(strongBinder2);
            } catch (RemoteException | RemoteCreator$RemoteCreatorException | NullPointerException unused) {
                return null;
            }
        }
        return a1Var;
    }

    @Override // n7.w
    public final Object zzc(j1 j1Var) {
        return j1Var.r1(new k8.b(this.f31006a), this.f31007b, ModuleDescriptor.MODULE_VERSION);
    }
}
