Sfoglia il codice sorgente

@Suppress "TooGenericExceptionCaught", "TooGenericExceptionThrown" detekt issues

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 1 anno fa
parent
commit
10b08341bb

+ 3 - 1
app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.kt

@@ -171,6 +171,7 @@ class SetupEncryptionDialogFragment : DialogFragment(), Injectable {
         }
         }
     }
     }
 
 
+    @Suppress("TooGenericExceptionCaught", "TooGenericExceptionThrown")
     private fun decryptPrivateKey(dialog: DialogInterface) {
     private fun decryptPrivateKey(dialog: DialogInterface) {
         Log_OC.d(TAG, "Decrypt private key")
         Log_OC.d(TAG, "Decrypt private key")
         binding.encryptionStatus.setText(R.string.end_to_end_encryption_decrypting)
         binding.encryptionStatus.setText(R.string.end_to_end_encryption_decrypting)
@@ -348,7 +349,7 @@ class SetupEncryptionDialogFragment : DialogFragment(), Injectable {
                 // first show info
                 // first show info
                 try {
                 try {
                     if (keyWords == null || keyWords!!.isEmpty()) {
                     if (keyWords == null || keyWords!!.isEmpty()) {
-                        keyWords = EncryptionUtils.getRandomWords(12, context)
+                        keyWords = EncryptionUtils.getRandomWords(NUMBER_OF_WORDS, context)
                     }
                     }
                     showMnemonicInfo()
                     showMnemonicInfo()
                 } catch (e: IOException) {
                 } catch (e: IOException) {
@@ -534,6 +535,7 @@ class SetupEncryptionDialogFragment : DialogFragment(), Injectable {
         const val ARG_POSITION = "ARG_POSITION"
         const val ARG_POSITION = "ARG_POSITION"
         const val RESULT_REQUEST_KEY = "RESULT_REQUEST"
         const val RESULT_REQUEST_KEY = "RESULT_REQUEST"
         const val RESULT_KEY_CANCELLED = "IS_CANCELLED"
         const val RESULT_KEY_CANCELLED = "IS_CANCELLED"
+        private const val NUMBER_OF_WORDS = 12
         private const val ARG_USER = "ARG_USER"
         private const val ARG_USER = "ARG_USER"
         private val TAG = SetupEncryptionDialogFragment::class.java.simpleName
         private val TAG = SetupEncryptionDialogFragment::class.java.simpleName
         private const val KEY_CREATED = "KEY_CREATED"
         private const val KEY_CREATED = "KEY_CREATED"