[Magisk] Didgeridoohan:
This thread/guide is now closed and will no longer be updated. It is only kept for posterity.

The new guide is stickied at the top of the Magisk forum, right here.

Installing Magisk and Modules

Installation

Where to start

It’s always a good idea to read through, at least, the release thread for information about what Magisk is and how to install it. Other useful information can be found in the Magisk All-In-One Wiki and the support thread.

Known issues

There may be issues with certain devices, ROMs and/or apps and Magisk. Check the release thread for information about currently known issues. While you're there, make sure to also take a look at the FAQ. When a new release is imminent, there will also be useful information in the beta thread.

Things to keep on your device

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

Magisk zip (release thread).

Magisk Manager apk (release thread) or GitHub.

Uninstall zip (release thread).

Mount Magisk zip (Collection of Magisk Modules v2 thread).

A copy of a clean boot image for your ROM (can be flashed in TWRP in case of problems).

Module zips.

Installation

Installing Magisk is straightforward. Follow the installation instructions in the release thread. After that you can install Magisk Modules through the Manager or via custom recovery (e.g. TWRP).

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.

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 in recovery before installing Magisk.

Otherwise, and this applies to any other root solution as well, you an use [MENTION=4544860]osm0sis[/MENTION] unSU script (in recovery) and then flash the stock boot image before installing Magisk.

If you're 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.

Updating

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

If you're having problems updating to a newer version. Flash the uninstaller in recovery, restore your stock boot image and start over.

Note that with an update to Magisk, the Uninstall zip may also have been updated. Always keep the latest version on your device.

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. If you're already rooted (not MagiskSU), first unroot ( [MENTION=4544860]osm0sis[/MENTION] unSU script is good for this).

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.

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.

If your ROM comes pre-rooted this can be tricky, depending on how the ROM roots your device. Usually the ROM just flashes root at the end of the ROM flash and you can simply open up the zip, unroot and flash the clean boot image from the ROM zip. If the ROM comes pre-patched from the start, ask for advice in your ROM thread or you could try a custom kernel that modifies the ramdisk.

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

After installation or update

After the first installation or an update, it may be necessary to perform a reboot or two for Magisk and/or any modules you have installed to start functioning properly.

Issues

Long boot time

If your device get stuck on the splash screen for a minute or so, it might mean that the magisk daemon have crashed or that there is some SELinux issue. If it is the case that the magisk daemon crashed, the Magisk debug logging during boot will never finish, even after the device has booted. This will eventually cause the debug log to eat up all your storage space! Take a look in /data and see if the file magisk_debug.log is very large and growing. Save the log and report the issue. Try rebooting to see if this fixes things, otherwise you'll probably need to uninstall Magisk and wait for a fix. Also see "Nothing works!" below.

Bootloop

If you end up in a bootloop when installing Magisk, run the uninstaller script in recovery, flash a clean boot image (the uninstaller restores a copy of the untouched boot image, so this step is “just in case”) and start over. If the uninstaller fails, just flash your unmodified copy of the boot image and you should be good to go. There’ll probably be some leftover files and folders from Magisk laying around in /cache and /data, but these can be removed manually.

First make sure your system can boot up without Magisk.

Boot to recovery and install Magisk. Boot up your system without installing any modules. Also see "Module causing issues" below.

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. Also see "Nothing works!" below.

Magisk Manager crashes

If you're having issues with the Magisk Manager force closing/crashing after an update, clear data for the Manager or uninstall it and install again.

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

If it still crashes, try reverting to an earlier version of the Manager (they're all on GitHub). But before you do, capture a logcat from the crash and post it in the support thread (with a detailed description of the problem).

There are no modules

If the list of modules under "Downloads" is empty, clear the repo cache (in settings) and/or reload the modules list (pull down).

Can't install modules

If there's an error installing a module, there's a couple of things to try.

If the error occurs when installing a module through the Downloads section of the Magisk Manager, then something is wrong. Capture a logcat and post in the support thread (with a detailed description of the problem).

If the error just states something along the lines "error when installing", try flashing the zip through recovery instead. It might also be that you're trying to flash a v4 template module on a Magisk version lower than v13.1. If you feel you need to stick with an outdated version of Magisk, check with the module developer if there is a v3 template module available.

If the error states that it's not a Magisk zip, or invalid zip in TWRP, something's gone wrong while packing the zip. Open up the zip and you'll probably see a folder (probably named something like <nameofmodule>-master). Take all the contents of that folder and repack it to the root of the zip and try flashing it again.

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

If you have a working Magisk installation, but a module causes Magisk, the Magisk Manager or your device to not function properly (bootloop, loss of root, etc), here's a tip:

Boot to recovery and flash the Mount Magisk zip (see “Things to keep on your device” above). This mounts the Magisk image to /magisk and it can now be accessed as any other directory. You now have a couple of options to remove the module:

Simply delete the modules folder under /magisk and reboot.

Navigate to the modules directory under /magisk and rename the "module.prop" file to "remove".

In terminal you can type (without quotation marks) "touch /magisk/<module folder>/remove" (or “/magisk/<module folder>/disable”, depending on your preference).

If you create the "remove" or "disable" files, Magisk will take care of removing or disabling the module on the next reboot.

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.

If you get an error in recovery when flashing Mount Magisk it might mean your Magisk image has become corrupted. Check the recovery log for details. Easiest way to fix this is to run the uninstaller and start from the beginning. It might also be possible to use fsck in terminal in recovery or through ADB. Google it (and check the recovery log for details).

Since Magisk v12.0 and Magisk Manager 4.3.0 you can also use the "Magisk Core Only Mode" in Manager settings. This disables all modules and only keeps the core functions of Magisk active (MagiskSU, MagiskHide, systemless hosts and, for Magisk v12.0, Busybox).

Installing/disabling/uninstalling modules through the Manager or recovery

If you’re experiencing problems with installing, disabling or uninstalling a module through the Manager, simply try it through recovery instead. For disabling or uninstalling a module through recovery, see the described method above under “Module causing issues”.

Apps are force closing

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.

It's also possible that removing and reinstalling Chrome stable, Chrome Beta or Google WebView (or simply installing one of them if it's not already) will fix the issue.

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's a few things you can try.

