yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] zak-freestyle:
Finally i get that twrp work ,and those are the steps that i use

Your bootloader must be unlocked.

Download TWRP zip file and copy it to your device (internal or external storage)

Download TWRP img file and and store it, on the folder where you have adb and fastboot files, on your PC

Open a cmd line and execute these commands (being on that folder, of course):

adb devices (to make sure your device is detected)

adb reboot bootloader (to reboot into fastboot mode)

fastboot getvar current-slot (to check what's your current active slot)

fastboot set_active b (if your active slot was a, if it was b then change it to a)

fastboot erase boot

fastboot flash boot twrp-3.3.1-2-unofficial-laurel_sprout.img

fastboot reboot (NOTE : Before hitting "Enter", long press Vol + on your device until you see the Android One logo. By doing this your device will be forced to boot into Recovery and not into System)

When TWRP recovery boots, i exctract the boot partition that i actually use (it was b for my case)

$ adb shell

laurel_sprout:/ # dd if=/dev/block/by-name/boot_b of=/sdcard/old_boot_b.img
131072+0 records in
131072+0 records out
67108864 bytes transferred in 0.744 secs (90200086 bytes/sec)

laurel_sprout:/ # exit

Normaly you should have it in your internal storage

Then flash the old_boot_b.img into boot partition

Install the TWRP zip (always install the latest build available)

Change slot to the one that was active on the beginning of these steps and reboot to Recovery (just to make sure that the slot, in fact, was changed)

Reboot to System

Thanks to
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] barth2:
Question:

I used [MENTION=758827]Typhus[/MENTION] method in post #10. Now if I boot into recovery I get fastboot (the mascot). i then have to

fastboot set_active b

then

fastboot reboot recovery

to get into twrp. Is that right or did I mess something up?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] dkrs_:
Thanks a lot man!! <3
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] cldkrs:
Thank you 1000 times man! :good::good::good:
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] 4B4vTqgG:
My MI A3 bricks on android one screnn then fastboot

Hello,

After install of TWRP my phoe bricks on android one screen then fastboot.

when i power it, i begin in fastboot mode.

I flash officiel rom with miflash, i worked but not this time.

what should I do please?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] 4B4vTqgG:
Finally, phone was on slot B, not A. I changed slot B to A and flash stock rom correctly.

it's very difficult for me to understand the difference between slot A and B.

The rom stock is installed on A, we have to change to B to install a TWRP, but when we install a custom rom it is installed on B. Where should TWRP be installed after that? I can't reboot on the custom rom. . .

there's a detail I didn't understand! I've been looking for several days.

Good day for all.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Khaderaque:
Does anyone with TWRP installed have any problem installing the stock rom December update? I have TWRP and when I try to update, it always says installation problem.

Is there anything I should be doing?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] ViboraNegra:
Hi,

With the December update arriving, I have revisited this thread and I am afraid I am going to need a little bit of hand-holding to perform it. Please bear with me.

I have a rooted Mi A3 in which I installed TWRP and Magisk as described in the first posts of this thread (I actually followed Typhus' instructions). Now, let's assume I want to install the new, updated rom but of course keeping TWRP, Magisk, and the rooting. The first post gives these instructions:

- delete magisk modules

- Put rom.zip, twrp installer.zip and magisk.zip on your internal storage or sdcard;

- Flash Rom;

- Flash TWRP Installer;

- Flash magisk(recommend to use Magisk v19.4);

- Reboot.

No problem with deleting the magisk modules and placing the relevant files in my internal storage, easy enough. Now, however, we are instructed to flash a number of files, and here come my questions:

1) The flash rom, flash twrp, etc... have to be executed from recovery? I assume that is the case, but nothing specific is said. I do understand the order is important, though, due to all those files sharing the same /boot partition now that there is no specific /recovery partition.

2) What about the A/B slots? In twrp I have the option to change slots. If my currently active slot is -let's say- A, should I switch to B upon entering TWRP and only then perform the steps above, so that if something goes wrong I can still boot into A with my current system?

