[RECOVERY][3.3.1-17][laurel_sprout]Unofficial TWRP recovery for Xiaomi Mi A3 (Test)

Search This thread

hacksome

Senior Member
Jan 27, 2005
1,156
152
Bangalore
Figured out most of the action is happening in the Telegram for this device. Here is a noob friendly tutorial i found there:-




BASIC FLASHING GUIDE BY BHAGYESH RANE.


UNLOCKING PROCEDURE:
Unlock bootloader required. To do so, Go to Settings, About Phone, and tap of Build Number 7 times.
After that go back and go to Settings, System, Developer Options, and enable Oem Unlocking.
After that, Long press vol- and power to enter fastboot mode.
Enter these two commands for unlocking (read NOTE):
- fastboot flashing unlock
- fastboot flashing unlock_critical

NOTE: All your data will be lost, so keep your backup somewhere other than your Mi A3.



FLASHING PIXEL EXPERIENCE:

After you have unlocked the bootloader, download the Pixel.7z file and extract it in a folder.
After that, enter fastboot again by long pressing volume down + power.

Open Cmd-here file and enter these commands one by one. Wait for each command to execute successfully.

fastboot set_active a
fastboot erase boot
fastboot erase system
fastboot flash dtbo dtbo.img
fastboot flash system system.img
fastboot flash vbmeta vbmeta.img
fastboot flash boot recovery.img.img

fastboot reboot -> After you enter this command, press volume up + button to boot into TWRP recovery.

After you enter TWRP Recovery,
- Go to Wipe, select Format Data and Type yes to format.
- Go back and go to Reboot, Select Recovery, select do not install.
- keep your phone connected during this, Again in the same Command Prompt, Type following commands:
1. adb push boot.img /sdcard
2. adb push recovery.zip /sdcard
3. adb push patchnofde10.zip /sdcard
- Now, go to install, select image, select boot.img, select boot and swipe to flash.
- then again go to install, select recovery.zip and swipe to flash
- then again go to install, select patchnofde10.zip, swipe to flash
- then Go to Wipe, select Format Data and Type yes to format.
- Go back and go to Reboot, Select system, select do not install.

now hopefully you will boot to the AMAZING PIXEL EXPERIENCE ROM.

link for files - https://mega.nz/#!V2QHwK6A!Wol5iP3zwPhVhrQ_7kkHk-3Htb3CkzV49TBFc0VO0F0
 

jnel26

