From aff1cc1cc32c7459b47a60808402f96be7adc6c2 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 8 Jun 2017 20:37:44 -0400 Subject: [PATCH] fallback to "old" KeyStoreStorageService --- src/Android/MainApplication.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/Android/MainApplication.cs b/src/Android/MainApplication.cs index 7760ea90e..0ebeacf3c 100644 --- a/src/Android/MainApplication.cs +++ b/src/Android/MainApplication.cs @@ -207,10 +207,23 @@ namespace Bit.Android container.RegisterSingleton(application.ApplicationContext); container.RegisterSingleton(application); + // Secure Storage + ISecureStorageService secureStorage; + try + { + secureStorage = new KeyStoreBackedStorageService(CrossSettings.Current); + } + catch + { + // Some isolated devices are having a hard time generating RSA keys for key store. + // Continue using the "old" keystore implementation for now. + secureStorage = new KeyStoreStorageService(new char[] { }); + } + // Services container.RegisterSingleton(); container.RegisterSingleton(); - container.RegisterSingleton(); + container.RegisterSingleton(secureStorage); container.RegisterSingleton(); container.RegisterSingleton(); container.RegisterSingleton();