Thanks in advance for your help. And yes, I clearly don't understand the updating process well. Sorry, I find the mixed explanations about A/B confusing.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Phil_gloves:
Hi, can you please tell me how to install the sdk platform tools or how to use it? I tried using the 15 seconds adb but when it gets to change the current slot it doesn't work at all.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Alister.:
It's not that hard is it? go to the link i've already provided saving you looking for it yourself.

Assuming you use windows download the zip file extract it, put any of the files you want to use with it inside that folder, double click the fastboot.exe and proceed to use it.

Something tells me you didn't even try it.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Phil_gloves:
Thanks for your answer but of course I tried and in the end I figured out that the problem was the cable which I used to connect the phone that didn't let the tools work... Sorry for bothering you mate :)
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Margano:
No wifi and no sound!

Hi!

Today tried to root mi A3 using the tutorial on 1st message (- Flash Rom; - Flash TWRP Installer; - Flash magisk). Achieved root but wifi and sound stopped working. Wifi MAC address chnaged to 02:00:00:00:00:00. Tried to flash stock boot.img from TWRP but got a corruption error. After doing a restore (as advised on display), phone restarted but still with not working wifi and sounds.

Any ideas to help me to solve this problem?

Thank you!

EDIT: solved the problem flashing the CORRECT stock boot.img from Fastboot (mine was INT and had flashed EU). :angel::o
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] masterdex:
Good evening everyone and I intend to stay on stock Roma but to get root permissions. I understand that in this case I don't need to change partitions from A to B, just install Twrp recovery with fastboot commands. It is not clear to me the boot.img speech whether I should bandage that or not. I'm on latest 10.3.13 and don't know where to find boot.img. Is someone kind enough to show me the correct step to take?

Inviato dal mio Mi A3 utilizzando Tapatalk
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] sunnycee:
Hello guys, thanks for your good works, pls I just want to install TWRP so as to able to install "pixel experience rom" based on Android 10 since Xiaomi is not yet ready to release Android 10 for mia3. I do not need root, just the pixel experience rom. What is the simplest, non complicated way of doing it? All this active slot and inactive slots a or b is not what I want to do.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] 2WildFirE:
Android 10 for mi a3 is announced to mid Feb
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] andrmax:
Hi, got the same problem here! Where did you find the proper boot.img file? Thanks
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Technical:
Is it only me or we can't boot this TWRP (fastboot boot twrp-3.3.1-2-unofficial-laurel_sprout.img)?

I've tested also with OrangeFox Recovery R10.0_2.1 image file and can't boot it also.

(The very new official TWRP is not booting from fastboot either. Seems a device/TWRP limitation)

I was trying to load TWRP into RAM and make a nandroid before flashing it.

Thank you.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Technical:
Indeed I plan to move to custom ROMs, so, can you confirm the steps?

My bootloader is still opened (critical parts too) and I'm on slot b.

adb devices

adb reboot bootloader

fastboot getvar current-slot

fastboot set_active a

fastboot erase boot

fastboot flash boot twrp-3.3.1-0-laurel_sprout.img

<pressing Vol+> It will reboot into TWRP

fastboot reboot

Flash twrp-3.3.1-0-laurel_sprout.img (as image, not zip) to boot partition (is it possible as we don't have the zip yet?)

(If I remember correctly, there where an option in TWRP Advanced menu to patch the boot image of both slots at a time)

Reboot into bootloader and:

fastboot getvar current-slot

fastboot set_active b

Reboot into system

Thanks.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Typhus_:
No. Don't flash the twrp.img to boot partition. You must install the TWRP zip installer.

Earlier this morning I've "created" a TWRP installer zip that installs the official TWRP, you may use it for the time being (see attachment).

Also, after running the installer you may change slot while on TWRP. After slot change, reboot to TWRP (just to make sure it actually changed). After that, you can reboot to system.

Cheers!
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Technical:
Can you double check then? Thanks for your help.

adb devices

adb reboot bootloader

fastboot getvar current-slot

fastboot set_active a

fastboot erase boot

fastboot flash boot twrp-3.3.1-0-laurel_sprout.img

<pressing Vol+> It will reboot into TWRP

fastboot reboot

Flash twrp-3.3.1-0-laurel_sprout.zip (provided here)

Change the slot within TWRP (on the reboot menu)

To be sure, reboot into TWRP and check again if I return to slot b, the original one)

