Magisk - Installation and troubleshooting


I am no longer involved in the Android modding scene and haven't been for some time. I don't have the energy or will to take it up again... This guide will no longer be updated.

If anyone feels like taking over, give me a holler.

So long and thanks for all the fish.


Table of Contents






Installation


Where to start

It’s always a good idea to read through, at least, the official Magisk Documentation over on GitHub. Other useful information can often be found in the XDA support thread.

Known issues

There may be issues with certain devices, ROMs and/or apps and Magisk. Check the Magisk FAQ for some information about currently known issues.

Things to keep handy

There are a couple of things that are good to keep accessible, making it easier to recover from any problems that might arise.



Installation

Installing Magisk is usually quite straightforward, but make sure to follow the installation instructions in the official Magisk Documentation. After you've got Magisk installed you can install Magisk Modules through the app or via a custom recovery (e.g. TWRP).

Since Google and different OEMs are changing things a lot starting from Android Pie, there are popping up more and more limitations for installing and running Magisk. Make sure to take a look at the docs to see if there's any specific instructions that apply to your device.

Note! On A/B devices it is a good idea to not install TWRP, but only boot it through fastboot:
fastboot boot twrp.img

Actually installing TWRP may lead to issues booting the device if you also install Magisk, since the recovery resides in the boot image.

Advanced Settings/Install options

From Magisk app v8.0.0 these options will only be available on supported legacy devices. For most modern devices they simply won't show, since they have the possibility of causing way more issues for the general user than it's worth. The tools are still available for advanced users and developers in magiskboot.

If you do not see these options, it usually means that you do not need them. If you still do, for whatever reason, there are other options to reach the same functionality (Zackptg5's universal disabler is a prime example). Just not through the Magisk app.

Preserve AVB 2.0/dm-verity
This is used to disable or preserve Android Verified Boot on your device. Dm-verity is used by the system to ensure that the device hasn't been tampered with in and let's the user know if this is the case. Since we do want to tamper with the system, most devices want to disable this when installing Magisk. But, there are those devices that need it to still be enabled or they won't boot. See "Working with dm-verity and forced encryption" for more details.

Preserve enforced encryption
By default, Android encrypts user data and the kernel enforces this state so that you cannot use your device without encryption. Some user do want to disable encryption on their devices, and if so they need to have this option disabled. See "Working with dm-verity and forced encryption" for more details.

Recovery mode
What is this "Recovery mode" that I see in the Magisk app?

Recovery mode needs to be enabled if you are installing Magisk on a device that doesn't have ramdisk in the boot partition. On these devices you need to install Magisk into the recovery image rather than the boot image, hence "Recovery mode". For details, see the official installation instructions in the Magisk documentation linked above.

Note though, that since Android is such a fractured ecosystem, detection of the ramdisk might not always be accurate (Xiaomi). So, if the result in the Magisk app is "no ramdisk", but patching the recovery image fails, give the boot image a go instead.

If you're using an older version of the app (that's not something that'll be supported, of course) that doesn't show if there's a ramdisk present, you can go by the general rule that a system-as-root device that doesn't have an A/B setup likely will have to install Magisk to recovery.







Installation Issues


Can't install from the Magisk app
When trying to install/update either the app or Magisk in the Magisk app v8+, some users experience that nothing happens. Usually this is caused by having a custom hosts file, or similar, that is blocking the CDN used by the Magisk app (JSDelivr). The solution is to whitelist that URL.

Installation through recovery fails

If installation through recovery fails, make sure to save the recovery log (see Asking for help) and share that in the support thread together with all and any details you can provide.

If your custom recovery is a bit outdated, this might be the reason why the installation fails. Try letting the Magisk app patch your devices boot image and then flash this to your device, either in recovery or through fastboot/download mode, Odin or similar. See the release thread for instructions.

Cannot mount /vendor

If you get this message, "Cannot mount /vendor", when trying to install Magisk through TWRP it usually means you have a Treble device but the TWRP version you have installed is not Treble compatible. Simply find an updated Treble compatible TWRP for your device.

Where's my boot/recovery image for the Magisk app to patch

When trying to patch the boot or recovery image of your device with the Magisk app, you will first have to get a copy of the stock image, place this on your internal storage where it will be accessible for the app and then select it according to the instructions. After that you can flash the patched image to your device, either in recovery or through fastboot/download mode, Odin or similar

Most of the time you can find the stock boot or recovery image in your factory image/firmware package/ROM. Unzip it and look for the boot.img file. If you're unsure on how to go about acquiring the stock boot/recovery image for your device, ask for help in your device's forum.

On some devices you won't find an image file in the firmware, but a payload.bin file that you need to unpack to get to the boot image. A web search is your friend and this is a great time to practice your Google-Fu, but XDA member ipdev has a good description and example here: https://forum.xda-developers.com/t/magisk-general-support-discussion.3432382/post-84572491
If you want to try doing it on your device you can test something like this: https://forum.xda-developers.com/t/tutorial-android-ota-payload-dumper-on-android.4061799/
If you need tools for other operating systems (or have other reasons why the above examples don't work) they're just a web search away...

Another way, if you have access to TWRP for your device, is that you can make a backup of your boot image in TWRP and then simply rename that backup file to .img.
It is also possible to dump the boot partition directly from the recovery terminal, by entering the following:
dd if=/dev/block/bootdevice/by-name/boot of=/sdcard/boot.img

That will save the device boot image to the internal storage, ready for you to patch.

If you for some reason want to install Magisk by patching the boot or recovery image but you already have Magisk installed you might be able to find a copy of the image in /data/magisk_backup_<sha1 checksum>. Before patching, Magisk saves a copy of the untouched image there. Note that it's compressed, so you need to unpack it before flashing to your device.

If you're trying to find a stock boot image because you're moving from SuperSU to Magisk, there might be a backup of the stock boot image in /data that you can use.

Invalid image: not signed

If you see a message in the install log, stating "Invalid image: not signed", that simply means that your boot image isn’t signed. It’s perfectly normal and nothing to worry about.

Working with dm-verity and forced encryption

Since Magisk app v8.0.0 the advanced settings/install options for dm-verity and forced encryption won't be available on most modern devices (see Advanced Settings/Install Options for details). The tools are still there and may be accessed through various means.

Keeping dm-verity and forced encryption
If your device supports it, the app will auto-detect if your device is encrypted and if it’s recommended to keep dm-verity enabled and the “Preserve forced encryption” and “Preserve dm-verity” will then be enabled by default. If these options aren’t enabled, you can keep dm-verity and forced encryption by checking the options for this before installing a new version of Magisk through the app.

If you install through recovery (either for the first time or as an update) run one or both of the following commands in a terminal emulator or in your recovery's terminal before installing:
echo KEEPVERITY=true>>/cache/.magisk
echo KEEPFORCEENCRYPT=true>>/cache/.magisk

If you can't access /data (TWRP can't decrypt, etc) you can instead use either /data/.magisk or/system/.magisk, but please note that using /system/.magisk isn't systemless.

Some devices need to keep dm-verity enabled to work properly. One example is some Huawei devices that might otherwise experience weird behaviour or bootloops.

Disabling dm-verity and forced encryption
If you on the other hand want to disable either dm-verity or forced encryption, you can go about it the same way as described above. If you're using the .magisk file method, just change KEEPVERITY and/or KEEPFORCEENCRYPT in the commands to false:
echo KEEPVERITY=false>>/data/.magisk
echo KEEPFORCEENCRYPT=false>>/data/.magisk

If you can't access /data (TWRP can't decrypt, etc) you can instead use either /cache/.magisk or/system/.magisk, but please note that using /system/.magisk isn't systemless.

