Question How To Update System While Keeping Magisk - Xiaomi Mi 11 Ultra

I have several modules in Magisk app and couple of apps having root authority after get root with Magisk (like Tasker). Now I want to update system while keeping my magisk apps and root-to-use apps working without any risk of stucking in reboot after install a new ROM.
Could I just firstly patch the boot.img of objective ROM in Magisk, replace the boot.img with magisk_pathed_XXXX.img and flash all the .img files needed? Will this way work? Or any other ways?

while flashing a newer rom version, the magisk modules are not deleted. After flashing the new version install magisk again and everything is working well. Before updatating the rom version "restore hide magisk by itself" if you have enabled it.

If you have modules like SmaliPatcher - These will cause a bootloop after update.
Disable all modules before any update and make sure to Restore the Magisk App if its hidden.

zuize411 said:
I have several modules in Magisk app and couple of apps having root authority after get root with Magisk (like Tasker). Now I want to update system while keeping my magisk apps and root-to-use apps working without any risk of stucking in reboot after install a new ROM.
Could I just firstly patch the boot.img of objective ROM in Magisk, replace the boot.img with magisk_pathed_XXXX.img and flash all the .img files needed? Will this way work? Or any other ways?
Click to expand...
Click to collapse
I take from your description that you are flashing a fastboot ROM. In that case you are correct, i.e.
take boot.img from new ROM, patch in Magisk and copy back into the original installation folder. Simplest is to rename the original boot image and name the new magisk boot image: boot.img
now you can simply start the installation batch and it will automatically install the magisk-patched boot.img
If you are using TWRP to flash the ROM this is not needed, just flash the corresponsing magisk installation ZIP/APK in TWRP right after the system update and BEFORE rebooting.
In addition @JazonX gave a good advice , but it really depends on which modules you use.

Related

Magic v11 installation question

