• Skip to primary navigation
  • Skip to main content

The Custom Droid

Android Tutorials, Tips, and Development

  • General
  • How-To
  • Downloads
  • ROMs
  • Reviews
  • About
  • Contact
Home ❯ How-To ❯ Mods

Enable Camera2 API on Xiaomi Mi A2/A2 Lite without Root and Download Google Camera Port

Mar 22, 2021•by Dhananjay Bhardwaj

How to Enable Camera2 API and Install Google Camera Port on Xiaomi Mi A2/A2 Lite

In this tutorial, you will learn how to enable Camera2 API on Xiaomi Mi A2 and Mi A2 Lite without root. Once enabled, you can download ports of various versions of the Google Camera app from below and install it on your phone.

In the past few 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 the stock Android software, 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 using a Magisk module.

But if your phone is not rooted, you will need to follow a different approach. And this guide will take you through the same. 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.

Related Article: How to Root Xiaomi Mi A2/A2 Lite without TWRP (Magisk)

Table of Contents
  • Download Patched Boot Image
    • For Xiaomi Mi A2 (jasmine_sprout)
    • For Xiaomi Mi A2 Lite (daisy)
  • How to Enable Camera2 API on Xiaomi Mi A2/A2 Lite without Root?
  • Download Google Camera Port for Xiaomi Mi A2/Mi A2 Lite
    • How to Install

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.

Starting with January 2021 update, patched boot images will not be provided on this page. I do not own this device anymore. You can easily patch the stock boot image on your phone itself by following step #2 of this tutorial.

For Xiaomi Mi A2 (jasmine_sprout)

V11.0.21.0.QDIMIXM Stock Boot Image –
V11.0.20.0.QDIMIXM Stock Boot Image –
V11.0.19.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.17.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.15.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.14.0.QDIMIXM Stock Boot Image –
V11.0.13.0.QDIMIXM Stock Boot Image –
V11.0.12.0.QDIMIXM Stock Boot Image –
V11.0.11.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.10.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.8.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.5.0.QDIMIXM Stock Boot Image Patched Boot Image
V11.0.4.0.QDIMIXM Stock Boot Image Patched Boot Image

For Xiaomi Mi A2 Lite (daisy)

V11.0.18.0.QDLMIXM Stock Boot Image –
V11.0.17.0.QDLMIXM Stock Boot Image –
V11.0.16.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.14.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.12.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.11.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.10.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.7.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.5.0.QDLMIXM Stock Boot Image Patched Boot Image
V11.0.4.0.QDLMIXM Stock Boot Image Patched Boot Image

How to Enable Camera2 API on Xiaomi Mi A2/A2 Lite without Root?

The process is quite easy. In order to enable the API, you must first boot the patched boot image to temporarily root your phone. Once that is done, you can use a Terminal Emulator to execute the commands that will enable Camera2 API. Once the API has been successfully enabled, you can reboot your phone to fully unroot and then install the Google Camera Port. By using this method, you will still be able to take OTA updates without any issues.

In order to temporarily boot the patched boot image, you will need to install Android SDK Platform-Tools on your PC and unlock the phone’s bootloader first. Once done, follow the steps below to enable Camera2 API on your Xiaomi Mi A2/A2 Lite.

  1. Download the patched boot image for the software build number installed on your phone.
  2. Extract the contents of the downloaded ZIP file to get the ‘magisk_patched.img’.
  3. Copy the extracted patched boot image file to the folder where the ADB/Fastboot tools are installed on your PC (e.g. C:\platform-tools).
  4. Hold the SHIFT key and right-click on an empty space inside the folder.
  5. Select the ‘Open PowerShell window here’ option.
  6. Power off your phone completely. Then hold the Volume Down and Power buttons simultaneously to boot it into Fastboot Mode.
    Enable Camera2 API on Xiaomi Mi A2/A2 Lite - Boot into Fastboot Mode
  7. Connect your phone to your PC using a USB cable.
  8. 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
  9. Replace “boot-image-filename.img” with the actual filename of the patched boot image you’re using. For example, if you downloaded the V11.0.6.0 patched boot image, then the command should be the following:
    fastboot boot magisk_patched.img

    Enable Camera2 API on Xiaomi Mi A2/A2 Lite - Boot Magisk Patched Boot Image

  10. Just as the command is entered, your Mi A2/Mi A2 Lite should boot into the OS with temporary root.
  11. 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 the full Magisk Manager.
  12. Simply go to the phone’s app drawer and launch the Magisk Manager app (In case the app doesn’t show up, download the latest APK from here and install it on your phone).
    • Note: Make sure that you install the app to the internal storage only, and not to the SD card via Adoptable Storage.
  13. Select “Yes” when prompted to upgrade to full Magisk Magisk Manager and follow the on-screen instructions.
    Upgrade to Full Magisk Manager on your Xiaomi Mi A2/A2 Lite when prompted
    (For reference only)
  14. Once Magisk Manager is fully installed, download and install Termux (Terminal Emulator) on your phone
  15. Once installed, launch Termux and enter the following command:
    su
  16. Grant superuser permissions to Termux when prompted
    Enable Camera2 API on Xiaomi Mi A2/A2 Lite without Root - Terminal Emulator
  17. 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
  18. 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.

Download Links:

Google Camera v7.3.020 Ports by Parrot043

  • MGC_7.3.020_Parrot043_V8.apk
  • MGC_7.3.020_Parrot043-v2.apk (Config: Parrot_MiA2_nBae.xml)

Google Camera 7.2.018 Ports:

  • DMGC_7.2.018_ver.3.9.apk

Google Camera 7.0.009 Ports:

  • GCam_4.0beta4.191002.0815build-7.0.009.apk
  • PMGC_7.0.009_ConfigsVersion_V3.apk
  • GCam_v7.0.009-v4.4.apk (by Urnyx05)
  • PMGC_7.0.009_Astrophoto_Version_V12.apk | Config file
  • DMGC_7.0.009_ver.0.3-dogfood.apk (by the_dise)

Google Camera 6.3.017 Port:

  • PMGC_6.3.017_PlusParrot_V9.apk

Google Camera 6.2.030 Ports:

  • Gcam_6.2.030_Advanced_V2.2.190716.1800-Final.apk (by Arnova8G2)
  • GCam-6.2.030_Arnova8G2_Urnyx05-v2.4.apk (by Urnyx05)
  • DMGC_6.2.030_ver.1.6-PE.apk (by the_dise)

Google Camera 6.1.021 Ports:

  • Gcam_6.1.021_Advanced_V1.7.190716.1800.apk
  • MGC_6.1.021_BSG_Arnova-based_v.1.3c_fix_TlnNeun.apk
  • MGC_6.1.021_MI8_V2e.apk (Thanks Rae!)

How to Install

  1. Download Google Camera Port for Xiaomi Mi A2/A2 Lite
  2. Open a file manager app on the phone
  3. Navigate to the location where the APK file was downloaded
  4. Tap on the APK file to install Google Camera Port on Xiaomi Mi A2 and Mi A2 Lite
    Install Google Camera Port on Xiaomi Mi A2 and Mi A2 Lite
  5. Follow the on-screen instructions to finish the installation
  6. Once Google Camera has been installed, go to the app drawer and launch it

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.

Huge thanks to f.y, Roy Goldberg, Nico van Draanen, and 4KhadaJhin4 for their contribution.

Tagged under: Google Camera Port, Xiaomi

Reader Interactions

