[RECOVERY][3.3.1-17][laurel_sprout]Unofficial TWRP recovery for Xiaomi Mi A3 (Test) - Xiaomi Mi A3 ROMs, Kernels, Recoveries, & Other De

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

Bug
https://imgur.com/Y83Xhw2installed this TWRP but I'm with this bug, there are a way to fix this?

mauronofrio said:
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.
Features:
- TWRP boots
- TWRP seems has problems with external sdcard and otg
- Magisk Flash works
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-15 Unofficial by mauronofrio
TWRP 3.3.1-15 Unofficial Installer by mauronofrio
Source code:
https://github.com/omnirom/android_bootable_recovery
https://github.com/mauronofrio/android_device_xiaomi_laurel_sprout
Precompiled Stock Kernel
Donations:
Credits:
Created 2019-08-31
Click to expand...
Click to collapse
Screenshots please

Rajendran Rasa said:
Screenshots please
Click to expand...
Click to collapse
For what, have you never seen TWRP?

nelinthon said:
https://imgur.com/Y83Xhw2installed this TWRP but I'm with this bug, there are a way to fix this?
Click to expand...
Click to collapse
The TWRP asked you for pattern or password when it started?

mauronofrio said:
The TWRP asked you for pattern or password when it started?
Click to expand...
Click to collapse
Can I directly flash twrp in fastboot??
fastboot flash recovery twrp.img
Because some mi devices won't boot to system after entering twrp

Thanks for your work! Is a big start for our phone!
Grazie dall'Italia!

mauronofrio said:
The TWRP asked you for pattern or password when it started?
Click to expand...
Click to collapse
yes

Rajendran Rasa said:
Can I directly flash twrp in fastboot??
fastboot flash recovery twrp.img
Because some mi devices won't boot to system after entering twrp
Click to expand...
Click to collapse
Recovery partition doesn't exist, so you can't flash it. The installation guide is explained in the first post

mauronofrio said:
The TWRP asked you for pattern or password when it started?
Click to expand...
Click to collapse
I fix it, just put the device password, so easy hahaha

nelinthon said:
I fix it, just put the device password, so easy hahaha
Click to expand...
Click to collapse
Yes that is for decryption

mauronofrio said:
Recovery partition doesn't exist, so you can't flash it. The installation guide is explained in the first post
Click to expand...
Click to collapse
That's not a guide
Explain with step 1,2,3
I have downloaded both the files given in op
Then how to flash twrp?? In fastboot
after flashing twrp do I need anything to flash for booting stock ROM
---------- Post added at 04:12 PM ---------- Previous post was at 04:07 PM ----------
Give the detailed step-by-step instructions for flashing twrp with usb drivers and adb fastboot files

Another problem
I tried to flash a GSI rom and STOCK rom but appears an error: UPDATER PROCESS ENDED WITH SIGNAL 4

Pls for cc9e also twrp

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!

rom.zip
where is rom.zip

I wonder if it can work on Mi CC 9e......

Crosstyan said:
I wonder if it can work on Mi CC 9e......
Click to expand...
Click to collapse
This will not work on Mi CC 9e

Uninstall method explained (aka revert to stock)
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
Uninstall all Magisk Modules you have installed (do the same for Substratum themes, if any)
Reboot to TWRP
While on TWRP, Flash Magisk Uninstaller Zip
Reboot to bootloader
Code:
fastboot getvar current-slot
(just to make sure which slot is currently active)
Code:
fastboot flash boot boot.img
(from your stock ROM build type)
Code:
fastboot set_active [B]b[/B]
(or a, if you were on slot b)
Code:
fastboot erase boot
Code:
fastboot erase system
Code:
fastboot erase vendor
Code:
fastboot flash vendor vendor.img
(from your stock ROM build type)
Code:
fastboot flash system system.img
(from your stock ROM build type)
Code:
fastboot flash boot boot.img
(from your stock ROM build type)
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

There's a way to relock the bootloader???

Related

* * * [Pixel 2 XL] - UPDATE Monthly Factory Image / UPGRADE To New OS * * *

