mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
fix: Special Characters #2180
This commit is contained in:
@@ -6,7 +6,7 @@ KeePassDX(4.2.0)
|
|||||||
* Change Passkey Backup Eligibility & Backup State #2135 #2150
|
* Change Passkey Backup Eligibility & Backup State #2135 #2150
|
||||||
* Search settings #2112 #2181 #2187
|
* Search settings #2112 #2181 #2187
|
||||||
* Autofill refactoring #765
|
* Autofill refactoring #765
|
||||||
* Small fixes #2157 #2164 #2171 #2122
|
* Small fixes #2157 #2164 #2171 #2122 #2180
|
||||||
|
|
||||||
KeePassDX(4.1.9)
|
KeePassDX(4.1.9)
|
||||||
* Fix landscape UI #2198 #2200 (@chenxiaolong)
|
* Fix landscape UI #2198 #2200 (@chenxiaolong)
|
||||||
|
|||||||
@@ -293,20 +293,22 @@ class PasswordGeneratorFragment : DatabaseFragment() {
|
|||||||
private fun generatePassword() {
|
private fun generatePassword() {
|
||||||
var password = ""
|
var password = ""
|
||||||
try {
|
try {
|
||||||
password = PasswordGenerator(resources).generatePassword(getPasswordLength(),
|
password = PasswordGenerator(resources).generatePassword(
|
||||||
uppercaseCompound.isChecked,
|
length = getPasswordLength(),
|
||||||
lowercaseCompound.isChecked,
|
upperCase = uppercaseCompound.isChecked,
|
||||||
digitsCompound.isChecked,
|
lowerCase = lowercaseCompound.isChecked,
|
||||||
minusCompound.isChecked,
|
digits = digitsCompound.isChecked,
|
||||||
underlineCompound.isChecked,
|
minus = minusCompound.isChecked,
|
||||||
spaceCompound.isChecked,
|
underline = underlineCompound.isChecked,
|
||||||
specialsCompound.isChecked,
|
space = spaceCompound.isChecked,
|
||||||
bracketsCompound.isChecked,
|
specials = specialsCompound.isChecked,
|
||||||
extendedCompound.isChecked,
|
brackets = bracketsCompound.isChecked,
|
||||||
getConsiderChars(),
|
extended = extendedCompound.isChecked,
|
||||||
getIgnoreChars(),
|
considerChars = getConsiderChars(),
|
||||||
atLeastOneCompound.isChecked,
|
ignoreChars = getIgnoreChars(),
|
||||||
excludeAmbiguousCompound.isChecked)
|
atLeastOneFromEach = atLeastOneCompound.isChecked,
|
||||||
|
excludeAmbiguousChar = excludeAmbiguousCompound.isChecked
|
||||||
|
)
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.e(TAG, "Unable to generate a password", e)
|
Log.e(TAG, "Unable to generate a password", e)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,20 +33,22 @@ import java.util.*
|
|||||||
class PasswordGenerator(private val resources: Resources) {
|
class PasswordGenerator(private val resources: Resources) {
|
||||||
|
|
||||||
@Throws(IllegalArgumentException::class)
|
@Throws(IllegalArgumentException::class)
|
||||||
fun generatePassword(length: Int,
|
fun generatePassword(
|
||||||
upperCase: Boolean,
|
length: Int,
|
||||||
lowerCase: Boolean,
|
upperCase: Boolean,
|
||||||
digits: Boolean,
|
lowerCase: Boolean,
|
||||||
minus: Boolean,
|
digits: Boolean,
|
||||||
underline: Boolean,
|
minus: Boolean,
|
||||||
space: Boolean,
|
underline: Boolean,
|
||||||
specials: Boolean,
|
space: Boolean,
|
||||||
brackets: Boolean,
|
specials: Boolean,
|
||||||
extended: Boolean,
|
brackets: Boolean,
|
||||||
considerChars: String,
|
extended: Boolean,
|
||||||
ignoreChars: String,
|
considerChars: String,
|
||||||
atLeastOneFromEach: Boolean,
|
ignoreChars: String,
|
||||||
excludeAmbiguousChar: Boolean): String {
|
atLeastOneFromEach: Boolean,
|
||||||
|
excludeAmbiguousChar: Boolean
|
||||||
|
): String {
|
||||||
// Desired password length is 0 or less
|
// Desired password length is 0 or less
|
||||||
if (length <= 0) {
|
if (length <= 0) {
|
||||||
throw IllegalArgumentException(resources.getString(R.string.error_wrong_length))
|
throw IllegalArgumentException(resources.getString(R.string.error_wrong_length))
|
||||||
@@ -228,7 +230,7 @@ class PasswordGenerator(private val resources: Resources) {
|
|||||||
private const val MINUS_CHAR = "-"
|
private const val MINUS_CHAR = "-"
|
||||||
private const val UNDERLINE_CHAR = "_"
|
private const val UNDERLINE_CHAR = "_"
|
||||||
private const val SPACE_CHAR = " "
|
private const val SPACE_CHAR = " "
|
||||||
private const val SPECIAL_CHARS = "!\"#$%&'*+,./:;=?@\\^`"
|
private const val SPECIAL_CHARS = "&/,^@.#:%\\='$!?*`;+\"|~"
|
||||||
private const val BRACKET_CHARS = "[]{}()<>"
|
private const val BRACKET_CHARS = "[]{}()<>"
|
||||||
private const val AMBIGUOUS_CHARS = "iI|lLoO01"
|
private const val AMBIGUOUS_CHARS = "iI|lLoO01"
|
||||||
|
|
||||||
|
|||||||
@@ -462,7 +462,7 @@
|
|||||||
<string name="visual_minus" translatable="false">-</string>
|
<string name="visual_minus" translatable="false">-</string>
|
||||||
<string name="visual_underline" translatable="false">_</string>
|
<string name="visual_underline" translatable="false">_</string>
|
||||||
<string name="visual_space" translatable="false"> </string>
|
<string name="visual_space" translatable="false"> </string>
|
||||||
<string name="visual_special" translatable="false">&\/,^@.#":%\\='$!*`;+</string>
|
<string name="visual_special" translatable="false">&\/,^@.#":%\\='$!?*`;+\"|~</string>
|
||||||
<string name="visual_brackets" translatable="false">[](){}<></string>
|
<string name="visual_brackets" translatable="false">[](){}<></string>
|
||||||
<string name="visual_extended" translatable="false">ñæËÌÂÝÜ...</string>
|
<string name="visual_extended" translatable="false">ñæËÌÂÝÜ...</string>
|
||||||
<string-array name="list_password_generator_options_default_values">
|
<string-array name="list_password_generator_options_default_values">
|
||||||
|
|||||||
@@ -3,4 +3,4 @@
|
|||||||
* Setting to close database after a Passkey selection #2187
|
* Setting to close database after a Passkey selection #2187
|
||||||
* Warning when overwriting existing Passkey #2124
|
* Warning when overwriting existing Passkey #2124
|
||||||
* Autofill refactoring #765
|
* Autofill refactoring #765
|
||||||
* Small fixes #2171 #2150 #2159 #2122
|
* Small fixes #2171 #2150 #2159 #2122 #2180
|
||||||
@@ -3,4 +3,4 @@
|
|||||||
* Paramètre de fermeture de la base après une sélection de Passkey #2187
|
* Paramètre de fermeture de la base après une sélection de Passkey #2187
|
||||||
* Mise en garde lors de l'écrasement d'un Passkey existant #21124
|
* Mise en garde lors de l'écrasement d'un Passkey existant #21124
|
||||||
* Refonte du remplissage automatique #765
|
* Refonte du remplissage automatique #765
|
||||||
* Petites corrections #2171 #2150 #2159 #2122
|
* Petites corrections #2171 #2150 #2159 #2122 #2180
|
||||||
Reference in New Issue
Block a user