AAPT2: Increase maximum proto size
Deserializing a proto form a string throws an error when 64MB have been
read from the stream. This change removes the maximum size but shows a
warning when a proto is larger than 64MB.
Bug: 114020398
Test: manual test with resources.pb greater than 64MB
Change-Id: Iee397b6709d79a9338133a6136fe6e8f70a4964c
diff --git a/tools/aapt2/cmd/Convert.cpp b/tools/aapt2/cmd/Convert.cpp
index 86b1f4c..954f1ed 100644
--- a/tools/aapt2/cmd/Convert.cpp
+++ b/tools/aapt2/cmd/Convert.cpp
@@ -170,8 +170,8 @@
}
pb::XmlNode pb_node;
- io::ZeroCopyInputAdaptor adaptor(in.get());
- if (!pb_node.ParseFromZeroCopyStream(&adaptor)) {
+ io::ProtoInputStreamReader proto_reader(in.get());
+ if (!proto_reader.ReadMessage(&pb_node)) {
context_->GetDiagnostics()->Error(DiagMessage(source_)
<< "failed to parse proto XML " << *file->path);
return false;