yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi A2 Lite Guides, News, & Discussion] anko13:
Uh did it, although with internal wipe (did hold volume down button?). Camera2 api works. THANKS:
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Drekaar:
Yes, you can, but remember to be careful with the procedure and the vol- button
[Xiaomi Mi A2 Lite Guides, News, & Discussion] HTCDevil:
Thank you very much for guide.

I'll give it a try
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Ansel26:
I have bootloader unlocked, what steps should i follow?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] HTCDevil:
All steps you can see after fastboot oem unlock, from patched boot...
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Ansel26:
Can i keep bootloader unlocked ? Can i avoid doing the last steps ?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Drekaar:
Yes, you can skip the last steps and keep bootloader unlocked
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Ansel26:
I don't understand when i should hold the volume button and when not
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Drekaar:
When you are in the fastboot mode and run "fastboot oem unlock", the phone will reboot, at that time you must hold the button (do it before execute the command). If you do not, all the information will be deleted. The same when you try to lock the bootloader.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] gianlucataldi:
Yes new version and i have solved with the drivers simply changed the USB port and doing a factory reset with this port still connected
[Xiaomi Mi A2 Lite Guides, News, & Discussion] lbsilva:
Great tutorial mate!

Just a simple question:

If anything goes wrong and GCam doesn't actually work, does this mess in any way with the stock camera?

I just want to make sure I won't break the stock camera in case the GCam won't work.

Thank you.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Zinyth:
#First install Android USB drivers, ADB, and activate USB debug and OEM unlock in dev. menu.

#Pressing DOWN while reboot prevent lock / unlock operations to erase datas

adb reboot bootloader

fastboot oem unlock (DO NOT PRESS ENTER)

press DOWN on the phone

press ENTER

#wait for fastboot screen

release DOWN

fastboot boot patched_boot_10.0.4.0.img (check this is the file for your build)

install Magisk Manager apk

adb shell

su

#ADB shell is root

setprop persist.camera.HAL3.enabled 1

setprop persist.camera.eis.enabled 1

exit

adb reboot bootloader

fastboot oem lock (DO NOT PRESS ENTER)

press DOWN on the phone

press ENTER

#wait for fastboot screen

release DOWN

fastboot reboot
[Xiaomi Mi A2 Lite Guides, News, & Discussion] leroi77:
yes of course :good:

the record do not touch the stock camera, only enable HAL3
[Xiaomi Mi A2 Lite Guides, News, & Discussion] rob.1:
Is it my imagination or can others confirm that google cam focus issue is working correctly after the Feb 5 2019 android 9 security patch.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] galileogarin:
Hey dude, if i keep the bootloader Unlocked, can i still get OTA and update normally?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] nickSnake:
Yes you can still get OTA updates
[Xiaomi Mi A2 Lite Guides, News, & Discussion] galileogarin:
Ok, thanks. Glad to know that ??
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Santy5442:
Its working. Thanks. I have just a little bug. Sometimes when i take photos from the Camera in WhatsApp the photo take a green color anyone have the same problem? Im on Android 9 v 10.0.4.0
[Xiaomi Mi A2 Lite Guides, News, & Discussion] marstonpear:
I have the same problem but somehow it works fine sometimes and sometimes it's green. This happens when I enable cam2api whether via adb or with Magisk module. I think this is a bug related to Xiaomi.

---------- Post added at 07:56 PM ---------- Previous post was at 07:56 PM ----------

It doesn't work for me (10.0.4.0)
[Xiaomi Mi A2 Lite Guides, News, & Discussion] faridryen:
zoom 1x before snap , no more green
[Xiaomi Mi A2 Lite Guides, News, & Discussion] rob.1:
I was too quick on my hopes that it was working too. It failed to focus on many photos. I just can't trust using the gcam with pie. I wish someone would figure out a fix. Perhaps g00gle pie only whitelisted specific approved models and made the rest to fail.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] To7aL:
I followed the instruction, but when i have to set the record in the 10th step, the adb sad:

/system/bin/sh: su: not found

What am i doing wrong?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] CRobert0:
I've read that the properties are set under /data.

Is an encrypted partition a problem for this procedure? Can I keep the data?