Reboot into system

Thanks.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Typhus_:
Yes, if you're in fact on slot b, those are the steps.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] ghasemi.hussein:
hi

i face a wired problem today. i was trying to flash havoc os. format data, wipe cache and system and then flashed havoc. when rebooting twrp warn me that no os installed. i ignore it and break my device. then i flash twrp image but after flashing i realize i can't boot into recovery with power and volume +. it just boot to fastboot mode. after flashing stock rom and trying again twrp booted. what was the problem?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] ghasemi.hussein:
Thanks. As I said before I flash stock and install twrp again. But this info will be very useful in future.

Since I just format system and flash havoc os, this means havoc image has problem? Other guys use it without problem
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] EVILWAR83:
hi [MENTION=6569827]Nik001[/MENTION] your twrp (both official and unofficial) breaks the wifi on jan update

but its working fine on 1.0.4.0 version

i flashed twrp like this:

fastboot --set-active=(active slot)

fastboot erase boot

fastboot flash boot twrp

fastboot reboot (+volume up)

pls update your twrp
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Typhus_:
TWRP breaks nothing!

You should flash TWRP on the

inactive

slot and not on the active one.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] EVILWAR83:
so if i flash it on inactive slot how can i flash magisk or ... on android(active slot)?

do u mean i have to first flash it on inactive slot then install installer.zip from twrp?

i did that on jan update but it broke the wifi

the official twrp has no installer.zip
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Nik001:
I will update thread step by step how to do thanks to [MENTION=5057272]Typhus_[/MENTION] for making flashing step easy for all.

While I am bit busy n tension with my office work. So in few days I will do.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Typhus_:
Yes, that's exactly it.

flash stock boot.img that matches your current build on the active slot (to make sure your current active slot is with the correct boot.img)

change slot to the inactive one

flash twrp on that slot

reboot to twrp

while on twrp flash stock boot.img, that matches your current build on this slot, to boot partition (not needed, but if you have the boot.img that corresponds to your build on the inactive slot, do it)

flash twrp installer zip

change slot on twrp

reboot to twrp (just to make sure twrp indeed changed the slot)

flash magisk (optional)

reboot to system

Impossible. You must have thought you've done that but you didn't.

OR

, maybe you did but, most likely, the boot.img on the active slot, before trying anything, was already tampered.

Not yet, but I've shared one a few posts back.

Cheers!
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] EVILWAR83:
Ok ill try it again

Thanks for your support

---------- Post added at 06:55 PM ---------- Previous post was at 06:54 PM ----------

Ok thank u
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] ManuelLima1994:
TWRP oficial have a bootloop, i use the Fix Recovery Bootloop in Advanced but this dont works
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] phiberoptick:
I can confirm that I was able to follow these instructions and use the official TWRP files from:

https://twrp.me/xiaomi/xiaomimia3.html

The process completed without any issues including installing Magisk.

I am up and running on the January security update with working TWRP and root.

Thanks for the great guide!!
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] nullstuff:
hi, following the same instructions i get:

Sending 'boot.img' (39780 KB) OKAY [ 0.912s]
Booting FAILED (remote: 'unknown command')
fastboot: error: Command failed
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] adefxda:
Try type:

fastboot getvar current-slot

what's your current active slot? If a, change to b or vice versa. Then try flash boot.img again

To change slot type

fastboot set_active x

X= A or B
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] nullstuff:
i'm on B slot; after shifting to A i get the same result booting twrp image ('unknown command').
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] phiberoptick:
You should be sending the twrp image and not the boot.img shouldn't you?

I also used the image I downloaded from TWRP and not the "3.3.1-2-unofficial-laurel_sprout" image.

