Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class DeviceIdBootable(private val context: Context) : Bootable() {
- override val key = Keys.DEVICE_ID
- override val isCritical = true
- override fun boot() {
- val preferences = PreferenceManager.getDefaultSharedPreferences(context)
- if (!preferences.contains("device_id")) {
- preferences
- .edit()
- .putString("device_id", UUID.randomUUID().toString())
- .apply()
- }
- }
- }
Add Comment
Please, Sign In to add comment