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.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.wv;

/* JADX INFO: loaded from: classes2.dex */
public final class w3 extends k8.c {
    @Override // k8.c
    public final /* synthetic */ Object getRemoteCreator(IBinder iBinder) {
        if (iBinder == null) {
            return null;
        }
        IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.ads.internal.client.IAdLoaderBuilderCreator");
        return iInterfaceQueryLocalInterface instanceof o0 ? (o0) iInterfaceQueryLocalInterface : new o0(iBinder);
    }

    @Nullable
    public final n0 zza(Context context, String str, wv wvVar) {
        try {
            k8.b bVar = new k8.b(context);
            o0 o0Var = (o0) getRemoteCreatorInstance(context);
            Parcel parcelO = o0Var.O();
            aj.d(parcelO, bVar);
            parcelO.writeString(str);
            aj.d(parcelO, wvVar);
            parcelO.writeInt(ModuleDescriptor.MODULE_VERSION);
            Parcel parcelB0 = o0Var.B0(1, parcelO);
            IBinder strongBinder = parcelB0.readStrongBinder();
            parcelB0.recycle();
            if (strongBinder == null) {
                return null;
            }
            IInterface iInterfaceQueryLocalInterface = strongBinder.queryLocalInterface("com.google.android.gms.ads.internal.client.IAdLoaderBuilder");
            return iInterfaceQueryLocalInterface instanceof n0 ? (n0) iInterfaceQueryLocalInterface : new l0(strongBinder);
        } catch (RemoteException | RemoteCreator$RemoteCreatorException unused) {
            return null;
        }
    }
}
