From 57fe48389f845709db23234088b97f4e30307ff4 Mon Sep 17 00:00:00 2001 From: Adam Lesinski Date: Wed, 10 May 2017 15:42:22 -0700 Subject: [PATCH] AAPT: Allow including dependencies in dump command Feature splits depend on their base. The dump badging command does resource resolution, and needs to be able to find resources located in the base APK of a feature split. Bug: 38038608 Test: manual Change-Id: I8c22f0083c46a853a3a56a4049715409ac2723fe --- tools/aapt/Command.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tools/aapt/Command.cpp b/tools/aapt/Command.cpp index 15648bdd1b3bc..ba731801e5070 100644 --- a/tools/aapt/Command.cpp +++ b/tools/aapt/Command.cpp @@ -762,6 +762,15 @@ int doDump(Bundle* bundle) return 1; } + // Now add any dependencies passed in. + for (size_t i = 0; i < bundle->getPackageIncludes().size(); i++) { + const String8& assetPath = bundle->getPackageIncludes()[i]; + if (!assets.addAssetPath(assetPath, NULL)) { + fprintf(stderr, "ERROR: included asset path %s could not be loaded\n", assetPath.string()); + return 1; + } + } + // Make a dummy config for retrieving resources... we need to supply // non-default values for some configs so that we can retrieve resources // in the app that don't have a default. The most important of these is