WHO IS THIS GUIDE FOR:
Anyone updating factory images within the same OS version (10 to 10)
Anyone upgrading from one OS to another (9x to Android 10)
Below is a QUICK REFERENCE guide for those who have done this before, and a DETAILED STEP BY STEP guide for the first or second timer who needs each and every step outlined. Links to all required files are also provided (make sure you are selecting the latest version)
UPDATE TO THE LATEST FACTORY IMAGE . . . UPGRADE TO THE NEXT OS. . .
PREP WORK:
* Unlocked bootloader. (*performing critical_unlock only required with bootloader versions PRIOR to TMZ20a) read it here.
* Latest SDK Platform Tools found here.
* USB 2.0 & 3.0 cables available (trust me)
* Remove screen lock security before starting
* Remove all substratum overlays
*Download and extract the latest Taimen factory image (place the second extracted folder in Platform Tools folder)
CLEAN FLASH (wipe everything) or DIRTY FLASH (keep data)
Decide now whether you want a fresh OS that will restore your device to factory setup OR if you want to flash the latest factory image but keep your data.
For a clean flash: leave the FLASH-ALL file intact, change nothing.
To retain your data: EDIT the FLASH-ALL file and REMOVE the -w near the end of the script. Save the file and reopen it to ensure the -w has been removed,
When UPGRADING from one OS to another I reco a CLEAN FLASH (leave the -w intact)
Place these files on your sdcard (either before dirty flash or from PC after clean install):
* Latest TWRP.ZIP
* Your preferred customer kernel zip, I use ElementalX kernel
* Magisk uninstall instructions In the event you need to manually uninstall and reinstall MM
* Latest Magisk.zip
* Latest Magisk Manager APK
NOTE: On Android 10, when flashing TWRP Installer, kernels, magisk , etc. in TWRP, ignore the warning "FAILED TO MOUNT '/system' (invalid argument) this is a known issue with TWRP + 10 but affects nothing :good:
QUICK REFERENCE GUIDE for updating/upgrading Pixel 2 XL:
Once you verify 'fastboot devices' on command prompt
Type flash-all to install factory image (allow it to install, and boot into system)
Hold vol down and power button to boot into bootloader
Fastboot into twrp 3.3.0-0.IMG
Flash the twrp installer 3.3.0-0.ZIP,
Flash custom kernel, I use flar2's ElementalX Kernel. SELECT THE CORRECT 9X OR ANDROID 10 KERNEL
Let the system boot up to verify.
Reboot back into twrp and flash latest magisk
Reboot to system
Profit
DETAILED STEP BY STEP GUIDE for updating monthly factory images, or upgrading to the next OS (ie: 9x to 10x)
I reco a CLEAN FLASH (leave the -w intact) when jumping from one OS to a new one (not necessary when doing monthly factory updates within the same OS version)
Requirements:
*Unlocked bootloader and Critical_unlock* completed. (*critical_unlock required with bootloader versions PRIOR to TMZ20a) read it here.
*Latest SDK PlatformTools found here
*USB 2.0 & 3.0 cables available (trust me)
These files on your sdcard:
* Latest TWRP.ZIP
* Your preferred Custom Kernel, I use Elemental X Kernel
* Magisk uninstall instructions In the event you need to manually uninstall and reinstall MM
* Latest Magisk.zip
* Latest Magisk Manager APK
These files in your Platform Tools Folder:
* Latest factory image (MAKE SURE YOU DL THE CORRECT DEVICE IMAGE :good: )
* Latest TWRP.IMG
1. Make backup, move to PC (because you never know)
2. Disable all security; patterns, pins, etc.
3. In Developer Options, make sure USB DEBUGGING is on
4. Connect device to PC, verify fastboot is working type; fastboot devices (should see your device's serial number)
5. Fastboot latest factory image (To KEEP internal storage intact, edit and remove -w in "flash-all.bat" file and SAVE, to wipe entire device, leave flash-all unedited)
Type: FLASH-ALL (hit enter) Allow the OS to reboot and settle for a minute *REMEMBER LEAVING THE -W INTACT WILL WIPE YOUR DEVICE*
6. Reboot into BOOTLOADER, in CMD screen Type: fastboot boot <twrpxxx.img name> to boot into Latest TWRP.IMG
7. Once in TWRP, install Latest TWRP.ZIP from sdcard
8. Reboot back into Recovery
9. Install compatible custom kernel, I use flar2's ElementalX Kernel.
10. Reboot back into Recovery
11. Reboot into System, allow OS to settle for a few minutes
12. Boot into Recovery
13. Install Latest Magisk.zip
14. Reboot into System
15. Profit
Troubleshooting Tips & Other Information
Click here for * * * BASIC FASTBOOT/ADB TROUBLE SHOOTING FOR THE 2XL * * *
If you get stuck at the G screen, or bootloop into TWRP, try these steps:
-Perform a hard reboot (long press the power button) or
-Get back to TWRP (whether by booting into it from fastboot, or rebooting into bootloader -long press power & vol down- then boot into recovery) and reinstall the Magisk Uninstaller in TWRP a few times.
- If you are bootlooping into TWRP with Magisk installed, READ THIS!
- Safety Net message in Magisk "The Response Is Invalid" is a known issue[/URL] ... Be patient
View attachment 4572738
Make sure you have all the correct and/or latest versions of SDK Tools, factory image, TWRP.img and TWRP.zip, and Magisk
Note: as a matter of superstition, I reboot back into recovery each time after installing TWRP, cust kernel, and magisk, prior to booting into system. It is NOT required, but it works
Again, HUGE thanks to @Badger50 for his invaluable input
Az Biker said:
A lot of users have had success upgrading from Oreo to Pie and there are several tutorial / guide posts located in different threads, so I figured I'd centralize instructions in a Quick Reference Thread, that includes all needed file links and an easy to follow step by step.
Please feel free to make any suggestions to simplify or make this more accurate.
Requirements:
*Unlocked bootloader and Critical_unlock completed.
*Latest SDK Tools found here
*USB 2.0 & 3.0 cables available (trust me)
These files on your sdcard:
* TWRP 3.2.2-0.ZIP
*Flash kernel 3.0
* magisk uninstaller
*magisk zip 1674
* MM 5.8.3 APK
These files in your Platform Tools Folder:
* 9.0 factory image
*TWRP 3.2.2-0.IMG
1. Make backup, move to PC (because you never know)
2. Disable all security; patterns, pins, etc.
3. In Developer Options, make sure USB DEBUGGING is on
4. Verify fastboot is working type; fastboot devices (should see your device's serial number)
5. Fastboot 9.0 factory image(To KEEP internal storage intact, remove -w in "flash-all.bat" file and SAVE, to wipe entire device, leave flash-all unedited)
6. Type: fastboot boot <twrpxxx.img name> to boot into TWRP 3.2.2-0.IMG
7. Once in TWRP, install TWRP.ZIP on sdcard
8. Reboot back into Recovery, and install the magisk uninstaller in twrp,
9. Reboot back into Recovery and install Flash kernel 3.0
10. Reboot back into Recovery
11. Reboot into System, allow OS to settle for a few minutes
12. Install MM 5.8.3 APK
13. Reboot into Recovery
14. Install magisk zip 1674,
15. Reboot back into Recovery
16. Reboot into System
17. Profit
Note: as a matter of superstition, I reboot back into recovery each time after installing TWRP, cust kernel, and magisk, prior to booting into system. It is NOT required, but it works
Thanks to @Badger50 for figuring out the right steps in this process!
Click to expand...
Click to collapse
Well done my brother!! :good::good:
Badger50 said:
Well done my brother!! :good::good:
Click to expand...
Click to collapse
I use unlock bootloader normal.
I was done follow your step but it's boot stuck google logo after flash magisk(16.74).
newyesor said:
I use unlock bootloader normal.
I was done follow your step but it's boot stuck google logo after flash magisk(16.74).
Click to expand...
Click to collapse
Sometimes it takes 5 minutes or so on first boot. If it doesn't work, do a hard restart a few times. If that doesn't work, flash magisk again in twrp.
You use unlock bootloader normal??
Badger50 said:
Sometimes it takes 5 minutes or so on first boot. If it doesn't work, do a hard restart a few times. If that doesn't work, flash magisk again in twrp.
You use unlock bootloader normal??
Click to expand...
Click to collapse
I use normal unlock bootloader.
I wait devices boot around 5 minutes and it 's reboot in to twrp recovery.
newyesor said:
I use normal unlock bootloader.
I wait devices boot around 5 minutes and it 's reboot in to twrp recovery.
Click to expand...
Click to collapse
So your bootloader _critical partition isn't unlocked?? Which can't be right either since you've been able to boot fastboot the update to P. Guess I just don't know what your trying to say.
Badger50 said:
So your bootloader _critical partition isn't unlocked?? Which can't be right either since you've been able to boot fastboot the update to P. Guess I just don't know what your trying to say.
Click to expand...
Click to collapse
I use this command for flash unlock bootloader.
fastboot flashing unlock
newyesor said:
I use this command for flash unlock bootloader.
fastboot flashing unlock
Click to expand...
Click to collapse
Have you ever ran fastboot flashing unlock_critical..?
Have you actually booted into the 9.0.OS yet?
Badger50 said:
Have you ever ran fastboot flashing unlock_critical..?
Have you actually booted into the 9.0.OS yet?
Click to expand...
Click to collapse
I have never ran fastboot flashing unlock_critical.
Yes,My devices is base on android P and I was booted into the 9.0.OS.
newyesor said:
I use this command for flash unlock bootloader.
fastboot flashing unlock
Click to expand...
Click to collapse
If you flashed the factory image with no issues, then you must have completed critical_unlock as well, otherwise the new bootloader shouldn't have taken (as far as I understand).
I'd start from scratch again, and make sure you follow the process exactly. Many users have used this with no issue, so maybe you missed something? The first time I flashed the factory image to my 6P (my backup) I totally skipped flashing the boot.img, and wondered why it wouldn't boot
Kudos, just what I needed to update!
newyesor said:
I have never ran fastboot flashing unlock_critical.
Yes,My devices is base on android P and I was booted into the 9.0.OS.
Click to expand...
Click to collapse
Have you flashed the magisk uninstaller as well? Why are you showing magisk 16.0?
Badger50 said:
Have you flashed the magisk uninstaller as well? Why are you showing magisk 16.0?
Click to expand...
Click to collapse
Yes,i was flashed the magisk uninstaller as well.
I try to root with magisk on my devices.
I try to flash patch boot for root without twrp but it's not work.
I try to flash magisk follow you but it's not work.
Is flashing the kernel mandatory?
newyesor said:
Yes,i was flashed the magisk uninstaller as well.
I try to root with magisk on my devices.
I try to flash patch boot for root without twrp but it's not work.
I try to flash magisk follow you but it's not work.
Click to expand...
Click to collapse
Something just seems fishy to me. I've never heard of anyone not unlocking _critical, and being able to fastboot the factory image. However, it seems that you have somehow. All I can suggest is to fastboot the 9.0 again to both slots, and let it boot up each time.
Then fastboot into twrp, flash the installer zip, and let it boot up. Then go back to twrp, flash magisk uninstaller zip, then flash custom kernel, and let it boot up. Then go back to twrp, and flash magisk 1674 again.
If none of that works, I'd unlock _critical, which will wipe your phone, and then start over.
aznriceballman said:
Is flashing the kernel mandatory?
Click to expand...
Click to collapse
Not mandatory, but it keeps TWRP touch screen working among other things...
Just wanted to say thanks for this!
I didn't have time to update from DP5 yesterday, but I guess that was a good thing because now there's this guide, and it worked perfectly. Upgraded from DP5/flash 2.44 and who knows what Magisk version to all the latest and greatest in no time at all.
Thanks!
Badger50 said:
Something just seems fishy to me. I've never heard of anyone not unlocking _critical, and being able to fastboot the factory image. However, it seems that you have somehow. All I can suggest is to fastboot the 9.0 again to both slots, and let it boot up each time.
Then fastboot into twrp, flash the installer zip, and let it boot up. Then go back to twrp, flash magisk uninstaller zip, then flash custom kernel, and let it boot up. Then go back to twrp, and flash magisk 1674 again.
If none of that works, I'd unlock _critical, which will wipe your phone, and then start over.
Click to expand...
Click to collapse
im having an issue, i followed all instructions and got booted up an everything but when i flash twrp img it stays stuck on the twrp logo, flashed the one mentioned in o.p and the newest as well to remove any doubts, but no go. Any suggestions?
shooterlgk said:
im having an issue, i followed all instructions and got booted up an everything but when i flash twrp img it stays stuck on the twrp logo, flashed the one mentioned in o.p and the newest as well to remove any doubts, but no go. Any suggestions?
Click to expand...
Click to collapse
Do you have screen lock disabled?
Badger50 said:
Do you have screen lock disabled?
Click to expand...
Click to collapse
Yes sir

[GUIDE] Flashing and updating custom ROMs

Flashing for Dummies
In this guide we'll go over how to flash custom ROMs with root and TWRP in addition to updating
this guide will always be updated
Read the ENTIRE guide before you start
Code:
Your warranty is now void.
We are not responsible for bricked devices, bootloop... Please
do some research if you have any concerns about mods
included in these GUIDES before using them! YOU are choosing to
make these modifications.
things to keep in mind:
1- when you flash a ROM through TWRP, it will flash to your inactive slot, that's why you need to switch slot after flashing it and then flash everything else, think of it like an OTA update except you need to switch active slot yourself
2- when you change your active slot in TWRP, it will only change after you reboot, your active slot will always be the one you're currently booted on
3- the order of flashing anything that modifies boot is
1) TWRP
2) custom kernel
3) noverity
4)Magisk
if you're not sure, flash stock boot of your rom and do it again, flashing TWRP will break Magisk, flashing a custom kernel will break magisk, flashing TWRP after flashing a custom kernel will most likely get you a bootloop
Before you begin
you need to unlock your bootloader first https://forum.xda-developers.com/mi-a2/how-to/unlock-bootloader-n-root-magisk-easy-t3856800
It is no longer required to be on stock Oreo before flashing, but I currently still recommend you do so as there might be some minor bugs on some custom roms, but otherwise everything will work just fine.
get latest platform-tools if you haven't already, using an older one WILL result in errors
platform-tools
extract it and open the folder
hold shift then right click on an empty space then click "open command window here"
if you're on windows 10, doing that will open power shell instead, inside power shell, type "cmd" and press enter, use cmd for everything below
if you're coming from stock, you need to do this first
type the following command (data and files will be wiped)
Code:
fastboot -w
fastboot set_active b
Notes:
Pixel Experience includes Gapps, do not flash them after the rom
many roms include TWRP, such as Havoc, AICP and many others, check ROM thread first, if it includes it then don't flash TWRP.
Flashing custom ROMs and other stuff
download latest TWRP img and zip from https://twrp.me/xiaomi/xiaomimia2.html and place it in the same folder you extracted platform-tools to
NOTE: if you are on stock then use TWRP 3.2.3 img, not 3.3
note: if you're having issues with official TWRP, I've built an unofficial one with F2FS support which you can try here
be careful if you switch to F2FS, it will only work with a recovery that supports it and a ROM that supports it, no stock.
rename the img to twrp.img
in cmd, type
Code:
fastboot boot twrp.img
if you get a bootloop, force shutdown (power + volume down) and try again
using MTP copy the files needed to flash to your phone
if MTP doesn't work, you have the following options
1) wipe data from TWRP, try again
2) advanced > file manager, go to /data/media , if there is nothing in there, create a new folder called 0 there by going to Advanced > Terminal and typing the following commands
Code:
cd /data/media
mkdir 0
then reboot to bootloader and try again
3) try using PBRP for MTP, then go back to TWRP PBRP
4) use adb sideload:
in TWRP, go to Advanced > adb sideload, then on PC
Code:
adb sideload file.zip
do that for each thing you want to flash
(you can type adb sideload then drag and drop the file you want to flash onto cmd, make sure there's a space between sideload and the file you want to flash)
5) use adb push. follow methode 2 to create the folder, then in cmd, type this command
Code:
adb push file.zip /data/media/0/
do that for each file you need
after you got the files on your phone, it's time to flash
remember that when flashing a ROM, it will flash to your inactive slot, in this guide I'll assume your active slot is B, use "fastboot set_active b" in fastboot if you'd like to follow along
First go to wipe > advanced and select System and Data then wipe, then you can start flashing
1- flash the ROM zip
2- flash TWRP zip, so you can boot to TWRP without the need of a PC (ONLY if the ROM doesn't include it already)
3- switch your active slot (to A if you are on B and to B if you were on A)
4- reboot recovery
5- flash Gapps if required by the ROM you're flashing, Opengapps nano is recommended, you can get it here http://Opengapps.org
6- (optional) flash a custom kernel if desired/needed
7- (optional) flash DM-VERITY & FORCEENCRYPT DISABLER zip , this will disable DM verity and encryption in vendor, this is not required by most custom ROMs as they will disable encryption anyway, it is most useful on stock, and in the possibility that the ROM you're flashing does not disable encryption
8- flash Magisk
9- reboot to system
IMPORTANT, if you get an error while flashing ROM zip, do the following
use latest official TWRP, if you're already using it, then the ROM you're flashing is one of the older ROMs
previously, ROMs and TWRP used Jasmine as a codename for our device, while the real codename is Jasmine_sprout, this caused some issues, newer ROMs and TWRP now use the correct codename, but that means new TWRP can not flash older ROMs, and so you will need some simple modifications to the ROM zip:
1- open the ZIP using WinRAR on PC or X-plore on phone
2- go to META-INF/com/android/metadata and open it as text
3- on the last line, edit 'pre-device=jasmine' to 'pre-device=jasmine_sprout'
4- save it and try flashing again
Switching between custom ROMs
follow the same flashing instructions, you can boot directly to TWRP by holding power + volume up, wipe data and system first then flash ROM and the rest.
Updating Custom ROMs
For OFFICIAL ROMs which support A/B OTA it's very easy
1- once you get a notification that an update is available, download and install with the system updater but don't reboot (If the ROM includes TWRP then don't do any of the following steps, just reboot)
2- go to Magisk, Downloads, search for "TWRP A/B Retention Script" and install it
3- on the main Magisk page, click install > install > Install to Inactive Slot (After OTA)
4- once Magisk finishes, reboot, you will now be on the opposite slot with both Magisk and TWRP installed.
for Unofficial ROMs with no OTA or Official ROMs that don't support A/B OTA, you'll need to use TWRP, do not wipe anything:
1- boot to TWRP
2- flash the ROM zip
3- flash TWRP zip (ONLY IF the ROM doesn't include TWRP)
4- switch your active slot (to A if you are on B and to B if you were on A)
5- reboot recovery
6- flash Gapps if required by the ROM you're flashing, Opengapps nano is recommended, you can get it here http://Opengapps.org
7- (optional) flash a custom kernel if desired/needed
8- (optional) flash DM-VERITY & FORCEENCRYPT DISABLER zip , this will disable DM verity and encryption in vendor, this is not required by most custom ROMs as they will disable encryption anyway, it is most useful on stock, and in the possibility that the ROM you're flashing does not disable encryption
9- flash Magisk
10- reboot to system
Very good and very well detailed guide. This guide will be useful to those who are not so familiar with Flashing ROMs especially in our device with partitions.
Thank you for making this, as many users were asking this thing. Keep it up!
does rebooting to twrp gets stuck on twrp logo after flashing twrp zip?
its been an issue on stock or maybe i have been doing to wrong...
after wipe commands and setting active slot b,
i reboot into fastboot boot twrp.img and flash the rom and Im getting mount failed /system
is that normal?
Edit: NVM, it is normal. I successfully flashed Carbon ROM in my device. Thanks for this awesome guide.
This is great thank you. Going to try it once I get bored of stock rom.
@AxL said:
after wipe commands and setting active slot b,
i reboot into fastboot boot twrp.img and flash the rom and Im getting mount failed /system
is that normal?
Edit: NVM, it is normal. I successfully flashed Carbon ROM in my device. Thanks for this awesome guide.
Click to expand...
Click to collapse
Yes it's normal because you wiped system
levai_spencer said:
does rebooting to twrp gets stuck on twrp logo after flashing twrp zip?
its been an issue on stock or maybe i have been doing to wrong...
Click to expand...
Click to collapse
twrp.zip has a bootloop for TWRP when it is flash
Candy_Pineapple said:
twrp.zip has a bootloop for TWRP when it is flash
Click to expand...
Click to collapse
No, if you follow the instructions it works
coming from stock to pE I followed exacty the steps.
then flash CR. Here what Ive done
i-wipe cache,data,system for both partition using twrp
ii- set partition to B in twrp and flash zip
iii- set partition to A in twrp and reboot into bootloop
iv- set partition to B in twrp and reboot successfully
so what partition is my CR now?
which partition should i install gapps,kernel and magisk?
Thanks.
notJimz said:
coming from stock to pE I followed exacty the steps.
then flash CR. Here what Ive done
i-wipe cache,data,system for both partition using twrp
ii- set partition to B in twrp and flash zip
iii- set partition to A in twrp and reboot into bootloop
iv- set partition to B in twrp and reboot successfully
so what partition is my CR now?
which partition should i install gapps,kernel and magisk?
Thanks.
Click to expand...
Click to collapse
It's in B, because you didn't reboot after switching slot initially in twrp, stay in B and boot recovery then flash Gapps and the rest
Nebrassy said:
It's in B, because you didn't reboot after switching slot initially in twrp, stay in B and boot recovery then flash Gapps and the rest
Click to expand...
Click to collapse
You are right. I miss the first bl reboot.
I follow the step back and reboot after switch partition.
Only now i got the concept for A/B flashing. And my os in A now.
Thanks for the guide. Really helpful.
notJimz said:
You are right. I miss the first bl reboot.
I follow the step back and reboot after switch partition.
Only now i got the concept for A/B flashing. And my os in A now.
Thanks for the guide. Really helpful.
Click to expand...
Click to collapse
No prob, keep connected and click the tx button
Matteo (AIO Project Founder)
Hello,
after make adb push file.zip /data/media/0
I receive the next message
adb: error: failed to get feature set: no devices/emulators found
Please advice.
Thanks
Roviva said:
Hello,
after make adb push file.zip /data/media/0
I receive the next message
adb: error: failed to get feature set: no devices/emulators found
Please advice.
Thanks
Click to expand...
Click to collapse
What's the output of adb devices?
Nebrassy said:
What's the output of adb devices?
Click to expand...
Click to collapse
I entered in fastboot mode,:
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>.\adb devices
List of devices attached
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>
If I enter the command "adb devices" in normal mode (no fastboot) appear:
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>adb devices
List of devices attached
a341410 device
Roviva said:
I entered in fastboot mode,:
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>.\adb devices
List of devices attached
C:\Users\DELL\AppData\Local\Android\Sdk\platform-tools>
Click to expand...
Click to collapse
Adb devices
While in twrp, adb won't work while in fastboot, follow the guide carefully
Nebrassy said:
Adb devices
While in twrp, adb won't work while in fastboot, follow the guide carefully
Click to expand...
Click to collapse
Hello,
In your guide I dont understand the next part:
using MTP copy the files needed to flash to your phone
if MTP doesn't work, you have the following options
1) wipe data from TWRP, try again
If I made the step 1 above: I enter in the TWRP, select wipe, then, select wipe, advance wipe, select data and then swipe to wipe. After this reboot system, the telephone start but in normal mode, like restored.
2) advanced > file manager, go to /data/media , if there is nothing in there, create a new folder called 0 there by going to Advanced > Terminal and typing the following commands
I follow the step 2, in data/media appear a folder TWRP then i dont created a folder called 0
Then I go to advanced >> adb sideload and in the pc i wrote "adb sideload twrp.zip.
You write file.zip, I dont understand what is this file?
I dont understand what do you mean in the step 3: "try using PBRP for MTP, then go back to TWRP PBRP"
Code:
cd /data/media
mkdir 0
then reboot to bootloader and try again
3) try using PBRP for MTP, then go back to TWRP PBRP
4) use adb sideload:
in TWRP, go to Advanced > adb sideload, then on PC
Code:
adb sideload file.zip
do that for each thing you want to flash
(you can type adb sideload then drag and drop the file you want to flash onto cmd, make sure there's a space between sideload and the file you want to flash)
5) use adb push. follow methode 2 to create the folder, then in cmd, type this command
Code:
adb push file.zip /data/media/0/
do that for each file you need
Roviva said:
Hello,
In your guide I dont understand the next part:
using MTP copy the files needed to flash to your phone
if MTP doesn't work, you have the following options
1) wipe data from TWRP, try again
2) advanced > file manager, go to /data/media , if there is nothing in there, create a new folder called 0 there by going to Advanced > Terminal and typing the following commands
I follow the step 2, in data/media appear a folder TWRP then i dont created a folder called 0
Then I go to advanced >> adb sideload and in the pc i wrote "adb sideload twrp.zip.
You write file.zip, I dont understand what is this file?
I dont understand what do you mean in the step 3: "try using PBRP for MTP, then go back to TWRP PBRP"
Code:
cd /data/media
mkdir 0
then reboot to bootloader and try again
3) try using PBRP for MTP, then go back to TWRP PBRP
4) use adb sideload:
in TWRP, go to Advanced > adb sideload, then on PC
Code:
adb sideload file.zip
do that for each thing you want to flash
(you can type adb sideload then drag and drop the file you want to flash onto cmd, make sure there's a space between sideload and the file you want to flash)
5) use adb push. follow methode 2 to create the folder, then in cmd, type this command
Code:
adb push file.zip /data/media/0/
do that for each file you need
Click to expand...
Click to collapse
File.zip, as in the file you want to copy, you change that to the name of the file you want to copy
PBRP is another recovery, you can try booting it if twrp doesn't work to copy
Nebrassy said:
File.zip, as in the file you want to copy, you change that to the name of the file you want to copy
PBRP is another recovery, you can try booting it if twrp doesn't work to copy
Click to expand...
Click to collapse
hello,
I dont know how to follow:
flash the ROM zip
2- flash TWRP zip, so you can boot to TWRP without the need of a PC
3- switch your active slot (to A if you are on B and to B if you were on A)
4- reboot recovery
I wiped data and storage then I press back.
I flashed the PBRP that I pushed to data/media/TWRP
After flash I returned to the menu of PBRP
I switched to A
When I reboot, a warning message that "NO OS SYSTEM IS INSTALLED" appear.
I reboot to recovery but after this, the telephone does not restart. the screen "androidone" appear and dont advance...
How can I install the PBRP and magisk?
I succesfull push the files to the telephone but when flash the PBRP I cannot follow......
Roviva said:
hello,
I dont know how to follow:
flash the ROM zip
2- flash TWRP zip, so you can boot to TWRP without the need of a PC
3- switch your active slot (to A if you are on B and to B if you were on A)
4- reboot recovery
I wiped data and storage then I press back.
I flashed the PBRP that I pushed to data/media/TWRP
After flash I returned to the menu of PBRP
I switched to A
When I reboot, a warning message that "NO OS SYSTEM IS INSTALLED" appear.
I reboot to recovery but after this, the telephone does not restart. the screen "androidone" appear and dont advance...
How can I install the PBRP and magisk?
I succesfull push the files to the telephone but when flash the PBRP I cannot follow......
Click to expand...
Click to collapse
You didn't flash a rom, obviously it won't boot