Thanks.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] juukeli:
I have system version 10.0.4.0 on my phone but there´s no pathed boot image for that. Is it now impossible to enable camera2 api according to this guide?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] usman farhat:
On the first try, the data was erased despite keeping the volume down pressed. On later tries, the device does not reboot unless we release the volume down button. Upon reading another website, I tried pressing volume down button only before entering the fastboot commands, and it worked. That is, I reboot into fastboot (power+vol), then I release both buttons, then I press volume, then I enter fastboot command, and then when the screen shows reaction (it flashes for a second) I release the volume down button. This just my experience, though and may not work for others.

A little unrelated, but one more thing I found useful in this whole process was that I initially skipped signing into the setup wizard (because I still risked data wipe again), but then the process was successful, and I needed to run setup wizard again. But it was nowhere to be found. So Apex Launcher comes to the rescue! I added the "Activities" shortcut from the widgets, and under that, I selected "Android Setup" > ".deferred.DeferredSetupWizardActivity". This allows you to complete Device Setup and allows to restore apps, settings, etc.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] ZauCunha:
There is a patched_boot.bin for the 10.0.7.0 build? I've installed the march update. This method is available for this version?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] maikonbona:
Hello, I would like to know if anyone can help me.

I followed the guide correctly and it worked perfectly, cam2 api activated.

BUT OTA updates are no longer working after you've made the guide. The device downloads the May update, the last that came out, and gives an installation error. I already tried to reset and even with the device still clean of the error to do the update.

Is there any way to solve this or just flashing the rom again?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Ciao ragazzi:
I just did this unlock/lock procedure after accidental wiping my data partition. (Don't press power&Vol-Up - it will instantly wipe) Used V10.0.8.0.PDLMIXM April release. Afterwards I received the May 2019 OTA update V10.0.9.0.PDLMIXM without problems. Must be something else with your phone.

Did you (re)lock the bootloader?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] jehnial:
which patched_boot.bin did you use? I'm in stock with April update and want to activate camera2api
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Ciao ragazzi:
Used the Magisk patched rom from this site:

https://www.the***********.com/root-xiaomi-mi-a2-a2-lite-android-pie-magisk/

The "su" in adb shell didn't work for me. Took me several tries until I found that I have to enable #superuser in the left menu in Magisk Manager. Don't need to install full Magisk though.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] godofpain:
I was pretty excited to take some night photos after I unlocked Camera2API on my A2 Lite but it seems that while all manual camera apps allow up to 32 seconds of exposure time, the camera doesn't go further than 1 second. Anyone else experiencing this?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Federic999:
I have a problem, i bought mi a2, and when I want to unlock the bootloader with pressing vol down, do not unblock the bootloader, only the message comes out to confirm that I want to do it, but I will lose the data, any solution?

Sorry for my bad english, i talk a little and use google translate
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Guize17:
Hi guys,

I am having a problem um the step 8, when I type in cdm "fastboot oem unlock", a message show up in the phone's screen asking to confirm or not the bootloader unclocking, but as I am keeping pressed the volume down button, the selection keeps alternating between yes or no and I can't select an option. I tried to run the next code in the cmd "fastboot boot patched_boot.img", nothing happens, the phone freezes and I can't select any option, then I need to restart the phone. I tried few times, but nothing happens.

I have read the answers and no one had this issue. Should I release the vol- button, select to accept the bootloader unlock and then press the vol- again? Could anyone help me, please?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] HeyItsMeElias:
Will this work with the latest security patch because i've heard some people saying that the got the system destroyed screen after the oem lock command?

thanks
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Pat750:
Hmm I'm not sure, maybe you already solved it, but it sounds like you are not in fastboot mode? To run the command power off the device then push vol down + power for about 4 sec till the fastboot screen with the little android appears (release the buttons). After unlock hold power for around 10 seconds to reboot the device.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] AKBIROCK3:
or just use this app

https://xdaforums.com/android/apps-games/app-camera2-api-enabler-xiaomi-oneplus-t3948448

https://play.google.com/store/apps/details?id=com.proxdz.hal3enabler
[Xiaomi Mi A2 Lite Guides, News, & Discussion] jusdecitron:
Anyone tried this?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] n1k0laz55:
Does this method still work for the July 2019 update?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] kima09:
+1

