package J0;

import android.os.Looper;
import android.view.Choreographer;
import java.security.GeneralSecurityException;
import java.security.SecureRandom;
import java.util.Random;
import javax.crypto.Cipher;

/* JADX INFO: renamed from: J0.a0, reason: case insensitive filesystem */
/* JADX INFO: loaded from: classes.dex */
public final class C0343a0 extends ThreadLocal {

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

    public /* synthetic */ C0343a0(int i6) {
        this.f2976a = i6;
    }

    @Override // java.lang.ThreadLocal
    public final Object initialValue() {
        switch (this.f2976a) {
            case 0:
                Choreographer choreographer = Choreographer.getInstance();
                Looper looperMyLooper = Looper.myLooper();
                if (looperMyLooper == null) {
                    throw new IllegalStateException("no Looper on this thread");
                }
                C0349c0 c0349c0 = new C0349c0(choreographer, A4.g.A(looperMyLooper));
                return c0349c0.plus(c0349c0.f2996n);
            case 1:
                try {
                    return (Cipher) Y3.o.f8838b.f8841a.a("AES/GCM/NoPadding");
                } catch (GeneralSecurityException e6) {
                    throw new IllegalStateException(e6);
                }
            case 2:
                return new Random();
            case 3:
                try {
                    return (Cipher) Y3.o.f8838b.f8841a.a("AES/GCM-SIV/NoPadding");
                } catch (GeneralSecurityException e7) {
                    throw new IllegalStateException(e7);
                }
            case 4:
                try {
                    return (Cipher) Y3.o.f8838b.f8841a.a("AES/CTR/NoPadding");
                } catch (GeneralSecurityException e8) {
                    throw new IllegalStateException(e8);
                }
            case 5:
                try {
                    return (Cipher) Y3.o.f8838b.f8841a.a("AES/ECB/NOPADDING");
                } catch (GeneralSecurityException e9) {
                    throw new IllegalStateException(e9);
                }
            case 6:
                try {
                    return (Cipher) Y3.o.f8838b.f8841a.a("AES/CTR/NOPADDING");
                } catch (GeneralSecurityException e10) {
                    throw new IllegalStateException(e10);
                }
            default:
                SecureRandom secureRandom = new SecureRandom();
                secureRandom.nextLong();
                return secureRandom;
        }
    }
}
