package n7;

import android.os.Bundle;
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.AdFormat;
import com.google.android.gms.internal.ads.aj;
import com.google.android.gms.internal.ads.bf1;
import com.google.android.gms.internal.ads.cf1;
import com.google.android.gms.internal.ads.ef1;
import com.google.android.gms.internal.ads.ff1;
import com.google.android.gms.internal.ads.gf1;
import com.google.android.gms.internal.ads.jk;
import com.google.android.gms.internal.ads.lf1;
import com.google.android.gms.internal.ads.s00;
import com.google.android.gms.internal.ads.ue1;
import com.google.android.gms.internal.ads.uv;
import com.google.android.gms.internal.ads.zi;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

/* JADX INFO: loaded from: classes2.dex */
public abstract class b1 extends zi implements c1 {
    /* JADX WARN: Multi-variable type inference failed */
    /* JADX WARN: Type inference failed for: r22v0, types: [android.os.Parcel] */
    /* JADX WARN: Type inference failed for: r5v0 */
    /* JADX WARN: Type inference failed for: r5v10, types: [int] */
    /* JADX WARN: Type inference failed for: r5v13 */
    /* JADX WARN: Type inference failed for: r5v17 */
    /* JADX WARN: Type inference failed for: r5v18 */
    /* JADX WARN: Type inference failed for: r5v2, types: [int] */
    /* JADX WARN: Type inference failed for: r5v5 */
    /* JADX WARN: Type inference fix 'apply assigned field type' failed
    java.lang.UnsupportedOperationException: ArgType.getObject(), call class: class jadx.core.dex.instructions.args.ArgType$UnknownArg
    	at jadx.core.dex.instructions.args.ArgType.getObject(ArgType.java:593)
    	at jadx.core.dex.attributes.nodes.ClassTypeVarsAttr.getTypeVarsMapFor(ClassTypeVarsAttr.java:35)
    	at jadx.core.dex.nodes.utils.TypeUtils.replaceClassGenerics(TypeUtils.java:177)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.insertExplicitUseCast(FixTypesVisitor.java:397)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.tryFieldTypeWithNewCasts(FixTypesVisitor.java:359)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.applyFieldType(FixTypesVisitor.java:309)
    	at jadx.core.dex.visitors.typeinference.FixTypesVisitor.visit(FixTypesVisitor.java:94)
     */
    @Override // com.google.android.gms.internal.ads.zi
    public final boolean Q2(int i10, Parcel parcel, Parcel parcel2) throws RemoteException {
        boolean zE;
        gf1 gf1Var;
        HashMap map;
        x0 w0Var = null;
        z0 y0Var = null;
        ?? r52 = 0;
        iP = 0;
        iP = 0;
        int iP = 0;
        r52 = 0;
        switch (i10) {
            case 1:
                ArrayList arrayListCreateTypedArrayList = parcel.createTypedArrayList(p3.CREATOR);
                IBinder strongBinder = parcel.readStrongBinder();
                if (strongBinder != null) {
                    IInterface iInterfaceQueryLocalInterface = strongBinder.queryLocalInterface("com.google.android.gms.ads.internal.client.IAdPreloadCallback");
                    w0Var = iInterfaceQueryLocalInterface instanceof x0 ? (x0) iInterfaceQueryLocalInterface : new w0(strongBinder, "com.google.android.gms.ads.internal.client.IAdPreloadCallback", 0);
                }
                aj.e(parcel);
                ((bf1) this).f9521a.a(arrayListCreateTypedArrayList, w0Var);
                parcel2.writeNoException();
                return true;
            case 2:
                String string = parcel.readString();
                aj.e(parcel);
                boolean zR2 = ((bf1) this).R2(string);
                parcel2.writeNoException();
                parcel2.writeInt(zR2 ? 1 : 0);
                return true;
            case 3:
                String string2 = parcel.readString();
                aj.e(parcel);
                s00 s00VarZzg = zzg(string2);
                parcel2.writeNoException();
                aj.d(parcel2, s00VarZzg);
                return true;
            case 4:
                String string3 = parcel.readString();
                aj.e(parcel);
                boolean zS2 = ((bf1) this).S2(string3);
                parcel2.writeNoException();
                parcel2.writeInt(zS2 ? 1 : 0);
                return true;
            case 5:
                String string4 = parcel.readString();
                aj.e(parcel);
                jk jkVarZzi = zzi(string4);
                parcel2.writeNoException();
                aj.d(parcel2, jkVarZzi);
                return true;
            case 6:
                String string5 = parcel.readString();
                aj.e(parcel);
                ef1 ef1Var = ((bf1) this).f9521a;
                synchronized (ef1Var) {
                    zE = ef1Var.e(AdFormat.INTERSTITIAL, string5);
                }
                parcel2.writeNoException();
                parcel2.writeInt(zE ? 1 : 0);
                return true;
            case 7:
                String string6 = parcel.readString();
                aj.e(parcel);
                r0 r0VarZzk = zzk(string6);
                parcel2.writeNoException();
                aj.d(parcel2, r0VarZzk);
                return true;
            case 8:
                uv.R2(parcel.readStrongBinder());
                aj.e(parcel);
                parcel2.writeNoException();
                return true;
            case 9:
                String string7 = parcel.readString();
                p3 p3Var = (p3) aj.a(parcel, p3.CREATOR);
                IBinder strongBinder2 = parcel.readStrongBinder();
                if (strongBinder2 != null) {
                    IInterface iInterfaceQueryLocalInterface2 = strongBinder2.queryLocalInterface("com.google.android.gms.ads.internal.client.IAdPreloadCallbackV2");
                    y0Var = iInterfaceQueryLocalInterface2 instanceof z0 ? (z0) iInterfaceQueryLocalInterface2 : new y0(strongBinder2, "com.google.android.gms.ads.internal.client.IAdPreloadCallbackV2", 0);
                }
                aj.e(parcel);
                boolean zZzm = zzm(string7, p3Var, y0Var);
                parcel2.writeNoException();
                parcel2.writeInt(zZzm ? 1 : 0);
                return true;
            case 10:
                int i11 = parcel.readInt();
                String string8 = parcel.readString();
                aj.e(parcel);
                bf1 bf1Var = (bf1) this;
                AdFormat adFormat = AdFormat.getAdFormat(i11);
                if (adFormat != null) {
                    ue1 ue1Var = bf1Var.f9522b;
                    synchronized (ue1Var) {
                        try {
                            ((i8.d) ue1Var.f17217f).getClass();
                            long jCurrentTimeMillis = System.currentTimeMillis();
                            HashMap map2 = ue1Var.f17212a;
                            if (map2.containsKey(adFormat)) {
                                lf1 lf1Var = (lf1) ((Map) map2.get(adFormat)).get(string8);
                                String strZzk = lf1Var == null ? null : lf1Var.zzk();
                                boolean z10 = strZzk != null && adFormat.equals(lf1Var.zzo());
                                Long lValueOf = z10 ? Long.valueOf(System.currentTimeMillis()) : null;
                                if (lf1Var == null) {
                                    gf1Var = null;
                                } else {
                                    ff1 ff1Var = new ff1(lf1Var.f13664e.f31009a, adFormat);
                                    ff1Var.a(string8);
                                    gf1Var = new gf1(ff1Var);
                                }
                                ue1Var.f17214c.zzd(lf1Var == null ? 0 : lf1Var.f13664e.f31012d, lf1Var != null ? lf1Var.p() : 0, jCurrentTimeMillis, lValueOf, strZzk, gf1Var, "2");
                                r52 = z10;
                            }
                        } catch (Throwable th) {
                            throw th;
                        }
                    }
                }
                parcel2.writeNoException();
                parcel2.writeInt(r52);
                return true;
            case 11:
                String string9 = parcel.readString();
                aj.e(parcel);
                r0 r0VarZzo = zzo(string9);
                parcel2.writeNoException();
                aj.d(parcel2, r0VarZzo);
                return true;
            case 12:
                String string10 = parcel.readString();
                aj.e(parcel);
                jk jkVarZzp = zzp(string10);
                parcel2.writeNoException();
                aj.d(parcel2, jkVarZzp);
                return true;
            case 13:
                String string11 = parcel.readString();
                aj.e(parcel);
                s00 s00VarZzq = zzq(string11);
                parcel2.writeNoException();
                aj.d(parcel2, s00VarZzq);
                return true;
            case 14:
                int i12 = parcel.readInt();
                String string12 = parcel.readString();
                aj.e(parcel);
                p3 p3VarZzr = zzr(i12, string12);
                parcel2.writeNoException();
                aj.c(parcel2, p3VarZzr);
                return true;
            case 15:
                int i13 = parcel.readInt();
                aj.e(parcel);
                ue1 ue1Var2 = ((bf1) this).f9522b;
                synchronized (ue1Var2) {
                    try {
                        map = new HashMap();
                        AdFormat adFormat2 = AdFormat.getAdFormat(i13);
                        if (adFormat2 != null) {
                            HashMap map3 = ue1Var2.f17212a;
                            if (map3.containsKey(adFormat2)) {
                                for (lf1 lf1Var2 : ((Map) map3.get(adFormat2)).values()) {
                                    map.put(lf1Var2.f13668i, lf1Var2.f13664e);
                                }
                                cf1 cf1Var = ue1Var2.f17214c;
                                ((i8.d) ue1Var2.f17217f).getClass();
                                cf1Var.j(map.size(), System.currentTimeMillis(), adFormat2);
                            }
                        }
                        return true;
                    } catch (Throwable th2) {
                        throw th2;
                    }
                }
                Bundle bundle = new Bundle();
                for (Map.Entry entry : map.entrySet()) {
                    String str = (String) entry.getKey();
                    p3 p3Var2 = (p3) entry.getValue();
                    Parcel parcelObtain = Parcel.obtain();
                    p3Var2.writeToParcel(parcelObtain, 0);
                    byte[] bArrMarshall = parcelObtain.marshall();
                    parcelObtain.recycle();
                    bundle.putByteArray(str, bArrMarshall);
                }
                parcel2.writeNoException();
                aj.c(parcel2, bundle);
                return true;
            case 16:
                int i14 = parcel.readInt();
                String string13 = parcel.readString();
                aj.e(parcel);
                bf1 bf1Var2 = (bf1) this;
                AdFormat adFormat3 = AdFormat.getAdFormat(i14);
                if (adFormat3 != null) {
                    ue1 ue1Var3 = bf1Var2.f9522b;
                    synchronized (ue1Var3) {
                        HashMap map4 = ue1Var3.f17212a;
                        if (map4.containsKey(adFormat3)) {
                            lf1 lf1Var3 = (lf1) ((Map) map4.get(adFormat3)).get(string13);
                            if (lf1Var3 != null) {
                                iP = lf1Var3.p();
                            }
                            cf1 cf1Var2 = ue1Var3.f17214c;
                            ((i8.d) ue1Var3.f17217f).getClass();
                            cf1Var2.zzp(iP, System.currentTimeMillis(), string13, lf1Var3 != null ? lf1Var3.f13664e.f31009a : null, adFormat3, lf1Var3 == null ? -1 : lf1Var3.f13664e.f31012d);
                        }
                    }
                }
                parcel2.writeNoException();
                parcel2.writeInt(iP);
                return true;
            case 17:
                int i15 = parcel.readInt();
                String string14 = parcel.readString();
                aj.e(parcel);
                bf1 bf1Var3 = (bf1) this;
                AdFormat adFormat4 = AdFormat.getAdFormat(i15);
                ?? A = adFormat4 != null ? bf1Var3.f9522b.a(adFormat4, string14) : 0;
                parcel2.writeNoException();
                parcel2.writeInt(A);
                return true;
            case 18:
                int i16 = parcel.readInt();
                aj.e(parcel);
                ((bf1) this).q(i16);
                parcel2.writeNoException();
                return true;
            default:
                return false;
        }
    }

    @Nullable
    public abstract /* synthetic */ s00 zzg(String str) throws RemoteException;

    @Nullable
    public abstract /* synthetic */ jk zzi(String str) throws RemoteException;

    @Nullable
    public abstract /* synthetic */ r0 zzk(String str) throws RemoteException;

    public abstract /* synthetic */ boolean zzm(String str, p3 p3Var, @Nullable z0 z0Var) throws RemoteException;

    @Nullable
    public abstract /* synthetic */ r0 zzo(String str) throws RemoteException;

    @Nullable
    public abstract /* synthetic */ jk zzp(String str) throws RemoteException;

    @Nullable
    public abstract /* synthetic */ s00 zzq(String str) throws RemoteException;

    @Nullable
    public abstract /* synthetic */ p3 zzr(int i10, String str) throws RemoteException;
}
