Don't use setUnlockedDeviceRequired() on the backup key

as importing it with Android 12 GSI fails. This key is only used to restore old backups anyway and the new one doesn't use this restriction.
This commit is contained in:
Torsten Grote 2021-10-08 08:14:56 -03:00 committed by Chirayu Desai
parent 3e87394da2
commit 04536de211

View file

@ -100,7 +100,9 @@ internal class KeyManagerImpl(
.setEncryptionPaddings(ENCRYPTION_PADDING_NONE) .setEncryptionPaddings(ENCRYPTION_PADDING_NONE)
.setRandomizedEncryptionRequired(true) .setRandomizedEncryptionRequired(true)
// unlocking is required only for decryption, so when restoring from backup // unlocking is required only for decryption, so when restoring from backup
builder.setUnlockedDeviceRequired(true) // FIXME disabled for Android 12 GSI as it crashes when importing the key
// KeyStoreException: Failed to import secret key.
// builder.setUnlockedDeviceRequired(true)
return builder.build() return builder.build()
} }