[Xiaomi Mi A1 Guides, News, & Discussion] joeyhuab:
Disclaimer:
I am not responsible for anything that may happen to your phone as a result of installing this GSI and/or kernels. You do so at your own risk and take the responsibility upon yourself.

MOD EDIT: Remember to be prepared for an experimental or unstable ROM. If do you not know what you are doing or not experienced with flashing and recovering your data then it's not recommended.

REMEMBER TO BACKUP EVERYTHING AS THIS WILL REPARTITION YOUR USERDATA AND WILL WIPE YOUR INTERNAL STORAGE. ALSO, REMEMBER TO READ EVERYTHING AS ALL FIXES ARE POSTED BELOW. DON'T JUST FLASH THEN JOIN TELEGRAM TO ASK WHY THIS DOESN'T WORK FOR YOU.

READ THE IMPORTANT NOTES POSTED HERE​

TO REVERT TO NON-TREBLE/STOCK ROM, WATCH THIS VIDEO BY @GizmoFreak OR FOLLOW THIS POST

Here's everything I can provide to the normal user willing to try this out on their Mi A1.

PLEASE VISIT THIS NOTE TO SEE ALL THE REMAINING BUGS

OR JUST READ THEM HERE

SELinux is permissive

Hw key lights don't light up

Everything else works fine. Just need to update your Google Play services app and you can restore apps via Google Backup (if you didn't already do it with Titanium Backup). Yes, rooting with Magisk works and some modules work as well such as Blobmojis among others.

Here are the steps to install it in your Mi A1 if you're coming from stock ROM

Or watch a video made by [MENTION=3294422]GizmoFreak[/MENTION]

[YOUTUBE]UgA6sI_VZ1g[/YOUTUBE]

Enable Developer options in Settings app

Check Enable OEM Unlocking

Reboot to fastboot mode

Unlock your bootloader

Install TWRP-fastboot only through fastboot boot command (Extract the .img file from the zip)

Flash CosmicDan's TWRP Installer through your current TWRP. Credits to @CosmicDan for his TWRP and @mohancm for official TWRP sources.

Reboot to TWRP recovery

Go to WIPE then ADVANCED then click FORMAT data. This will remove Encryption on your device and allows you to set new passwords when installing the GSI. Note that this will format your internal storage.

Treblelize through TWRP Tissot Manager (Go to advanced, click Tissot Manager and choose the repartition userdata option. Select singleboot option then click repartition)

Flash latest Vendor.img as VENDOR IMAGE

Flash A/B system Pie PR2 img as SYSTEM IMAGE (Extract the .img file from the zip) (special thanks to [MENTION=6292495]dgadelha[/MENTION] for the sGSI)

Flash POST-sGSI 1 tissot zip.

Flash POST-sGSI 2 tissot zip.

Flash a treble-compatible kernel (Moun, ProjectK,Velocity)(credits to @mountaser halak, @khusika, @kdragon)

Reboot to system.

Once booted, install the latest Play services linked above either via the Files app or via adb. This will fix the Pixel Setup and Google Backup issues as well as allows you access to the Play Store without problems.

You can now flash Magisk 17.3. This is the version that works properly with treble. Credits to @topjohnwu for Magisk.

Install the Data transfer tool APK update as well.

Special thanks to @erfanoabdi for porting the Pie A/B GSI.

Some features may seem to be broken but can actually be fixed with a few tweaks

USB MTP FIX

To enable USB MTP, enable Developer options in the About phone section of the Settings app by tapping the Build Number 4 times. Then look for the File Transfer option in the Dev options.

ENABLE NAV BAR GESTURES

To enable Nav Bar, I installed this nav bar enabler by @Hugwalk via Magisk.

After rebooting, go to Settings > System > Gesture and enable Swipe Up on Home Button to enable the Nav Bar Gestures.

SUBSTRATUM

You should have the Android Pie booting on your Mi A1 now with less issues.

To update from PR1 to PR2, you can do so without wiping data

To update your post post GSI zips, follow this