yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
If you are talking about option 7. in tool, here is a simple guide.

When the phone boots up first time, you need to start the magisk app from app drawer.

Install full magisk when offered.

Then check in developer options if debugging is checked/active.

Click on open cmd prompt here bat.

Type:

adb shell

su

when you type su, look at the phone, there will asking for root access, grant for one time.

If there is no asking for root access for ADB SHELL on the phone itself, it will not work !!!

Then type command for enabling camera api

setprop persist.camera.HAL3.enabled 1

press CTRL+C to cancel adb shell.

Then type adb reboot bootloader

In bootloader/fastboot flash stock boot.img only on partition a.

Put stock boot.img to adb folder

fastboot flash boot_a boot.img

Then when the phone starts, just uninstall magisk, don't worry, the phone will not be rooted.

Check the phone for enabled camera2 with app like camera 2 probe from gplay, it should show level3.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] stopthetime:
Can I lock the bootloader after this?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
I did not try it, but I believe that Benjamin has, and it did not work.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ki69:
If bootloader is not lock, can get OTA updates and installed them or not?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
I made a few modifications to install magisk and open it to get everything running. It worked for my phone upon testing but one phone is not a good sample size. I also removed the "setprop persist.camera.eis.enable 1" from the code.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
After pulling out my hair for the last few days because fastboot and adb output is not like typical cmd output, I was able to find a workaround to detect active partitions and use alternatives. In short, the set active detects and preserves your active partition. I have not had a chance to change the instructions completely yet though. Check it out in my 1.0.5 version.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
I missed my september OTA update because I was rooted and had build.prop file edited, so my OTA update could not be installed.

I'm waiting the new OTA update to pop up, so I will know.

The real answer for you is, I don't now, but many say that it will work, as long as you don't mess with system files.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] stopthetime:
Can anyone tell me if the API remains active after blocking the bootloader?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] MarceloBass:
Brothers, I made a big bull**** on my A2. When trying to install GCam I gave a wrong command in fastboot and deleted the whole system. I got a Mi 6x rom with MIUI 10. I'm in Brazil and she only has a language in Korean or English. With this app I can make it back to stock rom of the A2 with android one? Help me!!:crying::crying:

If that does not help me, what could I do? When trying to install a rom by TWRP, it shows me rollback. If it is in this mode I lost the device?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] stopthetime:
I can confirm... Lock bootloader wipe Camera2API :(
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] dodjob:
Thanks mate.

Yeah the fastboot is a bit tricky with a/b partitioning. I think I know why my "set_active a" instruction wasn't taken in consideration tho. I didn't unlock critical and it can really be the case that if you didn't, you are not able to change active partition. It actually make sense.

THAT SAID that F##!g fastboot should at least mention it, not sending an unknown echo without any real meaning behind it ??

If this is the case, (I will test it when TWRP get stable and we have a functional kernel to be flashed on stock) I think you should take care of this kind of "dependencies" in your script.

Something like if someone want to let's say, clean dalvik-cache (in one click) he gets a message of all what's needed (Unlocked. Bootloader + critical + TWRP ...etc)

Some actions will wipe all data (like critical unlock) and this is something a bit non-intuitive.

What I want to say, is that there is a need actually on this device to unlock a load of things which will wipe all data in the process. And this should be done at starts. Not doing it completely (like I sadly did) will let you in a state of half-functionality and induce errors and non achievement at some point. **More support requested from you, and your time unfortunately**

Finally, I think the a/b thing is a bit still in the development process, and not cleanly implemented at ADB/fastboot level. That's mostly the reason you get less hairs and lose so much time for things which were easy as 3 words command in terminal in the single partition system. Again, thanks for your time and great support ???
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
I had a hard time understanding what you were trying to say in your post, so correct me if I am wrong, but are you saying that the commands give no useful information back with the errors? After that I am a bit confused. Could you possibly clarify it for me?

As for the AB thing, from my understanding, the a/b system is due to treble, which is very new on the scene, therefore not well understood and only newer versions of fastboot support it fully.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
You can use the revert to stock option and it should flash everything back to stock. Android one does not have antirollback which is nice. the Mi 6x rom is not compatible with our devices though. You can also enter edl mode and restore using MiFlash and the Fastboot image
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] stopthetime:
Daha3ker,

Could you add this new way to activate Camera2api in the tool?

Open the TWRP without installing> By adb add the HAL3 line. End.

&

is there a way to not lose data when lock the bootloader?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
is it confirmed working? I have not tried it myself but if it is, then I will add it.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] bartoloandre98:
I selected the option to revert to stock but stuck on sending system b . What can i do?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] stopthetime:
Yes, I did it: https://xdaforums.com/mi-a2/how-to/tutorial-camera2api-gcam-root-t3842475

