Surely you have heard about the GCam or Google camera and you want to install it on your Mi A2 or Mi A2 Lite device without being a root user. You are in the right place to do it, since we detail each step so that you can achieve it and keep the updates via OTA without problems.
To achieve this, we must first unlock the bootloader, boot with the “patch_boot.img” that we will leave below (note, it is only valid for one version, we will explain how to do it yourself), install Magisk momentarily and finally, execute some commands ADB to enable the Camera2 API permanently without modifying the partition System.
Unlock the bootloader of the Mi A2
The first thing is to unlock the bootloader of our Xiaomi Mi A2 or Mi A2 Lite, and it is extremely simple but you must take into account that all the data stored in the device will be erased. Therefore, we strongly recommend that you make a backup of all important files such as photos, app data, etc.
We must allow the OEM Unlock and the USB debugging Before starting the process, to do this, go to Settings -> System -> Phone information. Press 7 times on the build number to unlock the hidden developers menu and enable these two options. We can now start entering commands on the PC (commands are without quotes):
- First in our computer we must install ADB drivers
- Enter fastboot mode by pressing volume keys – next to power until the Mitu rabbit appears and connect it to the PC
- Enter in cmd either PowerShell the command «fastboot devices» to check that the computer recognizes it correctly
- Unlock the bootloader with the command «fastboot oem unlock«, reboot and do the previous step of enabling the OEM Unlock and the USB debugging
- Once in fastboot after this process, we enter the command «fastboot flashing unlock_critical» to unlock the critical parts (in some it is not necessary, if it throws an error, continue)
- We already have the unlocked bootloader, again, activate the OEM Unlock and the USB debugging
Enable the Camera2API without the need to be a root user
As in the Mi A2 there is no TWRP compatible with Android Piefor the moment, we must resort to booting into the file “patched_boot.img» what you can do yourself by copying the file «boot” of the fastboot rom of your version to your device and letting Magisk do the magic by patching it.
We leave you the version 10.0.2.0 exclusively for the Mi A2. This method is also valid for the Mi A2 Lite, with its respective patched file, Sure. Note that you need the boot version corresponding to your current version.
Once we have this file, and we are sure that it is from our version, we can proceed to execute the commands to grant superuser permissions momentarily to enable the Camera2API.
We copy the “patched_boot.img» to a folder on the PC, preferably in the ADB folder, in which we open a command window (cmd either PowerShell). We restart the Xiaomi Mi A2 in fastboot mode, and connect it to the PC. Then we execute these commands:
- First we check that it detects it correctly with «fastboot devices«
- Now we boot with the modified file to be superusers momentarily (means that we start once, then we will not be root) with the command «fastboot boot patched_boot.img«
- After this, the smartphone will start, and we must install Magisk appwe ignore everything you tell us
- In the command window, we enter “adb shell» to access the shell, and then «its» to grant root permissions. A message will appear on the smartphone, we click “accept”
- Enter the following commands (one at a time) to enable the Camera2API on Android Pie and Android 10:
- setprop persist.camera.HAL3.enabled 1
setprop persist.vendor.camera.HAL3.enabled 1
setprop persist.vendor.camera.stats.test 5
setprop persist.camera.stats.test 5
setprop persist.camera.eis.enable 1
- setprop persist.camera.HAL3.enabled 1
- Finally, we exit the shell with “exit«
Now we can uninstall Magisk and reboot our Mi A2 or Mi A2 Lite routinely. Camera2API is already enabledwithout modifying any file on the partition Systemwith what the OTAs will keep coming.
It is quite simple to perform this method, but if it is the first time you will have to have a little patience. Do you already have the GCam on your Mi A2 and Mi A2 Lite? Tell us your experience! We leave you a video of our comparison between Stock and GCam.
In case you still have doubts with the explanation, we leave you a video to make it easier for you to carry out this process:
Do you want to receive the best information about technology?
Enjoy the outstanding news of each week directly in your inbox to always be informed.