How to Install Magisk on your Android Phone

If you’ve ever thought of rooting your phone or modding certain aspects of it, the chances are you’ve heard of Magisk. But what is Magisk? Magisk is a tool that can be used to gain root access on your device, similar to SuperSU but it’s not limited to just that. Developed by topjohnwu, a Senior Recognized Developer at the XDA Forums, Magisk is a portal that enables all sorts of modifications on your Android phone. There are several Magisk Modules you can install on your phone for different purposes.

There are modules for theming, ad blockers, enabling Camera2API, and a lot of other system-level modifications you can’t do otherwise. If you’re a power user and want to extend the functionality of your phone and push it to its limits, you need to try out Magisk. If all this sounds fun to you, we’ll tell you how you can install Magisk on your Android device to customize it and do things you never thought of doing on your phone.

How to Install Magisk

Installing Magisk requires you to have a custom recovery for which your phone needs to have an unlocked bootloader. If you’ve already unlocked the bootloader on your phone, you’re good to go. If you haven’t and you don’t know what we’re talking about, we recommend you head over to the XDA Forums, search for your device, and then look for a guide to unlocking the bootloader. There’s no universal method for this, as it differs from phone to phone. Once you’ve unlocked the bootloader, you can proceed further.

Disclaimer: Unlocking the bootloader will wipe all the data on your smartphone and in some cases, may even void your warranty. It’s advisable to back up all your data before performing these steps. It’s also important to understand that not following the steps correctly may result in a bricked phone so make sure you know how to recover your phone back to its original state in case you end up in a situation like that.

Furthermore, Magisk may cause issues with a few banking and payment-related apps so if those are absolutely vital to you, proceed with caution.

Before we begin, make sure you have access to a PC/Mac with ADB and Fastboot installed.

Step 1: Identifying the type of boot image

Download the latest version of the Magisk app from the project’s GitHub repository. Since the APK of Magisk is hosted outside the Google Play Store, you may need to allow sideloading apps from unknown sources first and then manually install the downloaded package.

After installing, open the Magisk app. You should see a screen like this:

Now, we need to note down the values of the following parameters:

Step 2: Locating the boot image

In order to patch the boot image for your device, you need to extract it from the official firmware packages. In case you’re using a custom ROM like LineageOS, the flashable ZIP file contains the boot image.

Case I: You have access to the recovery-flashable ZIP file

If you have a device that still uses the A-only partition scheme, you can find the ‘boot.img’ right inside the recovery-flashable ZIP file. Just extract it using a suitable archiver program.

Notice the boot.img file inside POCO M3’s recovery ZIP.

However, if your device utilizes the A/B partition scheme, then the boot image and other partition images are further packed inside a file named payload.bin as shown below.

The recovery ZIP of the Google Pixel 5 contains a payload.bin file. In that case, you have to extract the payload.bin file first, then use one of the community-developed payload.bin unpackers to get the boot.img out of it. We strongly suggest you opt for the extractor written in Go as it’s cross-platform and has been actively developed.

Known as ‘payload-dumper-go’, this fork even allows end-users to extract a single partition image without unpacking the whole payload.bin, which is particularly useful for this usage scenario.

Case II: You have access to the Fastboot-flashable image

A handful of OEMs like Google and Xiaomi provide Fastboot-flashable factory images for their devices. If you managed to grab such a package, then the raw ‘boot.img’ can easily be extracted from the archive.

Special Case: Samsung

Samsung Galaxy devices don’t a traditional Fastboot interface, hence their factory images are packed differently.

  1. Use Samsung Firmware Downloader to download the factory image for your model.
  2. Unzip the decrypted package and locate the AP tar file to your device. It is normally named as AP_[device_model_sw_ver].tar.md5.

Step 3: Patching the boot image

Now we have the boot image in hand, we should proceed with the patching part.

Case I: The value of the “Ramdisk” parameter is “Yes”

Keep in mind it’s possible to patch the boot image on the fly on legacy devices having boot ramdisk through a custom recovery like TWRP, but the method is no longer recommended on modern devices. Having said that, if you have an old phone and want to stick with the custom recovery route, the steps are as follows:

Case II: The value of the “Ramdisk” parameter is “No”

In this case, you need to locate the recovery.img file from the factory image of your device instead of boot.img file. This is because Magisk needs to be installed in the recovery partition, which means you’ll have to reboot to the recovery mode every time you want to access Magisk.

At this stage, there are three possible scenarios:

Special Case: Samsung

Step 4: Verification

The last step is to verify that everything is working properly. Locate the newly installed Magisk app and open it. We want to see a version number beside the “Installed” parameter. This means you have successfully installed Magisk. Great job!

Now you have Magisk installed, it’s time to try out some nice Magisk Modules. You can find lots of modules for specific purposes, and since Magisk gives you root access, you can even install some of the best apps for rooted devices. So install whichever apps and modules you like and get tweaking!

About author

Sumukh Rao

A tech fanatic with a hunger for knowledge in the ever-growing field of science and technology. An avid quizzer and a gadget critic who loves simplifying tech for the masses has a keen interest in modding Android devices.

Read This Next

Load more