First, reboot. Sometimes this helps Magisk mount everything as it should.

Second, 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.

If nothing else works, try starting fresh with a new installation. Also see “Asking for help” and “Nothing works!” below.

Root issues

<insert app name here> can’t detect root

Since Magisk v11 and the included MagiskSU, some apps have started having troubles detecting root. Usually this means the app in question is looking for root in a specific location and needs to be updated to work with MagiskSU.

You can try symlinking the su binary to the location where the troublesome app is looking for it. Here’s an example on how to do this in terminal (If you don’t know about symlinking, Google it.):

ln -s /sbin/su /system/xbin/su

[MENTION=7897801]laggardkernel[/MENTION] have made a Magisk module that does this completely systemlessly. Which, of course, is preferable as we're using a systemless mask... :good: You'll find it here. Please note that doing this might have the effect of MagiskHide not being able to hide root.

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 “/sbin/su -c”. Example (copy a new host file to Magisk):

/sbin/su -c cp /sdcard/hosts /magisk/.core/hosts

If the command doesn’t work, try putting quotation marks around the command, like so:

/sbin/su -c "cp /sdcard/hosts /magisk/.core/hosts”

Randomly losing root

Some devices seem to have issues with memory management where the Magisk Manager will not be kept in memory and as a result root management is lost. This can sometimes be fixed by clearing the Manager from memory (swipe it away from recent apps list) and opening it again. Make sure the Manager is removed from any battery optimisation.

Magisk but no MagiskSU

There have been a few reports of devices/ROMs where Magisk gets installed properly, but MagiskSU fails to install. This might have to do with your device/ROM not letting Magisk symlink the required binaries and files to /sbin. See the release thread for known issues. If you know of a solution that's not listed, here or in the release thread, please let me know and I'll add it.

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 and MagiskHide 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 (see “Asking for help” and “Nothing works!” below)

Installation files back to Magisk v12 can be found in the release thread.

Please note that there’s no guarantee that an older version of Magisk will work with the current Magisk Manager. Compatible apk's can be found inside the Magisk zip.

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), provide as much information as possible (in the support thread). For example:

Detailed description of the issue and what you've tried so far.

Details about your device and ROM, custom kernel, mods, etc.

Current and previous root solution (and what you've done to remove it, if applicable)

Logs! And when providing logs, do NOT paste them into your post. Attach as a file or use a service like Pastebin.

Recovery log from installation (in TWRP, go to Advanced - Copy log).

Magisk log (from the Manager or in /cache through recovery if you don't have root access)

Logcat. Get it via ADB or an app.

If you have boot issues (stuck or long boot time), take a look in /data for a file called magisk_debug.log (access through recovery if necessary). If it's not there, try capturing a logcat through ADB during boot (see above).

Nothing works!

If nothing works and you just can't get Magisk to install/function properly on your device, check the troubleshooting section in the release thread for instructions on how to help topjohnwu fix any compatibility issues with your device. The best thing you can do if Magisk isn't compatible with your device is to open an issue on GitHub and upload logs (recovery log, Magisk log, logcat, whatever is applicable) and a copy of your boot image. No boot image, no fix.

If you're using an older release of Magisk, take a look at the Old and outdated tips and tricks for "Installing Magisk and Modules". There might be something in there that applies to you.

Beta releases

It's also possible that whatever problem you're facing has been fixed in code, but not yet released. For this you have two options. The official beta and the unofficial beta snapshot.

The official beta is for [MENTION=4470081]topjohnwu[/MENTION] to test the release before it goes out to the masses. Read the OP carefully and follow any directions given. When reporting things about the beta, provide the necessary details and logs for whatever issue you're facing. Please don't spam the thread with "useless" posts...

If you're feeling brave you can try the unofficial beta snapshot. It's built directly from source and can sometimes be unusable. Keep an eye on the thread for current issues.