[HTC U12+ ROMs, Kernels, Recoveries, & Other Develo] Freak07:
F.A.Q.:

Q: Which TWRP.img to choose for my current Security Patch State

A: For the old base 1.15 use on of the unoffical 1.15 release found in the OP.

TWRP Image 3.2.3-1.img decrypts devices, which run firmware on the 1st June Security patch State.

TWRP Image 3.2.3-2.img decrypts devices, which run firmware on the 1st September Security patch State.

The zip installer (also from the 3.2.3-2 release), however, will work on any patch level, but if you're on stock kernel, you will still need to flash the hex patcher or a custom kernel to have working touch when rebooting into recovery mode.

Q: I´m not able to fastboot boot the recovery, because the command won´t execute properly.

A: Update your adb and fastboot binaries to the latest one found here:

https://www.xda-developers.com/google-releases-separate-adb-and-fastboot-binary-downloads/

Make sure you´re using the original cable.

Make sure you are in bootloader mode.

Try different USB ports on your machine.

On windows make sure you have the latest usb/mtp driver installed properly when the phone is connected in bootloader mode.

Q: I flashed the permanent twrp installer zip and now my touchscreen is not working.

A: This happens when you´re on stock kernel and did not flash the hexpatch-touchscreen zip found in the OP.

Q: I flashed the permanent twrp installer zip and the hexpatch-touchscreen zip found in the OP. Now commands/actions like

adb reboot recovery

reboot to recovery button in magisk manager

reboot to recovery button in TWRP

are only booting me straight to the OS.

A: As mentioned in the OP flashing the hexpatch-touchscreen zip will break the reboot to recovery command and associated actions.

To get to twrp reboot to bootloader and from there choose reboot to recovery with volume buttons and confirm with the power button.

Q: I flashed the permanent twrp installer zip, booted to the OS and lost root

A: Directly after flashing the twrp installer zip flash the magisk zip to keep root!

Q: I only fastboot booted TWRP but now my OTA functionality is broken.

A: Fastboot booting the twrp image trips a check, this check isn´t able to determine if system has been modified (because it receives no output) and subsequently assumes it has been modified.

this breaks verity on system and probably vendor. Resulting in non existing OTA functionality.

If you are interested in a more detailed explanation please follow this link:

https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1301

to check if system has been modified check the following path:

"/sys/fs/" + Current_File_System + "/" + block + "/lifetime_write_kbytes"

Current_File_System is ext4 on the U12+

block is related to your boot_slot. so check the partition table here:

https://xdaforums.com/u12-plus/how-to/guide-how-to-root-u12-magisk-tips-tricks-t3802583

if you´re on slot A: system_a is sda18

if you´re on slot B: system_b is sda19

Example:

I was on slot B so the file I needed to check was: `/sys/fs/ext4/sda19/lifetime_write_kbytes`

if this file shows 0 system was not modified. Any other value means it was modified and you will not be able to take an OTA!

Same check applied for vendor! you just have to adjust the path.

Slot A vendor: sde19

Slot B vendor: sde40

Example to check if vendor_b has been modified: /sys/fs/ext4/sde40/lifetime_write_kbytes

To restore OTA functionality follow this post:

https://xdaforums.com/showpost.php?p=76606113&postcount=3

or alternatively:

1. after updating your device via RUU or OTA, patch the boot.img with magisk (look at my guide thread)

2. run the following command on either a terminal shell on the phone or via adb shell on your pc(don´t forget to grant su permissions) to obtain an untouched system.img:

dd if=/dev/block/bootdevice/by-name/system$(getprop ro.boot.slot_suffix) of=/sdcard/system.img

3. store this system.img somewhere safe

Additional info:

you can also backup vendor this way!

dd if=/dev/block/bootdevice/by-name/vendor$(getprop ro.boot.slot_suffix) of=/sdcard/vendor.img

Information: Please note that only perm s-off devices are able to flash the vendor.img in fastboot!

Q: Is there a way to restore OTA functionality and keep using TWRP?

A: Yes there is. Please read below! thanks to [MENTION=4544860]osm0sis[/MENTION] who came up with the idea!

Temporary Workaround for TWRP mounting /system as RW

the issue linked here: https://github.com/TeamWin/Team-Win-Recovery-Project/issues/1301, which is causing TWRP not being able to mount system as read-only, results in a non pristine system partition after booting TWRP once.

The following file will allow TWRP to mount system as read-only (and therefore keeping OTA functionality)

That means after the following procedure, you can restore an untouched system.img, keep TWRP flashed on your device and simultaneously be able to take OTAs!

Instructions:

1. Download the following file https://www.androidfilehost.com/?fid=1322778262904004337 and extract it! (also as attachement to this post)

2. Copy/Replace the .twrps files to

/persist (make sure to grant the correct permissions afterwards! 0664 | rw-rw-r-- )

/storage/emulated/0/TWRP

with the one you just downloaded

3. When now booting/flashing TWRP system will get mounted as read only.

4. You can now restore a pristine system.img to your device! TWRP shouldn´t mount it as RW now!

5. Check if everything worked by following the guide above (check file lifetime_kbyte_writes for your active system partition)

A huge thanks to [MENTION=1238555]MassStash[/MENTION] for testing all this!