Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redmi Note 11S : incorrect critical_lock_state in seccfg #1236

Open
pierre-durand opened this issue Oct 3, 2024 · 1 comment
Open

Redmi Note 11S : incorrect critical_lock_state in seccfg #1236

pierre-durand opened this issue Oct 3, 2024 · 1 comment

Comments

@pierre-durand
Copy link

My phone is a Redmi Note 11S.
The seccfg partition is V4.

In unlock mode, field critical_lock_state is incorrectly set to 1 (instead of 0).
It has no effect with Android 11, but with Android 13, dm-verity complains at startup!

This can be fixed in bootloader mode:
fastboot oem cdms fix
This simply sets critical_lock_state to 0 in seccfg partition (+rehashing...).

This patch works for me:

--- mtkclient/mtkclient/Library/Hardware/seccfg.py	2024-10-03 15:36:45.159499963 +0200
+++ mtkclient/mtkclient/Library/Hardware/seccfg.py	2024-10-03 15:38:02.693707339 +0200
@@ -87,7 +87,7 @@
             return False, "Device is already unlocked"
         if lockflag == "unlock":
             self.lock_state = 3
-            self.critical_lock_state = 1
+            self.critical_lock_state = 0
         elif lockflag == "lock":
             self.lock_state = 1
             self.critical_lock_state = 0

If this is specific to my hardware, maybe there could be a flag to set critical_lock_state with a custom value?

@pierre-durand
Copy link
Author

Of course, I disabled verification flags in vbmeta. But it seems flags in seccfg has a precedence there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant