How to Install Magisk and Root Android Devices with it [2 Methods]

How to Install Magisk on Android

In this comprehensive guide, we will show you how to install Magisk Universal Systemless Interface to root Android devices. There are two different methods to install it – First, by flashing the latest Magisk installer zip using TWRP recovery, or two, by flashing the Magisk Patched Boot Image. The instructions for both the methods have been listed below in a step-by-step manner. For your convenience, we have also listed the steps to completely remove/uninstall Magisk to unroot, should you feel the need to do it.

The Android developer community is filled with a surfeit of modifications tools (Commonly known as ‘mods’) that allow you to customize the software on your Android devices. Many of these have gained immense popularity for their ability to efficiently and easily modify the phone’s software. These mods can help you draw various features on your Android phone, that the OEM doesn’t normally allow you to. Today, we will be taking one such mod/tweak in consideration that is being widely used for the past few years.

We’re here for “Magisk“, the ultimate interface to modify the software on Android devices systemless-ly. So if you’re looking ahead to root your phone or add third-party features to it, you should consider using it. The detailed instructions in this guide will allow you to install Magisk on almost any device running Android 4.2, to Android 10. If you’re new to the Android customization scene, take some time to read more about what it is and the features it offers.

Table of Contents

What is Magisk?

How to Install Magisk on Android

Magisk is a very powerful tool that not only allows users to root their Android device easily but also apply modifications to the software systemless-ly. It is developed by XDA Recognized Developer topjohnwu and is also considered as a true successor to SuperSU, offering even more features and ways to efficiently root devices running the latest Android version.

In 2016, Magisk emerged as a tool to modify the software on Android devices using “Modules” just like the Xposed Framework, but in a more efficient manner. Well, unlike Xposed, Magisk allows users to customize the software without actually altering the /system partition. This means users could still pass Google’s SafetyNet tests and use apps that might rely on it

Progressing further, it gained several new features like “MagiskSU“, a part of the tool itself for effectively rooting Android devices. At the moment, you can install Magisk to root any Android device running Android 10, Pie, Oreo, Nougat, Marshmallow, and Lollipop.

Magisk Hide” is another notable feature that allows users to hide root from apps that might not work if Root is detected, like Google Pay, Pokemon Go, banking apps, etc.

Below is a list of the major features that Magisk offers:

  • Modify or alter the software without tampering the system (vendor) partitions
  • Root any Android device with the open-source root solution
  • Manage root permissions and use biometrics like fingerprint or Face Unlock to grant superuser permissions
  • Pass Google’s SafetyNet tests even when the phone is rooted
  • Use banking and security applications on rooted devices
  • Remove kernel features like DM-Verity and ForceEncrypt
  • Add third-party features using Magisk Modules
  • Easily install OTA updates on your rooted Android device

So, if you’re at all interested in modifying the software of your Android device, then you must give a try to Magisk.

Prerequisites

  • As always, we strongly suggest that you take a complete backup of all your personal data on the phone. You can follow our guide on how to backup Android devices.
  • Your Android device’s bootloader must be unlocked. You can check for the instructions either on the official OEM portals or search for your device-specific tutorial from our archive.
  • Download and install the latest USB drivers for your OEM Android device on the PC.
  • For Method 1, you must have the latest TWRP recovery installed on your Android device.
  • For Method 2:
    • You must download the latest Android SDK platform-tools package and install it on your PC.
    • When asked to launch the command-line window on the PC, do the following:
      • On Windows: Go to the folder where the platform-tools have been installed (e.g. C:\platform-tools). Then hold the SHIFT key on the keyboard and right-click on any empty space inside this folder. Select the ‘Open PowerShell window here’ option.
      • On macOS/Linux: Open the Terminal and change its directory (using ‘cd’ command) to the folder where the Android SDK platform-tools are installed (e.g. Documents/platform-tools).
        cd Documents/platform-tools
  • Also, for method 2, you must have the stock boot image from the stock firmware, matching the current firmware installed on your phone. There are a couple of ways to get it. You can either find it on firmware.mobi (database by SuperSU creator ‘Chainfire’) or visit your device-specific section on the XDA-Developers forum. You can also download the full OTA package of the installed software, and extract the Payload.bin file in it to get the stock boot image.

How to Install Magisk on Android

Now, as we mentioned in the beginning, there are two different ways/methods to install Magisk on Android. The first method is by flashing the latest Magisk installer ZIP file using TWRP, which is the easiest.

But if TWRP recovery is not yet available for your device or if you just want to root, then you can use the second method. It involves patching the stock boot image (kernel) using Magisk and then flashing the Magisk patched boot image to your Android phone via fastboot. This is also the recommended method since it will allow you to easily install OTA updates on your rooted Android phone.

We have covered instructions for both the methods below in a step-by-step manner.

