Regenerate device ID if the stored ID is not valid

This commit is contained in:
Albert Vaca Cintora
2025-04-05 00:02:22 +02:00
parent e10f2496de
commit 28070954a6

View File

@@ -129,8 +129,8 @@ object DeviceHelper {
fun initializeDeviceId(context: Context) {
val preferences = PreferenceManager.getDefaultSharedPreferences(context)
val preferenceKeys: Set<String> = preferences.all.keys
if (preferenceKeys.contains(KEY_DEVICE_ID_PREFERENCE)) {
val deviceId = preferences.getString(KEY_DEVICE_ID_PREFERENCE, "")!!
if (DeviceInfo.isValidDeviceId(deviceId)) {
return // We already have an ID
}
@SuppressLint("HardwareIds")