Download and install Magisk v25.2

12 Min Read

One of the most popular ways to root an Android device is with Magisk. SuperSU was formerly the go-to exploit for rooting Android devices, stock firmware, and customized ROMS.

Magisk, on the other hand, is a much more sophisticated and experienced rooting tool now than it was in the past. Along with enabling systemless root access on Android, some of the features include compatibility for third-party modules, Googleโ€™s SafetyNet bypass, and MagiskHide for avoiding root detection.

There are modules for theming, ad blocking, activating Camera2API, and many other system-level changes you canโ€™t make otherwise. Try out this tool if youโ€™re a power user who wants to increase the usefulness of your phone and push it to its limits. If all of this sounds like fun to you, weโ€™ll explain how to install on your Android device so you can personalize it and perform tasks you never imagined you could perform on your phone.

magisk app root

Download version 25.2

Following are the direct download links right from the Github repository of the project.

- Advertisement -

Full downloads repository:

Use either the stable or beta and flash it viaย TWRP recoveryย to root Android devices.

Installation

If you already have it installed, it isย strongly recommendedย to upgrade directly via the app using its โ€œDirect Installโ€ method. The following tutorial is only for the initial installation.

Getting Started

Before you start:

- Advertisement -
  • This tutorial assumes you understand how to useย adbย andย fastboot
  • If you plan to also install custom kernels, install it after Magisk
  • Your deviceโ€™s bootloader has to be unlocked

Download and install the latestย Magisk app. In the home screen, you should see:

install magisk

The result ofย Ramdiskย determines whether your device has ramdisk in the boot partition. If your device does not have boot ramdisk, read theย Magisk in Recoveryย section before continuing.

(Unfortunately, there are exceptions as some devicesโ€™ bootloader accepts ramdisk even if it shouldnโ€™t. In this case, you will have to follow the instructions as if your deviceโ€™s boot partitionย doesย include ramdisk. There is no way to detect this, so the only way to know for sure is to actually try. Fortunately, as far as we know, only some Xiaomi devices are known to have this property, so most people can simply ignore this piece of information.)

If you are using a Samsung device that is launched with Android 9.0 or higher, you can now jump toย its own section.

If your device has boot ramdisk, get a copy of theย boot.img.
If your device doesย NOTย have boot ramdisk, get a copy of theย recovery.img.
You should be able to extract the file you need from official firmware packages or your custom ROM zip.

- Advertisement -

Next, we need to know whether your device has a separateย vbmetaย partition.

  • If your official firmware package containsย vbmeta.img, then yes, your deviceย hasย a separateย vbmetaย partition
  • You can also check by connecting your device to a PC and run the command:
    adb shell ls -l /dev/block/by-name
  • If you findย vbmeta,ย vbmeta_a, orย vbmeta_b, then yes, your deviceย hasย a separateย vbmetaย partition
  • Otherwise, your deviceย does notย have a separateย vbmetaย partition.

Quick recap, at this point, you should have known and prepared:

  1. Whether your device has boot ramdisk
  2. Whether your device has a separateย vbmetaย partition
  3. Aย boot.imgย orย recovery.imgย based on (1)

Letโ€™s continue toย Patching Images.

Patching Images

  • Copy the boot/recovery image to your device
  • Press theย Installย button in the Magisk card
  • If you are patching a recovery image, check theย โ€œRecovery Modeโ€ย option
  • If your device doesย NOTย have a separateย vbmetaย partition, check theย โ€œPatch vbmeta in boot imageโ€ย option
  • Chooseย โ€œSelect and Patch a Fileโ€ย in method, and select the boot/recovery image
  • Start the installation, and copy the patched image to your PC using ADB:
    adb pull /sdcard/Download/magisk_patched_[random_strings].img
  • Flash the patched boot/recovery image to your device.
    For most devices, reboot into fastboot mode and flash with command:
    fastboot flash boot /path/to/magisk_patched.imgย or
    fastboot flash recovery /path/to/magisk_patched.img
  • (Optional) If your device has a separateย vbmetaย partition, you can patch theย vbmetaย partition with command:
    fastboot flash vbmeta --disable-verity --disable-verification vbmeta.img
  • Reboot and voila!

Uninstallation

The easiest way to uninstall it is directly through the app. If you insist on using custom recoveries, rename the Magisk APK toย uninstall.zipย and flash it like any other ordinary flashable zip.

Magisk in Recovery

In the case when your device does not have ramdisk in boot images, it has no choice but to hijack the recovery partition. For these devices, you will have toย reboot to recoveryย every time you want root enabled.

When it hijacks the recovery, there is a special mechanism to allow you toย actuallyย boot into recovery mode. Each device model has its own key combo to boot into recovery, as an example for Galaxy S10 it is (Power + Bixby + Volume Up). A quick search online should easily get you this info. As soon as you press the key combo and the device vibrates with a splash screen, release all buttons to boot into recovery. If you decide to boot into the actual recovery mode,ย long press volume up until you see the recovery screen.

As a summary, after installing it in recoveryย (starting from power off):

  • (Power up normally) โ†’ (System with NO Magisk)
  • (Recovery Key Combo) โ†’ (Splash screen) โ†’ (Release all buttons) โ†’ (System with Magisk)
  • (Recovery Key Combo) โ†’ (Splash screen) โ†’ (Long press volume up) โ†’ (Recovery Mode)

