Forgot your phone password or want to update it for more security? On Android, you can change the lock code in several ways - from standard settings to recovery via account Google. But it is important to understand: the procedure depends on the version of the operating system, device model and even manufacturer. For example, on Samsung Galaxy s One UI the path to the security settings differs from the pure Android 14 on Pixel 8.

In this article we will analyze all the current methods of changing the password, including emergency ones - when access to the phone is lost. You will learn how to bypass the blocking without losing data (if possible), which ones, and why some methods stopped working after updates. We will also analyze which types of locks ( resetting to factory settings carries risks, and why some methods stopped working after updates Android 12+. We will also analyze what types of locks (PIN, pattern, fingerprint) can be changed remotely, and which ones can only be changed manually.

1. Standard method: changing the password through settings

If you remember the current lock code, the easiest way is to use the built-in security settings. This method works on all devices, regardless of brand (Xiaomi, Huawei, Realme etc.), but may differ slightly visually.

Open the menu Settings โ†’ Security and privacy โ†’ Screen lock. The system will ask you to enter your current password, PIN or pattern. After confirmation, select a new lock type:

  • ๐Ÿ”ข PIN code โ€” from 4 to 16 digits (at least 6 are recommended for security).
  • ๐Ÿ”‘ Password โ€” a combination of letters, numbers and symbols (most reliable option).
  • ๐ŸŽจ Pattern key โ€”a pattern of 4โ€“9 dots (less secure, but convenient).
  • ๐Ÿ‘† Fingerprint/face โ€”biometrics (requires a backup PIN/password).

On some devices (for example, Samsung s Knox), when changing the password, a warning about data reset may appear in applications Secure Folder or Samsung Pay. This is normal - this is how corporate feature protection works.

Current lock code at hand|Battery charge > 20%|Backup important data|VPN/proxies are disabled (can block synchronization)

-->

โš ๏ธ Attention: If you use managed workspace (for example, via Microsoft Intune or VMware Workspace ONE), changing the password may block access to corporate data. Check the security policy with your IT department administrator.

2. Changing your password through your Google account (if you forgot your current one)

If you have forgotten the lock code, but your phone is linked to your account Google, you can try to restore access through Find My Device (formerly "Device Manager"). This method only works if three conditions are met:

  1. The device is connected to the Internet (via a mobile network or Wi-Fi).
  2. The function is enabled Find device in the settings (Settings โ†’ Google โ†’ Security).
  3. You remember the login and password for the account Googlethat was added on the phone.

Instructions:

  1. Go to the site google.com/android/find from another device.
  2. Select a locked phone from the list (if there are several of them).
  3. Click Lock device and enter a new temporary password.
  4. Use this password to unlock the phone, then set a permanent code in the settings.

Manufacturer Support Find My Device Features
Google Pixel Yes Works stably, supports remote PIN change.
Samsung Yes, but with reservations May require confirmation via Samsung Account.
Xiaomi/Redmi Partially On some models it is blocked after 5 unsuccessful attempts.
Huawei (without GMS) No Use Huawei Cloud or reset.
โš ๏ธ Attention: On devices with Android 11+ and enabled File-Based Encryption (FBE) remote password change via Find My Device may lead to data loss in some applications (for example, WhatsApp or Signal). This is due to changing the encryption keys.

PIN code|Pattern key|Password|Fingerprint/face|I do not use a lock

-->

3. through Recovery mode (for experienced users)

If the previous methods did not work, you can only do so through the menu hardware. reset via menu Recovery. This method will delete all data from the device, including photos, messages and installed applications. Use it only as a last resort!

Steps for most devices:

  1. Turn off the phone.
  2. Hold down the combination of buttons to enter Recovery (depending on the model):
    • ๐Ÿ“ฑ Samsung: Volume up + Power + Bixby (or Volume up + Power on new models).
    • ๐Ÿ“ฑ Google Pixel, OnePlus: Volume down + Power.
    • ๐Ÿ“ฑ Xiaomi: Volume up + Power (hold for 10+ seconds).
  • In the menu Recovery select Wipe data/factory reset (control - volume buttons, confirmation - power button).
  • After resetting, reboot the device (Reboot system now).
  • What to do if you canโ€™t enter Recovery?

    If the button combination does not work, your device may be using Fastboot Mode instead of classic Recovery. In this case:

    1. Connect your phone to a PC with installed drivers. data-i="131">2. Enter the command: ADB.

    2. Enter the command:

    adb reboot recovery

    3. If this does not work, try:

    fastboot reboot recovery

    On some models Huawei and Honor a special unlock code may be required (it is provided by the manufacturer upon request).

    After the reset, you will need to reconfigure the phone, including linking the account Google. If the function was previously enabled Reset protection (FRP), the system will ask for the login and password from the last synchronized account.

    4. Using ADB to change the password (without losing data)

    For advanced users, there is a way to change the password via Android Debug Bridge (ADB)without losing data. This method only works if the phone USB debugging is enabled has access to a PC with installed drivers.

    Instructions:

    1. Connect the phone to the PC via a USB cable.
    2. Open the command line (cmd on Windows or Terminal on macOS/Linux).
    3. Enter the commands in order:
      adb shell
      

      su

      rm /data/system/gesture.key # for pattern key

      rm /data/system/password.key # for PIN/password

      rm /data/system/locksettings.db

      rm /data/system/locksettings.db-wal

      rm /data/system/locksettings.db-shm

      reboot

    4. After reboot, the phone will unlocked, but you will need to set a new password.
    5. โš ๏ธ Attention: On devices with Android 10+ and enabled File system encryption (FBE) this method may lead to Loss of access to data in /sdcard/ folders and some applications. The reason is a change in encryption keys when deleting lock files.

      If the commands su do not work, then there is no data on the phone root access. In this case, try the alternative method via ADB backup, but it requires additional manipulations and does not guarantee 100% results.

      adb backup -apk -obb -shared -all -f backup.ab

      This will save applications and their data (but not system lock settings).

      -->

      5. password on devices with MIUI, EMUI and One UI

      Manufacturers often modify the standard Android, adding their own security features. Let's look at the key differences:

      Xiaomi (MIUI):

      • ๐Ÿ”’ With 5 unsuccessful attempts to enter the password, the phone is locked for 30 seconds, then time. increases.
      • ๐Ÿ“ฑ To reset your password via Mi Account requires linking a phone number.
      • ๐Ÿ”„ Some versions of MIUI have a function Password recovery via SMS (a code is sent to the linked number).

      Huawei (EMUI/HarmonyOS):

      • ๐Ÿ” On devices without Google Mobile Services (GMS), password reset is only possible through Huawei ID.
      • ๐Ÿ“ต If you have forgotten the password for Huawei ID, you will need to contact support with proof of ownership of the device.
      • ๐Ÿ”„ On new ones models with HarmonyOS reset via Recovery may require entering unlock codeissued by the manufacturer.

      Samsung (One UI):

      • ๐Ÿ”’ When changing the password, the contents of the folder may be reset. Secure Folder.
      • ๐Ÿ“ฑ Supports unlocking via Samsung Find My Mobile (alternative Find My Device).
      • ๐Ÿ”„ On devices with Knox some corporate data may be blocked after a reset.

      -->

      6. How to protect your phone after a change password

      After successfully changing the lock code, it is recommended to take several steps to strengthen security:

      1. Set up backup unlocking methods:

      • ๐Ÿ”‘ Add backup PIN for biometric locking (print/face).
      • ๐Ÿ“ง Link your account Google and check that the function Find device is enabled.
      • ๐Ÿ“ž On Samsung set up Samsung Find My Mobile with a backup phone number.

      2. Enable additional security measures:

      • ๐Ÿ›ก๏ธ Activate device encryption (Settings โ†’ Security โ†’ Encryption).
      • ๐Ÿ”„ Set automatic blocking after 30 seconds of inactivity.
      • ๐Ÿ“ก Disable Smart Lock (auto-unlock in trusted locations) if it is not needed.

    3. Check active sessions:

    1. Go to Settings โ†’ Google โ†’ Google account management โ†’ Security.
    2. In the section Your devices delete unknown sessions.
    3. Enable two-step authentication for your account Google.

    If you often forget passwords, consider using manager. passwords (for example, Bitwarden or 1Password) to store backup codes. Do not store PIN codes in notes or SMS!

    Frequent errors and how to avoid them

    When changing a password, users often encounter typical problems. Here are the most common ones and ways to solve them:

    1. "Cannot change the password - the system writes 'Error'"

    • ๐Ÿ”น Check whether guest mode or second user.
    • ๐Ÿ”น Make sure there is enough free space on the device (less than 10% of memory can block changes settings).
    • ๐Ÿ”น Reboot the phone and try again.

    2. "After resetting via Recovery, the phone requires the old password"

    • ๐Ÿ”น This is a manifestation FRP (Factory Reset Protection)Enter the details of the last synchronized account. Google.
    • ๐Ÿ”น If the account is not remembered, use google.com/android/find to unlock.
    • ๐Ÿ”น On Samsung you may need to enter data Samsung Account.

    3 "The pattern key is not accepted, although I enter it. correct"

    • ๐Ÿ”น Try entering the pattern more slowly - the system may not have time to register touches.
    • ๐Ÿ”น Check if the mode is enabled Invisible PIN (on some firmware it hides the input).
    • ๐Ÿ”น If the pattern is really forgotten, use account Google or reset.

    โš ๏ธ Attention: On some devices (for example, OnePlus s OxygenOS) after several unsuccessful attempts to enter the password, it may work. hardware locking of the bootloader. In this case, unlocking is possible only through an official service center with confirmation of purchase.
    Is it possible to change the password on Android without data loss?

    Yes, but only if you remember the current lock code (via settings) or if USB debugging is enabled on your phone (via ADB). In other cases (forgotten password), resetting will lead to data deletion.

    Why did some applications stop working after changing the password?

    This is related. with File-based encryption (FBE)which is used in Android 10+. When you change the password, the encryption keys change, and some applications (for example, WhatsApp or banking) may require re-authentication.

    How to change the password to phone with a broken screen?

    If the screen responds to touches, connect the phone to the PC via USB-OTG and use the mouse. If the screen is completely inoperative, try connecting via ADB (if debugging was enabled) or contact a service center to replace the display.

    Is it possible to bypass the blocking through a call or SOS?

    No, modern versions of Android (starting from Android 9 Pie) have closed this vulnerability. Previously, it was possible to access the settings through the emergency call screen, but now this is impossible.

    What to do if the phone is blocked by the operator (for example, when purchased with hands)?

    This is IMEI lock, it is not related to the screen unlock code. Contact the operator with proof of purchase or check the phone through the service imei.info before purchasing.