From 98e9f6734a00cfb1d8164227b2de07d2aea150d2 Mon Sep 17 00:00:00 2001 From: Harsh Shandilya Date: Sat, 21 Mar 2020 12:14:13 +0000 Subject: Revise copy (#656) Signed-off-by: Harsh Shandilya --- app/src/main/AndroidManifest.xml | 3 +- .../main/java/com/zeapo/pwdstore/UserPreference.kt | 37 +-- app/src/main/res/values-ar/strings.xml | 2 +- app/src/main/res/values-cs/strings.xml | 3 +- app/src/main/res/values-de/strings.xml | 3 +- app/src/main/res/values-es/strings.xml | 3 +- app/src/main/res/values-fr/strings.xml | 3 +- app/src/main/res/values-ja/strings.xml | 3 +- app/src/main/res/values-ru/strings.xml | 3 +- app/src/main/res/values-zh-rCN/strings.xml | 3 +- app/src/main/res/values-zh-rTW/strings.xml | 3 +- app/src/main/res/values/arrays.xml | 6 +- app/src/main/res/values/strings.xml | 40 ++-- app/src/main/res/xml/preference.xml | 251 +++++++++++---------- 14 files changed, 183 insertions(+), 180 deletions(-) (limited to 'app') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 75f0752a..8e05d5b8 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -43,7 +43,8 @@ + android:parentActivityName=".PasswordStore" + android:label="@string/action_settings" /> diff --git a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt index 2a8f584d..8667110a 100644 --- a/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt +++ b/app/src/main/java/com/zeapo/pwdstore/UserPreference.kt @@ -60,7 +60,7 @@ class UserPreference : AppCompatActivity() { class PrefsFragment : PreferenceFragmentCompat() { private var autofillDependencies = listOf() - private var autoFillEnablePreference: CheckBoxPreference? = null + private var autoFillEnablePreference: SwitchPreferenceCompat? = null private lateinit var callingActivity: UserPreference override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { @@ -87,6 +87,7 @@ class UserPreference : AppCompatActivity() { val keyPreference = findPreference("openpgp_key_id_pref") // General preferences + val showTimePreference = findPreference("general_show_time") val clearAfterCopyPreference = findPreference("clear_after_copy") val clearClipboard20xPreference = findPreference("clear_clipboard_20x") @@ -115,7 +116,7 @@ class UserPreference : AppCompatActivity() { clearAfterCopyPreference?.isVisible = sharedPreferences.getString("general_show_time", "45")?.toInt() != 0 clearClipboard20xPreference?.isVisible = sharedPreferences.getString("general_show_time", "45")?.toInt() != 0 val selectedKeys = (sharedPreferences.getStringSet("openpgp_key_ids_set", null) - ?: HashSet()).toTypedArray() + ?: HashSet()).toTypedArray() keyPreference?.summary = if (selectedKeys.isEmpty()) { this.resources.getString(R.string.pref_no_key_selected) } else { @@ -270,17 +271,20 @@ class UserPreference : AppCompatActivity() { } } - findPreference("general_show_time")?.onPreferenceChangeListener = - ChangeListener { _, newValue: Any? -> - try { - val isEnabled = newValue.toString().toInt() != 0 - clearAfterCopyPreference?.isVisible = isEnabled - clearClipboard20xPreference?.isVisible = isEnabled - true - } catch (e: NumberFormatException) { - false - } - } + showTimePreference?.onPreferenceChangeListener = ChangeListener { _, newValue: Any? -> + try { + val isEnabled = newValue.toString().toInt() != 0 + clearAfterCopyPreference?.isVisible = isEnabled + clearClipboard20xPreference?.isVisible = isEnabled + true + } catch (e: NumberFormatException) { + false + } + } + + showTimePreference?.summaryProvider = Preference.SummaryProvider { + getString(R.string.pref_show_time_summary, sharedPreferences.getString("general_show_time", "45")) + } findPreference("biometric_auth")?.apply { val isFingerprintSupported = BiometricManager.from(requireContext()).canAuthenticate() == BiometricManager.BIOMETRIC_SUCCESS @@ -290,6 +294,7 @@ class UserPreference : AppCompatActivity() { summary = getString(R.string.biometric_auth_summary_error) } else { setOnPreferenceClickListener { + isEnabled = false val editor = sharedPreferences.edit() val checked = isChecked Authenticator(requireActivity()) { result -> @@ -297,12 +302,14 @@ class UserPreference : AppCompatActivity() { is AuthenticationResult.Success -> { // Apply the changes editor.putBoolean("biometric_auth", checked) + isEnabled = true } else -> { // If any error occurs, revert back to the previous state. This // catch-all clause includes the cancellation case. editor.putBoolean("biometric_auth", !checked) isChecked = !checked + isEnabled = true } } }.authenticate() @@ -541,7 +548,7 @@ class UserPreference : AppCompatActivity() { // TODO: This is fragile. Workaround until PasswordItem is backed by DocumentFile val docId = DocumentsContract.getTreeDocumentId(uri) val split = docId.split(":".toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray() - val path = if (split.size > 0) split[1] else split[0] + val path = if (split.isNotEmpty()) split[1] else split[0] val repoPath = "${Environment.getExternalStorageDirectory()}/$path" Timber.tag(TAG).d("Selected repository path is $repoPath") @@ -689,7 +696,7 @@ class UserPreference : AppCompatActivity() { @JvmStatic private fun setCustomDictSummary(customDictPref: Preference?, uri: Uri) { val fileName = uri.path?.substring(uri.path?.lastIndexOf(":")!! + 1) - customDictPref?.summary = "Selected dictionary: " + fileName + customDictPref?.summary = "Selected dictionary: $fileName" } } } diff --git a/app/src/main/res/values-ar/strings.xml b/app/src/main/res/values-ar/strings.xml index 3ac92731..c23ff0e0 100644 --- a/app/src/main/res/values-ar/strings.xml +++ b/app/src/main/res/values-ar/strings.xml @@ -80,7 +80,7 @@ التشفير إختيار مزود الأوبن بي جي بي OpenPGP الإعدادات العامة - مدة الإبقاء على كلمة السر ظاهرة + مدة الإبقاء على كلمة السر ظاهرة نسخ كلمة السر تلقائيًا تم استيراد مفتاح الـ SSH حدث هناك خطأ أثناء عملية إسترجاع مفتاح الـ SSH diff --git a/app/src/main/res/values-cs/strings.xml b/app/src/main/res/values-cs/strings.xml index 40b9e316..c1830df5 100644 --- a/app/src/main/res/values-cs/strings.xml +++ b/app/src/main/res/values-cs/strings.xml @@ -79,8 +79,7 @@ Vybrat poskytovatele OpenPGP Vybrat ID OpenPGP klíče Všeobecné - Čas zobrazení hesla - Nastavení času po který bude heslo uloženo ve schránce + Čas zobrazení hesla Automaticky kopírovat heslo Automatické kopírování hesla do schránky po úspěšném dešifrování. SSH-key importován diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 99358f5a..1c4b3cde 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -96,8 +96,7 @@ Wähle OpenPGP-Provider Wähle OpenPGP-Key ID Allgemein - Ablaufzeit des Passworts - Nach dieser Anzahl der Sekunden wird das Passwort aus der Zwischenablage gelöscht. + Ablaufzeit des Passworts Kopiere Passwort automatisch Kopiert das Passwort in die Zwischenablage, wenn der Eintrag entschlüsselt wurde. SSH-Key importiert diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 84d1f7b9..faaf046e 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -122,8 +122,7 @@ Selecciona la llave OpenPGP Ninguna llave seleccionada General - Tiempo para mostrar contraseña - Establece el tiempo antes de limpiar la contraseña del portapapeles. Un valor de cero deshabilita el limpiado. + Tiempo para mostrar contraseña Copiar contraseña automáticamente Automáticamente copia la contraseña al portapapeles si el descifrado fue exitoso. Llave SSH importada diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index a45a90a8..93f21000 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -81,8 +81,7 @@ Sélection du prestataire OpenPGP Sélection de votre identifiant OpenPGP Général - Durée de disponibilité du mot de passe - Choisissez la durée pendant laquelle le mot de passe sera disponnible dans le presse-papier + Durée de disponibilité du mot de passe Copie automatique du mot de passe Copie automatiquement le mot de passe vers le presse-papier si le déchiffrement a réussi. Clef SSH importée diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 43db9352..ae7ea9ab 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -82,8 +82,7 @@ OpenPGP プロバイダーを選択 OpenPGP 鍵 ID を選択 全般 - パスワード表示時間 - パスワードをクリップボードに入れておく時間を設定 + パスワード表示時間 自動的にパスワードをコピー 復号化が成功した後、自動的にパスワードをクリップボードにコピーします。 SSH 鍵をインポートしました diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index b21824a6..e34cb292 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -100,8 +100,7 @@ Выберите провайдера OpenPGP Выберите ключ OpenPGP Общие - Время в буфере - Время нахождения пароля в буфере обмена + Время в буфере Автоматически копировать пароль Автоматически копировать пароль в буфер обмена после успешного расшифрования SSH ключ импортирован diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 1201fd31..61deada0 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -65,8 +65,7 @@ 删除本地的 (隐藏) Repo Git 选择 OpenPGP Key Id - 选择密码在剪贴板中保存的时间限制 - 密码保存时限 + 密码保存时限 选择 OpenPGP 应用 搜索子文件夹 在当前目录的子目录中查找密码 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index f8c01e48..22da24d2 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -63,8 +63,7 @@ 刪除本機的 (隱藏) Repo Git 選擇 OpenPGP Key Id - 選擇密碼在剪貼簿中保存的時間限制 - 密碼保存時限 + 密碼保存時限 選擇 OpenPGP app 搜尋子資料夾 在目前目錄的子目錄中查詢密碼 diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 6b757fd6..522fe6cc 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -43,7 +43,11 @@ 9 10 - + + Classic + XKPasswd + + classic xkpasswd diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index cbc88eaf..288b93f2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -10,11 +10,11 @@ Delete directory Cancel Repository information - Git Configurations + Git configuration - Please clone or create a new repository below before trying to add a password or any synchronization operation. - You have to select your "PGP-Key ID" before initializing the repository + Please clone or create a new repository below before trying to add a password or running any synchronization operation. + You have to select your PGP key ID before initializing the repository Are you sure you want to delete the password %1$s? Move Edit @@ -29,15 +29,14 @@ This will overwrite %1$s with %2$s. - Add password for %1$s using android password store. - "Edit %1$s using android password store." - "Folder %1$s created using android password store." - "Remove %1$s from store." - "Rename %1$s to %2$s." - "Increment HOTP counter for %1$s." + Add generated password for %1$s using android password store. + Edit password for %1$s using android password store. + Remove %1$s from store. + Rename %1$s to %2$s. + Increment HOTP counter for %1$s. - No OpenPGP Provider selected! + No OpenPGP provider selected! Password copied to clipboard, you have %d seconds to paste it somewhere. Password copied to clipboard Username copied to clipboard @@ -134,13 +133,13 @@ Delete repository Clear repository Crypto - Select OpenPGP Provider - Select OpenPGP Key id + Select OpenPGP provider + Select OpenPGP key ID No key selected General - Password Show Time - Set the time (in seconds) you want the password to be in clipboard. 0 means forever. - Automatically copy Password + Password show time + Set the time (in seconds) you want the password to be in clipboard. 0 means forever. Current value: %1$s + Automatically copy password Automatically copy the password to the clipboard after decryption was successful. SSH-key imported Error while trying to import the ssh-key @@ -148,9 +147,9 @@ Recursive filtering Recursively find passwords of the current directory. Password sort order - Folders First - Files First - Type Independent + Folders first + Files first + Type independent Autofill Enable autofill Tap OK to go to Accessibility settings. There, tap Password Store under Services then tap the switch in the top right to turn it on or off. @@ -160,7 +159,7 @@ Automatically match by default Default to \'Automatically match\' for apps without custom settings. Otherwise, \'Never match.\' Always show dialog - Show Full Path + Show full path Show full path of matching password files Misc Clear clipboard 20 times @@ -172,7 +171,7 @@ Use default file picker Automatically clear the clipboard after copy After an automatic copy or a manual copy of the password, the clipboard will be automatically cleared. - Export Passwords + Export passwords Exports the encrypted passwords to an external directory Version @@ -208,7 +207,6 @@ Custom worldlist file Tap to pick a custom wordlist file containing one word per line - Length Passphrase diff --git a/app/src/main/res/xml/preference.xml b/app/src/main/res/xml/preference.xml index 3d91cbfa..1fb8d325 100644 --- a/app/src/main/res/xml/preference.xml +++ b/app/src/main/res/xml/preference.xml @@ -1,179 +1,180 @@ - + + app:key="git_server_info" + app:title="@string/pref_edit_server_info" /> + app:key="git_config" + app:title="@string/pref_edit_git_config" /> + app:key="ssh_key" + app:title="@string/pref_ssh_title" /> + app:key="ssh_keygen" + app:title="@string/pref_ssh_keygen_title" /> + app:key="ssh_key_clear_passphrase" + app:title="@string/ssh_key_clear_passphrase" /> + app:key="hotp_remember_clear_choice" + app:title="@string/hotp_remember_clear_choice" /> + app:key="ssh_openkeystore_clear_keyid" + app:title="@string/ssh_openkeystore_clear_keyid" /> + app:key="ssh_see_key" + app:title="@string/pref_ssh_see_key_title" /> + app:key="git_delete_repo" + app:summary="@string/pref_git_delete_repo_summary" + app:title="@string/pref_git_delete_repo" /> + app:key="git_external" + app:summary="@string/pref_external_repository_summary" + app:title="@string/pref_external_repository" /> + app:dependency="git_external" + app:key="pref_select_external" + app:title="@string/pref_select_external_repository" /> - + + app:key="openpgp_provider_list" + app:title="@string/pref_provider_title" /> + app:key="openpgp_key_id_pref" + app:title="@string/pref_key_title" /> - + + app:persistent="true" /> + app:key="pref_key_is_custom_dict" + app:title="@string/xkpwgen_pref_custom_dict_title" + app:summaryOn="@string/xkpwgen_pref_custom_dict_summary_on" + app:summaryOff="@string/xkpwgen_pref_custom_dict_summary_off"/> + app:key="pref_key_custom_dict" + app:title="@string/xkpwgen_pref_custom_dict_picker_title" + app:summary="@string/xkpwgen_pref_custom_dict_picker_summary" + app:dependency="pref_key_is_custom_dict"/> - + + app:key="general_show_time" + app:summary="@string/pref_show_time_summary" + app:title="@string/pref_show_time_title" /> + app:defaultValue="true" + app:title="@string/show_password_pref_title" + app:summary="@string/show_password_pref_summary" + app:key="show_password" /> + app:defaultValue="true" + app:title="@string/show_extra_content_pref_title" + app:summary="@string/show_extra_content_pref_summary" + app:key="show_extra_content" /> + app:defaultValue="true" + app:dialogTitle="@string/pref_copy_dialog_title" + app:key="copy_on_decrypt" + app:summary="@string/pref_copy_dialog_title" + app:title="@string/pref_copy_title" /> + app:defaultValue="true" + app:key="clear_after_copy" + app:summary="@string/prefs_clear_after_copy_summary" + app:title="@string/prefs_clear_after_copy_title" /> + app:defaultValue="true" + app:key="filter_recursively" + app:summary="@string/pref_recursive_filter_hint" + app:title="@string/pref_recursive_filter" /> + app:defaultValue="false" + app:key="search_on_start" + app:summary="@string/pref_search_on_start_hint" + app:title="@string/pref_search_on_start" /> + app:defaultValue="false" + app:key="search_from_root" + app:summary="@string/pref_search_from_root_hint" + app:title="@string/pref_search_from_root" /> - + app:title="@string/pref_sort_order_title" + app:defaultValue="FOLDER_FIRST" + app:key="sort_order" + app:entries="@array/sort_order_entries" + app:entryValues="@array/sort_order_values" + app:persistent="true" + app:summary="%s" /> + + app:key="biometric_auth" + app:title="@string/biometric_auth_title" + app:summary="@string/biometric_auth_summary" /> - - + + + app:key="autofill_apps" + app:title="@string/pref_autofill_apps_title"/> + app:defaultValue="true" + app:key="autofill_default" + app:summary="@string/pref_autofill_default_hint" + app:title="@string/pref_autofill_default_title"/> + app:defaultValue="false" + app:key="autofill_always" + app:title="@string/pref_autofill_always_title"/> + app:defaultValue="false" + app:key="autofill_full_path" + app:summary="@string/pref_autofill_full_path_hint" + app:title="@string/pref_autofill_full_path_title"/> - + + app:key="export_passwords" + app:title="@string/prefs_export_passwords_title" + app:summary="@string/prefs_export_passwords_summary"/> + app:defaultValue="false" + app:key="clear_clipboard_20x" + app:summary="@string/pref_clear_clipboard_hint" + app:title="@string/pref_clear_clipboard_title" /> + app:icon="@mipmap/ic_launcher_round" + app:key="app_version" + app:title="@string/prefs_version" /> -- cgit v1.2.3