Member
Jul 31, 2016
37
1
hellllppp guys im stuck on fastboot :(
this what happen,after i install magisk, my wifi not working anymore, so i try to wipe dalvik, data, system to have factory reset but now im stuck on fastboot. pls help
 

Typhus_

Senior Member
hellllppp guys im stuck on fastboot :(
this what happen,after i install magisk, my wifi not working anymore, so i try to wipe dalvik, data, system to have factory reset but now im stuck on fastboot. pls help

fastboot getvar current-slot

if the result is "a" then:

fastboot set_active b && fastboot reboot

if the result is "b" then:

fastboot set_active a && fastboot reboot

You'll lose all your userdata...but it will boot.

Problem solved.
 
  • Like
Reactions: jnel26

jnel26

Member
Jul 31, 2016
37
1
fastboot getvar current-slot

if the result is "a" then:

fastboot set_active b && fastboot reboot

if the result is "b" then:

fastboot set_active a && fastboot reboot

You'll lose all your userdata...but it will boot.

Problem solved.

thanks for this this is another way to get out of stuck fastboot, i also tried flashing stock rom via MI Flash and it also works too.

Now im back to rooterd device with twrp and magisk but WIFI not working again.
 

Typhus_

Senior Member
thanks for this this is another way to get out of stuck fastboot, i also tried flashing stock rom via MI Flash and it also works too.

Of course it does...flashing full stock ROM always works...

Now im back to rooterd device with twrp and magisk but WIFI not working again.

You're using the wrong boot.img. It must be the same boot.img of your current build version, or you'll end up with that issue.

If you rooted using TWRP, that happened because you didn't change slot on fastboot, before flashing twrp.img.

Now you must revert to original boot image from your current build version...or you'll be stuck without WiFi.
 
  • Like
Reactions: ghasemi.hussein

kimikim0

Senior Member
Oct 11, 2011
831
219
someone please upload boot.img, system.img and vendor.img from EU V10.3.7.0.PFQEUXM. i fked up, please thank you
 

DBuffon

Senior Member
Oct 8, 2019
63
7
Parma
  1. Get boot.img, system.img and vendor.img from your stock ROM build type (EU or Global) and store them on the same folder you have adb and fastboot
  2. Uninstall all Magisk Modules you have installed (do the same for Substratum themes, if any)
  3. Reboot to TWRP
  4. While on TWRP, Flash Magisk Uninstaller Zip
  5. Reboot to bootloader
  6. Code:
    fastboot getvar current-slot
    (just to make sure which slot is currently active)
  7. Code:
    fastboot flash boot boot.img
    (from your stock ROM build type)
  8. Code:
    fastboot set_active [B]b[/B]
    (or a, if you were on slot b)
  9. Code:
    fastboot erase boot
  10. Code:
    fastboot erase system
  11. Code:
    fastboot erase vendor
  12. Code:
    fastboot flash vendor vendor.img
    (from your stock ROM build type)
  13. Code:
    fastboot flash system system.img
    (from your stock ROM build type)
  14. Code:
    fastboot flash boot boot.img
    (from your stock ROM build type)
  15. Code:
    fastboot reboot

By doing this your phone will now boot to the previously inactive slot, where an older system build is installed, with all your userdata preserved.

Now you just have to wait for the OTA to arrive and install it in order to have the latest stock Rom build installed without TWRP and Magisk.

NOTE:


This procedure is also intended for everyone that want to install latest stock OTA without losing userdata. The Magisk OTA Installation Tutorial could fail if you tampered with system or vendor partitions, that's why I've decided to share this procedure

Since I had rooted my phone with Magisk (without TWRP) I tried to revert using the following procedure:

  1. Got boot.img from my stock ROM build type (EU or Global) and store it on the same folder I have adb and fastboot
  2. Reverted any modifications done to /system and /vendor
  3. Uninstalled Magisk
  4. Rebooted to bootloader
  5. Code:
    fastboot getvar current-slot
    (just to make sure which slot is currently active)
  6. Code:
    fastboot flash boot boot.img
    (from my stock ROM build type)
  7. Code:
    fastboot set_active b
    (since I was on slot a)
  8. Code:
    fastboot erase boot
  9. Code:
    fastboot flash boot boot.img
    (from my stock ROM build type)
  10. Code:
    fastboot reboot

The result was a bootloop.
I then set active slot back to a and the phone booted.
I've then tried to install the OTA update (which downloads correctly) but at about 30% it gives "Installation problem".
What should I do?
I guess I shouldn't have erased/flashed boot.img on slot b, but since it's too late for that, how do I solve? Please help me!
Thank you!
 

paq1170

Senior Member
Jun 12, 2015
165
34
Abuja
Xiaomi Mi Note 10
@Sapper Morton, pls can you post october boot.img. if i patch it with magisk and instal like u showed me for September boot.img hope it will work? Thanks

---------- Post added at 08:35 PM ---------- Previous post was at 08:32 PM ----------

@DBuffon you would have just followed the tutorial i used in some pages back to patch boot.img with magisk and just flash it. It was super easy and well explained.
 

DBuffon

Senior Member
Oct 8, 2019
63
7
Parma
@DBuffon you would have just followed the tutorial i used in some pages back to patch boot.img with magisk and just flash it. It was super easy and well explained.

My problem is not patching the boot.img. It is reverting back to stock.
I've solved (thank you Typhus!) by flashing the stock rom via fastboot, installing the OTAs and then rooting the phone again, but there should be an easier way.
 

ghasemi.hussein

Senior Member
Sep 15, 2011
78
9
Qom
i think i found a bug. installing this twrp image on october update(ota or clean install) will result broken wifi and hotspot(they won't turn on anymore). also flashing stock boot image after installing twrp will force you to factory reset in order to boot device(or restart to fastboot and install twrp again!). correct me please if i'm wrong.
 

ghasemi.hussein

Senior Member
Sep 15, 2011
78
9
Qom
Broken network is because you used a pre_patched boot.img, you must patch or use the same version as your firmware, otherwise you will be using wrong kernel build version; as for the factory reset, as long as you maintain the updated slot active, you will not have any trouble; Typhus already explained some tips to overcome that, however you must know what you're doing to avoid any data loss.

Anyway, attached below, there's the stock 10.3.8.0 PFQMIXM boot.img.

PS: For now, avoid using Magisk v20, otherwise you will be stuck at the bootloader after you try to access recovery mode; for it to boot, you will have to flash Magisk v19.5 Canary or below, or v19.4 or below; or just flash stock boot.img.

thankyou for replying. i flash the image you posted and booted the phone. it wants me to factory reset again.
i explain to you every step i mad and please correct me if i'm wrong.
after i updated from ota and flash twrp and magisk, i think maybe it's because ota . i donwload v10.3.8.0 .zip file from here (at end of page). use payload dumper to extract all of its images. and then flash all of them in fastboot. like described in this mi a2 threat. after that phone booted and every thing worked. it was slow and after a factory reset it work fine. then i use this guide to patch twrp and then flash magisk. phone booted and wifi and hotspot borken.
flash origianl boot.img again and factory reset page show up.
by the way i use both magisk v20 and 19.5 and they worked fine for me.
 

Attachments

  • image_2019_10_19-5_34_53_584_7DM.jpg
    image_2019_10_19-5_34_53_584_7DM.jpg
    53.4 KB · Views: 308

ghasemi.hussein

Senior Member
Sep 15, 2011
78
9
Qom
I just read typhus post. I think I changed slot before flashing twrp.img but I will try installing twrp from a clean boot tomorrow to make sure if it was problem.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 24
    Install method explained

    Hello!

    Since the install steps provided on OP maybe confusing I thought on sharing here the steps I've made in order to get TWRP working....let's call it a "noob friendly guide", ok?

    Here he we go:

    0 - Your bootloader must be unlocked. If it's not, then follow step 1 of the instructions provided HERE.
    1 - Download both twrp-3.3.1-15-laurel_sprout-mauronofrio.img and twrp-3.3.1-15-laurel_sprout-mauronofrio-installer.zip files present on OP
    2 - Download latest Magisk Installer, Magisk Uninstaller and Magisk Manager from HERE.
    3 - Copy all of the above to your phone internal memory (since current TWRP doesn't allow sdcard nor USB OTG yet...)
    4 - Connect the phone to your PC
    5 - Reboot to bootloader
    Code:
    adb reboot bootloader
    6 - Check your current active slot
    Code:
    fastboot getvar current-slot
    7 - Flash TWRP image into the current inactive slot (we do this just to leave the current active slot with no changes...at least for now)
    If your current active is slot b, then run:
    Code:
    fastboot --set-active=a
    Or, if your current active is slot a, then run:
    Code:
    fastboot --set-active=b
    And afterwards, run:
    Code:
    fastboot flash boot twrp-3.3.1-15-laurel_sprout-mauronofrio.img
    (of course that img file must be on the same path where you have adb and fastboot...)​
    8 - Reboot to TWRP:
    Code:
    fastboot reboot
    NOTE: Long press Vol+ button before hitting "ENTER" and leave it pressed until you see the Android One logo (just to force boot into recovery)​

    Just a heads up:
    Now we are on TWRP booted on the "previously inactive slot". The "previously active slot" continues unchanged. Nothing "bad" really happened until what we decide to do next. If we want, we can just make a TWRP backup of the current slot and nothing else. Afterwards, we could always reboot to bootloader, change to the "previously active slot" again and boot system. If we do this, we continue without TWRP and root but we would now have a TWRP backup of the system present on the "inactive slot". Anyway let's presume you really want to permanently install TWRP and ROOT your device....so let's continue.

    9 - While on TWRP, install twrp-3.3.1-15-laurel_sprout-mauronofrio-installer.zip
    Note that, by doing this, TWRP will be permanently installed into both slots. This means that, if someday, you want to revert to stock, you'll need to reflash stock boot.img on, at least, one of your slots.​
    10 - After installing TWRP zip, go to reboot menu, change to the active slot (the one you had on the beginning of these steps) and reboot to TWRP
    11 - After TWRP reboots, install Magisk installer zip
    12 - Finally, reboot to system
    13 - Enjoy

    Thank you @mauronofrio and Jyotiraditya Panda for your work on bringing TWRP to Mi A3 (laurel_sprout).

    I just hope you're able to fix USB OTG and SDCard bugs and, of course, make this TWRP official.

    Cheers!
    19
    Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.

    Code:
    #include <std_disclaimer.h>
    /*
     *
     * We are not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about features included in this ROM
     * before flashing it! YOU are choosing to make these modifications, and if
     * you point the finger at us for messing up your device, we will laugh at you.
     *
     */

    Features:
    - TWRP boots
    - TWRP seems has problems with external sdcard and otg
    - Magisk Flash works

    Install guide :
    Remember to use the appropriate .img version
    https://forum.xda-developers.com/showpost.php?p=80168528&postcount=16

    Other Install guide :
    1. Follow this guide to root your device
    2. Flash the TWRP installer like a magisk module
    3. Flashing the TWRP installer you will lose the root, so you will need to flash magisk again from magisk manager before reboot the device or you can reboot the device and flash magisk in twrp


    HOW TO UPDATE a ROM and KEEP TWRP and ROOT:
    Before all Disable all magisk modules for boths methods

    - Put rom.zip, twrp installer.zip and magisk.zip on your internal storage;
    - Flash Rom;
    - Flash TWRP Installer;
    - Flash magisk;
    - Reboot.

    If you want you can also update a stock rom from phone settings with local upgrade:
    - Update the Rom WITHOUT REBOOT;
    - Open Magisk Manager;
    - Menu/modules/+ button/select the twrp installer.zip and flash it;
    - Always in Magisk Manager, click on Install/Install/Direct Install;
    - Again in Magisk Manager, click on Install/Install/Inactive Slot;
    - Reboot.


    Tips:
    If you alread have a twrp flashed you can only flash the new installer zip or the new installation method to update your TWRP (remember to flash again magisk or your system will not boot).
    If you have some problems with backup, like 255 error or something similar please check this guide: https://forum.xda-developers.com/oneplus-6/how-to/255-error-twrp-backup-restore-999-t3801632
    For the Bacups use always "system_image" and "vendor_image" instead of "system" and "vendor".

    Download:
    TWRP 3.3.1-17 Unofficial by mauronofrio (Guide included in the link)


    Source code:
    https://github.com/mauronofrio/android_bootable_recovery
    https://github.com/mauronofrio/android_device_xiaomi_laurel_sprout
    Precompiled Stock Kernel

    Donations:



    Credits:

    Thanks to Jyotiraditya Panda for the help with the tree
    Thanks to @mdeejay for the hard testing

    Created 2019-08-31
    13
    So i decided to help @Nik001 to make a better TWRP and support this device in the better way, because i'm unable to follow also this device. His TWRP actualy is really stable and soon will be official.

    This is the new thread to follow: https://forum.xda-developers.com/mi-a3/development/recovery-unoffical-twrp-xiaomi-mi-a3-t3987759

    Moderator please close this thread
    11
    I decided to open again this thread and i decided to update the TWRP for android Q compatibility. I update the first post with a guide and a really similar guide can be found at the download link.

    TWRP 3.3.1-17 Unofficial by mauronofrio (Guide included in the link)
    5
    Hello friends,

    I've removed some posts with rude language and off topic discussion.
    Please keep in mind to discuss on topic and without offending others:)

    I recommend to read the FORUM RULES especially those:


    2.3 Flaming / Lack of respect: XDA is about sharing and this does not involve virtual yelling (flaming) or rudeness. Flaming or posting with a lack of respect is unacceptable. Treat new members in the manner in which you would like to have been treated when you were a new member. When dealing with any member, provide them with guidance, advice and instructions when you can, showing them respect and courtesy. Never post in a demanding, argumentative, disrespectful or self-righteous manner.

    2.4 Personal attacks, racial, political and / or religious discussions: XDA is a discussion forum about certain mobile phones. Mobile phones are not racial, political, religious or personally offensive and therefore, none of these types of discussions are permitted on XDA.




    Regards!

    strongst
    Forum Moderator