Gather the following items before you begin. Skipping any of these can cause the backup to fail or leave your data exposed.
adb installed and available in the system PATH..jar file that can decrypt and unpack the .ab backup created by ADB.All steps are performed without rooting the device, so the backup respects the app‑level permissions granted by Android.
ADB’s backup command creates a single .ab file that contains the selected app’s data. By adding the -encrypted flag you protect the file with a password you choose. The file is then unpacked with ABE, which produces a .tar archive. Inside the archive you’ll find XML files such as mmssms.xml (SMS/MMS) and contacts2.xml (call logs). These XML files can be opened with any text editor or converted to CSV for easier reading.
If you already have the Android SDK, you can skip this. Otherwise, download the platform‑tools package from the official Android developer site, extract it, and add the folder to your PATH.
# Example for Linux/macOS
wget https://dl.google.com/android/repository/platform-tools-latest-linux.zip -O platform-tools.zip
unzip platform-tools.zip -d $HOME
export PATH=$HOME/platform-tools:$PATH
Open Settings → About phone → tap Build number seven times to unlock Developer options. Then go to Settings → System → Developer options → enable USB debugging. Confirm any prompt that appears on the device.
Connect the phone via USB, then run:
adb devices
You should see a device ID followed by device. If you see unauthorized, accept the RSA key prompt on the phone.
Run the following command. Replace YOUR_PASSWORD with a strong passphrase you will remember. The password will never be stored on the phone.
adb backup -f sms_backup.ab -apk -nosystem -encrypted YOUR_PASSWORD com.android.providers.telephony
The phone will display a confirmation dialog. Tap Back up my data. When prompted for a password, type the same YOUR_PASSWORD and confirm.
Call logs are stored in the same provider package, so the previous backup already contains them. If you prefer a separate file, repeat the command with a different filename:
adb backup -f calllog_backup.ab -apk -nosystem -encrypted YOUR_PASSWORD com.android.providers.contacts
Download android-backup-extractor (ABE) and place abe.jar in a convenient folder.
Run the extractor for each .ab file:
java -jar abe.jar unpack sms_backup.ab sms_backup.tar YOUR_PASSWORD
If you created a separate call‑log backup, unpack it the same way.
Extract the .tar archive (any archive tool will do). Inside you will find a folder structure like:
apps/com.android.providers.telephony/f/00000001.xml
The file mmssms.xml holds all SMS/MMS messages. For call logs, look for contacts2.xml inside the contacts provider folder.
Open the XML files with a text editor. You should see entries such as:
<sms address="+1234567890" date="1633024800000" type="1" body="Hello!" />
If the files are readable, the backup succeeded and the encryption was correctly removed by ABE.
Many users prefer CSV over raw XML. A quick way is to use the free Python script below (requires Python 3).
import xml.etree.ElementTree as ET
import csv, sys
def sms_to_csv(xml_path, csv_path):
tree = ET.parse(xml_path)
root = tree.getroot()
with open(csv_path, 'w', newline='', encoding='utf-8') as f:
writer = csv.writer(f)
writer.writerow(['address','date','type','body'])
for sms in root.iter('sms'):
writer.writerow([
sms.get('address'),
sms.get('date'),
sms.get('type'),
sms.get('body')
])
if __name__ == '__main__':
if len(sys.argv) != 3:
print('Usage: python sms_to_csv.py input.xml output.csv')
sys.exit(1)
sms_to_csv(sys.argv[1], sys.argv[2])
Run it like python sms_to_csv.py mmssms.xml sms.csv. Open the resulting sms.csv in Excel or Google Sheets.
This usually means the device’s backup service is disabled. Go to Settings → System → Backup and ensure “Back up to Google Drive” (or similar) is turned on. The ADB backup command relies on that service.
Check that the destination folder on your PC is writable and that you have enough free space. Use an absolute path, e.g. adb backup -f C:\backups\sms_backup.ab ….
Make sure you typed the same password you entered on the phone. Passwords are case‑sensitive. If you forget it, the backup cannot be decrypted – you’ll need to create a new backup.
Some manufacturers (especially those with heavy custom skins) block ADB backup for the telephony provider. In that case, you can fall back to third‑party apps like “SMS Backup & Restore” which store their own encrypted XML files. The tutorial’s workflow still applies; just replace the ADB step with the app’s export.
Starting with Android 12, the adb backup command is deprecated and may be disabled by the OEM. If the command fails with “Backup disabled”, you must use an app‑based solution (e.g., “SMS Backup & Restore”) or root the device.
Never store the password you use for encryption in an insecure place (plain‑text notes, email, etc.). If an attacker obtains the .ab file and the password, all your messages and call logs are exposed.
After you have verified the XML/CSV files, consider securely deleting the original .ab and .tar files. On Windows you can use “cipher /w:shred or srm.
That’s it! You now have an encrypted backup of your SMS and call logs that can be stored offline, transferred to another device, or archived for future reference—all without rooting your Android phone.









