summaryrefslogtreecommitdiff
path: root/libs/androidfw/BackupHelpers.cpp
diff options
context:
space:
mode:
author Tomasz Wasilczyk <twasilczyk@google.com> 2023-09-06 18:52:41 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-09-06 18:52:41 +0000
commit4fb86ec92a08a65e2ab52f8e361edb15b380cfc4 (patch)
treea5bbde4223f39d17c527fbd38c100d539cf86339 /libs/androidfw/BackupHelpers.cpp
parent65a02ad0798646eb68c06c2166a2e306fb1b6d1c (diff)
parent13ab173d417f9b64161b0101d15b63fddf9fc0ee (diff)
Merge "Move String8 path functions to androidfw and aapt" into main am: 713e3930c4 am: 0cfc1c6ddd am: 9a80e1b70c am: 13ab173d41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/2723454 Change-Id: Id68d9725e711288d95290e07d3f656ed848fb69c Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'libs/androidfw/BackupHelpers.cpp')
-rw-r--r--libs/androidfw/BackupHelpers.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/androidfw/BackupHelpers.cpp b/libs/androidfw/BackupHelpers.cpp
index 35826090d6e5..1a6a952492f6 100644
--- a/libs/androidfw/BackupHelpers.cpp
+++ b/libs/androidfw/BackupHelpers.cpp
@@ -30,6 +30,7 @@
#include <utime.h>
#include <zlib.h>
+#include <androidfw/PathUtils.h>
#include <log/log.h>
#include <utils/ByteOrder.h>
#include <utils/KeyedVector.h>
@@ -606,14 +607,14 @@ int write_tarfile(const String8& packageName, const String8& domain,
prefix += packageName;
}
if (domain.length() > 0) {
- prefix.appendPath(domain);
+ appendPath(prefix, domain);
}
// pax extended means we don't put in a prefix field, and put a different
// string in the basic name field. We can also construct the full path name
// out of the substrings we've now built.
fullname = prefix;
- fullname.appendPath(relpath);
+ appendPath(fullname, relpath);
// ustar:
// [ 0 : 100 ]; file name/path
@@ -654,7 +655,7 @@ int write_tarfile(const String8& packageName, const String8& domain,
// Now build the pax *header* templated on the ustar header
memcpy(paxHeader, buf, 512);
- String8 leaf = fullname.getPathLeaf();
+ String8 leaf = getPathLeaf(fullname);
memset(paxHeader, 0, 100); // rewrite the name area
snprintf(paxHeader, 100, "PaxHeader/%s", leaf.c_str());
memset(paxHeader + 345, 0, 155); // rewrite the prefix area