phiber@dev-null:~/Desktop/Xiaomi_Mi_A3$ adb reboot bootloader
phiber@dev-null:~/Desktop/Xiaomi_Mi_A3$ fastboot getvar current-slot
current-slot: b
Finished. Total time: 0.005s
phiber@dev-null:~/Desktop/Xiaomi_Mi_A3$ fastboot --set-active=a
Setting current slot to 'a' OKAY [ 0.045s]
Finished. Total time: 0.054s
phiber@dev-null:~/Desktop/Xiaomi_Mi_A3$ cd TWRP/
phiber@dev-null:~/Desktop/Xiaomi_Mi_A3/TWRP$ fastboot flash boot twrp-3.3.1-0-laurel_sprout.img
Sending 'boot_a' (39780 KB) OKAY [ 1.556s]
Writing 'boot_a' OKAY [ 0.195s]
Finished. Total time: 1.762s
phiber@dev-null:~/Desktop/Xiaomi_Mi_A3/TWRP$ fastboot reboot
Rebooting OKAY [ 0.000s]
Finished. Total time: 0.050s

After that I continued with installing the TWRP installer zip file. Again, the 3.3.1-0-laurel_sprout version is what I used.

The files I used were:

twrp-3.3.1-0-laurel_sprout.img

twrp-3.3.1-0-installer-laurel_sprout.zip

I downloaded the img from download page linked here:

https://twrp.me/xiaomi/xiaomimia3.html

Direct link: https://dl.twrp.me/laurel_sprout/twrp-3.3.1-0-laurel_sprout.img

The installer, I actually made on my device by installing TWRP from Play Store and then telling it to flash but having it write out the installer to my device. I've seen the same installer zip around here on one of the threads.

Not sure if it matters, but I also accepted and installed the January security OTA right before unlocking the bootloader to make sure everything was current. Also, my device is the global version and not EU. (Again, no idea if that mattered or not).

Hope you get it working!
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Technical:
On one slot. The other will remain in the -1 version.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Jhon_Locke:
I tried installing this recovery and my phone now bootloops into fastboot. Tried several times and also tried changing slots but it still bootloops to fastboot. Is there any way to fix this?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] adefxda:
how about OrangeFox

bootloops into fastboot too?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Jhon_Locke:
Yes, it did too. In the end I think it must have been something I did and the problem is not with the recovery. In the end I flashed stock package, flashed recovery, rom, etc and it's working OK. Thanks for your help!
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] adefxda:
glad to hear that :svetius:
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Jhon_Locke:
Just a question out of the blue, this is now the official TWRP for this model, right?

https://twrp.me/xiaomi/xiaomimia3.html
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Jhon_Locke:
Thanks, so the installer (zip) on OP shouldn't be used?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] batata004:
I am following exactly what you said, however when I click REBOOT -> RECOVERY it always goes to fastboot mode! What should I do?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] batata004:
I tried installing pixel experience on xiaomi mi a3 and it didnt work and now I cant boot my system. I can still open fastboot and TWRP. So I am wondering: how can I install the stock ROM back to my phone using TWRP?

Before doing anything, I backuped my phone using TWRP however when I restore the backup (using TWRP) the system does not open, it always opens TWRP. For some reason the SYSTEM partition does not show up on the list to restore, it shows data, vendor, system image... I can restore however after that I click REBOOT SYSTEM and nothing opens.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] kon14:
Download the stock rom.

Get into Fastboot and flash it by running the appropriate script, that's either flash_all or flash_all_except_data_storage plus sh for linux shell scripts or bat for Windows.

Don't use the flash_all_lock script, unless you wish to also relock your Bootloader (as far as I can tell).

It should take a while, but you'll be back on a bootable system.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] batata004:
It worked perfectly!!!! I am back on track! One question: when I first unlocked my bootloader and then installed TWRP (before flashing any new ROM) I went on BACKUP option inside TWRP and generate a backup off all partitions that appeared on the screen. Then I went ahead and tried installing a custom ROM and I ended up with a useless phone. I was not afraid because I had my backup! So I went to TWRP -> RESTORE and selected the backup that I made previously. The restore process went fine HOWEVER when I rebooted my phone it never started the system, it always started twrp.