(Note: Youย CANNOTย use custom recoveries to install or upgrade in this case!!)

Samsung (System-as-root)

If your Samsung device is NOT launched with Android 9.0 or higher, you are reading the wrong section.

Before Installing

  • Installing Magiskย WILLย trip KNOX
  • Installing Magisk for the first timeย REQUIRESย a full data wipe (this isย NOTย counting the data wipe when unlocking bootloader). Backup your data before continue.
  • Download Odin (only runs on Windows) that supports your device.

Unlocking Bootloader

Unlocking the bootloader on modern Samsung devices have some caveats. The newly introducedย VaultKeeperย service will make the bootloader reject any unofficial partitions in some circumstances.

  • Allow bootloader unlocking inย Developer options โ†’ OEM unlocking
  • Reboot to download mode: power off your device and press the download mode key combo for your device
  • Long press volume up to unlock the bootloader.ย This will wipe your data and automatically reboot.
  • Go through the initial setup. Skip through all the steps since data will be wiped again in later steps.ย Connect the device to Internet during the setup.
  • Enable developer options, andย confirm that the OEM unlocking option exists and is grayed out.ย This means theย VaultKeeperย service has unleashed the bootloader.
  • Your bootloader now accepts unofficial images in download mode

Instructions

  • Use eitherย samfirm.js,ย Frija, orย Samloaderย to download the latest firmware zip of your device directly from Samsung servers.
  • Unzip the firmware and copy theย APย tar file to your device. It is normally named asย AP_[device_model_sw_ver].tar.md5
  • Press theย Installย button in the Magisk card
  • If your device doesย NOTย have boot ramdisk, check theย โ€œRecovery Modeโ€ย option
  • Chooseย โ€œSelect and Patch a Fileโ€ย in method, and select theย APย tar file
  • Start the installation, and copy the patched tar file to your PC using ADB:
    adb pull /sdcard/Download/magisk_patched_[random_strings].tar
    DO NOT USE MTPย as it is known to corrupt large files.
  • Reboot to download mode. Open Odin on your PC, and flashย magisk_patched.tarย asย AP, together withย BL,ย CP, andย CSCย (NOTย HOME_CSCย because we want toย wipe data) from the original firmware.
  • Your device should reboot automatically once Odin finished flashing. Agree to do a factory reset if asked.
  • If your device doesย NOTย have boot ramdisk, reboot to recovery now to enable it.
  • Install the app youโ€™ve already downloaded and launch the app. It should show a dialog asking for additional setup.
  • Let the app do its job and automatically reboot the device. Voila!

Upgrading the OS

Once you have rooted your Samsung device, you can no longer upgrade your Android OS through OTA. To upgrade your deviceโ€™s OS, you have to manually download the new firmware zip file and go through the sameย APย patching process written in the previous section.ย The only difference here is in the Odin flashing step: do NOT use theย CSCย tar, but instead use theย HOME_CSCย tar as we are performing an upgrade, not the initial install.

Important Notes

  • Never, everย try to restore eitherย boot,ย recovery, orย vbmetaย partitions back to stock! You can brick your device by doing so, and the only way to recover from this is to do a full Odin restore with data wipe.
  • To upgrade your device with a new firmware,ย NEVERย directly use the stockย APย tar file with reasons mentioned above.ย Alwaysย patchย APย in the app and use that instead.
  • Never just flash onlyย AP, or else Odin may shrink yourย /dataย filesystem size. Flashย APย +ย BLย +ย CPย +ย HOME_CSCย when upgrading.

Custom Recovery

This installation method is deprecated and is maintained with minimum effort. YOU HAVE BEEN WARNED!

Installing using custom recoveries is only possible if your device has boot ramdisk. Installing through custom recoveries on modern devices is no longer recommended. If you face any issues, please use the properย Patch Imageย method.

  • Download the the APK
  • Rename theย .apkย file extension toย .zip, for example:ย Magisk-v24.0.apkย โ†’ย Magisk-v24.0.zip. If you have trouble renaming the file extension (like on Windows), use a file manager on Android or the one included in TWRP to rename the file.
  • Flash the zip just like any other ordinary flashable zip.
  • Reboot and check whether the Magisk app is installed. If it isnโ€™t installed automatically, manually install the APK.

Warning: theย sepolicy.ruleย file of modules may be stored in theย cacheย partition. DO NOT WIPE THEย CACHEย PARTITION.

Changelog

v25.2

  • [MagiskInit] Fix a potential issue when stub cpio is used
  • [MagiskInit] Fix reboot to recovery when stub cpio is used
  • [MagiskInit] Fix sepolicy.rules symlink for rootfs devices
  • [General] Better data encryption detection
  • [General] Move the whole logging infrastructure into Rust

v25.1

  • [MagiskBoot] Fix ramdisk backup being incorrectly skipped
  • [MagiskBoot] Add new feature to detect unsupported dtb and abort during installation
  • [Zygisk] Change binary hijack paths
  • [App] Fix incorrect recovery mode detection and installation
  • [MagiskInit] Fix config not properly exported in legacy SAR devices
  • [General] Enforce the Magisk app to always match or be newer thanย magiskd
Share This Article
Leave a Comment

Leave a Reply

Your email address will not be published. Required fields are marked *