[Miscellaneous Android Development] Dib Membrane:
***WARNING*** — My R2 was bricked by rooting; feedback on guide Part 3

Everything went smoothly for me until this point, beyond the few oddments I mentioned above. I successfully did a full backup to my microSD with TWRP, then set all my apps and settings back up from the phone's factory reset state, then did another backup, and prepared to root.

Yup, did that. I wondered whether it'd be safer to root immediately after TWRP installation, and before re-doing initial setup on the phone, but I wanted to make sure everything seemed to be working normally before I rooted, and it was. Before proceeding to root, I confirmed with 'adb shell' that the custom fstab.qcom was still in place in /vendor, and I did 'mount | fgrep /data' and didn't see any attributes indicating the partition was encrypted. I also went into the Android security settings, and it was giving me the option to encrypt the device, which I did not do. So I figured I was good.

A custom kernel compiled from incomplete source sounded more prone to trouble, especially if ZTE and Visible do actually put out Android Pie for the R2 as they've indicated (though the "~9/16" date mentioned in that "New Android support!" Reddit thread has come and gone, and checking on a family member's R2, the current OTA is still the May 1, 2019 one). I just wanted working root, and was blissfully ignorant of what features I was missing out on from Magisk 19.3, so I figured I'd conservatively go with 16.7 and not replace the boot.img.

BTW, it'd be nice to expand on "flash it through TWRP" by saying that you copy it to the microSD (or internal) and then use TWRP's "Install" button. While installing 16.7, this message in the on-screen log relating to target image /dev/block/mmcblk0p20 surprised me:

Encrypted data detected, keep forceencrypt

since as noted above, I had changed to optional encryption, and AFAICT, encryption was not active. If this message is to be expected, it'd be good to document that so the user knows they haven't done something wrong.

Also, given the warning "DO NOT flash any zip that removes dm-verity and force encryption" in Part 2, the message:

Removing dm(avb)-verity in dtb

also gave me the heebie-jeebies. Is it supposed to say that?

I don't recall whether I got the double-reboot or not (I don't believe so), but unfortunately I never did get the "loading the system normally" part. After installing TWRP, I set my swipe code back to what it had been originally, but after booting post-Magisk-install, it suddenly claimed my pattern was incorrect! :eek:

I tried a few more times, rebooting between most of the attempts, but to my dismay I saw that the 10-tries-before-factory-reset counter didn't go back to 0 on reboot. I tried running ADB, but found that it couldn't see the device at that pre-unlock stage.

I figured I better restore from my pre-rooting TWRP backup, but when I rebooted while holding Volume Up, it just hung indefinitely on the initial white ZTE / Powered by Android screen. I held down power for a long time and it finally powered down. I powered it back up without Volume Up, and it came up normally to the authentication screen, but my pattern was again rejected.

Tried a few more times to launch TWRP, never with any luck. Booting without Volume Up did come up normally, but my swipe code was always rejected. On one of the boots, I had a weird issue where immediately after getting the prompt to swipe up to enter my swipe code, I tried to swipe up, and the screen froze in a partially swiped-up state. It'd sit there frozen for a few seconds, then the screen would go black. It still responded to the power button, and would turn on the screen for a few moments, but it was still frozen.

After the next reboot, I waited longer (letting all the background services finish coming up) before trying to swipe up, and this time it worked normally and let me try swipe patterns. I tried a close variations on my real one, but no luck.

I was confident I'd carefully used all the correct files and followed the instructions correctly, so at this point I figured I had no other option than to run the counter up to 10, let it do its factory reset, then install TWRP again, and try again with Magisk 19.3. Unfortunately it didn't work out that way. :crying: