[Xiaomi Mi A1 Guides, News, & Discussion] SmallTarzan:
Hello, I've seen a lot of community members struggling to install custom ROMs, GApps, Magisk or DolbyAtmos, so I've created a guide. So did I, this took me around 15 tries without bootlooping or breaking my OS. Yes, I was really new at this. Some guides had broken English that I couldn't understand, others were too complicated.

However, now I am presenting you a fully working, detailed (and easy) guide. Hopefully, it'll help at least someone to avoid potential mistakes when flashing or using root. Good luck!

(If you don't install TWRP, the GApps version will mismatch!)

(Probably not anymore, needs a confirmation.)

All-in-One installation .7z package: (NOW ONLY INCLUDES MAGISK, ADB DRIVERS, RECOVERY AND GCAM MOD. CHOOSE THE ROM YOURSELF.)

GDrive: https://drive.google.com/open?id=1tkkVyuGfv2UYvehsV7cmGi9BQ2msodKY

Mediafire: http://www.mediafire.com/file/y146i4satahiper/updatedFiles-Magisk-Recovery-GCam-ADB.7z

Mega: https://mega.nz/#!B34XmbLD!GzZuJthLWrJbsHqRd_r-wxMKOwvi3fQdGOmWmW0Mtlo

(Extract with 7zip or WinRar before using)

Enabled developer options with ADB debugging enabled (Settings->System->About Phone->Tap 7 times on Build Number, go back, Developer Options, scroll a bit down, Android Debugging - Enabled)

Backup any photos or videos, if needed.

Unlocked bootloader (Open a cmd in the folder->adb reboot bootloader->press Yes if your phone asks for a confirmation->fastboot oem unlock)

1. Open a command prompt in the provided folder

2. Use the command adb reboot bootloader

3. Use the command fastboot boot recovery-3.2.1-2-oreo.img

(Press Keep Read Only)

4. Go to Wipe->Advanced Wipe->Select: Dalvik / ART Cache, System, Data, Internal Storage and wipe by swiping right

5. Copy all files to your SD card/Internal Storage: Twrp-recoveryInstaller-3.2.1-2-oreo.zip, Google_Cam_Fix_for_LineageOS_v1.0.zip (not needed for other ROMs other than LineageOS, or at all), lineage-15.1-20180313-UNOFFICIAL-tissot.zip (or any other ROM file), Magisk-v16.4(1642).zip, open_gapps-arm64-8.1-micro-20180526.zip (Download the newest one at https://opengapps.org, ARM64, Android 8.1, micro)

6. Go to Install->and select lineage-15.1-20180313-UNOFFICIAL-tissot.zip (or any other ROM file) and install the zip file by selecting the file and swiping right

7. Reboot->Switch to the other slot (A->B or B->A) (Not needed on the latest ROMs)

8. DO NOT REBOOT (Just press the Back button)

9. Install Twrp-recoveryInstaller-3.2.1-2-oreo.zip by selecting the file and swiping right

10. Go to Reboot->Recovery and swipe

11. Install->Flash open_gapps-arm64-8.1-micro-20180526.zip by selecting the file and swiping right

12. Reboot or continue to the Magisk installation procedure below to get root access

12.5 IMPORTANT! Press Do Not Install

Your device can take a few minutes to boot

​

1. Reboot to recovery

1. Install->Flash Magisk-v16.4(1642).zip by selecting the file and swiping right

2. Reboot->System

3. Go to Magisk Manager->Modules->Add->Top right corner, three dots, Show internal storage and find the Google_Cam_Fix_for_LineageOS_v1.0.zip and flash it by clicking on it, reboot your device. (Not needed for other ROMs other than LineageOS, or at all)

(If you can't see your SD card because it is formatted as an adoptable storage, copy the file to the Internal Storage again)​

NOTE: MAY NOT WORK ON MOST ROMS ANYMORE, I USE VIPERFX FROM MAGISK REPOSITORY OR DIRECTLY FROM XDALABS HERE INSTEAD.

1. Copy DolbyAtmos_for_Oreo_20180218.zip and magisk-permissive-script_v1.2.zip to your SD card/Internal Storage (Currently only downloadable from the link below, please check the note just above the step 1)

(Please note that if you have your SD card formatted as an adoptable SD card, you'll have to copy your files to the Internal storage, nowhere else.)

2. Go to Magisk Manager, update it (you might need to install the latest apk by clicking on the INSTALL button, let it update before doing anything else)->Modules->Press the + button, top right corner, three dots, Show internal storage and find the magisk-permissive-script_v1.2.zip, tap on it.

3. Reboot

4. Reboot to recovery (Go to Settings->System->About Phone->Tap 7 times on Build Number, go back, Developer Options, Enable Advanced restart. Now you can simply hold the power button, press restart, tap on Recovery.)

5. Install->Flash DolbyAtmos_for_Oreo_20180218.zip by selecting the file and swiping right

(IF IT ENDS UP WITH AN ERROR->Back, go to Mount and check System) Then try flashing it again.

6. Reboot->System

(OPTIONAL STEPS, USE ONLY IF YOU DON'T SEE DOLBYATMOS AFTER REBOOT)

(In recovery)

7. Reboot->Select the other partition (A->B or B->A)

8. Back->Reboot->Recovery (Swipe to Reboot)

9. Install->Flash DolbyAtmos_for_Oreo_20180218.zip by selecting the file and swiping right

10. Reboot->Select the other partition (A->B or B->A)

11. Reboot System

1. Open Magisk Manager->Downloads->Search for GCam Mi A1 Fix->Tap, install, reboot (Please note that this is already enabled in most ROMs out here)

2. Copy the GoogleCamera-Pixel2Mod-Arnova8G2-V7beta-test-9.apk (from the Bonus folder) to your internal storage

3. Use any third-party file manager, (I recommend total commander) and install the .apk

4. Use the recommended settings:

Open the camera app->Settings->Advanced:

Config Camera HDR+: Nexus 6 Auto (This setting might not be neccesary in the provided GCam version anymore)

HDR+ parameters: Super High

Enable Zero Shutter Lag (ZSL): Enabled

Improve in low light: Enabled

5. Restart the app

1. Open Magisk Manager->Downloads->Modded Pixel2 Launcher->Tap, install, reboot (Optionally, you can install other Pixel launchers. I personally prefer Ruthless Pixel Launcher)

2. Tap on Pixel 2 Launcher

3. Press the home button

4. Always

(This sets the Pixel 2 Launcher as your default launcher.)

At this point - MAKE A BACKUP in TWRP (Boot into Recovery, select Backup, Select all partitions (except storage), Backup)

1. Download the OREO_MAGISK_Xiaomi_mi_A1_DualSpeaker.zip file from the attachment section

2. Open Magisk Manager->Modules->The + button->Find the OREO_MAGISK_Xiaomi_mi_A1_DualSpeaker.zip file->Flash it

3. Reboot

1. Download and install XposedInstaller_3.1.5.apk from the attachment section

2. Open it and click on the Xposed version 90-beta3 (or a newer version) in the INSTALL/UPDATE section

3. Install

4. You'll get an error saying that the device is busy

5. Restart to TWRP recovery

6. Install->Find the Xposed_Framework_(SDK_27)-90.1-beta3_(Systemless).zip (or a newer version) in the MagiskManager folder in the root of your internal storage (/storage/emulated/0/MagiskManager)->Flash the .zip file by swiping right

7. Reboot to system

[MENTION=6070905]abhishek987[/MENTION] - the guide has been inspired by his guide

[MENTION=7471004]mohancm[/MENTION] - used his recovery

[MENTION=7637048]talk2indrajit[/MENTION] - used his Google Cam fix, used some steps from his guide

[MENTION=4970751]Rajeev[/MENTION] - for providing link to the latest LineageOS

[MENTION=4860033]Arnova8G2[/MENTION] - his camera mod has been used in this guide

[MENTION=4437122]sad96[/MENTION] - his fps fix has been used in this guide

[MENTION=4445176]guitardedhero[/MENTION] - his DolbyAtmos port has been used in this guide

[MENTION=8715031]lelozerien[/MENTION] - for letting me know about the DualSpeaker mod

[MENTION=6282592]ydd0ras[/MENTION] - for guiding me through the installation of Xposed

[MENTION=4262550]coda00[/MENTION] - for letting me know about the version mismatch when not installing TWRP

[MENTION=4544019]ravinder0003[/MENTION]

OpenGApps taken from: http://opengapps.org

LineageOS taken from: https://xdaforums.com/mi-a1/development/rom-lineageos-15-1-t3757938

GCamMod taken from: https://www.celsoazevedo.com/files/android/google-camera/dev-arnova8G2/

TWRP taken from: https://xdaforums.com/mi-a1/development/recovery-twrp-3-1-1-0-touch-recovery-t3688472

DolbyAtmos taken from: https://xdaforums.com/android/software/app-dolby-atmos-axon-7-oreo-port-t3740508 (I've used an older version in this guide. If you are confident enough, you can try the latest one.)

Xposed taken from: https://xdaforums.com/showthread.php?t=3034811

I was writing these steps while actually installing the ROM, so it should work for sure.

I might add guides for installation of other ROMs too.

If you have any issues or questions, feel free to reply to this post.

A newbie tip: If you can't see your internal storage, swipe down the notification bar and change USB Charging to Transfer Files.

Coming from stock Android 8.0? Coming from Android Nougat, 7.1.2? Do you need to reflash your TWRP?

Take a look
​

If is anyone interested about the design:

https://cooltext.com

Changelog:

27/05/18 - Updated the guide and separated the main installation procedure.