Forgotten password on an Android smartphone is a situation that almost every user has encountered. It is especially unpleasant when important data is stored on the device: photos, correspondence, work documents or passwords from other services. A standard reset via Recovery Mode deletes all information from the internal memory, but there are ways to bypass the lock without losing data.

In this article we will examine 7 verified methodswhich will help you unlock your Android device while saving files, applications and settings. It is important to consider that the effectiveness of each method depends on the version of the operating system, smartphone model and security settings. For example, on Samsung Galaxy s One UI 5.0+ some tricks may not work due to enhanced protection Knox, and on Xiaomi s MIUI 14 - additional authorization through Mi Account.

Before you begin, make sure that you have access to a computer (for methods with ADB), a Google backup, or at least a SIM card with active Internet. If your smartphone is low, recharge it to at least 30% to avoid sudden shutdown during the procedure.

1. Unlocking via Google Account (Android 4.4 and below)

This method only works for Old versions of Android (up to 5.0 Lollipop inclusive). Modern devices do not have this vulnerability due to stricter security policies. If your smartphone was released before 2015, try the following steps: Android 6.0+ are deprived of this vulnerability due to tightened security policies. If your smartphone was released before 2015, try the following steps:

  1. On the lock screen, enter wrong password 5 timesuntil the message โ€œForgot your pattern?โ€ appears. or "Forgot your password?" account that was used when you first set up your smartphone.
  2. Click on this inscription - the system will prompt you to enter data Google Accountassociated with the device.
  3. Enter the email and password for the account that was used when you first set up your smartphone.
  4. After successful authorization, the device will be unlocked and you can set a new password.

โš ๏ธ Attention: If two-factor authentication (2FA) is enabled on your smartphone, you may need a code from SMS or application Google Authenticator. Make sure you have access to backup codes or a second device for verification.

Why did this method stop working on new Androids?

Starting from Android 6.0 MarshmallowGoogle has removed the ability to reset your password through your account due to security risks. Hackers could use this vulnerability to remotely hack devices. Now a similar function is implemented via Find My Device, but it requires preliminary configuration and deletes data when unlocked.

2. Using Safe Mode to bypass the lock

Safe Mode (safe mode) loads Android without third-party applications, which sometimes allows you to bypass the screen lock if it was installed through third-party software (for example, AppLock or CM Locker). The method is suitable for devices on Android 7.0โ€“11.0, but does not guarantee 100% results.

Instructions:

  • ๐Ÿ”„ Turn off the smartphone by long pressing the power button.
  • ๐Ÿ“ฑ Hold the power button until the manufacturer's logo appears, then immediately press and hold button Volume Down.
  • ๐Ÿ›ก๏ธ Hold it until the device boots into Safe Mode (in the lower left corner there will be an inscription โ€œSafe Modeโ€).
  • ๐Ÿ”“ If the lock was installed by a third-party application, try removing it via Settings โ†’ Applications.

If the lock was set through the standard Android settings, this method will not work. In this case, proceed to the next method.

Samsung

Xiaomi/Redmi/Poco

Huawei/Honor

Google Pixel

Another brand-->

3. Unlock via ADB (for enabled USB debugging)

ADB (Android Debug Bridge) is a powerful tool for managing Android devices from a computer. If on your smartphone USB debugging was previously enabled, you can delete the file with the password without resetting the data. This method works on Android 5.0โ€“12.0, but requires preliminary preparation.

What you will need:

  • ๐Ÿ’ป A computer with ADB and Fastboot installed.
  • ๐Ÿ”Œ USB cable (preferably original).
  • ๐Ÿ“ฑ Smartphone with an unlocked bootloader (on some models, for example Xiaomi, unlocking may be required Bootloader).

Step-by-step guide:

  1. Connect your smartphone to the computer and open Command Line (Windows) or Terminal (macOS/Linux).
  2. Enter the command to check the connection:
    adb devices

    If the device is shown in the list, proceed further.

  3. Delete the file with the password:
    adb shell rm /data/system/gesture.key

    For devices with a PIN code, use:

    adb shell rm /data/system/password.key
  4. Reboot your smartphone:
    adb reboot

After rebooting, the lock screen should disappear. If not, try entering any password, and the system will let you through.

Install ADB and Fastboot on your PC

Enable USB debugging on your smartphone (if you had access previously)

Prepare the original USB cable

Check the battery charge (minimum 30%)

Download drivers for your model-->

4. Bypassing the lock via Find My Device (with remote reset)

Service Find My Device from Google allows you to remotely control your Android device, including unlocking. However, this method works only if three conditions are met:

  • ๐Ÿ“ถ The device is connected to the Internet (via Wi-Fi or a mobile network).
  • ๐Ÿ”’ The function of the smartphone is enabled Find device (Settings โ†’ Google โ†’ Security).
  • ๐Ÿ“ง You remember the Google Account data linked to the phone.

How to unlock:

  1. Go to the site Find My Device from a computer or other phone.
  2. Select a locked device from the list.
  3. Click "Lock device" and enter a temporary password.
  4. This password will replace the current one on the lock screen. Enter it on your smartphone.

โš ๏ธ Attention: If you select the option โ€œErase dataโ€, all files will be deleted without the possibility of recovery. Use this option only as a last resort!

๐Ÿ’ก

If the Internet is turned off on your smartphone, but there is a SIM card with an active tariff, try calling it from another phone. Sometimes during a call it becomes possible to briefly access the menu.

5. Unlocking via Recovery Mode (partial reset)

