package p138.p176.p278.p279.p290;

import java.security.GeneralSecurityException;
import java.security.KeyFactory;
import java.security.KeyPairGenerator;
import java.security.MessageDigest;
import java.security.Provider;
import java.security.Security;
import java.security.Signature;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;
import javax.crypto.Cipher;
import javax.crypto.Mac;
import p138.p176.p177.p242.p246.p251.C4303;
import p138.p176.p278.p279.p290.InterfaceC5535;

/* JADX INFO: renamed from: ދ.ހ.ހ.֏.ޞ.ޘ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes.dex */
public final class C5534<T_WRAPPER extends InterfaceC5535<T_ENGINE>, T_ENGINE> {

    /* JADX INFO: renamed from: ށ, reason: contains not printable characters */
    public static final Logger f15931 = Logger.getLogger(C5534.class.getName());

    /* JADX INFO: renamed from: ނ, reason: contains not printable characters */
    public static final List<Provider> f15932;

    /* JADX INFO: renamed from: ރ, reason: contains not printable characters */
    public static final C5534<InterfaceC5535.C5536, Cipher> f15933;

    /* JADX INFO: renamed from: ބ, reason: contains not printable characters */
    public static final C5534<InterfaceC5535.C5540, Mac> f15934;

    /* JADX INFO: renamed from: ޅ, reason: contains not printable characters */
    public static final C5534<InterfaceC5535.C5542, Signature> f15935;

    /* JADX INFO: renamed from: ކ, reason: contains not printable characters */
    public static final C5534<InterfaceC5535.C5541, MessageDigest> f15936;

    /* JADX INFO: renamed from: އ, reason: contains not printable characters */
    public static final C5534<InterfaceC5535.C5539, KeyPairGenerator> f15937;

    /* JADX INFO: renamed from: ވ, reason: contains not printable characters */
    public static final C5534<InterfaceC5535.C5538, KeyFactory> f15938;

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public T_WRAPPER f15939;

    /* JADX INFO: renamed from: ؠ, reason: contains not printable characters */
    public List<Provider> f15940 = f15932;

    /* JADX INFO: renamed from: ހ, reason: contains not printable characters */
    public boolean f15941 = true;

    static {
        if (C4303.m7167()) {
            String[] strArr = {"GmsCore_OpenSSL", "AndroidOpenSSL"};
            ArrayList arrayList = new ArrayList();
            for (int i = 0; i < 2; i++) {
                String str = strArr[i];
                Provider provider = Security.getProvider(str);
                if (provider != null) {
                    arrayList.add(provider);
                } else {
                    f15931.info(String.format("Provider %s not available", str));
                }
            }
            f15932 = arrayList;
        } else {
            f15932 = new ArrayList();
        }
        f15933 = new C5534<>(new InterfaceC5535.C5536());
        f15934 = new C5534<>(new InterfaceC5535.C5540());
        f15935 = new C5534<>(new InterfaceC5535.C5542());
        f15936 = new C5534<>(new InterfaceC5535.C5541());
        new C5534(new InterfaceC5535.C5537());
        f15937 = new C5534<>(new InterfaceC5535.C5539());
        f15938 = new C5534<>(new InterfaceC5535.C5538());
    }

    public C5534(T_WRAPPER t_wrapper) {
        this.f15939 = t_wrapper;
    }

    /* JADX INFO: renamed from: ֏, reason: contains not printable characters */
    public T_ENGINE m8904(String str) {
        Iterator<Provider> it = this.f15940.iterator();
        Exception exc = null;
        while (it.hasNext()) {
            try {
                return (T_ENGINE) this.f15939.mo8905(str, it.next());
            } catch (Exception e) {
                if (exc == null) {
                    exc = e;
                }
            }
        }
        if (this.f15941) {
            return (T_ENGINE) this.f15939.mo8905(str, null);
        }
        throw new GeneralSecurityException("No good Provider found.", exc);
    }
}
