package com.vinfast.companion.core.base.storage;

/* JADX INFO: compiled from: r8-map-id-ae6aab8d9a1033945587ffdd1bc6222159522c1d66e66a2c4cecb065134dd0a6 */
/* JADX INFO: loaded from: E:\ios\vf_dex\classes15.dex */
@kotlin.Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0010\u001a\u0011\u0010\u0002\u001a\u00020\u0001*\u00020\u0000¢\u0006\u0004\b\u0002\u0010\u0003\u001a\u0019\u0010\u0007\u001a\u00020\u0006*\u00020\u00002\u0006\u0010\u0005\u001a\u00020\u0004¢\u0006\u0004\b\u0007\u0010\b\u001a\u0019\u0010\t\u001a\u00020\u0001*\u00020\u00002\u0006\u0010\u0005\u001a\u00020\u0004¢\u0006\u0004\b\t\u0010\n\u001a\u001b\u0010\f\u001a\u0004\u0018\u00010\u0004*\u00020\u00002\u0006\u0010\u000b\u001a\u00020\u0004¢\u0006\u0004\b\f\u0010\r\u001a!\u0010\u000f\u001a\u00020\u0001*\u00020\u00002\u0006\u0010\u000b\u001a\u00020\u00042\u0006\u0010\u000e\u001a\u00020\u0004¢\u0006\u0004\b\u000f\u0010\u0010\u001a!\u0010\u0013\u001a\u00020\u0001*\u00020\u00002\u0006\u0010\u0011\u001a\u00020\u00042\u0006\u0010\u0012\u001a\u00020\u0006¢\u0006\u0004\b\u0013\u0010\u0014\u001a\u0019\u0010\u0015\u001a\u00020\u0006*\u00020\u00002\u0006\u0010\u0011\u001a\u00020\u0004¢\u0006\u0004\b\u0015\u0010\b¨\u0006\u0016"}, d2 = {"Lcom/vinfast/companion/core/base/storage/AppSharedPreference;", "", "d", "(Lcom/vinfast/companion/core/base/storage/AppSharedPreference;)V", "", "permission", "", "c", "(Lcom/vinfast/companion/core/base/storage/AppSharedPreference;Ljava/lang/String;)Z", "f", "(Lcom/vinfast/companion/core/base/storage/AppSharedPreference;Ljava/lang/String;)V", "vincode", "b", "(Lcom/vinfast/companion/core/base/storage/AppSharedPreference;Ljava/lang/String;)Ljava/lang/String;", "sid", "g", "(Lcom/vinfast/companion/core/base/storage/AppSharedPreference;Ljava/lang/String;Ljava/lang/String;)V", "vinCode", "value", "e", "(Lcom/vinfast/companion/core/base/storage/AppSharedPreference;Ljava/lang/String;Z)V", "a", "core_release"}, k = 2, mv = {2, 2, 0}, xi = 48)
@kotlin.jvm.internal.SourceDebugExtension
public final class PrefExtensionKt {
    public static final boolean a(com.vinfast.companion.core.base.storage.AppSharedPreference appSharedPreference, java.lang.String str) {
        kotlin.jvm.internal.Intrinsics.l(appSharedPreference, "<this>");
        kotlin.jvm.internal.Intrinsics.l(str, "vinCode");
        return com.vinfast.companion.core.base.storage.AppSharedPreference.f(appSharedPreference, "VEHICLE_PRIVACY_POLICY_" + com.vinfast.companion.core.base.storage.AppSharedPreference.l(appSharedPreference, "current_user_email", null, 2, null) + "_" + str, false, 2, null);
    }

    public static final java.lang.String b(com.vinfast.companion.core.base.storage.AppSharedPreference appSharedPreference, java.lang.String str) {
        kotlin.jvm.internal.Intrinsics.l(appSharedPreference, "<this>");
        kotlin.jvm.internal.Intrinsics.l(str, "vincode");
        java.lang.String strL = com.vinfast.companion.core.base.storage.AppSharedPreference.l(appSharedPreference, "hashmap_vincode_sid", null, 2, null);
        java.lang.reflect.Type type = new com.google.gson.reflect.TypeToken<java.util.HashMap<java.lang.String, java.lang.String>>() { // from class: com.vinfast.companion.core.base.storage.PrefExtensionKt$getSIDFromVicode$type$1
        }.getType();
        kotlin.jvm.internal.Intrinsics.k(type, "getType(...)");
        if (strL == null) {
            return null;
        }
        java.lang.Object objFromJson = new com.google.gson.Gson().fromJson(strL, type);
        kotlin.jvm.internal.Intrinsics.k(objFromJson, "fromJson(...)");
        return (java.lang.String) ((java.util.HashMap) objFromJson).get(str);
    }

    public static final boolean c(com.vinfast.companion.core.base.storage.AppSharedPreference appSharedPreference, java.lang.String str) {
        kotlin.jvm.internal.Intrinsics.l(appSharedPreference, "<this>");
        kotlin.jvm.internal.Intrinsics.l(str, "permission");
        return appSharedPreference.e("permission_requested_" + str, false);
    }

    public static final void d(com.vinfast.companion.core.base.storage.AppSharedPreference appSharedPreference) {
        kotlin.jvm.internal.Intrinsics.l(appSharedPreference, "<this>");
        appSharedPreference.s("failed_login_count", 0);
        appSharedPreference.s("login_block_start_time", 0L);
    }

    public static final void e(com.vinfast.companion.core.base.storage.AppSharedPreference appSharedPreference, java.lang.String str, boolean z) {
        kotlin.jvm.internal.Intrinsics.l(appSharedPreference, "<this>");
        kotlin.jvm.internal.Intrinsics.l(str, "vinCode");
        appSharedPreference.s("VEHICLE_PRIVACY_POLICY_" + com.vinfast.companion.core.base.storage.AppSharedPreference.l(appSharedPreference, "current_user_email", null, 2, null) + "_" + str, java.lang.Boolean.valueOf(z));
    }

    public static final void f(com.vinfast.companion.core.base.storage.AppSharedPreference appSharedPreference, java.lang.String str) {
        kotlin.jvm.internal.Intrinsics.l(appSharedPreference, "<this>");
        kotlin.jvm.internal.Intrinsics.l(str, "permission");
        appSharedPreference.n("permission_requested_" + str, true);
    }

    public static final void g(com.vinfast.companion.core.base.storage.AppSharedPreference appSharedPreference, java.lang.String str, java.lang.String str2) {
        kotlin.jvm.internal.Intrinsics.l(appSharedPreference, "<this>");
        kotlin.jvm.internal.Intrinsics.l(str, "vincode");
        kotlin.jvm.internal.Intrinsics.l(str2, "sid");
        java.lang.String strL = com.vinfast.companion.core.base.storage.AppSharedPreference.l(appSharedPreference, "hashmap_vincode_sid", null, 2, null);
        java.lang.reflect.Type type = new com.google.gson.reflect.TypeToken<java.util.HashMap<java.lang.String, java.lang.String>>() { // from class: com.vinfast.companion.core.base.storage.PrefExtensionKt$setSIDOfVicode$type$1
        }.getType();
        kotlin.jvm.internal.Intrinsics.k(type, "getType(...)");
        java.lang.Object map = new java.util.HashMap();
        if (strL != null) {
            map = new com.google.gson.Gson().fromJson(strL, type);
            kotlin.jvm.internal.Intrinsics.k(map, "fromJson(...)");
        }
        ((java.util.Map) map).put(str, str2);
        appSharedPreference.s("hashmap_vincode_sid", new com.google.gson.Gson().toJson(map));
    }
}
