Selling a Xiaomi smartphone is a big step, especially if you're looking at a big memory model that has been accumulating photos, correspondence, banking data and other sensitive information for years, and even after a standard factory reset, some of the data can be recovered using specialized software. Why is this happening?
The point is that the operating system MIUI (Like any other Android shell, it doesn't physically erase files -- it only labels memory sectors as "free," leaving the possibility for recovery:
- ๐ธ Photos and videos in internal memory (including hidden folders.thumbnails and DCIM/.hidden)
- ๐ฌ Message logs from messengers (even deleted messages in WhatsApp or Telegram)
- ๐ฆ Cash of banking applications (for example, Sberbank Online or Tinkoff)
- ๐ Geolocation data from com.google.android.gms and com.miui.location
In this article, we will discuss three levels of cleanup: basic (for most users), advanced (with data encryption), and expert (with physical memory wiping), and you will learn how to check if files are deleted without recovery.
1.Reset preparation: what to do before data deletion
Before you start cleaning, follow a few critical steps, and skipping them can result in your Mi Account being unable to recover after you reset (if you forgot your password) or losing access to Google Play purchases.
Delete all Google accounts (Settings) โ Accounts)
Unlock the device from Mi Account (Settings) โ Mi Account โ Delete the account)
Backup important data (Settings โ Additional โ Backup)
Get out. SIM-microSD card and memory card (if any)
Record the IMEI of your phone (type *#06#)
-->
Pay special attention to the Mi Account deletion clause, if you are selling a phone with a Xiaomi account tied, the new owner will be able to:
- ๐ Unlock the device through your email/phone (if you know the password)
- ๐ Get your shopping notifications at the Mi Store
- ๐ฑ Use Find Device features to track your phone
โ ๏ธ Note: If you forget the password from Mi Account, you can reset it only through the official website account.xiaomi.com. After resetting the phone without detachment of the account, the new owner will see a request to enter your data when you first turn on (Mi Account Lock).
Also check if the phone is linked to a mobile operator (such as MTS Bonus or Beeline Subscriptions) and some rates are automatically renewed and payments can be charged to your card even after the device is sold.
2.Basic reset: how to make Factory Reset on Xiaomi
The standard factory reset is the minimum necessary procedure before the sale.
- ๐ฑ All installed applications and their data
- ๐ Personal files in internal memory (except system files)
- ๐ง System settings (Wi-Fi, Bluetooth, wallpaper, etc.)
However, as mentioned earlier, files are not physically erasedโthey can be restored by programs like DiskDigger or Recuvaโbut without this step, there is no point in further manipulation.
Method 1: Through the settings menu
The easiest method available on all Xiaomi, Redmi and other models POCO:
- Open the Settings. โ The phone.
- Tap 7 times on the item Version MIUI, to activate the developer mode (optional, but useful for the following steps)
- Return to the main settings menu and select Additional โ Recovery and Reset
- Click Reset Settings โ Delete all data
- Enter. PIN-code or pattern lock, confirm the action
Method 2: Recovery Mode (if the phone is not turned on)
If your smartphone is locked or not booting, use the Restore mode:
- Turn off your phone (press the Power + Volume Up for 10 seconds)
- Hold on to the Power. + Volume Up before the Mi logo appears
- In the Recovery menu, select Wipe Data (manage โ volume buttons, confirmation โ Power)
- Confirm the action, wait until the completion (usually 1-3 minutes)
- Select Reboot to Reboot
๐ก
If after reset, the phone asks to enter a password from the previous Google account (FRP-locking, so you didn't delete it beforehand. Solution: enter the data or perform a bypass. FRP via Fastboot (instructions are available on the 4PDA).
3. Advanced Cleanup: Encrypting Data Before Resetting
To make it harder to recover files, you can encrypt internal memory before resetting, and this is effective because:
- ๐ Data is encrypted using a key that is erased when Factory Reset is used.
- ๐ก๏ธ Without a key, decryption is almost impossible (even for professionals)
- โก It works for all Xiaomis with MIUI 9+ Android 7.0+
Encryption instructions:
- Charge your phone to at least 80% (the process takes 30-60 minutes)
- Go to Settings. โ Additionally. โ Encryption and credentials
- Select Encrypt Phone (if the option is inactive, install it). PIN-code)
- Follow the instructions on the screen (you will need to enter a password 2-3 times)
- After the encryption is complete, perform Factory Reset (see Section 2)
โ ๏ธ Note: Encryption will only delete data when reset if you use File-Based Encryption (FBE), which is activated by default in new versions MIUI. Older devices (until 2018) may require manual setup.
To check the type of encryption enter in the terminal (rights required) ADB):
adb shell getprop ro.crypto.typeIf the file answer is correct, if the block method is less reliable, then it is better to use physical rubbing (see section 4).
Expert method: physical erasure of memory
For maximum certainty that data recovery is impossible, use full wiped internal memory with random data (wipe).
- ๐ฑ Phones with sensitive information (working devices, business phones)
- ๐ง Devices that are sold through bulletin boards (high risk of fraud)
- ๐ ๏ธ Models with old versions MIUI (until 2019, where encryption is unreliable
This will require:
- ๐ฅ๏ธ Computer with installed ADB and Fastboot
- ๐ Cable USB Type-C (original, undamaged)
- ๐ Unlocked Bootloader โ If not, follow Xiaomiโs instructions
Step-by-step:
- Activate Developer Mode (see Section 2) and enable Debugging by USB In Settings โ Additionally. โ For developers
- Connect your phone to your PC and execute the command: adb reboot bootloader
- After you switch to Fastboot, type in: fastboot erase userdata fastboot erase cache
- For complete wiping (3-5 passes with random data): fastboot format:ext4 userdata
- Reboot the phone: fastboot reboot
| Team team. | What's he doing? | Implementation time |
|---|---|---|
| fastboot erase userdata | Remove the section with user data | 10โ30 seconds |
| fastboot format:ext4 userdata | Formats a data-brushing section | 5-15 minutes (depending on the amount of memory) |
| fastboot oem lock | Blocks the bootloader (optional, for security) | 5 seconds |
โ ๏ธ Attention: The fastboot erase and fastboot format commands permanently delete all data, including system files, and once they are executed, the phone will stop loading until the firmware is re-booted. Use only if you are confident in your actions!
What if the phone doesnโt turn on after formatting?
5.Verification: How to make sure that data is actually deleted
Even after all the manipulations, you should check if there are traces of your activity on the phone.
Method 1: Checking with Recovery
If you have done a reset through Recovery, check:
- Press Power + Volume Up to log in to Recovery
- Choose Mount โ System and Mount โ Data
- Connect your phone to your PC and check the contents of folders through ADB: adb shell ls /data/data/ If the folder is empty or contains only system files, the data is deleted.
Method 2: Using Recovery Programs
Install a data recovery program on your PC (for example, DiskDigger or 7-Data Recovery) and scan the phone's internal memory:
- ๐ The program finds files with names like deleted_1234.jpg โ discharge was incomplete
- ๐๏ธ Files are restored but opened as โbrokenโ โ encryption worked
- โ The program finds nothing โ the data is erased without the possibility of recovery
For the test, connect the phone in mode MTP (as a flash drive) and scan the userdata section. If you used physical wiping, the programs should not find any personal files.
Standard Factory Reset
Encryption + reset
Physical wiping through Fastboot
I sell without cleaning (I trust the customer)
Another way.-->
6. Additional security measures
In addition to cleaning up your memory, pay attention to:
1. MicroSD memory card
If you have a memory card installed in your phone, you need to clean it, too. Phone formatting is not enough, use:
- ๐พ Full formatting on PC through SD Card Formatter (select the Overwrite format option)
- ๐ฅ Utility. HDD Low Level Format Tool for Physical Grinding
2. SIM-map
Even if you took it out. SIM-map, the phone could have stayed on:
- ๐ Logs of calls (stored in the /data/com.android.providers.contacts/databases)
- ๐ฉ SMS-message (folder) /data/com.android.providers.telephony/databases)
Remove them manually through Settings โ Annexes โ All applications โ Communications/Contacts โ Warehouse โ Clear the data.
3. Accounts and synchronization
Check if you have left on your phone:
- ๐ง Email accounts (e.g. Yandex Mail or Mail.ru)
- โ๏ธ Cloud services (Mi Cloud, Google Drive, Dropbox)
- ๐ฎ Accounts in games (Google Play Games, Game Center)
Remove them through Settings โ Accounts or Settings โ Synchronization.
๐ก
Even after a complete cleanup, avoid selling a phone with the original packaging if it has documents preserved (IMEI, Serial number โ can be used to restore access to certain services.
7. Frequent mistakes and how to avoid them
Many users make critical mistakes in preparing Xiaomi for sale.
| Mistake. | Effects of consequences | How to fix it |
|---|---|---|
| Not deleted by Mi Account | The new owner can unlock the phone through your account | Untie the device in Settings โ Mi Account |
| Reset without disabling your Google account | FRP-lock (requires you to enter your password after resetting) | Delete your account in Settings โ Accounts. โ Google |
| Use of fast microSD formatting | Files are easy to recover with programs like Recuva | Full formatting through SD Card Formatter with Overwrite option |
| Selling a phone with an unlocked bootloader | The new owner can sew custom firmware with a backdoor | Close the bootloader with the command fastboot oem lock |
Another common problem is residual data in the app cache, like Viber or WhatsApp, which can back up your emails in folders:
- /sdcard/Android/media/com.whatsapp/WhatsApp/Databases
- /data/data/com.viber.voip/files/viber_data
Remove them manually through a file manager with root rights or using the ADB:
adb shell rm -rf /sdcard/Android/media/com.whatsapp/*