delete guide

delete guide
--reserved--
Hoe can i tell what image matches for my phone stil on 8.1 november 1st security patch n a unlocked boot
rob420p said:
Hoe can i tell what image matches for my phone stil on 8.1 november 1st security patch n a unlocked boot
Click to expand...
Click to collapse
Check your build and download the right file.
Matteo
While uninstalling Magisk(from rooted stock), do we need to find the current active slot and flash the stock image to it? In the guide flashing to both partitions is mentioned.
mujtahid1494. said:
While uninstalling Magisk(from rooted stock), do we need to find the current active slot and flash the stock image to it? In the guide flashing to both partitions is mentioned.
Click to expand...
Click to collapse
Flash a both slot just to be sure to pass OTA if needed.
Matteo
Matteo said:
Welcome to AIO Magisk Sub Guide.
Here you will find best methods for root Mi A2. I will maintain this guide with all safe, update methods. Currently only patched boot method is out for Stock Roms. I will add Twrp methods when we have decryption on pie.
Code:
Your warranty is now void.
We are not responsible for bricked devices, bootloop... Please
do some research if you have any concerns about mods
included in these GUIDES before using them! YOU are choosing to
make these modifications.
Install Magisk on Stock Roms Oreo & Pie
Needs:
- Bootloader unlocked, check this (currently not out) guide.
- Magisk Manager apk check Dowloads Section
- A brain
Procedure:
- Download the correct PatchedBoot file for your build from Downloads Section
- Rename the patched boot file to "patched_boot.img" and past it to your adb folder.
- Download Magisk Manager apk from Downloads Section
- Move apk to phone sdcard
- Reboot phone to bootloader by pressing Power + Volume Down until phone show the fastboot logo.
- Now open adb(fastboot) command prompt and type :
Code:
fastboot boot patched_boot.img
Your phone shoulds boot
- Install Magisk Manager apk
- Open Magisk Manager
- Click Install then choose Direct install. Reboot.
Done, you have Magisk on your device.
To uninstall Magisk just flash stock boot.img using fastboot:
"fasboot flash boot_a boot.img" and "fasboot flash boot_b boot.img"
Install Magisk on Custom Roms
Needs:
- Be on a Custom Rom
- Latest Magisk Beta zip check Dowloads Section
- Twrp latest file.img check Dowloads Section
- A brain
Procedure:
Sideload method. (It's for people who want to install Magisk on their phone during Custom Rom installation process without any permanent Twrp (usefull for people who want to root their phone when they have MTP issue during Custom Rom installation)
- Download the latest Magisk Beta zip from Downloads Section
- Rename the Magisk file to "magisk.zip" and past it to your adb folder.
- Download the latest TWRP img from Downloads Section
- Rename the twrp file to "twrp.img" and past it to your adb folder.
- Reboot phone to bootloader by pressing Power + Volume Down until phone show the fastboot logo.
Phone is now in fastboot.
- Type :
Code:
fastboot boot twrp.img
- Phone will boot Twrp.
- Navigate to Advanced > Adb Sideload
- Swipe to allow
- Open adb (fastboot) command prompt on your pc, type
Code:
adb sideload magisk.zip
Reboot and done, you have Magisk on your device.
Normal temp Twrp method. (It's for people who want to install Magisk on their phone when they are already running a Custom Rom without permanent Twrp.
- Download the latest Magisk Beta zip from Downloads Section
- Rename the Magisk file to "magisk.zip" and past it to your phone sdcard.
- Download the latest TWRP img from Downloads Section
- Rename the twrp file to "twrp.img" and past it to your adb folder.
- Reboot phone to bootloader by pressing Power + Volume Down until phone show the fastboot logo.
Phone is now in fastboot.
- Type :
Code:
fastboot boot twrp.img
- Phone will boot Twrp.
- Click Install, choose magisk.zip
- Swipe to confirm, wait for the process...
Reboot and done, you have Magisk on your device.
To uninstall Magisk just flash stock boot.img using fastboot:
"fasboot flash boot_a boot.img" and "fasboot flash boot_b boot.img"
If you have any issue, or if i make any type error, reply.
don't forget to ckick the TX button.
Downloads Section:
Boot / Patched Boot images
Magisk Thread for Beta zip / Apk file
Twrp images & zip
Click to expand...
Click to collapse
Hello, the stock boot v10.0.1.0.img, does not have mirrors, please could upload it again, I need it urgently, thank you very much
ofuen said:
Hello, the stock boot v10.0.1.0.img, does not have mirrors, please could upload it again, I need it urgently, thank you very much
Click to expand...
Click to collapse
No. If you have issue with androidfilehost it's not my problem.
Matteo
Matteo said:
Welcome to AIO Magisk Sub Guide.
Here you will find best methods for root Mi A2. I will maintain this guide with all safe, update methods. Currently only patched boot method is out for Stock Roms. I will add Twrp methods when we have decryption on pie.
Code:
Your warranty is now void.
We are not responsible for bricked devices, bootloop... Please
do some research if you have any concerns about mods
included in these GUIDES before using them! YOU are choosing to
make these modifications.
Install Magisk on Stock Roms Oreo & Pie
Needs:
- Bootloader unlocked, check this (currently not out) guide.
- Magisk Manager apk check Dowloads Section
- A brain
Procedure:
- Download the correct PatchedBoot file for your build from Downloads Section
- Rename the patched boot file to "patched_boot.img" and past it to your adb folder.
- Download Magisk Manager apk from Downloads Section
- Move apk to phone sdcard
- Reboot phone to bootloader by pressing Power + Volume Down until phone show the fastboot logo.
- Now open adb(fastboot) command prompt and type :
Code:
fastboot boot patched_boot.img
Your phone shoulds boot
- Install Magisk Manager apk
- Open Magisk Manager
- Click Install then choose Direct install. Reboot.
Done, you have Magisk on your device.
To uninstall Magisk just flash stock boot.img using fastboot:
"fasboot flash boot_a boot.img" and "fasboot flash boot_b boot.img"
Install Magisk on Custom Roms
Needs:
- Be on a Custom Rom
- Latest Magisk Beta zip check Dowloads Section
- Twrp latest file.img check Dowloads Section
- A brain
Procedure:
Sideload method. (It's for people who want to install Magisk on their phone during Custom Rom installation process without any permanent Twrp (usefull for people who want to root their phone when they have MTP issue during Custom Rom installation)
- Download the latest Magisk Beta zip from Downloads Section
- Rename the Magisk file to "magisk.zip" and past it to your adb folder.
- Download the latest TWRP img from Downloads Section
- Rename the twrp file to "twrp.img" and past it to your adb folder.
- Reboot phone to bootloader by pressing Power + Volume Down until phone show the fastboot logo.
Phone is now in fastboot.
- Type :
Code:
fastboot boot twrp.img
- Phone will boot Twrp.
- Navigate to Advanced > Adb Sideload
- Swipe to allow
- Open adb (fastboot) command prompt on your pc, type
Code:
adb sideload magisk.zip
Reboot and done, you have Magisk on your device.
Normal temp Twrp method. (It's for people who want to install Magisk on their phone when they are already running a Custom Rom without permanent Twrp.
- Download the latest Magisk Beta zip from Downloads Section
- Rename the Magisk file to "magisk.zip" and past it to your phone sdcard.
- Download the latest TWRP img from Downloads Section
- Rename the twrp file to "twrp.img" and past it to your adb folder.
- Reboot phone to bootloader by pressing Power + Volume Down until phone show the fastboot logo.
Phone is now in fastboot.
- Type :
Code:
fastboot boot twrp.img
- Phone will boot Twrp.
- Click Install, choose magisk.zip
- Swipe to confirm, wait for the process...
Reboot and done, you have Magisk on your device.
To uninstall Magisk just flash stock boot.img using fastboot:
"fasboot flash boot_a boot.img" and "fasboot flash boot_b boot.img"
If you have any issue, or if i make any type error, reply.
don't forget to ckick the TX button.
Downloads Section:
Boot / Patched Boot images
Magisk Thread for Beta zip / Apk file
Twrp images & zip
Click to expand...
Click to collapse
Thank you very much. It works for my stock rom. already clicked the thanks icon
dipankar.roy said:
Thank you very much. It works for my stock rom. already clicked the thanks icon
Click to expand...
Click to collapse
Thank you man, but plz next time don't quote the entire guide
Have a nice day
Matteo
No links available for stock boot 9.6.17.0
Edit: Oh I see, not his problem, dang.
Matteo said:
Welcome to AIO Magisk Sub Guide.
Here you will find best methods for root Mi A2. I will maintain this guide with all safe, update methods. Currently only patched boot method is out for Stock Roms. I will add Twrp methods when we have decryption on pie.
Code:
Your warranty is now void.
We are not responsible for bricked devices, bootloop... Please
do some research if you have any concerns about mods
included in these GUIDES before using them! YOU are choosing to
make these modifications.
Install Magisk on Stock Roms Oreo & Pie
Needs:
- Bootloader unlocked, check this (currently not out) guide.
- Magisk Manager apk check Dowloads Section
- A brain
Procedure:
- Download the correct PatchedBoot file for your build from Downloads Section
- Rename the patched boot file to "patched_boot.img" and past it to your adb folder.
- Download Magisk Manager apk from Downloads Section
- Move apk to phone sdcard
- Reboot phone to bootloader by pressing Power + Volume Down until phone show the fastboot logo.
- Now open adb(fastboot) command prompt and type :
Code:
fastboot boot patched_boot.img
Your phone shoulds boot
- Install Magisk Manager apk
- Open Magisk Manager
- Click Install then choose Direct install. Reboot.
Done, you have Magisk on your device.
To uninstall Magisk just flash stock boot.img using fastboot:
"fasboot flash boot_a boot.img" and "fasboot flash boot_b boot.img"
To uninstall Magisk just flash stock boot.img using fastboot:
"fasboot flash boot_a boot.img" and "fasboot flash boot_b boot.img"[/HIDE][/SIZE]
If you have any issue, or if i make any type error, reply.
don't forget to ckick the TX button.
[/SIZE]
Click to expand...
Click to collapse
After installing the patched boot image to my device (MI A2), android version 9. build number V10.0.2.0.PDIMIFJ,
the Magisk working properly. But when I turned off my phone and insert the power cable for charging, the phone start booting and stuck at "AndroidOne" logo.
Waiting for your advice...
Thanks..
dipankar.roy said:
After installing the patched boot image to my device (MI A2), android version 9. build number V10.0.2.0.PDIMIFJ,
the Magisk working properly. But when I turned off my phone and insert the power cable for charging, the phone start booting and stuck at "AndroidOne" logo.
Waiting for your advice...
Thanks..
Click to expand...
Click to collapse
That's a normal stock rom issue with magisk, you can't fix it. but if you want, we don't have this issue on custom roms
( next time plz don't quote the entire thread )
Matteo
Hey Matteo,
I've got a problem while booting with the patched boot image. Whenever I start the 'fastboot boot image' stuff, it ends with following message:
downloading 'boot.img'...
FAILED (command write failed (no error))
finished. Total time 0.002s
Phone screen goes black and says 'press any key to continue' or something like that. I tried several different USB ports and also different boot images, I cant even boot with the stock image.
When I unlocked the bootloader I had a problem that while booting the phone said I should perform a factroy reset because of a corrupt file system...after doing that, the phone itself works fine. But I really want the root access.
Have you ever encountered that message?
Thanks in advance
Update: Did the same procedure with my notebook and ironically it worked without a flaw. USB driver conflicts maybe?
On Pie V10.0.2.0, applied the patched_boot.img, Magisk was not installed at the beginning.
Installed Magisk manually but the phone was not rooted.
Applied the patched_boot.img again and I got root.
Now, every time I reboot the phone, root is gone and I have to apply the patched_boot.img again.
Thread closed on OP request

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

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
Reserved
This man -> @Nik001 deserves a beer!!!
Thank you for delivering us a fully working TWRP for laurel_sprout!
Cheers!
Typhus_ said:
This man -> @Nik001 deserves a beer!!!
Thank you for delivering us a fully working TWRP for laurel_sprout!
Cheers!
Click to expand...
Click to collapse
Welcome and thank you for testing twrp.:fingers-crossed:
Thank u peru sir
A3 real modding let's start
Good Job @Nik001
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.
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 */
Click to expand...
Click to collapse
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".
Your bootloader must be unlocked. If it's not, then follow step 1 of the instructions provided HERE.
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, 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)
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
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!
Sapper Morton said:
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.
Click to expand...
Click to collapse
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!
Typhus_ said:
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!
Click to expand...
Click to collapse
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 ?
After flashing recovery from pc..then go for fastboot reboot from minimal adb and " volume+ key" i saw error in my phone "no command"
Sapper Morton said:
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
Click to expand...
Click to collapse
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.
Sapper Morton said:
Sure, read the OP; Typhus has linked a couple of boot images, including 10.3.8.0 PFQMIXM.
https://forum.xda-developers.com/mi-a3/how-to/guide-how-to-root-mi-a3-magisk-t3958509
Click to expand...
Click to collapse
Sick! Thank you very much, sir!
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?
Makishima said:
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?
Click to expand...
Click to collapse
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.
Makishima said:
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?
Click to expand...
Click to collapse
Just flash the zip in twrp that you have.
That's what I did and it worked no problem on pe ROM
Typhus_ said:
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.
Click to expand...
Click to collapse
I did as you said but it says 'NOTE: You are now unrooted!'. Do I need to flash Magisk again?
Makishima said:
I did as you said but it says 'NOTE: You are now unrooted!'. Do I need to flash Magisk again?
Click to expand...
Click to collapse
Yes, that's right.

[GUIDE] Official Stock Android 10 flashing , Rooting with magisk and TWRP

In this guide i will go over how to flash stock android 10 if you are unlocked after flashing installing magisk and disabling force encryption :-
THIS GUIDE HAS BEEN TWEAKED AND UPDATED FOR PIXEL EXPERIENCE TOO
HTML:
Your warranty is now void.
We are not responsible for bricked devices, bootloop... Please
do some research if you have any concerns about mods
included in these GUIDES before using them! YOU are choosing to
make these modifications.
THIS GUIDE IS ONLY FOR THOSE WHO HAVE UNLOCKED THEIR BOOTLOADER
Moving from Custom ROM to Stock 10 :- OR Flashing PE 10
First downlaod Stock 10 CLICK HERE OR Pe 10
Reboot to twrp
Wipe everything expect internal storage
Flash ROM Zip
>Now if You Want to be Encrypted you can skip to Formatting Data Step This is for whom you don't want to format and want to be decrypted
>Change Slot and Reboot To Bootloader
>Boot To Official TWRP Image
>Now Flash FBE Disabler (Normally Or Via ADB Sideload ) and Reboot
Now You have to Format Your Data (IMPORTANT IF YOU CHOOSE TO BEING ENCRYPTED)
Change Slot
Now Reboot
IMPORTANT DON'T TRY TO FLASH TWRP INSTALLER JUST AFTER FLAHING THE STOCK ROM OR ELSE YOU WILL NOT BE ABLE TO BOOT ROM IN PE YOU CAN FLASH TWRP INSTALLER BUT IT TWRP WON'T BOOT AS OUR TWRP ISN'T YET READY FOR FBE
IF YOU ARE ALREADY ON STOCK(ENCRYPTED) AND WANT TO INSTALL MAGISK OR WANT TO DECRYPT SO CAN USE TWRP AGAIN
Once you have installed Stock 10 via TWRP in a rush and later you find out nothing is working there no TWRP no magisk and thus you can't move to custom ROM now , well check this out now
STEPS TO ONLY INSTALL MAGISK WITHOUT ANY DECRYPTION
Downlaod pathced boot image from link CLICK HERE
Reboot to Fastboot
Now type this code
HTML:
fastboot flash boot magisk_patched.img
After Success message reboot normally
Now Install Magisk Manager (apk)
YOU ARE ROOTED !
STEPS TO INSTALL MAGISK REMOVE DECRYPTION AND USE TWRP (For Stock and Pixel Experience Both)
IN ORDER TO SWITCH TO OTHER CUSTOM ROMs WHICH AREN'T FORCE-ENCRYPTED YOU HAVE TO DECRYPT FIRST !
IF YOU ARE ALREADY MOVING TO A ENCRYPTED ROM THEN YOU DON'T HAVE TO DECRYPT .
Reboot to Fastboot
Now type this code
HTML:
fastboot -w
This will earse all your data and decrypt
Now wait don't reboot
Now downlaod TWRP image and place it in you platform folder
Now boot to TWRP using this code
HTML:
fastboot boot twrp.img
As soon as you are in twrp flash force encrypt disabler
After Flashing Disabler Flash Magisk and reboot
NOW YOU ARE ON STOCK WITH NO ENCRYPTION AND MAGISK INSTALLED!
IF JUST IN CASE YOU WANT TO MOVE TO CUSTOM ROMs JUST AFTER FORMAT DATA AND BOOTING TWRP STEP FLASH YOUR DESIRED ROM
RECOMMENDED TWRP :- XDA HERE
THANKS Zacktg5 for Zip
HIT THANKS:cyclops:
I followed "STEPS TO ONLY INSTALL MAGISK WITHOUT ANY DECRYPTION" and got a bootloop
Thank you man!
Coming from a custom ROM (PE 10), is it possible to flash the stock 10 using fastboot, or this will cause issues?
can't install miui_JASMINEGlobal_V11.0.4.0.QDIMIXM_545aa0d958_10.0.zip
Step 1/2
Error applying update: 7 (ErrorCode :: kInstallDeviceOpenError)
Updater process ended with ERROR: 1
Error installing zip file /sdcard/miui_JASMINEGlobal_V11.0.4.0.QDIMIXM_545aa0d958_10.0.zip
---------- Post added at 03:19 PM ---------- Previous post was at 03:18 PM ----------
Zedsdeadbaby said:
I followed "STEPS TO ONLY INSTALL MAGISK WITHOUT ANY DECRYPTION" and got a bootloop
Click to expand...
Click to collapse
you can install miui_JASMINEGlobal_V11.0.4.0.QDIMIXM_545aa0d958_10.0.zip ?
why I got error ?
link to Universal DM-Verity, ForceEncrypt, Disk Quota Disablers in case someone asks: http://zackptg5.com/android.php#disverfe
XDA: https://forum.xda-developers.com/android/software/universal-dm-verity-forceencrypt-t3817389
Great
Antusuprik said:
can't install miui_JASMINEGlobal_V11.0.4.0.QDIMIXM_545aa0d958_10.0.zip
Step 1/2
Error applying update: 7 (ErrorCode :: kInstallDeviceOpenError)
Updater process ended with ERROR: 1
Error installing zip file /sdcard/miui_JASMINEGlobal_V11.0.4.0.QDIMIXM_545aa0d958_10.0.zip
---------- Post added at 03:19 PM ---------- Previous post was at 03:18 PM ----------
you can install miui_JASMINEGlobal_V11.0.4.0.QDIMIXM_545aa0d958_10.0.zip ?
why I got error ?
Click to expand...
Click to collapse
use some other twrp
I have flashed Android 10 ZIP in TWRP in slot A. After that i changed to slot B and restart to TWRP. In slot B i flashed Encryption Disabler zip and Magisk zip in order.
Same product, less steps
blackman01 said:
Downlaod pathced boot image from link CLICK HERE
HIT THANKS:cyclops:
Click to expand...
Click to collapse
Is this a December patched boot IMG?
d3rt0xx said:
I have flashed Android 10 ZIP in TWRP in slot A. After that i changed to slot B and restart to TWRP. In slot B i flashed Encryption Disabler zip and Magisk zip in order.
Same product, less steps
Click to expand...
Click to collapse
Just the Android 10 ZIP or with the twrp zip? Didn't you lose twrp if you didn't flash the twrp zip?
Thufailb said:
Just the Android 10 ZIP or with the twrp zip? Didn't you lose twrp if you didn't flash the twrp zip?
Click to expand...
Click to collapse
Without TRWP installer. I reboot to bootloader after every single step and boot TWRP.img manually with fastboot boot TWRP.img
So stock recovery is preset
Step by step:
- Boot twrp.img in fastboot from PC "fastboot boot twrp.img"
- Delete all partitions and be sure active boot slot is "A"
- Reboot to Bootloader, NOT Recovery
- Boot twrp.img in fastboot from PC "fastboot boot twrp.img" again
- Install Android 10 zip
- Change active boot slot to "B"
- Reboot to Bootloader, NOT Recovery again
- Boot twrp.img in fastboot from PC "fastboot boot twrp.img" again
- Flash Encryption Disabler zip
- Flash Magisk zip in order
- Reboot! Profit!
Fresh Android 10, decrypted and rooted with stock recovery :good:
Which recovery did you use tho?
Also does that recovery boot from stock android 9???
Please help,asap.
Guys, I have mi a2 on official pie and arb4. How to update?
Rupamxx said:
Which recovery did you use tho?
Also does that recovery boot from stock android 9???
Please help,asap.
Click to expand...
Click to collapse
Recent twrp.
Twrp boots from every version
d3rt0xx said:
Without TRWP installer. I reboot to bootloader after every single step and boot TWRP.img manually with fastboot boot TWRP.img
So stock recovery is preset
Step by step:
- Boot twrp.img in fastboot from PC "fastboot boot twrp.img"
- Delete all partitions and be sure active boot slot is "A"
- Reboot to Bootloader, NOT Recovery
- Boot twrp.img in fastboot from PC "fastboot boot twrp.img" again
- Install Android 10 zip
- Change active boot slot to "B"
- Reboot to Bootloader, NOT Recovery again
- Boot twrp.img in fastboot from PC "fastboot boot twrp.img" again
- Flash Encryption Disabler zip
- Flash Magisk zip in order
- Reboot! Profit!
Fresh Android 10, decrypted and rooted with stock recovery :good:
Click to expand...
Click to collapse
Hi, very helpful guide.
But how do you get OTA update when there's a new one? Can you provide the steps to get OTA and then get back to root. Thanks in advance.
disaster_peace said:
Hi, very helpful guide.
But how do you get OTA update when there's a new one? Can you provide the steps to get OTA and then get back to root. Thanks in advance.
Click to expand...
Click to collapse
Easy!
Just install normally via updater.
But before you restart your phone, install TWRP Retention Script via Magisk Manager to change active boot slot
can i skip installing magisk in this guide to get my banking apps working??
Sivakumar$ said:
can i skip installing magisk in this guide to get my banking apps working??
Click to expand...
Click to collapse
Yes, if you only install official OTA, banking apps work. Why not? Its official and unrooted
But decryption Script will useless without root i think
Im on derp fest Q rom now i want to go to stock 10 i cannot find any latest fastboot file and there is some issues with the mi flash tool as some users were reporting getting dev error
I'm tried using two versions of TWRP(3.2.3-0 and 3.3.1-0) and got two different errors:
• No digest file found (3.2.3-0)
• Error 7 (3.3.1-0)
What should I do? I don't have any ROM's installed

Categories

Resources