In this simple tutorial, we will show, how to enable Camera2 API on Xiaomi Mi A1 running Android Pie without root. The stock Pie update for Mi A1 has been around for a while now and we know most of the users are already running Android Pie update on their device. Mostly you need to root your device before performing any system wide changes but if you are already running Android Pie on your device then you can easily enable Camera2 API on Xiaomi Mi A1 running Android Pie without root, just continue reading the guide to see the process in detail.
What is Camera2 API?
Google introduced the Camera2 API in it’s OS that gives developers access to more advanced features of the camera app like manual exposure (ISO, shutter speed), focus, RAW capture and more. Despite the fact the MI A1 is an Android One device and comes in pure stock Android UI but still it lacks the Camera2 API support. There is no denying that Android is one of the most versatile OS, allows you perform tweaks and customization of your choice. Since Xiaomi Mi A1 comes with stock Android UI so it is also a development friendly device. If you have already rooted Mi A1 in your hands, you can easily enable the Camera 2 API by making a changes in the few build.prop. But you can also do it without root, and that’s what we are going to show you how easily you can enable Camera2 API on Xiaomi Mi A1 running Android Pie.
How to activate the Camera2 API on Xiaomi Mi A1 without root running Android Pie
At first you need to get access to temporary root on your device by booting a Magisk Patched Boot Image via fastboot commands. Let us tell you that the temporary root will not affect the OTA blockage or anything you can expect from a rooted device. Once your device booted into OS, make a few changes in the Terminal Emulator to enable camera2api on MI A1.
Necessary downloads and Pre-requisites:
Here we have listed all the Android Pie patched boot images for Mi A1 along with the stock boot image files for the respective firmware. All these files are provided by an XDA member “paolocorpo” for the boot images.
Xiaomi Mi A1 V10.0.10.0 (June 2019)
Xiaomi Mi A1 V10.0.9.0 (May 2019)
Xiaomi Mi A1 V10.0.8.0 (April 2019)
Xiaomi Mi A1 V10.0.7.0 (March 2019)
Xiaomi Mi A1 V10.0.5.0 (February 2019)
Xiaomi Mi A1 V10.0.4.0 (January 2019)
Xiaomi Mi A1 V10.0.5.0 (December 2018)
Set up adb drivers on your PC, here is a guide to do that.
Once done with the above steps, now head to the process below to enable camera2 api on Mi A1.
How to enable Camera2 API on Xiaomi Mi A1 without root
Just follow these steps carefully to avoid any issues during the process.
Download the Android Pie patched boot image for your device from the link above.
Now transfer the downloaded boot image file to the ADB folder where the ADB/Fastboot binaries are present by default it is in C:/username/ADB.
It’s the time to turn off your Xiaomi Mi A1 completely.
Now hold press and hold Volume Down + Power buttons together until you see fastboot mode on your device.
Connect your device to PC using USB data cable and let the drivers installed completely.
Now press and hold Shift key and right mouse click any empty space in the adb folder and choose ‘Open command window here’ (as shown above).
Enter in the following command in the command window to temporarily boot the Magisk patched boot image on your Mi A1.
fastboot boot boot-image-filename.img
Note: Remember to change the name of the file according to the firmware you are running on your device, for example, for V10.0.4.0, the command should be typed as fastboot boot patched_boot_V10.0.4.0.PDHMIXM.img
Upon the execution of the above command your Mi A1 should boot into the OS with temporary root.
Now install the terminal emulator app on your device and open the app when done.
In the Termux (terminal emulator) enter the following command. ‘SU’
Grant the necessary superuser permissions to Termux when prompted
Now type the final command in the terminal emulator to enable camera2 api on xiaomi Mi A1.
setprop persist.camera.HAL3.enabled 1
That’s it! You have successfully enabled the Camera2 API on Xiaomi Mi A1 running Android Pie. If you have any query let us know, you are free to ask. You can contact me directly on my gmail: [email protected]