yashsingh1/xdaforums huggingface dataset:
[Magisk] gloops100:
I'm currently with Android 14 ; HyperOS 1.0.2.0

The goal is to upgrade to 1.0.3.0 without data loss and keep Root with Magisk modules.

But as I've only patched the "init_boot.img" and don't touch the stock "boot.img" ; does the "restore partition" in Magisk is mandatory for OTA update ?

Another thing :

- Magisk version is : 26.4

An update is available to 27.0 for Application. When I click to "update" ; something lauch and close directly;

=> Is it because I used previously "hide Magisk" option ?

=> What to do in this case ?

PS : TWRP doesn't work on my phone (not supported)
[Magisk] Fishawy:
I updated from 26.4 to 27.0 and lost root. The problem was the Magical Overlayfs module.

If you have that installed, remove it and try again.

Sorry I can't help with HyperOS update.
[Magisk] pndwal:
This is always mandatory for taking any Delta stock-ROM OTAs 'over the air'. You need to restore stock images for any that you've changed/patched since delta OTAs are incremental/differential updates that combine small OTA package data with existing partition data to create the partition updates (so the previous partitions must all be unmodified/bit perfect for expected data to be combined with differential data for changed blocks) as opposed to full OTA updates that may be available for download and don't require restoring stock images to create updates...

It doesn't matter which partitions are patched by Magisk, TWRP or any other mod. The update engine will do pre OTA checks to ensure that active slot partitions are from an unaltered previous version suitable for combining with OTA differential data to building the updated partitions by 'seamlessly' streaming the data to the inactive slot while Android is running and will halt the update with errors due to such mods/patches causing digest checks to fail in order to prevent corruption... Newer checks (that can break Magisk's Install to inactive slot function) are performed post-OTA to determine that newly created partitions match digest information delivered with the OTA and if errata is found the slot is marked as corrupted and un-bootable... The system will reboot to original stot. Of course if this kind of check is implemented Magisk cannot be installed to inactive slot because that needs to occur after OTA but with root and before reboot, so post OTA checks will detect Magisk patching in any OTA partition as a corruption.

Update app from within app often fails due to system limitations... The updated .apk will be located in the download folder set in Magisk App settings however. Close the App fully, locate the update .apk and install from file explorer...

🤠 PW
[Magisk] Frans:
Problem upgrading to 27.0

My Samsung T580 tablet running LineageOS 19.1 has problems with the upgrade to 27.0

I have downloaded the 27.0 apk from topjohnwu github, and uninstalled the existing magisk manager.

The new apk installs, then when opeining I get the question do you want to installl the full magisk manager. When I do so it installs but when I run the manager it tells me that the actual version is 26.4 and that the latest is 27.0

It offers the update button. That does download but still I stay at 26.4

Reboot and wiping cache did not help.

Anyone an idea?
[Magisk] gloops100:
You mean, if it's an incremental ; I need to "restore stock" before installing.

But currently, when I try to "restore stock" ; I've this error message : "stock backup does not exist"

I've created the boot.img.gz in folder : /data/magisk_backup_<hash>/boot.img.gz

But still the error message.

How to fix this please ?
[Magisk] Nergal di Cuthah:
Did you unhide magisk before updating?
[Magisk] Frans:
As far as I know I have never hidden magisk.

Not sure how I can check and unhide

In settings I see an entry Hide the magisk app, but I didn't use it. The app name is Magisk

In App-info it says the app is installed through Magisk.

It says version 26.4 com.topjohnwu.magisk
[Magisk] J.Michael:
When you created the file you thought Magisk manager was looking for, what "hash" did you use?

"Restore stock" is not exactly the same as using Magisk manager's "restore images".

"Restore stock" means restoring the contents of all partitions.

Magisk manager has an option that is intended to "restore stock", but it depends on using files created (copied) by an earlier incarnation of Magisk manager (or maybe by a script run by TWRP, or some other path). When it works, it "restores stock". It's not working for you. It's not an option for you. Move on.

I'm sure you've been told repeatedly to reinstall the original, not-modified-by-Magisk, ROM. That is the most reliable "restore stock".
[Magisk] gloops100:
But if I launch the OTA without restore image , I think I'll have issues...

