• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[RECOVERY][STABLE]Unoffical TWRP for Xiaomi Mi A3[laurel_sprout]

Search This thread

Nik001

Senior Member
Apr 6, 2015
351
1,221
Bangalore West
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.
 *
 */

Whats Working?
Everything is working
Can change Slot A/Slot B on twrp
SDcard and OTG working
Decryption of Data working
Flashing of roms work pie and even Q roms work.

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 or sdcard;
- Flash Rom;
- Flash TWRP Installer;
- Flash magisk(recommend to use Magisk v19.4);
- Reboot.

Download:
TWRP 3.3.1-2 Unofficial Installer by Nikesh Kataria
TWRP 3.3.1-2 Unofficial by Nikesh Kataria

Donations:



Credits:

Thanks to @mauronofrio for a great help to make a stable recovery
Thanks to @Typhus_ for hardcore testing
Thanks to @prakash78 for testing

Contributors
Nik001
Source Code: https://github.com/Nikesh001/android_device_xiaomi_laurel_sprout-twrp

Version Information
Status: Stable

Created 2019-10-21
 
Last edited:

RJ-

Member
Sep 11, 2019
25
11
Ahemdabad
Anyone tell how to flash twrp... proper commands

Please

---------- Post added at 10:44 PM ---------- Previous post was at 10:42 PM ----------

Is that tested anyone.
 

sekil

Senior Member
Jul 27, 2013
270
556
Stock fw 10.3.8 (global) not booting with this twrp - in 10.3.8 audio modules have strange dependence "saved_command_line" symbol from kernel. For loading this modules need patch kernel sources -
diff --git a/init/main.c b/init/main.c
index 6d1880f0b852..2106f54a7008 100644
--- a/init/main.c
+++ b/init/main.c
@@ -128,6 +128,7 @@ void (*__initdata late_time_init)(void);
char __initdata boot_command_line[COMMAND_LINE_SIZE];
/* Untouched saved command line (eg. for /proc) */
char *saved_command_line;
+EXPORT_SYMBOL_GPL(saved_command_line);
/* Command line for parameter parsing */
static char *static_command_line;
/* Command line for per-initcall parameter parsing */
 

Typhus_

Senior Member
Proper install method explained

Hello!

Please, @Nik001, update the OP with the install method that I'm going to describe next, ok?

It's just to avoid future complications (lost of Wi-Fi, sound, etc...) for "not that experienced users".

  1. Your bootloader must be unlocked. If it's not, then follow step 1 of the instructions provided HERE.
  2. Download TWRP zip file and copy it to your device (internal or external storage)
  3. Download TWRP img file and and store it, on the folder where you have adb and fastboot files, on your PC
  4. 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)
  5. When TWRP recovery boots, if you have a stock boot.img that matches the build on this "currently active" slot, flash it into boot partition. If you don't have, then just ignore this step...(it's not mandatory)
  6. Install the TWRP zip (always install the latest build available)
  7. 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)
  8. Reboot to System

Why do I suggest this?


