mirror of
https://github.com/LittleTurtle2333/SimplicityTools.git
synced 2026-07-12 11:21:18 +08:00
新增XSPUtils类
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user