Age | Commit message (Collapse) | Author |
|
a13d7fc861 am: 4da226a984
Change-Id: I4443b84896684ac3249108316487035319b4f52e
|
|
We should keep classes that are in the android:name or class xml
attributes.
Test: m -j aapt2_tests
Bug: 142601969
Change-Id: Ia67365bd702bae75d38b9572d68e9930e856e0f8
|
|
|
|
This fixes relocatability issues with the code shrinkers.
Bug: 144529940
Test: None
Change-Id: I65e08e850193e67dcdf4c533d9e66332714f0c8c
|
|
The results of CollectLocations() are only used if the --proguard-conditional-keep-rules option is set, but the function is always called when the --proguard option is set.
Since this function can be slow on particularly large resource sets, avoid calling it unless --proguard-conditional-keep-rules is set.
Change-Id: If259d41cdab16abad8ca62f30d8beb5ebf33575a
Bug: 144236322
Test: aapt2_tests
|
|
Apps commonly use the versions of the attributes from AndroidX, which
will be unqualified.
Bug: 30888677
Change-Id: Id7cb32b28edb1cd1b8113a8c9a7ee29107a1b67e
Tested: aapt2_tests
|
|
Bug: 127262679
Test: atest ProguardRulesTest
Change-Id: Ib082404e08d98b25fcecbf680afb4af37fe2786b
|
|
We previously changed AAPT2 to correctly only generate keep rules for
the constructors required to inflate the different views. This cause
projects that did not have keep rules for the other constructors that
were accessed through reflection to have runtime crashes. This change
adds a flag to the link stage (--proguard-minimal-keep-rules) that
allows AAPT2 to only keep the constructors required for layout
inflation. If the flag is not present, then AAPT2 will generate less
specific keep rules than keep all constructors.
Bug: 116201243
Test: aapt2_tests
Change-Id: I8bb5cdf8446518ab153ea988e1243ca9494258c7
|
|
This expands the Context+AttributeSet constructor specificity from only work on <view class=> nodes to <my.Type> nodes.
Bug: 37123156
Test: make aapt2_tests
Change-Id: I8fb950731383f86bee225333bda27baf5a7a34c5
|
|
- For transition and pathMotion attributes the method must have Context and AttributeSet parameters.
- For actionViewClass and actionProviderClass attributes the constructor must have a single Context parameter.
- For Fragment's class or name attributes the constructor must have zero parameters.
Bug: 37123156
Test: make aapt2_tests
Change-Id: I34017abd182867ba95172835051d114cb2f3b3ac
|
|
This attribute was added in API 28 and is reflectively instantiated from a zero-argument constructor.
Test: make aapt2_tests
Change-Id: Ie9de0764165c6fe6c6fcda6cc38b0cc633f03bbd
|
|
For View's onClick attribute the method must have a single argument of type android.view.View. For a MenuItem's onClick attribute the method must have a single argument of type android.view.MenuItem. Since these rules match all types and any return type, matching by signature is the only available specificity that can be added.
Bug: 37123156
Test: make aapt2_tests
Change-Id: I4b82f5ef9e62a8ecffaab424e269df627825709e
|
|
Reflection-based instantiation of manifest-declared types is only done on the default (aka no-argument) constructor. While these types are unlikely to have alternate constructors (unlike the others listed in the bug), there's no reason to generate overly keep-y rules for them.
Bug: 37123156
Test: make aapt2_tests
Change-Id: Ic83a2671a54ea5dd558bfcacf033a60e9568ab8c
|
|
Adds generation of proguard rules for fragments in res/navigation. All
android:name attributes have keep rules generated for the classes they
reference.
Bug: 69929974
Test: aapt2_tests
Change-Id: I05a87484ab357ea5629b73caad8488182f474e1f
|
|
New conditional syntax is a logical AND, not OR. This means if a
resource should be conditionally kept by multiple ids, we need to
generate a separate rule for each condition (which will be interpreted
as OR).
Test: unit tests
Bug: 69341430
Change-Id: I0786c65561d36fbf43d181a2dfd0c7eaf1d96b8c
|
|
FileOutputStream is safe to use on Windows, as it opens
files using our compatibility API.
Bug: 68262818
Test: make aapt2_tests
Change-Id: Ib0b27e93edd609b49b1327db7d9867a002198ebb
|
|
Google's ProGuard fork is migrating to a new syntax that upstream
ProGuard 6.0 will also support.
Test: unit tests
Bug: 69162105
Change-Id: I3b6d7e82eb99c2e2af6c4d851a4f97ec3e471b55
|
|
Add the option to produce keep rules that conditional keep based on
usage of R identifiers. This allows Proguard to potentially shrink more
code if resources are not used.
Currently only produces conditional rules for classes referenced in
layout resources because they are the most common and has the easiest
transitive usage chain to analyze.
Bug: 63628451
Test: make aapt2_tests and manual testing
Change-Id: I6c1af7affd64af40c80e004d8506a9463444b2c3
|
|
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
|
|
<fragment> tags in layouts use the class attribute to determine which
Fragment subclass to load, and fallback on android:name if class is not
set.
AAPT2 only emitted a proguard rule for the class attribute for <fragment>,
when it should emit a proguard rule for the android:name attribute as
well.
AAPT2 didn't handle menu XML, so support for actionViewClass,
actionProviderClass and onClick is added.
Bug: 62216174
Test: make aapt2_tests
Change-Id: Ie8675c2bd899a5b51f3661eb0901ab8c9a16fd70
|
|
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
|
|
Aapt with -D option was not keeping the application and instrumentation
subclasses, which were instead handled by mainDexClasses.rules. Instead,
include them in the aapt -D output.
Change-Id: Ia3b89fc2edd45d379c4d06f0bf674716646fcb3d
|
|
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
|
|
Create an analogue of "aapt2 --proguard" which outputs a proguard
configuration that keeps only components which need to be in the main
dex.
Bug: 27383099
Change-Id: I61d652bfcdfc18e1614e852bd6f7540efd15f780
|
|
Change-Id: Id4697551b6c8cb6167f562de593006ae3c6158c0
|
|
Also moved some XML specific stuff into its own directory,
and refactored ReferenceLinker a bit.
Change-Id: I912247a82023c1bbf72dc191fbdaf62858cbec0c
|
|
Change-Id: I7f6d8b74d1c590adc356b4da55cb6cb777cdf1da
|
|
This includes comments from AndroidManifest.xml.
Change-Id: I412d9ecb12bad20a49a683d6b3bea4a0be1235ae
|