package com.google.android.gms.internal.ads;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.os.IBinder;
import android.os.IInterface;
import android.os.Parcel;
import android.os.RemoteException;
import android.text.TextUtils;
import androidx.media3.common.MimeTypes;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.math.BigInteger;
import java.security.GeneralSecurityException;
import java.security.InvalidAlgorithmParameterException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.spec.ECPoint;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;

/* JADX INFO: loaded from: classes2.dex */
public final class vu0 implements cb, s7.d, s7.i, s7.l, s7.n, rc1, or2 {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public Object f17778b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public Object f17779c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public Object f17780d;

    public /* synthetic */ vu0(int i10, int i11) {
        this.f17777a = i10;
        if (i10 != 21) {
            return;
        }
        this.f17778b = null;
        this.f17779c = null;
        this.f17780d = u12.f17063e;
    }

    public static void m(vu0 vu0Var, pz1 pz1Var) {
        long[] jArr = (long[]) vu0Var.f17778b;
        vu0 vu0Var2 = pz1Var.f15556a;
        long[] jArr2 = (long[]) vu0Var2.f17778b;
        long[] jArr3 = pz1Var.f15557b;
        vj1.n(jArr, jArr2, jArr3);
        long[] jArr4 = (long[]) vu0Var.f17779c;
        long[] jArr5 = (long[]) vu0Var2.f17779c;
        long[] jArr6 = (long[]) vu0Var2.f17780d;
        vj1.n(jArr4, jArr5, jArr6);
        vj1.n((long[]) vu0Var.f17780d, jArr6, jArr3);
    }

    public static String z(Context context) {
        File file = new File(context.getPackageResourcePath());
        if (!file.exists() || !file.canRead()) {
            return "";
        }
        try {
            FileInputStream fileInputStream = new FileInputStream(file);
            try {
                byte[] bArr = new byte[16384];
                MessageDigest messageDigest = MessageDigest.getInstance("SHA256");
                for (int i10 = fileInputStream.read(bArr); i10 != -1; i10 = fileInputStream.read(bArr)) {
                    messageDigest.update(bArr, 0, i10);
                }
                gt1 gt1VarF = gt1.f11873f.f();
                byte[] bArrDigest = messageDigest.digest();
                String strG = gt1VarF.g(bArrDigest, bArrDigest.length);
                fileInputStream.close();
                return strG;
            } catch (Throwable th) {
                try {
                    fileInputStream.close();
                } catch (Throwable th2) {
                    th.addSuppressed(th2);
                }
                throw th;
            }
        } catch (IOException | UnsupportedOperationException | NoSuchAlgorithmException unused) {
            return "";
        }
    }

    public final List A() {
        ArrayList arrayList = new ArrayList();
        Iterator it = ((List) this.f17779c).iterator();
        while (it.hasNext()) {
            String str = (String) n7.y.f31093e.f31096c.b((un) it.next());
            if (!TextUtils.isEmpty(str)) {
                arrayList.add(str);
            }
        }
        ArrayList arrayList2 = new ArrayList();
        ni.y(arrayList2, new bp("gad:dynamite_module:experiment_id", "", 4));
        ni.y(arrayList2, ni.f14622f);
        ni.y(arrayList2, ni.f14623g);
        ni.y(arrayList2, ni.f14624h);
        ni.y(arrayList2, ni.f14625i);
        ni.y(arrayList2, ni.f14626j);
        ni.y(arrayList2, ni.f14642z);
        ni.y(arrayList2, ni.f14627k);
        ni.y(arrayList2, ni.f14634r);
        ni.y(arrayList2, ni.f14635s);
        ni.y(arrayList2, ni.f14636t);
        ni.y(arrayList2, ni.f14637u);
        ni.y(arrayList2, ni.f14638v);
        ni.y(arrayList2, ni.f14639w);
        ni.y(arrayList2, ni.f14640x);
        ni.y(arrayList2, ni.f14641y);
        ni.y(arrayList2, ni.f14628l);
        ni.y(arrayList2, ni.f14629m);
        ni.y(arrayList2, ni.f14630n);
        ni.y(arrayList2, ni.f14631o);
        ni.y(arrayList2, ni.f14632p);
        ni.y(arrayList2, ni.f14633q);
        arrayList.addAll(arrayList2);
        return arrayList;
    }

