2012-09-04 20 views
21

Cihazdan bütün sms/mms gelen kutusunu çekmek için adb kullanmaya çalışıyorum ama sorun yaşıyorum. telefon köklü ve aşağıdaki komutları denedim:yedek tam sms/mms içeriği adb ile

Girdi

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

çıkış

Permission denied 

Girdi

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

Çıktı

The help menu 

Düşüncelerimde sms gelen kutusunu, çalıştığımlara benzer komutlar aracılığıyla çekebileceğim konusunda kusura bakmadım? Eğer benim emrimle neyin yanlış yapılması gerekiyorsa?/Veri dizinin içeriğini almak için

Teşekkür

cevap

34

bir yolu öncelikle ana bilgisayara oradan kopyalamak için adb çekme kullanarak sonra erişilebilir ve olan bir yere sqlite db kopyalamak etmektir.

Örneğin, aşağıdaki komutları (varsayarak /data/data/com.android.providers.telephony/databases/mmssms.db içerdiği) SMS veri almak için robot köprüden:

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 . 

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

kadar Nihayet, düzenli geçici alanı:

adb shell 
$ rm /mnt/sdcard/tmp/mmssms.db 
$ rmdir /mnt/sdcard/tmp 
$ exit 

Şimdi, prob örneğin en popüler alıcıyı bulmak için ana makinede mms/sms veritabanı

+2

Büyük adım adım yöntem! - Kök erişime ihtiyacım var ... – bgs

3

@ Bonlenfum'un cevabı sayesinde Köklü bir aygıttaki herhangi bir dosya/dizinin bir Windows yoluna (yerel veya UNC) kopyalanması için yeniden kullanılabilir bir komut dosyası ile gelebildim.


Düzenleme: yolları boşluk içeren giderildi.


kaydet aşağıdaki gibidir: adbSuPull.bat

@echo off 

SetLocal 
set RemotePath=%~1 
set LocalPath=%~f2 

if [%1] == [] goto Usage 
if "%~1" == "/?" goto Usage 
if not [%3] == [] goto Usage 

:: Replace " " with "\ " (escape spaces) 
set RemotePath=%RemotePath: =\ % 

set TimeStamp=%date:~-4,4%-%date:~-10,2%-%date:~-7,2%_%time:~-11,2%-%time:~-8,2%-%time:~-5,2% 

:: Replace spaces with zeros 
set TimeStamp=%TimeStamp: =0% 

if "%LocalPath%" == "" set LocalPath=adbSuPull_%UserName%_%TimeStamp% 
set SdCardPath=/mnt/sdcard 
set TempPath=%SdCardPath%/adbSuPull_temp_%TimeStamp%/ 

echo. 
echo Copying to temp location "%TempPath%" 
echo. 
adb shell "su -c 'mkdir -p %TempPath%; cp -RLv %RemotePath% %TempPath%'" 

echo. 
echo Copying to destination "%LocalPath%" 
echo. 
adb pull "%TempPath%" "%LocalPath%" 
if ErrorLevel 0 goto Cleanup 

:Error 
echo. 
echo Operation failed. Is USB Storage in use? 
echo. 
pause 
call Cleanup 
exit /b 1 

:Cleanup 
echo. 
echo Removing temp location "%TempPath%" 
echo. 
adb shell "rm -Rf '%TempPath%'" 
exit /b ErrorLevel 

:Usage 
echo. 
echo.adbSuPull ^<RemotePath^> [^<LocalPath^>] 
echo. 
echo Copies files/directories from a rooted Android device to a Windows path. 
echo Author: Ben Lemmond [email protected] 
echo. 
echo. RemotePath (required) Specifies the path to the file or directory on 
echo.       the rooted Android device. 
echo. 
echo. LocalPath (optional) Specifies the destination path. This can be a 
echo.       Windows local path (C:\folder) or a UNC path 
echo.       (\\server\share). 
echo.       Defaults to adbSuPull_%%UserName%%_%%TimeStamp%% 
echo.       in the current working directory. 
exit /b 1 

Kullanımı: Eğer çekmeden önce ADB kök privalages vermek zorunda

adbSuPull <RemotePath> [<LocalPath>] 

Copies files/directories from a rooted Android device to a Windows path. 
Author: Ben Lemmond [email protected] 

    RemotePath (required) Specifies the path to the file or directory on 
         the rooted Android device. 

    LocalPath (optional) Specifies the destination path. This can be a 
         Windows local path (C:\folder) or a UNC path 
         (\\server\share). 
         Defaults to adbSuPull_%UserName%_%TimeStamp% 
         in the current working directory. 
3

o veritabanı

adb root 

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