package B2;

import F2.C0056b;
import F2.Q;
import F2.r0;
import a1.C0222i;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.util.Base64;
import android.view.View;
import com.google.crypto.tink.shaded.protobuf.AbstractC0479h;
import com.google.crypto.tink.shaded.protobuf.B;
import com.google.crypto.tink.shaded.protobuf.C0485n;
import com.google.firebase.concurrent.ExecutorsRegistrar;
import com.google.firebase.datatransport.TransportRegistrar;
import com.google.firebase.installations.FirebaseInstallationsRegistrar;
import com.google.firebase.messaging.w;
import g3.C0614a;
import g3.C0615b;
import io.flutter.Build;
import io.flutter.plugin.editing.FlutterTextUtils;
import io.flutter.util.ViewUtils;
import io.sentry.M0;
import io.sentry.N0;
import io.sentry.flutter.SentryFlutterPluginKt;
import java.security.GeneralSecurityException;
import java.util.ArrayList;
import java.util.Set;
import java.util.concurrent.ScheduledExecutorService;
import p0.AbstractC0928a;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class c implements A2.b, P1.d, N2.f, ViewUtils.ViewVisitor, P1.a, h1.f, N0 {

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

    public /* synthetic */ c(int i) {
        this.f139k = i;
    }

    @Override // A2.b
    public t2.b a(A2.p pVar) throws GeneralSecurityException {
        switch (this.f139k) {
            case 1:
                if (!((String) pVar.f48a).equals("type.googleapis.com/google.crypto.tink.AesCmacKey")) {
                    throw new IllegalArgumentException("Wrong type URL in call to AesCmacParameters.parseParameters");
                }
                try {
                    C0056b c0056bD = C0056b.D((AbstractC0479h) pVar.f50c, C0485n.a());
                    if (c0056bD.B() != 0) {
                        throw new GeneralSecurityException("Only version 0 keys are accepted");
                    }
                    a aVar = new a(1, false);
                    aVar.f134l = null;
                    aVar.f135m = null;
                    aVar.f136n = g.f148f;
                    aVar.G(c0056bD.z().size());
                    int iY = c0056bD.A().y();
                    if (iY < 10 || 16 < iY) {
                        throw new GeneralSecurityException(AbstractC0928a.i(iY, "Invalid tag size for AesCmacParameters: "));
                    }
                    aVar.f135m = Integer.valueOf(iY);
                    aVar.f136n = i.a((r0) pVar.f52e);
                    h hVarJ = aVar.j();
                    a aVar2 = new a(0, false);
                    aVar2.f136n = null;
                    aVar2.f134l = null;
                    aVar2.f135m = hVarJ;
                    aVar2.f136n = new g3.c(10, H2.a.a(c0056bD.z().f()));
                    aVar2.f134l = (Integer) pVar.f53f;
                    return aVar2.i();
                } catch (B | IllegalArgumentException unused) {
                    throw new GeneralSecurityException("Parsing AesCmacKey failed");
                }
            default:
                if (!((String) pVar.f48a).equals("type.googleapis.com/google.crypto.tink.HmacKey")) {
                    throw new IllegalArgumentException("Wrong type URL in call to HmacProtoSerialization.parseKey");
                }
                try {
                    Q qE = Q.E((AbstractC0479h) pVar.f50c, C0485n.a());
                    if (qE.C() != 0) {
                        throw new GeneralSecurityException("Only version 0 keys are accepted");
                    }
                    w wVar = new w();
                    wVar.f5943k = null;
                    wVar.f5944l = null;
                    wVar.f5945m = null;
                    wVar.f5946n = g.f156o;
                    wVar.f5943k = Integer.valueOf(qE.A().size());
                    wVar.f5944l = Integer.valueOf(qE.B().A());
                    wVar.f5945m = p.a(qE.B().z());
                    wVar.f5946n = p.b((r0) pVar.f52e);
                    o oVarF = wVar.f();
                    a aVar3 = new a(2, false);
                    aVar3.f136n = null;
                    aVar3.f134l = null;
                    aVar3.f135m = oVarF;
                    aVar3.f136n = new g3.c(10, H2.a.a(qE.A().f()));
                    aVar3.f134l = (Integer) pVar.f53f;
                    return aVar3.k();
                } catch (B | IllegalArgumentException unused2) {
                    throw new GeneralSecurityException("Parsing HmacKey failed");
                }
        }
    }

    @Override // h1.f
    public Object apply(Object obj) {
        Cursor cursorRawQuery = ((SQLiteDatabase) obj).rawQuery("SELECT distinct t._id, t.backend_name, t.priority, t.extras FROM transport_contexts AS t, events AS e WHERE e.context_id = t._id", new String[0]);
        try {
            ArrayList arrayList = new ArrayList();
            while (cursorRawQuery.moveToNext()) {
                a aVarA = C0222i.a();
                aVarA.F(cursorRawQuery.getString(1));
                aVarA.f134l = k1.a.b(cursorRawQuery.getInt(2));
                String string = cursorRawQuery.getString(3);
                aVarA.f136n = string == null ? null : Base64.decode(string, 0);
                arrayList.add(aVarA.l());
            }
            return arrayList;
        } finally {
            cursorRawQuery.close();
        }
    }

    @Override // io.sentry.N0
    public void d(M0 m02) {
        m02.getClass();
        m02.f6948b = null;
        m02.f6950d = null;
        m02.f6949c = null;
        m02.f6951e.clear();
        m02.a();
        m02.f6953g.clear();
        m02.f6954h.clear();
        m02.i.clear();
        m02.b();
        m02.p.clear();
    }

    @Override // P1.a
    public Object f(P1.h hVar) {
        switch (this.f139k) {
            case Build.API_LEVELS.API_23 /* 23 */:
                return 403;
            default:
                return -1;
        }
    }

    @Override // N2.f
    public Object g(A2.p pVar) {
        switch (this.f139k) {
            case 11:
                return (ScheduledExecutorService) ExecutorsRegistrar.f5810a.get();
            case 12:
                return (ScheduledExecutorService) ExecutorsRegistrar.f5812c.get();
            case FlutterTextUtils.CARRIAGE_RETURN /* 13 */:
                return (ScheduledExecutorService) ExecutorsRegistrar.f5811b.get();
            case 14:
                N2.o oVar = ExecutorsRegistrar.f5810a;
                return O2.l.f2311k;
            case 15:
            case SentryFlutterPluginKt.VIDEO_BLOCK_SIZE /* 16 */:
            case 20:
            default:
                Set setA = pVar.a(N2.s.a(C0614a.class));
                g3.c cVar = g3.c.f6463m;
                if (cVar == null) {
                    synchronized (g3.c.class) {
                        try {
                            cVar = g3.c.f6463m;
                            if (cVar == null) {
                                cVar = new g3.c(0);
                                g3.c.f6463m = cVar;
                            }
                        } finally {
                        }
                        break;
                    }
                }
                return new C0615b(setA, cVar);
            case 17:
                return TransportRegistrar.lambda$getComponents$0(pVar);
            case 18:
                return TransportRegistrar.lambda$getComponents$1(pVar);
            case 19:
                return TransportRegistrar.lambda$getComponents$2(pVar);
            case Build.API_LEVELS.API_21 /* 21 */:
                return FirebaseInstallationsRegistrar.lambda$getComponents$0(pVar);
        }
    }

    @Override // P1.d
    public void h(Exception exc) {
        System.out.println((Object) ("integrityToken Error:=" + exc));
    }

    @Override // io.flutter.util.ViewUtils.ViewVisitor
    public boolean run(View view) {
        return view.hasFocus();
    }
}
