Adds flag --version-code-major that injects android:versionCodeMajor
into the manifest if none is present or when overriding.
Bug: 109883459
Test: aapt2_tests
Change-Id: I10b27abb8fa8a99a41976c42c4d684b99978b4f9
Inserts platformBuildVersionName and platformBuildVersionName when the
attributes are not currrently present. The attributes are set to
the values of versionName and versionCode.
Bug: 77541121
Test: Build apk using aapt and appt2 and dumped using xmltree to confirm
the presence of the attributes
Change-Id: I5330381905c878fb877214b42f83d7e2e48cd062
Bug: 74968793
Test: Tested for correct debuggable attribute presense with and without
flag
Change-Id: I0148d1caba62db8cf258926f1d9e87a849aa283f
(cherry picked from commit 444f9bb6a18ff34b69cba504c8658b7013eaa53a)
- Also fixes issue where a failure checking the Java package of an attribute
would yield no error message.
Bug: 70722199
Test: make aapt2_tests
Change-Id: I417d5ffe18c8d4ba2f1638f9fb9ba29278ec8e94
This change injects the 'android:compileSdkVersion' and
'android:compileSdkVersionCodename' into an app's AndroidManifest.xml,
whose values are dervied from the version name and version code of the
framework AndroidManifest.xml that is being linked against.
Bug: 63388434
Test: make aapt2_tests
Change-Id: I7b607192ecb337307c4bcb5770e7f716c6d4c9d2
ManifestFixer would go and fully qualify all elements with the attribute
'android:name', which is not correct, especially for cases like
<uses-split android:name="foo" />
Test: make aapt2_tests
Change-Id: I4bea2550d0025179d2d48dca8c64e0cbf4451e99
In preparation for exporting an XML proto format for UAM to consume,
this change brings the XML DOM API more in line with other APIs that
do not make the Namespace a separate node.
Treating Namespace declarations as just properties of an Element
node makes the implementation of algorithms much simpler, as
the constraints that Namespace nodes have only one child
are now built in and traversing to find Element nodes
is much simpler.
Also made a bunch of quality of life improvements, like formatting and
comment style.
Test: make aapt2_tests
Change-Id: Ib97ff1c4252b7907e2cc1f13a448dc4ca3b809a4
Some third party stores/tools expect manifest elements
under their namespace, and AAPT2 shouldn't fail if these
are present.
Bug: 37943705
Test: make aapt2_tests
Change-Id: I87b7500c7da5e8e79fc2a78b30e8e4334124af3d
- Add <feature-group> to ManifestFixer.
- Support <meta-data> in <instrumentation>
- Add support for <bag> and type="configVarying". Some CTS tests use this
old notation, we need to support it (even though configVarying isn't
anything supported by the framework convention).
Change-Id: I6946fa633ce513ea8437c1496db883cf27dcf6de
Test: make aapt2_tests
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
PackageParser on the device uses the targetSdkVersion of the
app while it parses <application>. That means that if the
<uses-sdk> tag comes after <application>, the targetSdkVersion
is assumed to be 0.
Test: make libaapt2_tests
Change-Id: I60f2179a7ff44e7419217afb53f3d24f8c030f6e
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
Previously the way to name resources in tests was to use reference
notation (@[package:][type/]name). Now we use name notation (no @).
Change-Id: I68f0a36562d89cc78c582d128f370d9556c58707
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
Defines a set of actions to perform on XML elements defined by their
hierarchy, eg: manifest -> application -> activity.
This can be used to easily add rules to check more tags in AndroidManifest.xml
Change-Id: I76c6916a98b6403075a7e56e16230979dc6cbee1
Android static libraries are like APKs but they contain much more debugging
and source information. We need to treat them differently in 3 ways:
1) When building a static library, we skip things like ID assignment and
product/config stripping. Source information is emitted as well.
2) When building a static library and linking against another
static library, we don't want to merge, we want to simply reference.
3) When building an app that uses static libraries, we want to merge
the static library under the same package with or without mangling.
Bug:25958912
Change-Id: I425e032857936a3e83173c1edc2a6cdc6020b842
- Add option to rename package in AndroidManifest.xml
- Support default versionName and versionCode
- Accept True and False as valid booleans
Change-Id: I400e350b9dcd0fd1c197d1929144299c7823617d