Step-by-step guides for Samsung & Xiaomi devices
Complete all items before proceeding. Skipping any step may brick your device.
Power off your device completely. Then press and hold:
On newer devices (S8+), hold Volume Up + Volume Down, then connect USB.
When the warning screen appears, press Volume Up to continue to Download Mode.
Some Samsung devices require a specific unlock process:
Download TWRP for your specific model from twrp.me.
Using Odin (Windows):
AP (or PDA on older versions) and select the TWRP .tar fileStartUsing Heimdall (Linux/Mac):
heimdall flash --RECOVERY twrp.img --no-reboot
Then manually boot to recovery with Volume Up + Power.
Download these before starting the flash process.
Power off, then hold Volume Up + Power until TWRP appears.
If you see "Unmodified system partition," swipe to allow modifications.
In TWRP, go to Wipe → Advanced Wipe:
Dalvik/ART Cache, System, Data, CacheInternal Storage (where your ROM zip is stored)Vendor partition.
Go to Install and flash in this exact order:
.zip.zip (if ROM doesn't include Google apps).apk renamed to .zip (for root, optional)After each file, tap "Add another ZIP" rather than rebooting between flashes.
Reboot to System. First boot may take 5-15 minutes.
Complete setup wizard. If you flashed Magisk:
vbmeta_disabled.tar via Odin to disable AVB, or the device won't boot custom ROMs.
Use one of these tools to download official firmware:
Your CSC (region code) can be found in Settings → About → Software Information.
Extract the firmware. You should see files like AP_xxx.tar.md5, BL_xxx.tar.md5, etc.
AP → AP_xxx.tar.md5BL → BL_xxx.tar.md5CP → CP_xxx.tar.md5 (modem)CSC → CSC_xxx.tar.md5 (use HOME_CSC to keep data, or CSC to wipe)StartBoot back to TWRP, wipe Dalvik/Cache, and re-flash ROM. If persistent, do a full wipe (including Internal Storage) and reflash stock firmware first.
Your bootloader is still locked, or you're using the wrong firmware variant. Check model number carefully (e.g., SM-G991B vs SM-G991U).
Install a GCam port or Samsung camera APK from your stock firmware. AOSP cameras lack Samsung's proprietary image processing.
Flash the correct CP/modem file for your model. Baseband version must match your hardware variant.
Use the CSC file (not HOME_CSC) to fully wipe including FRP. Or boot to stock recovery and factory reset from there.
Disable Samsung Game Optimizing Service (GOS) if present. Or flash a kernel tuned for your device (e.g., Kirisakura).
Xiaomi has the most restrictive unlock process. Read carefully.
Go to Settings → Additional Settings → Developer Options → Mi Unlock Status.
Tap Add account and device. Sign in with your Mi Account.
After binding, wait the required period (usually 168 hours / 7 days, up to 720 hours for newer devices).
Power off completely. Then hold:
Release when you see the Fastboot screen (Mi Bunny with "FASTBOOT" text).
UnlockDownload TWRP for your specific Xiaomi model from twrp.me or the device's XDA thread.
Via Fastboot:
fastboot flash recovery twrp.img
fastboot boot twrp.img
Alternative (if booting TWRP directly fails):
fastboot flash recovery twrp.img
fastboot reboot recovery
fastboot flash recovery_a twrp.img && fastboot flash recovery_b twrp.img
Download these before starting the flash process.
Hold Volume Up + Power to enter recovery.
If TWRP asks for a password, enter your lock screen PIN/pattern. If that doesn't work:
Wipe → Format Datayes to formatIn TWRP, go to Wipe → Advanced Wipe:
Dalvik/ART Cache, System, Data, Cache, VendorFor A/B devices, you may also need to wipe the inactive slot:
adb shell
set_active a # or b
# Then wipe from TWRP
Go to Install. Flash in this order:
Use "Add another ZIP" between each file. Do not reboot between flashes.
Reboot to System. First boot may take 5-15 minutes.
For SafetyNet / Banking apps:
MagiskHide Props Config moduleFor Xiaomi.eu ROMs: These are based on China MIUI with Google services added. They don't need GApps but may need Magisk for full functionality.
Download the correct Fastboot ROM (tgz file) for your exact model from:
Verify the model matches exactly (e.g., miui_REMINGTON for Redmi Note 12 Pro).
flash_all.bat)clean all - Wipes everything (recommended)save user data - Keeps internal storageclean all and lock - Wipes and relocks bootloaderFlashIf you don't have Windows, use the built-in scripts:
# Windows
flash_all.bat
# Linux/Mac
./flash_all.sh
These scripts use fastboot commands to flash each partition individually. Make sure fastboot is in your PATH.
Newer HyperOS devices require 720 hours (30 days). There is no way to bypass this. Some community tools claim to bypass but are scams or malware.
Ensure you're using the same Mi Account in the tool as on the device. For HyperOS, apply for unlock in Xiaomi Community app first. Some regions (India) have additional restrictions.
Use EDL mode (Qualcomm 9008). Requires an authorized Xiaomi account or EDL cable. Search for "EDL mode [your model]" on XDA. This is the only way to recover from a hard brick.
Flash the correct firmware/vendor zip before the ROM. If IMEI is lost, restore from backup (if you made one) or use QPST/QFIL to rewrite partitions. Never flash modem partitions from different variants.
Boot to TWRP, wipe Dalvik/Cache, and check you flashed the correct firmware. Xiaomi devices are very firmware-sensitive. Also ensure you didn't flash a ROM for the wrong variant (e.g., China ROM on Global device).
Use Magisk with Zygisk enabled. Install MagiskHide Props Config and set a certified fingerprint. For Xiaomi.eu ROMs, SafetyNet usually passes out of the box.
Flash the correct vendor/firmware for your base MIUI version. Wrong firmware causes power management issues. Also check for wakelocks using apps like BetterBatteryStats.
Install ANXCamera or a GCam port with the correct config for your sensor. Stock MIUI camera apps don't work on AOSP ROMs without significant modification.