LZMA (Elementalx), TWRP, Magisk -> change LOS 18.1 recovery to TWRP in order to get root access, - General Questions and Answers

So, backround is, I want to use AFWall+, which requires root, which I would like to use Magisk for.
In order to get Magisk I need TWRP, I learned so far.
I run LOS 18.1 and I used the lineage recovery/fastboot to flash it (according to the offical LOS-guide).
Changing the recovery is not the easiest thing for me.
Found this thread: https://forum.xda-developers.com/t/from-lineage-recovery-to-twrp-recovery.4253669/
but this seems to be very Samsung specific using Odin (I use a Pixel 4)
I also tried this guide: https://www.droidwin.com/boot-into-recovery-from-fastboot-mode/
but this just "deleted" my OS.
This is why I will be asking a few questions prior starting a new attempt, so please bear with my incompetence
At TWRP I read, I have to install a LZMA ramdisk kernel in order to get TWRP (https://twrp.me/google/googlepixel4.html).
I would go for elementalx, assuming it does support lzma.
From here things are getting tricky for me.
TWRPs guide tells me to get the kernel first, at Elementalx I get the instructions to use TWRP to install
It does say however its not neccessary to install TWRP permanently, but I would like to, because no matter what I want to do with my phone it requires TWRP. So I would like to change the recovery permanently.
The easiest way to do all of this seems to be this guide: https://elementalx.org/how-to-install/
But that will not change my recovery permanently...
What I would do (using a videoguide, because you know, I'm a noobish newbie):
1. Download TWRP img + zip, Magisk zip, Elementalx zip to my fastboot folder
2. Copy the Zips of TWRP, Magisk and Elementalx to my device
3. On my PC -> in the fastboot folder I run cmd as administrator
4. boot into bootloader
5. using cmd -> fastboot boot twrp.img
6. using TWRP -> flash the custom kernel
7. using TWRP -> flash TWRP
8. check if TWRP was proper installed: in TWRP -> boot -> recovery
hopefully the recovery was replaced
9. using TWRP - > flash Magisk
10. reboot
Would anyone please tell me if this will work?
Is there anything I need to do to avoid horrible things to happen?
This is not a request to blame something that could happen on someone afterwards. I just want to minimize the risk...

You can just flash the kernel from fastboot no twrp needed. Just fastboot flash boot boot.img.
You can have magisk patch a boot image then flash it from fastboot as mentioned above.
Usually its just recommended to fastboot boot twrp.img instead of flashing it to the actual device incase you want to revert back and install an OTA.
You can also just download the magisk apk from the device to patch the boot image, flash kernel from fastboot, then reboot with root and have magisk finish doing what it needs to do.

Thank you.
TWRP got stuck booting: I see the logo, "teamwin" and the version used 3.5.2_10-0
Everything was up to date, I'll try it again with an older version of TWRP.

Well, I dont know how to boot into LOS. It just froze on the mentioned screen.
Has anyone a idea what to do?

CodyF86 said:
You can just flash the kernel from fastboot no twrp needed. Just fastboot flash boot boot.img.
You can have magisk patch a boot image then flash it from fastboot as mentioned above.
Usually its just recommended to fastboot boot twrp.img instead of flashing it to the actual device incase you want to revert back and install an OTA.
You can also just download the magisk apk from the device to patch the boot image, flash kernel from fastboot, then reboot with root and have magisk finish doing what it needs to do.
Click to expand...
Click to collapse
Ok, I tried it my way - it wont work (of course). Maybe TWRP is still not supported for Android 11.
Now I'll try it your way (thx again).
In order to flash the kernel, I'll have to unzip the elementalx file, I assume. And boot the avaible image, which is called "dtbo.img".
I'll give this a go...

CodyF86 said:
You can just flash the kernel from fastboot no twrp needed. Just fastboot flash boot boot.img.
You can have magisk patch a boot image then flash it from fastboot as mentioned above.
Usually its just recommended to fastboot boot twrp.img instead of flashing it to the actual device incase you want to revert back and install an OTA.
You can also just download the magisk apk from the device to patch the boot image, flash kernel from fastboot, then reboot with root and have magisk finish doing what it needs to do.
Click to expand...
Click to collapse
fastboot flash boot boot.img did not work. I renamed the file to boot.img (did not mention this before).
Tried it twice, but nothing worked afterwards, not even recovery and I was not able to turn the device off.
Had to flash LOS again.
I also tried flashing the kernel using sideload while flashing the rom again.
Sideload did work, BUT the wifi was not working at all.
I dont want to bother you, but might there be another way?

I might have found something:
[VERY EASY GUIDE] ADB/FASTBOOT/RECOVORY *FULL GUIDE* for flashing ROMs, Kernels, APKs
Keep in mind bootloader unlock will not work if you have done the latest OTA update without previously using supercid. See bootloader unlock guide below for more details. This procedure is designed to be EXTREMELY EASY and for people using...
forum.xda-developers.com
uppon2 said:
That is all. Keep in mind things like wifi might not work if you forget to flash the kernel modules! - Just be sure it is always a 2 step process.
Click to expand...
Click to collapse
This is what I am experiencing when using sideload. It does install the kernel, but wifi wont work. I guess I do need a working (permanently or temporarly) recovery.

caraman said:
I might have found something:
[VERY EASY GUIDE] ADB/FASTBOOT/RECOVORY *FULL GUIDE* for flashing ROMs, Kernels, APKs
Keep in mind bootloader unlock will not work if you have done the latest OTA update without previously using supercid. See bootloader unlock guide below for more details. This procedure is designed to be EXTREMELY EASY and for people using...
forum.xda-developers.com
This is what I am experiencing when using sideload. It does install the kernel, but wifi wont work. I guess I do need a working (permanently or temporarly) recovery.
Click to expand...
Click to collapse
Wifi is usually a kernel module that gets loaded through an init script on boot. It's possible to build the wifi module built-in to the kernel, which makes it so it doesn't have to load separately through an init script.
So if youre not using the stock kernel you'd have to ask whoever makes the kernel you are using.

caraman said:
So, backround is, I want to use AFWall+, which requires root, which I would like to use Magisk for.
In order to get Magisk I need TWRP, I learned so far.
I run LOS 18.1 and I used the lineage recovery/fastboot to flash it (according to the offical LOS-guide).
Changing the recovery is not the easiest thing for me.
Found this thread: https://forum.xda-developers.com/t/from-lineage-recovery-to-twrp-recovery.4253669/
but this seems to be very Samsung specific using Odin (I use a Pixel 4)
I also tried this guide: https://www.droidwin.com/boot-into-recovery-from-fastboot-mode/
but this just "deleted" my OS.
This is why I will be asking a few questions prior starting a new attempt, so please bear with my incompetence
At TWRP I read, I have to install a LZMA ramdisk kernel in order to get TWRP (https://twrp.me/google/googlepixel4.html).
I would go for elementalx, assuming it does support lzma.
From here things are getting tricky for me.
TWRPs guide tells me to get the kernel first, at Elementalx I get the instructions to use TWRP to install
It does say however its not neccessary to install TWRP permanently, but I would like to, because no matter what I want to do with my phone it requires TWRP. So I would like to change the recovery permanently.
The easiest way to do all of this seems to be this guide: https://elementalx.org/how-to-install/
But that will not change my recovery permanently...
What I would do (using a videoguide, because you know, I'm a noobish newbie):
1. Download TWRP img + zip, Magisk zip, Elementalx zip to my fastboot folder
2. Copy the Zips of TWRP, Magisk and Elementalx to my device
3. On my PC -> in the fastboot folder I run cmd as administrator
4. boot into bootloader
5. using cmd -> fastboot boot twrp.img
6. using TWRP -> flash the custom kernel
7. using TWRP -> flash TWRP
8. check if TWRP was proper installed: in TWRP -> boot -> recovery
hopefully the recovery was replaced
9. using TWRP - > flash Magisk
10. reboot
Would anyone please tell me if this will work?
Is there anything I need to do to avoid horrible things to happen?
This is not a request to blame something that could happen on someone afterwards. I just want to minimize the risk...
Click to expand...
Click to collapse
Magisk should not be that complicated. All the hard work has been done and can be found in Magisk documentation. There are install instructions for just about any type device and if there is LOS for your device I'm sure it is covered. The latest Magisk is not TWRP flashable the same way as it used to be and newer devices often don't have ramdisk in boot image and root is achieved thru recovery instead. You referenced several threads and guides but no indication of Magisk instructions. Read the Magisk installation instructions for your device type, they're not just suggestions, they work.

Related

[GUIDE] Rooting your Essential PH-1

WARNING: Before attempting to root your device, do note that by unlocking your bootloader and modifying your device with root, ROMs, etc... you are risking voiding your warranty! I am NOT responsible for what you do to your device either, so follow these instructions at your own risk. Make sure you know what you're doing, it's best to understand the process rather than just copy and paste commands and such.
Useful and important general information can be found in the second post here.
NOTES
1. If you flash the TWRP Installer when you've already got Magisk installed, your device will keep booting to the recovery. You should be able to fix this by just simply reflashing Magisk.
2. If you have TWRP installed via the TWRP Installer, you will not be able to install stock OTA updates. You will have to reflash the stock boot image for whatever build you're running beforehand.
3. The prebuilt TWRP image may not have touch functionality if you're using the September 2018 Update or newer. Patching the boot image, however, for these builds with the TWRP Installer will allow touch to work flawlessly. Here is a pre-patched September 2018 Boot Image with TWRP. It should also work with builds newer than September. Since it's based off the September 2018 update, I suggest not using this as your main boot image but rather just as a replacement for the pre-built TWRP image from the official TWRP thread.
4. Simple "flash and forget" boot images pre-patched with Magisk and TWRP are provided by @aer0zer0 and are available here. They are based on ianmacd's variant of Magisk. If you are running stock, you can flash these boot images to get root and TWRP instead of following the guide to patch it yourself. Here is January's.
If you don't care about TWRP and simply want to just root your device, you can just simply patch the boot image for your ROM with the Magisk Manager and flash it in fastboot with
Code:
fastboot flash boot patched_boot.img
The link to the boot images for most stock builds can be grabbed from my Google Drive link in the second post or from the back-to-stock zips.
REQUIREMENTS
An unlocked bootloader
Working adb and fastboot environment, along with knowledge on how they work.
The latest build of TWRP along with the TWRP Installer. Read Note 3 above beforehand.
1. Download the latest build of TWRP and the TWRP Installer. Transfer the TWRP Installer zip to your device.
2. Reboot your phone into fastboot. Once in fastboot, change your device's current slot using the command
Code:
fastboot set_active other
If the command above doesn't work for you, use fastboot getvar current-slot followed by fastboot -aX, replacing "X" with the slot opposite (a or b) from your current slot.
3. Once your device's current slot has been switched, flash the TWRP image you downloaded earlier using the command
Code:
fastboot flash boot twrp.img
Depending on your version of fastboot, the above command might not work either. In that case, you can enter the following command, replacing "X" with your current slot (a or b).
Code:
fastboot flash boot_X twrp.img
4. Once TWRP has been flashed, boot into the recovery.
5. Once you have booted into TWRP, simply flash the TWRP Installer zip.
6. Once you have finished flashing the TWRP Installer zip, boot to recovery on the OPPOSITE slot. You can do this from TWRP by going to "Reboot", then selecting the opposite of the current slot (if on A, select Slot B. If on B, select Slot A), then select "Recovery." You can also do this through fastboot by running the same command from step 2.
7. Once you have booted back into TWRP, simply flash the Magisk zip and you are now good to go! Feel free to flash anything else like kernels while you're at it.
8. Reboot. :good:
NOTE: TWRP WILL remain installed on your device so long as you reflash the installer zip after every update.
Important Information for the Essential PH-1 can be found here. Keep it bookmarked.
Tips on updating via OTA after rooting can be found here.
In the case that you mess something up on your device, you may find it helpful to revert back to stock with the unofficial factory images graciously provided by @invisiblek and @aer0zer0 over here.
Official TWRP XDA Thread for the Essential PH-1
Join the Essential PH-1 Discord Server! -- Lots of cool people here!
Join the Essential PH-1 Development Telegram Channel!
Stock Boot Images for most builds can be found at my Google Drive link here.
Have a Red Verity Warning when booting your device? Click here.
If the link to the boot.fix.red image isn't working, you can also find it here or in my Google Drive link in the first post.
Essential Phone (PH-1) Partition Layout
Dumping Boot Images
1. Find the current slot with
Code:
fastboot getvar current-slot
or
Code:
adb shell getprop ro.boot.slot_suffix
2. Switch to the opposite slot in Fastboot using the command
Code:
fastboot set_active other
3. Flash TWRP using the command
Code:
fastboot flash boot twrp.img
4. Now, boot into TWRP and use the following command from your PC, replacing X in "boot_X" with the original slot from step 1 (a or b). TRIPLE CHECK:
Code:
adb shell dd if=/dev/block/bootdevice/by-name/boot_X of=/sdcard/boot.img
5. Profit! Don't forget to switch back to the original partition with the same command from step 2!
extractTarFork() error when restoring data from a TWRP backup
1. Reinstall the ROM from which the backup is based on.
2. Wipe your data. You can do this from the recovery or from fastboot using the command
Code:
fastboot -w
3. Boot into the ROM. When going through the initial setup, use the EXACT same security setup as the one from your backup. For example, if you used a Fingerprint + Password in the backed up ROM, use the exact same combo along with the exact same password as well. There is no need to set up anything else, like accounts.
4. Flash, install, and reboot into TWRP. You should now be able to restore the data backup without any issues.
AFH mirrors for images:
Build NMJ32F
NMJ32F patched boot image
NMJ32F factory image
Build NMJ20D
NMJ20D patched boot image
NMJ20D factory image
TWRP (alpha v4)
Thanks for getting the latest boot image up so quickly.
Thanks for the detailed guide, it worked great!
Any idea how to install xposed sdk 25? I tried the adb sideload function and the Magsik Module but both failed. Any ideas?
how to install the NMJ32F ota update when you are already rooted on NMJ20D?
Tried adb sideload but cannot install obviously because boot-loader is unlocked and is rooted.
prgopala said:
how to install the NMJ32F ota update when you are already rooted on NMJ20D?
Tried adb sideload but cannot install obviously because boot-loader is unlocked and is rooted.
Click to expand...
Click to collapse
You need to flash the system and boot images from Invisiblek's stock ROM dump. You'll then be unrooted and will be able to accept the update.
Factory reset no longer required if your bootloader is already unlocked? Does TWRP read encypted storage now? Or is that still a problem?
@bmg1001 , good looks, here are more free XDA points to trade in for that pool table, lol.
gk1984 said:
Factory reset no longer required if your bootloader is already unlocked? Does TWRP read encypted storage now? Or is that still a problem?
Click to expand...
Click to collapse
As far as I know, TWRP still doesn't have decryption fully working just yet, but installing Magisk works fine without any factory resets.
prozo said:
Thanks for the detailed guide, it worked great!
Any idea how to install xposed sdk 25? I tried the adb sideload function and the Magsik Module but both failed. Any ideas?
Click to expand...
Click to collapse
Xposed works fine for me. Make sure you installed the correct Xposed Installer/Manager apk linked in the thread for the Xposed Module. Also, it may take a reboot or two for Xposed to fully activate.
Did anyone manage to disable encryption? I tried everything and failed
bmg1001 said:
Xposed works fine for me. Make sure you installed the correct Xposed Installer/Manager apk linked in the thread for the Xposed Module. Also, it may take a reboot or two for Xposed to fully activate.
Click to expand...
Click to collapse
Maybe I'm not gathering the information correctly, using the Magisk Module itself doesn't work, sideloading the zip file via the adb fastboot TWRP.img doesn't work either, using the actual Xposed APK installer doesn't work either. I rebooted the phone about 4 times before removing it entirely.
Any chance you can walk me through how you got it installed without the TWRP recovery fully installed?
prozo said:
Maybe I'm not gathering the information correctly, using the Magisk Module itself doesn't work, sideloading the zip file via the adb fastboot TWRP.img doesn't work either, using the actual Xposed APK installer doesn't work either. I rebooted the phone about 4 times before removing it entirely.
Any chance you can walk me through how you got it installed without the TWRP recovery fully installed?
Click to expand...
Click to collapse
All I did was install the Xposed APK and then the Xposed Magisk Module. After two reboots, the apk said everything was working. This is the apk I used: https://drive.google.com/file/d/16-OHpswcngp1KLtkWCBDwwl8AvFafR5H/view?usp=drivesdk
bmg1001 said:
All I did was install the Xposed APK and then the Xposed Magisk Module. After two reboots, everything was working. This is the apk I used: https://drive.google.com/file/d/16-OHpswcngp1KLtkWCBDwwl8AvFafR5H/view?usp=drivesdk
Click to expand...
Click to collapse
Thanks for replying so quickly I appreciate it, the file you linked keeps opening on my end and fails to install saying it's corrupt
prozo said:
Thanks for replying so quickly I appreciate it, the file you linked keeps opening on my end and fails to install saying it's corrupt
Click to expand...
Click to collapse
The apk should be the same one found here: https://forum.xda-developers.com/xposed/unofficial-systemless-xposed-t3388268
bmg1001 said:
All I did was install the Xposed APK and then the Xposed Magisk Module. After two reboots, the apk said everything was working. This is the apk I used: https://drive.google.com/file/d/16-OHpswcngp1KLtkWCBDwwl8AvFafR5H/view?usp=drivesdk
Click to expand...
Click to collapse
Alright I got it to work
So I didn't use the APK instead I downloaded the zip from the XDA thread that is specifically for Magisk Module and then added via the modules tab on the left side of the Magisk Module APK.
After I restarted I had the newly installed APK to download and install the proper version of Xposed 88.2 sdk25
Another restart and boom I got the active module notification in green.
Thanks man!
Thread for downloads can be found here:
https://www.google.com/amp/s/forum....ed/unofficial-systemless-xposed-t3388268/amp/
Thank you for this!
My PH-1 is arriving today. SooOoo excited!
spotmark said:
You need to flash the system and boot images from Invisiblek's stock ROM dump. You'll then be unrooted and will be able to accept the update.
Click to expand...
Click to collapse
Would using flashfire work to install the ota?
drocny87 said:
Would using flashfire work to install the ota?
Click to expand...
Click to collapse
Couldn't tell you. I just used TWRP to flash the system and boot, and then took the update, and then rerooted.

[guide] root oreo stable with magisk [trial and error method]

Hello folks,
As soon as OREO stable update rolled out, we all were looking for a TWRP and a way to root our MI A1.
I found a way to root MI A1 without breaking WiFi and hotspot.
I will not be responsible for any harm caused to anyone during the flashing.
This may work or may not work for all of you.
DOANLOAD MAGISK INSTALLER.ZIP AND
Keep in mind, keep an OREO stock boot.img as it would be used later.
So here is how you will get it :
First of all, head to the folder where you have installed ADB AND FASTBOOT drivers, launch a command instance there and flash MohanCM's TWRP using command 'fastboot boot TWRP.img' (PS: Rename the .img file to TWRP.img).
Second, the phone will boot in TWRP but wait, here is what you need to do in order to make your TWRP recognize your data partition. It will initially show 0 MB.
OKAY, TO SOLVE THIS WHAT WE WILL DO IS, GO TO WIPE>ADVANCED WIPE>REPAIR/MODIFY BLABLA FILE SYSTEM>SELECT 'DATA' PARTITION>SELECT 'EXFAT'>AND SWIPE RIGHT TO CONVERT THAT 0 MB TO ORIGINAL 51GB USERSPACE.
AGAIN SELECT EXT4> SWIPE TO CONFIRM.
GO BACK, flash MAGISK installer zip(Mount system, data)
Reboot to bootloader.
Now flash the OREO's stock boot.img using,
FASTBOOT flash boot_a boot.img
FASTBOOT flash boot_b boot.img
FASTBOOT reboot
The phone with reboot back in system, with working WIFI AND HOTSPOT.
Next is download official MAGISK app, and you'll be seeing ROOT for sure.
This method worked for me, check if it works for you too.
Thanks,
Kaustubh.rockstar
NO NEED TO MAKE 100 THREADS for the same topic.
https://forum.xda-developers.com/mi-a1/how-to/oreo-update-officially-root-easy-t3728095
Use this , you can flash /boot the patched image. and just install from magisk manager
Here is a easier process if you really want to check if the boot.img is compatible:
First enable OEM Unlock in developer settings
- Reboot to fastboot (volume down + power)
- fastboot oem unlock (won't wipe)
- fastboot boot patched_boot.img
- After Android finishes booting, install Magisk Manager.
- In Magisk Manager, use Install and install the latest Magisk with Direct Install
- Reboot and you're done
I think you probably should read the contents of the thread that I wrote. I don't think this thread is about getting OREO STABLE.
It is related with working root for now without TWRP.
AS A TEMPORARY MEANS.
DO NOT COMMENT IF YOU HAVEN'T READ THE THREAD PROPERLY. I'VE BEEN AN ACTIVE DEVELOPER FOR VARIOUS ANDROID PHONES IN THE PAST TOO.
NO MORE DISCUSSIONS.
EDIT : THERE IS NO PATCHED BOOT FOR OREO STABLE. EVEN IF YOU FLASH OLDER PATCHED BOOT, IT WOULD SIMPLY BREAK YOUR WIFI AND HOTSPOT AND I FOUND A WORKAROUND FOR THE SAME BUT WITHOUT TWRP.
What the... reformat data partition just to install Magisk? Magisk can be installed in 5 minutes on stable Oreo, no TWRP needed, nothing gets broken.
You need to zip in the files to system, Don't you? ^^
MAGISK surely would not work without files.
kaustubh.rockstar said:
You need to zip in the files to system, Don't you? ^^
MAGISK surely would not work without files.
Click to expand...
Click to collapse
Yes and no. If you boot patched boot.img, which already contains Magisk, then you don't need TWRP. I confirm that steps above mentioned by "Aj.GaLaxY aCE" work. I did the same, even prepared patched boot.img while on Nougat myself, then updated to Oreo, booted patched_boot.img, installed Magisk Manager, installed Magisk to active partition. Wifi and hotspot are working and I didn't lose any data.
Alright, sire. ^^
Thread reported for deletion.
I'm not here to argue with you people. I'm here to help.
Simple.
kaustubh.rockstar said:
I think you probably should read the contents of the thread that I wrote. I don't think this thread is about getting OREO STABLE.
It is related with working root for now without TWRP.
AS A TEMPORARY MEANS.
DO NOT COMMENT IF YOU HAVEN'T READ THE THREAD PROPERLY. I'VE BEEN AN ACTIVE DEVELOPER FOR VARIOUS ANDROID PHONES IN THE PAST TOO.
NO MORE DISCUSSIONS.
EDIT : THERE IS NO PATCHED BOOT FOR OREO STABLE. EVEN IF YOU FLASH OLDER PATCHED BOOT, IT WOULD SIMPLY BREAK YOUR WIFI AND HOTSPOT AND I FOUND A WORKAROUND FOR THE SAME BUT WITHOUT TWRP.
Click to expand...
Click to collapse
1. People are messing up using twrp to root
2. Booting via patch boot.img doesn't break your wifi or hotspot
3. You haven't even posted an Oreo stock boot.img
4. There are similar twrp methods also available and no one is willing to put himself/herself at risk
5. If you can get a root by following simple steps,, there is no need to confuse people by this and that method.
Mod edit
Thread closed at OPs request

Systemless Root without custom recovery | Shield Tablet 5.3 ROW

I'm wondering if anyone tried to root Shield Tablet with Magisk without custom recovery? In the guide it says you have to patch the stock boot.img. I'm just a bit worried since the stock boot.img you can download from Nvidia is for firmware 5.2 and I have the 5.3 OTA on my tablet.
I want to do the following:
"Via Magisk Manager (Only support v14.0+):
This method does not need root, and also does not require a custom recovery.
However, you MUST have a stock boot image dump beforehand, and you also have to be able to flash the patched boot image, either through fastboot/download mode or ODIN
Install the*latest Magisk Manager
If you're planning to flash the patched boot image through ODIN, go to Settings > Update Settings > Patched Boot Output Format, and select*.img.tar. For normal users leave it as the default*.img
Press Install > Install > Patch Boot Image File, and select your stock boot image file
Magisk Manager will now patch your boot image, and store it in*[Internal Storage]/MagiskManager/patched_boot.img[.tar]
Copy the patched boot image to your PC. If you can't find it via MTP, you can pull the file with ADB:
adb pull /sdcard/MagiskManager/patched_boot.img[.tar]
Flash the patched boot image to your device and reboot. Here is the command if using fastboot:
fastboot flash boot /path/to/patched_boot.img"
This method hasn't any sense for our tablet. If you don't want install twrp you can do "boot only" twrp.
Make full backup and flash Magisk.zip.
fastboot boot NameOfTwrp.img
dzidexx said:
This method hasn't any sense for our tablet. If you don't want install twrp you can do "boot only" twrp.
Make full backup and flash Magisk.zip.
fastboot boot NameOfTwrp.img
Click to expand...
Click to collapse
Thanks! This was a better method! I successfully installed Magisk without installing twrp.
erik90 said:
Thanks! This was a better method! I successfully installed Magisk without installing twrp.
Click to expand...
Click to collapse
What is the point in not installing TWRP? TWRP is much more functional in every way than stock recovery.
redpoint73 said:
What is the point in not installing TWRP? TWRP is much more functional in every way than stock recovery.
Click to expand...
Click to collapse
I just wanted to root my Shield Tablet and still be able to receive OTA´s if there will be any more.
Don´t have the need for custom recovery since I like the tablet stock with exception for root, I tried a few custom roms but there was always some bugs.
One feature from stock I can´t live without is the Button Mapper, it´s amazing that it works with all bluetooth controllers that I have tried.
erik90 said:
I just wanted to root my Shield Tablet and still be able to receive OTA´s if there will be any more.
Click to expand...
Click to collapse
The OTAs install properly with TWRP and root.

[ALTERNATIVE] Root Mi A1 with TWRP Without disabling Ota

As you may imagine this simple guide will show you how to root your device with magisk from twrp recovery.
I know, there is already a guide by jashancheema that shows how to root this device, however it's difficult to update the system once you are rooted. In my opinion the way i'm about to show you is faster and easier.
Disclaimer: I am not responsible for ANY damage done to your phone, act at your own risk.
That's how you can root your phone with magisk and recovery without disabling ota.
1. First download magisk manager and magisk flashable zip from here (official thread)
Install magisk manager and copy the magisk flashable zip somewhere in your device or sd.
2. Download mohancm twrp recovery (recovery-3.2.1-2-oreo) from here (official thread)
NOTE: do not download the installer, you need the .img file bootable from fastboot (recovery-3.2.1-2-oreo.img)
3. Copy recovery-3.2.1-2-oreo.img into the fastboot folder.
4. Enable developer option from in the device, enable OEM unlocking.
5. turn off your device and enter into fastboot mode by holding voume down + power button, then connect your device to the pc.
6. now open fastboot and type this to check the connection, if the terminal return an andress your phone is correctly configured.
Code:
fastboot devices
7. type this from fastboot to unlock your bootloader.
Code:
fastboot oem unlock
8. now type this to boot your recovery (REMEMBER TO COPY THE RECOVERY IMG INTO THE FASTBOOT FOLDER)
Code:
fastboot boot recovery-3.2.1-2-oreo.img
9. once your recovey boot flash the magisk zip and reboot.
NOTE: do not install or flash twrp into your device or you won't be able to update through ota.
---------------------HOW TO UPDATE-----------------------------------------------------------------------------------------------------
When you will receive the update the only thing you need to do is boot twrp, flash magisk unistaller (that you can find here ) and update.
1. type this to boot your recovery (REMEMBER TO COPY THE RECOVERY IMG INTO THE FASTBOOT FOLDER)
Code:
fastboot boot recovery-3.2.1-2-oreo.img
2. flash magisk unistaller from recovey
3. Update your system
4. Repeat the same procedure to root again your device.
If you are italian and you need any help you can find it here, the serious telegram community.
https://t.me/XiaomiMiA1Italia
Special thanks to @samuele94 and @TheRealajeje from the telegram group.
RESERVED
All works!!! :good::good::good::good::good:
WORK
I tried, it works. thank you!
funziona da dio! fantastico! bella guida
Great work!
i already flash twrp on my device, so i cannot install update OTA until i go back to unroot?
@H.A.L. 9000, I'm sorry for my ignorance but I wonder whether the bootloader unlock passage (that'd reset everything) is inescapable after installing an OTA update
Can I install ota with the unlocked bootloader?
Thanks for this I was always confused on how to update the phone after magisk.
Edit: you think it's possible to use a custom kernel with magisk and still maintain ota?
Thank you, the rooting part worked flawlessly. :good: Now waiting for the next OTA to see if that will work well too.
1. USB debugging doesn't have to be allowed?
2. Updating Android can be done with PC only?
I did exactly the same (as nicely outlined in MP) for the last few updates, and can confirm it's working perfectly. I was using this as the 'normal' way failed due to unknown reasons.
This approach does not required a patched boot-image available, so imho it's more robust and reliable than the 'normal' method.
iG0tB0lts said:
Thanks for this I was always confused on how to update the phone after magisk.
Edit: you think it's possible to use a custom kernel with magisk and still maintain ota?
Click to expand...
Click to collapse
+1
Have you found out?
H.A.L. 9000 said:
As you may imagine this simple guide will show you how to root your device with magisk from twrp recovery.
I know, there is already a guide by jashancheema that shows how to root this device, however it's difficult to update the system once you are rooted. In my opinion the way i'm about to show you is faster and easier.
Disclaimer: I am not responsible for ANY damage done to your phone, act at your own risk.
That's how you can root your phone with magisk and recovery without disabling ota.
1. First download magisk manager and magisk flashable zip from here (official thread)
Install magisk manager and copy the magisk flashable zip somewhere in your device or sd.
2. Download mohancm twrp recovery (recovery-3.2.1-2-oreo) from here (official thread)
NOTE: do not download the installer, you need the .img file bootable from fastboot (recovery-3.2.1-2-oreo.img)
3. Copy recovery-3.2.1-2-oreo.img into the fastboot folder.
4. Enable developer option from in the device, enable OEM unlocking.
5. turn off your device and enter into fastboot mode by holding voume down + power button, then connect your device to the pc.
6. now open fastboot and type this to check the connection, if the terminal return an andress your phone is correctly configured.
7. type this from fastboot to unlock your bootloader.
8. now type this to boot your recovery (REMEMBER TO COPY THE RECOVERY IMG INTO THE FASTBOOT FOLDER)
9. once your recovey boot flash the magisk zip and reboot.
NOTE: do not install or flash twrp into your device or you won't be able to update through ota.
---------------------HOW TO UPDATE-----------------------------------------------------------------------------------------------------
When you will receive the update the only thing you need to do is boot twrp, flash magisk unistaller (that you can find here ) and update.
1. type this to boot your recovery (REMEMBER TO COPY THE RECOVERY IMG INTO THE FASTBOOT FOLDER)
2. flash magisk unistaller from recovey
3. Update your system
4. Repeat the same procedure to root again your device.
If you are italian and you need any help you can find it here, the serious telegram community.
https://t.me/XiaomiMiA1Italia
Special thanks to @samuele94 and @TheRealajeje from the telegram group.
Click to expand...
Click to collapse
Can't I just install syst update through twrp?
Rooting Mi A1 using this method worked. But the guide needs updating:
1.You must enable usb debugging
2.You must install magisk manager after unlocking bootloader. Installing it before is useless because unlocking bootloader will wipe all data.
freekarol said:
unlocking bootloader will wipe all data.
Click to expand...
Click to collapse
not till 9.5.11
freekarol said:
Rooting Mi A1 using this method worked. But the guide needs updating:
1.You must enable usb debugging
2.You must install magisk manager after unlocking bootloader. Installing it before is useless because unlocking bootloader will wipe all data.
Click to expand...
Click to collapse
Well, that happened to me.. Total WIPE... So, i decide to stop. But this night i'll try again, after a full backup. For me this is important because i need to use Android Auto, with aamirror.
I do regular backups so it was ok with me. It also should be in the guide as a first step: backup your phone. It seems like the guide is not for beginners... After rooting, you can face two problems:
1. From time to time, Magisk crashes. Just open it again.
2. There will be a camera lag. Installing a Magisk module should solve it(I haven't tried it yet): https://www.youtube.com/watch?v=UqcQKqhL3ok
there is some indication that 'fastboot boot twrp.img' wipes all the data!
Not sure when it started and if there is a way to avoid it - any idea?

Problems in rooting after flashing patched boot.img

Hi everyone sorry for the truble and probably the bad english this is not my main language .
I have an old Samsung s7 with android 8.0 that i wanted to root with magisk.
I first tried with twrp but i don't know why i couldn't "install" it, when flashing with odin it failed and made my phone go in like"emergency recovery mode ".
Next i tried without TWRP which i founded is the recommended method.
I did everything the guides i found said but when i am flashing the patched boot.img after the phone boot and i open magisk it isn't installed.
Ramdisk went from yes to no.
I don't know what to do i am sure i used the correct boot img. I transferred them via google driver in .tar maybe this broke something?
paoloooooo said:
I did everything the guides i found said
Click to expand...
Click to collapse
please mention the exact steps, we don't have crystal ball.
sorry,
I extracted boot.img from the ap file (it's the correct one i am sure because i used it to flash stock firmware).
Then i transferred the boot.img via google drive to the phone and used magisk to patch it, it said no error and everything worked fine . After that via google drive i brought back the patched file to the pc and used odin to flash it with BL CP HOME-CSC.
When i flash it with BL CP HOME-CS and the patched file the phone boot and ask me to go to factory reset i say yes, then after everything i reinstall magisk and ramdisk went from yes to no but it still says magisk not installed.
I don't know if i made myself clear
so I understood you enabled OEM unlocking, unlocked bootloader in download mode (what was factory resetting device) and after finishing initial welcome setup, you again ensured OEM is unlocked in developer settings. only then, you flashed Magisk, device is still working but Magisk provides no root, because ramdisk is gone.
What is the Samsung ROM version (for example G930FXXU8EVG3)?
What Magisk version you installed?
What options you set in Magisk before patching boot.img? Haven't used Magisk for a while, maybe no options have been asked.
i have enabled OEM unlocking but bootloader mode i don't have the option to activate it (in the passage before going to dowload mode) but the guide i looked said it wasn't needed if there wasn't the option.
I am using magisk 25.2 and they ask no option when patching .
download platform-tools, enable usb-debugging, install ADB drivers, confirm 'adb devices' on phone and push the ROM to phone storage.
Code:
adb devices
adb push path\to\pc\AP_[device_model_sw_ver].tar.md5 /sdcard/Download
uninstall Magisk and install older version Magisk-v24.2.apk
In case you want to use TWRP later, disable the encryption checkbox (only when asked) and disable avb/dm-verity checkbox (only when asked) in the options before patching (not sure these options exist though).
Device should have ramdisk, so do not enable the recovery option for now.
patch the whole AP_[device_model_sw_ver].tar.md5 file with Magisk. notice the file name when finished.
copy the patched file back to PC and rename it AP_[device_model_sw_ver]_magisk_patched_boot.tar
Code:
adb pull /sdcard/Download/magisk_patched.tar path\to\pc\AP_[device_model_sw_ver]_magisk_patched_boot.tar
flash the patched AP file together with BL CP CSC (will factory reset) and wait long time for first boot. finish the initial setup and install (older) Magisk apk again.
if rooting was successful, update Magisk from within the Magisk app.
i tried and did everything but when i try to flash with odin it crashes
please understand I won't answer "please help" or "tried everything" posts. give more information. the patched firmware does not flash? or is that general odin issue?
edit: given instructions were straight from magisk documentation
https://topjohnwu.github.io/Magisk/install.html#instructions
except for using older Magisk. I forgot to tell you how to install. did you figure it out yourself?
In the Magisk-v24.2.apk, do not update to recent version (yet).
In the settings, select Update Channel: custom. then select Custom Channel, copy-paste this link.
https://raw.githubusercontent.com/topjohnwu/magisk-files/4868c83/beta.json
you can now patch the rom file with older Magisk.
ok i managed to do every step you told me i patched the file with v24.2 of magik and falshed with odin, everything went fine. But there is still the same problem the app says that is not installed but ramdisk went from yes to no
You're more likely to get the help you need if you ask your question in the right place. We have a Galaxy S7 section. This is why Rule #1 is to search before posting! We will move your thread there.
An unlocked bootloader is absolutely necessary to root. Rooting means you're modifying images on the device; a locked bootloader will prevent flashing modified images. If you haven't unlocked your bootloader, that's your first step.
I personally haven't had any luck patching the AP file in Magisk either. My suggestion is to flash a custom recovery such as TWRP, then flash Magisk in TWRP. Use the latest version of Magisk - 25.2.
paoloooooo said:
But there is still the same problem the app says that is not installed but ramdisk went from yes to no
Click to expand...
Click to collapse
Hm.. then maybe it's true your device does not have boot ramdisk? or the patching failed and removed ramdisk somehow?
try again with "Recovery Mode" option enabled when patching. note you have to press the volume button for recovery mode each time you boot.
@V0latyle recent versions of Magisk running Zygisk may have incompatibilities
https://forum.xda-developers.com/t/...ices-with-old-kernel-3-19-s7-included.4447029
Magisk-v23.0.apk is last version without Zygisk (but afaik you still can disable Zygisk in recent Magisk).
https://raw.githubusercontent.com/topjohnwu/magisk-files/afe2c30/stable.json
aIecxs said:
Hm.. then maybe it's true your device does not have boot ramdisk? or the patching failed and removed ramdisk somehow?
try again with "Recovery Mode" option enabled when patching. note you have to press the volume button for recovery mode each time you boot.
@V0latyle recent versions of Magisk running Zygisk may have incompatibilities
https://forum.xda-developers.com/t/...ices-with-old-kernel-3-19-s7-included.4447029
Magisk-v23.0.apk is last version without Zygisk (but afaik you still can disable Zygisk in recent Magisk).
https://raw.githubusercontent.com/topjohnwu/magisk-files/afe2c30/stable.json
Click to expand...
Click to collapse
Zygisk is disabled by default, you have to manually enable it when setting up Magisk after root
V0latyle said:
You're more likely to get the help you need if you ask your question in the right place. We have a Galaxy S7 section. This is why Rule #1 is to search before posting! We will move your thread there.
An unlocked bootloader is absolutely necessary to root. Rooting means you're modifying images on the device; a locked bootloader will prevent flashing modified images. If you haven't unlocked your bootloader, that's your first step.
I personally haven't had any luck patching the AP file in Magisk either. My suggestion is to flash a custom recovery such as TWRP, then flash Magisk in TWRP. Use the latest version of Magisk - 25.2.
Click to expand...
Click to collapse
OEM unlocking should be like the boot loader.
i tried using TWRP and i followed this video doing all the steps
but after the final reboot magisk app is not there and if i try to install it manually it's the same as the immage i already posted.
I found out searching online that after root ramdisk should go from yes to no and that worked. But i don't know why it never says that's installed
paoloooooo said:
OEM unlocking should be like the boot loader.
i tried using TWRP and i followed this video doing all the steps
but after the final reboot magisk app is not there and if i try to install it manually it's the same as the immage i already posted.
I found out searching online that after root ramdisk should go from yes to no and that worked. But i don't know why it never says that's installed
Click to expand...
Click to collapse
It seems like you misunderstand several critical concepts.
First, OEM unlocking DOES NOT unlock the bootloader itself. It simply allows you to. After enabling OEM unlocking, you have to follow the process to boot the device into unlock mode, then you have to follow the prompts to unlock the bootloader, which will wipe the device.
Second, the Ramdisk indication in Magisk simply indicates whether or not the device has ramdisk. This does not change, regardless of whether or not the boot image or system has been patched with Magisk. The only thing you need to look for is Installed: <Magisk version>. If Installed: N/A then you do not have root.
All you need to do is install TWRP, and if you're going to be using the factory firmware, flash the Multidisabler. Then, install Magisk through TWRP. When you reboot to system, you should have root; you'll need to install the Magisk app, but once you do, you should see the version of Magisk next to Installed as described above.
@V0latyle I think paoloooooo is right (see his screenshot) and bootloader is unlocked (otherwise phone wouldn't boot after flashing magisk_patched.tar)
aIecxs said:
@V0latyle I think paoloooooo is right (see his screenshot) and bootloader is unlocked (otherwise phone wouldn't boot after flashing magisk_patched.tar)
Click to expand...
Click to collapse
I thought a locked bootloader will prevent flashing anything custom?
right. but afaik it's possible to flash on semi-locked bootloader after the OEM toggle was enabled, but vaultkeeper still armed. at least that is the mistake you're refering to, many people struggle with...
guys thanks for everything i literally don't know why but i tried one last time with patching immages and it had the same error as the immages.
2 days after, i looked into it again and i don't know how but magisk was installed.
Thanks for everything and sorry choosing wrong section and not being very explicative.
aIecxs said:
right. but afaik it's possible to flash on semi-locked bootloader after the OEM toggle was enabled, but vaultkeeper still armed. at least that is the mistake you're refering to, many people struggle with...
Click to expand...
Click to collapse
Yeah, it would seem that a user would have to do things one of two ways:
Unlock bootloader, flash custom recovery, IMMEDIATELY boot into recovery (do not allow boot to system), wipe /system and format /data, install custom OS...this should prevent KG from interfering
Unlock bootloader, flash multidisabler, wipe data, boot to system, connect to Internet, ensure OEM Unlocking toggle is still visible, if it is KG should be disabled
paoloooooo said:
Hi everyone sorry for the truble and probably the bad english this is not my main language .
I have an old Samsung s7 with android 8.0 that i wanted to root with magisk.
I first tried with twrp but i don't know why i couldn't "install" it, when flashing with odin it failed and made my phone go in like"emergency recovery mode ".
Next i tried without TWRP which i founded is the recommended method.
I did everything the guides i found said but when i am flashing the patched boot.img after the phone boot and i open magisk it isn't installed.
Ramdisk went from yes to no.
I don't know what to do i am sure i used the correct boot img. I transferred them via google driver in .tar maybe this broke something?
Click to expand...
Click to collapse
i have the exact problem I just want to install twrp but when flashing with odin it fails. can anyone help me install twrp?

Categories

Resources