package cn.org.bjca.trust.push.common

import android.content.Context
import android.content.SharedPreferences

object SharedPreferencesHelper {
    private lateinit var preferences: SharedPreferences
    fun getPreferences(context: Context): SharedPreferences {
        if (!::preferences.isInitialized) {
            preferences = context.getSharedPreferences("CookiePersistence", Context.MODE_PRIVATE)
        }
        return preferences
    }

    fun getPreferences(): SharedPreferences {
        if (!::preferences.isInitialized) {
            throw  Throwable("未初始化")
        }
        return preferences
    }
}