summaryrefslogtreecommitdiffstats
path: root/libs/utils/BackupHelpers.cpp
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2011-05-18 16:28:19 -0700
committerAlex Ray <aray@google.com>2013-07-30 13:56:56 -0700
commit8deb51e8e492219c72b5f143868958af2ad56459 (patch)
treee65b7165de85c978f65197daeca2bf8ddc525b65 /libs/utils/BackupHelpers.cpp
parent2d57c038725fb59587600e0b74e1c9b4ad01c4ab (diff)
downloadcore-8deb51e8e492219c72b5f143868958af2ad56459.tar.gz
core-8deb51e8e492219c72b5f143868958af2ad56459.tar.bz2
core-8deb51e8e492219c72b5f143868958af2ad56459.zip
Restore from a previous full backup's tarfile
Usage: adb restore [tarfilename] Restores app data [and installs the apps if necessary from the backup file] captured in a previous invocation of 'adb backup'. The user must explicitly acknowledge the action on-device before it is allowed to proceed; this prevents any "invisible" pushes of content from the host to the device. Known issues: * The settings databases and wallpaper are saved/restored, but lots of other system state is not yet captured in the full backup. This means that for practical purposes this is usable for 3rd party apps at present but not for full-system cloning/imaging. Change-Id: I0c748b645845e7c9178e30bf142857861a64efd3
Diffstat (limited to 'libs/utils/BackupHelpers.cpp')
-rw-r--r--libs/utils/BackupHelpers.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp
index e15875f38..f933199fe 100644
--- a/libs/utils/BackupHelpers.cpp
+++ b/libs/utils/BackupHelpers.cpp
@@ -503,6 +503,16 @@ int write_tarfile(const String8& packageName, const String8& domain,
needExtended = true;
}
+ // Non-7bit-clean path also means needing pax extended format
+ if (!needExtended) {
+ for (size_t i = 0; i < filepath.length(); i++) {
+ if ((filepath[i] & 0x80) != 0) {
+ needExtended = true;
+ break;
+ }
+ }
+ }
+
int err = 0;
struct stat64 s;
if (lstat64(filepath.string(), &s) != 0) {