Entering an incorrect pattern or PIN code on Android instantly blocks access to photos, contacts and documents, creating the erroneous impression that data can only be saved through a hard reset, although there are methods to bypass the blocking without losing information.
However, modern ones operating system versions Android and the existence of specialized tools make it possible to circumvent this problem using more humane methods. There are several working scenarios that provide a chance to restore access to the interface while maintaining the integrity of user data. The effectiveness of each method directly depends on the OS version, the presence of root access and the preliminary configuration of debugging parameters.
In this article we will analyze in detail the legal and technical methods of unlocking. We will look at both standard tools from Google and advanced methods of using the debug bridge ADB. It is important to understand that not every method will work on a specific device, so it is recommended to try them sequentially, starting with the least invasive.
Using the Find My Device service from Google
The simplest and most official unlocking method is available to those users who have previously linked their device to a Google account and enabled geolocation. The service Find My Device (Find Device) was originally created to search for lost gadgets, but also has a remote security management function. If your phone is connected to a mobile network or Wi-Fi, you can send a command to change the blocking type.
To do this, you need to go to the official website of the service from any other device (computer or friend’s phone) and log in with the same Google account that is used on the blocked smartphone. The system will detect the location of your device and offer three actions: play sound, lock the device or clear data. We are interested in the locking function, which paradoxically helps to remove the old password.
⚠️ Attention: On some modern versions of Android (starting from 9.0 and higher), the function of changing the password via the web interface has been eliminated for security reasons. If you only see the "Clear" option, this method, unfortunately, will not work without losing files.
When you select the lock option, the system will require you to enter a new password. After confirming the actions, a field for entering a new code will appear on the screen of the locked phone. By entering it, you will be able to log in, and the old pattern will be automatically deactivated. This works because the command from the server takes precedence over local security settings.
Make sure the Internet is turned on on the locked device. If Wi-Fi is turned off and the mobile network is not receiving, the command from the server will not reach the phone.
Unlocking via USB debugging (ADB)
This method is the most technically complex, but also the most reliable for advanced users who have previously had it activated. USB debugging. If you enabled this mode in the developer menu before you forgot the key, you can delete the file responsible for storing the graphic pattern directly through your computer. To work, you will need a PC with installed device drivers and platform tools Android SDK Platform-Tools.
Connect your smartphone to the computer via the original USB cable. Open a command prompt or terminal in the ADB utilities folder and enter the command to test the connection. If the device is detected correctly and you have given permission to debug (sometimes this window even appears on the lock screen when you first connect), you can run the command to delete the system key file.
adb shell rm /data/system/gesture.key
After executing this command, the file containing the picture of your key will be destroyed. However, the blockage may not go away immediately. Often you need to restart your device or simply press the screen off button and then turn it on again. In some cases, the system may require you to enter any arbitrary pattern or PIN code - after this, access will be opened.
☑️ Preparing to work with ADB
It is worth noting that on devices with disk encryption this method may not work, since without unlocking the screen the data partition is not writable even via ADB. Also, on new versions of Android, access to the directory /data/system/ is often closed to the command line without obtaining root access, which makes this method less universal than before.
Login via Google account on older versions of Android
On devices running Android 4.4 and lower, there is a built-in recovery mechanism access that many users overlook. If you enter an incorrect pattern five times in a row, the system will temporarily block the entry for 30 seconds. Immediately after this, a button should appear on the lock screen that says “Forgot your pattern?” or “Forgot your password?”
Clicking on this button will redirect you to the authorization form. You will need to enter the username and password for your Google account that was synchronized with this phone. After successfully verifying your credentials, the system will prompt you to set a new screen lock method or disable it completely. This is a standard security feature designed specifically for such cases.
| Android version | Presence of a "Forgot key" button | Network requirement | Risk of data loss |
|---|---|---|---|
| Android 4.4 and below | Yes (after 5 errors) | Required (Wi-Fi/Mobile) | Absent |
| Android 5.0 - 7.0 | Absent | Not required | High (reset needed) |
| Android 8.0 and higher | None | Not required | High (reset needed) |
| Android 10+ (with encryption) | Absent | Not required | Critical |
Unfortunately, starting with version Android 5.0 Lollipop, Google decided to remove this feature for security reasons. Too often, attackers have used this loophole to gain access to other people's phones simply by knowing or guessing the owner's email password. Therefore, this method cannot be applied on modern smartphones, and you need to look for alternatives.
Reset via Recovery mode and save data
Traditional reset via menu Recovery Mode implies complete formatting of the partition userdatawhich leads to the loss of all files. However, there are nuances that can help save some information or avoid a reset if the blocking is caused not by a forgotten password, but by a system failure. Sometimes the problem lies in a cache conflict, and not in the key itself.
Try Wipe Cache Partition. This operation is safe for personal data: it deletes only temporary system files that could cause a password verification error. To enter recovery mode, you usually need to hold down a combination of buttons (for example, Volume Up + Power) while the device is turned off. In the menu, navigation is carried out using the volume buttons, and selection is made using the power button.
⚠️ Attention: Do not select the "Wipe Data/Factory Reset" item if your goal is to save photos and contacts. This item is guaranteed to delete everything except files on the SD memory card.
If clearing the cache did not help, and the data is critical, you can risk extracting the internal memory via a PC connection in MTP mode, but on a locked screen this is usually prohibited by security settings. The only chance is if you have USB debugging enabled and you can use tools like adb pull to copy folders DCIM and Downloads to the computer before performing a hard reset.
What to do if Recovery requires a password?
On some On smartphones (for example, Samsung or Huawei), when entering recovery mode, the system may request the current pattern or PIN code. This is protection against theft. In this case, it is impossible to bypass the lock through Recovery without resetting.
Use of third-party utilities and services
There are a number of specialized apps, such as Dr.Fone, Tenorshare 4uKey or iMyFone LockWiper, which are positioned as tools for removing locks. These applications offer an automated process: they connect to the phone, scan the model and try to find a method to bypass the protection. Some of them actually know how to remove locks without losing data, but only on a limited list of old devices (mainly Samsung older series).
The principle of operation of such apps often comes down to automating the same actions that we described above: deleting key files via ADB or exploiting vulnerabilities in the bootloader. For new models with encrypted storage, these utilities most often only offer a hard reset, since it is mathematically impossible to bypass encryption without a key without losing data.
Be careful when downloading such software. Many free versions are fake or contain malware. Paid versions require payment before receiving results, and no one guarantees 100% success. Before purchasing a license, be sure to check the list of supported models on the developer’s official website.
Third-party apps are effective mainly for Samsung devices produced before 2018. For other brands, they often act as a paid shell for a standard factory reset.
Prevention and creation of backups
The best way to avoid painful access restoration is advance preparation. Regularly creating backups in the Google Drive cloud or on your computer ensures that even in the event of a hard reset, you will only lose the data accumulated since the last backup. Set up automatic synchronization of contacts, calendar and photos.
It is also recommended to write down your pattern or PIN in a safe place, inaccessible to others, but accessible to you in an emergency. This could be a password manager on your computer or a physical notepad. Don't use patterns that are too simple (like the letter "L" or "Z") that are easy to spot or guess, but don't make them so complicated that you can't reproduce them yourself.
Test the Smart Lock feature to work. It allows you to leave your phone unlocked under certain conditions: when it's at home (geolocation), when connected to a trusted Bluetooth device (headphones or watch), or when it's in your pocket (motion detection). This does not cancel the password completely, but reduces the frequency of its entry.
⚠️ Attention: Menu interfaces and the exact names of items may differ depending on the manufacturer’s shell (MIUI, One UI, ColorOS). Always check the official documentation for your specific smartphone model.
Set up a Google Photos backup with Space Saver quality - it's free and will save an unlimited number of photos in the cloud even if you lose your phone.
Frequently asked questions (FAQ)
Can it be unlocked phone via call?
This method worked on very old versions of Android (2.x and below). The idea was to call a blocked number, accept the call, minimize the phone application and have time to go to the settings to turn off the blocking. On modern smartphones with multitasking and screen protection, this method does not work. doesn't work.
Will unlocking via Find My Device delete my photos?
No, if you use the “Lock” function to set a new password, the data is saved. Data is deleted only if you select the “Erase” function, which is intended for cases where the phone is stolen.
What to do if the phone says “Device is infected” after removing the key?
Often, after incorrectly unlocking or using third-party software, the security system may issue false alerts. Try restarting your smartphone in safe mode. If the problem persists, the system partition file may have been damaged and a flashing will be required.
How to remove the lock if the screen is broken and the sensor does not work?
If the sensor does not work, but there is an image, connect a USB mouse via an OTG adapter. The mouse cursor will allow you to enter the pattern. If the screen is completely black, but the phone works, try connecting a keyboard and using key combinations (if supported) or the Find My Device service to change the lock type to a PIN code, which is easier to enter blindly.
Will removing the SIM card help remove the lock?
No, removing the SIM card does not affect the lock screen pattern or password in any way. This data is stored in the internal memory of the device and does not depend on the presence of a SIM card or network access, although the network is needed for some recovery methods via a Google account.