How to Unroot Android Completely
Time to remove root? Maybe for warranty service, selling your phone, or just want a fresh start.
Here's how to cleanly unroot any Android device.
Why Unroot?
Common reasons:
- Warranty claim requires stock device
- Selling phone to someone unfamiliar with root
- Banking apps giving issues (quicker than configuring hiding)
- System stability problems
- Want completely fresh start
- New job requires stock phone
Unroot Methods
| Method | What It Does | Best For |
|---|---|---|
| Magisk Uninstall | Removes root only | Quick unroot, keep everything else |
| Flash Stock Boot | Replaces patched boot | If Magisk uninstall fails |
| Full Stock Restore | Completely stock | Warranty claims, selling |
Method 1: Unroot via Magisk App
Easiest method if Magisk is working properly.
Steps
1. Open Magisk app
2. Tap "Uninstall Magisk" (at bottom)
3. Select "Complete Uninstall"
4. Wait for process
5. Phone reboots automatically
6. Magisk is gone!
What This Does
- Removes Magisk from boot partition
- Deletes Magisk app
- Removes all modules
- Removes root access
What This Doesn't Do
- Doesn't remove custom ROM (stays)
- Doesn't remove custom recovery (stays)
- Doesn't lock bootloader
- Doesn't restore stock firmware
Method 2: Flash Stock Boot Image
If Magisk uninstall doesn't work or want extra certainty.
Get Stock Boot Image
From Firmware Package:
1. Download stock firmware for your device
2. Extract boot.img from package
From Payload.bin (Modern Android):
1. Extract payload.bin from OTA
2. Use payload_dumper to extract boot.img
3. Save boot.img
Flash Stock Boot
Via Fastboot:
adb reboot bootloader
fastboot flash boot stock_boot.img
fastboot reboot
Via TWRP:
1. Copy boot.img to phone
2. TWRP → Install → Install Image
3. Select boot.img
4. Select Boot partition
5. Flash
6. Reboot
After Flashing
Root is now removed. Magisk app will show "N/A" status.
Method 3: Full Stock Restore
For complete stock return (warranty, selling).
Samsung
Using Odin:
1. Download stock firmware from SamMobile
2. Boot to Download Mode
3. Flash all partitions in Odin:
- BL
- AP
- CP
- CSC
4. Wait for PASS
5. Device is fully stock
Xiaomi
Using MiFlash:
1. Download Fastboot ROM from MIUI
2. Boot to Fastboot mode
3. Flash with MiFlash (clean all)
4. Wait for completion
5. Device is stock
Pixel
Using Factory Images:
# Download factory image
# Extract and run
./flash-all.sh
# Device returns to stock
OnePlus
Using MSM Tool:
1. Download MSM Download Tool
2. Boot to EDL mode
3. Run MSM Tool
4. Wait for completion
5. Device is stock + bootloader re-locked
Removing Custom Recovery
If you also want stock recovery:
Flash Stock Recovery
adb reboot bootloader
fastboot flash recovery stock_recovery.img
fastboot reboot
Or Let Stock Replace It
Stock Android often replaces custom recovery automatically on boot (if not rooted).
Re-Lock Bootloader
⚠️ WARNING: Only do this on COMPLETELY STOCK device.
Re-locking with custom software = potential brick!
Verify Stock First
# Check if all partitions are stock
# Only proceed if you flashed full stock firmware
Re-Lock Commands
Most Devices:
adb reboot bootloader
fastboot flashing lock
# Confirm on device
Samsung:
Settings → Developer Options → OEM Unlock → Disable
-OR-
Download mode → Volume Up to re-lock
What Re-Locking Does
- Wipes all data (factory reset)
- Restores verified boot
- Returns boot status to locked
- Warranty perspective: looks unmodified
Knox Warning (Samsung)
Re-locking bootloader does NOT restore Knox:
- If Knox was tripped (0x1), it stays tripped
- This is permanent hardware fuse
- Samsung can still see device was modified
Verify Unroot Success
Check Root Status
Root Checker app:
Download "Root Checker"
Run check
Should show "Root not properly installed"
Check SafetyNet
YASNAC or Play Integrity Checker:
Run attestation test
Should pass BASIC and DEVICE integrity
Check Other Verification
Banking apps should work
Google Pay should work
Netflix should be downloadable from Play Store
What About KernelSU?
If you used KernelSU instead of Magisk:
Uninstall KernelSU
1. Open KernelSU app
2. Disable root for all apps
3. Flash stock kernel or boot image
4. Uninstall KernelSU app
What About LSPosed?
If you had LSPosed installed:
Full Removal
1. Uninstall LSPosed app
2. Remove LSPosed module from Magisk
3. Reboot
4. Then proceed with Magisk uninstall
Troubleshooting
Magisk Uninstall Fails
Solution: Flash stock boot image manually
Still Failing SafetyNet After Unroot
Possible causes:
- Bootloader still unlocked (triggers some checks)
- Data partition has remnants
- Custom ROM detected
Solutions:
- Re-lock bootloader (if safe to do so)
- Factory reset
- Flash full stock firmware
Apps Still Say "Rooted Device"
Some apps cache root detection:
1. Clear app data
2. Reinstall app
3. Fresh login
Going Back to Root Later
If you unroot temporarily (warranty) and want root back later:
Keep These Saved
- Your working Magisk-patched boot.img
- TWRP recovery image
- ROM + GApps you were using
Re-Root Process
1. Unlock bootloader (wipes data)
2. Flash TWRP
3. Flash ROM
4. Flash Magisk
5. Restore setup from backup
Checklist for Complete Clean Phone
Full Stock Return:
[ ] Flash complete stock firmware
[ ] Remove custom recovery
[ ] Factory reset
[ ] Re-lock bootloader (if safe)
[ ] Verify SafetyNet passes
[ ] Test banking apps
[ ] Remove any unlocking tools from PC
Summary
Quick unroot: Magisk → Uninstall → Complete
Full stock:
1. Flash stock firmware via brand tool
2. Flash stock recovery
3. Re-lock bootloader (only if fully stock)
4. Factory reset
5. Verify with SafetyNet check
Unrooting is reversible. You can always re-unlock and root again later. Root responsibly!
Keywords: unroot android, remove magisk, unroot phone, restore stock android, remove root access