    public final List B() {
        List listA = A();
        Iterator it = ((List) this.f17780d).iterator();
        while (it.hasNext()) {
            String str = (String) n7.y.f31093e.f31096c.b((un) it.next());
            if (!TextUtils.isEmpty(str)) {
                ((ArrayList) listA).add(str);
            }
        }
        ArrayList arrayList = new ArrayList();
        ni.y(arrayList, ni.A);
        ((ArrayList) listA).addAll(arrayList);
        return listA;
    }

    @Override // com.google.android.gms.internal.ads.or2
    public final List a(int i10, fl flVar, int[] iArr) {
        ts1 ts1Var = b.f9321f;
        bs1 bs1Var = zzguf.f19771b;
        as1 as1Var = new as1(4);
        for (int i11 = 0; i11 < flVar.f11273a; i11++) {
            String str = (String) this.f17780d;
            int i12 = i11;
            as1Var.a(new nr2(i10, flVar, i12, (jr2) this.f17778b, iArr[i11], (String) this.f17779c, str));
        }
        return as1Var.g();
    }

    @Override // s7.d
    public final void b(g7.a aVar) {
        try {
            String canonicalName = ((s7.a) this.f17779c).getClass().getCanonicalName();
            int i10 = aVar.f26270a;
            String str = aVar.f26271b;
            String str2 = aVar.f26272c;
            StringBuilder sb = new StringBuilder(String.valueOf(canonicalName).length() + 41 + String.valueOf(i10).length() + 17 + String.valueOf(str).length() + 16 + String.valueOf(str2).length());
            sb.append(canonicalName);
            sb.append("failed to load mediation ad: ErrorCode = ");
            sb.append(i10);
            sb.append(". ErrorMessage = ");
            sb.append(str);
            sb.append(". ErrorDomain = ");
            sb.append(str2);
            q7.j.a(sb.toString());
            cw cwVar = (cw) this.f17778b;
            cwVar.x0(aVar.a());
            cwVar.M2(i10, str);
            cwVar.zzg(i10);
        } catch (RemoteException unused) {
        }
    }

