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

How To Guide TWRP + Root

Search This thread

regedit12345

Senior Member
Jun 23, 2021
103
59
Hi all. Hope you are good and safe from Covid-19.

If you like TWRP as your recovery and want to keep root access as well, I am going to show you how to do that. Because if you take the stock boot.img and patch it via magisk, you will lose TWRP as your recovery and if you flash TWRP then you will lose root access. For the advance users, they probably already know how to do this but I haven't seen any guides so I am creating one myself.

Disclaimer:
I am a Textile engineer and do not have the slightest idea about computer engineering but my passion for computers and gadgets has taught me all this.

So, if anything happens to your device, it's not on me. I have done this on my device and it worked, so I am sharing this knowledge with you guys.

Let's cut to the chase and start our work:

Before we start, I am hoping you have your bootloader unlocked and have previous experience on flashing roms.

Step 1: Installing Stock/Xiaomi.EU/Custom rom

Go ahead and install one for your favorite roms from the threads. Luckily, Poco F3 has so many roms to choose from and they're all good.

Step 2: Installing magisk.apk

Install Magisk.apk from here

Step 3: Installing TWRP

Install TWRP from @vasishath's thread. (You'll lose root access if you had any).

Step 4: Backing up your boot image

- Boot into TWRP recovery and select backup.
1630688989507.png

- Tick on boot and untick rest of the boxes.
1630689354099.png


- This will create 3 files in your TWRP folder on the phone. "boot.emmc.win" is your main file that you want to patch via magisk.

- After creating a backup of your boot image, boot into system normally.

Step 5: Patching the backed up boot image

- Open Magisk app and tap on install next to magisk.
1630689685721.png


- Now select "Select and Patch a file".
1630690656799.png

- Go ahead and select the boot.emmc.win file that is in your TWRP folder created earlier via TWRP backup.
- This is patch the boot.emmc.win and name it something like "magisk_patched-23000_randomalphanumeric.img"
- Rename the file via any file explorer to boot.img because something when the phone is plugged into the pc, your pc can't read the file. So, just to be safe, unplug the phone and re-plug to read the drive again.
- Copy this boot.img and take it to the folder where fastboot is installed/saved.

Final Step: Flashing the boot.img

- Reboot your phone to fastboot mode via pressing and holding the volume down + power buttons (or if you have custom roms installed and have the option to boot into fastboot mode directly).
- Once in fastboot mode, type following to flash the boot.img

fastboot flash boot boot.img
- once the flashing is done (in about 5-10 seconds), type the following:

Congratulations! you now have TWRP installed as your recovery and have root access as well. To verify this you should have the below screen in your magisk app

1630691564011.png



If my guide helped you in any way, please do like it as it motivates me to write more guides to take my time out from my busy work life.

Thanks.
 
Last edited:

DaRdamnDoG

Senior Member
May 23, 2017
189
36
Very detailed and comprehensive guide indeed, however I just unlocked my almost a week now. Initially, I have 3 choices on how I will run my device after unlocking bootloader.
Either I use XiaoMi.EU testing non-root, AOSP non-root or worse can scenario I'll root and run it on stock firmware.

No I do not think that F3 users are lucky, instead I think the reality is the trend of really good coders and programmers have past. You think F3 have a huge variety of custom roms to choose? 90%+ above are based on AOSP, which I don't understand why we have 10+ AOSP roms, with only 1-2 difference. It's such a waste of time. They are only interested in making new custom roms, never in maintaining them. Always abandon project and go missing after a while. This generation is full of "enthusiasts", "wanna-be" developers most noticeable after POCO entered India's market. You can try search in YouTube, poco f3 then you will get 70-80% of tech/mobile influencers with tons of guides. The sad part is, most of them are literally talking about the same stuff, and what I hate the most they love to decorate their website with tons of ads.
 

pegasoc

Senior Member
Hi,
thanks for your guide I really needed it because I already have custom ROM, root, Magisk... but TWRP I used to start it from the computer every time I needed it.

If I follow your method I don't lose the installed apps and my data, right?
 

katcj

Member
Dec 27, 2014
8
0
Xiaomi Poco F3
thank you for the guide!
I already have xiaomi.eu and TWRP installed but my first time installing Magisk on this device.
do I have to wipe /data ?
 

hofi01

Senior Member
Jul 14, 2014
94
28
No. Just install magisk.apk and patch the boot image extracted via twrp and go ahead and flash it.
PLEASE stop patching the BOOT image
.
.
.
DIRECT INSTALL (Recommendend) is the option on your screen.
that's all you needed.

and your TWRP is OLD
please, use new officel TWRP from
and there you will find the correct instructions for installing TWRP
 
Last edited:

TheBrutalLicker

Senior Member
Mar 23, 2011
102
14
Xiaomi Poco F3
Thank you for taking your time to contribute value to community resources!

There seem to be so many different guides and methods
I followed nebrassy's guide for TWRP
0. miflash latest stock -> flash desired rom
1. fastboot boot twrp.img (3.6 official)
2. advanced -> flash current twrp (now its permanent)
3. flash latest magisk alpha zip (usb otg or put in storage pre fastboot)
4. reboot.. launch magisk app -> update -> direct install -> reboot
5. profit
 
  • Like
Reactions: beicuxhaven

Wiilsoonj

New member
Dec 25, 2021
4
1
Hello. Could you help me with rooting my phone, please?

I'm on Xiaomi.eu 21.12.8 (the last android 12 weekly update). I tried flashing Magisk.zip with the TWRP but it didn't work at all.
It's like I never flashed it. So I decided to try your method to see if it would go any different, and it didn't.

