If you want to get the latest Android Pie sGSI on your Xiaomi Mi A1, its really a simple process that just involves flashing a lot of different files via TWRP. The important thing to remember is that because we will be doing a repartition of your userdata, your internal storage will be wiped.
There are a few known bugs with this release:
- DT2W only works on some display panels
- Some issues with the Mi A2 Camera app (“Could not connect to Camera” crashes often)
- SELinux is permissive
But everything else should be working perfectly fine, and if not, it is more than likely a vendor issue and you should contact your ROM dev. You can restore your apps via Google Backup or Titanium Backup if you engage those options before beginning to follow this guide.
Requirements / Downloads:
- TWRP Fastboot only with Tissot Manager (Required)
- CosmicDan’s TWRP Installer (Required)
- ResurrectionRemix Oreo Vendor.img (Required)
- A/B system Pie PR2 img (Required)
- POST-sGSI 1 tissot zip (Required)
- POST-sGSI 2 tissot zip (Required)
- A Treble-compatible kernel (Moun, ProjectK, Velocity) (Required)
- Magisk 17.1 (Optional)
- Data Transfer Tool APK (Optional, Recommended)
- Nav Bar Enable (Magisk module) (Optional, Recommended)
- First enable Developer Options on your Xiaomi Mi A1 by going into Settings > About > tap ‘Build Number’ 7 times, until Developer Mode is activated.
- Now go into Settings > Developer Options > enable OEM Unlocking and USB Debugging.
- Now connect your Xiaomi Mi A1 to your PC via USB, navigate to your ADB installation folder, hold Shift + Right click and choose ‘Open a Command Window Here’.
- In the ADB terminal window, type: adb devices
- A dialogue should open on your Xiaomi Mi A1’s screen asking to confirm the ADB pairing. Confirm it, then re-type ‘adb devices´ into the ADB terminal.
- If the ADB connection is successfully recognized, the ADB terminal should display your device’s serial number. If no device is recognized, you may need to troubleshoot the ADB connection (USB cable coming loose, etc).
- Now extract the TWRP fastboot only version .img file from the .zip you downloaded earlier, and place the .img file inside your main ADB path.
- Place the CosmicDan’s TWRP Installer .zip on your SD card.
- In ADB terminal, type: fastboot boot recovery.img (replace recovery.img with actual filename)
- Your Xiaomi Mi A1 should reboot into a temporary version of TWRP. You should now install the CosmicDan’s TWRP Installer as a flashable zip through the TWRP install menu.
- Once TWRP has been successfully flashed, you can reboot your Xiaomi Mi A1 by typing: fastboot reboot
- Once your Xiaomi Mi A1 boots into the Android system, start copying the remainder of the required downloaded files to your device’s SD card.
- Now in the ADB terminal, type: adb reboot recovery
- This should reboot your Xiaomi Mi A1 directly into TWRP recovery.
- Once inside TWRP, you need to go to TWRP Tissot Manager via Advanced > Tissot Manager > select the ‘Repartition Userdata’ option.
- Choose ‘Singleboot’ and then press Repartition.
- Now flash the Vendor.img as a Vendor Image.
- Flash the A/B system Pie PR2.img as a System Image
- Then flash the POST-sGSI 1 tissot zip and POST-sGSI 2 tissot zip files.
- Now you need to flash a kernel that is compatible with Treble – such as Moun, ProjectK, or Velocity.
- Finally, reboot to system.
Once you’re inside the Android System, you need to install the latest Google Play services, either as manual APK installation or via ADB flash. This will fix the Pixel Setup and Google Backup issues, and you can also access the Play Store without further issue.
If you want root via Magisk, you can install Magisk 17.1, which is Treble-compatible.
You should install the Data Transfer Tool APK as well.
At this point, there are a couple tweaks to do to fix some things. First, to enable USB MTP, you should go into Developer Options and change the File Transfer option to USB MTP.
Enable the Navbar
To enable the nav bar, you need to install the Nav Bar Enabler via Magisk. Reboot your Xiaomi Mi A1, then Settings > System > Gesture and enable Swipe Up on Home Button to enable the Nav Bar Gestures.
If you install this Substratum APK from the Telegram channel, it has much better support for Android Pie. After building the themes, you need to reboot, then go into Manager and enable the overlays for the theme you have built.
Updating from PR1 to PR2
You don’t need to wipe data to update from PR1 to PR2. You just need to wipe SYSTEM, then flash PIE PR2 AB GSI, and reboot to system.
For updating your post GSI zips, you need to wipe VENDOR, flash the vendor, then flash the POST zips and reboot to system.
Install the latest Google App update from the Play Store. Download the April or July modem patch and flash via TWRP. See which one makes OK Google work for you.
Library of GCam mods (not all of them will work, depends on the device): https://www.celsoazevedo.com/files/android/google-camera/
- Recommended: https://temp4-f.celsoazevedo.com/file/gcamera/GoogleCamera-Pixel2Mod-Arnova8G2-V8.2.apk
- If you want dual camera support, use CStark Tele: https://temp4-f.celsoazevedo.com/file/gcamera/cstark27_GCam_5.1.018_24_tele_v0.1a.apk