This method is suitable for devices with Custom Recovery (for example, TWRP). If your smartphone has standard Recovery installed, the method will not work or will lead to a complete reset. Before you start, check the Recovery model:

Recovery type Ability to unlock without data loss Device examples
TWRP โœ… Yes (via File Manager) Xiaomi, OnePlus, Google Pixel (with unlocked bootloader)
Stock Recovery (standard) โŒ No (hard reset only) Samsung, Huawei, Realme
OrangeFox โœ… Yes (same as TWRP) POCO, Redmi (advanced users)

Instructions for TWRP:

  1. Turn off your smartphone.
  2. Hold down the combination of buttons to enter Recovery (usually Power + Volume Up).
  3. In the menu TWRP select Advanced โ†’ File Manager.
  4. Go to the folder /data/system/ and delete the files:
    • gesture.key (for pattern key),
    • password.key (for PIN code),
    • locksettings.db (for password).
  • Reboot the device.
  • On devices with encryption (File-Based Encryption, FBE) this method will not work - the data will be locked even after the keys are deleted.

    6. Using service codes (for some brands)

    Some manufacturers leave service codes to reset the lock, but they do not work on all models and often require a SIM card of the same operator. For example:

    • ๐Ÿ“ฑ Samsung: enter in the dialer ##7780## (soft reset) or *2767*3855# (hard reset, deletes data!).
    • ๐Ÿ“ฑ Huawei: try ##2846579## โ†’ ProjectMenu โ†’ Background Settings โ†’ Log settings โ†’ password reset.
    • ๐Ÿ“ฑ Xiaomi: codes usually do not work, but you can try ##3646633## (Engineering Mode).

    โš ๏ธ Attention: Service codes can lead to irreversible reset or damage to the firmware. Use them only if other methods have not helped and you are ready to risk data loss.

    ๐Ÿ’ก

    Service codes are the most unreliable method. On modern smartphones they are either disabled or lead to a complete reset. Before use, check that the code is up to date for your model.

    7. Contacting the service center (warranty cases)

    If none of the methods worked, you just have to contact the official service center manufacturer. without data loss, but this depends on:

    • ๐Ÿ“„ Availability of a receipt or warranty card (proof of ownership).
    • ๐Ÿ” Smartphone models (on Samsung s Knox or Google Pixel s Titan M unlocking without resetting is unlikely).
    • ๐Ÿ’ฐ Willingness to pay for the service (outside the guarantee, the cost can reach 3-5 thousand rubles).

    Before visiting service:

    1. Check by phone whether they provide such a service.
    2. Take with you documents confirming the purchase.
    3. Make sure that the function is disabled on the device Factory protection (Factory Reset Protection, FRP), otherwise after resetting you will need to enter previous account data.

    โš ๏ธ Attention: Unofficial services may offer โ€œunlocking without data lossโ€ for a low price, but often use questionable methods (for example, flashing with loss of IMEI. This can lead to network blocking or problems with updates.

    FAQ: Frequently asked questions about unlocking Android

    Is it possible to unlock a smartphone if USB debugging has been disabled?

    Without USB debugging enabled, unlocking options without resetting data are extremely limited. The only working options:

    • Use Find My Device (if it is turned on and there is Internet).
    • Contacting a service center (for some models).
    • Exploiting vulnerabilities in older versions of Android (for example, through Safe Mode or service codes).

    On devices with Android 8.0+ and debugging turned off, the chances are almost zero.

    What to do if, after removing gesture.key, the lock screen remains?

    This means that:

    • The device has encryption (FBE) enabled and the keys are stored in encrypted form.
    • You deleted the wrong file (check for availability password.key or locksettings.db).
    • The manufacturer uses additional protection (for example, Samsung Knox or Huawei TEE).

    In this case, try:

    1. Delete all three files (gesture.key, password.key, locksettings.db).
    2. Reboot the device in Safe Mode and repeat try.
    3. Use Find My Device to set a temporary password.
    How to unlock Xiaomi if you forgot your Mi Account password?

    On devices Xiaomi, Redmi i POCO with linked Mi Account unlocking becomes more difficult. Options:

    • ๐Ÿ”‘ Restore access to Mi Account via official website (email or phone number required).
    • ๐Ÿ“ง If your email is linked, try resetting your password through it.
    • ๐Ÿ› ๏ธ Contact the service center Xiaomi with proof of purchase (may require waiting 72 hours to unlock).

    โš ๏ธ Without access Mi Account unlocking without resetting data impossible is a manufacturer's security limitation.

    Will flashing a smartphone help save data?

    Flashing via Fastboot or Odine (for Samsung) deletes all data from partition /data, including photos, messages and applications. However:

    • If you have TWRP backupyou can restore the data after flashing.
    • On some devices (for example, with a chip MediaTek), you can make a backup via SP Flash Tool before flashing the firmware.
    • Files on SD card or external memory (if it is not encrypted) will remain intact.

    Flashing is a last resort method that should be used only if other methods have not helped.

    Why did some applications disappear after unlocking?

    This can happen for the following reasons:

    • ๐Ÿ”„ When deleting password files via ADB or TWRP the data of applications linked to the account could be damaged (for example, WhatsApp, Telegram).
    • ๐Ÿ”’ Some applications (banking, instant messengers) are blocked when the security state of the device changes.
    • ๐Ÿ“ฅ Applications could be installed on external SD cardwhich was temporarily disabled.

    Solution:

    1. Restart your device.
    2. Check for applications in Settings โ†’ Applications (maybe they are just hidden).
    3. Update applications via Google Play.