Stock Restoration & Unroot

How to Completely Uninstall Magisk

Whether preparing your device for official warranty service, selling your smartphone, passing strict enterprise MDM security compliance, or recovering from a persistent bootloop, follow this guide to completely remove Magisk and restore your stock boot partition.

Clean Uninstallation Principles

Because Magisk operates systemlessly, removing it does NOT require wiping your user data or reinstalling the entire Android operating system. A complete uninstallation simply restores the pristine stock boot.img or init_boot.img and deletes the root configuration directory (/data/adb).

Method 1: Complete Uninstallation via Magisk App (Recommended)

If your device boots normally and you have access to the Magisk App:

  1. Open the Magisk App on your device.
  2. Tap the red "Uninstall Magisk" button located on the main screen.
  3. A dialog will present two choices:
    • "Restore Images" • Only restores stock boot partitions without deleting modules or app settings (used prior to OTA updates).
    • "Complete Uninstall" • Restores stock boot images, removes all root binaries, wipes /data/adb, and completely unroots the device.
  4. Tap "Complete Uninstall".
  5. Magisk will unpack the backup, restore your stock boot partition, and automatically reboot the phone into pristine stock Android.

Method 2: Manual Uninstallation via Fastboot (Emergency / Bootloop)

If your phone is stuck in a bootloop or you cannot access the Magisk App, flash your original stock image directly via Fastboot:

Fastboot Stock Flash Commands
# 1. Reboot device into Fastboot Mode (Hold Power + Volume Down) $adb reboot bootloader # 2. For Android 13+ GKI devices (Pixel 7/8/9, OnePlus 11/12, etc.): $fastboot flash init_boot stock_init_boot.img # 3. For Android 12 and older devices: $fastboot flash boot stock_boot.img # 4. Reboot into stock Android $fastboot reboot

Method 3: Emergency Module Removal (Fix Bootloop Without Unrooting)

If you are only uninstalling Magisk because a bad module caused a bootloop, you do NOT need to unroot! You can disable all modules while keeping Magisk intact:

Option A: Hardware Keycombo Safe Mode

When your device powers on and shows the first boot logo, press and hold Volume Down until the lock screen appears. Android will enter Safe Mode, and Magisk will automatically disable all active modules and core overlays.

Option B: Emergency ADB Module Wipe

ADB Module Removal Command
$adb wait-for-device shell magisk --remove-modules $adb reboot

Critical Warning: Relocking the Bootloader Safely

If you intend to relock your bootloader after uninstalling Magisk (via fastboot flashing lock):

CRITICAL WARNING:

NEVER relock your bootloader if any partition (system, vendor, boot, recovery) is modified! If Android Verified Boot (AVB) detects a modified binary on a locked bootloader, your phone will permanently hard brick with a "No valid operating system found" error. Always flash full official stock factory firmware before relocking.

Source & Verification Standard

Last Reviewed: August 19, 2026 • Verified With: Magisk v30.7 • Primary upstream: topjohnwu/Magisk. Primary reference: topjohnwu/Magisk on GitHub.