By doing this method (which seems more complicated but, trust me, it's how it should be done) we will flash TWRP img into the "inactive" slot, thus, not breaking anything on the "currently active" slot. When TWRP boots, it will patch both slots boot ramdisks. But the thing is, on the "currently active" slot (the one inactive on the beginning) it will patch the TWRP img but, on the "currently inactive" slot (the one that was active on the beginning), it will patch the stock boot.img, thus, no bug will happen that usually appears when a user accidentally flashes the wrong boot.img into boot partition.

On the other hand, if we have a stock boot.img, that matches the build on the "inactive" slot, we could flash it into boot partition before installing the zip that patches ramdisk. By doing this we will patch both stock boot.img present on both slots (instead of patching TWRP img and boot.img).


Cheers!
 
Last edited:

Typhus_

Senior Member
The method Typhus shared works 100% of the times; however I must say, I don't use it, just preference; as it follows, instead of flashing into the inactive slot, I flash the pre_patched boot image into the active slot, this of course will mostly like break network and other components on the ROM, if you mismatch image versions; however, if you flash the stock boot image (using install button, inside TWRP, tapping into 'images', select your stock boot.img) and then patch it using the TWRP Installer right after, you will be using the right image, so no problem will occur, and mostly important, no slot change is needed. Both methods works, choose what you prefer, just read it carefully and I repeat, always use the same boot image from your firmware, a lot of confusion comes to the fact, that when you uses TWRP.img or Magisk.img they aren't boot images, but they are; A/B partition scheme doesn't use some individual partitions anymore, as /recovery, thus is extremely important to patch your boot image, where the recovery, kernel and other components now lives.

So, in other words, your method is this (correct me if I'm wrong):

  1. Download TWRP zip file and copy it to your device (internal or external storage)
  2. Download TWRP img file and and store it, on the folder where you have adb and fastboot files, on your PC
  3. Open a cmd line and execute these commands (beeing on that folder, of course):
    adb devices (to make sure your device is detected)
    adb reboot bootloader (to reboot into fastboot mode)
    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)
  4. Flash stock boot.img that matches your current build using TWRP install Image feature, into boot partition
  5. Install the TWRP zip (always install the latest build available)
  6. Reboot to System

Is that it?

If it is, the only downside I see is that, when a new version comes out (through OTA for example), you'll first need to get your hands on a stock boot.img that matches the new build.

Right?

Cheers!
 

bibekmufc

Member
Nov 19, 2018
35
14
So, in other words, your method is this (correct me if I'm wrong):

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 (beeing on that folder, of course):
adb devices (to make sure your device is detected)
adb reboot bootloader (to reboot into fastboot mode)
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)
Flash stock boot.img that matches your current build using TWRP install Image feature, into boot partition
Install the TWRP zip (always install the latest build available)
Reboot to System


Is that it?

If it is, the only downside I see is that, when a new version comes out (through OTA for example), you'll first need to get your hands on a stock boot.img that matches the new build.

Right?

Cheers!


As someone who just wants to root his phone with TWRP and few magisk modules, and not miss out on OTAs, seeing these many methods is so confusing and overwhelming ?
 

RJ-

Member
Sep 11, 2019
25
11
Ahemdabad
After flashing recovery from pc..then go for fastboot reboot from minimal adb and " volume+ key" i saw error in my phone "no command"
 

Attachments

  • images.jpeg
    images.jpeg
    8.2 KB · Views: 388

bibekmufc

Member
Nov 19, 2018
35
14
Use the method Typhus explained, it's more simple in the long run; there will be no need to manually flash stock boot image afterwards, since Magisk will have done a proper backup, thus, you will only need to use 'restore image' feature inside Magisk Manager; When taking an OTA, make sure to read the complete Magisk documentation before proceeding:

https://topjohnwu.github.io/Magisk/tutorials.html

Thank you! I will do that. But one more thing I'd like to ask. Do you know where I could find the boot image for 10.3.8.0.PFQMIXM? I checked git for dumps, but I couldn't find the boot image for this one.
 

Typhus_

Senior Member
What about flashing this on an already rooted phone with Magisk modules and the previously available TWRP by mauronofrio? Any complicated procedures? Is slot changing etc still necessary?

In that case, obviously, simply flash the new TWRP zip.

The install method I've explained is for everyone who never had TWRP, or Magisk patched boot, installed on the device.
 
  • Like
Reactions: Makishima

garylawwd

Forum Moderator
Staff member
What about flashing this on an already rooted phone with Magisk modules and the previously available TWRP by mauronofrio? Any complicated procedures? Is slot changing etc still necessary?
Just flash the zip in twrp that you have.
That's what I did and it worked no problem on pe ROM
 
  • Like
Reactions: Makishima

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    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.
     *
     */

    Whats Working?
    Everything is working
    Can change Slot A/Slot B on twrp
    SDcard and OTG working
    Decryption of Data working
    Flashing of roms work pie and even Q roms work.

    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 or sdcard;
    - Flash Rom;
    - Flash TWRP Installer;
    - Flash magisk(recommend to use Magisk v19.4);
    - Reboot.

    Download:
    TWRP 3.3.1-2 Unofficial Installer by Nikesh Kataria
    TWRP 3.3.1-2 Unofficial by Nikesh Kataria

    Donations:



    Credits:

    Thanks to @mauronofrio for a great help to make a stable recovery
    Thanks to @Typhus_ for hardcore testing
    Thanks to @prakash78 for testing

    Contributors
    Nik001
    Source Code: https://github.com/Nikesh001/android_device_xiaomi_laurel_sprout-twrp

    Version Information
    Status: Stable

    Created 2019-10-21
    31
    Proper install method explained

    Hello!

    Please, @Nik001, update the OP with the install method that I'm going to describe next, ok?

    It's just to avoid future complications (lost of Wi-Fi, sound, etc...) for "not that experienced users".

    1. Your bootloader must be unlocked. If it's not, then follow step 1 of the instructions provided HERE.
    2. Download TWRP zip file and copy it to your device (internal or external storage)
    3. Download TWRP img file and and store it, on the folder where you have adb and fastboot files, on your PC
    4. 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)
    5. When TWRP recovery boots, if you have a stock boot.img that matches the build on this "currently active" slot, flash it into boot partition. If you don't have, then just ignore this step...(it's not mandatory)
    6. Install the TWRP zip (always install the latest build available)
    7. 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)
    8. Reboot to System

    Why do I suggest this?


    By doing this method (which seems more complicated but, trust me, it's how it should be done) we will flash TWRP img into the "inactive" slot, thus, not breaking anything on the "currently active" slot. When TWRP boots, it will patch both slots boot ramdisks. But the thing is, on the "currently active" slot (the one inactive on the beginning) it will patch the TWRP img but, on the "currently inactive" slot (the one that was active on the beginning), it will patch the stock boot.img, thus, no bug will happen that usually appears when a user accidentally flashes the wrong boot.img into boot partition.

    On the other hand, if we have a stock boot.img, that matches the build on the "inactive" slot, we could flash it into boot partition before installing the zip that patches ramdisk. By doing this we will patch both stock boot.img present on both slots (instead of patching TWRP img and boot.img).


    Cheers!
    6
    This man -> @Nik001 deserves a beer!!!

    Thank you for delivering us a fully working TWRP for laurel_sprout!

    Cheers!