From a0a8200393671f92d7d587750d01cf7915f4d2b8 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Tue, 21 Dec 2021 01:37:18 +0530 Subject: [PATCH] app: integrate diceware UI --- .../dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt | 4 ++++ .../dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt | 4 ++++ app/src/main/res/values/arrays.xml | 2 ++ 3 files changed, 10 insertions(+) diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt index b1c66a0a..1b23dc0a 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivity.kt @@ -42,6 +42,7 @@ import dev.msfjarvis.aps.R import dev.msfjarvis.aps.data.passfile.PasswordEntry import dev.msfjarvis.aps.data.repo.PasswordRepository import dev.msfjarvis.aps.databinding.PasswordCreationActivityBinding +import dev.msfjarvis.aps.ui.dialogs.DicewarePasswordGeneratorDialogFragment import dev.msfjarvis.aps.ui.dialogs.OtpImportDialogFragment import dev.msfjarvis.aps.ui.dialogs.PasswordGeneratorDialogFragment import dev.msfjarvis.aps.util.autofill.AutofillPreferences @@ -360,6 +361,8 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB when (settings.getString(PreferenceKeys.PREF_KEY_PWGEN_TYPE) ?: KEY_PWGEN_TYPE_CLASSIC) { KEY_PWGEN_TYPE_CLASSIC -> PasswordGeneratorDialogFragment().show(supportFragmentManager, "generator") + KEY_PWGEN_TYPE_DICEWARE -> + DicewarePasswordGeneratorDialogFragment().show(supportFragmentManager, "generator") } } @@ -591,6 +594,7 @@ class PasswordCreationActivity : BasePgpActivity(), OpenPgpServiceConnection.OnB companion object { private const val KEY_PWGEN_TYPE_CLASSIC = "classic" + private const val KEY_PWGEN_TYPE_DICEWARE = "diceware" const val PASSWORD_RESULT_REQUEST_KEY = "PASSWORD_GENERATOR" const val OTP_RESULT_REQUEST_KEY = "OTP_IMPORT" const val RESULT = "RESULT" diff --git a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt index 3aa24a9f..7bea5e49 100644 --- a/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt +++ b/app/src/main/java/dev/msfjarvis/aps/ui/crypto/PasswordCreationActivityV2.kt @@ -39,6 +39,7 @@ import dev.msfjarvis.aps.R import dev.msfjarvis.aps.data.passfile.PasswordEntry import dev.msfjarvis.aps.databinding.PasswordCreationActivityBinding import dev.msfjarvis.aps.injection.crypto.CryptoSet +import dev.msfjarvis.aps.ui.dialogs.DicewarePasswordGeneratorDialogFragment import dev.msfjarvis.aps.ui.dialogs.OtpImportDialogFragment import dev.msfjarvis.aps.ui.dialogs.PasswordGeneratorDialogFragment import dev.msfjarvis.aps.util.autofill.AutofillPreferences @@ -290,6 +291,8 @@ class PasswordCreationActivityV2 : BasePgpActivity() { when (settings.getString(PreferenceKeys.PREF_KEY_PWGEN_TYPE) ?: KEY_PWGEN_TYPE_CLASSIC) { KEY_PWGEN_TYPE_CLASSIC -> PasswordGeneratorDialogFragment().show(supportFragmentManager, "generator") + KEY_PWGEN_TYPE_DICEWARE -> + DicewarePasswordGeneratorDialogFragment().show(supportFragmentManager, "generator") } } @@ -466,6 +469,7 @@ class PasswordCreationActivityV2 : BasePgpActivity() { companion object { private const val KEY_PWGEN_TYPE_CLASSIC = "classic" + private const val KEY_PWGEN_TYPE_DICEWARE = "diceware" const val PASSWORD_RESULT_REQUEST_KEY = "PASSWORD_GENERATOR" const val OTP_RESULT_REQUEST_KEY = "OTP_IMPORT" const val RESULT = "RESULT" diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 63a8bef5..3c1568d6 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -24,9 +24,11 @@ Classic + Diceware classic + diceware work/example.org(.gpg)