Skip to content

Encryption auto detection

Simao Gomes Viana edited this page Nov 17, 2019 · 13 revisions

How it works

  1. Check if FDE encrypted
     -> if yes, dynamically set flags for FDE
     -> if no, proceed with 2.
  2. Check if FBE encrypted  -> if yes, dynamically set flags for FBE
     -> if no, proceed with 3.
  3. Assume device is decrypted, remove all encryption flags

Pick following commits:

https://github.com/halogenOS/android_system_core/commit/301f4659bf83063a186249742dda8e9ae44eeb00
https://github.com/halogenOS/android_system_core/commit/604da74a79aa95c43525203024da56e80ad35207
https://github.com/halogenOS/android_system_core/commit/0ff53949b0f384909727427e28ce9dd24708cee2

Do this in your device tree:
https://github.com/halogenOS/android_device_oneplus_msm8998-common/commit/9ebd98f2d6627281f0a074d1d27e7652e2c11dde

Basically this adds autodetect_crypt and make sure you keep the FBE and FDE configs for your device, e. g. fileencryption=ice,encryptable=footer,length=-16384

Have fun