summaryrefslogtreecommitdiff
path: root/tools/aapt/Package.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 /tools/aapt/Package.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 'tools/aapt/Package.cpp')
-rw-r--r--tools/aapt/Package.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/aapt/Package.cpp b/tools/aapt/Package.cpp
index a7ff5fabf495..5e0f87f0dcaf 100644
--- a/tools/aapt/Package.cpp
+++ b/tools/aapt/Package.cpp
@@ -10,6 +10,7 @@
#include "ResourceFilter.h"
#include "Utils.h"
+#include <androidfw/PathUtils.h>
#include <androidfw/misc.h>
#include <utils/Log.h>
@@ -170,7 +171,7 @@ status_t writeAPK(Bundle* bundle, const String8& outputFile, const sp<OutputSet>
/* anything here? */
if (zip->getNumEntries() == 0) {
if (bundle->getVerbose()) {
- printf("Archive is empty -- removing %s\n", outputFile.getPathLeaf().c_str());
+ printf("Archive is empty -- removing %s\n", getPathLeaf(outputFile).c_str());
}
delete zip; // close the file so we can remove it in Win32
zip = NULL;
@@ -274,9 +275,9 @@ bool processFile(Bundle* bundle, ZipFile* zip,
return true;
}
- if (strcasecmp(storageName.getPathExtension().c_str(), ".gz") == 0) {
+ if (strcasecmp(getPathExtension(storageName).c_str(), ".gz") == 0) {
fromGzip = true;
- storageName = storageName.getBasePath();
+ storageName = getBasePath(storageName);
}
if (bundle->getUpdate()) {
@@ -366,7 +367,7 @@ bool processFile(Bundle* bundle, ZipFile* zip,
*/
bool okayToCompress(Bundle* bundle, const String8& pathName)
{
- String8 ext = pathName.getPathExtension();
+ String8 ext = getPathExtension(pathName);
int i;
if (ext.length() == 0)