[Xiaomi Mi 5s ROMs, Kernels, Recoveries, & Other De] htchd2sucks:
I don't know if I am tired or if you explain terribly, let me rephrase so we have some understanding.

You can boot in RECOVERY even without the encryption password, but then it won't mount the /data as unable to decrypt.

You can not boot in SYSTEM (android os, LOS or whatever rom) without the actual encryption password. It will become stuck at the password/pattern prompt. Therefore it's 100% unable to access any settings to disable that method.

I have tried numerous methods for days, and while I don't know everything, I think that's impossible by design. Even trying to boot in safe mode, use adb to replace some files, etc... won't work.

The only way is to wipe again, which would result in the password/pattern files to be removed and the system won't ask for them in boots.

Unless we are talking about a different password, not the one related to secure boot, but then it's getting even more confusing.

In fact, it appears likely due to the user information, that he run into the same problem I investigated for like 100 hours, system asking for pin/pattern when a different method was used.

That could be a new variation of the problem.

---------- Post added at 08:11 AM ---------- Previous post was at 07:59 AM ----------

Thanks for the help but that's absolutely not a solution (it's a poor workaround) and the post reference is wrong:

Page 43 there's only this from you which seems related: (post 426)

https://xdaforums.com/showpost.php?p=77497467&postcount=426["]https://xdaforums.com/showpost.php?p=77497467&postcount=426"]https://xdaforums.com/showpost.php?p=77497467&postcount=426[

You said "Encryption problem, decrypt your phone first via formating data in twrp then you don't have any problem."

Formating the /data is not decrypting, that's incorrect. It's formatting everything, including the encryption. It never decrypts but removes it entirely (suprress).

And that's a complete different action, the problem can come not from the actual encryption but how the system is handling files related to encryption, on system level. In other words, even when the phone is properly encrypted, it can produce that result.

And removing encryption is also not necessary as LOS16 can work on encrypted device without problem.

The more I use my brain on that particular problem, the more I remember about it, and the more I realize why I'm surprised it might be here... Because I worked on another ROM for another device. Therefore, the fixes are not on LOS16 for Capricorn but on another rom. I will try to contact LuK and put him in contact with the dev from the other rom, who fixed the issue.

---------- Post added at 08:26 AM ---------- Previous post was at 08:11 AM ----------

[MENTION=5075128]LuK1337[/MENTION] Hi there, Witam from your motherland!

That user claims the system on LOS16 is asking him for a password, allegedely never set.

If true, that issue reminds me very much on a problem I encountered in Android 9 (pie) on Pixel Experience rom on device called Whyred.

I worked numerous hours on it and clearly something has been changed on various levels regarding how the system would check for encryption using PIN/PATTERN and how it would prompt users for it.

During the investigation, we found that it was also impacting recovery (maybe issue was a bit different) and the one from OrangeFox had used a workaround at that level: they added a button to ask PIN, that way even if the system ask for PATTERN (which might have never been set), at least the recovery would ask for both to attempt decrypting /data (https://gitlab.com/OrangeFox/Recovery/commit/a081410dd4d7909de08756efa67851104c5659cf).

At system, the issue was also there, often asking for PIN/PASSWORD even when not set, or switching that. In the end I don't exactly know what was changed, but I had looked deeply and that was not that complicated as looking into locksettings.db or similar. I think that was a simple situation where a value has changed and some files had to be modified to reflect those changes.

The thread is here, I know there was a commit on github related to that but I don't know exactly and I don't have the time right now.

https://xdaforums.com/redmi-note-5-pro/development/rom-pixel-experience-t3830197

If you dig a bit from there, I'm sure you'll find the exact file and exact changes. Worth to have a look because I think that's the same root cause, if that problem is really true.

PS: We all know, that user could format /data, redo the encryption and reinstall the system, but if the problem is there, better to actually fix it for everyone.