[Magisk] pndwal:
Nice Surprises for Redmi Note 8T / other Xiaomi users:

1) As mentioned, some anomaly is causing a fallback to BASIC key Attestation after bootloader is unlocked (with no other intervention), and SafetyNet evalType now returns BASIC... I hope this is a long term occurrence.

Please report if other Xiaomi device's similarly show BASIC after bootloader unlock.

2) I've been checking on reports many Xiaomi devices can install Magisk to boot.img with no issues despite Magisk Manager showing Ramdisk: No (with no issues), and found this explanation from John Wu:

https://github.com/topjohnwu/Magisk/issues/3239

This does seem to contradict the previous statement:

So I deduce from this that while Type III (method B) device's have no ramdisk set up in boot.img (because kernel directly mounts system as root directory (SAR) (and boots), if boot.img is patched with Magisk (SU), an effective ramdisk space is created.

Seems this ability was added in Feb 2019 ( https://github.com/topjohnwu/Magisk/commit/e72c6685edf81706617a3444575c4500b9b8fe6c ). And because bootloader has retained compatibly with initramfs, this causes kernel to mount initramfs (Ramdisk) as root directory before system is mounted as root directory (and booted). Effectively, method C, utilising 2SI (2 Stage Init), has replaced method B.

NB. Legacy devices similarly change from using method A to method C (2SI) after update to Android 10.

Also, interestingly

So it seems Google updated bootloader and/or added initramfs (ramdisk) to boot.img for these devices so they too can utilise method C.

Other devices are 'stuck' ONLY in the sense that OEMs have not added such support, but are NOT if bootloader is compatible with ramdisk and a custom mod like Magisk patches boot.img with initramfs (ramdisk).

Anyway, when patching boot.img (recovery option unchecked) I get:

- Device platform: arm64-v8a
- Copying image to cache
- Unpacking boot image
- Checking ramdisk status
- Stock boot image detected
- Patching ramdisk
- Repacking boot image

****************************
Output file is written to
/storage/emulated/0/Download/magisk_patched.img
****************************
- All done!

... And I'm happily rooted after flashing magisk_patched.img to boot!

Of course the fact that Ramdisk compatibility is present but not detected in M Manager is an anomaly although the No response is technically correct; ramdisk is not used, or present, but may be added 'manually'.

Also, the statements in Installation Instruction / Magisk in Recovery "If your device does not have ramdisk in boot images, Magisk has no choice but to be installed in the recovery partition. For these devices, you will have to reboot to recovery every time you want Magisk" don't account for / simply are NOT true of device's retaining bootloader compatibility with ramdisk. Ironically, the 'choice' Magisk will make if forced (ie, by user selecting patch boot image method) is to ADD Ramdisk (containing Magisk SU) to boot.img (despite not having established bootloader compatibility).

Conclusion: Because "it is literally impossible for Magisk to know whether a device bootloader accepts ramdisk", it seems well worth trying patching boot image method on devices slated for patching recovery image only (boot-type III device's), just as a check to see if patched image boots w/ Magisk... This beats always booting to recovery any day! :D ... Simply flash original boot image to revert.

Hope it helps some. :cowboy: PW