Added lock screen pin to encrypted device - can't unlock on boot now I have an encrypted cyanogenmod 13 device. I set the password manually via the command line using a guide like this. More recently I added a lock screen pin, and I think I set it to not ask on boot but I'm not certain now. I rebooted the device for the first time since adding the new pin but I can't unlock it now.

When it boots, it's loading the same disk unlocking screen as before, but it's asking for the pin instead. Entering it doesn't work, however. Since it's expecting a pin all it presents is a number pad - can't type the encryption password in case that's what it wants.

The question is, obviously, how can I unlock it. I know both the encryption password and the lock screen pin so I could do it via the USB+command line but neither ADB nor fastboot detect any devices.

Some users elsewhere have suggested trying the sim pin but a) same thing happens when sim is removed and b) the sim pin doesn't work anyway.

I'd like to get this unlocked soon, if not possible I need to do the whole setting up from scratch process as soon as possible.

Note: I have access to the device via the teamwin reovery thing which has a filemanager and terminal. Is there some command I can run to set the unlock type/keyboard back to normal?



Edit: I was able to use ADB when in recovery mode, but obviously changes made to settings.db don't propagate. What do I need to do to regenerate the "initramfs" or whatever android uses that contains all the necessary data to boot when encrypted? I assume that it has it's own copy of settings.db.
Since I have access to the recovery, I simply backed up everything, did a full-format (which wipes the encryption), restored, disabled the damn lock screen pin and then added the encryption again.

Not the ideal solution but hopefully helps someone in a similar situation.