From 75d4c7d05cc7356c923c7eb830a64448e5aed1f6 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Fri, 8 Oct 2021 08:14:56 -0300 Subject: [PATCH] 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. --- .../main/java/com/stevesoltys/seedvault/crypto/KeyManager.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/stevesoltys/seedvault/crypto/KeyManager.kt b/app/src/main/java/com/stevesoltys/seedvault/crypto/KeyManager.kt index 794e1529..eded4cef 100644 --- a/app/src/main/java/com/stevesoltys/seedvault/crypto/KeyManager.kt +++ b/app/src/main/java/com/stevesoltys/seedvault/crypto/KeyManager.kt @@ -100,7 +100,9 @@ internal class KeyManagerImpl( .setEncryptionPaddings(ENCRYPTION_PADDING_NONE) .setRandomizedEncryptionRequired(true) // 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() }