I could root Evolution X (android 12), ArrowOS 11 and 12 with this method of flashing Magisk.zip on TWRP but I can't understand why it didn't worked on Xiaomi.eu 21.12.8. I could even root Xiaomi.eu 21.9.17, which was the last android 11 weekly update.

Desperate, I went to the "advanced" section of TWRP and there was an option of "Flash magisk alpha" and it ended up rooting the phone but I don't understand why the previous 2 methods didn't work.

Could you help me understand that?
 

Wiilsoonj

New member
Dec 25, 2021
4
1
Thank you!!
Using canary worked on xiaomi.eu, although, I still cannot understand why using the magiskv23.apk can root aosp android 12 rom but not xiaomi.eu android 12, if you could explain me, I'd greatly appreciate it.

Also, canary seems to have the magiskhide function removed, is there a way to hide it for certain apps (banks, mostly) with a module or is it disabled permanently now?
 

beicuxhaven

Senior Member
Jan 16, 2011
82
17
Thank you!!
Using canary worked on xiaomi.eu, although, I still cannot understand why using the magiskv23.apk can root aosp android 12 rom but not xiaomi.eu android 12, if you could explain me, I'd greatly appreciate it.

Also, canary seems to have the magiskhide function removed, is there a way to hide it for certain apps (banks, mostly) with a module or is it disabled permanently now?
yes the new "hide" is zygisk in the options
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Root only works with magisk canary in Android 12

  • 22
    Hi all. Hope you are good and safe from Covid-19.

    If you like TWRP as your recovery and want to keep root access as well, I am going to show you how to do that. Because if you take the stock boot.img and patch it via magisk, you will lose TWRP as your recovery and if you flash TWRP then you will lose root access. For the advance users, they probably already know how to do this but I haven't seen any guides so I am creating one myself.

    Disclaimer:
    I am a Textile engineer and do not have the slightest idea about computer engineering but my passion for computers and gadgets has taught me all this.

    So, if anything happens to your device, it's not on me. I have done this on my device and it worked, so I am sharing this knowledge with you guys.

    Let's cut to the chase and start our work:

    Before we start, I am hoping you have your bootloader unlocked and have previous experience on flashing roms.

    Step 1: Installing Stock/Xiaomi.EU/Custom rom

    Go ahead and install one for your favorite roms from the threads. Luckily, Poco F3 has so many roms to choose from and they're all good.

    Step 2: Installing magisk.apk

    Install Magisk.apk from here

    Step 3: Installing TWRP

    Install TWRP from @vasishath's thread. (You'll lose root access if you had any).

    Step 4: Backing up your boot image

    - Boot into TWRP recovery and select backup.
    1630688989507.png

    - Tick on boot and untick rest of the boxes.
    1630689354099.png


    - This will create 3 files in your TWRP folder on the phone. "boot.emmc.win" is your main file that you want to patch via magisk.

    - After creating a backup of your boot image, boot into system normally.

    Step 5: Patching the backed up boot image

    - Open Magisk app and tap on install next to magisk.
    1630689685721.png


    - Now select "Select and Patch a file".
    1630690656799.png

    - Go ahead and select the boot.emmc.win file that is in your TWRP folder created earlier via TWRP backup.
    - This is patch the boot.emmc.win and name it something like "magisk_patched-23000_randomalphanumeric.img"
    - Rename the file via any file explorer to boot.img because something when the phone is plugged into the pc, your pc can't read the file. So, just to be safe, unplug the phone and re-plug to read the drive again.
    - Copy this boot.img and take it to the folder where fastboot is installed/saved.

    Final Step: Flashing the boot.img

    - Reboot your phone to fastboot mode via pressing and holding the volume down + power buttons (or if you have custom roms installed and have the option to boot into fastboot mode directly).
    - Once in fastboot mode, type following to flash the boot.img

    fastboot flash boot boot.img
    - once the flashing is done (in about 5-10 seconds), type the following:

    Congratulations! you now have TWRP installed as your recovery and have root access as well. To verify this you should have the below screen in your magisk app

    1630691564011.png



    If my guide helped you in any way, please do like it as it motivates me to write more guides to take my time out from my busy work life.

    Thanks.
    3
    Very detailed and comprehensive guide indeed, however I just unlocked my almost a week now. Initially, I have 3 choices on how I will run my device after unlocking bootloader.
    Either I use XiaoMi.EU testing non-root, AOSP non-root or worse can scenario I'll root and run it on stock firmware.

    No I do not think that F3 users are lucky, instead I think the reality is the trend of really good coders and programmers have past. You think F3 have a huge variety of custom roms to choose? 90%+ above are based on AOSP, which I don't understand why we have 10+ AOSP roms, with only 1-2 difference. It's such a waste of time. They are only interested in making new custom roms, never in maintaining them. Always abandon project and go missing after a while. This generation is full of "enthusiasts", "wanna-be" developers most noticeable after POCO entered India's market. You can try search in YouTube, poco f3 then you will get 70-80% of tech/mobile influencers with tons of guides. The sad part is, most of them are literally talking about the same stuff, and what I hate the most they love to decorate their website with tons of ads.
    1
    Hi,
    thanks for your guide I really needed it because I already have custom ROM, root, Magisk... but TWRP I used to start it from the computer every time I needed it.

    If I follow your method I don't lose the installed apps and my data, right?
    No, you won't lose your data.
    1
    Hi,
    to be sure I understand correctly, at point 3 where there is to install the TWRP I always started the TWRP from PC I do not have to do it again, right?
    Yeah, once you boot from pc and "install current twrp", you dont have to do it again.
    1
    thank you for the guide!
    I already have xiaomi.eu and TWRP installed but my first time installing Magisk on this device.
    do I have to wipe /data ?
    No. Just install magisk.apk and patch the boot image extracted via twrp and go ahead and flash it.