OSDN Git Service

AAPT: Multiple period legacy support and errors
authory <rtmitchell@google.com>
Wed, 11 Apr 2018 16:54:56 +0000 (09:54 -0700)
committery <rtmitchell@google.com>
Wed, 11 Apr 2018 22:52:43 +0000 (15:52 -0700)
commitd6b83299a6d636c67fee8bd4ae07555a9ae2269a
tree3ba4327af7207a6a57c2375f87cdda1804651d08
parent65317bac02e993d1313a1958a8497ff5f2a2ecd5
AAPT: Multiple period legacy support and errors

AAPT would accept files with multiple periods in the filename as input.
This lead to cases explained in b/74999475. This change adds error
messages for files with multiple periods unless the legacy flag is
present. With the legacy flag present, AAPT2 will behave like AAPT
rather than throwing an error.

Test: Added tests to aapt2_tests
Bug: 73071563
Bug: 74999475
Change-Id: I28dfceeea7b39f8e4b9e6671e0fc8793cf388f52
tools/aapt2/Android.bp
tools/aapt2/cmd/Compile.cpp
tools/aapt2/cmd/Compile.h [new file with mode: 0644]
tools/aapt2/cmd/Compile_test.cpp [new file with mode: 0644]
tools/aapt2/integration-tests/CompileTest/res/drawable/image.9.png [new file with mode: 0644]
tools/aapt2/integration-tests/CompileTest/res/drawable/image.png [new file with mode: 0644]
tools/aapt2/integration-tests/CompileTest/res/drawable/image.small.9.png [new file with mode: 0644]
tools/aapt2/integration-tests/CompileTest/res/drawable/image.small.png [new file with mode: 0644]
tools/aapt2/integration-tests/CompileTest/res/values/values.all.xml [new file with mode: 0644]
tools/aapt2/integration-tests/CompileTest/res/values/values.xml [new file with mode: 0644]