I have this message too on August security patch.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Pat750:
Did you try the answer I gave to the post you quoted? Command works only in fastboot mode and not when OS is running.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] kima09:
Yes, I know that this command works only in Fastboot mode. The normal unlocking mode will wipe data partition. So, what we're asking is that if unlocking without data loss is still working or not, or if there is any alternatives for unlocking without wiping data.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Pat750:
Ah, thanks for clarifying it. I don't know if this method still works. Maybe someone else knows?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] mohakagr:
Factory data reset after "fastboot OEM lock"

I have August security patch installed in my Mi A2. I followed the above steps and I was able to enable camera2api.

However after "fastboot OEM lock" and "fastboot reboot" command, it doesn't reboot into OS unless I leave the volume button. And once I do that, it reboots and says "Can't load android system. Your data may be corrupt...." and there are only 2 options:

•Try Again

•Factory Data Reset

After factory data reset, the camer2api was gone. What should I do?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Luthfire:
is there someone who noticed that if camera2Api enabled whatsapp camera show green shadows?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Nexus Phreak:
Unlocking the bootloader

without erasing the data

using the "PWR button + VOL down" method works just fine.

I did it today on Android Pie with the latest security patch installed (10.0.13.0 - August 2019).
[Xiaomi Mi A2 Lite Guides, News, & Discussion] kima09:
No prompt for confirmation? For me, there's a prompt whether I want to unlock or not. So, there is no way of unlocking without releasing Volume button.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Nexus Phreak:
Yes, there's a prompt for confirmation. But since you

just

need to keep the VOL Down button pressed and not the PWR one during the process, it's really easy to confirm. :)
[Xiaomi Mi A2 Lite Guides, News, & Discussion] u363840:
Thank you for the method ; just applied it a bit differently :

* When enabling adb debug and allowing oem unlock, I also removed unlock security (no fingerprint, no scheme, no pin, ...) (might not be needed, but I wasn't ready to reinstall everything)

* Instead of using modified boot & temporary rooting the phone, I just booted TWRP : when you use adb shell, you already have root rights and you can directly use setprop (and I finished with a "sync")

* When finished with TWRP, I used adb reboot bootloader
[Xiaomi Mi A2 Lite Guides, News, & Discussion] ForMartha:
I'm on the latest august security patch, which patched bootloader should I pick?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] NotXiaomi:
Hey guys, quick question

Any of you who did this and then turned usb debug off again, is it really disabled or does it still persist on? (Asking cuz some xiaomi devices are having this bug since a patch earlier in the year)
[Xiaomi Mi A2 Lite Guides, News, & Discussion] johnwho2410:
Hi Guys,

i really need help here. I have tried to use this method to get the cam2api working. Downloaded the patched_boot.img and did all the steps in the tutorial to install it. But after the reboot i get an error message that tells me the phone could not boot into android and my data might be corrupt. All i can do from here is try again which leads to the same error or i can do a complete factory reset.

Do i have to use a special boot img or has somebody an idea what is going wrong here?

Thx in advance for your help!
[Xiaomi Mi A2 Lite Guides, News, & Discussion] chalseu:
Lol, don't panic man. That warning is just a simple warning not a bootloop. This is because the bootloader is unlocked. After doing the fastboot oem lock, this will hide the warning message.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] johnwho2410:
Hi [MENTION=8863672]chalseu[/MENTION]

Sorry i did not mean the open bootloader info. Its really a form of "error screen".

The phone starts to boot up and i see the android one logo and after a short moment i get the message

"Can't load android system. Your data may be corrupt...."

all i can do from here is either

"try again"

or

"factory data reset"

Trying again leads to the same screen over and over again. Factory Data Reset just resets the phone and put everything back to the normal, unpatched version.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] ro0ven:
I have the same error, and a factory reset reverses all changes on the props
[Xiaomi Mi A2 Lite Guides, News, & Discussion] trash2009:
Could some one send my the patched_boot.img for stock Pie with September Security patch?

I've reset my phone to factory settings and now cam2api is gone. Using patched_boot out of a other source nothing happens, the phone does not boot.

Thanks in advance.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] picopi:
Tried doing it this way twice now and both times just results in a GCam that crashes on startup. Tried two different kinds even, the one linked in the OP and the "MGC_6.1.013_MiMAX" one also linked in this thread. I'm stuck doing it this way until someone makes a pre-patched boot img for the September security patch, it seems. Don't want to install Magisk or whatever because I don't have any need for it.

edit; theres a patched boot for 10.0.0.4 or w/e its called on 4pda but i just cocked it up and erased my device unintentionally so hey kids, that warning about not letting go of volume down too early is a genuine one! considering its now in that state i tried it again with the patched boot and got it working, but now there's the issue of 75% of the image being green boxes. boy howdy this is a great reminder of why i dont bloody bother with modding **** on phones anymore lmao
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Th1gas:
when lock bootloader mobile erases all data
[Xiaomi Mi A2 Lite Guides, News, & Discussion] trash2009:
Finaly i've solved the issue. Everything works like described. I've done it like in this tutorial (vol down button handling): https://youtu.be/v6GLQ5UcDmM

I've used this patched boot img for current pie version with september security patch: https://www.mediafire.com/file/1fpaxcj7se2pqke/patched_boot_10.0.14.0_mi_a2_lite.img/file
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Mohammedyb93:
the first time i successfully booted the patched boot and i was able to enable cam2api and every thing works just fine, after that i didn't remove the magisk manager after rebooting the phone and i mistakenly installed an unsupported zip mod, then the phone stucked at boot-loop and refusing to boot and eventually it will boot into fastboot, the only way to boot the phone is by flashing stock boot, pls help and thanks in advance.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] samiru.gamage:
su not found

i did resetted my phone accidently because i didnt hold the volume down button and i did the step 3 again but there's an error message telling

daisy_sprout:/ $ su

su

/system/bin/sh: su: not found
[Xiaomi Mi A2 Lite Guides, News, & Discussion] pawelik001:
you don't have booted magisk boot .img properly
[Xiaomi Mi A2 Lite Guides, News, & Discussion] AquaNine:
Thanks a lot!!!

installed gcam 7.0 and it's working fine. :D
[Xiaomi Mi A2 Lite Guides, News, & Discussion] 1347kittens:
Has anyone tried to enter the recovery mode again after the bootloader lock procedure?

They write on the forum that the formatting code will wait and wait for opportunity to wipe up the next time when you enter recovery mode.

Thanks

Later

TESTED, ANSWER: NO
[Xiaomi Mi A2 Lite Guides, News, & Discussion] a1291762:
Note: I have not tested this but I recently found this path...

Boot to fastboot (hold vol down when powering on)

Run fastboot boot twrp-3.3.1-dees_troy.img

Run adb shell

cd /data/adb/modules

Remove the broken module directory

Reboot

I have used the mm module (Magisk Manager CLI) from TWRP. It gives you a script you can run to manage modules from the CLI. But obviously you need it installed before you need to use it.

You should also be able to fastboot boot vanilla_boot.img and use Magisk Manager to disable the module, then reboot.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Hungry_muffin:
Is it possible to enable "Level_3" ?

Cc9/mi9 lite have that disabled
[Xiaomi Mi A2 Lite Guides, News, & Discussion] paul222008:
Does this sill works on A2 December 2019 Security Patch? Currently my bootloader is locked and i dont want to lose all my data. Thank you
[Xiaomi Mi A2 Lite Guides, News, & Discussion] 1347kittens:
Still work, but.... It hard to do this in first time
[Xiaomi Mi A2 Lite Guides, News, & Discussion] paul222008:
Why it's hard sir?

---------- Post added at 06:19 PM ---------- Previous post was at 06:19 PM ----------

December Security Patched boot image anyone have?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] paul222008:
Is that for Mi A2 December security patch sir?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] 1347kittens:
I make it in 10.0.16.0, and it still work after December OTA
[Xiaomi Mi A2 Lite Guides, News, & Discussion] paul222008:
Just for clarification sir sorry. So it's safe to use the 10.0.17.0 to my A2 with December 2019 security patch?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] 1347kittens:
I don't do this at 10.0.17.0. It's your risk
[Xiaomi Mi A2 Lite Guides, News, & Discussion] paul222008:
Okay I'll wait when someone have the 10.0.18.0 :)
[Xiaomi Mi A2 Lite Guides, News, & Discussion] yashinodon:
Maybe you're on the wrong thread. This is for Mi A2 Lite (daisy_sprout), not Mi A2 (jasmine).

