Forgot your Android display pattern/password/PIN? Solution on how to unlock it
An android smartphone can be protected from unauthorized access using a pattern, a PIN or a password. Each time someone wants to use the device, the previously setup pattern, PIN or password needs to be entered to gain access.
Unfortunately, it's possible, especially when the device is not used for a long time, that the owner of the device can not remember the setup pattern, PIN or password. To gain access again, there're different approaches which are explained on this page. The solutions differentiate themself, in general, by the ability to be able to access the data saved in the device afterwards. Some of the provided solutions include the loss of the data saved on the device, as long as there was no backup made before.
Generally spoken: Currently, there's no way of gaining access to the device without loosing all of data saved on it, as long as the you can not have have root access on it.
Solution 1: Reset pattern/PIN/password using Find My Device
Some users where able to reset their display security using the service Find My Device. For that, open your google account and navigate to the Security section and scroll down to the Your devices area. Click on Manage devices (direct link). In the list of the devieces, click on the 3-dot-menu of the device you want to unlock and select the function Search Smartphone. On the new page, you can use the feature Lock smartphone where you can reset the display security with a new password.
Alternatively, the feature is also available from the Find My Device portal.
In newer versions of the service, Google does not allow to set a new password for the display security anymore, if there's already a display protection setup. If you lock your device, the already setup pattern/PIN/password is used.
Some device manufacturers provide a similar service, which may also allow you to unlock the device using a web interface. Usually, it is required to activate that service or feature beforehand. If you did that before you forgot your pattern, PIN or password, you may be able to unlock your device using one of the services. Among others, these manufacturers provide such a webservice:
- Samsung: Find My Mobile
- Sony: MyXperia (service discontinued and forwards to the Find My Device portal from Google)
Solution 2: delete pattern/PIN/password (requires root access)
No data will be deleted when using this solution.
There's a possibility to delete the pattern, PIN or password setup on the device.Cite error: The opening
<ref> tag is malformed or has a bad name When doing this, the device is acting as if there was no setup display protection at all. This, however, is only allowed to be done on your own device; doing it on devices you do not own may be a violation of laws.
- Connect the phone with your computer
- Open a:
- terminal on a linux-based computer
- a command-line window on Windows computers (by pressing the Windows key together with the [R] key and type "cmd" in the Run window followed by pressing the [Return] key. You may also need to navigate to the installation location of the adb.exe
- Execute the following commands:
adb remount # für ein Muster adb shell rm /data/system/gesture.key # für ein Passwort/eine PIN adb shell rm /data/system/password.key
Afterwards the pattern is deleted. If the phone is still requesting to put in a pattern, PIN or password, you can enter whatever you want, the phone will give access no matter what you put in there. If you got access to the device, navigate to the settings and setup a new display protection.
Since Android version "Marshmallow", information regarding the lock method of the display protection and related data is not saved in the gesture.key or password.key files anymore, but instead in new files which contents will be calculated using the gatekeeper-service. That also means, that you need to delete different files when trying to unlock an android 6.0 "Marshmallow" device with this solution:6.0
adb remount adb shell rm /data/system/gatekeeper.password.key adb shell rm /data/system/gatekeeper.pattern.key adb shell rm /data/system/locksettings.db
If an android device has a display protection setup, a file named gesture.key or password.key (or the gatekeeper files on Android "Marshmallow" devices and higher) is created in the /data/system directory. In this file, all required information about the pattern, PIN and password are stored. If you remove these files (using the linux utility rm), the system does not know the protection anymore and will accept anything.6.0
Solution 3: Reset the phone
Using this solution you will loose all data saved on the device.
If no other solution is available anymore, the last thing possible is to reset the phone.
The easiest and hassle-free , but also a non-free possibility to reset the phone is by letting your provider to that. Usually you need to send your device to an address provided to you by the carrier and pay a fee for that. Not all carriers may provide such a service and the cost may vary a lot as well.
Most manufacturers provide a way to reset the phone through their bootloader of recovery system (a so called factory reset). The way of doing it may depend on the device you're using, but usually the following steps needs to be done:
- Turn off the device
- Press the Volume up- (Home-) and Power on-key simultaneously
- Navigate to the function Factory Reset (or similar) using the Volume up and down keys and confirm the selection with the power on key
- You may need to confirm that you want to reset the device by navigating to yes with the Volume up and down key nd confirm your selection with the power on key
The device usually restarts after the reset was done and the pattern/PIN/password, as well as all the other data on the device, are deleted. You also need to setup the phone from scratch now.
On Samsung and Sony devices (not all devices may support this, though), you can also reset the phone from the emergency call screen:
- Seelct the Emergency key on the display security screen
- Enter the following number:
- Samsung: *2767*3855#
- Sony: *#*#7378423#*#*
- The device will be resetted
- "Download Android Studio and SDK tools | Android Developers". Android Developers. Abgerufen am 2019-11-02.
- "Gatekeeper | Android Open Source Project". Android Open Source Project. Abgerufen am 2019-11-02.
- "Wire up GateKeeper to LockSettingsService · aosp-mirror/platform_frameworks_base@8fa5665". GitHub. Abgerufen am 2019-11-02.
- "Question| cracking Android M pattern,pin code,password". hashcat.net. Abgerufen am 2019-11-02.
- "Restore TWRP backup breaks password pin/pattern. Unable to get back into device. - Android Forums at AndroidCentral.com". forums.androidcentral.com. Abgerufen am 2019-11-02.
- "Password storage in Android M". nelenkov.blogspot.de. Abgerufen am 2019-11-02.