If disabling verity through Magisk doesn't help, you can try the following command (provided that your device has a vbmeta.img):
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img


Moving from another systemless root solution to MagiskSU

If you wan't to install Magisk but already have a systemless root solution installed (SuperSU, phh's superuser) you'll have to first remove that.

SuperSU
With SuperSU, most of the times you can simply use the full unroot option in the SuperSU app and let it restore your stock boot image, alternatively use the full unroot option and then flash the stock boot image before installing Magisk. When moving from SuperSU to Magisk, you might have a backup of the stock boot image in /data (compressed).

unSU script
Otherwise, and this applies to any other root solution as well, you an use osm0sis unSU script (in recovery) and then flash your device's/ROM's stock boot image before installing Magisk, or you can dirty flash your ROM.

Prerooted ROM
If your ROM is prerooted it's quite likely that you can still use the boot image from the ROM zip. Many ROMs simply flash a root zip at the end of the ROM installation. If this doesn't work you'll have to check with your ROM developer on how to find an unpatched boot image that work with your ROM. Also see "Boot image patched by other programs" below.

If you're using TWRP you can flash the boot.img file pretty much the same way you would with a zip (Install - Install Image - navigate to the image file - choose "Boot" - swipe).

Dirty flash
Another option is to simply dirty flash your full factory image/firmware package/ROM. As long as it isn't pre-rooted this will remove any traces of root and you can flash Magisk. Depending on your setup/device you have to flash Magisk straight away to prevent dm-verity to trigger, TWRP being replaced by stock recovery, etc.

Boot image patched by other programs