But if you put in your toll, is better
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] bartoloandre98:
now im trying to return to stock but saying flash system b error. Rip just bricked my device
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] dodjob:
Haha I was on a lyric rampaging mode ???

If I give manually with fastboot terminal "fastboot set_active_partition a" I get a list of "known commands" like what you would get with "fastboot -help"

Making the same with "b" suffix works but correctly.

That means, that fastboot instead of giving you a warning that your device isn't critical_unlocked and therefore the set_active option isn't accessible, will just give Out a "non recognized command" standard message (very rude way to say, learn how to use fastboot... Wich I definitively take as an offense ??)

I will check if my fastboot is outdated. I really doubt it tho. Do you know any command of trick to check which version I have? This is the kind of thing that makes me crazy... Why the hell "fastboot --version" doesn't work ???
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
System is the largest ones to send. Unless it says it failed then wait for a while. flashing system and vendor are large and therefore take a while. If it fails then re-run it. Fastboot can be unreliable for our phones.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Darshan28:
Hi i just tried to use the tool and boot into TWRP, first i unlocked all the 3 sections in unlocking bootloader and then selected 4th option that is to boot into TWRP. The phone gors to fastboot mode and the tool says unable to find the active partition and the phone stays in fastboot mode. I manually tried booting into fastboot by fastboot boot TWRP.img but the phone is stuck on the boot animation for 5 minutes. Any help guys?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
In windows with ADB put the phone in bootloader ( fastboot).

Type:

adb reboot bootloader

Then when the phone is in fastboot, flash stock boot.

Put the boot.img in the same folder as adb is, and then command.

fastboot flash boot_a boot.img
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Darshan28:
Ok thanks for the reply. I pressed the power button for few seconds and it rebooted normally.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] MarceloBass:
I had already seen in another discussion that I had how to restore in EDL mode.

Even if he turned the Mi 6x still have how? I saw a post about a CMD app that had some options to restore, would it work? A guy from my city is trying to recover via the box. He said EDL would not work. He's wrong, right?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] MarceloBass:
C:\adb>fastboot flash mdtpsecapp_b C:\adb\images\mdtpsecapp.img

target reported max download size of 536870912 bytes

sending 'mdtpsecapp_b' (1053 KB)...

FAILED (remote: No such partition.)

finished. total time: 0.003s

hen I try to flash the rom, all images B of error in partition B
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] michiamoantonio:
i have september update, can i use the tool? If not there is a way to go back ti august update?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] migfer:
Thanks

Enviado desde mi Mi A2 mediante Tapatalk
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Deepanjan Maity:
Can I use the manual method to enable camera2 api as we did in case of MI A1 ???
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Shifat Islam:
is it compatible with the new september update??

if not will you please make it compatible with new update?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
Sorry all, I just started a new semester of school right now and I am kinda swamped. An update will come, but it may be a bit.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] paolobia:
call fastboot in path ?

In Toolkit.bat look this line :

fastboot getvar current-slot

must be ?

%fastboot% getvar current-slot
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] asuturo:
when i want to launch the TWRP, my device already plugged in and in fastboot mode, but it says "could not detect the active partition used, please ensure your phone is plugged in and in fastbook mode". How to fix this? tks
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] paolobia:
change every call to fastboot into %fastboot%
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] acetonight:
hey so i recently bought a mi a2 and i really want to enable camera 2 api but idk where to start. Should I install other apps before i use your tool because like the 2 files "Open cmd here.bat" and "Open cmd in ADB folder.bat" idk what to do with those 2. and should i connect my phone while on fastboot or just plug directly anytime?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Membrillo007:
So, there is no root method for v9.6.13 September build?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] aof2092:
You can extract the stock boot.img with URTool from the payload.bin file. Then use Magisk Manager to patch de boot file and flash it with fastboot command. I used this method and is working fine.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] XchickenXslayerX:
Installing camera api.

Hey, which things should be opened for installing the camera api, I know the bootloader.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Rafaelboxer:
I'm a bit rusty with the procedures but i can't go into step 4, how do i "change every call to fastboot into %fastboot%" since i'm using the tool and it's automatic and doesn't show the commands?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] abgnokia:
FYI > Refer to this post.

To install Camera Api, install using Magisk, click Download & search Camera Api Mi A2..

To Edit build.prop.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] SpectraFun:
How unlock critical? See only unlock bootloader but not second critical? I am on Septmeber patch.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] webmasterone:
my A2 is unlocked (i unlocket it symply with fastboot unlock bootloader (not using critical))

and it' s rooted (magisk)

i've OPM1.171019.011.V9.6.10.0.ODIMIFE (patch 5 August 2018)

