From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: alina sireneva <alina@tei.su>
Date: Fri, 10 Apr 2026 03:26:07 +0300
Subject: add password autofill hints for password managers

---
 .../java/org/telegram/ui/Components/EditTextBoldCursor.java     | 1 +
 TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java  | 2 ++
 .../main/java/org/telegram/ui/TwoStepVerificationActivity.java  | 1 +
 .../java/org/telegram/ui/TwoStepVerificationSetupActivity.java  | 2 ++
 4 files changed, 6 insertions(+)

diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/EditTextBoldCursor.java
@@ -322,6 +322,7 @@ public class EditTextBoldCursor extends EditTextEffects {
     @TargetApi(Build.VERSION_CODES.O)
     @Override
     public int getAutofillType() {
+        if (getAutofillHints() != null) return super.getAutofillType();
         return AUTOFILL_TYPE_NONE;
     }
 
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java
@@ -5255,6 +5255,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No
             codeField.setTypeface(Typeface.DEFAULT);
             codeField.setGravity(LocaleController.isRTL ? Gravity.RIGHT : Gravity.LEFT);
             codeField.setOnFocusChangeListener((v, hasFocus) -> outlineCodeField.animateSelection(hasFocus ? 1f : 0f));
+            desu.inugram.helpers.InuUtils.setAutofillHint(codeField, View.AUTOFILL_HINT_PASSWORD);
             outlineCodeField.attachEditText(codeField);
             outlineCodeField.addView(codeField, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.TOP));
             codeField.setOnEditorActionListener((textView, i, keyEvent) -> {
@@ -7076,6 +7077,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No
                 codeField[a].setPadding(padding, padding, padding, padding);
                 if (stage == 0) {
                     codeField[a].setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+                    desu.inugram.helpers.InuUtils.setAutofillHint(codeField[a], View.AUTOFILL_HINT_PASSWORD);
                     codeField[a].setTransformationMethod(PasswordTransformationMethod.getInstance());
                 }
                 codeField[a].setTypeface(Typeface.DEFAULT);
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationActivity.java
@@ -272,6 +272,7 @@ public class TwoStepVerificationActivity extends BaseFragment implements Notific
         passwordEditText.setBackground(null);
         passwordEditText.setSingleLine(true);
         passwordEditText.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+        desu.inugram.helpers.InuUtils.setAutofillHint(passwordEditText, View.AUTOFILL_HINT_PASSWORD);
         passwordEditText.setTransformationMethod(PasswordTransformationMethod.getInstance());
         passwordEditText.setTypeface(Typeface.DEFAULT);
         passwordEditText.setCursorColor(Theme.getColor(Theme.key_windowBackgroundWhiteInputFieldActivated));
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java
index 0000000..0000000 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/TwoStepVerificationSetupActivity.java
@@ -991,6 +991,7 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
                 editTextFirstRow.setContentDescription(LocaleController.getString(R.string.LoginPassword));
                 editTextFirstRow.setImeOptions(EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
                 editTextFirstRow.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+                desu.inugram.helpers.InuUtils.setAutofillHint(editTextFirstRow, View.AUTOFILL_HINT_PASSWORD);
                 editTextFirstRow.setTransformationMethod(PasswordTransformationMethod.getInstance());
                 editTextFirstRow.setTypeface(Typeface.DEFAULT);
 
@@ -1017,6 +1018,7 @@ public class TwoStepVerificationSetupActivity extends BaseFragment {
                 editTextFirstRow.setContentDescription(LocaleController.getString(currentType == TYPE_CREATE_PASSWORD_STEP_1 ? R.string.EnterPassword : R.string.ReEnterPassword));
                 editTextFirstRow.setImeOptions(EditorInfo.IME_ACTION_NEXT | EditorInfo.IME_FLAG_NO_EXTRACT_UI);
                 editTextFirstRow.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_VARIATION_PASSWORD);
+                desu.inugram.helpers.InuUtils.setAutofillHint(editTextFirstRow, View.AUTOFILL_HINT_PASSWORD);
                 editTextFirstRow.setTransformationMethod(PasswordTransformationMethod.getInstance());
                 editTextFirstRow.setTypeface(Typeface.DEFAULT);
 
