Xiaomi smartphone owners often face the need to find a specific message or recover lost data after a reset. Standard applications only allow you to view correspondence, but do not give access to the physical location of files on the disk. Understanding the structure of the Android file system is necessary for deep diagnosis or manual copying of the database.
Android security isolates application data, so you can't just go to the folder with an SMS through the file manager. Access to system directories requires special rights or the use of debugging tools. In this article, we'll discuss in detail where your messages are and how to work with them safely.
System architecture of message storage
All text messages in the Android operating system, including the MIUI shell and HyperOS, are not stored as separate text files, but are written into a single database. This database is managed by a system component that processes incoming and outgoing packets, physically this file is located in a secure partition of memory, access to which is limited by the rights of the superuser.
The standard path to storage is: /data/data/com.android.providers.telephony/databases/mmssms.db. It is the mmssms.db file that contains the entire history of correspondence, including sent, received and drafts. In some firmware versions, the file name may differ slightly, but the directory structure remains unchanged.
It's important to understand that without root rights, direct access to /data/ is closed. It's a fundamental mechanism for protecting user data from malware, and if you try to open that path through a non-administrator Explorer, the system will give you an access error.
Direct access to database files
To see a message file in the file system, your smartphone must have an unlocked bootloader and established superuser rights (Root), only in this case, file managers with support for root access, such as Root Explorer or MiXplorer, will allow you to move on the system path.
After obtaining the rights, the following actions must be performed:
- π Open the file manager and activate Root mode in the application settings.
- π Cross the path. /data/data/com.android.providers.telephony/databases/.
- π Find the file mmsms.db (sometimes accompanied by log files).
- π Copy the file into internal memory or onto a computer for analysis.
Copying this file allows you to save a complete correspondence history, but you can't just open it with standard means, because it's a SQLite format. You'll need special utilities on your PC to read it.
β οΈ Warning: Modifying or deleting the mmsms.db file manually can result in complete loss of message history and malfunctions in the Messages app. Always back up before any operations.
Using ADB to Retrieve SMS
If root rights are not part of your plans, the only legal way to access a database file is to use the Android debugging bridge (ADB), a method that requires connecting your smartphone to your computer and having drivers.
First, activate the developer mode. To do this, go to Settings β About Phone and quickly click on the build number seven times. Then, in the Advanced Settings menu, turn on Debugging on USB. Connect the phone to your PC and start the command prompt.
To copy the database file, execute the command:
adb pull /data/data/com.android.providers.telephony/databases/mmssms.db C:/sms_backup/The team will copy the file from the system partition to the specified folder on the computer.This method works on most Xiaomi devices, even without root rights, unless the Android version blocks ADB access to system files (on Android 11+, access may be restricted).
What if ADB canβt see the file?
Analysis and reading of message files
Once you have a file called mmsms.db on your computer, the question is, how do you read it? Because it's a SQLite database, a regular text editor will only show a set of obscure characters. You'll need specialized software.
The most popular tools for viewing are:
- π DB Browser for SQLite β a free utility with a convenient interface.
- π SQLiteStudio is a powerful tool for advanced users.
- π Android SMS Backup & Restore β programs that can import a database.
When you open a file in DB Browser, you'll see a pdu table where the bodies of the messages are stored, and a threads table that handles the dialogs. Address fields contain the phone number and body the text of the message.
The table also stores a time stamp in Unix format. Online converters or SQL functions can be used to convert the date to a readable format. This allows you to determine exactly when each message was sent or received.
| Field in the database | Description of the data | Type of data | Example of meaning |
|---|---|---|---|
| _id | Unique message identifier | INTEGER | 1045 |
| thread_id | Dialogue ID (correspondence branches) | INTEGER | 5 |
| address | Phone number of sender/receiver | TEXT | +79990000000 |
| body | Textual content of SMS | TEXT | Confirmation code: 4582 |
| date | Time of creation (Unix timestamp) | BIGINT | 1709823400 |
Recovery of SMS from MIUI backup
Xiaomiβs ecosystem has a built-in backup mechanism that saves SMS in a more accessible format: Local backups are created in the phoneβs memory and do not require root permissions to create.
The way to local backups on Xiaomi is /MIUI/backup/AllBackup/. Inside the backup folder is the sms.db file or data archive. This file is also the SQLite database, but its structure may be specific to the MIUI version.
To recover data from such a copy:
- Go to Settings β About Phone β Reservation and Restore.
- Select βRestoreβ and specify the desired date.
- Mark the βMessagesβ item and start the process.
This method is preferred for ordinary users, as it ensures the integrity of the data and the correct display of messages in the standard application after recovery.
βοΈ Pre-reconstruction checks
Cloud storage Xiaomi Cloud
Modern Xiaomi smartphones offer data synchronization with the cloud service Xiaomi Cloud by default. If this feature was activated, your SMS can be stored on remote servers of the company.
You can check for a copy through your browser by logging into your Mi Account on i.mi.com. However, the data retention policy changes and text may not sync to the cloud depending on the region and privacy settings.
The advantages of cloud storage:
- βοΈ Access to data from any device when logging in to your account.
- βοΈ Automatic saving in case of loss or breakdown of the phone.
- βοΈ Independence from the physical memory of the smartphone.
To activate sync, go to Settings β Mi Account β Xiaomi Cloud and make sure the slider opposite the Messages item is on. This is the most reliable way to protect against accidental loss of information.
β οΈ Note: When resetting to factory settings without prior synchronization with Mi Cloud or local backup, it will be almost impossible to restore SMS.
π‘
Tip: Use third-party apps like SMS Backup & Restore that can save copies straight to Google Drive, which will create a backup independent of Xiaomi.
Problems and limitations of access
Users often find that the paths described here are not working, and this is due to the increased security in newer versions of Android. Starting with Android 10 and up, access to /data/data/ is strictly regulated.
Even with root rights on some devices with disk encryption enabled, files may not be readable until the unlock password is entered. FBE (File Based Encryption) encryption protects each application's data with a separate key.
Possible errors in access:
- π« Β«Access Denied β no root rights or rights ADB.
- π« Β«File corrupted: attempts to read a file while the system is running (file blocked by process).
- π« Empty file β a record failure or feature of the file system.
In such cases, it is recommended to use only regular export funds or specialized software for data recovery, which can work with memory dumps.
π‘
Without root rights or ADB, direct access to the SMS filebase on modern Xiaomi is impossible due to Android system security limitations.