package io.flutter.plugins.sharedpreferences;

import android.content.Context;
import java.io.IOException;
import java.util.List;
import java.util.Set;
import kotlin.jvm.internal.PropertyReference1Impl;

/* JADX INFO: loaded from: classes.dex */
public abstract class t {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public static final /* synthetic */ yd.g[] f28314a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static final androidx.datastore.preferences.b f28315b;

    static {
        PropertyReference1Impl propertyReference1Impl = new PropertyReference1Impl(t.class, "sharedPreferencesDataStore", "getSharedPreferencesDataStore(Landroid/content/Context;)Landroidx/datastore/core/DataStore;", 1);
        kotlin.jvm.internal.g.f29240a.getClass();
        f28314a = new yd.g[]{propertyReference1Impl};
        f28315b = androidx.datastore.preferences.a.a();
    }

    public static final androidx.datastore.core.h a(Context context) {
        return (androidx.datastore.core.h) f28315b.a(context, f28314a[0]);
    }

    public static final boolean b(String str, Object obj, Set set) {
        nb.g.i(str, "key");
        return set == null ? (obj instanceof Boolean) || (obj instanceof Long) || (obj instanceof String) || (obj instanceof Double) : set.contains(str);
    }

    public static final Object c(Object obj, i iVar) throws ClassNotFoundException, IOException {
        nb.g.i(iVar, "listEncoder");
        if (!(obj instanceof String)) {
            return obj;
        }
        String str = (String) obj;
        if (!kotlin.text.h.j0(str, "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBhIGxpc3Qu", false)) {
            if (!kotlin.text.h.j0(str, "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBEb3VibGUu", false)) {
                return obj;
            }
            String strSubstring = str.substring(40);
            nb.g.h(strSubstring, "this as java.lang.String).substring(startIndex)");
            return Double.valueOf(Double.parseDouble(strSubstring));
        }
        if (kotlin.text.h.j0(str, "VGhpcyBpcyB0aGUgcHJlZml4IGZvciBhIGxpc3Qu!", false)) {
            return obj;
        }
        String strSubstring2 = str.substring(40);
        nb.g.h(strSubstring2, "this as java.lang.String).substring(startIndex)");
        List listA = ((androidx.datastore.preferences.protobuf.h) iVar).a(strSubstring2);
        nb.g.f(listA);
        return listA;
    }
}
