[Redmi K20 / Xiaomi Mi 9T ROMs, Kernels, Recoveries] raulpesch:
Step-by-step instructions for newbies

I'm new to Android and for a newbie I found the installation procedure often complex, confusing and frustrating. I've experiences countless boot loops, TWRP boot issues, fears of having bricked my phone. I've therefore created this instruction. Maybe other Android newbies that want to experiment with Pixel Experience on their Mi 9T/K20 get some value out of it.

TIP: If you screwed up, try repeat step 3 & 4 again to reset the device to factory ROM.

In my case, if I follow the steps below to the letter. I can get PE running on any Mi9T/K20.

However, results may vary.

FIRST: Connect your device to USB. Please note that the procedure below will erase all data!

1) UNLOCK DEVICE

a. Download miflash_unlock from http://en.miui.com/unlock/download_en.html

b. Extract the zip file to a new folder: c:\xiaomi

c. Put your Xiaomi device in Fastboot by keeping Volume DOWN + Power On/Off pressed

d. From c:\xiaomi, run: miflash_unlock.exe

e. Reboot your phone after it has been unlocked successfully

(note that Xiaomi has a wait time before your phone can be unlocked)

2) INSTALL TOOLS

a. Download files from: https://xdaforums.com/showthread.php?p=48915118#post48915118

b. Extract the zip file to c:\xiaomi

c. From c:\xiaomi run adb-setup-1.4.3.exe

3) CLEAN UP EVERYTHING

a. Put your Xiaomi device in Fastboot by keeping Volume DOWN + Power On/Off pressed

b. Open a Command Window (Start > CMD)

c. Type: fastboot erase system -w

d. Type: fastboot erase boot

e. Type: fastboot erase recovery

f. Type: fastboot reboot

4) FLASH A CLEAN FACTORY ROM

a. Download the latest ROM (select type: Fastboot) from: https://xiaomifirmwareupdater.com/miui/davinci/

b. Unpack the file to c:\xiaomi

c. Open a command prompt and type: cd\xiaomi

d. type: flash_all.bat

e. Once the phone reboots, keep pressing Volume DOWN + Power On/Off to enter Fastboot

5) INSTALL TWRP RECOVERY

a. Download TWRP recovery for the K20 Mi9T from here: https://xiaomi-miui.gr/community/index.php/Thread/25256-TWRP-3-3-X-X-για-συσκευές-XIAOMI/

c. Save the downloaded file in c:\xiaomi

d. Open a command window and type: fastboot flash recovery c:\xiaomi\[name of the downloaded image].img

e. Reboot you phone by keeping Volume UP + Power On/Off pressed until it vibrates and you see the Mi logo.

f. You are now booting into TWRP

6) COPY IMPORTANT FILES

a. On your PC, download Magisk from: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445

b. On your PC, download Permissiver_v4 from: https://androidfilehost.com/?fid=6006931924117886495

c. Copy the downloaded ZIP files of Magisk and Permissiver to the TWRP folder on your device

d. On your PC, download PixelExperience from: https://xdaforums.com/mi-9t/development/rom-pixel-experience-t3953280

e. Copy the downloaded PixelExperience ZIP file to the TWRP folder on your device

7) INSTALL PIXEL EXPERIENCE

a. In TWRP click Install and select PixelExperience

b. Click the button "Add more Zips" and add Magisk

c. Click the button "Add more Zips and add Permissiver

d. Wipe Cache/Dalvik

e. Reboot

8) INSTALL EXTRA'S

a. Install Google Camera (Gcam): https://www.celsoazevedo.com/files/android/google-camera/dev-urnyx05/

This version supports all lenses. Turn it on in settings. In my case, front-cam video does not seem to work...

b. Change the version of your phone to Google Pixel 2 by downloading this ZIP and installing it via Magisk Manager.

This will allow you to install Pixel-only apps from Google Play (eg. ARcore)

https://f.celsoazevedo.com/file/cfiles/gcm1/ARCore_Playground_Patcher-v1.6.zip

c. Open Magisk > Setings > Turn on Fingerprint Authentication (in my case, this solved the ctsProfile error in Magisk)

You device will restart and -after a short while- boot into Pixel Experience.

Enjoy it, it's great!

NOTE: To upgrade to a newer version without wiping your configuration/apps etc: download the new version of Pixel Experience for K20/Mi9T and follow steps 6E till 7E above.

Edit 15/8/2019: After using it for a few days I'm still impressed. More than good enough to work as a daily driver. I've listed below what works and what doesn't work.

Any recommendation to fix these is appreciated.

What does work (to my surprise):

- Behind glass fingerprint registration & unlock

- Face unlock with pop-up front cam

- NFC payment (bunq bank app)

- Same long battery life

- All 3 lenses in Gcam

- Everything else

What doesn't work:

- Double Tap to Wake

- Google Playground (AR)

- Slow motion and Photo Kiosk in Gcam

- I noticed that I cannot do front cam video. May need to try another Gcam APK.

- in some apps the fingerprint overlaps with the keypad making it hard to press '8'

- Netflix does not show in Google Play Store when your device is rooted.

- I disabled Pocket detection as a precaution (some suggested it may cause deep sleep)

- Adaptive Brightness. When enabled, the screen toggles unpredictably between bright and dark.

See below a potential fix in case you run into issues:

Please note: In case your device turns totally dark directly after boot, do this:

- Remove the SIM

- Find a bright room (sunlight preferred)

- Reboot by pressing power until the logo appears

- Wait until the screen turns dark (press the power button if you see the clock)

- Swipe down from the top

- You still won't see anything yet but the brightness slider is approx 1 cm from the top. Try and swipe it to the right. Keep trying until the screen lights up.

- Disable Adaptive Brightness (Settings > Display > Adaptive Brightness)