Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

backup full sms/mms contents via adb

Tags:

android

I've been attempting to use adb to pull the sms/mms inbox in its entirety from the device but am having some trouble. The phone is rooted and I've tried the following commands:

Input

./adb pull /data/data/com.android.providers.telephony/databases/mmssms.db 

output

Permission denied 

Input

./adb pull su /data/data/com.android.providers.telephony/databases/mmssms.db 

Output

The help menu 

Am I flawed in my thinking that I can pull the sms inbox via commands similar to the ones I've tried? If it can be done what is wrong with my command?

Thanks

like image 573
KDEx Avatar asked Sep 04 '12 15:09

KDEx


People also ask

Does ADB backup pictures?

It can backup all APKs and their data, your personal files, downloads, music, pics, etc.

Does Google pixel backup text messages?

Android's built-in SMS BackupPixels have automatic SMS backup. Google Pixel phones have supported restoring backups since Android 8.1, allowing you to automatically transfer key data from your old phone to your new phone (including SMS messages) after the initial setup.


1 Answers

One way to fetch contents of the /data directory is to first copy the sqlite db to somewhere that is accessible, and then using adb pull to copy from there to the host.

For example, the following commands use the android bridge to grab the sms data (assuming it is contained in /data/data/com.android.providers.telephony/databases/mmssms.db):

adb shell $ mkdir /mnt/sdcard/tmp # su # cat /data/data/com.android.providers.telephony/databases/mmssms.db > /mnt/sdcard/tmp/mmssms.db # exit $ exit adb pull /mnt/sdcard/tmp/mmssms.db . 

Now you have the mms/sms database on your host machine, probe to find most popular recipient, for example:

sqlite3 -header mmssms.db 'select address from sms' | sort -n | uniq -c | sort -n 

Finally, tidy up the temp area:

adb shell $ rm /mnt/sdcard/tmp/mmssms.db $ rmdir /mnt/sdcard/tmp $ exit 
like image 173
Bonlenfum Avatar answered Oct 06 '22 15:10

Bonlenfum