summaryrefslogtreecommitdiff
path: root/tools/aapt2/LoadedApk.cpp
diff options
context:
space:
mode:
authorRyan Mitchell <rtmitchell@google.com>2018-08-06 16:32:24 -0700
committerRyan Mitchell <rtmitchell@google.com>2018-08-09 10:57:29 -0700
commit83a37adfbb3c9fc139cc7881995ddd63db4caff8 (patch)
tree706379b92d5d73409c3d2e158fc560f720d764a1 /tools/aapt2/LoadedApk.cpp
parentdeee39507f594db017f0e1beab5c973d178387a4 (diff)
AAPT2: Loosen loading apk format requirements
The Android runtime and AAPT are more lenient of apk format, allowing for duplicate enty, types, and configs. This change loosens the ResourceTable's checks on resource uniqueness when apks are loaded; not when ResourceTables are being created by aapt2. Bug: 36051266 Test: Tested using apks in bug with allow_duplicates on and off Change-Id: I9296417bf2dc53e1e891479a53679a0388210d50
Diffstat (limited to 'tools/aapt2/LoadedApk.cpp')
-rw-r--r--tools/aapt2/LoadedApk.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/aapt2/LoadedApk.cpp b/tools/aapt2/LoadedApk.cpp
index 1dd46ba813db..b32766be8d18 100644
--- a/tools/aapt2/LoadedApk.cpp
+++ b/tools/aapt2/LoadedApk.cpp
@@ -76,7 +76,7 @@ std::unique_ptr<LoadedApk> LoadedApk::LoadProtoApkFromFileCollection(
}
std::string error;
- table = util::make_unique<ResourceTable>();
+ table = util::make_unique<ResourceTable>(/** validate_resources **/ false);
if (!DeserializeTableFromPb(pb_table, collection.get(), table.get(), &error)) {
diag->Error(DiagMessage(source)
<< "failed to deserialize " << kProtoResourceTablePath << ": " << error);
@@ -120,7 +120,7 @@ std::unique_ptr<LoadedApk> LoadedApk::LoadBinaryApkFromFileCollection(
io::IFile* table_file = collection->FindFile(kApkResourceTablePath);
if (table_file != nullptr) {
- table = util::make_unique<ResourceTable>();
+ table = util::make_unique<ResourceTable>(/** validate_resources **/ false);
std::unique_ptr<io::IData> data = table_file->OpenAsData();
if (data == nullptr) {
diag->Error(DiagMessage(source) << "failed to open " << kApkResourceTablePath);