If the installation (or uninstallation) through recovery fails with a message about the boot image being patched by other programs you need to follow the instructions given with the message. You most likely have some other systemless root solution (SuperSU, phh's superuser) or there's something else that have added it's patches to the boot image that will interfere with Magisk and cause the installation/uninstallation to fail. Magisk is not compatible with with any other root solution (SuperSU compatibility was removed in Magisk v13.1). If you're already rooted, first unroot (osm0sis unSU script is good for this). Also see "Moving from another systemless root solution to MagiskSU" above.

You'll have to restore a stock boot image without any other patches before installing/uninstalling Magisk. If you're using TWRP you can simply flash the boot.img file pretty much the same way you would with a zip (Install - Install Image - navigate to the image file - choose "Boot" - swipe).

When moving from SuperSU to Magisk there might be a backup of the stock boot image in /data (compressed) that you can use.

The boot image can usually be found in your device's factory image/firmware file. If you're using a custom ROM it's found in the ROM zip. Also see "Where's my boot image for the Magisk app to patch" above.

If your ROM is prerooted it's quite likely that you can still use the boot image from the ROM zip. Many ROMs simply flash a root zip at the end of the ROM installation. If this doesn't work you'll have to check with your ROM developer on how to find an unpatched boot image that work with your ROM. Also see "Moving from another systemless root solution to MagiskSU" above.

Of course, you can also use a ROM that does not come pre-rooted (IMHO, the preferred way).

If you have a completely stock boot image installed and still get this message, there's likely some kind of incompatibility between your device/ROM and Magisk (see Asking for help for info on what to provide when asking for support).

Process error

If there's a "process error" when installing Magisk it is usually caused by the app not having storage permission. It might also be fixed by clearing data for the app.

Additional setup failed

If you get a message when opening the Magisk app after installing or updating Magisk, that additional setup is required and that it fails, try uninstalling the Magisk app and install it again manually.







Uninstall


How to uninstall

If you somehow need to uninstall Magisk you have two options:

Magisk app
When booted to Android you can use the Magisk app to uninstall. Press Uninstall - Complete Uninstall. The app will run the uninstall script, uninstall itself, and then reboot. The stock boot image will be restored and all Magisk related files will be removed from your device. Be careful when using this option. As an example: if you have disable forced encryption and decrypted your device, that will now likely be enabled again (since the stock boot image has been restored) and your device will encrypt when rebooting.

Recovery
When booted to a custom recovery, you can use the uninstall zip (rename the Magisk app apk to uninstall.zip) to uninstall Magisk. It uses the same uninstall script as mentioned above.

If experiencing issues, take a look at Uninstall Issues.

Note that older uninstall zips might not uninstall newer versions of Magisk.







Uninstall Issues


Bootloop after uninstalling

Experiencing a bootloop after uninstalling Magisk, either through the app or with the apk renamed to uninstall.zip and flashed through recovery, might mean that the boot image hasn't been restored correctly or that dm-verity otherwise triggers.

Try one of the following:

Uninstall zip doesn't work

If the uninstall zip doesn't work (reports an error, TWRP can't mount/decrypt /data, etc), first try rebooting TWRP. If that doesn't fix things, try booting back into Android and use the Magisk app to uninstall. If you can't boot, try enabling Safe Mode (in case it's a Magisk module causing issues), see Disable all modules under Module causing issues.

It's also possible that a previous version of the uninstaller works, if the current one doesn't. You'll find earlier releases on GitHub.

Lastly, if nothing else works, restore a stock boot image for your device/ROM and see if the device boots (you might have to dirty flash your ROM). If the device boots, try installing Magisk again. The boot image backup might have been corrupted/be incompatible with the current uninstaller. After this you might be able to use the uninstaller to remove all traces of Magisk.







Updating

If there's an update to Magisk, you'll get a notification from the Magisk app (if you haven't turned it off, that is). You can update through the app or download the Magisk apk from GitHub (never download Magisk files from anywhere else!), and flash in recovery (after changing the .apk extension to .zip). Make sure to read the release notes and the changelog, both can be found in the Magisk Documentation. Any modules you have installed may have to be updated to conform with possible changes to Magisk.

Unsupported Magisk version

After updating the Magisk app you might get a message that the updated app doesn't support your installed version of Magisk. Here you have two options, both involving manually upgrading Magisk to a supported version. Download the Magisk zip and flash it from TWRP, or downgrade the app to a release that supports your current Magisk version and flash the zip from the Modules section of the app. This is done exactly like when installing a Magisk Module manually, by clicking the "Install from storage" button and selecting the zip.

Updating issues

If you're having problems updating to a newer version of Magisk (bootloops, etc), start by disabling your modules, in case one or more of them are causing issues. This is easiest done by enabling Safe Mode or the ADB command to remove all modules (see Disabling/uninstalling modules manually). You can also try to uninstall Magisk and start over with a clean installation of the new Magisk version.

MagiskHide or SafetyNet fails after an update

If MagiskHide or SafetyNet starts failing after an update to either Magisk, the app or both it's usually fixed by toggling MagiskHide off and on (also see ”Test MagiskHide”).

Magisk not installed after updating

When updating Magisk there might sometimes be issues related to the Magisk app, where the app might report that Magisk isn't installed. If you have the app hidden/repackaged you might end up with two apps installed, etc.

The solution is usually to uninstall the app (or both if that's the case) and install it fresh. If the app can't be reinstalled you might have to do some manual work to get things working. Take a look under "Can't install the Magisk app" for details.

If you experience the "Magisk not installed" issue randomly, see "Randomly losing root" for details.







Magisk Issues


Bootloop

If you end up in a bootloop when installing Magisk, flash the Magisk app renamed to uninstall.zip in recovery (you migth also have to flash a clean boot image, which will help if there's something wrong with the boot image on your device) and start over. If the uninstaller fails or you do not have access to a custom recovery on your device, just flash your unmodified copy of the boot image and you should be good to go. There will probably be some leftover files and folders from Magisk laying around in /cache and /data/adb, but that shouldn't be an issue.



Some devices might need a more hands-on approach to disable dm-verity, or the device will bootloop when installing Magisk. See Working with dm-verity and forced encryption for more details.

It is also possible that the device is refusing to boot because you've added system apps or processes to the MagiskHide list. That's not a good idea... Only add the apps detecting root to the Hide list. Also see "System instabilities" below.

Another big cause for bootloops are modules that are incompatible with your device/system. Keep reading below.

Bootloop after module installation or device update
If your device bootloops after installing a Magisk module, or after updating your device (there might be an incompatible module installed), see "Module causing issues".

A/B devices (Pixel, etc)
Many users are reporting about bootloops on Pixel and other A/B devices. Often this is caused by having TWRP installed at the same time as installing Magisk. Since the recovery now resides in the boot image, having these two modifications to the same partition may cause issues. If you want to use TWRP, use fastboot to only boot it, don't install:
fastboot boot twrp.img


Android 11
Bootloop on Android 11 is also often caused by having TWRP installed (just as above). Boot it, don't install.

Custom kernel
If your system bootloops again and you're using a custom kernel, try starting over without installing that kernel. If there's still a bootloop your system might just not be compatible. One possibility is to try finding another custom kernel that is compatible.

Magisk update
If there’s just been a new Magisk release it’s also possible that there might be something with Magisk causing the issue. Just keep calm, restore your device like described above (also see Updating), but first make sure to provide proper logs (see "Asking for help/reporting bugs").

DM-verity and Forced encryption
Another thing to try if your device ends up in a bootloop when flashing Magisk, is to keep dm-verity and force encrypt enabled (be very careful when working with modern Android devices though, you might cause more issues). By default Magisk might remove these flags from your boot image which on some setups have been reported to cause a bootloop. See "Working with dm-verity and forced encryption" for more details.

Module issues
A bootloop might also be because you’ve installed a module that Magic Mounts new files or folders to the root of /system, etc. On some devices this will cause a bootloop. Contact the creator of the module you’re trying to install and let them know… Also see "Module Issues".

Special cases
Some devices need special modifications to the boot image to not bootloop with Magisk. Sony is one of these manufacturers, where you may need to disable RIC.

Magisk not installed

After installing Magisk, if the app still reports that Magisk is not installed, check if the app has been installed to the external or adoptable storage. This is known to cause all kinds of issues, so make sure that the app is installed to the internal storage and check again.

This might also be happen when the Magisk app update doesn't go as planned and you end up with two app installed or the app doesn't actually update. Something that might lead to issues... See "There are two Magisk apps" or "Magisk not installed" for further details.

Some users seems to experience this issue randomly, where Magisk seems to uninstall by itself. See "Randomly losing root" for more details.

System instabilities

If your system suddenly becomes unstable, with reboots and system processes stopping, make sure you haven't added any system apps or processes to the MagiskHide list. Because of the way MagiskHide works, it might kill off some pretty important parts of the running system if this kind of apps/processes are on the list, causing all kinds of havok.

Only add the apps and processes that actually detect root to the MagiskHide list.

Apps are force closing


Apps on the MagiskHide list
If apps on the MagiskHide list are force closing, simply remove them from the list. You should only add the apps and processes that actually detect root. Adding anything else to the list, that doesn't need to be there, may cause instabilities in your system (also see "System instabilities" above) Note: It's not about the number of apps on the list, but which apps are added.

WebView issues
If a bunch of apps suddenly start force closing after installing Magisk, your ROM might have issues with WebView. More precisely with the signatures for Chrome and Google WebView. You can take a logcat when one of the apps crash and see if there's anything about WebView in there. The reason is that MagiskHide sets ro.build.type to "user" and this enables the signature check. Ask your ROM developer to fix the signature error... Meanwhile, you can fix it temporarily by disabling MagiskHide, use the Magisk module MagiskHide Props Config to revert the prop value, or use a boot script to revert the MagiskHide prop change (see "Reverting prop values set by MagiskHide").

It's also possible that removing and reinstalling Chrome stable or Google WebView (or simply installing one of them if it's not already installed) will fix the issue. If nothing else, installing Chrome Beta should work. After that you can go to Developer options -> WebView implementation and select the corresponding implementation.

It might also be possible to use Chromium. There are several Chromium installers available both in the Play Store and on F-Droid.

Other
If it's not an issue with MagiskHide or WebView, grab a logcat from the crash and post it together with lots of details in the support thread (also see "Asking for help/reporting bugs").

Developer options disappeared from settings

If Developer options suddenly disappeared from settings after installing Magisk, it's probably because MagiskHide changes ro.build.type from "userdebug" to "user" (known "safe" prop value). On some devices/ROMs this prop need to be set to "userdebug" to show the Developer options.

You can use the Magisk module MagiskHide Props Config to revert the prop value, use a boot script to revert the MagiskHide prop change, or temporarily disable MagiskHide (also see "Reverting prop values set by MagiskHide")

Or, there's a much better solution... You can ask your ROM developer to add this commit.

Beginning of crash

In the Magisk log you'll sometimes see "--------- beginning of crash". This is perfectly normal and unless you experience issues with Magisk it is nothing to worry about. Since Magisk uses Android's logcat for collecting logs this will appear in the log as soon as there is any kind of crash occuring on your device, regardless if it has anything to do with Magisk or not.

Wifi stopped working

If your Wifi stops working after installing Magisk and you're using a custom kernel, try reflashing said kernel.

Magisk isn't working

If you can boot up, but Magisk isn't working as expected (not detecting the Magisk installation, loss of root, etc), there are a few things you can try.


  1. Reboot. Sometimes this helps Magisk mount everything as it should.
  1. Try removing any installed modules to see if it's a faulty module causing issues. If that seems to fix it, install the modules one at a time to find which one causes issues.
  1. If nothing else works, try starting fresh with a new installation.
  1. If you still can't get things working, check here: "Asking for help/reporting bugs".








Magisk app Issues


Can't install the Magisk app

If the Magisk app doesn't get installed when you flash the Magisk zip, or that you're trying to install the apk manually and it doesn't work, you might first have to remove remnants of an old installation. This can be done through ADB. Start by uninstalling any currently installed app (especially if it's repackaged with a random package name) and then just run the following command from ADB Shell and you should be good to go:
adb uninstall com.topjohnwu.magisk


Problem parsing the package

"There was a problem while parsing the package". If you see this message while trying to update the app and the app is hidden, go to the app settings and choose to "Restore Magisk app ". The new app release will be downloaded and installed with the regular package name and you'll just have to rehide the app again afterwards.

If you don't have the app hidden, but still see this message, try clearing the app cache, or if that doesn't work uninstalling the app and reinstalling it again (you'll find the apk on GitHub).

Clearing cache and data

If there are issues with the Magisk app, it's often a good idea to clear data for the app. All your granted superuser requests and apps added to the MagiskHide list will still be intact (since they're saved elsewhere).

Latest show "N/A"

If the information for the latest available Magisk or app just show N/A you either do not have internet access (or you have something blocking internet access for the app), or you might have an invalid link set for the custom update channel in the app settings. This could be, for example, caused by the links to the Canary channel json file has changed.

Tip: Instead of putting the link to the Canary channel in a custom update channel, simply download the Canary app from GitHub and pick the make sure the Canary update channel is selecte in the app settings. That way you won't have to keep track on if and when topjohnwu changes the link.

Magisk app crashes/freezes

If you're having issues with the Magisk app force closing/crashing/freezing at any point, clear data for the app or uninstall it and install it again. Note that you might have two apps installed, the regular Magisk app and a hidden one with a random package name. You'll need to uninstall both...

Theming
The app crashing might also be caused by using a theme engine to theme the app (Substratum, etc). Disable it and reapply after an update to the app .

Magisk app installed to external/adoptable storage
Installing the Magisk app to an external or adoptable storage is known to cause issues. Reinstall it to the internal storage.

Magisk app as a system app
Another reported reason for the app crashing is if you've for some reason added the Magisk app as a system app. If this is the case try de-systemising to see if that fixes the issue.

Trying to install modules in the Modules tab
If the app crashes when pressing the "Install from storage" button in the Modules window, it's likely caused by your ROM not having a file explorer installed. Install one from F-Droid or the Play Store.

Cant' fix
If there still are issues, capture a logcat from the crash/freeze and post it in the support thread or as an issue on GitHub (just make sure to do it properly), with a detailed description of the problem (also see "Asking for help/reporting bugs").

There are two Magisk apps

If there suddenly are two Magisk app in your app drawer, this might be caused by somehow installing a new app while having the old one repackaged (hidden) with a random package name. It can happen when updating Magisk, and usually if you install the app apk manually, or if you use the Magisk zip in recovery while having a repackaged app installed. Also, the uninstaller zip (the Magisk app apk renamed to uninstall.zip) cannot uninstall the repackaged app (since it doesn't know the random package name), and you'll have to uninstall the old app manually. Or something else... If the duplicate app doesn't disappear (it'll be uninstalled by the "real" app) after you open the one named just "Manager" (or whatever name you've picked), the best thing is probably just to uninstall both and install the app again (apk can be found on GitHub). It might also be necessary to delete /data/adb/magisk.db. Also see "Can't hide the Magisk app" below.

It's also possible that you'll get two apps installed when trying to hide (repackage) the app. If you have made the app a system app, or the ROM you're using has the app pre-installed as a system app, the repackaging feature can't uninstall the old app (because it's a system app) after having installed the new one with a random package name (the app might get stuck on "Hiding it now"). Remove the app from /system/app or /system/priv-app (depending on where you or the ROM creator have placed it). If the app comes pre-installed as a system app, please let your ROM creator know that it's a bad idea to include the app like this.

If your ROM doesn't come with the Magisk app installed as a system app, or you haven't made the app into a system app, if disabling Play Protect doesn't help, or if the app can't be hidden/repackaged at all, please provide details and logs (see "Asking for help/reporting bugs").

Can't hide the Magisk app

First thing to try is to temporarily disable Play Protect in the Play Store. From v7.4.0 the app uses a stub apk to hide fully on Android 9+ systems. This sometimes triggers Play Protect which will silently block the install, and you'll just get a "Hide Magisk app failed" message. On some devices this might be caused by SELinux issues, so if the above doesn't work, try changing SELinux to permissive when you hide the app.

If you have a Xiaomi device and MIUI, you might have to turn on "Install via USB" in Developer options before trying to hide the app.

Can't restore the Magisk app

If you can't restore the Magisk app, either that it gives an error or nothing happens at all, the easiest way is to simply uninstall the hidden/repackaged app and install the apk manually. The latest stable app apk can always be found on GitHub.

It might be necessary to remove any remnants of old installs through ADB before the app can install again (see "Can't install the Magisk app" above).

Updates doesn't show up for modules

It's very likely that nothing is actually wrong. Take a look at "A module has been updated but doesn't show up in the Magisk app" for details.







Module Issues


There are no modules

If the list of modules in the Magisk app is empty, clear the repo cache (in the app settings) and/or reload the modules list (the small icon in the top right corner of the "Modules" window).

A module has been updated but doesn't show up in the Magisk app

If it seems like a module has been updated (if you look at the date below the module in the modules list in the app), but it doesn't show up as an update, there's nothing wrong.

The date will change and the module will move to the top of the modules list whenever there is any kind of edit to the module's repo on Github. So if the readme is updated, for example, it isn't necessary to release an update for the module, but the date will change. An update will only show up if the module creator/developer also changes the version code for the module.

Modules are installed, but don't load

Make sure you haven't disabled modules by running your device in "Safe Mode". Doing this disables all modules and also disables MagiskHide. If you have not done this, and your modules are all enabled, there's likely something wrong with your Magisk installation and you need to figure out what. Post details and logs in the support thread (also see "Asking for help/reporting bugs").

Modules seem to install, but aren't there after rebooting

Often caused by the module using an outdated module template. See "Outdated template" below.

If that's not the case, looking at the Magisk and module installation logs might give a clue as to what's going on.

Can't install modules

If there's an error installing a module or the module seems to install fine but doesn't show up as installed after a reboot, there's a couple of things to try.

Download error
When trying to download a module in Magisk app v8+, some users just get an error, that usually shows in the download notification. Usually this is caused by having a custom hosts file, or similar, that is blocking the CDN used by the app (JSDelivr). The solution is to whitelist that URL.

Outdated template
It might be that you're trying to flash a module with an outdated module template. Magisk modules templates used to have a version number (seen in the modules module.prop file), but now all installation logic is centralised to the Magisk module installation script. If the module you are trying to install has a minMagisk entry in the module.prop file it is very likely that it is too old to be able to install on a recent version of Magisk.

Most of the times you can tell that the issue is an outdated template by an error message telling you to install an older version of Magisk than the version you have installed. If there is no such message, look at the module installation log, since it might show why things didn't install properly. One thing to look for is:
mount_magisk_img: not found

That means the installer is trying to use a Magisk image, something that was deprecated in Magisk v19.0.

You can also look in the module.prop file in the zip. If there's a line looking something like minMagisk=1500 it is a good hint that the module installer is too old (that kind of check isn't used anymore).

In other words, the installer scripts used in the zip needs an update.

Zip is not a Magisk module
If the error states that it's not a Magisk zip, or invalid zip in TWRP, the zip is not packaged correctly. Open up the zip and you'll likely see a folder (probably named something like <nameofmodule>-master or similar, or something completely different). Take all the contents of that folder and repack it to the root of the zip and try flashing it again.

It might also be that you (or whomever made the module) forgot to add the line "#MAGISK" to the updater-script file.

Magisk app storage permission
If the app does not have storage permissions there will be issues with module installation (and other things). It should automatically ask for permission when needed, but if this doesn’t work, give the permission manually.

Process error
If there's a "process error" when installing a module it is usually caused by the app not having storage permission (see above). It might also be fixed by clearing data for the app.

Corrupt zip
Also make sure that there’s nothing wrong with the zip file (corrupt, etc). Try downloading the zip again.

Unable to extract zip
If you get an error stating “Unable to extract zip” when installing modules it might just mean that the zip has been packaged wrongly. Try using a different program/app to create the zip. If you still keep getting this error and you know that the zip is ok, you might have to to a complete reinstallation of Magisk.

Logs, etc
If the error occurs when installing a module through the Downloads section of the Magisk app, save an install log by clicking on the “Save log” button (disk icon) after the install script has run. If the error just states something along the lines "error when installing", try flashing the zip through recovery instead (if available). If this also fails, save the recovery log and post in the support thread together with your app install log (also see "Asking for help/reporting bugs").

Module will be updated at next reboot

If you install a module and after reboot it doesn’t work or it works but there’s a message in the Magisk app modules section that states “module will be updated at next reboot”, try this:

If the module works, just navigate to the module folder under /data/adb/modules and delete the “update” file. If it keeps happening when installing modules post the installation logs, Magisk log and possibly a logcat from the installation in the support thread (also see "Asking for help/reporting bugs").

If the module doesn’t work and hasn’t installed properly. Navigate to /data/adb/modules, delete the module folder and try again. If it still doesn’t work post the installation logs, magisk_debug.log and possibly a logcat from the installation in the support thread (also see "Asking for help/reporting bugs").

Can't uninstall module

If a module, for some reason, can't be uninstalled from the app you can do this manually. See Uninstalling modules manually below.

Module causing issues (Magisk functionality, bootloop, loss of root, etc)

If you have a working Magisk installation, but a module causes Magisk, the Magisk app or your device to not function properly (bootloop, loss of root, etc), see Disabling/uninstalling modules manually below.

Disabling/uninstalling modules manually

Remove all modules
Since Magisk v19.4, there's an adb command that can be used to uninstall all modules on your device. If the device is bootlooping or simply hanging on the boot animation you have a good chance that you can use this command to get up and running again.

Hook your device up to a computer (or other device you can run adb from) and execute the following command:
adb wait-for-device shell magisk --remove-modules

After that you can start your device and as soon as adb is available the command will activate, the modules will be removed and the device will reboot. Hopefully to a working system, sans modules. There's of course a chance that the troublesome module has done something that the command can't remove...

If you do not have USB Debugging enabled adb won't work and you'll need to use Safe Mode instead (see below).

Core Only Mode
From Magisk v21, Core Only Mode has been replaced with Safe Mode. See below.

Safe Mode
Booting your device into Android Safe Mode will disable all modules and also disable MagiskHide. Once you reboot back to normal Android the modules will remain disabled and you can manage them manually to find/uninstall the module that is causing issues.

To boot into Android Safe Mode you have two options.

There should be a button combination available to activate Safe Mode. Usually it is something along the lines of holding the power button until the OEM splash screen shows and then switching to holding volume down instead until your device boots into Safe Mode. Search the big great interweb for information on your device's particular button combo.

If you cannot get the button combination working, you could also disable Magisk completely by flashing the stock boot image to your device. This should let it boot, but with Magisk (and thus all it's modules) disabled. From here you can activate Safe Mode from the Power Menu. Long press "Power Off" and you should get a prompt to enable it. Once the device reboots, press and hold the button combination to enter the bootloader menu or equivalent for your device. From here you should be able to then install a Magisk patched boot image (through fastboot, or equivalent) and when you then reboot your device it will go to Safe Mode which in turn will let Magisk disable all the modules and you can continue as described above.

The drawback to the this method is that it will disable all your Magisk modules, not just the one causing issues. If you don't want to do this and you have a custom recovery available (booted or installed), you can use the following methods to disable or uninstall only the troublesome module.

No custom recovery
The tips below all rely on having a custom recovery, like TWRP, for your device. If you do not have one installed (or don't want one installed) but there is one available for your device it's a good idea to keep it handy to at least be able to fastboot boot it.

If you do not have access to a custom recovery, the methods described above should hopefully work for you.

Uninstall/delete/disable modules from recovery
This is my prefered method, manually removing a troublesome module through a custom recovery. Boot to recovery and use the file explorer to navigate to /data/adb/modules (if you don't have access to /data in recovery, try using the "Disable all modules" method below). You now have a couple of options to remove the module:



If you create the "remove" or "disable" files, Magisk will take care of removing or disabling the module on the next reboot. Uninstalling the module this way is the preferred way, since it will also run any uninstall script that the module is using.

You can also keep a copy of the corresponding disable or remove files on your device and copy them to the module folder as needed.

There are also several available terminal/Aroma based recovery type managers available for handling this. Take a look in the Magisk forums.

Recovery Module Managers
There are also a few different module managers for custom recoveries available (take a look over at XDA). These might make it easier for you to manage any installed modules when you can't boot your device, but personally I feel that it's easier to do all this yourself through the recovery file manager.

Installing/disabling/uninstalling modules through the Magisk app or recovery

If you’re experiencing problems with installing, disabling or uninstalling a module through the Magisk app, simply try it through recovery instead (if one is available). For disabling or uninstalling a module through recovery, see the described methods above under “Module causing issues”.







Root issues


<insert app name here> can’t detect root

Some apps may have troubles detecting root when using Magisk. Usually this means the app in question is looking for root in a specific location and needs to be updated to work with MagiskSU or otherwise can’t detect MagiskSU. Contact the developer.

You can try symlinking the su binary to the location where the troublesome app is looking for it. You'll likely need to mount /system rw to be able to create the symlink. This will alter your system partition and you will not be able to update through an OTA afterwards. If you need to keep /system intact and untouched, don't use this method. Mounting /system rw may even be impossible on Android 10+ devices. See "Can't edit system file" below.

Here’s an example on how to do this in terminal:
ln -s /sbin/su /system/xbin/su

Please note that doing this might have the effect of MagiskHide not being able to hide root. A workaround for this would be to make a Magisk module that places the symlink in the appropriate location (which would be a systemless modification).

Superuser request prompt does not show

If the prompt to grant superuser access does not show on your device, first make sure that the setting for "Automatic Response" for superuser in the Magisk app settings is set to "Prompt". If it is and there still is no popup, check your Android settings. Some OEMs have a setting that you have to enable to allow background processes to display a popup window.

Or, the app simply can't detect root with Magisk (see above).

ADB cannot run as root in production builds

If you're having issues running the ADB root command after installing Magisk this is because of MagiskHide setting a few prop values to known "safe" values. You can get ADB root working again by turning of MagiskHide and rebooting, but if you need MagiskHide for some app or service this could quickly become annoying.

A more convenient solution is to reset props like ro.build.type and ro.debuggable to their original values (userdebug and 1 respectively), and possibly other props that MagiskHide alters (it sometimes depends on what ROM you're using). This can be done by using the Magisk resetprop tool (see the Magisk Documentation for details), either by running it directly in a terminal emulator, in a late_start service boot script, or by using the MagiskHide Props Config Magisk module's "Edit MagiskHide props" function.

If your ROM is a "user" or "release" version, changing these values won't automatically enable adb root. It all depends on your ROM, so you'd have to ask there.

Tasker and MagiskSU

Any version before Tasker v5.0 will have issues detecting MagiskSU. If you by any chance feel that you cannot update to v5+, you can use this Magisk module to enable Tasker root support. Reportedly, Secure Settings will also function with MagiskSU thanks to this module.

Another way is to use “Run Shell” in Tasker and use shell commands to do what you want, prefaced by “su -c”. Example (copy a boot script to service.d):
su -c cp /sdcard/testscript.sh /data/adb/service.d/testscript.sh


If the command doesn’t work, try putting quotation marks around the command, like so:
su -c "cp /sdcard/testscript.sh /data/adb/service.d/testscript.sh”


Magisk root detection has been fixed in Tasker v5.2. Previous to this version, there were issues with root detection if the app was hidden, but that should now be fixed. If you're still having issues with root and tasker, try the “su -c” workaround mentioned above.

Can't edit system files

From Android 9 a lot has changed in Android, and if you can't edit system files anymore it is not because root is broken or not fully working.

On some system-as-root (SAR) devices you can no longer mount the system partition as read-write and doing systemless modifications through Magisk is an easy way of getting around that. If you do want to do actual edits of the system, and if it is even possible (from Android 10 it's actually impossible on some devices), you need to mount the root directory, /, as rw and not /system. You can also try editing the partition mirrors that Magisk keeps in /sbin/.magisk/mirror, but this should be the last resort since it might be tricky mounting them rw.

From v20.0, Magisk is also following the design laid down by Google, which is why you might suddenly start to experience this "issue" after updating from earlier Magisk versions.

If you have a system that cannot be mounted rw but you really want to do things the old-fashioned way, you can use XDA Senior Member lebigmac's Universal Mount System read write script to change the partitions to being writable. You'll find it here: https://forum.xda-developers.com/t/script-android-10-universal-mount-system-read-write-super-no_super.4247311/

For more info on how Magisk v20+ deals with SAR, take a look at the Magisk v20.0 release notes.

Randomly losing root

Some devices seem to have issues with loosing root randomly and the Magisk app reporting that "Magisk is not installed".

This may be caused by memory management where the Magisk app will not be kept in memory and as a result root management is lost. This can sometimes be fixed by clearing the app from memory (swipe it away from recent apps list) and opening it again. Make sure the app is removed from any battery optimisation.

Other reasons for this issue include a failed update and having the Magisk app installed to external/adoptable storage

If you can't find any way to get around this issue, try to capture a logcat of it actually happening (also see "Asking for help/reporting bugs") and post that together with a detail description in the general support thread. This is a recurring issue for some users and so far there have been very few useful logs provided.


Magisk app was denied superuser access

Sounds weird, huh? How could the app responsible for superuser access suddenly be denied? The answer: it is very likely that you have two apps installed, one hidden and one not. See "There are two Magisk apps" for details on how to solve this.

If you do not find a second app, try deleting the Magisk database file (/data/adb/magisk.db). This will reset everything (including which apps have been given superuser access and the MagiskHide list) and you should be able to use the Magisk app again (you might have to uninstall it and install the apk again).







Other things to try


Starting fresh

If you've been trying a lot of things and can't get Magisk to work properly it can be a good idea to start fresh. Start by uninstalling Magisk, flashing a clean boot image and installing Magisk again. If that doesn't work you could try wiping your device and starting out completely clean.

Older versions of Magisk

It is possible that an older version of Magisk may work if the latest does not. This is a last resort and should be considered unsupported. If the latest version of Magisk doesn’t work, but an earlier version does, please help fixing the issue by reporting it with all the necessary details (also see "Asking for help/reporting bugs").

Installation files for earlier releases of Magisk can be found on GitHub. If you need other versions, not available for download, the source code for these can be found in the same place, along with instructions on how to build Magisk.

Please note that there’s no guarantee that an older version of Magisk will work with the current Magisk app. Compatible apk releases can be found on GitHub.

Nothing works!

If nothing works and you just can't get Magisk to install/function properly on your device, the best thing you can do if Magisk isn't compatible with your device is to provide as much details as possible and upload logs (recovery log, Magisk log, logcat, whatever is applicable) and a copy of your boot image in the XDA support thread or as an issue on GitHub (also see "Asking for help/reporting bugs").

Canary releases

It's also possible that whatever problem you're facing has been fixed in code, but not yet released. For this you can use the the Canary bleeding edge build. It is a build by topjohnwu that is based on the latest (working) commits from GitHub. Keep in mind that it is a bleeding edge build and may be quite unstable. Only install of you know what you're doing! The Canary Magisk app is available on GitHub.







Asking for help/reporting bugs


Asking for help

If you can't fix the problem yourself, start by looking in the support thread where you might find that someone else have had this problem as well. Search for your device and/or problem. If you can't find anything (it's a big thread), search again. If you still can’t find anything, provide as much information as possible (in the support thread). For example:







Reporting a bug

When reporting a bug, make sure you have the latest Canary bleeding edge build installed on your device. Otherwise any bug you're reporting may already be fixed upstream. It will also have much more detailed logging enabled (see below).

All bug reports should be made on the the Magisk Github repo. The same tips that are outlined above apply.

Logs

But what if I can't get logs?
Most of the time you can get some kind of log showing what is going on. Keep reading below to see what tools you have at your disposal.

But, if you really cannot get hold of any logs at least try to give as detailed instructions as possible on how to reliably reproduce the issue.

Which log?
Certain issues require different kinds of logs. Here's a list of examples (see further down for details on how to acquire the logs in question), but it's far from a complete list and only meant as an example of what logs may be useful:


















Get the log

















Verbose logging
When reporting about issues and bugs, it's useful to have more verbose logging. To get the most information possible, make sure to install the Canary bleeding edge build. It has debug logging active and will show much more useful information. The log is then saved just as the normal Magisk log, described above. When reporting about Magisk bugs, this is a requirement.

The Magisk log is empty

If your Magisk log is empty, it's likely that you have Android logging disabled. Try enabling it.

Could also mean it's faulty somehow. Try grabbing a logcat and see what happens (see above).

It might also be that your kernel/ROM wipes the /cache directory during boot, thus removing the log. See here for details.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki