Google Camera for Mi A2/A2 Lite brings Pixel 3 camera features like Night Sight, Portrait Mode, and can also help you drastically increase the camera quality of your phone. In this tutorial, we will guide you on how to enable Camera2 API on Xiaomi Mi A2/Mi A2 Lite without Root. The method is tested on Android Pie, but should also work on Android Oreo. We have also provided links to download Google Camera 7.2, 7.0, 6.2, and 6.1 Ports for Xiaomi Mi A2 and Mi A2 Lite.
In the past two years, Google Camera (GCam) Port from Pixel devices has gained immense popularity. But it is not just known for the amazing and latest features, it also enhances the camera quality and allows you to take great pictures using AI software. It is, in several ways, better than the stock camera app that comes pre-installed on the phone.
But in order to install Google Camera Port, you must first enable Camera2 API on your Xiaomi Mi A2/A2 Lite. Even though Xiaomi phones run stock Android, they still do not support Camera2 API officially. It’s easy to enable it when your phone is rooted, by editing the build.prop file manually, or by simply issuing some simple commands.
But if your Mi A2 is not rooted, you will need to follow a different method. So, just follow the instructions below to first enable Camera2 API without root and then install Google Camera Port on Xiaomi Mi A2/A2 Lite.
You will first need to boot a Magisk Patched Boot Image to temporarily root the phone. When that is done, you can easily use a Terminal Emulator app to enable Camera2 API on Xiaomi Mi A2/A2 Lite.
And finally, when the API is enabled, you can reboot your phone to unroot and then install the Google Camera Port. By using this method, you will still be able to take OTA updates without any issues.
Download Patched Boot Image
Here, we have provided Magisk Patched Boot Images for Mi A2 and Mi A2 Lite to temporarily root it. We have also provided stock boot images for the corresponding firmware, to help you unroot if you mistakenly flash the image.
Updated on 24 January 2020: Patched Boot and Stock Boot Images of January 2020 update for Xiaomi Mi A2 and A2 Lite are now available. These have been patched with the latest version of Magisk.
For Mi A2 (jasmine_sprout)
- V220.127.116.11.QDIMIXM (January 2020 Update)
- V18.104.22.168.QDIMIXM (Android 10 update) – Huge thanks to Nicola for sharing these!
- V10.0.18.0.PDIMIXM (December 2019 Update)
- V10.0.17.0.PDIMIXM (November 2019 Update)
- V10.0.16.0.PDIMIXM (October 2019 Update)
- V10.0.15.0.PDIMIXM (October 2019 Update)
- V10.0.14.0.PDIMIXM (September 2019 Update)
- V10.0.13.0.PDIMIXM (Huge thanks to Nebrassy for uploading and Kevin for sharing these with us!)
- V10.0.8.0.PDIMIXM (Thanks to XDA Senior Member ThaiDai)
- V10.0.4.0.PDIMIXM (Huge thanks to XDA Senior Member minnuss!)
Huge thanks to Nicola Bontempelli for providing patched boot images for the Mi A2.
For Mi A2 Lite (daisy)
- V10.0.18.0.PDLMIXM (January 2020 Update)
- V10.0.17.0.PDLMIXM (December 2019 Update) – Credits: XDA Senior Member a1291762
- V10.0.16.0.PDLMIXM (November 2019 Update)
- V10.0.15.0.PDLMIXM (October 2019 Update) – Thanks Nico van Draanen!
- V10.0.14.0.PDLMIXM (September 2019 Update)
- V10.0.13.0.PDLMIXM (Huge thanks to Roy Goldberg!)
- V10.0.10.0.PDLMIXM (Kudos to Roy Goldberg for sending us these!)
- V10.0.2.0.PDLMIFJ Patched Boot Image: Link
How to Enable Camera2 API on Xiaomi Mi A2/A2 Lite
In order to temporarily boot the patched boot image, you will need to install Android SDK Platform-Tools on the PC and unlock the phone’s bootloader first. Once done, follow the steps below to enable Camera2 API without Root:
- Download Patched Boot Image for your Mi A2/A2 Lite.
- Copy the downloaded image file to the folder where the ADB/Fastboot binaries are present (e.g. C:/username/platform-tools).
- Hold the SHIFT key and right-click on an empty space inside the folder.
- Select the ‘Open PowerShell window here’ option.
- Power off your Xiaomi Mi A2/A2 Lite completely.
- Now hold the Volume Down and Power buttons together to enter Fastboot Mode.
- Connect your phone to the PC using the USB cable.
- Enter the following command to temporarily boot the Magisk patched boot image on your Mi A2/Mi A2 Lite:
fastboot boot boot-image-filename.img
- Make sure to replace ‘boot-image-filename.img‘ with the actual filename. For example, if you’re on V10.0.13.0, the command should be:
fastboot boot patched_boot_V10.0.15.0_mi_a2_lite.img
- Just as the command is entered, your Mi A2/Mi A2 Lite should boot into the OS with temporary root.
- Right now, only the Magisk Manager stub is installed on your phone. In order for Magisk to work properly and to grant superuser permissions, you must first install full Magisk Manager.
- Simply go to the phone’s app drawer and launch Magisk Manager app (In case the app doesn’t show up, download the latest APK from here and install it on your phone).
- Select “Yes” when prompted to upgrade to full Magisk Magisk Manager and follow the on-screen instructions.
- Once Magisk Manager is fully installed, download and install Termux (Terminal Emulator) on your phone
- Once installed, launch Termux and enter the following command:
- Grant superuser permissions to Termux when prompted
- Finally, enable Camera2 API on Xiaomi Mi A2/A2 Lite by entering the following command:
setprop persist.camera.HAL3.enabled 1
setprop persist.vendor.camera.HAL3.enabled 1
setprop persist.camera.stats.test 5
setprop persist.vendor.camera.stats.test 5
- Once the commands have executed successfully, reboot your phone to uninstall Magisk and unroot completely.
For further confirmation, you can also check Camera2 API support using an app. And finally, follow the next section to install Google Camera Port on Xiaomi Mi A2/A2 Lite.
Download Google Camera Port for Xiaomi Mi A2/Mi A2 Lite
There’s no dedicated Google Camera Port, you can try different versions from here. However, after digging enough on XDA forums, I was able to find a few versions of the Google Camera ports for the Mi A2 and Mi A2 Lite.
As of 13 November 2019, Google Camera 7.2 and 7.0 Ports for Xiaomi Mi A2 and Mi A2 Lite are available for download. v7.2 ports are only compatible with Android 10, while v7.0 ports can be installed on both Android 9 Pie and Android 10. Thanks to Kwanthay for tipping us!
General advice: Not all GCam Ports are perfect, some features like NightSight and HDR+ might be buggy on some ports, while not on some others. I have tried and gathered the most stable ones as recommended by the users themselves on XDA forums. Start by trying the first port listed and move down to test other versions until you find the one that works best for you.
How to Install
- Download Google Camera Port for Xiaomi Mi A2/A2 Lite
- Open a file manager app on the phone
- Navigate to the location where the APK file was downloaded
- Tap on the APK file to install Google Camera Port on Xiaomi Mi A2 and Mi A2 Lite
- Follow the on-screen instructions to finish the installation
- Once Google Camera has been installed, go to the app drawer and launch it
Below are some Recommended Settings to help you smoothly run Google Camera on your Mi A2 (Go to Settings > Advanced):
- Interface Style: Pixel 3
- Config: Auto
- Back Camera: Pixel 3 XL
- Front Camera: Nexus 6P
- Libs: Stock by Eszdman v3
So, this was how you can enable Camera2 API on Xiaomi Mi A2/A2 Lite and install Google Camera Port on it. If you have any questions, please leave them down in the comments.