Ok. So I think I have it filtered down to a simpler process, that works with Magisk and TWRP. I think... It worked for me.
Android 11 (R)
Download the firmware, and extract as instructed in this OP
Download TWRP .img (not img.tar)
Copy the AP from the stock firmware to phone external SD card
Copy the TWRP .img file to the same folder on the phone.
Use Magisk to patch the AP file.
Use Magisk to patch the TWRP .img file
(be sure to not confuse the files above since they ae both similar in name.
Move both files back to computer.
If want to and you are using Windows, go to the file explorer and click view tab, options/change folder and search options, view tab, and remove check from "hide extensions of known file types" This will show the file extension and will assist in identifying the 2 different files)
Make a copy of the AP file so you have one as your original and a working copy.
Download and install 7zip. (winrar or similar doesn't work. I think only 7zip works, at least that's what I've found)
Open your working copy of the Magisk patched AP file with 7zip.
**These next few steps will take many minutes each step**
Delete the recovery.img from the archive. (**10 mins +/-**)
Rename the Magisk patched TWRP file to recovery.img (same as the name of the file you just deleted)
Copy the renamed Magisk TWRP file (Now recovery.img) into the archive (**10 mins +/-**)
Now you have the Magisk patched AP file with the Magisk patched TWRP recovery image file contained within.
Flash this AP file to your phone with Odin. I just flashed the AP file, but I had already flashed all the other things(BL, CP, CSC) previously.
Reboot with the button combo, and check Magisk to make sure the top one says its installed.
(I find that holding the power and vol up until the 3rd screen appears, well its pretty much the same screens just switching a little but you'll see it switch 3 times, as soon as you see the 3d one release. You have to have the USB cable connected which is a pain but as always Dr. Ketan rom comes trough and fixes this. It is a great ROM but missing all the fancy customizations.)
Then as a best practice... Make a TWRP backup of this stock root. Select Boot, Recovery, System Image, Product Image, Data, Baseband, EFS. This way if you mess up, or lose your IEMI you can always restore your stock root and start over. Some ROMS require stock before flashing and this make it easier to revert back to stock if you are switching ROMS.
EDIT: So something really strange happens when I do this above process.
My phone is a 256GB but when I do the above it changes the internal storage to 32GB.
Anyone know how to fix this?
or better yet, know how to root and install TWRP?
Android 11 (R)
Download the firmware, and extract as instructed in this OP
Download TWRP .img (not img.tar)
Copy the AP from the stock firmware to phone external SD card
Copy the TWRP .img file to the same folder on the phone.
Use Magisk to patch the AP file.
Use Magisk to patch the TWRP .img file
(be sure to not confuse the files above since they ae both similar in name.
Move both files back to computer.
If want to and you are using Windows, go to the file explorer and click view tab, options/change folder and search options, view tab, and remove check from "hide extensions of known file types" This will show the file extension and will assist in identifying the 2 different files)
Make a copy of the AP file so you have one as your original and a working copy.
Download and install 7zip. (winrar or similar doesn't work. I think only 7zip works, at least that's what I've found)
Open your working copy of the Magisk patched AP file with 7zip.
**These next few steps will take many minutes each step**
Delete the recovery.img from the archive. (**10 mins +/-**)
Rename the Magisk patched TWRP file to recovery.img (same as the name of the file you just deleted)
Copy the renamed Magisk TWRP file (Now recovery.img) into the archive (**10 mins +/-**)
Now you have the Magisk patched AP file with the Magisk patched TWRP recovery image file contained within.
Flash this AP file to your phone with Odin. I just flashed the AP file, but I had already flashed all the other things(BL, CP, CSC) previously.
Reboot with the button combo, and check Magisk to make sure the top one says its installed.
(I find that holding the power and vol up until the 3rd screen appears, well its pretty much the same screens just switching a little but you'll see it switch 3 times, as soon as you see the 3d one release. You have to have the USB cable connected which is a pain but as always Dr. Ketan rom comes trough and fixes this. It is a great ROM but missing all the fancy customizations.)
Then as a best practice... Make a TWRP backup of this stock root. Select Boot, Recovery, System Image, Product Image, Data, Baseband, EFS. This way if you mess up, or lose your IEMI you can always restore your stock root and start over. Some ROMS require stock before flashing and this make it easier to revert back to stock if you are switching ROMS.
EDIT: So something really strange happens when I do this above process.
My phone is a 256GB but when I do the above it changes the internal storage to 32GB.
Anyone know how to fix this?
or better yet, know how to root and install TWRP?
Last edited: