[Pixel C Android Development] ipdev:
Hi all. :D

Have an issue that very well is a local issue.

Might also explain issues other users have on this and/or other devices.

I think something became corrupt or a settings flag is not getting reset.​

Since this post became long, I put most of the details in a hide tag.​

I did not have this issue a month or two ago, since then I have flashed Stock Google multiple times testing Magisk.

Magisk canary 22006 includes a regression fix that affected dragon.​

You can again use the Direct install method in Magisk (22006+) on dragon.​

---

Stock Recovery takes under a minute to Format/Factory reset.

LineageOS Recovery takes under a minute to Format data/factory reset.

I ran a l18 dragon build to get LineageOS recovery for dragon.

Stock and LineageOS recovery can format data even if it is an empty partition.

Lineage Recovery (fastboot erased userdata)

Example:

Start at 23:00:38 Done at 23:01:15. (37 Sec.)​

---

Did not matter what version of TWRP I used.

twrp-3.1.0-0-dragon.img

twrp-3.2.3-0-dragon.img

twrp-3.3.1-2-dragon.img

twrp-3.4.0-0-dragon.img

twrp-3.5.0_9-0-dragon.img

twrp-3.5.1_9-0-dragon.img

Reverted back to using 3.5.1_9-0

TWRP Recovery takes ten minutes (give or take) to format data.

Example:

Start at 14:47:38 Done at 14:58:13. (10 Min. 35 Sec.)​

If I erase userdata (data) in fastboot then boot into TWRP.

TWRP can not decrypt and asks for a password.

This leaves TWRP in a useless state since I can not format or wipe or install.

Cache, Data, System and Vendor can not be mounted.

If I format userdata in fastboot, stock recovery or Lineage recovery.

TWRP will boot without asking for a password and I can format, wipe and install.

This is the same issue I had with Google stock when testing Magisk and data was actually encrypted.

For testing Magisk, I could use adb sideload and install magisk since it was patching boot.

Stock boot image backup was lost since it could not be save to data.

---

Go though the format, wipes and do a clean install of Lineage and OpenGApps.

For magisk I have to use a boot image patched using the Magisk app.​

- See below for reason. -​

Booted into system (Lineage 18.1), I am unencrypted as expected.

dragon:/ # getprop | grep crypto
[ro.crypto.state]: [unencrypted]

Booted into TWRP, I show encrypted. WTF?

~ # getprop | grep crypto
[ro.crypto.state]: [encrypted]
[ro.crypto.type]: [file]

If I flash Magisk in recovery..

TWRP shows encrypted, Magisk finds it and patches the boot image accordingly.

Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[true]

LineageOS show nothing, Magisk finds it and patches the boot image accordingly.

Patch with flag KEEPVERITY=[true] KEEPFORCEENCRYPT=[false]

---

I have done a few things that I would never suggest to others to try. 🙃

- I made a restore plan, best as I could, for each step.

- Realized I could very well HARD brick the device.

I even erased persist and let it regenerate on boot with Lineage 18.1.

Still was encrypted when booted into TWRP. :(

This broke the ability to LOCK/UNLOCK bootloader.​

The oem unlock option was even greyed out and not accessible in the stock (Google) rom.​

I dumped PST before I erased persist.

'persist' is not the bootloader partition name.​

I am using the common name so others could not just fastboot erase NameOfpartition.​

I was not sure that PST was persist but, it seemed my gamble was correct?​

Restoring the dump fixed locking/unlocking bootloader. ;)

---

Anyone have an idea of where an encryption flag might still exist after erasing/formatting partitions or what may have become corrupt ?

Cheers all. :cowboy: