Google Camera for Mi A2/A2 Lite brings Pixel 3 camera features like Night Sight, Portrait Mode, and can also help you dramatically increase the camera quality. In this tutorial, we will guide you on how to enable Camera2 API on Xiaomi Mi A2/Mi A2 Lite without Root and install Google Camera Port on it. The method is tested on Android Pie, but should also work on Android Oreo.
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, better than the stock camera app.
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.
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 install Google Camera Port. 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.
IMPORTANT: Several Mi A2 users are facing bootloop after January 2019 update. For now, we’d advise you not to update your phone until we have an official word from Xiaomi and the issue is resolved.
Mi A2 (jasmine)
Mi A2 Lite (daisy)
- 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. 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:
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.2.0, the command should be:
fastboot boot patched_boot_V10.0.2.0_mi_a2_lite.img
- Just as the command is entered, your Mi A2 should boot into the OS with temporary root
- Now, 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 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 and Install Google Camera Port
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 version which is a port of Google Camera 6.1 from Pixel 3 by Tolyan009!
- 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.