Erase LG V20 Disk Encryption Key

Last modified by Leon Poon on 2020/09/20 14:28

In a LG V20, Full-Disk Encryption (FDE) makes use of Secure Execution Environment (SEE, by Qualcomm). The password/pin you provide to Android will be used to unlock encryption key stored in SEE.

When Lineage OS (as of 17.1) encrypts an unencrypted disk, it tries to set up SEE with your password/pin. If SEE was already previously set up with an old password/pin at that time, it will reject the attempt by Lineage OS to set up a new one. This drops your phone into a boot-loop because Lineage OS is not able to make use of SEE for FDE.

If you erase the current key from SEE then SEE will accept a new setup from Lineage OS.

How to erase FDE encryption key from SEE:

  1. Root - use magisk
  2. Download the attached mymod binary executable into your phone.
  3. Do adb shell
  4. Become root: su
  5. move theĀ mymod file into /sbin
  6. chmod +x /sbin/mymod
  7. Run: /sbin/mymod

You can check whether it has successful removed the old key material by looking at logcat for lines starting with "mymod". Indication of a 0 status means successful.

After running mymod and successfully removing the pre-existing encryption key from SEE, you can immediately ask Lineage OS to do FDE.