After moving gatekeeper.pattern.key to unlock, Settings>Security keeps crashing Context: I forgot my unlock pattern, so I used TWRP and ADB to move gatekeeper.password.key and gatekeeper.pattern.key to /sdcard, so now I am able to use my phone again :-)

Problem: I want to set a new pattern, but whenever I go to Settings>Security and press Screen lock, it crashes:



How to solve the problem?

I restarted, cleared all apps cache, wiped the cache partition from TWRP, booted in safe mode, always crash. I am afraid that if I move the files back the situation will get even worse, or at best it will ask me for the pattern that I still can't remember.

Android 7.1.2 LineageOS
In a web browser (on any device), log into Gmail with the account you used when setting up your phone.
Go to https://myaccount.google.com/intro/find-your-phone
Press "Lock your phone"
Enter "abcd"
Your phone's screen is now locked. Unlock it with "abcd"
You can now change your screen lock.