NOW there is an update available (OTA - September 2018 security update)

can you suggest the correct step i've to make to try the OTA update without brick the phone ?

and in general, the steps to do before make any future update ?

(i mean, have i to unroot, lock bootloader, etcc . If possible someone could give me all the needed steps? )

thanks to everyone could help me
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ki69:
I want to use this guide:

https://xdaforums.com/mi-a2/how-to/tutorial-camera2api-gcam-root-t3842475 ut don´t work on September Update i think the problem is in TWRP, there is any way to fix this? I know it woul be dificult to get, before a proper/oficial release do the TWRP for MI a2 is out.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] rafihasan710:
Hey, i've my mi A2 in August Patch (v9.6.10.0 ODIMIFE)

And

1. Bootloader Unlocked

2.Rooted

3.HAL3 Enabled

4.System Modified

What shoud i do to update to the latest(September) security patch.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Darshan28:
If you have modified system, OTA installation wil fail... Flash stock images on both the partitions and then update... Or simply use the unroot option in the tool.. You will lose root and will be back to stock... To again root, use the tool or use patched_boot.img for September update
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
it is now updated to the september update. I had to wait for a few large bugs to iron themselves out.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
Question, Should I try to make a tool that can switch between mi a2 and 6x? If so I cannot test due to me needing a reliable device for school and work.. If anyone is willing to test it I am willing to make it.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ki69:
I think has a good feature. I don´t ofer to test it because i am a noob on this device, and usualy root only after warranty is finish, but if there is a tool that can make an easy change from A2 to 6x and vice versa for sure in the future i will try this.

keep the great work.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ilyas111:
ok. now it will download September update for unbricking right?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Farkiny:
Mi a2 bootloop

I always get this message. I want to do 3. Unbrick/Revert to stock/Force update ( revert to stock)[IMG="error"]https://i.imgur.com/oC4qJK8.png[/IMG]
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] MrkMrsn:
Can you update it for those who are beta testers using September update.

Will you update it on version 8.9.20 beta?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] pridix:
FYI Tried to enable Camera2Api in September update was unsuccessful for me. Traid to send data to partition A and got an error. Then tried to send data to partition B and got "Unknown error". I've tried several times.

Thanks for the tool anyway.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
Yes
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
You need to re-run the dependencies download. Itdoes not have the files it needs.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Daha3ker:
Fastboot is kinda buggy for our phones. Sometimes a reboot of the phone and computer is necessary to resolve the fastboot issues.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] pridix:
Working now (but I had to install Magisk manually for some reason! Thanks
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Dimasaguung:
Hi, first of all thanks for the updated tool.

I've Mi 6X succeed convert to Mi A2 with september patch.

Can i do root with this tool? This tool using magisk?

-Edited-

Already tested and success to root.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Darshan28:
Performance terrible

Hi, i used this tool for enabling camera 2 API and after enabling it, the phone has been hanging and lagging like crazy.. especially apps which use camera eg camera apps, snapchat and Instagram. Can anyone give me a solution for it? I resetted my phone, cleared app preferences, tried safe mode and did everything possible, can anyone please give me a solution? And will i be able to claim warranty or should i lock bootloader and claim? Thanks.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] xdxita:
Hey, [MENTION=8908789]Darshan28[/MENTION] , let me know if you fixed your device, my A2 just arrived and I'll be using this tool in the next days.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Darshan28:
I haven't been able to fix... Planning to visit the service centre today, let's see what they say
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] minnuss:
Read this

https://xdaforums.com/mi-a2/how-to/sudden-random-freezes-t3840928

maybe it will help
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] oscar1823:
Cant seem to do a back up on Twrp. I did the Boot Loader Unlocking. There needs to be a guide not just throw this program at us and thats it.

---------- Post added at 07:42 PM ---------- Previous post was at 07:18 PM ----------

Now i keep getting GOOGLE SERVICE FRAME WORK KEEPS STOPPING on boot up when trying to set up android. no back up or anything! it is unlocked boot loader tho thats it.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] xdxita:
Try to clear dalvik/art cache
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] xdxita:
[MENTION=8080580]Daha3ker[/MENTION], please look at line 89 in your script, the command tries to move the wrong extracted folder(from 9.6.10 image)

mkdir "%cd%\stock_images
MOVE /Y "%cd%\TEMP\jasmine_global_images_V9.6.10.0.ODIMIFE_8.1\images\*" "%cd%\stock_images