Hi, do i need install systemless SuperSU always in twrp before install magisk v11 if I want use new MagiskSU instead??
If I try install Magisk v11 with superSU uninstalled and phone unrooted TWRP give me error and installation fails and if I install superSU and after Magisk v11, Magisk manager say system is using SuperSU instead MagiskSU. How do I install Magisk with MagiskSU??
I have Samsung Galaxy S4 with optimized LineageOS 14.1
Read the pinned Magisk thread...
Unroot again using unSu by osm0sis (Google) before flashing magisk
Installation Instructions
If you're already rooted with MagiskSU, Magisk phh's superuser (not original), or Official Systemless SuperSU
Install/upgrade Magisk Manager from Play Store
Install/upgrade Magisk as prompted in the application
Reboot and you're done!!
If you're not rooted, or something went wrong and you need a clean start
(Recommended) Restore your boot image back to stock
Download the latest Magisk zip file
If you choose to use SuperSU (only support Android 6.0+), first flash SuperSU in systemless mode
Flash Magisk zip
Reboot, and update the stub Magisk Manager to the latest from Play Store
Click to expand...
Click to collapse
I read 200 times but when I install Magisk without SuperSU (because I want MagiskSU) TWRP give me an error and install fail... read my initial post first please....
Error:
Code:
! SU image mount failed...
! Please immediately flash SuperSU now
! Installation will complete after flashing SuperSU
[B]Updater process ended with ERROR: 1
Error installing zip file 'sdcard/Download/Magisk v11.1/Magisk-v11.1.zip[/B]
dhaern said:
I read 200 times but when I install Magisk without SuperSU (because I want MagiskSU) TWRP give me an error and install fail... read my initial post first please....
Error:
Click to expand...
Click to collapse
You need to FULLY unflash superSU using the zip that the other person told you to google.
PartyPlease said:
You need to FULLY unflash superSU using the zip that the other person told you to google.
Click to expand...
Click to collapse
Ok I will try unflash with the zip, I was using unroot inside superSU menu but installation instructions dont say nothing about the unflash with an extrenal script
dhaern said:
Ok I will try unflash with the zip, I was using unroot inside superSU menu.
Click to expand...
Click to collapse
Yeah that button doesn't work for systemless superSU. It doesn't roll back your boot.IMG like it should.
Worst case scenario, flash the stock boot.img and then flash magisk.
Thanks guys, I installed Magisk v11.1 with MagiskSU working, Magisk Hide enabled but I have CTS mismatch error now in Safetynet test. I guess I cant do nothing about this error. Optimized LineageOS 14.1 and Samsung Galaxy S4
EDIT: Finally I passed the Safetynet test (no CTS mismatch error) disabling ADB interface in developer options. Thanks for Magisk, amazing.
PartyPlease said:
Yeah that button doesn't work for systemless superSU. It doesn't roll back your boot.IMG like it should.
Worst case scenario, flash the stock boot.img and then flash magisk.
Click to expand...
Click to collapse
ahh, this would explain why my boot.img was not the same after "unrooting"! thanks for clearing this up for me...
dhaern said:
Thanks guys, I installed Magisk v11.1 with MagiskSU working, Magisk Hide enabled but I have CTS mismatch error now in Safetynet test. I guess I cant do nothing about this error. Optimized LineageOS 14.1 and Samsung Galaxy S4
EDIT: Finally I passed the Safetynet test (no CTS mismatch error) disabling ADB interface in developer options. Thanks for Magisk, amazing.
Click to expand...
Click to collapse
By disabling ADB interface, do you mean the USB debugging part? for some reason I am still getting Safetynet error.
vicky_ag said:
By disabling ADB interface, do you mean the USB debugging part? for some reason I am still getting Safetynet error.
Click to expand...
Click to collapse
Yeah I said USB debugging option, when I disabled this I passed Safetynet test.
dhaern said:
Yeah I said USB debugging option, when I disabled this I passed Safetynet test.
Click to expand...
Click to collapse
Thanks but doesn't seem to work for me.
dhaern said:
Yeah I said USB debugging option, when I disabled this I passed Safetynet test.
Click to expand...
Click to collapse
Thanks for this hint; got my build "passed" now appreciate it
What settings are you guys using in Magisk? I have disabled BusyBox, enabled Magisk Hide and systemless hosts. Superuser options are Access to "Apps and ADB" and Automatic Response set to prompt
I'm still having an issue installing Magisk on my phone with RAMROM V10. It gives me an ERROR 1.
It has been suggested that I should re-flash my boot.img with TWRP following the instruction:
Place your BOOT.img on your sdcard
Reboot into TWRP recovery
Tap "Install"
In the bottom right corner tap "Install Image"
Select your BOOT.img
Select the Boot Partition, then swipe to confirm Flash
However, when I follow the step, my TWRP cannot seem to find BOOT.IMG in my SD Card (I know it is there). What did I do wrong? Can anyone help?
i think the .img thingy is only for twrp.img files. You have to use another method to place your boot image like. -> make a backup of only your boot image via twrp backup function. Then duplicate that backup folder of twrp containing only the newly just regernated files, in the twrp folder. Then replace the su-modified boot file there with your original boot file, you obviously have to rename your boot image to fit the right name. (eg. with the logo image -> logo.bin changes to logo.emmc.win -> etc;.) Then use the twrp restore function to restore your "original" boot logo.
Hierarchy folder view would be like:
TWRP->folder 1 (original folder, in case something goes wrong)-> boot file and others
->folder 2 (our modified folder)-> files
sm00th4f3 said:
i think the .img thingy is only for twrp.img files. You have to use another method to place your boot image like. -> make a backup of only your boot image via twrp backup function. Then duplicate that backup folder of twrp containing only the newly just regernated files, in the twrp folder. Then replace the su-modified boot file there with your original boot file, you obviously have to rename your boot image to fit the right name. (eg. with the logo image -> logo.bin changes to logo.emmc.win -> etc;.) Then use the twrp restore function to restore your "original" boot logo.
Hierarchy folder view would be like:
TWRP->folder 1 (original folder, in case something goes wrong)-> boot file and others
->folder 2 (our modified folder)-> files
Click to expand...
Click to collapse
FIY: Flashing regular boot.img files works just fine with "Install Image" in TWRP (of course, YMMV, depending on your device).

How to use Magisk??? (add lost txt)

