Uninstall

How to uninstall Magisk

The simplest way to remove Magisk is Uninstall Magisk → Complete Uninstall in the Magisk app. This page covers every other situation too: no app, a phone that won't boot, Samsung, and relocking the bootloader without bricking the phone.

Last updated 9 sourcesHow we check pages

Pick your situation

Which way to uninstall?

Is it a Samsung Galaxy?
  • Yes
    Flash the complete stock firmware in Download mode. Never restore single partitions
  • No
    Does the phone boot into Android?
    • Yes
      Does the Magisk app show an installed version?
      • Yes
        Complete Uninstall in the app (reinstall the app first if it's gone)
      • No (N/A)
        Flash the stock image with fastboot
    • No
      Did it stop booting after a module?
      • Yes
        Remove modules first (Safe Mode or adb), then Complete Uninstall
      • No
        Flash the stock image with fastboot
From Magisk's installation guide and FAQ (v30.7 and v31.1) and its uninstaller script.
  1. Open the Magisk app. If you hid it (possible up to v30.7), it appears under the name you gave it, "Settings" by default.
  2. Tap Uninstall Magisk in the Magisk card. The dialog warns: "All modules will be disabled/removed! Root will be removed!"
  3. Tap Complete Uninstall. Don't pick Restore Images: that only puts the stock image back for a system update and leaves Magisk's files in place.
  4. The app removes Magisk, uninstalls itself and the phone reboots a few seconds later.

Magisk's documentation calls this the easiest way to uninstall. If the Magisk app is gone, install it again from the download page first. Since v31.1, Magisk no longer reinstalls its app automatically when it is missing.

What Complete Uninstall does

From Magisk's uninstaller script:

  • Restores the stock boot or init_boot image (and dtb/dtbo if they were patched) from the backup in /data/magisk_backup_*. If there is no backup, it rebuilds the stock ramdisk from the copy Magisk keeps inside the patched image.
  • Runs each module's uninstall.sh, then deletes all modules. Some modules only undo changes made outside their own folder this way, such as Universal GMS Doze.
  • Deletes Magisk's files from /data/adb, /cache, /metadata and /persist.
  • Refuses to touch an image patched by another root tool ("Boot image patched by unsupported programs").

What restoring puts back: our check

When there's no saved stock image, Magisk rebuilds it from the backup it keeps inside the patched image. We tested that step on a real file: Google's generic boot image, patched by Magisk v31.1's own script, then restored with magiskboot cpio restore, the command the uninstaller uses. Android's original init came back byte for byte, Magisk's added files were removed, Magisk's status check returned 0 (stock) again, and the kernel had never been changed.

Restoring a Magisk-patched ramdisk with magiskboot 31.1
$./magiskboot cpio ramdisk.cpio restore "extract init init-restored"; echo "exit code $?" Loading cpio: [ramdisk.cpio] Restore [.backup/init.xz] -> [init] Removed entry [.backup] Removed entry [overlay.d] Removed entry [overlay.d/sbin] Removed entry [overlay.d/sbin/init-ld.xz] Removed entry [overlay.d/sbin/magisk.xz] Extracting entry [init] to [init-restored] Dumping cpio: [ramdisk.cpio] exit code 0 $./magiskboot cpio ramdisk.cpio test; echo "exit code $?" Loading cpio: [ramdisk.cpio] exit code 0 $./magiskboot cpio stock-ramdisk.cpio "extract init init-stock" Loading cpio: [stock-ramdisk.cpio] Extracting entry [init] to [init-stock] Dumping cpio: [stock-ramdisk.cpio] $sha256sum init-restored init-stock a4400f3de64c620d542425c57767a679d73f12b7b6b6111529fe5926fe6d7120 init-restored a4400f3de64c620d542425c57767a679d73f12b7b6b6111529fe5926fe6d7120 init-stock $cmp kernel stock-kernel && echo "kernel identical to the stock kernel" kernel identical to the stock kernel

Lines 62 to 84 of the unedited output. Full log · how it was made

This was a test of the image file on a computer, not an uninstall on a phone. How the image was patched: what patching actually changes.

Uninstall by flashing the stock image

Use this when the app can't do it: the app shows Not Installed (v31.1) or Installed: N/A (v30.7), or the phone won't boot. Flash the unmodified image from the firmware of the build you are running, to the partition you patched:

Restore the stock image
$adb reboot bootloader # flash the one you patched when installing $fastboot flash init_boot init_boot.img $fastboot flash boot boot.img $fastboot reboot

This removes root, but leaves Magisk's data and modules in /data/adb. Without Magisk running, nothing there is loaded; the files stay until a factory reset. Module uninstall.sh scripts don't run. Where to get the stock image: getting the stock image.

With a custom recovery, Magisk's guide also lets you rename the Magisk APK to uninstall.zip and flash it. Run from recovery, the script can't uninstall the app: remove it yourself after rebooting.

If the phone won't boot

A bootloop after installing a module is usually fixable without uninstalling. Magisk's FAQ gives two routes:

  • With USB debugging on: run adb shell magisk --remove-modules while the phone is starting. It removes all modules and reboots.
  • Without it: use Magisk's Safe Mode, which disables all modules. Press Volume Down a few seconds before the boot animation and let go as soon as it appears. Magisk's v31.1 FAQ also says it enters Safe Mode by itself after the phone fails to finish booting twice in a row.

Then uninstall from the app if you still want to. If Magisk itself stops the phone booting, flash the stock image as above. Full recovery steps: fixing a Magisk bootloop.

Samsung phones

Magisk's guide warns never to restore boot, init_boot, recovery or vbmeta to stock on their own: "You can brick your device by doing so, and the only way to recover from this is to do a full firmware restore with data wipe." To remove Magisk from a Galaxy, flash the complete stock firmware (BL, AP, CP and CSC, which wipes data) for your model in Download mode. The Knox warranty bit stays tripped. Tools and firmware: Samsung guide.

Relocking the bootloader

Only relock on fully stock firmware

A locked bootloader checks every boot partition against the manufacturer's keys. If anything modified is still installed when you lock (a Magisk-patched image, a custom ROM, kernel or recovery, a vbmeta flashed with verification disabled), AOSP's boot flow rules say the phone shows a red error screen and can't continue booting. To unlock again you need the OEM unlocking setting, which is inside Android: a phone that can't boot may not be recoverable.

Relocking without bricking the phone

  1. 1Back upLocking resets the phone
  2. 2Flash full stock firmwareEvery partition, same build
  3. 3Boot onceCheck it starts normally
  4. 4Lockfastboot flashing lock
  5. 5Only then turn OEM unlocking offOptional
Order based on AOSP's bootloader locking and boot flow documentation. Relocking resets the phone.
  1. Back up. AOSP says locking resets the device.
  2. Flash the complete stock firmware for your model, not just the image you patched: every partition you or a tool may have changed, including vbmeta. Each brand's full firmware and flashing steps are in the device guides.
  3. Boot it once and check Android starts normally, with Magisk gone.
  4. Lock from the bootloader with fastboot flashing lock and confirm on the phone. Samsung and some other brands use their own process; follow your manufacturer's instructions.
  5. Leave OEM unlocking on until the locked phone has booted. Turning it off is optional afterwards.

After relocking on stock firmware, the unlocked-bootloader warning at boot goes away, and Play Integrity's DEVICE verdict can pass again.

Questions people ask

Does uninstalling Magisk delete my data?

Complete Uninstall removes Magisk's own files and modules, not your apps, photos or settings. The app warns that "Any internal storage unencrypted through the use of Magisk will be re-encrypted". Relocking the bootloader afterwards is different: it resets the phone.

Is the bootloader locked again after uninstalling?

No. Uninstalling only removes Magisk. The bootloader stays unlocked until you lock it yourself, and the phone keeps showing its unlocked-bootloader warning at boot.

Will banking apps and Google Wallet work after uninstalling?

Not necessarily. On Android 13 and newer, Play Integrity's DEVICE and STRONG verdicts need a locked bootloader, so an unrooted phone with an unlocked bootloader still fails them. Relocking on stock firmware is what restores them. See Play Integrity and root.

Will I get system updates again?

Yes, once every partition is stock again. Complete Uninstall restores the stock image the app backed up, or rebuilds it from the backup stored inside the patched image.

Does uninstalling undo Samsung's Knox warranty bit?

No. Magisk's guide says installing Magisk trips the Knox warranty bit and that this "is not reversible in any way". Uninstalling or relocking does not change it.

I only want to remove the app, not Magisk

On v31.1 you can uninstall the app like any other and Magisk keeps running; the release notes even suggest it once root access and modules are set up. Install the APK again when you need it. Don't use Complete Uninstall for this.

Sources

This page is written from the sources below. If anything here disagrees with them, the upstream source is correct.

Found a mistake or something out of date? Tell us and we will check it against the source and fix the page. Confirmed corrections are listed in the corrections log.

Report a problem with this page