Jump to content

Magisk Install - Step by Step [ROOT]


Recommended Posts

  • Replies 217
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

The typical installation method as described on XDA won't work yet on Pro1, because we don't have a fully working version of TWRP yet.  But never fear, it's still easy, five simple steps and you

For those getting their devices and wanting to root now, the recommended procedure has changed!     This method should allow you to take future OTA updates keeping root using the A/B method link

If someone need - i upload to google drive stock versions of  boot.img, backuped by Magisk from all versions i had:  - 20191028 - 20191111 - 20191129 - 20191210 - 20200106

Posted Images

6 minutes ago, Laska said:

Does anyone update with magisk root?

I am rooted with magisk.  I am doing a backup of my apps and settings before I do the update (just to be safe...that has nothing to do with being rooted).  I'll then tell Magisk Manager to disable root, do the OTA, not reboot, and then tell Magisk Manager that the OTA is done, then reboot.  If the OTA is flaky and forces a reboot in the middle of the update, I'll lose root and will have to manually re-root the phone.  I'm hoping that doesn't happen.  

I should be able to report my results in the next hour.

  • Thanks 2
Link to post
Share on other sites
6 minutes ago, david said:

I am rooted with magisk.  I am doing a backup of my apps and settings before I do the update (just to be safe...that has nothing to do with being rooted).  I'll then tell Magisk Manager to disable root, do the OTA, not reboot, and then tell Magisk Manager that the OTA is done, then reboot.  If the OTA is flaky and forces a reboot in the middle of the update, I'll lose root and will have to manually re-root the phone.  I'm hoping that doesn't happen.  

I should be able to report my results in the next hour.

How you gonna "tell" magisk about OTA...?

Link to post
Share on other sites
11 minutes ago, Laska said:

Well, after reading this I'm affraid I'm screwed -I've modified my /system partition...

Is there any other way to install update?

You can download it like the people did at the start of this topic and pick it that way.  I have no idea how that interacts with Magisk though.

The point of Magisk is to have a system-less root.  Why did you need to update /system?

Link to post
Share on other sites
26 minutes ago, Laska said:

Is it make ane difference? After all, OTA app is downloading update package to SD, am I right?

Mainly I've uninstalled many apps from /system.

To be honest, I've never done a manual OTA .zip install in the way the people at the beginning of this topic were talking about.  My guess is that will undo your /system updates and your boot image updates (magisk) and you will be left with stock without root.  You can then reroot and re-uninstall apps from /system.

You could also use other standard methods to apply the .zip:

https://www.theandroidsoul.com/how-to-install-ota-updates-manually-using-recovery-and-adb-sideload/

Getting into recovery on the Pro1 requires some extra button presses:

 

Edited by david
  • Thanks 1
Link to post
Share on other sites
11 minutes ago, david said:

To be honest, I've never done a manual OTA .zip install in the way the people at the beginning of this topic were talking about.  My guess is that will undo your /system updates and your boot image updates (magisk) and you will be left with stock without root.  You can then reroot and re-uninstall apps from /system.

You could also use other standard methods to apply the .zip:

https://www.theandroidsoul.com/how-to-install-ota-updates-manually-using-recovery-and-adb-sideload/

Getting into recovery on the Pro1 requires some extra button presses:

 

Hmm, I think that update package is to small to contain apps from /system partition, it is only 69mb...

Link to post
Share on other sites
18 minutes ago, david said:

To be honest, I've never done a manual OTA .zip install in the way the people at the beginning of this topic were talking about.  My guess is that will undo your /system updates and your boot image updates (magisk) and you will be left with stock without root. 

Thinking about this more, the update is probably incremental, so it wouldn't have everything in it to replace everything in /system.  I guess that could leave you in a weird state, depending on the exact changes to /system that you made vs what the incremental update is trying to modify.  Hopefully it would recognize this and give you an error during the flash. 

If none of these methods work, then you could always go back to the factory image and do all the OTAs from there forward and reroot after that.  

 

