Since ResStringPools are encoded using Modified UTF-8, retrieving
strings from the string pool convert the strings to UTF-8 before
returning.
Bug: 114734350
Test: m aapt2_tests
Change-Id: Ib459018186f4c5b40f3f3786425a335ecfb9ed02
Codepoints that are encoded to 4 bytes in UTF-8 are not allowed in
Modified UTF-8. They instead should be encoded as surrogate pairs in the
same way that CESU-8 allows for surrogate pairs. This will also cause 4
byte UTF-8 codes to be represented in 6 bytes.
Bug: 37140916
Test: aapt2_tests
Change-Id: I155dc24f166139d1d36a16bac088dcfcd59eb321
Change styled string whitespace processing to be like AAPT's was.
Main changes:
- whitespace around tags is preserved.
- tags start exactly where they are supposed to, not off by one.
Bug: 72406283
Test: make aapt2_tests
Change-Id: I4d12728c493efd8c978e2e3d2718b56534ff52ef
Android package names are more strict (ASCII only) than Java package names.
Also fixed an issue where trailing underscores were disallowed in Android
package names.
Bug: 68468089
Test: make aapt2_tests
Change-Id: I1052e9e82b6617db6065ce448d9bf7972bb68d59
* Use const reference parameter type to avoid unnecessary copy.
* Use more efficient overloaded string methods.
Bug: 30407689
Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: Iaa0a6f18f64cf573bee49dd1466281ea4d37b410
When processing attributes in XML, quotes can't be used to mark a
section as whitespace preserving, so the assumption should be that the
entire string is whitespace preserving, which makes quote characters
literals.
Bug: 62840718
Bug: 62840406
Test: make aapt2_tests
Change-Id: I4afff02148b5b8e78833abf1f323c2f5325d6155
Iterating over a UTF-8 string by codepoints ensures that
unicode characters do not get sliced. Otherwise the resulting
string could contain malformed characters.
Bug: 62839202
Test: make aapt2_tests
Change-Id: Ia0c44fbceb7dcfa11e77a1a77011da0f5466e342
%n is a special value marking a platform independent newline and is
not to be considered a format argument.
Bug: 37132275
Test: make aapt2_tests
Change-Id: I806521e44afe20004344dee9f18ecee6cc7086ea
libandroidfw needs to make use of StringPiece, so
move it to libandroidfw and update all code referencing
StringPiece in aapt2.
Test: make libandroidfw_tests libaapt2_tests
Change-Id: I68d7f0fc7c651b048d9d1f5e7971f10ef5349fa1
Use Google3 naming style to match new
projects' and open source google projects' style.
Preferred to do this in a massive CL so as to avoid
style inconsistencies that plague legacy code bases.
This is a relatively NEW code base, may as well keep
it up to date.
Test: name/style refactor - existing tests pass
Change-Id: Ie80ecb78d46ec53efdfca2336bb57d96cbb7fb87
Styled strings use spans to denote which part
is styled (<b>, <i>, etc). Spans are simply a range
of indices into the original string.
In Java, we use String and its internal representation, meaning
we must encode the indices using UTF16 lengths.
When the internal AAPT2 representation of strings switched to UTF8,
the indices also began to index into the UTF8 string.
This change reverts the indices to use UTF16 lengths.
Bug:31170115
Change-Id: I07b8b5b67d2542c7e0a855b601cdbd3ac4ebffb0
For legacy reasons, we kept around the use of UTF-16 internally
in AAPT2. We don't need this and this CL removes all instances of
std::u16string and StringPiece16. The only places still needed
are when interacting with the ResTable APIs that only operate in
UTF16.
Change-Id: I492475b84bb9014fa13bf992cff447ee7a5fe588
Proguard rules would be ignored for components defined
in AndroidManifest.xml for android:name attributes if
they didn't start with '.'.
Change-Id: I029b5a2f224f4daf155b73a2a4dcd940dd43372e
- Add option to rename package in AndroidManifest.xml
- Support default versionName and versionCode
- Accept True and False as valid booleans
Change-Id: I400e350b9dcd0fd1c197d1929144299c7823617d
An early refactor. Some ideas became clearer as
development continued. Now the various phases are much
clearer and more easily reusable.
Also added a ton of tests!
Change-Id: Ic8f0a70c8222370352e63533b329c40457c0903e