package o;

import android.content.SharedPreferences;
import android.text.TextUtils;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.uu0, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public abstract class AbstractC2667uu0 {
    public static final H10 a;

    static {
        LG lg = PG.m;
        Object[] objArr = new Object[24];
        objArr[0] = "Version";
        objArr[1] = "GoogleConsent";
        objArr[2] = "VendorConsent";
        objArr[3] = "VendorLegitimateInterest";
        objArr[4] = "gdprApplies";
        objArr[5] = "EnableAdvertiserConsentMode";
        objArr[6] = "PolicyVersion";
        objArr[7] = "PurposeConsents";
        objArr[8] = "PurposeOneTreatment";
        objArr[9] = "Purpose1";
        objArr[10] = "Purpose3";
        objArr[11] = "Purpose4";
        System.arraycopy(new String[]{"Purpose7", "CmpSdkID", "PublisherCC", "PublisherRestrictions1", "PublisherRestrictions3", "PublisherRestrictions4", "PublisherRestrictions7", "AuthorizePurpose1", "AuthorizePurpose3", "AuthorizePurpose4", "AuthorizePurpose7", "PurposeDiagnostics"}, 0, objArr, 12, 12);
        AbstractC2461sm0.c(24, objArr);
        a = PG.f(24, objArr);
    }

    public static String a(SharedPreferences sharedPreferences, String str) {
        try {
            return sharedPreferences.getString(str, "");
        } catch (ClassCastException unused) {
            return "";
        }
    }

    public static final boolean b(Ls0 ls0, M10 m10, M10 m102, Q80 q80, char[] cArr, int i, int i2, int i3, String str, String str2, String str3, boolean z, boolean z2) {
        EnumC2572tu0 enumC2572tu0;
        char c;
        int iC = c(ls0);
        if (iC > 0 && (i2 != 1 || i != 1)) {
            cArr[iC] = '2';
        }
        if (g(ls0, m102) == Ms0.m) {
            c = '3';
        } else {
            if (ls0 == Ls0.m && i3 == 1 && q80.f294o.equals(str)) {
                if (iC > 0 && cArr[iC] != '2') {
                    cArr[iC] = '1';
                }
                return true;
            }
            if (m10.containsKey(ls0) && (enumC2572tu0 = (EnumC2572tu0) m10.get(ls0)) != null) {
                int iOrdinal = enumC2572tu0.ordinal();
                Ms0 ms0 = Ms0.f245o;
                if (iOrdinal != 0) {
                    Ms0 ms02 = Ms0.n;
                    if (iOrdinal != 1) {
                        if (iOrdinal == 2) {
                            return g(ls0, m102) == ms0 ? f(ls0, cArr, str3, z2) : e(ls0, cArr, str2, z);
                        }
                        if (iOrdinal == 3) {
                            return g(ls0, m102) == ms02 ? e(ls0, cArr, str2, z) : f(ls0, cArr, str3, z2);
                        }
                        c = '0';
                    } else if (g(ls0, m102) != ms02) {
                        return f(ls0, cArr, str3, z2);
                    }
                } else if (g(ls0, m102) != ms0) {
                    return e(ls0, cArr, str2, z);
                }
                c = '8';
            } else {
                c = '0';
            }
        }
        if (iC <= 0 || cArr[iC] == '2') {
            return false;
        }
        cArr[iC] = c;
        return false;
    }

    public static final int c(Ls0 ls0) {
        if (ls0 == Ls0.m) {
            return 1;
        }
        if (ls0 == Ls0.f216o) {
            return 2;
        }
        if (ls0 == Ls0.p) {
            return 3;
        }
        return ls0 == Ls0.q ? 4 : -1;
    }

    public static final String d(Ls0 ls0, String str, String str2) {
        String strValueOf = "0";
        String strValueOf2 = (TextUtils.isEmpty(str) || str.length() < ls0.zza()) ? "0" : String.valueOf(str.charAt(ls0.zza() - 1));
        if (!TextUtils.isEmpty(str2) && str2.length() >= ls0.zza()) {
            strValueOf = String.valueOf(str2.charAt(ls0.zza() - 1));
        }
        return String.valueOf(strValueOf2).concat(String.valueOf(strValueOf));
    }

    public static final boolean e(Ls0 ls0, char[] cArr, String str, boolean z) {
        char c;
        int iC = c(ls0);
        if (!z) {
            c = '4';
        } else {
            if (str.length() >= ls0.zza()) {
                char cCharAt = str.charAt(ls0.zza() - 1);
                boolean z2 = cCharAt == '1';
                if (iC > 0 && cArr[iC] != '2') {
                    cArr[iC] = cCharAt != '1' ? '6' : '1';
                }
                return z2;
            }
            c = '0';
        }
        if (iC > 0 && cArr[iC] != '2') {
            cArr[iC] = c;
        }
        return false;
    }

    public static final boolean f(Ls0 ls0, char[] cArr, String str, boolean z) {
        char c;
        int iC = c(ls0);
        if (!z) {
            c = '5';
        } else {
            if (str.length() >= ls0.zza()) {
                char cCharAt = str.charAt(ls0.zza() - 1);
                boolean z2 = cCharAt == '1';
                if (iC > 0 && cArr[iC] != '2') {
                    cArr[iC] = cCharAt != '1' ? '7' : '1';
                }
                return z2;
            }
            c = '0';
        }
        if (iC > 0 && cArr[iC] != '2') {
            cArr[iC] = c;
        }
        return false;
    }

    public static final Ms0 g(Ls0 ls0, M10 m10) {
        Object obj = m10.get(ls0);
        if (obj == null) {
            obj = Ms0.p;
        }
        return (Ms0) obj;
    }
}