I realized that the SYSTEM partitions was not available inside TWRP to restore but all other partitions were available. Why?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] kon14:
I'm not particularly keen on the details, though it could be any or many from a list of factors.

In any case, it's my understanding that whenever you wish to get back to stock (or anything closely resembling it without heavy modifications) you're better off cleanly flashing stock and then restoring a partial backup.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] batata004:
Thanks!
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Golbinex:
TWRP apparently can't wipe f2fs data partition properly for my custom ROM. ROM will always instantly reboot to recovery after wiping. If I flash stock userdata partition, custom ROM will boot. If I change data to ext4, ROM will bootloop without writing anything to data partition. Anybody knows CLI solution to wipe data partition?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] afarkas:
Twrp + custom rom problem...

Hi ...

When i installed Pixel Experience ROM on my Mi A3, i already had TWRP and Magisk on my stock rom - all working fine...

i flashed this rom via that TWRP, rebooted to system and set up the phone...

when i wanted to boot into twrp again i learned its not there anymore... some google android recovery was on its place...

So i attempted to install the twrp again, by flashing its img via fastboot and then flashing the TWRP installer thru that "temporary" TWRP... but when i did, i could not boot into system anymore there was this infinite Google logo...

Cant get out of this circle where OR i have TWRP, OR i have working ROM...

Any advice, please?

Thanks
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] batata004:
This is exactly what happened to me and I ended up having to flash a stock ROM. Just wasted time. This ROM is not a typical custom ROM that is easy to install. Also, the A/B slot make things even stranger and subject to errors.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] afarkas:
The solution, apparently is to come from Stock ROM, without TWRP... Have PixelExperience ROM package and TWRP Installer on SD card... via fastboot first change slot to different as it is (if a then change to b and vice versa), then flash temporary TWRP (still via fastboot), then boot into that temporary TWRP, make sure you are still on different slot as original, flash PixelExperience ROM, flash TWRP installer, switch back to original slot and reboot to solid TWRP. (i made factory reset at this point to wipe user data from stock rom and start with PixelExperience as a fresh new phone)
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] batata004:
I cant confirm your method works because something wrong happened when installing the CUSTOM ROM, so when I tried to install it again I was not "come from Stock ROM". So, in this situation that I was, things get complicated to solve.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] ViboraNegra:
Hi,

Could somebody please expand on the instructions given in the first post about how to install updates while keeping TWRP and root? I have this recovery installed since november or so, but have not performed any updates. The instructions, as given in the first post, skip many details (at least for me!).

I already asked in post #69 in this very thread, but got no answer. I would be very grateful is someone could lend me a hand with this.

Thanks!
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Golbinex:
Flash rom zip, flash twrp zip, reboot to recovery, then gapps, magisk etc. But better follow instructions for your rom, this twrp is far from being stable.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] epirater:
Could you please provide more detail on how to do this, with a stock room automatic update, and Magisk installed, for a n00b? thanks :victory:
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] ViboraNegra:
Thanks for the reply. As the other poster said, could you please provide a little more detail? To begin with, the "flash rom", "flash twrp", etc... Is it done from the system, or from recovery? Does the A/B slot scheme require any special action?
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] Golbinex:
If you have stock ROM, then update with OTA is the best option for now. Fastboot method will override your data partition. Unfortunately you have to install twrp after every update, this applies to custom ROMS as well, because this device contains recovery in boot partition, which gets overriden by ROM recovery. Usually recovery has it's own partition and is not affected by ROM updates, not this case and probably not possible to fix in future.
[Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De] epirater:
Thanks, but it's still a bit complicated to me.

What's the best way for one to do the OTA update and retain, or backup and restore all data?

It's rooted with TWRP and Magisk and I tried doing the OTA update but it doesn't work. Do I have to remove the root or restore the original ROM somehow, then do the update, then root it again? How does one do this, and keep all app data etc?