Someone on Reddit find a solution to bypass Magisk :

Source :

https://www.reddit.com/r/Magisk/comments/1911zz4

Do you think it'll work ?
[Magisk] J.Michael:
You give no indication that you are responding to me.

I was trying to say that Yes, you need to restore; No, you do not need to use Magisk to restore.

The instructions you found on Reddit look like they could work. They also look more involved than you will be able to follow.

Have you made any effort to locate a full ROM you can download that includes the OTA update you are so anxious to have?
[Magisk] gloops100:
Ok thank you :)

I've downloaded the OTA update file and extract the stock files (boot.img and init_boot.img)

What will be the benefit to have the full ROM with OTA included ?

Yes I'm anxious because I had already some issue in the past (boot loop and loose all my apps,...). I don't want to have this issue again.

That is why I look everywhere and if possible find a good tuto to do upgrade :)
[Magisk] J.Michael:
The benefit to having the full ROM containing the updates that would have been applied by the OTA update is what you just did: you were able to extract the new "stock" init_boot image. If you had taken the OTA, you would have had another adventure finding a procedure to get a copy of the new init_boot image.

Also, now you can stop worrying about how to "restore" before taking the OTA update. Install this new ROM and then you can install Magisk exactly as you did the first time.

If you still have Magisk, now would be a good time to disable all modules, and unhide the Magisk manager. (I think none of that matters if you are forced to wipe data when you install the new ROM, but I think sometimes data does not get wiped.)
[Magisk] gloops100:
Finally @B!GBOY did the upgrade with this method :

1. tap install in the updater app

2. the update got installed

3. I went to magisk and tap install to inactive partition

4. it got installed and I pressed reboot

5. update is done, root still OK, no issue :)

All works well for me also !!!

Please note : we've the Xiaomi Mi Fold 3 ; rooted with Magisk (patch init_boot.img)
[Magisk] pndwal:
As I said, I'm not sure why initial backup failed; generally it's there if you follow standard installation instructions... Seems you flashed with FKM, maybe related to some difference there?... You could start fresh and see if stock init_boot is backed up properly with standard installation... Also, seems boot.img got messed up which is strange on your device... Maybe FKM or other mod you use patches boot.img as is too old to recognise A13+ devices using init_boot for init...

As above, but of course this is only needed for the luxury/convenience of preserving root with Install to inactive slot method, it may well not work on your modern device anyway for reasons I've mentioned above, and ability to use this simply basically only means you need not connect to a computer after an OTA... You can always restore images manually, take OTA then do initial Magisk installation (download full OTA ROM and extract boot image for patching) which is what all A-only device users must do anyway... Or just install full OTA (without restoring images if that works as is likely) and do initial Magisk installation after that.

🙃 PW
[Magisk] J.Michael:
I think he patched and flashed boot.img on his way to deciding that init_boot.img was what he wanted. Maybe Magisk fiddles some signature in the image it is patching and that was enough to keep it from booting.

I really dislike "take the OTA, *then* download a full ROM and extract an image to patch". If you download the full ROM and flash the full ROM there will be no doubt that the extracted image is exactly what was on the device -- taking the OTA there is a chance that the images do not match. Maybe not much of a chance, but why take the chance?
[Magisk] pndwal:
Yeah, just patching /boot would be enough to break delta OTA but not sure why it would boot loop if switching back to initial slot as it should, but he was manually switching slots and had issues with backup being absent so it's all confusing... Perhaps patching both boot.img and init_boot.img confused Restore images function too...