    public final void c() {
        com.google.android.gms.common.internal.w.d("#008 Must be called on the main UI thread.");
        q7.j.a("Adapter called onAdClosed.");
        try {
            ((cw) this.f17778b).zzf();
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    @Override // com.google.android.gms.internal.ads.cb
    public final void d(g91 g91Var, q2 q2Var, x2.o0 o0Var) {
        this.f17779c = g91Var;
        o0Var.d();
        o0Var.e();
        u3 u3VarE = q2Var.e(o0Var.f34560d, 5);
        this.f17780d = u3VarE;
        u3VarE.d((zn2) this.f17778b);
    }

    @Override // com.google.android.gms.internal.ads.cb
    public final void e(p01 p01Var) {
        long jA;
        long j10;
        ((g91) this.f17779c).getClass();
        String str = bb1.f9474a;
        g91 g91Var = (g91) this.f17779c;
        synchronized (g91Var) {
            try {
                long j11 = g91Var.f11636c;
                jA = j11 != -9223372036854775807L ? j11 + g91Var.f11635b : g91Var.a();
            } catch (Throwable th) {
                throw th;
            }
        }
        g91 g91Var2 = (g91) this.f17779c;
        synchronized (g91Var2) {
            j10 = g91Var2.f11635b;
        }
        if (jA == -9223372036854775807L || j10 == -9223372036854775807L) {
            return;
        }
        zn2 zn2Var = (zn2) this.f17778b;
        if (j10 != zn2Var.f19337j) {
            sm2 sm2Var = new sm2(zn2Var);
            sm2Var.f16485h = j10;
            zn2 zn2Var2 = new zn2(sm2Var);
            this.f17778b = zn2Var2;
            ((u3) this.f17780d).d(zn2Var2);
        }
        int iY = p01Var.y();
        ((u3) this.f17780d).a(p01Var, iY);
        ((u3) this.f17780d).zze(jA, 1, iY, 0, null);
    }

    public final void f() {
        com.google.android.gms.common.internal.w.d("#008 Must be called on the main UI thread.");
        StringBuilder sb = new StringBuilder(String.valueOf(0).length() + 44);
        sb.append("Adapter called onAdFailedToLoad with error 0.");
        q7.j.a(sb.toString());
        try {
            ((cw) this.f17778b).zzg(0);
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public final void g(g7.a aVar) {
        com.google.android.gms.common.internal.w.d("#008 Must be called on the main UI thread.");
        int i10 = aVar.f26270a;
        int length = String.valueOf(i10).length();
        String str = aVar.f26271b;
        int length2 = String.valueOf(str).length();
        String str2 = aVar.f26272c;
        StringBuilder sb = new StringBuilder(length + 71 + length2 + 15 + String.valueOf(str2).length());
        sb.append("Adapter called onAdFailedToLoad with error. ErrorCode: ");
        sb.append(i10);
        sb.append(". ErrorMessage: ");
        sb.append(str);
        sb.append(". ErrorDomain: ");
        sb.append(str2);
        q7.j.a(sb.toString());
        try {
            ((cw) this.f17778b).x0(aVar.a());
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public final void h(g7.a aVar) {
        com.google.android.gms.common.internal.w.d("#008 Must be called on the main UI thread.");
        int i10 = aVar.f26270a;
        int length = String.valueOf(i10).length();
        String str = aVar.f26271b;
        int length2 = String.valueOf(str).length();
        String str2 = aVar.f26272c;
        StringBuilder sb = new StringBuilder(length + 71 + length2 + 15 + String.valueOf(str2).length());
        sb.append("Adapter called onAdFailedToLoad with error. ErrorCode: ");
        sb.append(i10);
        sb.append(". ErrorMessage: ");
        sb.append(str);
        sb.append(". ErrorDomain: ");
        sb.append(str2);
        q7.j.a(sb.toString());
        try {
            ((cw) this.f17778b).x0(aVar.a());
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public final void i(g7.a aVar) {
        com.google.android.gms.common.internal.w.d("#008 Must be called on the main UI thread.");
        int i10 = aVar.f26270a;
        int length = String.valueOf(i10).length();
        String str = aVar.f26271b;
        int length2 = String.valueOf(str).length();
        String str2 = aVar.f26272c;
        StringBuilder sb = new StringBuilder(length + 71 + length2 + 15 + String.valueOf(str2).length());
        sb.append("Adapter called onAdFailedToLoad with error. ErrorCode: ");
        sb.append(i10);
        sb.append(". ErrorMessage: ");
        sb.append(str);
        sb.append(". ErrorDomain: ");
        sb.append(str2);
        q7.j.a(sb.toString());
        try {
            ((cw) this.f17778b).x0(aVar.a());
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public final void j() {
        com.google.android.gms.common.internal.w.d("#008 Must be called on the main UI thread.");
        q7.j.a("Adapter called onAdLoaded.");
        try {
            ((cw) this.f17778b).zzj();
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public final void k() {
        com.google.android.gms.common.internal.w.d("#008 Must be called on the main UI thread.");
        q7.j.a("Adapter called onAdOpened.");
        try {
            ((cw) this.f17778b).zzi();
        } catch (RemoteException e10) {
            q7.j.zzl("#007 Could not call remote method.", e10);
        }
    }

    public final xc1 l(Callable callable) {
        List list = (List) this.f17779c;
        e.t0 t0VarX1 = ih1.x1(list);
        uu1 uu1VarC = t0VarX1.c(wc1.f18029a, b30.f9365g);
        yc1 yc1Var = (yc1) this.f17780d;
        return new xc1(yc1Var, this.f17778b, null, uu1VarC, list, t0VarX1.c(callable, yc1Var.f18807a));
    }

    public final void n(int i10) throws InvalidAlgorithmParameterException {
        if (i10 != 16 && i10 != 32) {
            throw new InvalidAlgorithmParameterException(String.format("Invalid key size %d; only 128-bit and 256-bit AES keys are supported", Integer.valueOf(i10 * 8)));
        }
        this.f17778b = Integer.valueOf(i10);
    }

    public final byte[] o() {
        long[] jArr = new long[10];
        long[] jArr2 = new long[10];
        long[] jArr3 = new long[10];
        long[] jArr4 = new long[10];
        long[] jArr5 = new long[10];
        long[] jArr6 = new long[10];
        long[] jArr7 = new long[10];
        long[] jArr8 = new long[10];
        long[] jArr9 = new long[10];
        long[] jArr10 = new long[10];
        long[] jArr11 = new long[10];
        long[] jArr12 = new long[10];
        long[] jArr13 = new long[10];
        long[] jArr14 = (long[]) this.f17780d;
        vj1.p(jArr4, jArr14);
        vj1.p(jArr13, jArr4);
        vj1.p(jArr12, jArr13);
        vj1.n(jArr5, jArr12, jArr14);
        vj1.n(jArr6, jArr5, jArr4);
        vj1.p(jArr12, jArr6);
        vj1.n(jArr7, jArr12, jArr5);
        vj1.p(jArr12, jArr7);
        vj1.p(jArr13, jArr12);
        vj1.p(jArr12, jArr13);
        vj1.p(jArr13, jArr12);
        vj1.p(jArr12, jArr13);
        vj1.n(jArr8, jArr12, jArr7);
        vj1.p(jArr12, jArr8);
        vj1.p(jArr13, jArr12);
        for (int i10 = 2; i10 < 10; i10 += 2) {
            vj1.p(jArr12, jArr13);
            vj1.p(jArr13, jArr12);
        }
        vj1.n(jArr9, jArr13, jArr8);
        vj1.p(jArr12, jArr9);
        vj1.p(jArr13, jArr12);
        for (int i11 = 2; i11 < 20; i11 += 2) {
            vj1.p(jArr12, jArr13);
            vj1.p(jArr13, jArr12);
        }
        vj1.n(jArr12, jArr13, jArr9);
        vj1.p(jArr13, jArr12);
        vj1.p(jArr12, jArr13);
        for (int i12 = 2; i12 < 10; i12 += 2) {
            vj1.p(jArr13, jArr12);
            vj1.p(jArr12, jArr13);
        }
        vj1.n(jArr10, jArr12, jArr8);
        vj1.p(jArr12, jArr10);
        vj1.p(jArr13, jArr12);
        for (int i13 = 2; i13 < 50; i13 += 2) {
            vj1.p(jArr12, jArr13);
            vj1.p(jArr13, jArr12);
        }
        vj1.n(jArr11, jArr13, jArr10);
        vj1.p(jArr13, jArr11);
        vj1.p(jArr12, jArr13);
        for (int i14 = 2; i14 < 100; i14 += 2) {
            vj1.p(jArr13, jArr12);
            vj1.p(jArr12, jArr13);
        }
        vj1.n(jArr13, jArr12, jArr11);
        vj1.p(jArr12, jArr13);
        vj1.p(jArr13, jArr12);
        for (int i15 = 2; i15 < 50; i15 += 2) {
            vj1.p(jArr12, jArr13);
            vj1.p(jArr13, jArr12);
        }
        vj1.n(jArr12, jArr13, jArr10);
        vj1.p(jArr13, jArr12);
        vj1.p(jArr12, jArr13);
        vj1.p(jArr13, jArr12);
        vj1.p(jArr12, jArr13);
        vj1.p(jArr13, jArr12);
        vj1.n(jArr, jArr13, jArr6);
        vj1.n(jArr2, (long[]) this.f17778b, jArr);
        vj1.n(jArr3, (long[]) this.f17779c, jArr);
        byte[] bArrR = vj1.r(jArr3);
        bArrR[31] = (byte) (((vj1.r(jArr2)[0] & 1) << 7) ^ bArrR[31]);
        return bArrR;
    }

    public final void p(int i10) throws GeneralSecurityException {
        if (i10 < 10 || i10 > 16) {
            throw new GeneralSecurityException(defpackage.e.n(new StringBuilder(String.valueOf(i10).length() + 40), "Invalid tag size for AesCmacParameters: ", i10));
        }
        this.f17779c = Integer.valueOf(i10);
    }

    public final vw1 q() throws GeneralSecurityException {
        jc1 jc1Var;
        i92 i92VarB;
        ax1 ax1Var = (ax1) this.f17778b;
        if (ax1Var == null || (jc1Var = (jc1) this.f17779c) == null) {
            throw new GeneralSecurityException("Cannot build without parameters and/or key material");
        }
        if (ax1Var.f9302a != jc1Var.i()) {
            throw new GeneralSecurityException("Key size mismatch");
        }
        if (ax1Var.a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((ax1) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        zw1 zw1Var = ((ax1) this.f17778b).f9304c;
        if (zw1Var == zw1.f19411d) {
            i92VarB = u02.f17053a;
        } else if (zw1Var == zw1.f19410c) {
            i92VarB = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (zw1Var != zw1.f19409b) {
                throw new IllegalStateException("Unknown AesEaxParameters.Variant: ".concat(String.valueOf(((ax1) this.f17778b).f9304c)));
            }
            i92VarB = u02.b(((Integer) this.f17780d).intValue());
        }
        return new vw1((ax1) this.f17778b, (jc1) this.f17779c, i92VarB, (Integer) this.f17780d);
    }

    public final bx1 r() throws GeneralSecurityException {
        jc1 jc1Var;
        i92 i92VarB;
        fx1 fx1Var = (fx1) this.f17778b;
        if (fx1Var == null || (jc1Var = (jc1) this.f17779c) == null) {
            throw new GeneralSecurityException("Cannot build without parameters and/or key material");
        }
        if (fx1Var.f11413a != jc1Var.i()) {
            throw new GeneralSecurityException("Key size mismatch");
        }
        if (fx1Var.a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((fx1) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        ex1 ex1Var = ((fx1) this.f17778b).f11414b;
        if (ex1Var == ex1.f10946d) {
            i92VarB = u02.f17053a;
        } else if (ex1Var == ex1.f10945c) {
            i92VarB = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (ex1Var != ex1.f10944b) {
                throw new IllegalStateException("Unknown AesGcmParameters.Variant: ".concat(String.valueOf(((fx1) this.f17778b).f11414b)));
            }
            i92VarB = u02.b(((Integer) this.f17780d).intValue());
        }
        return new bx1((fx1) this.f17778b, (jc1) this.f17779c, i92VarB, (Integer) this.f17780d);
    }

    public final gx1 s() throws GeneralSecurityException {
        jc1 jc1Var;
        i92 i92VarB;
        kx1 kx1Var = (kx1) this.f17778b;
        if (kx1Var == null || (jc1Var = (jc1) this.f17779c) == null) {
            throw new GeneralSecurityException("Cannot build without parameters and/or key material");
        }
        if (kx1Var.f13425a != jc1Var.i()) {
            throw new GeneralSecurityException("Key size mismatch");
        }
        if (kx1Var.a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((kx1) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        jx1 jx1Var = ((kx1) this.f17778b).f13426b;
        if (jx1Var == jx1.f13035d) {
            i92VarB = u02.f17053a;
        } else if (jx1Var == jx1.f13034c) {
            i92VarB = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (jx1Var != jx1.f13033b) {
                throw new IllegalStateException("Unknown AesGcmSivParameters.Variant: ".concat(String.valueOf(((kx1) this.f17778b).f13426b)));
            }
            i92VarB = u02.b(((Integer) this.f17780d).intValue());
        }
        return new gx1((kx1) this.f17778b, (jc1) this.f17779c, i92VarB, (Integer) this.f17780d);
    }

    public final r12 t() throws GeneralSecurityException {
        jc1 jc1Var;
        i92 i92VarA;
        v12 v12Var = (v12) this.f17778b;
        if (v12Var == null || (jc1Var = (jc1) this.f17779c) == null) {
            throw new GeneralSecurityException("Cannot build without parameters and/or key material");
        }
        if (v12Var.f17476a != jc1Var.i()) {
            throw new GeneralSecurityException("Key size mismatch");
        }
        if (v12Var.a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((v12) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        u12 u12Var = ((v12) this.f17778b).f17478c;
        if (u12Var == u12.f17063e) {
            i92VarA = u02.f17053a;
        } else if (u12Var == u12.f17062d || u12Var == u12.f17061c) {
            i92VarA = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (u12Var != u12.f17060b) {
                throw new IllegalStateException("Unknown AesCmacParametersParameters.Variant: ".concat(String.valueOf(((v12) this.f17778b).f17478c)));
            }
            i92VarA = u02.b(((Integer) this.f17780d).intValue());
        }
        return new r12((v12) this.f17778b, (jc1) this.f17779c, i92VarA, (Integer) this.f17780d);
    }

    public final String toString() {
        switch (this.f17777a) {
            case 15:
                StringBuilder sb = new StringBuilder(32);
                sb.append((String) this.f17778b);
                sb.append('{');
                uz0 uz0Var = (uz0) ((uz0) this.f17779c).f17460b;
                String str = "";
                while (uz0Var != null) {
                    Object obj = uz0Var.f17461c;
                    sb.append(str);
                    if (obj == null || !obj.getClass().isArray()) {
                        sb.append(obj);
                    } else {
                        sb.append((CharSequence) Arrays.deepToString(new Object[]{obj}), 1, r2.length() - 1);
                    }
                    uz0Var = (uz0) uz0Var.f17460b;
                    str = ", ";
                }
                sb.append('}');
                return sb.toString();
            default:
                return super.toString();
        }
    }

    public final v12 u() throws GeneralSecurityException {
        Integer num = (Integer) this.f17778b;
        if (num == null) {
            throw new GeneralSecurityException("key size not set");
        }
        if (((Integer) this.f17779c) == null) {
            throw new GeneralSecurityException("tag size not set");
        }
        if (((u12) this.f17780d) != null) {
            return new v12(num.intValue(), ((Integer) this.f17779c).intValue(), (u12) this.f17780d);
        }
        throw new GeneralSecurityException("variant not set");
    }

    public final a22 v() throws GeneralSecurityException {
        jc1 jc1Var;
        i92 i92VarA;
        f22 f22Var = (f22) this.f17778b;
        if (f22Var == null || (jc1Var = (jc1) this.f17779c) == null) {
            throw new GeneralSecurityException("Cannot build without parameters and/or key material");
        }
        if (f22Var.f10992a != jc1Var.i()) {
            throw new GeneralSecurityException("Key size mismatch");
        }
        if (f22Var.a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((f22) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        e22 e22Var = ((f22) this.f17778b).f10994c;
        if (e22Var == e22.f10605e) {
            i92VarA = u02.f17053a;
        } else if (e22Var == e22.f10604d || e22Var == e22.f10603c) {
            i92VarA = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (e22Var != e22.f10602b) {
                throw new IllegalStateException("Unknown HmacParameters.Variant: ".concat(String.valueOf(((f22) this.f17778b).f10994c)));
            }
            i92VarA = u02.b(((Integer) this.f17780d).intValue());
        }
        return new a22((f22) this.f17778b, (jc1) this.f17779c, i92VarA, (Integer) this.f17780d);
    }

    public final u62 w() throws GeneralSecurityException {
        i92 i92VarA;
        s62 s62Var = (s62) this.f17778b;
        if (s62Var == null) {
            throw new GeneralSecurityException("Cannot build without parameters");
        }
        ECPoint eCPoint = (ECPoint) this.f17779c;
        if (eCPoint == null) {
            throw new GeneralSecurityException("Cannot build without public point");
        }
        sz1.a(eCPoint, s62Var.f16314b.f14882b.getCurve());
        if (((s62) this.f17778b).a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((s62) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        r62 r62Var = ((s62) this.f17778b).f16316d;
        if (r62Var == r62.f16009e) {
            i92VarA = u02.f17053a;
        } else if (r62Var == r62.f16008d || r62Var == r62.f16007c) {
            i92VarA = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (r62Var != r62.f16006b) {
                throw new IllegalStateException("Unknown EcdsaParameters.Variant: ".concat(((s62) this.f17778b).f16316d.f16010a));
            }
            i92VarA = u02.b(((Integer) this.f17780d).intValue());
        }
        return new u62((s62) this.f17778b, (ECPoint) this.f17779c, i92VarA, (Integer) this.f17780d);
    }

    public final p72 x() throws GeneralSecurityException {
        i92 i92VarA;
        if (((m72) this.f17778b) == null) {
            throw new GeneralSecurityException("Cannot build without parameters");
        }
        BigInteger bigInteger = (BigInteger) this.f17779c;
        if (bigInteger == null) {
            throw new GeneralSecurityException("Cannot build without modulus");
        }
        int iBitLength = bigInteger.bitLength();
        m72 m72Var = (m72) this.f17778b;
        int i10 = m72Var.f13997a;
        if (iBitLength != i10) {
            throw new GeneralSecurityException(com.google.android.gms.measurement.internal.u1.m(new StringBuilder(String.valueOf(iBitLength).length() + 56 + String.valueOf(i10).length()), "Got modulus size ", iBitLength, ", but parameters requires modulus size ", i10));
        }
        if (m72Var.a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((m72) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        l72 l72Var = ((m72) this.f17778b).f13999c;
        if (l72Var == l72.f13522e) {
            i92VarA = u02.f17053a;
        } else if (l72Var == l72.f13521d || l72Var == l72.f13520c) {
            i92VarA = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (l72Var != l72.f13519b) {
                throw new IllegalStateException("Unknown RsaSsaPkcs1Parameters.Variant: ".concat(String.valueOf(((m72) this.f17778b).f13999c)));
            }
            i92VarA = u02.b(((Integer) this.f17780d).intValue());
        }
        return new p72((m72) this.f17778b, (BigInteger) this.f17779c, i92VarA, (Integer) this.f17780d);
    }

    public final x72 y() throws GeneralSecurityException {
        i92 i92VarA;
        if (((v72) this.f17778b) == null) {
            throw new GeneralSecurityException("Cannot build without parameters");
        }
        BigInteger bigInteger = (BigInteger) this.f17779c;
        if (bigInteger == null) {
            throw new GeneralSecurityException("Cannot build without modulus");
        }
        int iBitLength = bigInteger.bitLength();
        v72 v72Var = (v72) this.f17778b;
        int i10 = v72Var.f17533a;
        if (iBitLength != i10) {
            throw new GeneralSecurityException(com.google.android.gms.measurement.internal.u1.m(new StringBuilder(String.valueOf(iBitLength).length() + 56 + String.valueOf(i10).length()), "Got modulus size ", iBitLength, ", but parameters requires modulus size ", i10));
        }
        if (v72Var.a() && ((Integer) this.f17780d) == null) {
            throw new GeneralSecurityException("Cannot create key without ID requirement with parameters with ID requirement");
        }
        if (!((v72) this.f17778b).a() && ((Integer) this.f17780d) != null) {
            throw new GeneralSecurityException("Cannot create key with ID requirement with parameters without ID requirement");
        }
        u72 u72Var = ((v72) this.f17778b).f17535c;
        if (u72Var == u72.f17121e) {
            i92VarA = u02.f17053a;
        } else if (u72Var == u72.f17120d || u72Var == u72.f17119c) {
            i92VarA = u02.a(((Integer) this.f17780d).intValue());
        } else {
            if (u72Var != u72.f17118b) {
                throw new IllegalStateException("Unknown RsaSsaPssParameters.Variant: ".concat(String.valueOf(((v72) this.f17778b).f17535c)));
            }
            i92VarA = u02.b(((Integer) this.f17780d).intValue());
        }
        return new x72((v72) this.f17778b, (BigInteger) this.f17779c, i92VarA, (Integer) this.f17780d);
    }

    @Override // com.google.android.gms.internal.ads.rc1
    public final Object zza(Object obj) {
        dw0 dw0Var = (dw0) this.f17778b;
        q7.m mVar = (q7.m) this.f17779c;
        String str = (String) this.f17780d;
        dw0Var.getClass();
        ((a30) dw0Var.f10537b).execute(new m1((SQLiteDatabase) obj, str, mVar, 6));
        return null;
    }

    public /* synthetic */ vu0(int i10, Object obj) {
        this.f17777a = i10;
        this.f17778b = null;
        this.f17779c = null;
        this.f17780d = null;
    }

    public vu0(nq nqVar) {
        IBinder iBinder;
        this.f17777a = 4;
        this.f17779c = new ArrayList();
        this.f17778b = nqVar;
        try {
            this.f17780d = nqVar.zzb();
        } catch (RemoteException unused) {
            this.f17780d = "";
        }
        try {
            for (Object obj : nqVar.zzc()) {
                sq qqVar = null;
                if ((obj instanceof IBinder) && (iBinder = (IBinder) obj) != null) {
                    IInterface iInterfaceQueryLocalInterface = iBinder.queryLocalInterface("com.google.android.gms.ads.internal.formats.client.INativeAdImage");
                    qqVar = iInterfaceQueryLocalInterface instanceof sq ? (sq) iInterfaceQueryLocalInterface : new qq(iBinder);
                }
                if (qqVar != null) {
                    ((List) this.f17779c).add(new tq(qqVar));
                }
            }
        } catch (RemoteException unused2) {
        }
    }

    public vu0(cw cwVar) {
        this.f17777a = 6;
        this.f17778b = cwVar;
    }

    public /* synthetic */ vu0(a80 a80Var, int i10) {
        this.f17777a = i10;
        this.f17778b = a80Var;
    }

    public /* synthetic */ vu0(a80 a80Var, eb ebVar) {
        this.f17777a = 9;
        this.f17778b = a80Var;
        this.f17779c = ebVar;
    }

    public /* synthetic */ vu0(Object obj, Object obj2, Object obj3, int i10) {
        this.f17777a = i10;
        this.f17778b = obj;
        this.f17779c = obj2;
        this.f17780d = obj3;
    }

    public vu0() {
        this.f17777a = 26;
        this.f17778b = new HashMap();
        this.f17779c = new HashMap();
    }

    /* JADX WARN: Illegal instructions before constructor call */
    public vu0(int i10) {
        this.f17777a = i10;
        int i11 = 19;
        if (i10 != 19) {
            this.f17778b = new ArrayList();
            this.f17779c = new ArrayList();
            this.f17780d = new ArrayList();
            return;
        }
        this(new long[10], new long[10], new long[10], i11);
    }

    public vu0(Context context, ExecutorService executorService, qe qeVar, vg vgVar) {
        this.f17777a = 2;
        this.f17779c = vgVar;
        this.f17780d = qeVar;
        this.f17778b = ih1.A0(new hg(this, context, 0), executorService);
    }

    public vu0(ow owVar, cw cwVar, s7.a aVar) {
        this.f17777a = 5;
        this.f17778b = cwVar;
        this.f17779c = aVar;
        Objects.requireNonNull(owVar);
        this.f17780d = owVar;
    }

    public vu0(um0 um0Var, cr0 cr0Var) {
        this.f17777a = 12;
        this.f17778b = um0Var;
        final d11 d11Var = new d11(cr0Var);
        this.f17779c = d11Var;
        final mu muVarZze = ((um0) this.f17778b).zze();
        this.f17780d = new xe0() { // from class: com.google.android.gms.internal.ads.j11
            @Override // com.google.android.gms.internal.ads.xe0
            public final void q(n7.l2 l2Var) {
                d11Var.q(l2Var);
                mu muVar = muVarZze;
                if (muVar != null) {
                    try {
                        ku kuVar = (ku) muVar;
                        Parcel parcelO = kuVar.O();
                        aj.b(parcelO, l2Var);
                        kuVar.O0(3, parcelO);
                    } catch (RemoteException e10) {
                        q7.j.zzl("#007 Could not call remote method.", e10);
                    }
                }
                if (muVar != null) {
                    try {
                        int i10 = l2Var.f30997a;
                        ku kuVar2 = (ku) muVar;
                        Parcel parcelO2 = kuVar2.O();
                        parcelO2.writeInt(i10);
                        kuVar2.O0(2, parcelO2);
                    } catch (RemoteException e11) {
                        q7.j.zzl("#007 Could not call remote method.", e11);
                    }
                }
            }
        };
    }

    public /* synthetic */ vu0(yc1 yc1Var, zzfno zzfnoVar, List list) {
        this.f17777a = 13;
        Objects.requireNonNull(yc1Var);
        this.f17780d = yc1Var;
        this.f17778b = zzfnoVar;
        this.f17779c = list;
    }

    public vu0(String str) {
        this.f17777a = 1;
        sm2 sm2Var = new sm2();
        sm2Var.zzl(MimeTypes.VIDEO_MP2T);
        sm2Var.zzm(str);
        this.f17778b = new zn2(sm2Var);
    }

    /* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
    public vu0(pz1 pz1Var) {
        this(19);
        this.f17777a = 19;
        m(this, pz1Var);
    }

    public /* synthetic */ vu0(String str, int i10) {
        this.f17777a = 15;
        uz0 uz0Var = new uz0(10, (com.bytedance.sdk.component.adexpress.dynamic.dynamicview.b) null);
        this.f17779c = uz0Var;
        this.f17780d = uz0Var;
        this.f17778b = str;
    }

    public vu0(vu0 vu0Var) {
        this.f17777a = 19;
        this.f17778b = Arrays.copyOf((long[]) vu0Var.f17778b, 10);
        this.f17779c = Arrays.copyOf((long[]) vu0Var.f17779c, 10);
        this.f17780d = Arrays.copyOf((long[]) vu0Var.f17780d, 10);
    }
}