Method 1: By Flashing Magisk Installer Zip using TWRP Recovery

  1. Download the latest Magisk installer zip: Download link
  2. Connect your phone to the PC using the USB cable and enable MTP/File Transfer mode.
  3. Copy the downloaded Magisk zip file (e.g. Magisk-v20.3.zip) to the device’s internal storage or SD card.
  4. Now, boot your Android device into TWRP recovery using the relevant key combination.
  5. Alternatively, you can also use the following ADB command while your device is connected with USB debugging enabled:
    adb reboot recovery
  6. Tap on ‘Install’ in the TWRP main screen.
  7. Navigate to the phone’s internal/external storage and select the Magisk installer zip file (e.g. Magisk-v20.3.zip).
    Install Magisk Installer Zip using TWRP Recovery
  8. The file will be added to the TWRP flashing queue.
  9. Finally, swipe the button on the bottom of the screen to flash the file and install Magisk on your Android device.
  10. When the flashing process is complete, hit the “Reboot System” button.

Alongside rooting, Magisk also simultaneously patches/disables any kernel-level security features (like DM-verity) that may prevent your phone from booting if the software is modified.

After your Android phone boots, you will see the latest Magisk Manager app present in the app drawer. Simply run it to verify that Magisk has been installed.

Method 2: By Flashing Magisk Patched Boot Image using Fastboot

If your device doesn’t support TWRP recovery or you don’t want to install it for some reason, then follow the steps below to install Magisk by flashing the Magisk Patched Boot image. This method also allows you to easily take OTA updates on your rooted Android device.

  1. First, get the stock boot image for the current firmware installed on your Android device.
  2. Transfer the boot image file to the phone’s internal or external storage.
  3. Download the latest Magisk Manager APK file from here and install it on your device.
  4. Now go to the app drawer and launch the ‘Magisk Manager’ app.
  5. Tap on the ‘Install’ button and choose ‘Install’ again.
    Select and Patch a File in Magisk Manager
  6. Select the ‘Select and Patch a File’ option.
  7. Navigate to the storage and select the stock boot image file (e.g. boot.img) that you transferred earlier.
    Patch Stock Boot Image using Magisk Manager
  8. Magisk Manager will now patch the stock boot image with the latest version of Magisk.
  9. Once patched, the patched boot image (magisk_patched.img) file will be stored in the ‘Download’ folder of your phone’s internal storage.
  10. Transfer the resultant file from the phone’s storage to the folder on the PC where the Android platform-tools are installed.
    Copy Patched Boot Image to Android Platform-tools folder on PC
  11. Boot your Android device into Bootloader/Fastboot mode and connect it to the PC using the USB cable.
    Boot Android Device into Fastboot Mode to Flash Magisk Patched Boot Image
  12. Now, launch the command-line window (PowerShell in Windows or Terminal in macOS/Linux) on your PC.
  13. Enter the following command in the PowerShell window to ensure that your Android device is being detected properly by fastboot:
    fastboot devices
  14. Finally, enter the following command to flash the patched boot image and install Magisk on your Android device:
    fastboot flash boot magisk_patched.img
  15. Note: The Magisk Patched Boot image will be flashed to your phone’s current active slot.
    Flash Magisk Patched Boot Image to root Android
  16. Once done, reboot your phone using:
    fastboot reboot

When your phone boots, open the Magisk Manager to verify the installation. You may further download various modules from the official repository or from here. The official documentation is a good way to start with the basics and also to know what Magisk is capable of.

How to Completely Uninstall Magisk and Unroot your Android Device?

Now, if you wish to uninstall Magisk for any reason, the steps below will assist you in doing so. The most direct way to do this is via the Magisk Manager app itself. Before you uninstall Magisk, make sure to disable and remove all the modules first. Once you have done that, follow the instructions below.

  1. Launch the ‘Magisk Manager’ app on your Android device.
  2. Tap on the ‘Uninstall’ option in the app’s main screen.
  3. The Uninstall prompt should show up on the phone’s screen.
    How to Uninstall Magisk Completely and Unroot your Android Device
  4. Finally, select ‘COMPLETE UNINSTALL’ to uninstall Magisk and restore the stock boot image.
  5. When the process finishes, reboot your phone.

Once the phone boots, you can safely uninstall/remove the Magisk Manager app as well.

An alternative to the above method is to flash the Magisk Uninstaller zip using TWRP Recovery or by simply restoring the stock boot image if you used Method 2.

Magisk gives you the ability to perform various tasks in order to customize the software. For starters, you can use any root-enabled app on your phone. “Magisk Hide” allows you to hide root from apps like Pokemon Go, and so on. You can also install modules to add third-party features to the software. The possibilities are endless, so don’t stop exploring.

So this was our guide on how to install Magisk on Android and root it. If you have any questions, kindly leave them in the comments.

Source