Yeah; had little time on way to work this morning and responded without even reading the other responses...same thought crossed my mind but was just posting about how delta OTA can still work even when Magisk's backup is broken simply by manually restoring images, and did so as I arrived our job site... Of course if one is going to install Magisk again and needs full ROM/OTA for boot image, installing update via delta OTA is pretty much a redundant exercise which is why I added "Or just install full OTA (without restoring images if that works as is likely) and do initial Magisk installation after that" a minute later before climbing onto the roof... Sorry if the thoughts appeared disconnected, but I tried with the limited time I had... (And lunch is nearly over now.) 🙂 PW
[Magisk] skorpiodav:
Hello people, I did update from 26.1 (or 26.4 I don't remember) to 27.0 by direct install. I had magisk hidden. After reboot Magisk has no root, when I open the magisk app I have the option to reinstall the app but this fails. If I install manually the app it cannot find magisk installed and there are not modules.

What should I do to fix it with no risk and maybe not losing all the previous settings (modules and app already with root permitted)?

Redmi 9 Lite, miui 12.0.10 Global. I have twrp installed if needed.

Can you help me please?
[Magisk] Nergal di Cuthah:
Uninstall the hidden magisk
[Magisk] skorpiodav:
I did, but I still don't have root, if I install a "new" magisk it ask me to patch the files
[Magisk] pndwal:
To be sure, did you search in device settings, Apps, for any interactions of hidden stub, maybe called 'settings' (default) itself if you didn't choose a name?... Also, install Applist Detector here:

https://github.com/Dr-TSNG/ApplistDetector

and it will detect package variations for hidden stub (as long as LSPosed HMA isn't hiding Magisk)...

Conflicting hidden App, not properly removed (very common issue on many devices) is the most common cause of apparent root loss after Magisk updates... To see if you really still have root, type magisk -c in a standard terminal emulator (avoid termux for this)...

🤠 PW
[Magisk] skorpiodav:
Thank you for your answer. I don't understand what I have to look for but yes the previous Magisk app was called "settings" after updating to 27.0 (no errors) and after the reboot opening that app returned the message "magisk is hidden but without root cannot works please reinstall the app" (something like this) and there was a button to "Reinstall" that after pressed returned 3/4 times "Failed" so I did uninstall this app.

Attached results of what you asked
[Magisk] Nergal di Cuthah:
Obviously you didn't uninstall it because it's still showing in your screenshot.
[Magisk] J.Michael:
If you really uninstalled the hidden version of the Magisk manager app, did you then rerun the unhidden Magisk manager app? What version does it say it is? (First screen when you open Magisk manager app, top panel describes the Magisk (if any) installed in the boot partition; second panel from top describes the manager app itself.)

If the unhidden manager app doesn't run, uninstall it. Once you have no Magisk manager app installed, install the one you are trying to use (you said 27).

I think the fact that the message when you tried to run magisk from a command prompt was "permission error", rather than "file not found", indicates that you do, indeed, have Magisk installed, you just have to get out of its way.
[Magisk] Nergal di Cuthah:
Does the command have to be su. Also why avoid termux (i don't use it but curious).

Edit: answered my own question by trying it without. It does not need su
[Magisk] zgfg:
On which of his two Settings apps you see hidden Magisk app?

First one is an app from Playstore

And Termux is not the only valid Terminal Emulator.

Specially, if he previously had his TE app, and previously had it granted root, then using the same TE again is the good test - but by testing eg su
[Magisk] pndwal:
So did you ignore the messages (reinstall from app often just doesn't work), close the hidden app then manually uninstall it before trying to install the full app?; it's not clear...

I'm not sure about permissions message either... Should just get 'file not found' etc if uninstalled... Looks like AD can't detect either but permission issues make be stopping that too... 🤷 PW
[Magisk] pndwal:
Yup.. don't need su...

Termux is great but not a simple TE.... It comprises a whole independent Linux environment that behaves differently from Android environment and can confuse inexperienced users...

Sometimes full paths are needed when not on a stand-alone TE or other configuration/environment protocols differ.

👍 PW
[Magisk] pndwal:
Yeah, MIUI hidden settings... Second seems to be a system app... So does appear to be removed... PW
[Magisk] skorpiodav:
I did uninstall the hidden magisk app, the first app is a miui app to Edit some settings, I don't know the second one but is not the icon or the package name of the hidden magisk, I assure you.

I did uninstall the hidden magisk, with the manual installation it shows N/A (Attached screenshot). I use Material Terminal, is it ok?

Thank you mate for trying to help me, I appreciate a lot, I hope I can restore the situation or at least to reinstall Magisk with no harm...

I tried to reinstall Magisk from the hidden app but it fai led, so I tried to install manually and after i deleted both apps (since they didn't work). I tried another reboot too but I don't want to risk another one (just in case). Ty.
[Magisk] pndwal:
Strange that root now seems to be gone... Did You ever take uninstall options from Uninstall Magisk in App?... Either way freshly patching boot.img and flashing via fastboot shouldn't cause you any concerns... If you get a bootloop you can always try fixing with safe mode, and if still have issues just fastboot flash un-patched boot.img to get back to how things are now... 🙃 PW
[Magisk] skorpiodav:
I did not uninstall magisk before the update, I don't remember if I ever uninstalled the app, If I ever did I restored the app from hide and then uninstalled.

Since in the past I patched (updated magisk) by recovery (twrp) do you think I can do in that way? The risk is for the "latest" phones or also for the latest version of magisk? I will lose my installed modules? Ty
[Magisk] J.Michael:
Your installed modules are a collection of subdirectories of /data/adb/modules -- you won't lose them unless you wipe data.

You might be better off losing them -- one of them might not be compatible with the new Magisk.

Does your TWRP have a file manager? Try renaming /data/adb/modules to /data/adb/notmodules. Then try patching boot image with Magisk manager app and flash patched boot image.

Circling back to the mystery about running "magisk" in a terminal window and getting a permission error:

which magisk
ls -l $(which magisk)
[Magisk] skorpiodav:
What if I install back 26.4 instead 27.0? Could I recover modules and settings too?

Thank you for the info to rename folder modules.

I did the terminal commands now before re-installing (flashing), is it ok? I didnt understand if I had to do now or not.
[Magisk] pndwal:
I wasn't talking about the App; it's not Magisk, just a 'dashboard' UI 😉 ... Asked if you used this:

... Or (old school) renamed and ran magisk.apk as uninstall.zip from custom recovery.

Sure, you usually can... Won't work for many Android 9 LV A-only devices (Ramdisk - No) but still does for most others... In-app patching is more universal however. And nb. patching with from unbooted system like custom recovery .zip installer installation now only gives partial root (as new refactoring to improve compatibility accross devices means selinux/module rule directory cannot be selected until system is booted), but enough to enable Direct Install option in App... You'll now be prompted to complete Magisk installation by taking Direct Install on opening Magisk App...

No real risk... It'll work or it won't... Modules will remain if /data/adb files (Magisk configuration) are still intact... Nb. Modules normally remain compatible with Magisk updates but not necessarily with Android/system upgrades.

🙂 PW
[Magisk] Frans:
I am still stuck in getting magisk to upgrade from 26.4 to 27.0 on my tablet running LineageOS 19.1

I have completely uninstalled the manager app. Applist Detector gives me not found checkmarks everywhere

with one exception. Under Abnormal Environment it lists TWRP as being suspicious.

If I then install magisk 27.0 (downloaded from TopJohnW's github, it installs the basic magisk app. If I launch that one it asks me if I want to install the full magisk manager. When I do so it installs but when I start the app afterwards it tells me that Magisk is at 26.4 (26400) and the app is also at 26.4 (26400) whereas the actual vrsion is reported to be 27.0 (27000).

This is already odd as I installed 27.0

Also the update button is there. If I click it it downloads 27000 again but nothing happens.

Installing the newly downloaded 27000 (without uninstalling the 26.4 that I installed just before, I get a message

"App not installed as package conflicts with an existing package"

Anyone an idea what is going on?

(note that I did not use the Uninstall Magisk button mention in the previous post.

Oh and I already tried erasing the cache. Did not dare to erase the store as I feared ti would e.g. remove plugins
[Magisk] trevtdogg:
bit of a noob question I know, but I really don't want to have to wipe my device if something goes wrong...

what is the recommended safe / easy method for upgrading magisk?

I'm on a11, moto edge 20 fusion, stock rom, lsposed, zygisk, no magisk hide, in case any of that matters.
[Magisk] skorpiodav:
Sorry to not understanding what you did mean. No, I haven't uninstalled Magisk, only the App.

Thank you for your support. I did try something before your answer (since you and J.Micheal helped me a lot to figure out how the things work) so I did a reflash of Magisk by TWRP, at the beginning it did not work so I uninstalled Magisk with uninstall.zip and reinstalled the 26.4, like you explained it asked me to flash it inside the App and after that it worked, I did lost modules since I forgot to rename/backup (I guess they were purged by uninstall) but like J.Micheal wrote was better to cleanup modules. So without modules (not so big loss) I updated again from inside the app to 27.0 and now seems everything is ok, even with modules installed (it seems I needed only one module after all, the one to detach some apps from playstore).

Thank you very much again, I did learn something and had the reassurances for not losing my data or brick the phone. Have a nice day <3
[Magisk] J.Michael:
You say it turns out you only needed one module. At any point after installing Magisk 27 did you have all of the original modules installed? If not, then it could be that one of them was not compatible with 27. Or, if uninstalling Magisk wiped the /data/adb directory, maybe something about the Magisk database needed to be redone. If that were the case, I would expect that everyone who updated to 27 would have a problem, and I am not getting that impression.

I am still confused about your terminal emulator and whether it is ever possible for you to use it. Before you were asked to try running magisk from a command prompt, had you ever used this terminal emulator? Now that Magisk is properly installed, can you run all of the commands you tried earlier? ("magisk -c", "which magisk", "ls -l $(which magisk)")

It's not important now, but I think you should figure out whether you can count on this terminal emulator *before* the next time you need it.
[Magisk] Wolfcity:
If the one module you're using is the latest zygisk-detach (and I recommend it over older modules) it's not the one causing trouble for you.

I updated to magisk 27 with that module installed, had also trouble with a hidden magisk app but solved it as usual by uninstalling the hidden app.

For the rest follow the steps @J.Michael mentioned. And for the future don't forget to unhide magisk before updating.
[Magisk] pndwal:
Magisk v27.0 was promoted to public Stable:

Update README​

topjohnwu committed yesterday

For changelog info see:

https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-89316958

👍 PW
[Magisk] zgfg:
He already had (previous page) No permissions for magisk -c

Hence which will not find magisk

IMO, he has successfully removed his old hidden Magisk app, but after upgrading the Magisk

And frankly, I don't understand does he still have Magisk ('mask') now or not (he should have but his new Magisk app does not find it although the old app was deleted....)

@skorpiodav will need to parch his boot img again and fastboot boot into

Then to do Direct install. If he didn't reformat or wipe /data, he will find his old modules, etc
[Magisk] pndwal:
Note: uninstall.zip is the old school equivalent of Uninstall Magisk, Complete uninstall, so your original modules etc will have been removed when you ran that...

Exzachery... All Magisk configuration (in /data/adb) will have been removed...

👍 PW
[Magisk] SteweEliteModder:
Galaxy S22 Ultra here, latest firmware update (S908BXXU7DXA6), patched boot.img through magisk v27.0, flashed by odin, and lost the root, then patched boot.img with old version 26.4, flashed by odin, and got the root again, so... conclusion... latest magisk version 27.0 has some issue to fix.
[Magisk] pndwal:
Please can you clarify this last bit? (Maybe include a screenshot)... I'm confused about "whereas the actual vrsion is reported to be 27.0 (27000)"... if "Magisk is at 26.4 (26400) and the app is also at 26.4 (26400)", please say where you see 27.0 (27000) reported...

Yeah, I'm suspicious some strange regression is affecting certain devices, but no proper issue report yet... 🤷 PW
[Magisk] Feenix0:
AFAIK Magisk has to already have root access to update itself, which is why initial install requires flashing an image. The update process might have gone through the motions without actually changing anything, therefore you still see that you have v. 26.4.

Perhaps you need to verify that you have root before another install/upgrade attempt?
[Magisk] pndwal:
Well Direct Install is the update process and it simply isn't available unless App sees/has root access... If 'Update Magisk' was offered, really it should simply have worked... PW
[Magisk] esatch:
Hi.

I'm on redmi note 13 4g miui 14 and I'd like to update with the new version.

I've "messed" with system partition so I don't think using magisk's uninstall before ota/inactive slot method would work.

Can I install the new updated full rom from fastboot without worries? (selecting to keep user data in miflash or command prompt).

If so, do I mandatory have to disable/remove modules or magisk, restoring init_boot.img before flashing?

Am I missing something?

Thanks.