From 804e819c1bf64d4df483107e02e896b29e58b3f1 Mon Sep 17 00:00:00 2001 From: Tomasz Wasilczyk Date: Wed, 23 Aug 2023 02:22:53 +0000 Subject: Move String8 path functions to androidfw and aapt Test: m checkbuild Bug: 295394788 Change-Id: I9488bc5632cbd47c83f6b5f2df4c87eb324a1e8e --- libs/androidfw/BackupHelpers.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libs/androidfw/BackupHelpers.cpp') 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 #include +#include #include #include #include @@ -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 -- cgit v1.2.3-59-g8ed1b