4

I have a non-rooted Droid X2 that is in permanent "Safe mode", but I want to recover SMS messages. SMS Backup and Restore will NOT work because safe mode only allows system apps to run.

adb shell will get me into the phone, but does not allow me to get to the SMS database:

[rjt@pc232 workspace]$ adb shell
$ cat /proc/version
Linux version 2.6.32.9-00008-gc406305 (hudsoncm@il93lnxdroid80) (gcc version 4.4.0 (GCC) ) #2 SMP PREEMPT Tue Jan 24 22:54:19 CST 2012

$ cd /data/data/com.android.providers.telephony/databases/
$ pwd
/data/data/com.android.providers.telephony/databases
$ ls
opendir failed, Permission denied
$ su -l root
su: permission denied
$ sudo
sudo: permission denied
$ sudo su -
sudo: permission denied
$ sudo su -l root
sudo: permission denied
$

Since SMS Backup and Restore is allowed to access my SMS messages when in normal mode, is "Safe mode" blocking my access or the fact that this phone is not rooted?

Can I root the phone without losing my existing SMS messages?

3 Answers 3

2

You will be unable to do this without a rooted device, as the /data directory can only be read by the Android system, and apps can also read their own /data/data/<package name> directory only.

Android devices do not come with sudo, and you need to be rooted to use su as it switches to the root shell (on unrooted ROM's, su can't switch to the root user, as the kernel denies it).

If you do find a way to root the device, (which may be difficult), you can mount the /data partition as RW, then you can copy files from it.

Use these command to remount the /data patition:

su

mount -o remount,rw /data

The su command can only be executed on a rooted device.

EDIT:

Just for clarification, the SMS Backup & Restore app uses an API call to get the SMS messages via the Messaging app, hence the need for the READ_SMS permission.

EDIT2:

Most rooting methods don't wipe the device data, however some do. You would have to google for a way to root your droid 2 however, and see if it wipes the data.

3
  • When in "Safe mode", should i be able to install and run applications such as "SMS Backup and Restore" via adb? If so, how?
    – rjt
    Jan 12, 2013 at 18:16
  • @rjt You can install them most likely, but you won't be able to run them AFAIK. You could try though. Download the apps .apk file, and use adb install <path/to/apk/file> to install it.
    – Liam W
    Jan 12, 2013 at 18:17
  • Thank You Liam for emphasizing that the phone needed to be rooted first.
    – rjt
    Feb 11, 2013 at 21:15
5

Try this:

cat /data/data/com.android.providers.telephony/databases/mmssms.db > /sdcard/mysms.db

Which copies the SMS database across to the SDCard.

For the Telephone database,

cat /data/data/com.android.providers.telephony/databases/telephony.db > /sdcard/mytelephony.db

Its a very old trick, to pull in the databases without root. It is not guaranteed to work across all ROMs depending on how the directory permissions are set.

13
  • $ cat /data/data/com.android.providers.telephony/databases/mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db: Permission denied
    – rjt
    Jan 12, 2013 at 17:56
  • you left out the redirect symbol? as in >
    – t0mm13b
    Jan 12, 2013 at 17:57
  • Yes i did leave out the redirect because i do not currently have an external sd card. Will try again after inserting card. whoops. i do not have the sdcard with me, do really think it makes a difference?
    – rjt
    Jan 12, 2013 at 17:58
  • try adb pull /data/... directly? You should have stated explicitly in your question that you do not have an external SD Card!
    – t0mm13b
    Jan 12, 2013 at 17:59
  • [rjt@pc232 workspace]$ adb pull /data/data/com.android.providers.telephony/databases/mmssms.db failed to copy '/data/data/com.android.providers.telephony/databases/mmssms.db' to './mmssms.db': Permission denied
    – rjt
    Jan 12, 2013 at 18:01
0

I'm not sure yet whether this works on non-Google phones, but on my Pixel 2 and Nexus 5, the backup feature (under Settings -> System -> Backup -> (Choose profile, if relevant) -> Pixel 2 backup) shows that SMS text messages are included in the Google Drive backup, if you have enabled it. You cannot directly download or view the backup from Google Drive/PC, but if you have another phone and choose to restore data to it, the SMS messages should be downloaded to the new phone and be available to view and export with a 3rd party app.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .