Are there any way to access the files in /data/data
and copy them into memory card? I do not have root access.
1 Answer
Without root access you have 2 options. Both options (may) allow you to access the files for a particular app, e.g. the folder /data/data/com.app.packagename
.
If the application is debuggable you can use the
run-as
command in adb shell (more info about what adb is and how to install it can be found here)adb shell run-as com.your.packagename` cp /data/data/com.app.packagename/
If the application is not debuggable, you can use Android's backup function.
adb backup -noapk com.app.packagename
You will now be prompted to 'unlock your device and confirm the backup operation'. It's best NOT to provide a password, otherwise it becomes more difficult to read the data. Just click on 'backup my data'. The resulting 'backup.ab' file on your computer contains all the app's data in android backup format. Basically it's a compressed tar file. This page explains how you can use OpenSSL's zlib command to uncompress it. You can use the
adb restore backup.db
command to restore the backup.
-
5Does this also apply to applications with
android:allowbackup="false"
?– Key-SixCommented Jan 9, 2015 at 9:40 -
2@Drejon No, I don't think it will work in that case (but I haven't tested it, so I am not 100% sure).– THelperCommented Jan 9, 2015 at 10:54
-
2I am sure there are some cases of application that don't allow backup. When creating backup of all apps, they simply backup nothing. AFAIK, some app might provide a restricted subset of files or maybe even something custom, so don't consider it as always 1:1 of the directory in /data/data. BTW, BlackBerry forces me to use some password, but it is possible to decrypt it (if you have the password). I think I have used sourceforge.net/projects/adbextractor for that.– v6akCommented Mar 13, 2018 at 20:56
-
3I managed to get it with adb backup -noapk com.app.packagename You will get backup.ab then you will need to convert to tar (to open it with 7zip) You can convert it with sourceforge.net/projects/adbextractor - there is jar inside thi called abe.jar. Then You can run command java -jar abe.jar unpack backup.ab backup.tar Commented Jun 10, 2019 at 8:01
-
6If
adb backup
produces a tiny (41-47 byte) file, then it may be that the APK is marked asallowBackup=0
. Runaapt dump xmltree whatever.apk AndroidManifest.xml | grep allowBackup
. Commented May 4, 2020 at 0:10