# backup sms and call logs.

adb shell su -c cp -r /data/data/com.android.providers.telephony/databases /sdcard/telephony
adb shell su -c cp -r /data/data/com.android.providers.contacts/databases /sdcard/contacts

adb pull /sdcard/telephony telephony
adb pull /sdcard/contacts contacts

adb shell rm -r /sdcard/telephony
adb shell rm -r /sdcard/contacts

This script makes two directories: telephony and contacts. telephony/mmssms.db is the SMS database, and contacts/contacts2.db is the call log database. Both are sqlite databases with plain texts.