UPDATE:  I'm making educated guesses here.  If anything looks out of place, other people should feel free to correct the wrong information.

Edited by david
Link to post
Share on other sites

Also, going forward, if you have root, you can use various apps to to freeze the apps you want to get rid of instead of modifying /system to uninstall them.   Alternatively, if the app has the "Disable" option in its system settings screen, you can use that to stop it from running.

Link to post
Share on other sites
12 minutes ago, david said:

Yeah, see my next post above.

This is what I'm afraid of, it will eventually lead me to lose everything because when I flash stock system.img I will have to wipe /data partition because of forced encryption...

Link to post
Share on other sites
22 minutes ago, Laska said:

This is what I'm afraid of, it will eventually lead me to lose everything because when I flash stock system.img I will have to wipe /data partition because of forced encryption...

Did you disable encryption on /data somehow?

Link to post
Share on other sites
4 hours ago, david said:

I am rooted with magisk.  I am doing a backup of my apps and settings before I do the update (just to be safe...that has nothing to do with being rooted).  I'll then tell Magisk Manager to disable root, do the OTA, not reboot, and then tell Magisk Manager that the OTA is done, then reboot.  If the OTA is flaky and forces a reboot in the middle of the update, I'll lose root and will have to manually re-root the phone.  I'm hoping that doesn't happen.  

I should be able to report my results in the next hour.

It worked.

OTA info screen:

 

Screenshot_20200305-131404.thumb.png.ebe6eb09aec337942cb736650be6f2fa.png

I then went into Magisk Manager and uninstalled it, telling it to restore the previous image.

Next, started the download for the OTA:

 

Screenshot_20200305-155953.thumb.png.f7f0c9b4a667fec9c9e53ab7491b5682.png

One interesting thing was that it automatically started installing after the download.  I thought in the past that it gave you an option tap something to start the install after the download was done, but I could be mistaken about that.  This means it is important to uninstall Magisk before even starting the download.

It also showed 100% complete immediately after the download was complete and the installation started.  However, there was a notification for the install, so I tapped on that and then got this screen:

Screenshot_20200305-160116.thumb.png.d21e5f253aca2580db72bac2a2be93ed.png

After a while, without any progress bar change, that changed to:

Screenshot_20200305-160310.thumb.png.51116e6dec86cb9c64b89e24c399260f.png

Be very careful at this point.  You aren't just responding "OK" to the message.  If you tap "OK", it will restart the phone.  I'm guessing "CANCEL" will not restart the phone, but I didn't test that.

At this point, without tapping either button, I went back into Magisk Manager and told it to install Magisk, picking the "Install to Inactive Slot (After OTA)" option.  It then did the Magisk install over the top of the OTA, in the inactive slot, backing up the boot image first, so that it is ready to do this whole process again with the next OTA:

Screenshot_20200305-160805.thumb.png.98f5e6bf494f2cd4061c283d099a5722.png

I then went back into the OTA screen and tapped "OK", causing it to reboot.  That could have been done in the Magisk Manager screen with the yellow Reboot button or I could have manually done it with the power button.  The method of reboot shouldn't matter at this point.

After rebooting:

Screenshot_20200305-161114.thumb.png.f5adeccd4ad07d52d921811836ce18f2.png

 

And root was maintained, which is the whole point of this exercise.