The extracted folder from September update is jasmine_global_images_V9.6.13.0.ODIMIFE_8.1 and not jasmine_global_images_V9.6.10.0.ODIMIFE_8.1
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ilyas111:
Look into the tool. There is some bug when u download update through it. The images folder doesn't get copied to stock_images folder. It remains in temp folder. That's why unbrick doesn't work.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] afridishamsofficial:
What steps should I go by to get the camera2Api enabled?

What I don't want :

1) Leave the bootloader unlocked.

2) Leave my devices rooted.

3) Lose OTA updates.

What I want?

1) Camera2Api enabled.

Please be kind to help me ?!
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] :
It's imposible without leave the bootloader unlocked
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] afridishamsofficial:
On my previous device, mi a1 it was somehow possible with the toolkit. Anyways. I can maximum leave the bootloader unlocked. But no root and no loose on the OTA. ?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] dupereira:
Mac Version

Any chance for a Mac version?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] ishmeet1995:
If someone has done rooted their phone with this tool please post a guide to as what steps needs to be followed.

Its pretty clear but still we need to be sure that we won't break our device during the process.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] bavmouse:
Sorry, my English is not so good. But how i can flash TWRP with this Tool?

Thanks
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] xdxita:
Look at my post #109
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] raydekok:
Problem here,

Phone won't start up.

It stays in the android one screen.

It can get in fastboot and can give it commands. But it won't unlock the bootloader.

Because the phone won't start I can't get it to oem development.

Last problem. I can't get it to recovery it gives me the android one screen.

What I want to try, erase or switch a with b. But don't know the commands.

What to do?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Nebrassy:
Fastboot wipe userdata

Edit: actually first try fastboot -w
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] raydekok:
Erase not allowed in lock state
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Nebrassy:
If you can't get to recovery then it's a problem with the boot partition not data, did you do anything that may have caused this?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] afridishamsofficial:
You've to flash the stock firmware now. That'd be the best solution. Happened to me too.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] raydekok:
OK but how. When I do fastboot oem edl it says already unlocked.

Within mi flash tool I can see the phone but it gives a error like all the others.

What rom or image do I need?

This phone is from a friend. He did not do anything I think.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] afridishamsofficial:
When I tried to flash stock rom using miflash tool I was having errors. So I had to go through the manual flash method through adb commands.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] raydekok:
Ook help. Me out witch one?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] noobington:
Bug Report

Daha3ker, I have attached for your attention, some typo/syntaxt corrections (and cosmetic corrections) to your Toolkit.bat file.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] raydekok:
Will check later. I orderd a edl cable let's see if that will help.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] anwar.asyraf:
my mi a2 was unlock bootloader. if i try to use number 1 option to lock bootloader. data will wipe?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] sampatghosh:
i have some noob questions.

1. To enable camera2api do I have to unlock bootloader first?

2. If bootloader needs to be unlocked, do I need relock the bootloader in order to get OTA?

3. After enabling camera2api will the miui camera still be working?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] Dimasaguung:
I just help answer from my experience. CMIIW

1. yup, that was the beginning of the process to develop the Mi devices.

2. from my case, I prefer to do flashing than OTA. Cause gives me a selection of files to be upgraded (after reading the review). Some Mi devices, has unlock a bootloader that can still do OTA ( in selected Region).
sometime i'm flash with Custom Rom (nightly/stable/official file)

3. the Miui camera still working, and you can use the Google Cam side by side with Miui camera.

Sorry for my bad english. :D
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] yadavdharmendar:
Stable October update is up!

Plz update the tool for support to oct_patch_/\_
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] bongmasta:
october update - root

nice work, thx!

do i have to unroot my phone, install OTA october update and then root it again? will that work?

im on september 5, magisk 17.1, no twrp

thx!
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] mat choh:
help

hai..sorry if im asking weird question. will this tool works with october patch? and anyone know if now im already root with september patch and update october patch via ota, is it my root and magisk will gone? seeking for answer..sorry for bad english.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] mosaiques:
I've tried this tool with the october patch, I wanted to root the phone.

Nothing happened. The app says my phone is rooted but it is not. :confused:
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] bongmasta:
did u install magisk manager apk after that?

Gesendet von meinem SM-G900F mit Tapatalk
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] the_bastian:
Quick question: I wanted to revert to stock, but I get following error:

Sending sparse 'system_a' 3/5 (524284 KB) FAILED (command write failed (Unknown error))

Finished. Total time: 38.340s

"Flash system_a error"

The phone is not running the correct version to flash or the flashing failed.

Any ideas?
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] mosaiques:
I've tried Root Check and the phone was not rooted.
[Xiaomi Mi A2 / 6X Guides, News, & Discussion] bongmasta:
https://r.tapatalk.com/shareLink?ur...share_tid=3854280&share_fid=3793&share_type=t maybe

Gesendet von meinem SM-G900F mit Tapatalk