Comments

  1. Nithin

    Mar 6, 2021

    It worked! but my default camera app is now crashing on opening.. how do I reset the changes that I have caused. Is there a tutorial for that? Please help me in this regard

    Reply
    • Dhananjay Bhardwaj

      Mar 6, 2021

      Nithin, that’s a known bug since the Android 10 update. You can either enable camera2 API and use GCam, or keep the API disabled and use the stock camera app.

      The both cannot be used simultaneously.

  2. Daniel

    Dec 30, 2020

    Hello Dhananjay
    What do I need to do to get the stock core yourself?

    Reply
    • Dhananjay Bhardwaj

      Dec 31, 2020

      Hi Daniel. If you need the stock boot for a specific firmware version, I can do that for you.

      Could you point to the firmware version for which you want the stock boot image?

      You can do so either by extracting the fastboot ROM (the easiest) or by extracting the Payload.bin file from a full OTA package. Here are the instructions to extract the Payload.bin file.

      You can get both of these FW packages from the Mi A2/A2 Lite Update repository I maintain.

    • Daniel

      Jan 3, 2021

      Thanks for the information. Could you tell me more details about fastboot ROM extraction please. Do you need a root for this in advance?

    • Dhananjay Bhardwaj

      Jan 3, 2021

      Extracting the fastboot ROM is nothing but extracting a tarball (.tgz) package using a utility like WinRAR or 7-Zip.

      Just install one of those utilities on your computer, download the fastboot ROM, right-click the file and extract it.

  3. Lex

    Nov 26, 2020

    A new security patch has come out, will this also conflict with Gcam and force the hard reset?

    Reply
    • Dhananjay Bhardwaj

      Nov 27, 2020

      No Lex. The November update for Mi A2 doesn’t seem to be plagued with the factory reset issues users faced with the October update. You should be good to go.

  4. ANKIT

    Nov 24, 2020

    There is one major problem after enabling camera 2 api with latest update,

    When we check using root checker app or similar type of apps to check root status of device, app says device is NOT ROOTED,

    but some apps (like myjio, sbi yono etc.) are not working because they find device is ROOTED. And some of them show warning and some other apps refuse to operate because device is ROOTED.

    Can you solve this problem ?

    Reply
    • Dhananjay Bhardwaj

      Dec 2, 2020

      Ankit, for the brief period when the phone was rooted (while enabling the API), these apps might have detected root permissions.

      My suggestion: Clear the app data of all these apps by going to Settings > Apps & notifications > All Apps. Then uninstall these apps and reboot your phone. After the reboot, download and install the apps again from the Play Store and check if they work.

  5. Brance

    Nov 3, 2020

    Your Instructions are inconvenient, I have to jump several links here and there. It’s a bit annoying to open several links that will lead you to open another link and so on and so forth.

    Reply
    • Dhananjay Bhardwaj

      Nov 4, 2020

      Brance, I really appreciate your feedback. It would be great if you could point out the exact links (that are presumably redirecting further). I’ll be more than happy to fix them, and/or work out a better approach.

  6. Alex

    Oct 27, 2020

    Taking advantage of the October update did the hard reset on all MI A2, and I will have to redo the API process, I wanted to settle a doubt: Why now when doing the GCam process the native camera no longer works? Before this did not happen, the two worked together and now when releasing api2 the native camera stop working

    Reply
    • Dhananjay Bhardwaj

      Oct 28, 2020

      Alex, yes, the October 2020 update for the Mi A2 brought that force-reset issue. I have it mentioned in the update guide.

      As for the question regarding the stock and GCam working together, that’s the behavior Android 10 introduced on the Mi A2 series. You can either have the stock camera with camera2 API disabled, or have camera2 API along with GCam. As far as I know, there’s no solution to this problem, at least I couldn’t find one.

  7. Ahmed Nasser

    Oct 25, 2020

    Dear sir
    thanks for your big effort, can you upload the patched boot for Mi A2 v11.0.15.0.qdimixm

    Reply
    • Dhananjay Bhardwaj

      Oct 27, 2020

      It has been added to the post, Ahmed. Please check now.

  8. haven

    Oct 24, 2020

    heelo bro. the october update mademe reset my phone else it wont start. now i cant run gcam anymore. can you provde stock img or patched one so that we can run gcam once again
    thanks alot

    Reply
    • Dhananjay Bhardwaj

      Oct 27, 2020

      It has been added, Haven. Please refresh the page and check again.

  9. moelhadi

    Oct 24, 2020

    Hi, could you upload the latest v11 0.15.0 QDIMIXM for jasmine please? 😅
    Last night my jasmine suddenly bootloop and hard reset when i update the latest patch (october patch) and my cam2.api wont work anymore 😅😅

    GBU

    Reply
    • Dhananjay Bhardwaj

      Oct 27, 2020

      Yes, the October update for the Mi A2 has caused that issue. It would require a factory reset suddenly.

      Anyways, I have added the patched boot for V11.0.15.0. Please refresh and check.

    • moelhadi

      Oct 29, 2020

      thank you so much!!

      your patched image always worked,

      may god bless you man.

  10. vilizar

    Oct 24, 2020

    Hi, again. May be here I should post my question. After latest update in this October i loss camera 2.0 and need to do factory reset. Version is QKQ1.190910.002 V11.0.15.0.QDIMIXM

    Reply
  11. Dev

    Oct 10, 2020

    Please,
    I need magisk_patched_boot_11.0.11.0_daisy.zip.

    Thank you very much!

    Reply
    • Dhananjay Bhardwaj

      Oct 11, 2020

      Dev, patched boot for V11.0.11.0 has been added for the Mi A2 Lite.

    • vilizar

      Oct 24, 2020

      Hi, thanks for the great work. I need for V11.0.15.0.QDIMIXM

  12. Keifer

    Oct 3, 2020

    Please version 11.0.11.0 img for A2 lite.

    Thank you!

    Reply
    • Dhananjay Bhardwaj

      Oct 4, 2020

      Added the stock boot image for V11.0.11.0. You will need to self-patch it for now using the instructions here.

  13. kidd

    Sep 23, 2020

    congratulation for work,
    where i can find patched boot for Xiaomi mi A2 lite V11.0.11.0.QDLMIXM

    Reply
  14. NELLTOM

    Sep 11, 2020

    Hi! Where can I download? The latest stock boot.img for Mi A2.

    Thanks!

    Reply
    • Dhananjay

      Sep 14, 2020

      The latest stock boot image for Xiaomi Mi A2 has been added.

  15. nhed

    Aug 30, 2020

    why is it always saying “waiting for any device”?

    Reply
    • Dhananjay

      Aug 31, 2020

      The PC is not able to recognize the device over the USB connection. Check Control Panel > Device Manager for any driver-related issues.

  16. Amar

    Aug 29, 2020

    Hi Dhananjay,

    I have upgraded my phone to V11.0.13.0 . How do you get the stock boot.img file. I need it for V11.0.13.0.

    Reply
    • Dhananjay Bhardwaj

      Oct 4, 2020

      It has been added, Amar. Please check again.

  17. Nelltom

    Aug 6, 2020

    Thanks for this marvelous work. Will you be uploading the most recent magisk patched boot image for Mi A2 (jasmine_sprout)?

    V11.0.12.0.QDIMIXM

    Reply
    • Dhananjay

      Aug 6, 2020

      Hi. I do not own the Mi A2 anymore, so I am not able to patch the stock boot on my own.

      However, you can do so quite easily. Just download the stock boot image for V11.0.12.0 and follow the instructions under Step #2 on this page.

    • Awas

      Sep 2, 2020

      Hey, really appreciate your work man…can you please add v11.0.10.0.QDLMIXM
      For mi a2 lite daisy

  18. Riccardo

    Jul 6, 2020

    Hello!
    Where I can find the patched boot Image version V11.0.7.0.QDLMIXM (Android 10 June 2020 Update) for Xiaomi Mi A2 Lite (daisy)?
    thanks

    Reply
    • Dhananjay

      Jul 30, 2020

      Hi Riccardo. I have just uploaded it, please refresh the page and check again.

  19. Raza Haider

    Jul 5, 2020

    Hi enabled canera 2 api using your method .
    Google camera working.
    But my stock camera crashes all the time after enabling camera 2 api.
    Can u help me what is going wrong.

    Reply
    • Dhananjay

      Jul 5, 2020

      Hi Raza. That’s a known issue since the Android 10 update rolled out for the Mi A2 series. You can either enable the API and use GCam OR, you can keep the API disabled and use the stock camera.

      Both the stock camera and Google Camera port can’t be used simultaneously.

    • Raza Haider

      Jul 6, 2020

      I cannot use gcam all the time because it doesn’t support front camera flash.

  20. Raza

    Jul 4, 2020

    After enabling camera 2 api gcam working but stock camera crashes.
    Mi A2 Android 10

    Reply
    • Dhananjay

      Jul 30, 2020

      Hi Raza. That’s a known issue since Android 10 was released. You can either have the API enabled and use GCam, or disable the API and use the stock camera app.

      Both GCam and stock camera cannot be used simultaneously on Mi A2 running Android 10.

  21. Manuel

    Jul 2, 2020

    Hi and thanks for this tutorial, everything went as you described and the gcam works perfectly! One thing I can’t do though is to unroot the magisk patched boot, and when I tried to relock the bootloader my phone got bricked. I saved it but it remains in unlocked mode and it keeps having the magisk app installed.

    Reply
    • Dhananjay

      Jul 2, 2020

      Hi Manuel. If you want to keep the API enabled and also to enable it after future OTA updates, you’d need to keep the bootloader unlocked.

      The unrooting part is really simple. After executing the commands from Termux, you just have to reboot the phone and do nothing else. This will revert the phone to the stock boot automatically and remove Magisk.

      Although, there are chances that the Magisk Manager app will be left behind. You can just uninstall the app from your phone.

  22. Manuel

    Jun 29, 2020

    Hi, I have followed your instructions and everything worked perfectly except for one thing, I couldn’t unroot (or I don’t know how to do it) and when I tried to relock the bootloader, using a safe mode that I saw on a youtube tutorial (by pressing volume down while entering the command) my phone got bricked.
    I rebooted and saved it, but it remains booted with the magisk patch and every time I restart it, I find the magisk app in the app drawer and I uninstall it every time, but nothing changes.
    Please, how can I unroot the patched boot? Can I relock the bootloader without brick then?
    Thanks!
    Manuel

    Reply
    • Dhananjay

      Jul 2, 2020

      Hi Manuel. If you plan on keeping the API enabled and re-enable it after future updates, I will suggest keeping the bootloader locked.

      Now, currently, your phone’s bootloader is unlocked or locked?

      Did you use the “fastboot boot” command or the “fastboot flash boot” command while following the instructions?

      If you open the Magisk Manager app, does it show that Magisk is installed? Please share a screen with me if possible. You could use Imgur for screenshot.

    • Manuel

      Jul 4, 2020

      Hi, my phone’s bootloader is currently unlocked, the magisk app shows up in the app drawer but when I open it, it says it isn’t installed and that I should update to the complete version. When I followed the instructions I typed only fastboot boot.
      After I used termux I tried to relock the bootloader with the volume down trick and it appeared that I wasn’t losing my data, so then I tried to reboot without pressing any button on the phone and it got bricked. I did all your process again and left it unlocked.
      So my question now is: do you agree if I follow this process?
      -uninstall magisk
      -reboot
      -relock the bootloader (should I try with the volume down trick? It appears it could save me from complete erasure)
      Thanks!

    • Dhananjay

      Jul 30, 2020

      Hi Manuel. Can you please list the complete command that you used to temporarily boot the patched boot image?

      If you do not want to enable the API, then yes, you can just uninstall the Magisk Manager app, reboot the phone and relock the bootloader. You could try the Volume Down trick, I am not a 100% sure if it still works, but trying won’t hurt either.

      If you do want to use GCam, you will need to keep the bootloader unlocked. That’s because the API will be disabled after an update, post which you will need to enable it again, which will require an unlocked bootloader.

  23. Klaytton

    Jun 25, 2020

    hi wanted to know if i do this procedure will format the phone? or continue with all my apps and photos, etc …

    Reply
    • Dhananjay

      Jun 25, 2020

      Hi Klaytton. No, it will not erase any data on the phone, given that your phone’s bootloader is already unlocked.

      If it’s locked, you would need to unlock it first (instructions here) which will erase all the data.

      And in any case, it’s best to keep a backup just to safeguard it if anything goes unplanned.

  24. Kamal

    Jun 24, 2020

    Suggestion [3,General]: The command fastboot was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: “.\fastboot”. See “get-help about_Command_Precedence” for more details.
    PS C:\Users\aarit\Downloads\platform-tools_r30.0.3-windows\platform-tools> getting this error how can I solve it if I use .\ still not able to do it pls. help

    Reply
    • Kamal

      Jun 24, 2020

      it reboot but never start I can see the screen is on but never got rebooted with patched image kindly help

    • Dhananjay

      Jun 24, 2020

      Hi Kamal, please provide more information, such as:
      1) Is it the Mi A2 or the Mi A2 Lite?
      2) What software build number is your phone currently running?
      3) Which patched boot image did you download? Share the filename
      4) What command did you enter exactly in the PowerShell when you got that error?

    • Kamal

      Jun 25, 2020

      Hi Dhananjay,

      I am Using Mi A2

      i am running may 2020 security patch on android 10

      downloaded patched_boot_11.0.11.0_mi_a2.zip

      I have tried both mac as well as windows, in the command prompt it says that image processed but phone never get booted i can see the screen is on but it never get booted with the patched image than i have to mannualy boot the phone but no patched image.

      i am using following command

      ./fastboot boot patched_boot_11.0.10.0_mi_a2.img

      Kindly suggest

    • Dhananjay

      Jun 25, 2020

      Hi Kamal. Did you extract the “patched_boot_11.0.11.0_mi_a2.zip” file first on your PC to get the “magisk_patched.img“?

      Also, the command you have to use is – “.\fastboot boot magisk_patched.img” for Windows and “./fastboot boot magisk_patched.img” for macOS/Linux.

  25. Fenil

    Jun 12, 2020

    What changes I’m supposed to do in that 4 lines of termux code to disable camera2 api and use stock camera??

    Reply
    • Dhananjay

      Jun 12, 2020

      Hi Fenil. The value for those lines should be turned back to “0” if you want to disable the API and use the stock camera.

  26. Tanvir Ahmed

    Jun 7, 2020

    I have downloaded the patched image and the bootloader of my Mi A2 is unlocked. But when I am booting the patched image through power shell, it reboots into the stock rom. Patched image is not booting up.

    I am using: patched_boot_11.0.10.0_mi_a2.img

    Reply
    • Dhananjay

      Jun 7, 2020

      Hi Tanvir. Yes, after you issue the command on your PC, your phone will reboot and enter the OS. That’s how it should be.

      After it boots, go to the app drawer and open the ‘Magisk Manager’ app to verify that your phone is rooted or not. It should show Magisk as installed.

  27. Jorg_521

    Jun 6, 2020

    First of all, thanks for such a nice guide!

    On my Mi A2 Lite (v10.0.20.0 daisy) everything worked fine, including HDR+ for the front camera in standard and portrait mode.
    I used either CameraX9 or GCam_v7.0.009 (both by Urnyx05) with appropriate A2 Lite XML-config.

    However, today after rebooting, the system suddenly upgraded to version 11.0.5.0.QDLMIXM. Since that, the front camera is not working anymore (only with HDR+ turned off). Every time I try to make a shot, GCam crashes.

    – I’ve tried deleting this GCam port and trying other ports developed by the_dise, Parrot043, overwhelmer, rz_end and newest versions of Urnyx05. None of them worked again with enabled HDR+ on front camera.

    – I’ve checked Camera2Api support and it shows everything’s as it should be.

    If anyone knows how to solve this problem, plz write in the comment below.

    Reply
    • Dhananjay

      Jun 6, 2020

      Hi Jorg, please try the_dise’s latest port: DMGC_7.3.020_ver.4.4.apk

      Once you have installed it, change the front camera config to Nexus 6P, Pixel 3, or Pixel 2 in the GCam settings menu. Every time you switch and try, make sure that you force-close and restart the app in between.

    • Jorg_521

      Jun 8, 2020

      I am sorry, Dhananjay, but I don’t see an option to change the front camera config in this GCam version. Do I miss something?

      Thx in advance!

    • Dhananjay

      Jun 9, 2020

      With this new port, does the same issue occurs?

    • JEFFERSON SANTY

      Jun 10, 2020

      Dhananjay leí este foro, esta muy interesante, asi mismo leí los comentarios, al parecer existe problemas con la version de android 10, de que solo se pueda usar la stock o la gcam. existirá solucion pronto de estos problemas?
      y la otra consulta era de que hacer estos pasos sin ser root al parchear mi A2 lite perderé mis fotos o toda app que tengo instalado?, se que debeemos hacer un backup de nuestro movil. pero en si vamos a perder todo lo q esta en nuestro celular al montar esta img temporalmente?. muchas gracias

    • Dhananjay

      Jun 10, 2020

      Hello Jefferson. Thank you for the kind words.

      About the GCam/Stock camera problem, I don’t think there’s a way yet to fix this. Also, Xiaomi hasn’t posted any official reply to this problem, so we can’t say if and when it would be fixed.

      As for your question about date wipe, no, nothing will be erased while performing the steps in this guide. However, that is only applicable if your phone’s bootloader is already unlocked. If it isn’t unlocked yet, then you will need to unlock it first, which will erase all the data completely. And like you said, it’s best to take a backup always (Just in case).

    • Jorg_521

      Jun 10, 2020

      Yes Dhananjay, I installed the_dise’s latest port: DMGC_7.3.020_ver.4.4.apk.
      But I can’t find an option to change the front camera config.
      However, according to the_dise website this port shouldn’t work with front camera on A2 Lite. So I think I lost this option forever after upgrading to Android 10.

    • Dhananjay

      Jun 12, 2020

      Oh. Since I do not own the Mi A2 anymore, I would be able to personally check and confirm. Anyhow, I want you to try the following two ports and see if it makes a difference. When switching ports, make sure that you wipe the data of the existing port, then uninstall it, and finally install the new port.

      1) https://www.celsoazevedo.com/files/android/google-camera/f/changelog893/
      2) https://drive.google.com/open?id=1Bhc8L3Axagrmjq4VXmArR4oj_me8FzRN

  28. Stilian

    Jun 2, 2020

    Any ideas why magisk is still not installed? I did the update to 11.0.5 and used the patched boot image listed above but after booting magisk is still not installed. I tried manually trough internal storage but got the same result.

    Reply
    • Dhananjay

      Jun 2, 2020

      So, after booting the patched boot image using the fastboot command, Magisk Manager shows that Magisk is not installed?

    • Stilian

      Jun 2, 2020

      Yes

    • Dhananjay

      Jun 3, 2020

      That’s odd. Have you tried patching the stock boot by yourself and using that instead? See if it makes a difference.

    • Stilian

      Jun 4, 2020

      I tried and after booting the patched boot I manually installed Magisk and got it unlocked for 5 seconds which was followed by rebooting the phone by itself and Magisk not installed again after the reboot. Do you think I can use the “fastboot flash boot patched_boot.img” command to flash the patched boot permanently so I can try enabling 2api that way and after doing so – flashing stock boot image again?

    • Dhananjay

      Jun 4, 2020

      That’s odd. So the patched boot does work, but it leads to a bootloop. Have you tried fastboot booting it again? Does it happen every time?

      As for your other question, yes, that could be done. You can flash the patched boot, enable the API, and just re-flash the stock boot again.

  29. ahab

    Jun 1, 2020

    Any ideas why step 8 isn’t working for me? It just boots back to my regular phone. I have encryption turned on, is that why? I’m on V 11.0.5

    I did it when I was on pie, but I can’t get it to work now on 10.

    Reply
    • Dhananjay

      Jun 1, 2020

      Hi Ahab. Encryption wouldn’t cause any problems booting the patched boot image. May I know what exact error does the PowerShell window show when you enter the command shown in step #8?

    • ahab

      Jun 2, 2020

      Thanks for the reply. No error, it goes through successfully on adb exactly as it should. Phone starts to boot, but it boots to the existing OS instead of the patched image.

    • Dhananjay

      Jun 3, 2020

      Hi again, Ahab. I believe it’s a problem with the patched boot that I have provided. Some other readers in the comments section (Mike and Stilian) have reported the exact same problem. I have suggested them to try this new patched boot.

      If it still doesn’t work, I would suggest patching the stock boot image by yourself on your phone and use that instead.

  30. Alex

    May 31, 2020

    I noticed that since the Mi A2 went to Android 10 for some reason whenever I do the procedure of activating the native camera gcam stops working, I imagined that I had done something wrong, so I did a hard reset and redid the process and again, so api2 is activated the native camera stops working. Can you tell this could be it?

    Reply
    • Dhananjay

      May 31, 2020

      Hi Alex. I am afraid that’s a known issue on the Android 10 firmware for both the Mi A2 and A2 Lite. You can either enable the API and use GCam port, or keep the API disabled and use the stock camera. Currently, there’s no way to use both of these camera apps simultaneously.

      I am constantly keeping my eye on the matter and if I discover something, I will surely keep this post updated with the info.

  31. Banyuvisandip

    May 30, 2020

    I want to ask, does stock camera app still can be used after enable the Camera 2 API with this guide?
    On stock (not root) pie, December patch

    Reply
    • Dhananjay

      May 31, 2020

      Hello Banyuvisandip.

      The stock camera will work with camera2 API enabled and GCam installed as long as you’re running Android Pie on your phone.

      The problem arises with the Android 10 update. Wherein, you can only either use the stock camera or GCam. Not both of them at once.

  32. Stilian

    May 27, 2020

    Hi. I successfully enabled camera2 API last year using your method. But after the Android 10 update I got some problems (microphone not working, lagging etc.) as many others mi a2 lite users so I fixed some of the issues with factory reset but lost gcam as well. Currently I am with Android 10 – V11.0.2.0.QDLMIXM so what do you think is the best way to get gcam again:
    1) Using patched boot for V11.0.2.0.QDLMIXM (can you upload one btw)
    Or
    2)Flash V11.0.4 through recovery and then using the patched boot image listed above?
    Thanks in advance

    Reply
    • Dhananjay

      May 28, 2020

      Hi Stilian. I think it’s best to first upgrade to V11.0.5.0 and then use the patched boot image to enable the API.

      If you enable the API and then upgrade the phone, you will need to enable it again, which doesn’t make any sense given the current scenario, right?

    • Stilian

      May 28, 2020

      I found patched boot image for my version but after going through the process in fastboot I booted up my phone and it says magisk is not installed.
      What do you think is the problem? Could it be the boot image?

    • Dhananjay

      May 28, 2020

      Hi again. Have you tried using the boot image I have provided?

    • Stilian

      May 28, 2020

      I haven’t tried. But it’s stock right?
      I have to patch it myself. I am talking about V11.0.2.0.QDLMIXM

    • Dhananjay

      May 29, 2020

      Like I suggested, first update your phone to the latest firmware, which is V11.0.5.0 currently.

      Once that is done, you can use the provided patched boot image (See the download links in this post) to temporarily gain root and enable the API.

  33. NAVEEN VERMA

    May 14, 2020

    Hi,

    Can you please share me the method of enabling camera2api in my MI A2 without root.

    Reply
    • Dhananjay

      May 14, 2020

      Hi Naveen. This guide is for the same purpose. It doesn’t permanently root your phone, only boots into a temporary root state to enable the API. Once you have executed the commands and enabled the Camera2 API, you will need to perform a simple reboot/restart to return back to the non-rooted state.

    • karthik

      May 16, 2020

      Hi Dhananjay

      At last i have uninstalled magisk app and the problem is when i check my mobile with root checker it shows my mobile is rooted..

      Mobile: MI A2

      can i get OTA updates without any issues

    • Dhananjay

      May 16, 2020

      Hi again, Karthik. After enabling the API (i.e. entering the commands), did you reboot your phone?

    • Karthik

      May 17, 2020

      Hi again Dhananjay

      Yes i rebooted my device.

      And installed google camera working perfect.. but worrying about OTA updates.. that root checker shows your devices is ..rooted

    • Karthik

      May 17, 2020

      Hi Dhananjay..

      Now it shows ur phone is not rooted.. working perfect like charm… You are the best.. tq soo much.. sorry for previous comment..

    • Dhananjay

      May 17, 2020

      That’s great! So the reboot unrooted the phone, am I correct?

      Oh, and you’re welcome, and thanks to you for the kind words.

    • Karthik

      May 30, 2020

      Hi Dhananjay,

      I have some issues:
      1. Every time i restart my mobile magisk manager app is appearing
      2. Background app are not running like multitasking (when i switch app again it starts from first).

      Please help me dhananjay..!

      Thank you.

    • Dhananjay

      May 31, 2020

      Hello Karthik. Below, I have tried and answer both of your questions.
      1) Please open Magisk Manager and confirm that it shows that Magisk is NOT INSTALLED. If it shows not installed, then just uninstall the Magisk Manager app like any other.
      2) This seems like a bug with the software itself and doesn’t anyhow relate to the camera2 API. Would you please mind sharing the exact build number of the current software installed on your phone? You can find this info in ‘Settings’ > ‘About phone’.

    • Karthik

      Jun 1, 2020

      Hi Dhananjay,

      I cannot update my phone.
      when i try to update my phone.. it shows that
      (Couldn’t update Installation problem) after downloading software.

      Please help me dhananjay!!

      Thank you.

    • Dhananjay

      Jun 2, 2020

      Hi Karthik. The error would only show up if it finds that the inactive slot (where the update will be installed) has some sorts of modifications left over.

      Have you previously rooted your phone or installed TWRP? And no, enabling the API via temporary root doesn’t count in this.

    • Karthik

      Jun 1, 2020

      Hi Dhananjay,

      Here is my build numer – QKQ1.190910.002 V11.0.8.QDIMIXM

      Thank you.

    • Karthik

      Jun 2, 2020

      Hi Dhananjay,

      I did not rooted my mobile before and not installed TWRP.

      I just enabled the API as above instructions.

    • Dhananjay

      Jun 2, 2020

      Okay. If that’s the case, I would request you to wait. As soon as I get the official OTA link of the May update (the one you’re trying to install), I will let you know.

      You could try sideloading the OTA via the stock recovery for updating. That should work. But even if there’s a slight chance it doesn’t, we’d try something else that would.

    • Karthik

      Jun 2, 2020

      Hi Dhananjay,

      How to update OTA via the stock recovery. Can u please tell me
      or
      If there is a link please provide me.
      Thank you.

    • Dhananjay

      Jun 2, 2020

      Yes, sure. The instructions could be found on this page. However, as I said in my previous comment, you will need to wait until I get the download link for the OTA file.

      Since the new update has already been pushed, it would be just a matter of a few days until someone captures the OTA URL and posts it online.

      As soon as I have it, I will let you know.

    • Karthik

      Jun 2, 2020

      Hi Dhannanjay,

      How to update sideloading the OTA via the stock recover.

    • Dhananjay

      Jun 3, 2020

      Hi again, Karthik. I have provided a link for the page that contains the instructions in my previous comment. Please check.

    • Karthik

      Jun 9, 2020

      Hi Dhananjay

      Is there any update on my problem.. ?

    • Dhananjay

      Jun 9, 2020

      Yes, Karthik. In that case, download the V11.0.10.0 OTA from this page and follow the instructions here to sideload the OTA via the stock recovery. And the instructions for booting the Mi A2 into stock recovery mode could be found here.

    • Karthik

      Jun 26, 2020

      Hi Dhananjay,

      Don’t know how but my phone just updated to V11.0.11.0.QDIMIXM

      hahaha

    • Dhananjay

      Jun 26, 2020

      That’s great! You didn’t need to manually sideload the OTA update, am I right?

    • karthik

      Dec 4, 2020

      Hi Dhananjay,

      I already used google camera, after the recent update my mobile got formatted..
      I tried the latest patched boot and it shows

      PS C:\platform-tools> fastboot boot patched_boot_V11.0.17.0_mi_a2.img
      fastboot: error: cannot load ‘patched_boot_V11.0.17.0_mi_a2.img’: No such file or directory

      can you please help?

      Thank you.

    • Dhananjay Bhardwaj

      Dec 4, 2020

      Karthik, yes the last update for the Mi A2 caused that problem for everybody wherein users were forced to format the phone.

      The patched boot image is packed inside a .zip package (filename: magisk_patched_boot_11.0.17.0_jasmine_sprout.zip). You will need to extract its contents (using an archive utility like WinRAR, 7-Zip, etc) to get the patched boot image with filename “magisk_patched.img”. And then boot that using the following command: fastboot boot magisk_patched.img

      I have corrected the command in the instructions as well.

    • karthik

      Dec 6, 2020

      Hi Dhananjay.

      I stopped at TERMUX app,

      It shows – No su program found on this device. Termux does not supply tools for rooting.

      can you please help.

      Thank you.
      (Thanks for the previous reply too.).

    • karthik

      Dec 6, 2020

      Hi Dhananjay,

      It worked,

      You are the best😃,

      Thank you so much.

    • Dhananjay Bhardwaj

      Dec 9, 2020

      I am glad you were able to figure it out on your own, Karthik. May I know what exactly was causing the problem initially?

    • karthik

      Dec 18, 2020

      Hi Dhananjay,

      Actually after installing magisk app.. I opened it and that app asked to “restart the mobile” and i restarted my mobile (all this done before installing the TERMUX app). & Then after installed termux app it shows:- No su program found on this device. Termux does not supply tools for rooting.

      So i uninstalled magsik app normally and started again installing magsik app using Patched boot image ‘this time I didn’t restarted my device after installing Magsik app, so as usually I followed the instructions it worked 😃

      So i noticed that :- after installing Magsik app if the device is restarted then the problem occurs at TREMUX app

      Thank you.

    • Dhananjay Bhardwaj

      Dec 19, 2020

      Yes, Karthik. That’s how it works when you temporarily boot the patched boot image. I am glad you figured it out on your own.

  34. Fahim

    May 14, 2020

    Hi, I have just enabled camera 2 api in my mi a2 lite, running on Android 10 latest patch. Didn’t face any issue while following the steps. Your content is very informative. I just have one question. Can I lock the bootloader after enableing camera 2 api? Will it boot loop the device?

    Reply
    • Dhananjay

      May 14, 2020

      Hi Fahim. Glad that you’re able to enable it and thanks for the appreciation.

      I wouldn’t recommend locking the bootloader. You will need to perform this same process every time you install a new update on your phone. Without an unlocked bootloader, this won’t be possible and relocking, then unlocking bootloader again and again would be messy. So, I’d suggest sticking to the unlocked bootloader.

  35. Alex

    May 5, 2020

    Ha ha ha 🙂 Took me a few hours to finally make it work. And then I locked the bootlocker back and my Mi A2 Lite did factory reset momentarily, disabling Camera2 API hell away! You might wanna put in some extra hours at work & buy the Goole Pixel 3a and live a life instead :-]

    Reply
    • Dhananjay

      May 5, 2020

      Yes, I don’t understand why Xiaomi didn’t enable the API within the firmware. It’s sad that the users have to go through such a trouble after every update, just to get a camera app working. Glad the Mi A3 hadn’t got the same fate as its predecessors.

      Pixel 3a is a great choice in a budget too!

  36. Federico Navarrete

    May 4, 2020

    When I meant the SD Card, I meant that I configured for storing apps not only for images or videos. If you do this, then you have the bug that the app is not rooted because the Magisk Manager is installed in the SD Card and when it’s there then you cannot do anything. You need to move it to the Internal Storage.

    Reply
    • Dhananjay

      May 5, 2020

      Great! I have mentioned about the same within the instructions. Thanks for your keen observation and for sharing it with me.

  37. Federico Navarrete

    Apr 21, 2020

    The image for the Mi2 Lite Android 10 (patched_boot_V11.0.4.0_mi_a2_lite) is not working. The phone is still not recognized as root as soon as it loaded.

    Reply
    • Dhananjay

      Apr 25, 2020

      Hi Federico. After temporarily booting the patched boot via the fastboot boot command, do you see Magisk Manager in the phone’s app drawer?

    • Federico Navarrete

      Apr 26, 2020

      No, I don’t see it and when I check the root checker it gives an error that I don’t have root permissions.

    • Dhananjay

      Apr 26, 2020

      Hi Frederico. While your phone is booted with the patched boot image, download the latest version of the Magisk Manager APK from here and install it. Once installed, open the app and check if it shows whether Magisk is installed or not.

    • Federico Navarrete

      Apr 27, 2020

      I tried it, but it didn’t work. The only different that I did after I had enabled the first time the Camera2 with the Nov 2019, is that I factory reseted my phone in Feb. Later, in March I tried to re-enable the Camera2 with the same process and I started to get the error that was shared before that the root is not working and the Magisk is not being installed.

    • Federico Navarrete

      May 4, 2020

      Hi Dhananajay,

      I discovered the root cause of all this problem. You must have the Magisk Manager installed in the Internal shared storage. If for X or Y reason you have an SD configure, then it’s going to create the errors.

      This should be added as a warning.

    • Dhananjay

      May 4, 2020

      Hi again, Federico. I am so glad you finally figured this out, all on your own. And thank you for providing the information.

      Did you mean adoptable storage when you mentioned “SD configure”?

    • Dhananjay

      Apr 29, 2020

      Try updating to the latest platform-tools from here and see if it makes any difference.

      On a side note, are you using an AMD PC or a USB 3.0/3.1/3.2 port while fastboot booting the patched boot?

    • Federico Navarrete

      May 3, 2020

      Nothing, I updated it to the lastest one: 30.0.0-6374843

      Also, I’ve an Intel PC and I tried both 2.0 and 3.0 and the same result.

      Thanks.

    • Dhananjay

      May 4, 2020

      Okay, so everything seems to be just fine on your PC’s end.

      Now, the only suggestion I have is to download the stock boot image of V11.0.4.0, patch it via Magisk Canary, and try that patched boot image.

      Do you know how to do it?

    • Federico Navarrete

      Apr 27, 2020

      Also, I installed on my own and it didn’t work, similarly to the previous patch. The only different I did the last time is that I factory restarted the phone, but the boot kept unlocked.

    • Dhananjay

      Apr 28, 2020

      Hi. Thanks for the information. It’s odd. As the same image has worked for some other readers. Could you please tell me which version of fastboot are you using?

    • Federico Navarrete

      Apr 29, 2020

      Hi Dhananjay,

      This is my version:
      fastboot version 29.0.5-5949299
      Installed as C:\Android\android-sdk\platform-tools\fastboot.exe

    • Federico Navarrete

      May 4, 2020

      I also tested the beta as suggested and didn’t work.

    • Dhananjay

      May 4, 2020

      Oh, so you patched the stock boot image via Magisk Canary and that patched boot didn’t work either?

    • Zaki Jaaskelainen

      Apr 30, 2020

      I confirm the same problem with the CAF Q 3.18 kernel on top of 11.0.4.0 on Mi A2 Lite.
      I had to download the latest Magisk beta to get root working.

    • Dhananjay

      May 1, 2020

      Hi Zaki. Thanks a lot for providing your knowledge and experience on this topic, and resolving the issue.

      So, the latest boot image from V11.0.4.0 firmware should be patched via Magisk Beta/Canary and not stable Magisk, am I correct?

  38. Tom

    Apr 20, 2020

    update to v.11.0.8.0 mi a2 please

    Reply
    • Dhananjay

      Apr 25, 2020

      Hi Tom. I have just added the images for V11.0.8.0. A huge thanks to our reader Emiliano for providing the patched boot.

  39. Emiliano

    Apr 20, 2020

    could you upload the latest version v.11.0.8.0 for mia2?

    Reply
    • Dhananjay

      Apr 20, 2020

      Hi Emiliano. As soon as I get the link for the full OTA package, I will extract the stock boot and upload it.

    • Emiliano

      Apr 23, 2020

      https://drive.google.com/open?id=10oHDr_4xuWOIJmtnQX64dwMAS3cWbWhM

      Boots v.11.0.8.0 for mia2 🙂

    • Dhananjay

      Apr 25, 2020

      Hi Emiliano. Thanks for this. I added the stock boot image for V11.0.8.0. But now, thanks to you, the Patched Boot for the same is available as well.

  40. Sunday

    Apr 19, 2020

    Can you please provide patched IMG for Xiaomi a2 Lite v11.0.4.0.QDLMIXM (android 10)

    Reply
    • Dhananjay

      Apr 19, 2020

      Hi Sunday, I have added the boot images for V11.0.4.0 to the section.

  41. f.y.

    Apr 19, 2020

    a2 lite v11.0.4.0 stock boot image (released on 4/15) is here:
    http://hugeota.d.miui.com/V11.0.4.0.QDLMIXM/miui_DAISYGlobal_V11.0.4.0.QDLMIXM_43d1799e9a_10.0.zip

    Reply
    • Dhananjay

      Apr 19, 2020

      Thanks for sharing the link! I have added the stock boot image to the downloads section now. Also, I have added your name towards the end of the article for your contribution. Thanks, f.y.!

  42. Miraj

    Apr 18, 2020

    Can you please suggest me the best stable gcam available for mi a2?

    Reply
    • Dhananjay

      Apr 19, 2020

      Hi Miraj. If you’re looking for the latest GCam features like astrophotography mode, then use “PMGC_7.0.009_ConfigsVersion_V3.apk”. If stability is your primary concern then try “PMGC_6.3.017_PlusParrot_V9.apk”.

    • Miraj

      Apr 22, 2020

      No the PMGC_6.3.017_PlusParrot_V9.apk it keeps crashing

    • Dhananjay

      Apr 22, 2020

      Hi again, Miraj. Do other ports work fine?

  43. siniranjith

    Apr 18, 2020

    thanks for the article, really benefited from it….one article on going back to custom rom to stock please

    Reply
    • Dhananjay

      Apr 18, 2020

      Hi Siniranjith, you’re welcome! I will surely cover an article on this very soon.

  44. Hertons

    Apr 14, 2020

    Hi Dhananjay, today a new update of android 10 has been released for those coming from android 9 with March patch. Will your method also work with this? (i read that it is android 10 v11.0.4).
    Can I use your V11.0.2.0.QDLMIXM image?
    Thank you

    Reply
    • Dhananjay

      Apr 19, 2020

      Hi Hertons. Yes, the method remains the same. You just have to make sure that you use the boot image for the firmware installed on your phone. So, do not use the V11.0.2.0 boot on V11.0.4.0.

      On the other hand, I have just added the V11.0.4.0 boot image, so you can use it. Do note that it’s the stock boot image, you will still need to patch it via Magisk.

  45. ANKIT NIRWAN

    Apr 9, 2020

    After OTA update, android 10 March security patch 2020,
    Jio 4G video calling problem,
    Other person can not see my face during call.
    I reset my device then this problem solved,
    And stock camera working but camera 2 api automatic disable after resetting,

    When I enable camera to api today using your patched boot file procedure same problem come again, and stock camera app crashes everytime.

    It means volte video calling use stock camera and due to gcam, stock camera fails to open and other person can’t see my face.

    Can you please fix this problem using some deep research

    Thank you for your continuous support for enable camera 2 api posts

    Reply
    • Dhananjay

      Apr 11, 2020

      Hi Ankit. You’re much welcome!

      I am afraid that’s the part Xiaomi has to sort and fix. This problem was picked up through the first Android 10 update that was released for the devices and nobody has found a possible solution to it yet.

      I will surely keep an eye out if a solution is achieved and update this post with that. Until then, I think you have two choices – (1) Keep camera2 API disabled, use the stock camera and VoLTE video calls, or (2) Enable Camera2 API, use GCam port, and use a different video calling service (Google Duo, etc) till this problem is resolved.

  46. Adhithia Dev M R

    Apr 8, 2020

    brooo can you please help me my phone is rebooting android logo comes up and twrp page is stuck i cant do anything else i beg you please help me

    Reply
    • Adhithia Dev M R

      Apr 8, 2020

      i have done twrp rooting in my phone and i followed you steps

    • Adhithia Dev M R

      Apr 8, 2020

      even my fastboot commands are not working is it a hard brick

    • Dhananjay

      Apr 8, 2020

      Hi Adhithia, may I know exactly at what step did this happen?

      Were you trying this method while TWRP was installed on your phone? Also, let me know if it’s the regular Mi A2 or the Mi A2 Lite?

  47. Hadi

    Apr 7, 2020

    hi, should i stay on android P instead of upgrading to android 10?
    because i read some comments there was a problem with stock camera if camera2 api enabled,
    if i enabled camera2 api on android p, does both stock camera and gcam running normal?

    Reply
    • Dhananjay

      Apr 19, 2020

      You’re right Hadi. On Pie, both the stock and GCam worked simultaneously, at least until the January 2020 update. I cannot confirm the same for the March 2020 Android Pie update, but it should work on that as well.

      The problem came after the Android 10 update. So, if you wish to use both together, you would need to stay on Pie until it’s fixed.

  48. Sebastian Florez

    Mar 30, 2020

    hello bro i have a problem. when i unlock the camera2api, the stock camera app can’t run
    how i can to resolve that

    Reply
    • Dhananjay

      Apr 4, 2020

      Hi Sebastian. That’s a known behavior after the Android 10 update. You can either use the Google Camera port or disable Camera2 API and use the stock camera. Currently, there’s no way to get them both running simultaneously.

    • Ankit NIRWAN

      Apr 10, 2020

      Jio 4G volte calling problem.
      Because it use stock camera for Video Calling.
      Other person can’t see my face

    • Dhananjay

      Apr 11, 2020

      Hi again, Ankit. Have you tried going through the Jio calling app’s settings to figure if you can set another camera app as default? If possible, this could be the only solution you have right now.

  49. Miraj

    Mar 29, 2020

    Can you please help with the stock camera not working after the pie update? Is there any way to work on that or should we wait for the update to fix it?

    Reply
    • Dhananjay

      Mar 29, 2020

      Hi Miraj. It’s a known issue with the Android 10 update. You can either use the GCam port or disable the API and use the stock camera.

      Using both of them simultaneously isn’t an option right now. It could be fixed in the next update, but no one can say that for sure.

  50. Tarikul Rabbi

    Mar 23, 2020

    After February update my Mi A2 Lite is now V11.0.2.0 !! is it available??

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Tarikul, yes, it’s available. However, you will need to patch the stock boot image via Magisk Manager by yourself.

      It’s very easy. If you want to do it, just download the stock boot image from here and follow the instructions in step #2 of this post.

      ** Follow only Step #2 **

    • Tarikul Rabbi

      Mar 24, 2020

      Thank You Bro! Finally i complete this <3 <3

    • Dhananjay

      Mar 25, 2020

      Hi again, Tarikul. That’s awesome! So, were you able to enable the API and install the GCam port?

    • Kazi Iftekharul Adnan

      Mar 27, 2020

      Sir, can you please make a complete video on this from first to last so that it becomes easy for us to do ?
      Because i’m getting confused at many steps. So please do make a video on this complete issue and share the link of the video. It’s a humble request. Please.

    • Dhananjay

      Mar 27, 2020

      Hi Kazi. I do not own the Mi A2 Lite anymore. However, I do have the Mi A1 at my disposal.

      The method on both the Mi A1 and the A2 is almost the same. I will try to do a video with that.

  51. Akash

    Mar 22, 2020

    Hello Dhananjay, I am on the December update on my MI A2 (i.e. V10.0.18.0). I tried to boot into the patched boot image but got the following error :
    C:\Users\Desktop\platform-tools>fastboot boot patched_boot_10.0.18.0_mi_a2.img
    Sending ‘boot.img’ (29933 KB) FAILED (Write to device failed (Invalid argument))
    fastboot: error: Command failed
    How to resolve this? I would like to know if I root my phone using something like Kingoroot, then change the build prop and then unroot, will the Camera2api ability persist?
    Thank you. Keep up your amazing work.

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Akash. Before anything else, DO NOT, I repeat DO NOT try one-click root solutions. Magisk creator John Wu recently blew the whistle on this topic, please read about it here.

      Now, coming over to the error message you have shared. Have you unlocked your phone’s bootloader?

    • Akash

      Mar 24, 2020

      Yes, I have an unlocked bootloader.

    • Dhananjay

      Mar 25, 2020

      Thanks for providing the info, Akash.

      Are you using an AMD PC? Also, did you connect the phone to the PC using a USB 2.0 or a USB 3.0/3.1 port?

    • Akash

      Mar 25, 2020

      No, I am using an Intel Machine and a USB 3.1 port.

    • Dhananjay

      Mar 27, 2020

      Hi again, Akash. Please try using a USB 2.0 port instead. USB 3.0/3.1 ports and AMD PCs show some abnormal behavior when using the Android SDK tools like ADB and Fastboot. I have experienced it first hand.

  52. Aziz

    Mar 21, 2020

    Waiting for Mi A2 V11.0.6.0 March Patched Boot….

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Aziz. It has been added now. Please check.

  53. Riccardo

    Mar 15, 2020

    Hi, I have just installed the March update (V11.0.2.0.QDLMIXM) and I tried this procedure. When I flash the patched image the phone remains in Fastboot mode for 2-3 seconds and then the Android One loading screen appears (the one with the horizontal lines sliding through the screen). But then, even after waiting for 5 minutes, the phone doesn’t boot into the patched OS. Am i doing something wrong or do I have to wait for the release of the newest patched image?

    Reply
    • Dhananjay

      Mar 15, 2020

      Hi Riccardo. I don’t think I have added any V11.0.2.0 patched or stock boot image yet.

      Which boot image did you use?

    • Riccardo

      Mar 16, 2020

      I’m using the V10.0.18.0 Ok, now I understand that I have to wait until you add the newest version. Sorry for wasting your time, I’m a bit of a noob

    • Dhananjay

      Mar 16, 2020

      Hi again, Riccardo. No problem at all, I have been a noob myself at a time. It’s a learning phase, to be honest.

      And please don’t say sorry as well. I am more than happy to help.

      I didn’t upload the boot images, because the Mi A2 Lite Android 10 update was called off by Xiaomi due to bugs. Anyhow, I will still extract the stock boot and get the patched one uploaded ASAP.

  54. Osvaldo

    Feb 23, 2020

    Da tempo cercavo una procedura non troppo complicata per l’A2lite.
    Funziona, grazie.

    Reply
    • Dhananjay

      Feb 25, 2020

      Hi Osvaldo. I am happy to know that it worked for you! Enjoy GCam now.

  55. Indra

    Feb 22, 2020

    Hi there, the instructions are clear and I’m able to use gcam on my MI A2, I’m using the latest version of gcam 7.2.018 Ports
    DMGC_7.2.018_ver.3.15.apk

    I’m trying to get video stabilization to work on 30fps to several version of gcam but no avail
    Does anyone know what version of gcam has the video stabilization on?

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Indra, please try using the latest DMGC port v3.9 from here.

      I have updated the download links with the latest version of each port available for the A2 series.

  56. Shakeel

    Feb 19, 2020

    I flashed the stock img and locked the bootloader again after enabling camera2 API procedure. Gcam didn’t work. now repeating the procedure again and flashing patched img. I want to ask if this is necessary to stay bootloader unlock and patched img?

    Reply
    • Dhananjay

      Feb 19, 2020

      Hi Shakeel. First off, don’t lock the bootloader as it will undo the commands you have used to enable Camera2 API and that’s the reason why you cannot use GCam.

      Next, don’t flash the patched boot image, instead, you have to temporarily boot it using the command mentioned in the instructions above.

      To make it more clear, the “fastboot boot” command is for temporarily booting (and rooting) and the “fastboot flash” command is for permanently flashing. You have to use the former.

  57. dope

    Feb 19, 2020

    Thank you so much, it works flawlessly, images are 100x better than stock camera!You are the best!
    Just one thing i am curious, do you guys experience wifi problems like randomly disconnecting, low wifi signal and slow speeds, unless standing next to the router, well cuz i do and i contacted xiaomi customer support and the guy named Adam said by the march security patch i should be fixed but we will see!

    Reply
    • Dhananjay

      Feb 19, 2020

      Hey. I am glad it proved helpful. Please keep me posted when the March update arrives.

  58. Kwanthay

    Feb 15, 2020

    By following your clear guides, I could use gcam smoothly. But I have problem now with stock camera apk on my mi a2 after updated to Android 10, it crashes Everytime I open. How to solve it?
    Thanks

    Reply
    • Dhananjay

      Feb 15, 2020

      Hi Kwanthay. It’s a known issue and probably caused by the most recent software update.

      For now, you will have to either keep Camera2 API enabled and use GCam. Or, you will need to turn off camera2 API to keep using the stock camera app.

    • Rohit

      Feb 21, 2020

      Any hope that it will sorted out in March update.

      Thanks

    • Dhananjay

      Feb 22, 2020

      Hi Rohit. We can only wait for it to release and test again.

  59. Miraj

    Feb 8, 2020

    After January Update, I am not able to use my stock camera even after flashing the latest patched boot image but google camera works fine. When I open the stock camera, the camera keeps stopping error is shown and closed. Tried clearing the app cache, app data and restarting not solved. Can you please help me

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Miraj. That’s a known issue. You can either enable the API and use GCam port only. Or you can disable the API and only use the stock camera. Both the stock and GCam port cannot be used after the Android 10 update. Hopefully, this will be resolved in the future.

  60. Erik Arambula

    Feb 8, 2020

    Hey, I’m followed all the steps and it worked perfectly. The only issue I had it was that after rebooting (phone reboot), Magisk Manager still installed, and I only could uninstall it from my android device manually (hold on the app > Unistall). I’m a little worried since you said that with the reboot, Magisk would disappear but it did not.
    Will this be a problem in the future?
    P.S. Thanks for the tutorial 😀

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Erik. Thanks a lot for your feedback, as well as for those nice words.

      The Magisk Manager application is just an app, like any other. It doesn’t root your phone and is only used to manage root permissions if your phone is rooted. Normally, if you flash Magisk patched boot image (instead of temporarily boot it, as we did here), then the Magisk Manager app gets installed automatically and will be uninstalled automatically when you unroot.

      Now since we’re only temporarily booting the patched/rooted boot image, the application’s behavior isn’t the same as above and thus it needs to be removed manually.

      So, no, this won’t create any problems for you. I hope this clears your question.

  61. Onur

    Feb 7, 2020

    Merhaba bilgilerin öncelikle çok faydalı güzel başarılarınızın devamını dilerim.
    Benim bir sorum olucaktı. Gcam yükledim sorunsuz çalışıyor ancak güncelleme alamıyorum sanırım Root edip build.propda oynama yaptığım için.
    Asıl sorum cihazımın versio’nu V10.0.13.0.PDIMIXM bu. Stok olan sürümünü yüklerken fastboot ekranında cihazım komple sıfırlanır mı? Sıfırlanmaması için ne yapabilirim ?

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Onur. Modifying the build.prop file manually is not a good idea, and I hope you have understood now.

      Now, as for your question regarding restoring the stock firmware. I suggest you download the stock V10.0.17.0 fastboot firmware from here. Once you have downloaded, you can flash the fastboot firmware using the Mi Flash Tool. instructions for the same could be found here.

      In order to prevent the flashing process from resetting your phone, you have to use the ‘Save user data’ option in the Mi Flash Tool’s window.

      I would still suggest that you take a complete backup first. In case anything goes wrong, you will still have your important data save with you.

  62. Julian

    Feb 4, 2020

    I am stuck at the “su” command, it says “Permission denied”

    Have updated my Mi A2 Lite to the latest January update v18 and also used the same img. provided from your site. Bootloader is unlocked, img. loading from fastboot mode seems to work fine, phone boots up 2-3 seconds after I activated it from my MacBook terminal. However Magisk is not automatically installed so I tried multiple times to install it manually as you say. But once I install it never asks to install a full version. It also never says that Magisk is installed, only the manager.

    Reply
    • Dhananjay

      Feb 6, 2020

      Hi Julian. Could you please try this patched boot image (download link) and let me know if it works correctly?

    • Federico Navarrete

      Feb 8, 2020

      Hi Dhananjay,

      I have the same issue, here you have a video:

      https://youtu.be/kzVsGFyoiiU

      It’s in my case Mi 2 Lite, January 2020 update.

      Thanks.

    • Dhananjay

      Mar 23, 2020

      Okay. I get it now. Thanks for the video, it cleared up everything for me. Are you still using the same firmware or have you upgraded your phone to Android 10?

      I think the provided boot image is not a full boot image, but an incremental one. I will extract and upload the right one.

    • Julian

      Feb 10, 2020

      I tried again with the .img you provided, also tried with a Windows PC this time, booting up works fine but still no Magisk Manager installed. Also when I install it manually, the terminal gives me “Permission denied” for “su”.

    • Dhananjay

      Feb 10, 2020

      Hi Julian, could you please launch Magisk Manager and let me know if it shows whether Magisk is installed or not?

    • Julian Koch

      Feb 11, 2020

      It says Magisk is not installed.

    • Dhananjay

      Feb 11, 2020

      Okay. There definitely seems to be some problem. Please let me know which software build number you have installed on your phone? Also, is it the Mi A2 or the A2 Lite?

    • Federico Navarrete

      Feb 11, 2020

      Hi Dhananjay,

      From the original question it says:

      “Mi A2 Lite to the latest January update v18”

      I think all issues are connected to the Mi A2 Lite in the update of Jan 2020.

      Thanks.

    • Dhananjay

      Mar 23, 2020

      Yes, you’re right. The problems were with the update itself.

    • Julian Koch

      Feb 13, 2020

      I have Mi A2 Lite and PKQ1.180917.001.V10.0.18.0.PDLMIXM

    • Dhananjay

      Feb 13, 2020

      Okay, Julian. Now, it’s best that you patch the stock boot image by yourself and then use that.

      First of all, download the stock boot image of V10.0.18.0 from here. Then follow step #3 in this guide to patch the file. Once done, copy the patched boot image (filename: magisk_patched.img) from your phone’s “Download” folder to the PC (where Android SDK tools are installed).

      Then use the instructions above to temporarily boot the patched boot image file using:
      .\fastboot boot magisk_patched.img

      When the phone boots, go to Magisk Manager and see if it shows that Magisk is installed or not.

    • Julian Koch

      Feb 14, 2020

      Everything seems to work but in the end, Magisk is still not installed.

    • Dhananjay

      Feb 14, 2020

      Hi Julian. Thanks for going through the steps manually.

      I am not exactly sure what to tell you now. I will try doing a bit of research and will get back to you (and others who are facing this) with a solution.

    • Riki

      Feb 10, 2020

      Stocm kamera forced close if aktivated camera2api….any solutions for this problem ???

    • Dhananjay

      Feb 11, 2020

      Hi Riki. It’s a known issue, probably something introduced in the latest software. You will either have to keep camera2 API enabled and use Google Camera port, or disable it and use the stock camera application.

  63. Julian

    Feb 2, 2020

    I have mounted the newest patch (Patched Boot Image, V10.0.18.0.PDLMIXM) on my A2 lite (V10.0.18.0.PDLMIXM) in Fastboot mode, it doesn’t immediately boot but takes like 2-3 seconds, then boots up normally. The Magisk Manager is not installed so I proceed to install the newest version manually. When I launch the app, it does not ask me to upgrade to a full version. Also Magisk is not installed, only the Manager. From there with Termux I insert “su” but it says “Permission denied”.

    Do I need to install Magisk?

    Reply
    • Dhananjay

      Feb 6, 2020

      Hi Julian. It certainly seems like a problem with the patched boot image. Could you please try another one (download link) and let me know if it works?

    • Federico Navarrete

      Feb 9, 2020

      It’s the same issue.

    • Dhananjay

      Feb 9, 2020

      That’s extremely odd. I will try searching a bit to see what exactly is the issue.

      The one I provided in this post and the comments are patched boot images from two different sources. And still, both fail to work.

      I will keep you posted.

    • Shashank

      Feb 27, 2020

      I got my Mi a2 updated to android 10 and its version is 11.0.5.0 i followed ur instructions after booting patched img system booted in 2-3 secs after boot there is no magisk installed so i installed externally at termux command “su” not working

    • Dhananjay

      Feb 28, 2020

      Hi Shashank. After booting with the patched boot image, did you try installing the Magisk Manager app manually? Try that please and then launch Magisk Manager to verify if Magisk is installed or not.

  64. dzukicha

    Jan 29, 2020

    when i shift and right click it opens cmd, can i use cmd instead of powershell

    Reply
    • Dhananjay

      Mar 23, 2020

      Yes, for sure you can.

  65. Aziz

    Jan 29, 2020

    After UBL and enable cam2api, the microphone both during calls and records, the sound produced is not loud, is there a way to fix it?

    Reply
    • Dhananjay

      Mar 23, 2020

      Hi Aziz, is it the Mi A2 or the A2 Lite? and which Android version is it running?

  66. Amit

    Jan 26, 2020

    When i am booting patched_boot_11.0.5.0_mi_a2 via fastboot,, the device boots into stock recovery and asks for factory data reset.
    What to do ??

    Reply
  67. Federico Navarrete

    Jan 25, 2020

    Hi Dhananjay,

    I’ve issues with my mi2 lite Jan 2020 update, in the Magisk I get this error:

    Unsupported/Unknown image format.

    And when I check the root in Root Checker, I get:

    Sorry, Root access it not properly installed on this device.

    When I try su, I get:

    Permission denied.

    Is the patch working? Or maybe a new one is needed. Thanks!

    Reply
    • Dhananjay

      Jan 26, 2020

      Hi Frederico, which firmware update is installed on your phone? Also, which patched boot image did you use?

    • Federico Navarrete

      Feb 1, 2020

      It’s the January 2020 update. I’m using the last patch for Jan 2020.

    • Dhananjay

      Mar 23, 2020

      Could you please share the exact command you’re trying to enter?

    • Federico Navarrete

      Feb 1, 2020

      Hi Dhananjay,

      I’m using: V10.0.18.0.PDLMIXM (January 2020 Update), but it’s not working.

    • Dhananjay

      Feb 2, 2020

      Hi Frederico, can you provide details on how it’s not working? I mean, when you enter the “fastboot boot patched_boot_10.0.18.0_mi_a2_lite.img”, does your phone boot into the OS?

    • Federico Navarrete

      Feb 7, 2020

      Hi Dhananjay, yes it boots and I get this:

      In Magisk I get this error:

      Unsupported/Unknown image format.

      And when I check the root in Root Checker, I get:

      Sorry, Root access it not properly installed on this device.

      When I try su, I get:

      Permission denied.

  68. V

    Jan 25, 2020

    Hi, there’s a new update for January 2020. It’s V11.0.5.0.QDIMIXM, when will the patched boot image be available? Thank you.

    Reply
    • Dhananjay

      Jan 26, 2020

      Hi V. It has been uploaded now. Please check again.

  69. Aziz

    Jan 25, 2020

    Waiting for Mi A2 Android 10 v11.0.5.0 Patch boot

    Reply
    • Dhananjay

      Jan 26, 2020

      Hi Aziz. It has been uploaded now. Please recheck.

  70. Konstantin

    Jan 24, 2020

    Hello! January update came out (v11.0.5). Will there be more patced boot and how much will they wait? Thank you!

    Reply
    • Dhananjay

      Jan 24, 2020

      Hi Konstantin. I have added the download link for the stock boot image. The patched boot image is not available yet. Please patch the provided 11.0.5.0 stock boot image using Magisk Manager.

    • Huberto

      Jan 26, 2020

      Hello. I have a Mi A2 and I did all the procedures successfully. However, in termux, the SU command is not recognized (No su program found on this device). What do you suggest I do to continue unlocking the camera2api? Obs. Magisk only Manager is installed. That’s correct, right?

      Thanks

      Huberto

    • Dhananjay

      Jan 26, 2020

      Hi Huberto. Please launch the Magisk Manager app, and check if it shows that Magisk is installed or not?

    • hilmi

      Jan 26, 2020

      hi sir, i want to ask. i have done reboot now system for my phone but after reboot my phone still have magisk app and its still install. What i have to do?

    • hilmi

      Jan 26, 2020

      or i can just uninstall magisk app? but when i open magisk app its still say magisk and magisk manager install with green tick

    • Dhananjay

      Jan 26, 2020

      Hi Hilmi. Are you sure that you used the “fastboot boot” command and not the “fastboot flash boot” command during the instructions?

    • hilmi

      Jan 27, 2020

      ouhh no, hm i think i used “fastboot flash boot” command. so what i have to do hmm? how can i uninstall magisk and unroot my phone? can you help me sir? And if i get OTA update, can i just download it like usually?

    • Dhananjay

      Mar 23, 2020

      The simplest way to unroot in that case is either by using the ‘Uninstall’ option in Magisk Manager or by re-flashing the stock boot image corresponding to the software version.

    • hilmi

      Jan 27, 2020

      sir, i “complety uninstall” magisk and now my phone stuck at no command and cant open anymore. hmm help me sir, what should i do

    • Dhananjay

      Mar 23, 2020

      Hi Hilmi, that’s the stock recovery screen initialization. Press and hold the Power button, and then tap the Volume Up button once. You should then see the stock recovery screen.

      In there, you have to select ‘Reboot system now’ to reboot your phone back into the OS.

  71. Mohd Azman

    Jan 23, 2020

    The latest version of Android 10 on MI A2 is V11.0.5.0 .. But no patched boot image been posted yet. 🙁 is it safe to flash the previous version? i.e V11.0.4.0.

    Reply
    • Dhananjay

      Jan 24, 2020

      Hi Mohd. Please, never flash a boot image (Stock or patched) that are not meant for your installed software version.

      I have added the link to the stock boot image. But I am afraid you’ll need to patch it yourself first. The instructions for patching could be found here.

  72. undertherain

    Jan 23, 2020

    Will the procedure be redone on the first OTA update?

    Reply
    • Dhananjay

      Jan 24, 2020

      Yes, the procedure will need to be redone after every OTA update.

    • undertherain

      Jan 25, 2020

      Sorry but I can’t.
      I unlocked, everything ok.
      I flashed the “patched_boot_10.0.17.0_mi_a2_lite.img” file but there was no Magisk on reboot.
      So I installed apk for Magisk 7.1 but starting the app it tells me that Magisk is not installed.
      I tried from inside the Magisk app to flash “patched_boot_10.0.17.0_mi_a2_lite.img” again but it always tells me that Magisk is not installed and I can’t do it from Termux.
      What should I do?
      Thanks!

    • undertherain

      Jan 25, 2020

      I believe (I hope) to have solved.
      After locking the Mi A2 Lite in bootloop (at times I use it as an ashtray …;)), I flashed v.13 of the software with MiFlash and then I made the following steps:

      1 – Flashing from Magisk Manager “patched_boot_10.0.18.0_mi_a2_lite.img”
      2 – Copy from Internal \ Download “magisk_patched.img” under C: \ adb
      3 – Restart in recovery
      4 – Flash:
        – fastboot devices
        – fastboot flash boot magisk_patched.img
        – fastboot reboot
      5 – Check from Magisk Manager if Magisk is installed
      6 – Install Termux and do:
        – on (agree Superuser)
        – 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
      7 – Install apk GCam

      The above steps must be redone with each update (since I updated with the latest OTA and I redid everything for testing).
      Thanks again friend …;)
      Just one question: I can’t find the Recommended Settings you described in the latest version of GCam 7.2.018, under settings / advanced … did the developer remove them?

    • Dhananjay

      Jan 26, 2020

      Hello,

      I believe I misunderstood your question in the first place.

      Yes, the procedure needs to be performed every time you install an OTA update. And it’s extremely important to use the patched boot image corresponding to the software version installed on your phone. For example, if you recently updated the phone to V10.0.18.0, then you must use the 10.0.18.0 patched boot image only.

      Regarding the instructions, make sure that you do not flash the patched boot image. Instead, temporarily boot it using the “fastboot boot” command.

      One more thing, earlier when you were unsuccessful, were you using the 10.0.17.0 patched boot image after updating your phone to 10.0.18.0?

      As for the recommended settings, they were meant for the initial versions of GCam for the phone.

  73. leo

    Jan 23, 2020

    Hey there! quick question pls, I have a A2 with Gcam installed with your help (thx btw) all fine untill my oem camera stopped working today after latest OS update, it just doesn’t open the app. I am on V11.0.5.0.QDIMIXM. I uninstalled Gcam apk bc i assumed that was the problem, reset the phone, deleted cache + data everything but now i dont have any working camera! lol. Should I do a factory reset? block the bootloader? flash? idk helppppp pls

    Reply
    • Dhananjay

      Jan 24, 2020

      Hi Leo. It’s not just with you. Everyone on the Mi A2 with January update (V11.0.5.0) and camera2 API enabled is facing this problem. It’s definitely a problem introduced by the software, so locking the bootloader would be useless.

      For now, you can either enable Camera2 API and keep using GCam as your primary camera app. Or, you can undo the API commands to disable camera2 API and only use the stock camera app.

      As far as I know, this is the only probable solution.

    • leo

      Jan 25, 2020

      I guessed it was some conflict with the update. Really appreciate ur input, I went with a factory reset since it was the easiest route for me at the time and all good now. Bootloader still unlocked, i’ll get that cam again for sure, stock cam is really nice tho.
      Million thanks! i’ll keep an eye on your page, keep it up

    • Dhananjay

      Jan 26, 2020

      Yes, that’s right. A conflict with the software.

      And thank you for the kind words. Really appreciate it.

    • Prithwish

      Jan 29, 2020

      Same Problem here with me. January security patch; enabled cam2api ( thanks btw). Stock Cam stopped working; in my case only one gcam mod is working others are not!?
      Android Q update in A2 has a lots of bug in itself.. I received this update on 20/01/20 along with Jan security patch. By the way which custom rom do you suggest if I switch to? PE would be okay?

    • Dhananjay

      Mar 23, 2020

      Hi Prithwish. You’re not alone. With the Android 10 update, Xiaomi has surely made some changes regarding the camera API usage.

      For now, you will have two choices:
      1) Enable Camera2 API and use GCam port without stock camera
      2) Disable the API and use the stock camera only

      As for the Android 10 update, it has been a total blunder, not just for the Mi A2, but for the A2 Lite and Mi A3 as well.

      For custom ROMs, I would suggest Pixel Experience or HavocOS, the latter is good with features. BTW, which ones have you tried till now?

  74. Hussain

    Jan 22, 2020

    Please upload the lastest patched boot image i.e. V11.0.5.0.QDIMIXM with the January Security Patch for Mi A2.

    Reply
  75. Laz Coder

    Jan 21, 2020

    Hello, January patch released for Mi A2. Can you add?

    Reply
    • Dhananjay

      Jan 24, 2020

      Hi Laz. I have added the stock boot image for the January patch. At the moment, the patched boot image is now available. So, you will need to patch the boot image by yourself, using Magisk Manager.

  76. VISHWA

    Jan 17, 2020

    Hi! Thanks a lot for the tutorial. I got gcam successfully installed on my device.
    Thanks again.

    Reply
    • Dhananjay

      Jan 24, 2020

      Good to know, Vishwa. Enjoy GCam now.

  77. Dox

    Jan 14, 2020

    Waiting for patch boot mi a2 android 10

    Reply
    • Dhananjay

      Jan 14, 2020

      Hi Dox. They are up for download. Please refresh the page and check again.

      Again, the credit for these goes to Nicola!

    • Karl Mark Arce

      Jan 20, 2020

      Hi sir, there’s a new Android 10 update V11.0.5.0. please let us have another new patched boot file, because stock camera not working. And also can I ask how will I fix the issue. My phone bootloader is fully unlocked, and Camera2Api Enabled. After updating to android 10, my Stock Camera is crashing, but Gcam app works fine no issue. What are the steps i should do? Thank you

    • Dhananjay

      Jan 24, 2020

      Hi Karl. The issue is known, and would probably be fixed in a future update. Just in case, have you tried performing a factory reset?

      The stock boot image for V11.0.5.0 is now available. However, since I do not own the device anymore, I cannot patch it. For now, you will need to patch it by yourself using the instructions here.

    • Karl

      Jan 21, 2020

      Android 10 V 11.0.5.0 Patched boot image please, new update January 20

    • Prithwish

      Jan 22, 2020

      V11.0.5.0 with January security patch. Link not updated yet. Thanks in advance

    • Dhananjay

      Jan 24, 2020

      Hi Prithwish, I have added the download link for the stock boot image. You will need to patch it using Magisk Manager by yourself (for now).

  78. Madi

    Jan 13, 2020

    Hi Dan (If you like it)

    I have unlocked the bootloader and have two issues

    1. Each time I restart My Mi A2 it show a black warning screen and ask to press power button twice; is it normal? Can I bypass this?

    2. There is unusually fast battery drain occurring after I did the step by step procedure you mentioned in this article. please help asap as the phone is with my mom and she will kill me if I don’t correct it soon…hehehe 😉

    Reply
  79. Nitish

    Dec 27, 2019

    Sir, whenever I try to boot patched image, either nothing happens or I get a message “press any key to shutdown” on top left corner of phone’s screen.

    Reply
    • Dhananjay

      Dec 28, 2019

      That’s odd. Is your phone’s bootloader completely unlocked?

    • Nitish

      Dec 28, 2019

      Yes, it is, even when it was not working, I locked and unlocked the bootloader again.
      I am on November update.

    • Dhananjay

      Dec 28, 2019

      Hi. Is it the Mi A2 or the Mi A2 Lite? Can you please share the complete name of the patched boot image file that you downloaded and used?

    • Nitish

      Dec 28, 2019

      Also, it gives an error “Failed too many links”

    • Dhananjay

      Dec 28, 2019

      That’s an issue with fastboot being initiated too many times. Simply disconnect the phone, reboot the PC, connect again and the error should be gone.

  80. Ciocan Andrei

    Dec 27, 2019

    With this procedure will phone be wiped to factory state ?

    Reply
  81. Nanang Walker

    Dec 26, 2019

    Is the oreo patched boot version missing? just pie? my version v9.6.11.0 help plz

    Reply
    • Nanang Walker

      Dec 26, 2019

      My phone Mi A2 Lite

  82. Elison Lici

    Dec 23, 2019

    i don’t understand the 18th step, how can i reboot my phone and unroot it completely?

    Reply
    • Dhananjay

      Dec 24, 2019

      Hi again, Elison. After you have performed the procedure, you just have to reboot the phone. Rebooting will automatically uninstall Magisk and unroot your phone.

    • Andrei

      Dec 27, 2019

      Will this procedure cause a phone wipe ?

    • Dhananjay

      Dec 27, 2019

      Hi Andrei. This procedure requires an unlocked bootloader. If you have already unlocked the bootloader, then nothing will be wiped.

    • Ben

      Dec 28, 2019

      reboot the phone but it is still rooted. should I unroot the phone with app like SuperSU?

    • Dhananjay

      Dec 29, 2019

      Hi Ben. After rebooting, could you please open the Magisk Manager app and check whether it shows that Magisk is installed or not?

    • Gabriel

      Jan 13, 2020

      For android 10 when?

    • Dhananjay

      Jan 14, 2020

      Hi Gabriel. I have uploaded them. Huge thanks to one of our avid readers; Nicola, for sending these Android 10 boot images to us.

  83. Marcus

    Dec 1, 2019

    Hello Dhananjay,

    Thank you so much for this details step-by-step guide. I had bought the xiaomi a2 lite recently, I love everything out of it but not the camera. Now I have this camera installed and it is so much better. I am working in the field of software also but I focus in web development. Man, really appreciate your work! Hat off to you. I wish you all the best in your future! Cheer!

    Reply
    • Dhananjay

      Dec 2, 2019

      Hi Marcus. I am glad my tutorial was helpful. Thank you so much for the kind words! These sorts of comments keep me going. All the best to you too, my friend.

    • Nasigo

      Dec 28, 2019

      Is there any procedure to instal gcam in mia2 without root

    • Dhananjay

      Dec 29, 2019

      Hi Nasigo. This procedure is as close as it can get to “without root”. By following this, you will only be temporarily rooting your phone for just 5 minutes until you can execute the commands. Once done, a simple reboot will unroot your phone and you shall have camera2 API enabled.

  84. CLS

    Nov 25, 2019

    Does get the gcam to work.
    But bootloader remains unlocked, what is the problem?
    After executing the commands in the termux, what else do i need to do to make sure bootloader is locked.
    Just reboot?

    Reply
    • Dhananjay

      Nov 27, 2019

      Hi CLS. The bootloader needs to be kept unlocked. Or else, the camera2 API changes would be undone, and you will not be able to use GCam.

      The command in this tutorial will finally unroot your phone. They wouldn’t help you re-lock the bootloader.

      If you don’t want to use GCam and want to re-lock the bootloader, then let me know. I will help you do it.

  85. mitul parikh

    Nov 25, 2019

    sir all is ok just how to patch the stock image i tried it couple of time but when phone restart bootloader show the error also oem has tobe kept unlocked in developer option?

    Reply
    • Dhananjay

      Nov 25, 2019

      Hi Mitul. I am sorry, but I didn’t understand the first part of your question fully. Could you please elaborate?

      As for OEM Unlock, yes, it needs to be kept enabled.

  86. Suraj R

    Nov 22, 2019

    Hey Dhananjay !

    Thanks for such a detailed and up to date guide ! I was extremely surprised to see patches even for the latest month ! Kudos to you for being so active in the comments section and extensively helping everyone in the process.

    I haven’t yet unlocked the bootloader and tried this, but I will, in the future !

    Thanks for this post and all your hardwork 🙂

    Reply
    • Dhananjay

      Nov 22, 2019

      Hi Suraj. Thank you for all the kind words! I am so happy that you took the time just to appreciate my work. That means a lot.

      And yes, do let me know when you try it. If you need any help, I am always here.

  87. Shashank Tulsian

    Nov 21, 2019

    I need a patched boot image for 9.6.9.0. Can you help with that?

    Reply
    • Dhananjay

      Nov 22, 2019

      Hi Shashank. Yes, I will help for sure. Please let me know which device you’re using? Is it the Mi A2 or the Mi A2 Lite?

  88. JadC

    Nov 15, 2019

    Hey, can you tell how much time it usually takes for the boot image being released after a new update? I just installed the november update and wanted to try this.

    Thanks

    Reply
    • Dhananjay

      Nov 22, 2019

      Hi JadC. I have uploaded the new images. Please check now.

      As for the time-frame, there’s no exact time. It all depends on how soon someone shares the full OTA package or a Fastboot image. Once I get my hands on that, I instantly extract the stock boot image, patch it via the latest version of Magisk, and add the download links to this post.

  89. Felipe

    Nov 13, 2019

    Hey, i got camera api enable but Netflix is not in the playstore, so i tried flashing stock boot and it didn’t work.
    I used fastboot flash bot stock_boot.img.
    And i also tried download the apk from the netlix page but a message about incompatibility appears with i try open it. however, I like Gcam, I thought it wouldn’t work, thank you.

    Reply
    • Dhananjay

      Nov 15, 2019

      Hi Felipe. Netflix wasn’t visible on the Play Store because of Google Play Protect certification.

      After finishing with the method, did you reboot your phone?

  90. Shrey Shah

    Nov 3, 2019

    Hi Dhananjay,

    It is unbelievable how a sub 15k phone can be turned into a beast camera phone using GCam, and all thanks to you for making that possible! I have been enjoying the feature for over 5 months but recently I noticed that my camera is taking blurred out pictures on one side. I looked up and found that its a common hardware problem with Mi A2 devices. Fortunately, my phone is still under warranty and I need to relock my bootloader to claim the same. Honestly, I am a newbie. Could you please give me a detailed step-wise description on how I can relock my bootloader?
    Thanks a lot again for the work you have done and the kind of extended support you have been providing.

    Reply
    • Dhananjay

      Nov 3, 2019

      Hi Shrey. Thanks for the kind words.

      Before you proceed to relock, are you sure that your device is not rooted or doesn’t have any other sort of modifications?

    • Shrey Shah

      Nov 6, 2019

      Yes Dhananjay. The only procedure I have ever carried out on my phone is temporarily rooting it as directed in this article.

    • Shrey Shah

      Nov 8, 2019

      Yes. Except following the steps mentioned in this article to temporarily root the phone, I haven’t made any modifications.

    • Shrey Shah

      Nov 18, 2019

      Hi Dhananjay, I haven’t made any modifications. Could you please help? My warranty is about to expire soon.

    • Dhananjay

      Nov 18, 2019

      Hi, again Shrey. Great! Now, first of all, let me know exactly which command did you use to unlock the bootloader in the first place? Was it “fastboot oem unlock” or “fastboot flashing unlock”?

    • Shrey Shah

      Nov 20, 2019

      I’m not very certain as I did it long time ago. But I strongly feel it was “fastboot OEM unlock”.

    • Dhananjay

      Nov 20, 2019

      Hi again Shrey. Yes, then “fasboot oem lock” should allow you to re-lock your phone’s bootloader.

    • Shrey Shah

      Nov 21, 2019

      Is that all I need to do? Thanks a lot for the help. I was of the impression that I need to boot it with stock image again.

    • Dhananjay

      Nov 22, 2019

      Yes, that’s all you’d need to do. As for the stock boot image, you already have it installed, don’t you?

    • Shrey Shah

      Nov 23, 2019

      Hi Dhananjay! I just went on and executed “fastboot oem lock” command. It worked and the bootloader locked. Just got my camera module replaced from the service centre! Thanks a lot for the help.
      Now, when I was trying to follow the steps to enable camera2 api again, I couldn’t find magisk manager in the app drawer. I am stuck at step 12. Please guide on how can I install magisk manager?
      For now, I am flashing the stock image again.

    • Dhananjay

      Nov 24, 2019

      Hi Shrey! That’s great news.

      Now, you have to unlock the bootloader again, and then proceed with the steps.

      In case, after booting with the Patched Boot Image, Magisk Manager isn’t installed automatically. Then download the APK directly from here and install it manually.

    • Shrey Shah

      Nov 23, 2019

      I tried downloading the apk version 7.4.0 and installed it. When I opened the app, it said Magisk is not installed. I am not sure how to install it. Please help

    • Dhananjay

      Nov 24, 2019

      Hi again, Shrey. Magisk will show as installed only when your phone is booted with the Patched Boot Image.

    • Shrey Shah

      Dec 7, 2019

      Hi Dhananjay! Thank you so much for all your support! I was able to successfully enable camera2api and i have GCam back on my phone. Kudos to you!

    • Dhananjay

      Dec 7, 2019

      Hi again Shrey. I am glad you were able to enable it without any problems. Good luck and thanks for the kind words.

    • Hussain

      Jan 21, 2020

      V11.0.5.0.QDIMIXM is the latest version of Android 10 with January security patch (Mi A2). Can you please provide/update the respective boot images?

      Thanks in advance!

    • Dhananjay

      Jan 24, 2020

      Hi Hussain. I have added the stock boot image for the same. I am afraid that you’ll need to patch the boot image by yourself (for now).

  91. Theresa

    Nov 3, 2019

    Hi, I followed your tutorial and Gcam is working nicely on my Mi A2, so that’s really cool…but now I’m having problems with Safety Net. Everything checks out except I get a CTS profile match fail. Magisk is no longer installed and I checked for root and it says the phone is not rooted. Could this be because of the unlocked bootloader? I had a Samsung galaxy watch connected to my phone and now it won’t let me install the galaxy wearable app. Is the any fix for this that doesn’t involve relocking the bootloader?

    Reply
    • Dhananjay

      Nov 3, 2019

      Hi Theresa. That’s odd. SafetyNet should pass since you do not have any modifications done to the phone. Have you tried flashing the stock boot image?

      Also, when you mentioned “it won’t let me install the galaxy wearable app”, did you mean that the app is not visible in the Play Store? Or it doesn’t open/run after installing?

    • Theresa

      Nov 4, 2019

      Hi Dhananjay, I did a SafetyNet test, and everything passed except for the CTS profile, which is weird, since, as you said, I haven’t made any modifications to the phone. No, I haven’t tried flashing the stock boot image yet. But If I do that, will the Camera2 api still work, or will all the settings be erased? The galaxy wearable app is in my app library, but it says it’s not compatible with my phone. Before locking the bootloader and enabling Camera2 it worked fine. I have been able to install the apk from another source, so if there’s no other way around the issue, I may just leave it, since I really like Gcam. From what I’ve read, the Galaxy wearable app on the play store won’t work if SafetyNet doesn’t pass. All my other apps work fine, but I don’t know if this will give me trouble with any apps that I might want to install in the future

    • Dhananjay

      Nov 22, 2019

      Hi, again Theresa. Please try flashing the stock boot image and check again for SafetyNet. Let me know how it goes.

  92. Laercio

    Nov 2, 2019

    Patched Boot Image V10.0.16.0.PDIMIXM ( 5 October 2019 Update) ?

    Reply
    • Dhananjay

      Nov 3, 2019

      Hi. Do you mean the recently rolled out bug-fix update for the Mi A2 (jasmine_sprout)? Am I right?

    • Laercio

      Nov 4, 2019

      my MI A2 version number is V10.0.16.0.PDIMIXM (October 5, 2019 update)
      Want to know if I can use this boot image of yours? V10.0.15.0.PDIMIXM (October 2019 update)

    • Dhananjay

      Nov 5, 2019

      No. Do not use that. I have been able to get my hands on the stock boot image of V10.0.16.0 for the Mi A2. However, I couldn’t find the time yet to patch it.

      You can download the stock boot from here and patch it using the instructions (Method 2) in this post.

    • Laercio

      Nov 6, 2019

      I’ll wait for you to make it available patched boot image V10.0.16.0 for the Mi A2

    • jimy

      Nov 14, 2019

      help me need pacth boot v10.0.16.0 for mi a2 lite

    • Dhananjay

      Nov 15, 2019

      Hi Jimy. I have updated the post with the images, please refresh the page and check again.

    • jimy

      Nov 15, 2019

      yes thanks

  93. Hussain

    Oct 20, 2019

    Hi Dhananjay! I followed your instructions and now I am able to enjoy Gcam on my Mi A2. Thanks for this step by step procedure. You have really written it in a lucid and at the same time in a detailed manner with the required links for all the drivers and software making it a one stop solution for anybody who wants to enjoy Gcam without root. Appreciate your work here.
    The only place I had an issue was when after booting into the the patch image I was not able to install the full Magisk Manager app on my phone. It always encountered an error (Error while downloading Magisk) when downloading/updating the full app after clicking Yes. I tried manually uninstalling and installing from the above mentioned link but I was getting the same error. I even tried different older versions but was not able to install.
    Then I thought it’s better to start from Step 1 and repeat the same procedure again. I did it and voila! after the boot it was already showing the full app installed (don’t know how.) Finally! And yes everything is working as before all the banking apps etc. I am using the DMGC_6.2.030_ver.1.6-PE.apk as I tried the latest ver. 7 but didn’t find it stable. This version is working fine for me without any issues. Everything works. Photos obviously look more natural and detailed as compared to stock camera. The only downside is that I can’t take 20MP photos now won’t be able to utilize the full potential of the sensor because every Gcam supports upto 12MP pictures only.
    Anyways! Thanks again

    Reply
    • Dhananjay

      Oct 21, 2019

      Hi Hussain. Thank you for such kind words! This means the world to me, to be competent enough to be able to write articles that could help others.

      The issue could have been a faulty boot, it could happen, like in your case. I am glad you figured it out by yourself.

      As for GCam v7, give a try to the latest one from here, and use the device-specific config file from here. It might give you a more stable camera experience.

    • Hussain

      Oct 21, 2019

      Thanks again! As I check there were config files for Mi A2 lite and not the regular Mi A2. Could you please check?

    • Dhananjay

      Oct 21, 2019

      Hi again, Hussain. Yes, I know, but it is worth trying. Start without the config and see if you get optimal results. If not, then try the config. If it doesn’t work, then you can always clear the app’s data from the Settings to remove the config.

    • Mirage

      Oct 28, 2019

      Hi there! Just wanted to run by a couple of things before I attempt this!

      When attempting this, it won’t restore my phone to factory defaults and remove all my data right?

      Also, do I need to have developer mode/tools activated?

      Thank you! Looking forward to your reply!

    • Dhananjay

      Oct 28, 2019

      Hi Mirage. Sure, I have answered both your questions below.

      1) No, it won’t do either. However, as always, I would still suggest keeping your important data always backed up.

      2) No, there’s no need to enable any special modes/tools in the OS.

      Now before you proceed, I have a question for you as well. Do you have your phone’s bootloader unlocked? Because if that’s the case, then the answers to both your questions will change.

      If it’s already unlocked, then you can safely go ahead.

    • Shahi sharaf

      Nov 3, 2019

      Hello bro, There are 4 commands that you have stated in the above Procedure. Do i have to enter all the 4 commands or just any one of them? pls reply. Thank u

    • Dhananjay

      Nov 3, 2019

      Hi Shahi. You have to enter all 4 of them, one after the other in the given order.

      After you enter the first command, it will just enter into the next line, where you’ll enter the second command, and further the same should be done for the third and fourth commands.

  94. Hussain

    Oct 19, 2019

    october patched and boot image?

    Reply
    • Dhananjay

      Oct 19, 2019

      Hi! It is available for the Mi A2 Lite for now. Courtesy of Nico van Draanen!

  95. Hussain

    Oct 19, 2019

    hi does banking and payment apps such as Google Pay still work after the process? Can anybody confirm?

    Reply
    • Dhananjay

      Oct 19, 2019

      Hi Hussain. Yes, they’ll work.

  96. Alex

    Oct 18, 2019

    I did the whole process and the camera worked, the problem is that even after restarting the phone, the root check still point the cell as rooted

    Reply
    • Alex

      Oct 18, 2019

      Sorry I ended up getting the root, now another doubt: Will the unlocked OEM cause problems in OTA updates or not?

    • Dhananjay

      Oct 18, 2019

      Hi again, Alex. No, the unlocked bootloader does not affect OTA updates at all. Even if your phone was rooted, it is quite easy to install OTA updates while still retaining root after the update.

    • Dhananjay

      Oct 18, 2019

      Hi Alex. Being rooted and simply having Magisk Manager installed are two different things. Once you rebooted your phone after the process, did you open Magisk Manager to check if Magisk (i.e. root) was installed?

  97. victor

    Oct 10, 2019

    Me doy cuenta que al bootear el img reinicia mi cel pero al parecer no hace lo que debe ya que al instalar magisk manager me dice que magisk no está instalado, y de ahi no paso no puedo conceder permisos a termux

    Reply
    • Dhananjay

      Oct 10, 2019

      Hi Victor, when you execute the “fastboot boot” command, what result do you see in the PowerShell window?

  98. victor

    Oct 10, 2019

    hago todos los pasos pero cuando se reinicia mi ce no esta la app de magisk asi que la descargo como apk y al instalar me dice que ya esta actualizada y que magisk no esta instalado. tengo que instalar magisk tmb o como?

    Reply
  99. Archie

    Oct 10, 2019

    Hello sir,

    How do I perform a full backup of my device first before I perform this guide? Thanks in advance! 🙂

    Reply
    • Dhananjay

      Oct 10, 2019

      Hi Archie. We already have a guide here that explains it all. Although it needs updating, but the existing instructions will ensure that all your data is backed up.

      And, you’re most welcome!

    • Archie

      Oct 10, 2019

      Hello sir, after step#18 I’ll just close the cmd/powershell, disconnect the USB from my phone then reboot my phone like usual? It will boot to the stock image with the data wiped clean? No need to manually uninstall Magisk and termux?
      Thank you again 😉

    • Dhananjay

      Oct 10, 2019

      Hi again Archie. Yes, just reboot and Magisk will be automatically uninstalled and your phone will be unrooted.

      The data will not be wiped at all. The data is only wiped when you have to unlock the bootloader. If it’s already unlocked, then nothing will be wiped.

      However, I still recommend taking a backup. Just to safeguard it.

      When your phone boots back you can open Magisk Manager (if it’s still installed) and it will show that Magisk is not installed on your phone. This will confirm that Magisk has been removed completely. You can then safely uninstall Magisk Manager, as well as Termux.

    • Archie

      Oct 10, 2019

      bahut dhanyavaad, Dhananjay sir 🙂

    • Dhananjay

      Oct 10, 2019

      You’re welcome, Archie! If you have any further questions, do let me know.

  100. John

    Oct 8, 2019

    I receive this message on step 9: PS C:\adb> .\fastboot boot patched_boot_10.0.14.0_mi_a2.img
    Sending ‘boot.img’ (29929 KB) FAILED (Write to device failed (Too many links))
    fastboot: error: Command failed
    I’m using the correct patch, bootloader is unlocked, USB debugging enabled. Please help.

    Reply
    • Dhananjay

      Oct 10, 2019

      Hi John. The error you mentioned is commonly caused by using USB 3.0 ports. Reboot your PC, try using a different port and let me know how it goes.

  101. Claudio

    Oct 4, 2019

    hi, i am on v10.0.14.0, Mi A2, and i’m stuck on step 7, as when i modify the code and type itin it says: no such file or directory. What should i do?

    Reply
    • Dhananjay

      Oct 4, 2019

      Hi Claudio. Did you open the PowerShell window in the same folder where the patched boot image was downloaded?

      Secondly, what was the exact name of the file that you downloaded?

  102. Pepe

    Oct 4, 2019

    Hola de nuevo! Aunque la activarán como hay que dejar el teléfono para que no le pase nada habiendo activado la camera api mediante el sistema unroot. Habría que desbloquear el gestor de arranque o podríamos actualizar directamente como estamos?

    Reply
    • Dhananjay

      Oct 4, 2019

      Hi. Once you have unlocked the bootloader, follow this method to enable camera2 API on your phone. At the end of the process, you will need to reboot your phone. Rebooting will unroot your phone and camera2 API will still be enabled. So, you can then go ahead and install the Google Camera Port.

      Make sure to keep the bootloader unlocked. Locking it back will disable the Camera2 API again.

      As for OTA updates, if you have followed this method, you can install OTA normally without any problems. The unlocked bootloader does not affect OTAs.

    • Pepe

      Oct 7, 2019

      Yo me refiero a android 10. ¿Habría alguna consecuencia?

    • Dhananjay

      Oct 22, 2019

      No, it won’t. When the Android 10 OTA arrives, you will be able to install it normally on your Mi A2 device.

    • Pepe

      Oct 9, 2019

      Hola! Pero cuando llegue android 10 también podremos actualizar sin problema?

    • Dhananjay

      Oct 10, 2019

      Hi Pepe. Of course you can. The method only temporarily roots your phone until the required commands are executed. Once done, a simple reboot will unroot your phone.

      Also, an unlocked bootloader will not prevent you from installing the Android 10 OTA update (when it is released).

  103. Kwanthay

    Oct 2, 2019

    Successfully installed. I love “Try Night Sight”. It’s incredible. Thanks a lot.

    Reply
    • Dhananjay

      Oct 2, 2019

      Great! And you’re welcome Kwanthay. Enjoy GCam now. If you find a more recent/better version for your device, do let me know so that I can put up the link in the post for others.

    • kwanthay

      Oct 3, 2019

      Sure Mr. Dhananjay.

    • Kwanthay

      Oct 6, 2019

      Below is the link of gcam for mi a2.

      https://f.celsoazevedo.com/file/cfiles/gcm1/DMGC_7.0.009_ver.0.3-dogfood.apk

    • Dhananjay

      Oct 7, 2019

      Thanks for that Kwanthay! I have updated the post with the link.

  104. Gayanuka

    Oct 2, 2019

    Sir, editing the build.prop can modify the system isn’t it? So even we unroot we can’t receive updates or even if we update it the device can end up in bootloop isn’t it?

    Reply
    • Dhananjay

      Oct 2, 2019

      Yes, that’s correct. However, when we use “setprop”, it doesn’t actually modify the build.prop in the /system partition, rather store the properties in the /data partition (Reference).

      The method used here is fully compliant with OTA updates. If we would have actually modified the build.prop, the installation would fail. I have followed this same method on my sibling’s Mi A1 and there have never been a problem with OTA updates. I began by flashing the stock firmware to both the slots first, and then used the method to enable Camera2 API and subsequently install GCam.

      In case of most users the cause of the OTA installation problem is that they have some modifications present in the inactive slot, where the OTA would be installed.
      For instance, if someone installed Magisk on their phone, but then decide to unroot. In such cases, one should first disable and uninstall all the Magisk Modules completely, followed by a reboot. Then perform a complete uninstall via Magisk Manager. One should also take note of any other sort of modifications that have been applied.

      For example, they downloaded the Kernel Adiutor or FK Kernel Manager app (both of which require root) and tweaked their kernel a bit. If the user misses to restore those modifications, then even if they had Magisk root completely removed, the OTA will fail.

      My point is: Users often overlook the information provided within tutorials and sometimes even fail to understand the procedure in the first place, and head straight to the instructions. This is why, several of our readers have succeeded with these instructions and are still able to take OTA updates without any problems, while others have not.

      I wouldn’t blame them. the A/B partition concept is not easy to understand when it comes to custom development.

      I have been in the same boat like others, back when Froyo was the latest version available. Didn’t read the provided information and often overlooked how the procedure works. It has taught me a great amount of lessons. That’s why, I always try to provide information about the procedure, before writing the instructions in my posts.

    • Gayanuka

      Oct 2, 2019

      Thank you for your support,sir.

    • Dhananjay

      Oct 2, 2019

      You’re welcome, Gayanuka!

    • Gayanuka

      Oct 3, 2019

      Shall I backup my build.prop via a root explorer and restore it later again with the root explorer?I want to enable AR mode on some games like Gcam stickers,CSR2,Porche mission E.The game needs camera2api,arcore and must change the device to a Pixel XL or else it won’t work.So will I do it?Sir,

    • Dhananjay

      Oct 3, 2019

      Let us make it even easier. Your phone is rooted with Magisk, right?

      If so, then follow the instructions above from step #15 to 18. This will enable Camera2 API.

      Next, go to Magisk Manager > Downloads and install the ‘ARCore/Playground Patcher’ module by macrant01 and finally reboot your phone. This module will enable ARCore support, so that you can download the official ARCore app from the Play Store (Or you can manually get the APK from here as well). Next, it will also subsequently add support for AR Stickers (now known as “Playground”). Get the patched Playground APK from here.

      Why I am suggesting this procedure? It will make OTA installation much more easier and quick. So, you wouldn’t have to restore build.prop or do any thing. When an OTA arrives, simply disable and uninstall the module, then follow the instructions here.

    • Gayanuka

      Oct 3, 2019

      I tried it Sir it changed my finger print to Pixel 2 and I was able to install ARcore and Playgrounds officially via playstore but AR apps didn’t work,it shows the device is supported but it’s not working.The grids are not showing on AR apps.I saw something weird has happened when I go to the settings I saw my security patch has changed to September 5 2019 to August 1 2019 so I think it’s working up to August 1 2019.I found a module called daydreambypass on a website.The website is mentioned as the module works up to Oreo but it worked to Pie.All AR apps got worked and my device model has changed to Pixel XL but I faced an issue again.when I placed the AR model it won’t stay in one place it starting to fly away when I get close to it.I don’t know the reason.If you know anything sir you can help me, thanks!

    • Gayanuka

      Oct 3, 2019

      Thank you sir, Before following this method I was using a magisk module to make camera2api working but I followed your steps and enabled camera2api with the help of termux.Still I didn’t got AR working anyway I got at least Gcam working.I’ll find a way myself to get AR working,thank you for your support sir.If you know anything about AR working on mi A2 help me by replying thank you so much sir.

    • Dhananjay

      Oct 4, 2019

      Hi. Thanks for the input, I will investigate more about the ARCore/Playground patcher, in case it has any issues working on the latest Pie code. If you’re facing this issue, then I am sure it is something that others would be facing too.

      Ping me back tomorrow, just for a reminder, and I will look into it.

    • Gayanuka

      Oct 4, 2019

      Thank you sir

    • Dhananjay

      Oct 4, 2019

      Hi again. Please try the modified Playground app from here after you have installed the ARCore/Playground Patcher module and rebooted your phone.

    • Gayanuka

      Oct 4, 2019

      I downloaded the playgrounds app provided by you and I installed it with ARcore/Playground patcher and AR stickers worked on Gcam without crashing but this is not the issue.The AR model doesn’t stay in one place it just fly away and disappear.The issue is only with the ARcore app or the module is not supported to MI A2 rom.I tried different AR apps like Porche mission E,sketchfab etc..but it doesn’t work.I am not telling AR apps crashing.The apps launch fine but grids doesn’t show and the model doesn’t stay in one place and even the apps gets hard to detect the surface even I hold my MI A2 on a table or to the floor.What I think is the ARcore doesn’t support on this stock MI A2 rom,maybe flashing a custom rom like Havoc OS or Pixel Experience can get a success.I have seen Pixel experience rom gets used on many ARcore tutorials.They just edit the build.prop using a build prop editor and they add a file called calibration.xml on “/system/etc/” and they convert their phone into a Pixel XL.I found some magisk modules do the same process adding the calibration.xml and changing the device to Pixel XL and the magisk successfully changed my model to Pixel XL and added calibration.xml on the same path I mentioned before.I still used the stock rom so I still got the same issue like before.I don’t know the reason why this won’t work on Mi A2 even magisk modules enabled.Tell me whether if you have a Mi A2 did “ARcore/playgrounds patcher” work for you? tell me about yours.I don’t know these modules won’t work for me.I thought to flash twrp and install Pixel experience on Mi A2.I still didn’t tried it but my mind is forcing me to do it.If I want to restore my device I’ll flash stock rom and stock recovery.The Google ARcore is just like a pain in my Ass so I’ll try my best to get success.Thank you for your support sir.

    • Dhananjay

      Oct 5, 2019

      Well, I don’t have my Mi A2 anymore. Just my sibling’s Mi A1 and the Mi A3 that I bought recently. The tricks that I mentioned above works just fine on the Mi A1 which is rooted with Magisk and is still on stock ROM. No issues like you have mentioned.

      On the other hand, the Mi A3 completely supports ARCore, so I have no troubles there as well.

      I think trying with a custom ROM would be a good idea. Or, restore the stock firmware completely and start afresh with my trick.

      BTW before that, use Termux and execute this command: setprop persist.camera.eis.enabled 1

      Then reboot your phone and try the same AR setup again as I mentioned. See if it helps.

    • Gayanuka

      Oct 6, 2019

      I tried but didn’t work I ‘ll try installing custom rom thank you sir.

    • Dhananjay

      Oct 7, 2019

      Sure. Let me know how it goes.

  105. Kwanthay

    Oct 1, 2019

    My version is 10.0.14.0 PDIMIXM. Could you pls send image file for that version?

    Reply
    • Dhananjay

      Oct 1, 2019

      Hi. I have updated the download links, please check again.

    • kwanthay

      Oct 2, 2019

      Thank you very much!

    • Dhananjay

      Oct 2, 2019

      You’re welcome, Kwanthay!

  106. Pepe

    Sep 25, 2019

    Hola! Quisiera saber ahora que llega él nuevo android 10 que hay que hacer para no caer en un brink teniendo habilitado camera api con el método no root y bootloader desbloqueado.

    Un saludo

    Reply
    • Dhananjay

      Sep 25, 2019

      Hi Pepe. It depends upon Xiaomi. If they decide tho make camera2 API enabled by default in Android 10, then it would save a lot of hassle.

  107. Kalana Ashan

    Sep 19, 2019

    I have enable camera 2 api by following your methods. thanks for that. now the problem is when i try to update my phone on august patch it cannot be updated and show a message called “installation problem”. that is a one issue.

    Reply
    • Kalana Ashan

      Sep 19, 2019

      Also when I try to update after showing September security patch update result was same. now I cannot install security updates.

    • Dhananjay

      Sep 19, 2019

      Hi Kalana. That’s because the there were modifications found on the inactive slot. Did you root your phone (Permanently) using Magisk before August, or installed TWRP?

    • Kalana Ashan

      Oct 3, 2019

      No. I just followed your instructions on how to imstall gcam using custom boot img. I only did as you have explained in the tutorial.

    • Dhananjay

      Oct 4, 2019

      Hi Kalana, did you follow the same instructions before installing the September update?

  108. Les

    Sep 17, 2019

    Hi Dhanajay,
    First of all- Thank you much for this guide!! After some initial hang ups, I managed to get it Gcam installed, and it is working great. It really is crazy how good this software is for taking photos.
    I just have a quick question, as this the first time I have tweaked any part of the android system, I’m not entirely sure what I should expect in the future with the changes I made to the system. I followed you instructions all the way through and everything is good- phone is no longer rooted. But, my bootloader is still unlocked, and I was reading around and supposedly that’s enough to prevent OTA updates to the phone? Part of the reason I was psyched on this phone was because of the whole “Android One” thing, so I was still hoping to receive those updates, without having to jump through hoops. It’s not the end of the world, but it would be nice to continue to receive OTA updates.
    So, yeah- just curious if the unlocked bootloader prevents future updates.

    Thanks again, for this great guide, Dhananjay:D

    –Les

    Reply
  109. Akhil Singh

    Sep 14, 2019

    Hi i want to sell my mi a2 and now i want to lock the bootloader.
    Please explain how to lock bootloader …???

    Reply
    • Dhananjay

      Sep 14, 2019

      Hi Akhil. First, let me know if the phone is rooted or is running complete stock firmware?

  110. Manish

    Sep 7, 2019

    Hey Dhananjay! Thanks for the detailed guide. I know it’s a bit of a noob question but do you think that this method of yours may cause bootloop? Cause this is my new device and I don’t really want to mess it up but then I also want GCAM. So I just wanted to know if going wrong at any step may cause a potential bootloop or has anyone reported about their phone going into a bootloop? Thank you in advance! 🙂

    Reply
    • Dhananjay

      Sep 9, 2019

      Hi Manish. It wouldn’t unless you try to boot a patched boot image of a different software version.

      But I don’t want to leave to just that answer. If ever, you mistakenly face a bootloop issue while using this method, then you can easily recover your device by flashing the stock boot image. That’s the reason why I have provided download links to the official stock boot images as well.

      If you still have any doubts or get stuck anywhere, feel free to reach out to me by commenting here. I will always be there to help.

  111. Andre

    Sep 5, 2019

    Hi everyone who have had problems with termux su command.
    I got it also, after couple hours of digging internet and trying eventually. I solved it.
    If you tried it couple time so its meaning you have magisc and termux installed on your phone.
    So then follow instructions of Dhanajay. Just boot patched image one more time through fastboot, then go to!! termux and you will got grand permission prompt. Then put su in termux you will see result. I used last August 5 patched core and mi a2. If there’s no grand permission, then try it again to fastboot it. Good luck everyone. And a lot of thanks to author

    Reply
    • Dhananjay

      Sep 9, 2019

      Hi Andre. Thanks for digging into it and providing a possible solution.

  112. Udbhav

    Aug 31, 2019

    I entered “su” in termux. Got “Permission denied”.
    Then I tapped magisk manager in app drawer, it says “Upgrade to full Magisk Manager to finish the setup. Download and Install?”. I can’t get to settings of magisk manager like you said in the other comments here.
    I’m stuck. What do i do?
    P.s. I don’t want my phone permanently rooted.

    Reply
    • Paul

      Sep 25, 2019

      Yes, upgrade to full “Magisk Manager” only. You’ll be then asked about permissions on Termux, grant them and it’s done.

    • Dhananjay

      Sep 25, 2019

      Udbhav, Paul is right. When you boot with the patched image, only the Magisk Manager stub is installed. Once you open Magisk Manager and install it, it will then work properly.

      Thanks Paul for clearing out the air and also for taking the time to help others around the blog. Highly appreciated.

      I will update the instructions shortly.

  113. Kalana Ashan

    Aug 24, 2019

    I have enable camera 2 api by following your methods. thanks for that. now the problem is when i try to update my phone on august patch it cannot be updated and show a message called “installation problem”. that is a one issue. also there is an another issue. after enabled the feature i could not open my banking app. message was shown ” your device seems to be rooted”. Please help me….

    Reply
    • Kalana Ashan

      Aug 25, 2019

      after boot with stock boot img that banking app issue was corrected. but still i cannot install OTA updates

    • Dhananjay

      Oct 2, 2019

      It seems like the inactive slot has some sort of modification present. That’s why the update is failing to install.

  114. Ayni Koc

    Aug 21, 2019

    Hello, I want to Enable Camera2 API on Xiaomi Mi A2 with the 10.0.13.0.Version of Patched Boot Image but I need help by Step 9.
    I don’t know the name of the Command I should use.

    Reply
    • Dhananjay

      Oct 2, 2019

      Hi Ayni. You have to execute all the mentioned commands in the given order.

  115. MG

    Aug 19, 2019

    Hello

    I have enabled the Gcam in June and I was able to get the July security patch but I’m not able to download the August one. What do I do? I have tried repeating the whole process to see if I could do anything. I rebooted the phone after the process, so Magisk is uninstalled and the Gcam is working fine. Any tips to get the updates again?

    P.S. Magisk in uninstalled but still on my app drawer.

    Bye

    Reply
    • Dhananjay

      Oct 1, 2019

      Hi MG. During the June update, did you make any modifications via Magisk Module or Magisk Hide? Also, go the app drawer, launch Magisk Manager, and then let me know if it shows that Magisk is installed or not?

  116. MVG

    Aug 19, 2019

    Hello.

    I’m not sure if I’ve done anything wrong but I’m not able to install the August security patch. My phone says it’s updated with the July security patch. Is there a fix?
    I enabled Gcam in June, and I was able to download the July update. Why can’t I download the August one?

    P.S. The Gcam is fine and Magisk is still on my app drawer but when I open it, it says that it is uninstalled.

    Great tutorial btw

    Reply
  117. SACHIN

    Aug 17, 2019

    i’m waiting for V10.0.13.0 August boot image

    Reply
    • Dhananjay

      Aug 17, 2019

      Hi Sachin. The August patched boot for the Mi A2 is now up. I am still waiting to get my hands on the Mi A2 Lite boot image, once it is available.

    • Afzal

      Aug 24, 2019

      Hi Dhananjay. I’ve followed all of your steps successfully but the camera 2 api is not enabled yet. Can you tell me the reason. Also, do I need to flash stock boot image to get Ota updates?

    • Dhananjay

      Oct 2, 2019

      Hi Afzal. After following the complete procedure, rebooting your phone, did you try install a Google Camera port on it?

      Also, this method simply boots the patched boot (does not flash it), which means, after rebooting, root will be gone. And thus, no need to restore stock image unless you accidentally used the “fastboot flash boot” command instead of “fastboot boot”.

  118. tavismo

    Aug 16, 2019

    i’m waiting for V10.0.13.0 August boot images 🙂

    Reply
  119. ibnYusrat

    Aug 16, 2019

    Hi,

    It seems strange but my phone seems to be running 10.0.13.0 PDIMIXM.

    Is there any ETA on when its modified boot image will be uploaded?

    Reply
  120. Kalana Ashan

    Aug 11, 2019

    I cannot give super user permission for termux and also I cannot install magisk. when install magisk via magisk manager it was shown a message unsupported/unknown image format like that

    Reply
  121. JhonDC

    Aug 2, 2019

    Hi. Nice tutorial. Sorry for the question but for those who dont have temporary but definitive root and bootloader already unlocked, and after changing the prop lines, how to continue receiving ota updates? I need to unroot my device too?

    Reply
    • Dhananjay

      Aug 2, 2019

      Hi. Thanks for the appreciation.

      If you choose that method, then you will first need to undo the build.prop changes, and disable ‘n’ completely uninstall any Magisk Modules.

      The next step depends on how you have rooted your phone – (1) By flashing the zip via TWRP or (2) By flashing the patched boot image to the currently active slot?

      In the case of the first, you will need to make a complete uninstall via Magisk and then restore the stock boot image, just to be sure. Once that is done, installing the OTA wouldn’t be a problem.

      For the second case, you can simply follow the instructions here, provided directly by topjohnwu himself.

    • JhonDC

      Aug 2, 2019

      Thanks Dhananjay! I opted to completely uninstall Magisk and then use ur method to enable camera2 and leave my device unroot. It worked well. But now about new ota updates… before installing them i’ll have to change the values ​​by termux again to keep the system unchanged?

    • Dhananjay

      Aug 3, 2019

      Hi again. The benefit of using this method is that your phone is not rooted and thus installing the OTA wouldn’t require any extra effort.

      Although, once you have updated, you will need to re-do the procedure with the patched boot image of the new firmware version. Doesn’t take more than a few minutes once you get hold of the process.

    • Gorgo

      Sep 7, 2019

      hi. I did this method some time back, but the root remained after restarting. I didn’t solve it because I missed it. but now came the ota update and I can’t install it. in magisk manager I did exactly what other tutorials write. but I don’t know exactly how to undo the commands I put in Termux. thank you for all the advice

    • Dhananjay

      Sep 9, 2019

      Hi Gorgo. Could you please go to the app drawer and see if Magisk Manager is still there? If it is, then open it and let me know if it shows that Magisk is installed or not.

    • Gorgo

      Sep 12, 2019

      you asked if I had magisk manager installed. yes, I have. but at the same time I tried to uninstall it. I clicked on “restore images” as other tutorials say when I want to install ota while leaving magisk and root on the device. so I did, but ota update still couldn’t be installed. I also read that if there are any changes to the system, for example in Termux, I need undo all the changes. and that’s exactly the problem, I don’t know how, and I don’t know if it’s possible at all. my friend told me that a hard reset should solve it, what do you think? thanks a lot for your help.

    • Tushar

      Aug 12, 2019

      10.12 hyperlinks are exchanged. You may need to correct it

    • Dhananjay

      Aug 12, 2019

      Hi Tushar. Thanks for notifying.

      BTW, did you mean the mirror links for the Mi A2? If so, then those have been corrected.

    • Tushar K

      Aug 14, 2019

      Sorry for the short comment. Yes the hyperlinks for Mi A2 stock & patched images were interchanged. Its looks Ok now. I have folllowed your steps and happily using cam2api. Many Thanks.

      Is there any way to get rid of the black warning screen & ‘Unlocked’ label which appears during boot.

      Any luck with patched img for Pie August security update?

    • Dhananjay

      Aug 14, 2019

      Hi again Tushar. First off, I am happy that the instructions proved useful to you.

      As for the bootloader warning, you will need to cope with it. It just goes away in a few seconds, right? Not big of a problem I think. If you were ever about to sale your phone, you can simply relock the bootloader and the warning message will be gone.

      I am keeping an eye out for the August boot images. As soon as I have my hands on them, I will be updating this post.

  122. Guize

    Jul 30, 2019

    Thanks! After a little issue it worked.
    First time I tried and I got stuck in the 13 step, the Termux app was not showing the option to allow super user after type su and press enter. Then, I installed the Magisk Manager and the Termux app worked properly. Thanks guys for the comments.
    And Dhananjay, if you know a metod to remove that message of bootloader unlocked on the boot screen, please let us know. Thanks Again.

    Reply
    • Dhananjay

      Jul 31, 2019

      Hi Guize. Thanks for the confirmation. I will make sure to edit the steps and add what solution you offered, in case anyone else falls into the same situation.

      As for the message, I am afraid that can only be removed once you relock the bootloader. But if you do that, you will lose the Camera2 API values that you adjusted, and thus no GCam.

      I think the message won’t be a problem and simply goes away in a few seconds when you boot.

    • Paul

      Aug 23, 2019

      Exactly what happened to me.

      Got stuck at Step 13 because Termux wasn’t asking for root permission auth. Just needed to install Magisk Manager by clicking on its app icon (which shows up in your app list / drawer after flashing the patched boot.img) and that was it.

      Thanks for the tip.

  123. Alex

    Jul 25, 2019

    hey Dhananjay thanks for the work,

    somehow I just get to step 14. I type in the 4 commands into Termux and than nothing happens but also no error is showing so I Exit and reboot and when I check with the camera 2 api app just Level 3 is green the rest is still red, and when I install the Gcam app it obviously chrases, so it seems the 4 commands did not work. Do you know what could be the mistake I made?

    Thanks

    >Greetings

    Reply
    • Dhananjay

      Jul 25, 2019

      Hi Alex. Was Termux able to gain superuser permissions properly?

      Actually, that’s what is supposed to happen. The commands won’t give out anything as resultant, just the next line. If that was so then the commands were successful. And Level 3 of the API is what you need. If it is marked with the green tick, it means that the API was enabled successfully.

      Once you have enabled the API, reboot your phone. Then try a different version of the port:
      1) Arnova’s Advanced v1.7 or v2.2: Download Link
      2) Dise’s v1.6: Download Link

  124. Annas

    Jul 24, 2019

    Sir, Patched boot 10.0.10.0 mi A2 it’s not working properly.
    i’ve checked rootchecker and it’s said ” root acces is not properly installed on this devices”.
    can you help me ? thank you
    i’ve flashed with fastboot 2 times and still not working for me..
    help mee , thank you

    Reply
    • Dhananjay

      Jul 24, 2019

      Hi. Once booted with the Patched boot image, go to Magisk Manager, open the app’s menu and tap on ‘Superuser’. Grant the access to Termux and try again. See if this helps.

    • Annas

      Jul 25, 2019

      There’s no option ‘ supersu’ for me ?

    • Dhananjay

      Jul 25, 2019

      Hi again. Once boot with patched boot, launch Magisk Manager and tap on the menu icon (3 lines) on the top-right, you should see the ‘Superuser’ option there.

      If not, then go to the Magisk Manager settings, and let me know what the Update Channel is set to.

  125. Riski

    Jul 20, 2019

    Hallo sir,, i need patched_boot Juli v10.0.12.0
    Thanks

    Reply
    • Dhananjay

      Jul 20, 2019

      Hi. As soon as I get hands on the full OTA or fastboot image, I will be posting the download links for V10.0.12.0 boot images.

    • Masood

      Jul 28, 2019

      Can you make a video on this please for mi a2

  126. Hertons

    Jul 17, 2019

    Hi Dhananjay, with this procedure, when I reboot the phone, everything comes back normal? Don’t I lose my configuration, photos, videos, documents and apps?
    thank you

    Reply
    • Dhananjay

      Jul 18, 2019

      Hi. Yes, everything stays intact once you reboot. Although, note that when you unlock the bootloader, everything on the phone including the internal storage will be wiped completely.

      If you already have unlocked the bootloader, nothing will be wiped. However, I would still recommend taking a full backup beforehand, just in case anything goes sideways.

  127. Ayman

    Jul 16, 2019

    Yo Bro, Can you Give Me A Stable version of gcam working on mi a2 lite ?

    Reply
    • Dhananjay

      Oct 2, 2019

      Hi. The latest ones that are compatible with the Mi A2 Lite have been linked towards the end of the post. Please have a look.

      FYI, there’s no perfect GCam out there, you have to try a few before you can get one that works the best for you case.

  128. jubaer

    Jul 15, 2019

    sorry to inform you, but termux didn’t get the su permission.
    i’m have used june 2019 v10.0.10.0 patched img properely without any error but there wasn’t any prompt for asking su permission on termux.
    any solution?

    Reply
    • Dhananjay

      Oct 2, 2019

      Hi Jubaer. The instructions have been revised. Please follow them again and you will not face any issues regarding su permissions.

  129. Karan

    Jul 13, 2019

    Hi Dhananjay,
    I am entirely new to this process, so please bear with me.
    I have successfully unlocked the phone’s bootloader and also installed Magisk v19.3 version. I also downloaded the patched boot image and stock boot image for V10.0.10.0. for Mi A2.
    Now coming to the steps for enabling Camera2 API, I am not able to move beyond the command
    Fastboot boot patched_boot_10.0.10.0_mi_a2.img in Powershell window.
    It gives me the following error.

    downloading ‘boot.img’…
    FAILED (command write failed (unknown error))
    finished. total time : – 0.000s

    I will be grateful for your suggestions and guidance to help me move forward.
    Thanks in advance.
    Karan

    Reply
    • Dhananjay

      Oct 2, 2019

      Hi Karan. Welcome to the community! You will need to unlock your phone’s bootloader first before you could follow this procedure. Have you done that?

  130. Yuri

    Jul 6, 2019

    astboot : The term ‘fastboot’ is not recognized as the name of a cmdlet, function, script file, or operable program.
    Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
    At line:1 char:1
    + fastboot boot patched_boot_10.0.10.0_mi_a2_lite.img
    + ~~~~~~~~
    + CategoryInfo : ObjectNotFound: (fastboot:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

    how can i solved this im stuck at this

    Reply
    • Dhananjay

      Oct 2, 2019

      Hi Yuri. Try using “.\fastboot boot” instead of just “fastboot boot” in the command.

  131. Gabriel Peres de Oliveira

    Jun 21, 2019

    Good morning, after following the tutorial will I continue to receive updates via OTA? For the constant updates were the reason for the school for Mi A2.

    Reply
    • Gabriel Peres de Oliveira

      Jun 21, 2019

      Ops… For the constant updates were the reason for the choosing for Mi A2.

    • Dhananjay

      Oct 6, 2019

      Hi Gabriel. Yes, you will receive OTA updates normally. Through this method, we only temporarily root the device to execute the commands. Once the commands are successfully executed, you will need to reboot your phone to unroot.

      Once that is done, and an OTA arrives, you can install it manually.

  132. Tiago

    Jun 21, 2019

    Hi, I did the June update on my Mi2. I wonder if Magisk v19.2 is for this update or do I have to wait for a next version of Magisk? Thank you!

    Reply
  133. MG

    Jun 20, 2019

    It’s not working. I have a Mi A2 Lite with Android Pie on the May update and I’m struggling with versions 10.0.9.0 and 10.0.8.0 . It always says that the Magisk Manager is not installed and when I insert the code su on the Termux, it worked once. Then I would write the other lines of code from step 14 and rebooted. When the phone restarted, I went to the camera2 API Probe to find out it didn’t work. What do I do? I have tried a few times.

    Reply
    • Dhananjay

      Jun 20, 2019

      Hi MG. Did the commands execute properly without any problems? If yes, then download one of the GCam ports linked above, install it, and run it. See if Google Camera runs properly.

    • MG

      Jun 21, 2019

      I’m not sure if the Termux commands worked. When I wrote setprop and the rest of the code, it said that there is no code called setprop and recommended me to use getprop, so I did. Then I wrote the code with getprop instead of setprop and it ”answered” me by repeating the number at the end of each line of code.
      Now it’s saying ‘No su program on this device’. Why?
      P.S: When I was booting up after I used the code in Powershell my phone showed me an error page that I had to control with the phone’s buttons. What am I doing wrong?

    • Andrew

      Aug 17, 2019

      How did you solve this issue? setprop doesnt work for me

    • Dhananjay

      Oct 1, 2019

      Hi Andrew, I have re-written the instructions. Please follow them. The issue was probably caused because full Magisk Manager wasn’t installed, and thus it couldn’t grant superuser permissions.

    • MG

      Jun 21, 2019

      Nevermind, I got it!

    • Rahul

      Jun 23, 2019

      Hay June patchboot proper work or not??

    • Dhananjay

      Jun 23, 2019

      Hi Rahul. It does work.

    • Shamie

      Jul 26, 2019

      hi sir i tried downloading patch12.0.12 for daisy but it didnt boot in its os rather it died. i can still open it though

    • Dhananjay

      Jul 27, 2019

      Hi. Could you please let me know if you have the Mi A2 or the Mi A2 Lite?

    • Sandeep Murthy

      Jul 20, 2019

      Easiest way to enable camera2api could be installing build prop editor and then search for HAL3 and set the value from 0 to 1 for both the search results
      This is an easy way compared to Termux

    • Dhananjay

      Jul 20, 2019

      Hi Sandeep. Indeed, however, that will only work when the phone is rooted. The instructions here are for those who’d like to keep their phone unrooted.

      BTW, thanks for sharing your input. It’d be helpful for the rooted users who visit this page.

    • sandeep Murthy

      Jul 20, 2019

      Hello Sir,
      In fact i followed your tutorial and succeeded in enabling camera2api and installed Gcam and clicking away pics like a Pro.
      Thanx a million Bro for sharing this tutorials.
      But the hardest part of your tutorial is the Termux part.That why i used build prop editor method..
      Termux gives a hell a lot of errors ….its not impossible but definitely weird to follow.
      Otherwise your tutorial is on spot.
      Once again Thanks for sharing this piece of instructions for all android lovers..!

    • Goudian

      Jul 31, 2019

      Hello sir, is July patch boot image out?

    • Dhananjay

      Jul 31, 2019

      Hi. Yes, it is. Check out the Downloads section within the post.

  134. Edo

    Jun 20, 2019

    How about update OTA?

    Uninstall magisk? But i dont know which slot that when install magisk.

    Reply
    • Dhananjay

      Jun 20, 2019

      Hi Edo. If you used this method, then Magisk shouldn’t have been permanently installed. Can you see Magisk Manager in the phone’s app drawer?

    • Jean

      Jul 9, 2019

      To get root access in termux I had to open the magisk and it even asked to install the magisk apk. I did this and did not open the magisk and requested root access in termux and it worked, I rebooted and I was enabled Level_3. The magisk continued after rebooting the phone, but only continued because I installed apk magisk, I uninstalled the apk and magisk disappeared. I downloaded the root checker and it says that it does not have root. Is the device out of root or do I need to install stock_boot_10.0.10.0_mi_a2 by twrp to return to normal and receive Ota?

    • Dhananjay

      Oct 2, 2019

      Hi Jean. That’s correct. I have updated the guide too because of this.

      What happens is, when you boot your phone with Magisk-patched boot image, only the Magisk Manager stub is installed. You did it right.

      Now if you go to Magisk Manager, you will see that it shows that Magisk is not installed. Simply uninstall Magisk Manager app since you don’t need it now. There’s no need to install the stock boot unless you flashed the patched boot and not temporarily booted it (like mentioned).

      BTW, do you have TWRP installed?

  135. Nisar Mahmood

    Jun 15, 2019

    Hi do I have to keep my boot loader unlocked for the rest of the time? I successfully done all and it worked but when I locked my bootloader then camera 2 api is not working anymore

    Reply
    • Dhananjay

      Jun 15, 2019

      Hi Nisar. Yes, you will need to keep it unlocked. Locking the bootloader will revert the changes. Despite, keeping the bootloader unlocked will not prevent you from taking OTA updates. You will still be able to install OTA updates normally.

    • Konok

      Jun 21, 2019

      After download June update its not installing my on mi a2 its show error message installation failed. How solve the problem, my phone bootloader is unlocked.

    • Dhananjay

      Oct 6, 2019

      Hi Konak. Sorry for the delayed response. It’s quite hard for me to handle all the comments, but I still try to. Yours must have missed my attention.

      Now, are you still facing the issue or is it resolved?

  136. kareem mahaly

    Jun 15, 2019

    When I write “su” in “termux” program gives me a message “permission denied”

    Reply
    • Dhananjay

      Jun 15, 2019

      Hi Kareem. Once booted with Magisk, open Magisk Manager and go to its settings. In there, you will see the ‘Update Channel’. Let me know what’s selected in there?

  137. Edo

    Jun 14, 2019

    Hi i am new user mi a2.
    I try to following your guidr but when I use termux and type su, the message is permission denied.
    Have a solution?

    How to know the unlock bootloader and boot patched is success?

    Reply
    • Dhananjay

      Oct 6, 2019

      Hi Edo. I have revised the instructions and you will not face the permission denied error anymore.

      To know if the process succeeded, simply try and install one of the recommended GCam ports. If it opens up, then for sure the process worked.

  138. Rohan

    Jun 8, 2019

    it shows magisk is not installed …wat to do now

    Reply
    • Dhananjay

      Jun 8, 2019

      Hi Rohan. Please go to Magisk Manager > Settings and let me the “Update Channel” that’s set there.

  139. Falah

    Jun 4, 2019

    ALL DONE PERFECTLY!!! LOVE U BRO!
    my device Mi A2 10.0.9.0

    Reply
    • Dhananjay

      Jun 4, 2019

      Hi. I am glad it worked! Enjoy GCam now.

    • Sameer

      Jun 6, 2019

      hello i have done successfully with all working mod.. but i have questions will i get ota update ?? and can i use paytm phonePe Gpay etc with unlocked bootloader .. and one thing when i install termux and hit Su command nothing were happening then suddenly got popup to update magisk i click yes then it install magisk update then i again went to termux hit Su command then ask for permission to grant.. is there any issues ?? coz in ur post there is nothing like this ..

    • Dhananjay

      Jun 7, 2019

      Hi Sameer. Kindly go to the Magisk Manager and uninstall Magisk completely from there. Once done, also restore the stock boot image (corresponding to the software version currently installed on the phone).

      Once you have done this, let me know so that I can guide you further.

    • Say

      Jul 1, 2019

      What he meant was that you cannot enter the Magisk settings. When he launches it, you beeing promt to install magisk from a unsecure source.
      “No, thanks” doesnt let you enter settings.

      Also not sure if temux needs installation first or is the app from playstore all you need..

  140. Peraveen

    Jun 3, 2019

    Mi a2 pixel camera install how do….

    Reply
    • Dhananjay

      Jun 3, 2019

      Hi Peraveen. If you have already enabled Camera2 API via this method or any other, then you can simply download one of the provided GCam Port APKs and install it on your device.

    • MG

      Jun 20, 2019

      I went to Termux, inserted the code su and it told me permission denied. Then, I went on Magisk Manager like you told another person on the comment section. The menu ‘Update Channel’ has the options: Stable, Beta and Personalized. Which should I pick and what do I do next?

  141. Enrico

    May 31, 2019

    Hi Dhananjay, thanks for this guide…
    I’ve a problem; after having succesfully done all the steps and verified with Camera2 API Probe apk
    the correct enabling of Camera2 API for my Mi A2 Lite, when I open the Gcam (I tried more then one version), after asking permissions at first installation, it crashes every time and never starts.
    What could be the root cause?

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi Enrico. There’s no stable Google Camera port for every device that supports all Android version. For eg. a GCam port might work on Android Oreo, but not on Pie, or vice-versa.

      Let me know which port did you try and install on your device?

  142. Thanos

    May 30, 2019

    Hello, thanks for the tutorial. I rooted my Mi A2 using your guide! It all went down well. Next i wanted to unlock the Camera 2 API on my Mi A2 as well but however i do it i can’t get it to work. I searched for guides and you only have for the non-rooted version unfortunately.

    What i actually did was to edit my build.prop and check that it was ok but it wasn’t. After that i installed a magisk module (C2API+GcamSlomo enabler v1500) and tried again, but once again i couldn’t get it to work. What can i do?

    My phone is rooted, bootloader unlocked, TWRP inside.

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. If you have root, you can simply install Termux, execute the commands given above, and then reboot your phone. You should then have Camera2 API enabled on your phone.

  143. leo

    May 26, 2019

    hey buddy, awesome guide really appreciate it. noob question here: is it safe to do a factory reset and keep the gcam? mi a2 running V10.0.8.0.PDIMIXM bootloader still unlocked. i also noticed the oem unlock toggle dissapeared from dev opt?

    Reply
  144. Afsal

    May 25, 2019

    Hi, I am using MI a2 with latest security update may 2019 and things went good until the bootloader unlock.
    But thereafter while tried to boot using temporary boot, phone getting rebooted and while installed Termux, and creating super user by SU comment, it shows “no su program found”. Can you help me out on this?

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. Once you have booted the phone with the patched boot image, go to Magisk Manager > Settings and set the update channel to Beta. Then close and re-open Magisk, you should then have root access in Termux.

      Note that this is only for the V10.0.8.0 image. From v10.0.9.0, ensure that the update channel is selected as “Stable” in Magisk Manager settings.

  145. Yashoda

    May 24, 2019

    Hi,

    I cannot download the latest patched_boot_10.0.9.0_mi_a2 .img. I tried the same even from XDA, but still failed. Can you please check whether the given link is working.

    Reply
    • Yashoda

      May 24, 2019

      Hi,

      I downloaded the above patch image from XDA. But when I enter su on Termux, it says denied. When I open the Magisk, it is asking whether to download and install the full Magisk manager to finish the setup. What should I do now? Please help

    • Dhananjay

      May 24, 2019

      Hi. Are you sure that you booted the patched boot image via fastboot?

  146. Jaime Andrés Rueda Gómez

    May 24, 2019

    Hi
    thanks for the tutorial
    I followed all the steps and everything seems to work, never got an error but I have a question:
    If I do a factory reset of the phone will the camera2 api turn unable again? or can I resest with confidence?

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi Jaime. I am not sure that I have the confirmed answer to that. A factory reset should normally format the partitions and should not replace or change any system files. So, theoretically, the Camera2 API should still be enabled.

  147. Rudra

    May 22, 2019

    If I follow the given procedures l, then will I loose my data?

    Reply
    • Dhananjay

      Jun 11, 2019

      You will only lose data once when you unlock the bootloader. If you already have the phone’s bootloader unlocked, nothing will be erased.

  148. Akhil Singh

    May 21, 2019

    Hey I enabled cam2api on my mia2 using your temporary root method….now Today I received a notification of may security update on my mia2.
    So my question is … whether after updating to may security update the gcam will work or not???

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. After installing the OTA, you will need to repeat the procedure with the May Patched Boot Image.

  149. Ammar Zakwan

    May 19, 2019

    Hi. After i’m unlocking the bootloader and installing Gcam, My phone become uncertified in a Playstore. I try relocked my bootloader to see if it can make my device certified back but unfortunately my Camera2 api become legacy after i’m relocked my bootloader. Do you know how to make my device certified and can use G cam at the same time ? Thanks in advance .

    Reply
  150. Lucas Helal

    May 17, 2019

    Hi Dhananjay,

    Nice tutorial!!

    I’ve a MI 6, and after android pie my camera 2 api level 3 was disable.

    So I’m trying enable with the follows commands:

    setprop persist.camera.HAL3.enabled 1
    setprop persist.camera.eis.enable 1
    setprop persist.camera.is_mode 4
    setprop persist.camera.stats.test 5
    setprop persist.vendor.camera.HAL3.enabled 1
    setprop persist.vendor.camera.eis.enable 1
    setprop persist.vendor.camera.is_mode 4
    setprop persist.vendor.camera.stats.test 5
    setprop persist.sys.qcom-brightness 4095

    I’m using twrp to boot..

    If u can give same tip 🙂

    thanks

    Reply
    • Dhananjay

      May 18, 2019

      Hi Lucas, have you rooted your Mi 6 via Magisk as well? Or is it just TWRP that you have installed on the device?

  151. Ammar Zakwan

    May 15, 2019

    Hi. Sorry for this noob question. Do my data will be wiped out if i’m using those steps to enable camera API ?

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi Ammar. Your data will only be wiped when you unlock the bootloader. If you have already unlocked the bootloader, nothing on the device will be wiped.

  152. Rajdeb

    May 11, 2019

    Hello from Bangalore. thanks a ton for drafting such an easy way to enable camera 2 api and finding working google camera port.

    I am on mi a2 V10.0.8.0.PDIMIXM .
    followed your steps and I am able to use camera 2 api enabled google camera port.
    Its doing little magic with night sight n portrait n hrd + surely though the resolution is compromised.

    I was trying to lock the bootloader ( dont like the stupid warning boot message). I tried to skip ‘wiping phone data in fastboot while locking bootloader by pressing the volume down and then fastboot reboot.

    It didn’t help..

    Please let us know how to lock the bootloader with out wiping phone data and the working google cam port from phone .

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. The button trick is very messy and lately, users have reported that it doesn’t work. So, I don’t think there’s a way to re-lock the bootloader without wiping.

  153. hafiz

    May 11, 2019

    i have done all your step and install magisk in *temporary root boot*. But when i reboot after termux thing…I lost all of my data…i thought its only *temporary* how can i get back my stock data

    Reply
    • Dhananjay

      Jun 11, 2019

      That’s quite odd. There’s nothing with Termux or root that will format the data. The data is only erased once when you unlock the bootloader.

  154. lucho

    May 9, 2019

    Hi, I have the same problem. The cellphone doensn’t load the patched imaged. It restarts to the normal image and it doesn’t allow super user. I have Magisk Manager up to date v7.1.2. When I open the app it says at first Magisk is not installed.

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. Once you have booted the phone with the patched boot image, go to Magisk Manager > Settings and set the update channel to Beta. Then close and re-open Magisk, you should then have root access in Termux.

      Note that this is only for the V10.0.8.0 image. From v10.0.9.0, ensure that the update channel is selected as “Stable” in Magisk Manager settings.

  155. Iacopo

    May 8, 2019

    Hi, thanks for this tutorial. I’m following all steps until Termux. Once i write su it takes a while to respond and when it does, it tells me “permission denied”.
    I’m triyng to install the latest version (patched_boot_10.0.8.0_mi_a2_lite.img) and magisk is correctly present in app drawer. Thanks in advance

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. Once you have booted the phone with the patched boot image, go to Magisk Manager > Settings and set the update channel to Beta. Then close and re-open Magisk, you should then have root access in Termux.

      Note that this is only for the V10.0.8.0 image. From v10.0.9.0, ensure that the update channel is selected as “Stable” in Magisk Manager settings.

  156. Jon KZB

    May 6, 2019

    Hello friend the tutorial worked flawlessly straight!
    A big question: can I re-lock the bootloader without lose the GCam funcionality?
    Specifically, some apps (aka Niantic’s games) are not working after detecting the unlocked bootloader =/

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. Thanks for the kind words.

      I think you will not lose the functionality after re-locking the bootloader.

  157. Stilian

    May 5, 2019

    Hello,
    Very good tutorial but will I still receive OTA updates after the process?
    I unlocked the bootloader and after that tried to enable API with twrp 3.3.0-0 several times but nothing happened..
    I tried this method too, but I didn’t enable API again. It says: Booting – FAILED (remote ‘dtb not found’). What am I doing wrong?
    BTW I am using mi a2 lite.

    Reply
    • Dhananjay

      Jun 11, 2019

      Hi. Please make sure that you download and use the latest version of Android SDK platform-tools.

  158. Vojtech

    May 4, 2019

    thanks for the tutorial, totallz worked for me, i just have one more question. can i relock the bootloader after i did all this process and installed the gcam? will it still work?
    thanks again man

    Reply
    • Dhananjay

      May 5, 2019

      Hi. Yes, you can. But keeping the bootloader unlocked is more convenient. So if any further monthly software update overwrites the Camera2 API commands, you can easily re-apply the procedure.

  159. Newton Mbugua

    May 3, 2019

    Hi, I tried following the steps as mentioned until i get to termux. Once i write su it takes a while to respond and when it does, it tells me permission denied. What could be the problem and how can i solve it? I really need this camera2 api enabled. Thanks and good work on the article.

    Reply
    • Newton Mbugua

      May 3, 2019

      Forgot to mention, i am using the Mi A2 with the April Update V10.0.8.0.PDLMIXM

    • Dhananjay

      May 3, 2019

      Hi. Can you please go to the app drawer and see if the Magisk Manager app is present there?

      If not, then after booting your phone with the patched boot image (Step #8), download the latest Magisk Manager APK and install it on your phone.

    • Binod

      May 9, 2019

      Hey! Stuck in the same step as the guy above. But once I type su in the termux app, it says “No su program found on this device. Termux does not supply tools for rooting.” I even installed the latest Magisk Manager but didn’t help… (mi a2, April 2015 update)

    • Dhananjay

      Jun 11, 2019

      Hi Binod. Once you have booted your phone with the patched boot image, please go to Magisk Manager > Settings and let me know what is selected as the “Update Channel”?

    • lorez

      May 11, 2019

      I’m having the same problem. Magisk Manager is present in the app drawer but I get permission denied when I execute “su” from Termux. Mi A2 with April patch.

    • Dhananjay

      Jun 11, 2019

      Hi. Once you have booted the phone with the patched boot image, go to Magisk Manager > Settings and set the update channel to Beta. Then close and re-open Magisk, you should then have root access in Termux.

      Note that this is only for the V10.0.8.0 image. From v10.0.9.0, ensure that the update channel is selected as “Stable” in Magisk Manager settings.

    • Beni

      May 14, 2019

      I have same problem, the magisk manager still on there. But when I type su on termux, grant superuser permission is not prompted, and then it tells me permission denied

    • Dhananjay

      May 14, 2019

      Hi Beni. Please open Magisk Manager and confirm that it shows that Magisk is installed (V19.0).

    • Ryan

      May 17, 2019

      same problem.
      unsupported/unknown image format
      installation failed
      when installing Magisk, downloaded the latest .apk and version v19

    • Dhananjay

      May 18, 2019

      Hi Ryan. Did you tap on the ‘Install’ button in Magisk Manager?

    • Ryan

      May 18, 2019

      Hi Dhananjay,
      I figured it out. I installed Magisk in advance before the starting these steps 😀 what worked for me is, after step 10 I installed Magisk before Termux. It’s all working now.
      One thing I noticed, after reboot is Magisk did not uninstall automatically. Not a problem really as all of my Apps are working except Netflix. Is it because I’m still rooted? How can I un-root it?
      Thanks, mate. This tutorial really helped me a lot.

    • Dhananjay

      May 18, 2019

      Thanks for the confirmation and also for the kind words.

      When you mentioned that you “installed Magisk”, did you mean that you installed the Magisk Manager app or used the “Install” button to install Magisk itself?

    • Ryan

      May 19, 2019

      I mean the Magisk Manager app. I should install it first, then Magisk itself before installing Termux.

      can’t seem to get Netflix and Fox+ app working. So, I re-lock my A2. Problem was it re-formatted again and Camera2API was disabled upon boot-up. I there’s a way to re-lock it without reformatting?

    • Dhananjay

      May 19, 2019

      Hi. Thanks for clarifying. When you boot the patched boot image, Magisk is already installed, and your phone is rooted temporarily, until the next reboot.

      So, if you go to Magisk Manager and use the ‘Install’ button, you would just be rooting your phone permanently.

      Do one thing, download the stock boot image of the software version that you have installed on your phone, and flash it using fastboot.

      The command you need to use is: fastboot flash boot stock-boot-filename.img

      Once you have restored, check if you can use Netflix again.

      Now, for your bootloader re-locking question. As far as I have seen, when you issue the command to re-lock the bootloader and select the confirmation message on the device, instantly press and hold the Volume Down button. This will force the phone to reboot back into the bootloader and prevent the data wipe.

      Although I have seen this trick work initially, users recently reported that it is quite dodgy now. So, I couldn’t confirm anything.

    • Yashraj

      May 21, 2019

      I have version 10.0.9.0.PDIMIXM
      Can you the patched boot image for this version

    • Dhananjay

      Jun 11, 2019

      Hi. It’s up for download now.

  160. Arhyel Shani

    May 2, 2019

    please when will patched boot image for 10.0.8 mi a2 lite be available

    Reply
    • Dhananjay

      May 2, 2019

      Hi. It’s now available and patched using the recently released stable Magisk 19.1.

  161. Ethan

    May 2, 2019

    It seems mine gets stuck on booting every time I issue the command on my PC. I’m using the A2 Lite. Is there any chance it’s because of my build? Seems to have been updated to 0.8.0. Any chance we’re getting the respective updated patched build? Thanks in advance

    Reply
    • Dhananjay

      May 2, 2019

      Hi Ethan. It’s now available, please take a look at the Downloads section again.

  162. itsmeMarioooo

    May 1, 2019

    Hi !
    In case I dont like the pixel gcamera and I want the undo all the changes I made, how can I flash the stock ROM and lock the bootloader.
    Maybe if you are kind enought, you can make a tutorial or a post here in comments, how can we revert all the changes we had made, like flashing the stock ROM and locking back the bootloader.

    I would kindly appreciate.
    Thanks !

    Reply
    • Dhananjay

      May 3, 2019

      Hi. When you use this method, you only temporarily root the device. Which means, after executing the command when you reboot your phone, root is automatically gone and your device is still running the stock boot image.

      So, even after performing this procedure, your device is completely stock, but just with an unlocked bootloader. To lock it back, reboot your phone into the Fastboot Mode, connect it to the PC, and run the “fastboot oem lock” command in the PowerShell/CMD window on the PC.

      That’s it. Your phone’s bootloader will then be locked again.

    • Lovre

      May 5, 2019

      After restarting my phone I still have Magisk app on it.Does that means that my phone is still rooted or? And can I delete Magisk and Termux now and just leave it be or do I have to flash stock image on it.
      Btw thanks for everything !!! 🙂
      This is the only version that doesn’t crash for me MGC_6.1.021_MI8_V2e.apk
      but I have some kind of scripts/commands on screen (just above the “take photo” button)

    • Dhananjay

      May 6, 2019

      Yes, you can safely delete both of them. If you only booted the patched boot image and didn’t flash it, then your phone will be unrooted automatically upon reboot.

      You’re welcome! And as for the GCam version, you can give a try to some different ones from here and see which works the best for you.

    • itsmeMarioooo

      May 6, 2019

      I asked it, because after I did what you said in your tutorial I lost my Google Play Certificate, and I wondered if I flash the stock imagine and lock the bootloader back maybe I can get my certification back.

    • Dhananjay

      May 6, 2019

      Okay. In that case, simply flash the stock boot image via Fastboot and re-lock the bootloader, and verify if the device gets certified again.

  163. Abir

    May 1, 2019

    After completion of all procedures will termux continue to have root priviledges after reboot?

    Reply
    • Dhananjay

      May 3, 2019

      Hi Abir. I have re-uploaded the new patched boot images for both the devices. Please download it again and try with that.

  164. Shashank Tulsian

    May 1, 2019

    Hey bro, I followed every step as mentioned above. But didn’t make nay progress whatsoever. I don’t know what is wrong. When I enter the command fastboot boot patched boot.img , it boots into the os and then I wait for about 10 minutes, but I don’t see magisk module anywhere. Then I go in termux and wait for it to start, after about 5 seconds when I write su, it outright says denied. And that too persistently! I tried it for about half an hour. My Mi A2 has a jdi screen so I cannot install twrp recovery, neither does my phone lets me install PBRP. And trust me, I tried. For 48hours, 72 hours. I was hell bent on rooting but couldn’t get anywhere. Can you please help me here man? This is my last resort. And if you can help in any way in installing custom recovery and all on my device, then that would be deeply appreciated brother. And not forgetting the existing issue, termux says denied! Where to now after this?

    Reply
    • Dhananjay

      May 3, 2019

      Hi Shashank. Please retry with the new patched boot images that I have uploaded and let me know what progress you have.

    • Rifat

      May 21, 2019

      I am facing same problem, termux command sure getting denied. I used the patched boot uploaded here. What should I do now?

    • Dhananjay

      Jun 11, 2019

      Hi. Once you have booted the phone with the patched boot image, go to Magisk Manager > Settings and set the update channel to Beta. Then close and re-open Magisk, you should then have root access in Termux.

      Note that this is only for the V10.0.8.0 image or below. From v10.0.9.0, ensure that the update channel is selected as “Stable” in Magisk Manager settings.

  165. Abir

    May 1, 2019

    Hi Dhananjay, I will be trying this method. I have knowledge about bootloaders in pc, but not in a phone. This is the first time I am going to try such a process. I am going to do the following after temporary root:

    Install termux and do the usual, install link2sd and es file explorer and grant them su before rebooting (unrooting).

    My questions are:
    1. Is it safe to relock the bootloader after the procedure? Is “fastboot oem lock” the correct command for that?
    (I read a post where a guy bricked his phone by relocking the bootloader and disabling “oem unlocking” options in developer options. The same settings are there in MI A2 jasmine sprout)

    2. And, since I am not flashing anything permanently (except installing 3 system apps), nor changing the stock bootloader or leaving my bootloader unlocked, will my warranty be still present?

    Reply
    • Dhananjay

      May 3, 2019

      Hi Abir.

      Don’t do that! The apps you mentioned require root permission every time they launch and mount the /system partition. So, when the person (That you are telling me about) did this and rebooted his phone, the security feature (dm-verity) detected the modified partition and thus the phone was bricked. It’s easy to get away with this and restore the stock system.img to revive the device back.

      However, with a locked bootloader, there’s no way to recover it. Make sure that you keep the ‘OEM Unlocking’ toggle enabled at all times if you’re even going to try this for your satisfaction.

      The warranty stays intact only if the system has not been modified at all (Not even a single app) and the bootloader is locked.

      Hope this answers your queries. If you have any questions, feel free to ask them to me by commenting here.

    • Abir

      May 24, 2019

      Hi, I couldn’t wait so I have already gone ahead and done that. As I understand, build.prop is also a part of system partition (I may be wrong here). So since I am modifying that for gcam, I have left my bootloader unloacked and oem unlocking is anyway showing allowed and grayed since the bootloader is already unlocked. The results are:
      a. As a daily driver, no issues at all.
      b. On rebooting, the “unlocked bootloader” warning message flashes for 5 seconds annoyingly.
      c. System is not upgrading to May security patch, it downloads the 100mb file and then shows error

      My quesiton is:
      If I am flashing the corresponding stock rom, will it erase the user apps? (Do I have to again start from scratch? :'( )

      Oh and PS: The apps who I gave root access, no longer have root access on rebooting, nor are they system apps (not installed in system partition). That’s it, they function as normal user apps.

    • Dhananjay

      May 24, 2019

      Hi. That’s correct, editing build prop is basically modifying the system partition. Did you edit the file manually or did you use the commands above?

      This method basically roots your device temporarily by booting the patched boot image and the root is completely removed when you reboot the phone, hence none of the root apps will operate.

      Do you want to root your phone or just want to enable the API?

    • Abir

      May 27, 2019

      Hi, I followed your instructions, but I also modified the file using ES file explorer to whitelist gcam in the vendor.camera.aux.packagelist, so that in future if gcam supportes dual rear cameras, I don’t need to go through this process again.
      I also hoped to use fake gps go app as a system app (running from system partition without root) for pokemon go (using temporarily elevated link2sd app), but this failed for me. The app was not at all present on reboot.

      Somehow things must have gone wrong somewhere due to which I am unable to update to May security and I am looking forward to flash everything to stock following this:
      https://forum.xda-developers.com/mi-a2/how-to/ota-v9-6-5-0-odimife-t3823445 for V10.0.8.0.PDIMIXM. I am hesitating a bit because the boot.img (bootloader) filesize does not match the one you provided.

      As an alternate this is my question:
      What if I try to change the active partition from a to b or b to a, whatever was the one before the V10.0.8.0.PDIMIXM OTA and then try to go for OTA, which should overwrite the partition which I so recklessly modified?
      (user data has a single partition and most probably it won’t get erased just like in OTA updates)

    • Abir

      May 27, 2019

      Oh I forgot. No I don’t want to root my phone since Pokemon Go won’t run then 😛 And also there is a risk of getting banned from Uber, Ola, etc. This is my lifeline device, not for experimenting 😛 😀 (I don’t want to go through the hassle of hiding root and its uncertainties)
      I just like to extract the most from what I have without harming the device (I won’t do stuff like overclocking) and so wanted to use GCam. The pictures from GCam are much nearer to real than stock cam, although the front camera pics are “too good to be true” 😛 after hdr processing. Your tutorial was highly helpful.

    • Abir

      May 27, 2019

      Plz ignore my question. I went for the partition change. The device got stuck at bootloop. After waiting 10 mins, I gave up, opened fastboot, changed the active partition again to the working one and booted normally. (At one point fastboot wasn’t coming up, which gave me a mini a heart attack. I won’t be doing any experiment now, **** may update, and I won’t disturb you again 😛 😀 )

  166. Jhonattan

    May 1, 2019

    Great tuto, thanks from Colombia!!

    There’s only one thing that disturbs me. The only camera lens that is allowed for the rear camera of the A2 is the 12MP? I can’t see a configuration that allows me to use the 20MP rear camera of my A2.

    Thank you

    Reply
    • Dhananjay

      May 3, 2019

      Hi Jhonattan, thank you so much for the kind words.

      Each GCam build has its own limitations, the only way to get past is to use a different port. I do keep a tab on recent supported GCam versions, but I am afraid I can’t try them all. In case you find a better GCam port from here, do let us know since it will help other readers as well.

  167. Lovre

    May 1, 2019

    Well,I did everything as written and after flashing patched_boot_10.0.7.0_mi_a2_lite.img my phone was stuck at booting…Never booted up so I had to turn him off.
    I’v tried to repeat this whole process twice with same results (stuck at boot) so I decided to quit.
    🙁

    Reply
    • Dhananjay

      May 3, 2019

      Hi. By any chance, are you using the V10.0.7.0 patched boot on your Mi A2 Lite running V10.0.8.0? In that case, your phone will bootloop. I have recently added the Patched Boot for V10.0.8.0, please download and use that.

    • Lovre

      May 5, 2019

      Yup,realized later that was the exact problem.I’m going to try again with newest version.

  168. DEEPAK

    Apr 27, 2019

    I HAVE ROOTED MY PHONE AS YOU MENTIONED BEFORE PROCEEDING THIS PROCESS. AS I RUN CMD COMMAND FASTBOOT BOOT PATCHED_BOOT_V10.0.8.0_MI_A2.IMG AFTER CONNECTING MY PHONE IN FASTBOOT, THE FOLLOWING ERROR IS SHOWING
    FASTBOOT.EXE- SYSTEMERROR
    THE PROGRAM CAN NOT START BECAUSE API-MS-WIN-CRT-LOCALE-II-I-0 IS MISSING FROM YOUR COMPUTER. TRY REINSTALLING THE PROGRAM TO FIX THIS PROBLEM

    Reply
    • Dhananjay

      Apr 27, 2019

      Hi Deepak. That’s quite an unusual errror. When I tried searching for it, It seems like a virus on the PC.

    • Deepak

      Apr 27, 2019

      I also did some research about that and found that DLL registry is missing on my pc. Will install that registry and repeat the process and let you know what will happen.

    • Deepak

      Apr 27, 2019

      now i have overcome the above mentioned issue and successfully boot the patched boot file. and install termux in my but here come the another issue when i command su it say permission denied. what should i do….?
      do i need to install twrp recovery prior to this procedure?

    • Dhananjay

      Apr 27, 2019

      Hi Deepak. No, there’s not need for TWRP. Once you have booted with the patched boot image, go to the app drawer and check if Magisk Manager is visible to you. Note that after rebooting, Magisk Manager could take about a minute to appear in the app drawer, in some cases.

      One more thing, you used the patched V10.0.8.0 boot image for Mi A2 and NOT Mi A2 Lite, right?

  169. Jonas

    Apr 25, 2019

    This Patched Boot V10.0.8.0.PDLMIXM for Mi A2 works in my version V10.0.8.0.PDiMIXM?

    Reply
    • Dhananjay

      Apr 25, 2019

      Hi Jonas. It was typo on my part. I have corrected the name now. It was actually PDIMIXM and not PDLMIXM. You can use it.

  170. demonvack

    Apr 24, 2019

    After enabling camera 2 api, I decided to delete Magisk Magisk and now my cell phone turns on the message “no command” I decided to load again the boot image that you left in the description and in effect starts the device but when restarting it appears again “no command” message, now how can I solve it?

    *sorry my english is not well :c

    Reply
    • Dhananjay

      Apr 25, 2019

      Hi. Magisk will automatically be removed completely when you reboot your phone. There was no need to uninstall it from the app, in case you did that.

      Tell me which device are you using, the Mi A2 or the Mi A2 Lite? Also, which software build is installed on it (Like V10.0.7.0, V10.0.8.0, V10.0.6.0, etc)?

  171. Gustavo

    Apr 24, 2019

    i can not start with the patched boot image, I don’t know what i have do to fix it

    C:\platform-tools>fastboot boot patched_boot_10.0.8.0_mi_a2.img
    Sending ‘boot.img’ (29901 KB) OKAY [ 0.643s]
    Booting FAILED (remote: ‘Flashing is not allowed in Lock State’)
    fastboot: error: Command failed

    Reply
    • Dhananjay

      Apr 25, 2019

      Hi Gustavo. You must first unlock the phone’s bootloader in order to use this method. It was an error on my part to not mention it.

  172. goody

    Apr 23, 2019

    hello sir, can i seek for help. why does my power shell says fastboot not recognized? big thanks

    Reply
    • Dhananjay

      Apr 25, 2019

      Hi goody. You must first download and install Android platform-tools on the PC. The platform-tools include fastboot, adb, etc. You can follow our tutorial here.

    • Ken C.

      Jun 10, 2019

      Hi! Thanks for the guide. If I re-lock the bootloader, will it reformat the device and reset the Camera2 API? If it does, is there a way to prevent the reformat from happening? Thanks.

    • Dhananjay

      Jun 11, 2019

      Hi Ken. Although there’s a button trick to prevent the format when unlocking or re-locking the bootloader, recently users have reported that it doesn’t work anymore.\

      Also know that if you re-lock the bootloader, the camera2 API will be reverted to legacy again.

  173. Prasenjit Deb

    Apr 20, 2019

    Hello, today I have already updated my MI A2 to April Security Patch ,
    so will the patched Boot Image of V10.0.7.0.PDLMIXM, work with my Build No. Version V10.0.8.0 PDIMIXM,
    for enabling Camera 2 API.
    Please Response.
    Thanks.

    Reply
    • Dhananjay

      Apr 23, 2019

      Hi Prasenjit. Nope, always make sure to use the patched boot of the version installed on your phone. I have just updated the post with V10.0.8.0 patched boot image, kindly use that.

  174. Tom

    Apr 20, 2019

    Hi Dhananjay, I have a Mi A2 Lite. I installed the sdk platform, made the connection with the pc, typted adb devices and it said that one device was connected. Then I went to the instructions:

    5. Power off your Xiaomi Mi A2/A2 Lite completely : done
    6. Now hold the Volume Down and Power buttons together to enter Fastboot Mode
    Boot into Fastboot Mode : done ( I’m seeing the logo as in the picture in the instructions)
    7. Connect your phone to the PC using the USB cable: I’m plugging in back the cable, but it doesn’t make a connection. When I type adb devices, I’m not getting a device attached.

    any ideas? I’m working on a windows 10 PC

    kind regards, Tom

    Reply
    • Tom

      Apr 21, 2019

      I got a little further, I did a adb reboot bootloader and then it connected. I then did the fastboot boot patched……img and it said:
      PS C:\adb> fastboot boot patched_boot_10.0.7.0_mi_a2_lite.img
      downloading ‘boot.img’…
      OKAY [ 0.736s]
      booting…
      OKAY [ 0.605s]
      finished. total time: 1.346s

      after that it restarted , but i lost everything, he installed completly from zero ( don’t know if this is normal or not?) I installed termux , and when i enter su it says: no such program found on this device. Termix does not supply tools for rooting….. what next? 🙂 kind regards, Tom

    • Dhananjay

      Apr 23, 2019

      Hi Tom. Reboot your phone once. Then reboot it back into Fastboot and follow the procedure from start. Right after you enter the ‘fastboot boot’ command, your phone will boot temporarily with root. Go to the app drawer and check if Magisk Manager is present there or not (It might take a minute or two for it to appear in the app drawer).

    • Tom

      Apr 27, 2019

      Hi,

      I rebooted my phone, rebooted back in fastboot and followed the procedure from start.
      PS C:\adb> fastboot boot patched_boot_10.0.7.0_mi_a2_lite.img
      downloading ‘boot.img’…
      OKAY [ 0.771s]
      booting…
      OKAY [ 0.609s]
      finished. total time: 1.385s
      PS C:\adb>
      my phone rebooted and when I check it doesn’t have magisk manager . Not even after 10min-20min.

      I don’t know what I’m doing wrong 🙁

  175. Luis

    Apr 20, 2019

    Hello, I wonder if by using this method will it void my device’s warranty? I thank you in advance!

    Reply
    • Dhananjay

      Apr 23, 2019

      Hi Luis. When you unlock the bootloader and root your phone, your phone’s warranty is gone. But the best part about using an Android One device like Mi A2/A2 Lite is that you can always restore stock and re-lock the bootloader, in case of any warranty issues.

  176. Ankit nirwan

    Apr 19, 2019

    Hi
    A big thanks to mr. Dhananjay
    Yesterday i did it with this process, google camera working fine
    I also find some other gcam port which is specific for MI A2
    Slow motion feature also working in it

    https://f.celsoazevedo.com/file/gcamera/MGC_ver.6.1.021_Dise_v5.1.apk

    And today i got April security patch update 10.0.8.0,
    All commands, links working fine
    I did it without root, and with the help of your step by step guidelines

    Thanks
    Thanks
    Thanks
    Thanks

    Reply
    • Dhananjay

      Apr 19, 2019

      Hi again Ankit! Thanks for the kind words. I have updated the post with the version you shared, thanks for doing that, it will be helpful for several other readers.

    • Jeevan

      Apr 20, 2019

      Hi Ankit,
      Can you please let me know if you used the 10.0.7.0 patched boot IMG for your april update.
      Am a bit worried if it will cause any issues. Or is there a patched boot IMG for April update?

      Thanks in advance

    • Dhananjay

      Apr 23, 2019

      Hi Jeevan. Patched boot for the April update (V10.0.8.0) is now available for download, for the Mi A2 (jasmine_sprout).

  177. ankit nirwan

    Apr 18, 2019

    what is the role of stock boot image file here?
    since we are using only patched boot img file..
    does it need to flash into stock boot img after all process?

    Reply
    • Dhananjay

      Apr 18, 2019

      Hi Ankit. I just provided them if the user accidentally flashes the patched boot image instead of booting it. Users often look for stock boot image in case of fully unrooting to take OTA updates etc.

      There’s no one particular reason for me to share them, just thought it would be useful.

      Oh, and no. You do not need to flash the stock boot image at all after following the instructions above.

  178. Unmekh

    Apr 14, 2019

    Hi. I followed the process but i dont think the commands you’ve given for termex worked. I have superuser access and entered all 5, but it still shows legacy camera.

    Reply
    • Dhananjay

      Apr 14, 2019

      Hi Unmekh. I am pretty sure that the commands work, please give it a try again. Once you have successfully executed them, reboot your phone and then try installing a GCam port.

    • Android One Mi A2

      Jun 15, 2019

      Same with me. Do you have any workarounds here? After typing the command and press enter what do we expect to see? Are there new codes that will show? Or we’ll just continue to tye the next command.

      Cause what I did is type a command then press enter. Type another and press enter. Once I am done typing all five commands I exited the app. Is there something I missed here? Thanks in advance

  179. Deluxe

    Apr 13, 2019

    I solved the aforementioned problem by unlocking bootloader but when I start termux it doesn’t allow me to access super user

    Reply
    • Dhananjay

      Apr 23, 2019

      Hi. Are you certain that you launch Termux and enter the ‘su’ command when the phone is booted with the patched boot image?

      The fastboot command is for temporarily booting the phone with root. After that, when you do a reboot, root will be gone.

  180. Deluxe

    Apr 12, 2019

    hello, I followed your guide but when I type the command fastboot the process stops with this message: “FAILED (remote: unlock device to use this command). How can I solve? thanks

    Reply
    • v1adimir

      Apr 23, 2019

      Most probably the bootloader is locked? Check the topic on Xiaomi, “Mi Devices Bootloader Unlocking Tutorial & Unlocking Tool”.

    • Dhananjay

      Apr 23, 2019

      Correct. However, you wouldn’t need the Xiaomi Unlock Tool to do it. Since it’s an Android One device, unlocking the bootloader could easily be done using the ‘fastboot oem unlock’ command and is reversible as well.

      Thanks, v1adimir for taking out the time and helping out other readers here.

  181. SeptianAdistyan

    Apr 12, 2019

    Hyyy My Bro,,
    I Was Succesfully Installed MGC_6.1.021_BSG_Arnova-based_v.1.3c_fix_TlnNeun.apk and Work On My MI A2..
    But I Want Ask About 20 MP Rear Camera..

    Why In My Device Only Work 12 MP??
    In EXIF Data Only Show 4000 X 3000 Resolution..

    Reply
    • Dhananjay

      Apr 23, 2019

      Hi. That’s because of the Google Cam port you are using. Please give a try to one of the other GCams linked above.

  182. Antonio Miranda

    Apr 12, 2019

    I did the procedure to start with a patched boot image, and the phone does not start with the temporary root, I tried to install the magisk but it did not work, thanks again

    Reply
  183. Anubhav Deshwal

    Apr 11, 2019

    Hi ,
    Should i unlock the bootloader before following the above steps

    Reply
    • Dhananjay

      Apr 11, 2019

      Hi Anubhav. Yes, you will need to unlock the bootloader first. You can do that without losing data, but you’ll need to follow a specific set of instructions for that.

      If data isn’t a concern, then you can unlock the bootloader and simply follow the process.

    • Giordano

      Apr 13, 2019

      Can I lock the bootloader after that and keep camera2api enabled or it will be disabled?

    • Dhananjay

      Apr 23, 2019

      It should still be enabled, however, I wouldn’t recommend re-locking until everything is completely stock.

    • Anubhav

      Apr 13, 2019

      I tried the above steps after unlocking my bootloader , but wheneven i try to send this command “fastboot boot patched_boot_10.0.7.0_mi_a2.img” the console just says: sending “boot.img” it doesn’t do anything

    • Dhananjay

      Apr 13, 2019

      Hi Anubhav. As soon as you enter the command, does the phone boots into the OS with the patched boot image?

      In case it doesn’t and the command prompt doesn’t move ahead, then I believe it’s a connection issue between the device and the PC. It could be the USB drivers, the cable, or the USB port on your PC itself.

  184. V.Panov

    Apr 11, 2019

    Hi
    Am I going to lose my data if I try to root my Mi A2 and install Gcam according to your instructions ?

    Reply
    • Dhananjay

      Apr 11, 2019

      Hi. You won’t lose your data if you use this method to root the phone and enable Camera2 API. However, you might lose it when unlocking the bootloader (Which is a requirement for this process).

      You can unlock the bootloader without losing data if you want to know how then let me know.

    • V.Panov

      Apr 12, 2019

      Hello again,
      What you mean that I can lose data during bootload ?
      Could you give me instructions ?
      I just want to enable Camera2 API and to install Gcam later, without loosing any data or OTA updates fro my device.
      Thanks in advance!

    • V.Panov

      Apr 12, 2019

      Also another question,
      Am I going to receive OTA updates after your procedure ?
      Thanks

    • Dhananjay

      Apr 14, 2019

      Hi. You will still be able to take OTA updates, so don’t worry about that. As for unlocking the bootloader without wiping data, please refer to the steps in this XDA thread.

      Make sure that you read the thread first and follow it exactly as it tells you to or you will end up losing the data while unlocking the bootloader.

    • Jeevan

      Apr 21, 2019

      The guide didn’t work. Earlier there was no confirmation message asking to confirm the bootloader unlock on the handset. Since there is a confirmation message displayed on the phone now, pressing the volume down key while this unlocking process doesn’t help since we need the volume button to select the menu in device to confirm bootloader unlock. So I ended up wiping complete data on this process. Fortunately I took a complete backup. Prepare for the worse scenarios during these processes so u don’t end up worrying if something goes wrong.

    • Dhananjay

      Apr 21, 2019

      Hi Jeevan. I am glad you took a backup beforehand.

      In the more recent Pie builds, Xiaomi seems to have updated the bootloader for all its Android One devices.

      The trick to prevent wiping is to avoid your phone from booting into the OS. So, when you press the Power button to select the confirmation message, simply keep pressing the Volume button simultaneously. That you reboot the phone back into the Fastboot Mode.

  185. Antonio Miranda

    Apr 11, 2019

    Good night, my version and V10.0.7.0.PDIMIXM, I can not get past the powershell command, would it be because of the different version? I tried it with Patched Boot Image V10.0.7.0.PDLMIXM

    thanks for the tutorial

    Reply
    • Dhananjay

      Apr 23, 2019

      Yes. You need to make sure that you use the patched boot image of the version installed on your device.

  186. Davide

    Apr 11, 2019

    Hi, thank you for this guide, it’s the best one I’ve found so long!
    But I have a problem, when I go to the step 9 (typing “fastboot boot patched_boot_V10.0.7.0_mi_a2_lite.img”)
    The computer says:

    Downloading ‘boot.img’ OKAY [ 1.018s]
    booting FAILED (remote: ‘unlock device to use this command’)

    What can I do?

    Reply
    • Dhananjay

      Apr 23, 2019

      Hi. That means you have not yet unlocked the phone’s bootloader. In order to perform this method, you must unlock the bootloader first.

  187. Gabriel De Jesus

    Apr 9, 2019

    Hi, can you help me? I followed all the steps of your tutorial and everything went perfectly fine except for one thing. After I’ve enabled the camera2 api on my mi a2 the frontal camera only works with 5 megapixels instead of 20. When I disable the camera2 api it backs to 20mp, but with camera2 api it’s maximum resolution is 5mp. Can you help me?

    Reply
    • Dhananjay

      Apr 23, 2019

      Hi Gabriel. Please try a different version of GCam as linked above.

  188. Hariharan

    Apr 8, 2019

    Hi Dhananjay, the Gcam works like a charm. Thank you so much. I’ve got a few doubts. Can I uninstall the Magisk Manager now? Will I get the updates as usual even after I have unlocked the bootloader?

    Reply
    • Dhananjay

      Apr 23, 2019

      Yes, you can safely remove it after you have performed the procedure.

    • Android One Mi A2

      Jun 15, 2019

      After typing the command in Termux and press enter what do we expect to see? Are there new codes that will show? Or we’ll just continue to tye the next command.

      Cause what I did is type a command then press enter. Type another and press enter. Once I am done typing all five commands I exited the app. Is there something I missed here? Thanks in advance

    • Dhananjay

      Jun 15, 2019

      Hi. If the command(s) executed properly, you wouldn’t see anything, just the next line to enter another command. This means that it worked.

  189. Sagar Deshpande

    Apr 4, 2019

    Hi Dhananjay,
    I have unlocked the bootloader. however superuser permission not pop up on my mobile.
    su not found message displayed on screen

    Reply
    • Dhananjay

      Apr 7, 2019

      Hi Sagar. Which software version are you running? Also, you have to execute SU command when you have successfully booted the phone with the patched boot image.

  190. Sugam

    Apr 3, 2019

    can you post the patched boot image 10.0.7.0 jasmin for mi a2

    Reply
    • Dhananjay

      Apr 3, 2019

      Hi Sugam. The patched boot image for V10.0.7.0 (March update) is now available.

    • Sugam

      Apr 4, 2019

      Thanks

  191. Sayem Siddique

    Apr 2, 2019

    Hi, I tried the method yesterday, but in camera2 probe apk shows green mark in legacy not in level 3 or any other. and one thing, you provided 4 different commands here, are they all for mi a2 lite? if not, then which are?
    and how can I be sure that the commands are executed properly. I am not getting it. I will wair for your ans. And thanks for this post.

    Reply
    • Dhananjay

      Apr 3, 2019

      Hi. The commands are the same for both Mi A2/A2 Lite. Please make sure that you use the patched boot corresponding to the software version installed on your phone. Once you have booted the patched boot image, open Termux and follow the steps. Also, make sure that you execute the ‘su’ command first to grant root permissions to Termux.

      Once you have granted the root permissions, you can execute the four commands to enable Camera2 API on your A2 Lite.

    • Kundan Yadav

      Apr 18, 2019

      In Termux app, I have entered su command but it reply that permission denied.
      What to do next ???

    • Dhananjay

      Apr 19, 2019

      Hi. That means that the patched boot image has not booted up properly. Here are two things that I want you to try, in the given order:

      1) Once you have booted your phone with the patched boot image, download Magisk Manager APK, install it, and run it. See if it shows wheather Magisk is installed or not?
      2) If the above doesn’t work, make sure that you have proper USB drivers installed. At several occasions, it has led to be an error on the USB drivers part.

      Let me know how it goes. Oh, and don’t forget that you use the patched boot image for your own device – Mi A2 or the Mi A2 Lite.

  192. Caique Ribeiro de Oliveira

    Mar 12, 2019

    I tried to lock the bootloader again, but it always resets from the factory. I keep pressing volume down, after I keep pressing a message appears can’t load android system your data may be corrupt, there I have to restore the phone. Mine is my normal a2

    Reply
    • Dhananjay

      Apr 4, 2019

      Hi. Sorry for the late response. Were you able to recover your device or do you still need help with it?

  193. Cebe

    Mar 10, 2019

    The MGC_6.1.021_BSG_Arnova-based_v.1.3c_fix_TlnNeun.apk can’t be open, it always force closed, but
    MGC_6.1.021_MI8_V2e.apk can be open but it can’t take picture from front camera.

    A2 Lite

    Reply
    • Dhananjay

      Mar 10, 2019

      Hi Cebe. Please visit this page and try the suggested versions (In Red color). Finding the perfect Gcam port could be hard at first.

  194. Vasily

    Mar 9, 2019

    Seems like booting with the image you provided doesn’t change anything. I got permission denied for su. I have a V10.0.4.0.PDLMIXM build, and used the according image. Realy can’t solve that issue.

    Reply
  195. Nicolas

    Feb 28, 2019

    Hi,
    Thanks for this job !

    Can i leave Always the patched boot img (without patch original img) for my A2 lite rest in Root state ?
    Thanks in advance and sorry for my bad english language.

    Nicolas.

    Reply
    • Dhananjay

      Mar 2, 2019

      Hi Nicholas! I am sorry, but I am not fully able to understand your question. Once the API is enabled, you can freely delete the patched boot image.

    • Hariharan

      Apr 10, 2019

      Hi Dhananjay,
      I had already commented on the post, but it is not here now. Anyways how do I delete the patched boot image? Thanks for your help.

    • Dhananjay

      Apr 23, 2019

      Hi. When you reboot your device after performing the commands in Termux, root is automatically removed.

  196. Leyaliton

    Feb 28, 2019

    I installed the MGC_6.1.021_MI8_V2e.apk port, but the front camera does not store the photos.

    Reply
    • Dhananjay

      Mar 2, 2019

      Hi Leyaliton! Did you try the other one linked above?

  197. Franklin Rosa

    Feb 23, 2019

    When i pressed enter on the step 9 i got an error: (too many links)

    in device screen appears the follow message: press any key to shutdown

    HELP!

    Reply
  198. Franklin Rosa

    Feb 23, 2019

    Mi A2 Lite v10.0.3.0 works in my Mi A2? (v10.0.3.0.PDIMIX)

    Reply
    • Dhananjay

      Feb 24, 2019

      Hi Franklin. The Mi A2 Lite images will not work on the regular A2. Do you have V10.0.3.0 installed on your regular Mi A2?

  199. Rae

    Feb 23, 2019

    after i successfully completed the process in termux i take a reboot and installed the ported gcam . after the installation it force closes after i grant the permission it wants.

    Reply
    • Rae

      Feb 23, 2019

      -update

      i installed another ported gcam heres the link : https://f.celsoazevedo.com/file/gcamera/MGC_6.1.021_MI8_V2e.apk

      and it works well. but the slow mo makes camera forced stopped.

    • Dhananjay

      Feb 24, 2019

      Hi again Rae! Thanks for sharing his. I have updated the post with the link you provided, along with the previous one.

      GCam ports are not all same. Some might have bugs in certain features. So, you need to keep testing which one works the best for your setup.

    • Rae

      Feb 28, 2019

      ok. i’ll update again if some other ported gcam works. ill send it right away here. 😊

    • Ankit

      Mar 13, 2019

      Please share a thread on how to lock bootloader again,cz I’m unable to do software update

    • Dhananjay

      Mar 31, 2019

      Hi Ankit. You don’t need a locked bootloader to update. You can simply uninstall Magisk from within Magisk Manager and then flash the stock boot image corresponding to your software version. Once you have done this, you will be able to install the OTA update normally.

  200. Rae

    Feb 22, 2019

    i redownloaded patched image for 10.0.4,
    booted.
    redownloaded termux.
    still su denied.
    please email me if you have the patched 10.0.4 again! thanks for the works btw! 😀

    Reply
    • Dhananjay

      Feb 22, 2019

      Hi Rae. When you boot with the patched boot image, do you see the Magisk Manager app installed and visible in the app drawer?

      And thanks for the appreciation. Keeps me going.

    • Rae

      Feb 22, 2019

      i do checked for the magisk app and i wondered why there’s no magisk installed.

    • Rae

      Feb 22, 2019

      i’ll be checking your response tomorrow. Thanks again. 😀

    • Dhananjay

      Feb 23, 2019

      Hi again Rae. Boot with the correct patched boot image according to the firmware version installed (V10.0.3.0 patched boot if V10.0.3.0 is installed, and so on).

      Once booted, download and install Magisk Manager 7.0.0 on the phone. Then launch it and see if it shows that Magisk is installed.

      Remember, do this all when booted with the patched boot image.

    • Rae

      Feb 23, 2019

      ok ill test it later in v10.0.4.0

    • Aditya Utama

      Mar 8, 2019

      Sorry sir, are this tutorial work on locked bootloader or not?

    • Dhananjay

      Mar 31, 2019

      Hi Aditya. No, it would not work on a device with a locked bootloader.

    • dikto

      Apr 21, 2019

      boot yang di tambal versi v1.0.0.8.0 mi a2sudah tersedia pak?

    • Dhananjay

      Apr 23, 2019

      Hi. Patched boot and stock boot for v10.0.8.0 are now available for download.

  201. Rae

    Feb 22, 2019

    redownloaded the patched image for 2 lite still denied.

    Reply
  202. Sugam

    Feb 16, 2019

    Can’t download the g cam. Can you provide another link

    Reply
    • Dhananjay

      Feb 20, 2019

      Hi Sugam. The download link is working just fine. I have personally tried it both via my PC and my Pixel.

  203. Sahidul

    Feb 9, 2019

    Need video for this method.

    Reply
    • Dhananjay

      Feb 21, 2019

      Hi. I am sorry, but we do not do videos for now. You will have to go with the instructions until we create a YouTube channel.

  204. Alejandro

    Feb 2, 2019

    when typing SU command termux displays “permission denied”

    Reply
    • Dhananjay

      Feb 2, 2019

      Hi. Are you sure that you’re typing the command when booted into the OS with Patched Boot Image?

    • Joseph

      Feb 20, 2019

      Went through everything booted with patched boot image…I have the same issue, denied su!

    • Dhananjay

      Feb 21, 2019

      Hi Joseph. I have patched the latest boot images for both Mi A2/A2 Lite with Magisk 18.1. Please re-download the patched boot image and try again.

    • gabriele

      Feb 21, 2019

      it is because you need to install magisc manager apk frist
      (sorry for bad english)

  205. Nick

    Feb 1, 2019

    The steps are clear but you should mention (somewhere at the beginning of the article), that if you follow the procedure you will end up WIPING EVERYTHING. Not cool.

    Reply
    • Dhananjay

      Feb 1, 2019

      Hi Nick. Thanks for the suggestion. Did you have an unlocked bootloader before starting off with the instructions? Or did you unlock it just before performing this?

      Why I am asking this, is because the method should not wipe anything.

  206. Caique Ribeiro de Oliveira

    Jan 29, 2019

    Flashing is not allowed in Lock State
    I’m new to this so I do not know what to do. Can anybody help me?

    Reply
    • Dhananjay

      Feb 21, 2019

      Hi. It is required that you unlock the phone’s bootloader first. If you need a guide, you can find it here.

    • yuvi

      Mar 17, 2019

      yeah thats right and after that my a2’s warranty will be void. am i right?

    • Dhananjay

      Mar 17, 2019

      Yes. But the beauty of using Google/Android One devices is that you can easily re-lock the bootloader back.

  207. Alehandro

    Jan 25, 2019

    1.For my mi A2 Lite (android Pie),which one install V10.0.3.0.PDLMIXM or V10.0.2.0.PDLMIFJ?
    2.Do you need to unlock the oem bootloader in developer mode?

    Thanks in advance

    Reply
    • Dhananjay

      Feb 21, 2019

      Hi Alehandro.

      1) You need to use the patched boot image for the firmware version installed on your Mi A2 Lite. So, if you have V10.0.3.0, you will need to use the patched V10.0.3.0 boot image.
      2) Yes, you need to enable OEM unlock in Developer Options and also unlock the bootloader after that. You can find the guide for unlocking the bootloader on Mi A2 Lite here.

  208. jerome

    Jan 25, 2019

    Hello
    thank you for the tutorial but I have the message “permission denied” when I enter the command “su” in Termux.
    What should I do?

    Reply
    • Dhananjay

      Feb 21, 2019

      Hi Jerome. Please re-download the patched boot image and try again. I have patched the boot images with Magisk v18.1 just now. Please try with the newly uploaded patched boot and let me know if it works.

    • Ed

      Mar 25, 2019

      I just tested with the V10.0.4.0.PDLMIXM patched Boot Image for Mi A2 Lite (daisy) and I have the same “permission denied” message when I enter the command “su” in Termux.

    • Dhananjay

      Mar 31, 2019

      Hi Ed. Once you have booted with the Patched Boot Image, do you see Magisk Manager in the app drawer? If you don’t, then please download it from here, install it on your phone and launch it. See if it shows that Magisk is installed or not?

Leave a Reply Cancel reply

Comment Policy: We welcome relevant and respectable comments. Only input your real first name and valid email address if you want your comment to appear. Read our comment policy fully before posting a comment.

Recent Posts

How to open ADB/Fastboot command window inside Platform-Tools on Windows, macOS, and Linux

Open ADB/Fastboot Command Window in Platform-Tools

Download Magisk v22 w/ New Magisk App, Galaxy S21 support, and more

[Download] Magisk v22.1 – New Magisk App, Galaxy S21 Support, Bug Fixes, and more

How to Install TWRP on Snapdragon Galaxy S20 and root using Magisk

Install TWRP on Snapdragon Galaxy S20/S20+/S20 Ultra and Root using Magisk

©2017 - 2021 TheCustomDroid.com Privacy Terms Disclaimer Request Tutorial