Hi to all
I have rooted OP3T and every time when I install new update, BETA small or full version zip file, I need again to install stock.zip from boatloader , then again, install TWRP and Super Su.
I hear that with Magisk I can easy install any update without lost TWRP and Root. I have flash Magisk and install from Google Store Magisk Manager.
So my question is how to install new update with Magisk and dont lost TWRP and Root?
Please tell me step by step
thx a lot for your answers
Magisk doesn't touch the recovery. And you'll still have to flash the Magisk zip since the boot image is updated whenever you update your system (Magisk modifies the boot image).
What does stay after an update (as long as you don't wipe /data) is any Magisk modules that you have installed. If you have a bunch of modules that change build.prop values, debloat system apps, change screen density, replaces system UI sounds, etc, you won't have to do those changes again after an update. They are found in the Magisk image in /data and will be loaded by Magisk at boot.
Even if you've wiped /data, it's just a matter of flashing the Magisk and module zips in TWRP after updating your system. No tedious manual editing of build.prop or deleting apps, etc. It literally takes seconds...
If you have issues with loosing TWRP after an update, you can easily fix that, right after updating. Just keep a copy of the recovery image on your device and flash it in TWRP.

[Guide][How to flash magisk v14.0+ in non-primary ROMs flashed by Dual boot patcher]

Here I'm going to explain how to flash magisk or use magisk with magisk modules in non-primary (i.e. secondary, data, ext-sd slot) ROMs in dual boot patcher environment.
What's needed?
ROM or boot.img (Which should be flashed as non-primary ROM)
Magisk manager app
X-plore file manager (or any other file manager)
Now,
Install magisk manager app (latest)
Extract boot.img from ROM mentioned above
Now,
Patch boot.img using using magisk manager app,
To do so, open magisk manager, go to install/install/patch boot image file so file manager will be opened up, select extracted boot.img file.
Magisk will patch it then and save file in sdcard/MagiskManager folder with name patched_boot.img
Now,
Rename patched_boot.img to boot.img & replace boot.img of ROM.
Now flash ROM using dual boot patcher app.
Reboot
Non-primary flashed rom will be booted
Here install magisk manager app
Download magisk v14.3/ v14.0 from install/install/Download Zip Only
(Or you can download it from official magisk xda thread)
Flash magisk.zip manually just like flashing any other module.
Reboot
Done.
Enjoy magisk in non-primary dual booted ROMs!
Thanks!
Better & best method is here:
https://forum.xda-developers.com/showthread.php?t=2447534&p=74551998
Method 2..
Just patch Magisk v12.0
Flash from dual boot patcher
Reboot to non-primary ROM
Install magisk manager app (latest)
Flash magisk v14.0/14.3 manually
Reboot
Done.
How to flash magisk 14 manually in 2nd method?
lolnwl said:
How to flash magisk 14 manually in 2nd method?
Click to expand...
Click to collapse
Just open magisk manager app & flash magisk 14.3 just like flashing any other module.
lolnwl said:
How to flash magisk 14 manually in 2nd method?
Click to expand...
Click to collapse
Better try this..
https://forum.xda-developers.com/showthread.php?t=2447534&p=74551998
And can you give advice on how to install magisk on primary ROM (I mean after I installed Dual patcher)?
@dr.bathman Does "Flash from dual boot patcher" is same as flash rom on dual boot patcher app?
exodius48 said:
@dr.bathman Does "Flash from dual boot patcher" is same as flash rom on dual boot patcher app?
Click to expand...
Click to collapse
Download magisk v14.3 from attachment of below link
https://forum.xda-developers.com/showthread.php?t=2447534&p=74551998
Flash it just like flashing any other zip file (means patch it & flash)
little help
i did as mentioned in the DPB thread about flashing the modified magisk 13.4 for non primary rom and everything is ok but i dont know i try to install modules like viper4andrpod or adblock its there in installed but i cannot see viper in my system or can activate the adblock by terminal android ... should i patch the modules with the dual boot patcher !!?
thanks in advance
dr.bathman said:
Download magisk v14.3 from attachment of below link
https://forum.xda-developers.com/showthread.php?t=2447534&p=74551998
Flash it just like flashing any other zip file (means patch it & flash)
Click to expand...
Click to collapse
Do you have v14.0 stable?
exodius48 said:
Do you have v14.0 stable?
Click to expand...
Click to collapse
No, but v14.3 is working perfectly.
how i can activate the modules in the secondary rom should i patch the modules ?
I can't find the path to patch the boot img in magisk manager 5.5.5 (magisk 15.3)
Simonex16 said:
I can't find the path to patch the boot img in magisk manager 5.5.5 (magisk 15.3)
Click to expand...
Click to collapse
Open magisk manager, click on install. It will ask you if you want to patch a boot.img.
kloosgj said:
Open magisk manager, click on install. It will ask you if you want to patch a boot.img.
Click to expand...
Click to collapse
It asks me to flash magisk 15.3,nothing else
Easy step for Xiaomi MI Max2 & solution to lock screen issue.
--------------------------ROM1----------------------------
1.flash Custom-ROM-1 + flash magisk-v15.3-DBP-max2.zip--->reboot
2.setup Custom-ROM-1 + install DualBootPatcher.apk---->set kernel
=Now (Ramdisk is already up to date.)Status=
--------------------------ROM 2---------------------------
Patch Custom-ROM-2 with "DualBootPatcher-9.3.0.r409.g1ccd3798-win32.7z"
3.flash ROM-2_data-slot-1.zip--->reboot
4.setup ROM-2_data-slot-1 --->reboot
5.flash Magisk.v14.3(1437).zip
-IF Not show magisk'icon
5.1 install magisk-manager-v.555.apk
5.2 tap install update magisk.v15.3.zip
6.install DualBootPatcher.apk--->get Root -->set kernel
Note--Not try to pass safetyNet Check with "safetyNet Fix module".
https://mega.nz/#F!VuQmmKZS!qLT99EL17SKJ-7eevo9zzw
https://www.youtube.com/watch?v=yLSvCpZXZWI
Sorry need to ask the same: How can I install Magisk on my secondary ROM using DualBootPatcher? The "normal" way (patching and installing it) does not work - just brings me an error message.
Also installing MagiskManager and trying to install ZIP from there does not work.
So do I have to patch my secondary ROM ZIP with MagiskManage first and afterwards with DualBootPatcher and need to install the entire ROM again (loosing all data and settings)? Or can I install Magisk onto it somehow? (Reason is: 2nd ROM is RRemix and I cannot get root access besides using ADB and internal setting [which I did not try yet] - nothing worked yet to get it rooted!)
can Magisk 19.3 be installed
smallville7123 said:
can Magisk 19.3 be installed
Click to expand...
Click to collapse
Yes if you patch the bootimage of your RRemix ROM using Magisk. Then it can be used even with DualBootPatcher. But be warned! Do not update bootimage from within your secondary RRemix Magisk-rooted ROM - you won't be able to boot anymore afterwards (reflashing RRemix as secondary did the job and repaired it). If you want to update Magisk Bootimage you need to download it, patch your secondary RRemix bootimage with it and reflash secondary RRemix ROM completely using the patched bootimage.
I tried the first method and it worked thanks body.

Android PIE, Magisk and bootloop

After I've applied the OTA updated for Android Pie(V10.0.2.0.PDIMIFJ), using the classic restore image, apply OTA, patch image, reboot and profit. My phone started bootlooping, my first move was to restore boot.img, done, working again. Then I patched the original boot.img and flashed it using fastboot, the bootloop returned. Tried to clear ddr after flashing the patched image, reinstalled magisk manager, repatched boot.img, no success at all. Anyone having trouble installing magisk on PIE(V10.0.2.0.PDIMIFJ)?
Regards,
xdxita said:
After I've applied the OTA updated for Android Pie(V10.0.2.0.PDIMIFJ), using the classic restore image, apply OTA, patch image, reboot and profit. My phone started bootlooping, my first move was to restore boot.img, done, working again. Then I patched the original boot.img and flashed it using fastboot, the bootloop returned. Tried to clear ddr after flashing the patched image, reinstalled magisk manager, repatched boot.img, no success at all. Anyone having trouble installing magisk on PIE(V10.0.2.0.PDIMIFJ)?
Regards,
Click to expand...
Click to collapse
Search patched_boot.img for 10.0.2.0.PDIMIFJ and magisk manager.apk
Code:
fastboot boot patched_boot.img
Install magisk manager if is not already installed
Open Magisk manager and use Install option and select recommended instalation option
Reboot and you are rooted
fast_retina said:
Search patched_boot.img for 10.0.2.0.PDIMIFJ and magisk manager.apk
Code:
fastboot boot patched_boot.img
Install magisk manager if is not already installed
Open Magisk manager and use Install option and select recommended instalation option
Reboot and you are rooted
Click to expand...
Click to collapse
Hey! Actually the problem is related to some module i've installed, to remove this module I have to boot TWRP and remove magisk files, problem is that the \data is encrypted and current version of TWRP(or PBRC) is unable to decrypt . My only option so far is to format data. But i'm still waiting for a updated version of some recovery. Or any other ideas besides format.
Cheers!

Update lineageos OTA update and keep root access.

Hi
I installed LineageOS 20 on OnePlus 9 with the instructions on official wiki. Then I root my phone with Magisk. I install Magisk by sideloading the Magisk ZIP file and then install the apk as it's been explained in this video. Now I can't update the OS with updater in system settings. I find this guide that explained I need to uninstall and restore images in magisk then update my phone and reinsatall magisk before reboot. But magisk didn't create a backup during installation.
I followed this instructions to fix magisk stock backup does not exist
I create a backup with this guide and lineageos boot.img file and I can now restore images in magisk but I get the same error when trying to install the updates. I noticed that there is also dtbo in backup function and I did the same thing for backing up dtbo.img and it doesn't solve the problem. Is there anything I'm missimg. Should I use vendor-boot.img instead of boot.img?
mtuxz said:
Hi
I installed LineageOS 20 on OnePlus 9 with the instructions on official wiki. Then I root my phone with Magisk. I install Magisk by sideloading the Magisk ZIP file and then install the apk as it's been explained in this video. Now I can't update the OS with updater in system settings. I find this guide that explained I need to uninstall and restore images in magisk then update my phone and reinsatall magisk before reboot. But magisk didn't create a backup during installation.
I followed this instructions to fix magisk stock backup does not exist
I create a backup with this guide and lineageos boot.img file and I can now restore images in magisk but I get the same error when trying to install the updates. I noticed that there is also dtbo in backup function and I did the same thing for backing up dtbo.img and it doesn't solve the problem. Is there anything I'm missimg. Should I use vendor-boot.img instead of boot.img?
Click to expand...
Click to collapse
I just learned that Magisk doesn't work after an OTA update. What I do is I normally update, uninstall Magisk, boot into Lineage Recovery, sideload the Magisk .zip file via ADB, reboot, and finish setting up Magisk through the app. There are other ways to do this, but this method works well and doesn't need anything special. Works for me!
Alteratively, look here.
mtuxz said:
Hi
I installed LineageOS 20 on OnePlus 9 with the instructions on official wiki. Then I root my phone with Magisk. I install Magisk by sideloading the Magisk ZIP file and then install the apk as it's been explained in this video. Now I can't update the OS with updater in system settings. I find this guide that explained I need to uninstall and restore images in magisk then update my phone and reinsatall magisk before reboot. But magisk didn't create a backup during installation.
I followed this instructions to fix magisk stock backup does not exist
I create a backup with this guide and lineageos boot.img file and I can now restore images in magisk but I get the same error when trying to install the updates. I noticed that there is also dtbo in backup function and I did the same thing for backing up dtbo.img and it doesn't solve the problem. Is there anything I'm missimg. Should I use vendor-boot.img instead of boot.img?
Click to expand...
Click to collapse
ethical_haquer said:
I just learned that Magisk doesn't work after an OTA update. What I do is I normally update, uninstall Magisk, boot into Lineage Recovery, sideload the Magisk .zip file via ADB, reboot, and finish setting up Magisk through the app. There are other ways to do this, but this method works well and doesn't need anything special. Works for me!
Alteratively, look here.
Click to expand...
Click to collapse
I was exactly looking for this for my SM-T290, which also runs LineageOS 20. I think it is the most easy to deinstall Magisk root from the Magisk Manager, apply the update and then reinstall it. I think this also works with TWRP???
Minionguyjpro said:
I was exactly looking for this for my SM-T290, which also runs LineageOS 20. I think it is the most easy to deinstall Magisk root from the Magisk Manager, apply the update and then reinstall it. I think this also works with TWRP???
Click to expand...
Click to collapse
I'm installing an update right now. I would imagine it works with TWRP as well, but I only recently started using it.
I realize that this may be a late reply, however, there is no need to do any of these convoluted processes.
Here is what I do, flash the Magisk as a .zip in Lineage recovery once and set everything up. Once the Magisk install is working you can apply OTA updates normally without Magisk and root being removed. On my OnePlus 7 Pro which is an A/B device I just install the OTA and hit reboot with Magisk seamlessly persisting and nothing else being required to preserve or reinstall it. The reason that this works is because the Magisk.zip installs an addons.d script which automatically runs after OTA updates and takes care of Magisk for you.
I installed many Lineage OS 20 OTAs and I never had to touch Magisk at all, it is always installed and working with no intervention whatsoever. Keep in mind that this will only work on A/B devices with Lineage recovery (which you should all be using anyway).
droidman1992 said:
I realize that this may be a late reply, however, there is no need to do any of these convoluted processes.
Here is what I do, flash the Magisk as a .zip in Lineage recovery once and set everything up. Once the Magisk install is working you can apply OTA updates normally without Magisk and root being removed. On my OnePlus 7 Pro which is an A/B device I just install the OTA and hit reboot with Magisk seamlessly persisting and nothing else being required to preserve or reinstall it. The reason that this works is because the Magisk.zip installs an addons.d script which automatically runs after OTA updates and takes care of Magisk for you.
I installed many Lineage OS 20 OTAs and I never had to touch Magisk at all, it is always installed and working with no intervention whatsoever. Keep in mind that this will only work on A/B devices with Lineage recovery (which you should all be using anyway).
Click to expand...
Click to collapse
Well, I came to the fact I have a problem with TWRP. It uses OpenRecoveryScript for OTA updates and should also run addon.d scripts after it (Magisk uses this to survive an OTA). The only problem is that the scripts should run after the OTA flash, but for me, it doesn't. So I need to manually reflash Magisk and Gapps after installing an update. My data is encrypted, but I edited the addon.d script to flash the ZIP from the external SD card.

Categories

Resources