瀏覽代碼

@Suppress "TooGenericExceptionCaught", "TooGenericExceptionThrown" detekt issues

Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
Andy Scherzinger 1 年之前
父節點
當前提交
10b08341bb
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      app/src/main/java/com/owncloud/android/ui/dialog/SetupEncryptionDialogFragment.kt

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