Disable saving PIN to password manager.

We haven't found a reliable way to make the auto-fill framework differentiate between the PIN and backup key, so we are disabling prompts to save Signal PINs to password managers to avoid accidentally overwriting a saved backup key with a PIN value.

Co-authored-by: Michelle Tang <mtang@signal.org>
This commit is contained in:
jeffrey-signal
2025-09-04 16:21:56 -04:00
committed by Greyson Parrelli
parent 217a6187c2
commit b1f067536b
16 changed files with 33 additions and 123 deletions

View File

@@ -7,6 +7,7 @@ package org.thoughtcrime.securesms.registration.ui.registrationlock
import android.os.Bundle
import android.text.InputType
import android.text.method.PasswordTransformationMethod
import android.view.KeyEvent
import android.view.View
import android.view.inputmethod.EditorInfo
@@ -275,11 +276,11 @@ class RegistrationLockFragment : LoggingFragment(R.layout.fragment_registration_
val isAlphaNumeric = keyboard == PinKeyboardType.ALPHA_NUMERIC
binding.kbsLockPinInput.setInputType(
if (isAlphaNumeric) InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD
else InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_VARIATION_PASSWORD
if (isAlphaNumeric) InputType.TYPE_CLASS_TEXT else InputType.TYPE_CLASS_NUMBER
)
binding.kbsLockPinInput.getText().clear()
binding.kbsLockPinInput.transformationMethod = PasswordTransformationMethod.getInstance()
}
private fun sendEmailToSupport() {

View File

@@ -7,6 +7,7 @@ package org.thoughtcrime.securesms.registration.ui.reregisterwithpin
import android.os.Bundle
import android.text.InputType
import android.text.method.PasswordTransformationMethod
import android.view.View
import android.view.inputmethod.EditorInfo
import android.widget.Toast
@@ -201,8 +202,9 @@ class ReRegisterWithPinFragment : LoggingFragment(R.layout.fragment_registration
private fun updateKeyboard(keyboard: PinKeyboardType) {
val isAlphaNumeric = keyboard == PinKeyboardType.ALPHA_NUMERIC
binding.pinRestorePinInput.inputType = if (isAlphaNumeric) InputType.TYPE_CLASS_TEXT or InputType.TYPE_TEXT_VARIATION_PASSWORD else InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_VARIATION_PASSWORD
binding.pinRestorePinInput.inputType = if (isAlphaNumeric) InputType.TYPE_CLASS_TEXT else InputType.TYPE_CLASS_NUMBER
binding.pinRestorePinInput.text?.clear()
binding.pinRestorePinInput.transformationMethod = PasswordTransformationMethod.getInstance()
}
private fun onNeedHelpClicked() {