NOTE:  You have to originally achieve root in the proper way for this method to work.  And that proper way is for Magisk Manager to be given a non-patched boot image file that is identical to the one you are currently using.  It will make a backup of that file (for later use in the OTA process) and will also create a patched version of that file.  You then copy that patched file to your PC and use fastboot to flash it.  (https://android.gadgethacks.com/how-to/make-ota-updates-easy-by-rooting-your-pixel-3-with-magisks-boot-image-patch-0189139/)

If you don't go through the proper steps to acquire root with Magisk Manager, then you won't be able to use the Magisk Manager features to survive the next OTA update.

SUB-NOTE: Technically there is a way to hack it and give Magisk Manager a backup boot image that it didn't backup itself, but I haven't tried that. https://forum.xda-developers.com/pixel-4-xl/how-to/guide-alternative-method-applying-ota-t4023175  If you attempt this, there has been a change to where Magisk Manager stores its backup images now.  They are now at /data/magisk_backup_(hash)/boot.img.gz  instead of having the .gz file right in /data.  Also read the comments about changing the recoverymode variable in the config file to false if it is true.

If anyone is in a phone state where they don't have root and have the 20200304 firmware on their phone, and they want to root it, let me know and I can upload the boot image for the 20200304 firmware so that you can have Magisk Manager patch it, etc.

Edited by david
  • Thanks 6
Link to post
Share on other sites
9 minutes ago, EskeRahn said:

It would be easier to read if you sorted them chronologically... *LOL*

I uploaded them from my phone and posted it as-is, and then edited the post on my laptop.  You caught it in between my edits. :-)

  • Like 1
  • Haha 1
Link to post
Share on other sites
30 minutes ago, david said:

It worked.

Thanks for being the guinea pig here. I got this notification about the ota, and the part about it restarting to recovery to apply the update made me think this update would force a restart before installing. Glad to know that isn't the case.

Screenshot_20200305-124450~2.png

Link to post
Share on other sites
14 minutes ago, SirBaconIII said:

Thanks for being the guinea pig here. I got this notification about the ota, and the part about it restarting to recovery to apply the update made me think this update would force a restart before installing. Glad to know that isn't the case.

Screenshot_20200305-124450~2.png

Yeah, I forgot to comment on that.  That message was really weird.  There is no "Install now" button to select.  And why in the world would it go into Recovery Mode to install an OTA update to an A/B device, since the whole point is that you can install it while you are using the phone and not need to restart until you want to. :-)

Link to post
Share on other sites

I added this to my post above, but I'm duplicating it here in case anyone missed it because it is important.  If you don't follow the steps properly the first time you root, you won't be able to do what I documented above (which has also been documented elsewhere on the forums by other people, but for people reading this topic, and not seeing the others, it is good to have it here as well).

...

NOTE:  You have to originally achieve root in the proper way for this method to work.  And that proper way is for Magisk Manager to be given a non-patched boot image file that is identical to the one you are currently using.  It will make a backup of that file (for later use in the OTA process) and will also create a patched version of that file.  You then copy that patched file to your PC and use fastboot to flash it.  (https://android.gadgethacks.com/how-to/make-ota-updates-easy-by-rooting-your-pixel-3-with-magisks-boot-image-patch-0189139/)

If you don't go through the proper steps to acquire root with Magisk Manager, then you won't be able to use the Magisk Manager features to survive the next OTA update. 

SUB-NOTE: Technically there is a way to hack it and give Magisk Manager a backup boot image that it didn't backup itself, but I haven't tried that. https://forum.xda-developers.com/pixel-4-xl/how-to/guide-alternative-method-applying-ota-t4023175  If you attempt this, there has been a change to where Magisk Manager stores its backup images now.  They are now at /data/magisk_backup_(hash)/boot.img.gz  instead of having the .gz file right in /data.  Also read the comments about changing the recoverymode variable in the config file to false if it is true.

If anyone is in a phone state where they don't have root and have the 20200304 firmware on their phone, and they want to root it, let me know and I can upload the boot image for the 20200304 firmware so that you can have Magisk Manager patch it, etc.  See below for the link to the file.

Edited by david
  • Thanks 1
Link to post
Share on other sites
On 3/1/2020 at 8:10 PM, Craig said:

Just a note, if you're installing Magisk on LIneage, you don't need to go to all this effort.  Just use lineageos recovery to adb sideload it.

Question on this.  Are you saying this is because there is no normal OTA process for LineageOS, so every time you update LineageOS, you'll lose root anyway, and have to re-flash magisk?

Link to post
Share on other sites
3 minutes ago, EskeRahn said:

Sorry, moved it all over here, as it is not related to the specific OTA, but more general usable 🙂

Thanks!  I put a pointer post in the other thread for people over there to follow back here if they are dealing with root issues.

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Terms