新增XSPUtils类

This commit is contained in:
LittleTurtle2333
2022-02-22 17:03:30 +08:00
parent 56f7284dc4
commit fd0335e763

View File

@@ -0,0 +1,18 @@
package com.lt2333.simplicitytools.util
import com.lt2333.simplicitytools.BuildConfig
import de.robv.android.xposed.XSharedPreferences
object XSPUtils {
var prefs = XSharedPreferences(BuildConfig.APPLICATION_ID, "config")
fun getBoolean(key: String, defValue: Boolean): Boolean {
if (prefs.hasFileChanged()) {
prefs.reload()
}
return prefs.getBoolean(key, defValue)
}
}