Also, the official tutorial for Mi A2 Lite still does work for Mi A2 Lite (December update)(10.0.17.0). No probs at all.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] paul222008:
Can i flash 10.0.17.0 on my A2 with December security patch with no problem at all?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] yashinodon:
I think it would be better if you ask this to the Mi A2 forums here: https://xdaforums.com/mi-a2
[Xiaomi Mi A2 Lite Guides, News, & Discussion] DekiS3:
Hi guys!

I didn't backup the build.prop file before change these lines.

If i want to undo these changes how should i do? Would it be enough to enter the value 0 instead of 1?

If I had made a backup of the build.prop would it be enough to overwrite it?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] marstonpear:
Replacing the build.prop with the original would revert the changes but might cause issues with OTA. These commands are stored in /data, so if you do a factory reset it will be automatically removed. However if you try this you might remove the property (although I haven't tested it and only found it on stackexchange) :

adb shell
su
rm /data/property/persist.camera.HAL3.enabled
rm /data/property/persist.camera.eis.enabled

Then reboot to apply it.

EDIT : Check this out before you do anything and proceed at your own risk !!! https://stackoverflow.com/questions/16440945/unsetting-persistent-system-properties

EDIT2 : Setting those properties to zero would also work, but the keys would still be there in /data/property. It might also add new keys which are set to 0. I don't know, sorry.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] ~Nagareboshi:
Hi guys. The OP post still works? Can I use in stock Android 10?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] suad93:
Yes this method still works.I used this method on my phone to enable camera2api on stock Android 10,but i had to add three more props to enable.

setprop persist.vendor.camera.HAL3.enabled 1

setprop persist.camera.stats.test 5

setprop persist.vendor.camera.stats.test 5

Here you can download patched boot that i created for stock android 10

https://mega.nz/#!ba530ISR!7W1G7OGOzVNPUsGQruPdW2BgG5wf4sVclXS2mQf1-ps

Here you can see screenshots from my phone

[IMG="Camera2API"]https://imgur.com/NSEpTRr.png[/IMG]

[IMG="Android 10 Screenshot"]https://imgur.com/IgIMy16.png[/IMG]
[Xiaomi Mi A2 Lite Guides, News, & Discussion] ~Nagareboshi:
Thanks man!

Correction: I'm on Android 9 :p

Can I use the first post tutorial or your tutorial?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] suad93:
You can use both but you must find patched boot for you version.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] ~Nagareboshi:
I'm on 10.0.18.0 (last Pie), and looks like the OP post have patched boot.img up to 10.0.13.0... to extract a patched boot from 10.0.18.0 I'll need root? So no way to enable camera2api on 10.0.18.0 without root?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Yanyan2129:
su not working

Hey bro, when I enter adb shell, and request for super user access, it doesn't show on my phone if i should grant it or not.. it doesn't show that option. Can you tell me how did you do it? Thanks!
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Yanyan2129:
Super user request not popping up

I've tried everything, but when I enter 'su' it doesn't show the grant pop-up.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] suad93:
You can check in Magisk is it granted or not.I didn't get the pop-up to,but it has been already allowed.I don't know how.
[Xiaomi Mi A2 Lite Guides, News, & Discussion] theslugone:
is time for the V11.0.4.0 patched image, anyone did it?

[MENTION=6682403]suad93[/MENTION]
[Xiaomi Mi A2 Lite Guides, News, & Discussion] a1291762:
https://yasmar.net/xda/patched_boot_11.0.4.0_204.img.gz
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Syahmi Popo:
It is work ?
[Xiaomi Mi A2 Lite Guides, News, & Discussion] theslugone:
[MENTION=4964062]a1291762[/MENTION]

Tnx MAN!!!! Works as exepted . :)

[MENTION=10420997]Syahmi Popo[/MENTION]

Definitely
[Xiaomi Mi A2 Lite Guides, News, & Discussion] Fast Eagle:
Thank you
[Xiaomi Mi A2 Lite Guides, News, & Discussion] e20140:
The above boot image does not work for 11.0.4.0,

use the following:

Thank you both