Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

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.

share|improve this answer
    
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 '13 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 '13 at 18:17
    
Thank You Liam for emphasizing that the phone needed to be rooted first. –  rjt Feb 11 '13 at 21:15

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.

share|improve this answer
    
$ cat /data/data/com.android.providers.telephony/databases/mmssms.db /data/data/com.android.providers.telephony/databases/mmssms.db: Permission denied –  rjt Jan 12 '13 at 17:56
    
you left out the redirect symbol? as in > –  t0mm13b Jan 12 '13 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 '13 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 '13 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 '13 at 18:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.