package com.it_nomads.fluttersecurestorage.ciphers;

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import java.util.Map;

/* JADX INFO: loaded from: classes.dex */
public final class e {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final KeyCipherAlgorithm f24555a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final StorageCipherAlgorithm f24556b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final KeyCipherAlgorithm f24557c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final StorageCipherAlgorithm f24558d;

    public e(SharedPreferences sharedPreferences, Map map) {
        this.f24555a = KeyCipherAlgorithm.valueOf(sharedPreferences.getString("FlutterSecureSAlgorithmKey", "RSA_ECB_PKCS1Padding"));
        this.f24556b = StorageCipherAlgorithm.valueOf(sharedPreferences.getString("FlutterSecureSAlgorithmStorage", "AES_CBC_PKCS7Padding"));
        Object obj = map.get("keyCipherAlgorithm");
        KeyCipherAlgorithm keyCipherAlgorithmValueOf = KeyCipherAlgorithm.valueOf(obj != null ? obj.toString() : "RSA_ECB_PKCS1Padding");
        int i10 = keyCipherAlgorithmValueOf.minVersionCode;
        int i11 = Build.VERSION.SDK_INT;
        this.f24557c = i10 > i11 ? KeyCipherAlgorithm.RSA_ECB_PKCS1Padding : keyCipherAlgorithmValueOf;
        Object obj2 = map.get("storageCipherAlgorithm");
        StorageCipherAlgorithm storageCipherAlgorithmValueOf = StorageCipherAlgorithm.valueOf(obj2 != null ? obj2.toString() : "AES_CBC_PKCS7Padding");
        this.f24558d = storageCipherAlgorithmValueOf.minVersionCode > i11 ? StorageCipherAlgorithm.AES_CBC_PKCS7Padding : storageCipherAlgorithmValueOf;
    }

    public final d a(Context context) {
        b bVar;
        switch (((oa.a) this.f24557c.keyCipher).f31443a) {
            case 26:
                bVar = new b(context);
                break;
            default:
                bVar = new c(context);
                break;
        }
        switch (((oa.a) this.f24558d.storageCipher).f31443a) {
            case 28:
                return new d(context, bVar);
            default:
                return new g(context, bVar);
        }
    }

    public final d b(Context context) {
        b bVar;
        switch (((oa.a) this.f24555a.keyCipher).f31443a) {
            case 26:
                bVar = new b(context);
                break;
            default:
                bVar = new c(context);
                break;
        }
        switch (((oa.a) this.f24556b.storageCipher).f31443a) {
            case 28:
                return new d(context, bVar);
            default:
                return new g(context, bVar);
        }
    }
}
