3 Commits

Author SHA1 Message Date
Adam Lesinski
490595a5fc AAPT2: Workaround for feature splits without namespacing
Android Instant Apps in its current iteration does not use namespaces,
but due to limitations on the Android resource runtime, needs to make
it look like it does.

This is due to a bug that treats any package ID that's not 0x01 or 0x7F
as a shared library. Shared libraries require unique package names.

As a workaround, and since Android Instant Apps can not have a feature
depend on another feature, we can alter the resource package name of a
feature split just before writing it out to disk. This avoids using a
unique package name while linking, thereby avoiding namespace issues.

Bug: 68820737
Test: manual
Change-Id: Ic553ed42656436bbb949393d0248ee7bb9d37860
2017-11-09 14:57:49 -08:00
Adam Lesinski
96cc9ae90e Update FeatureSplit sample
This updates the FeatureSplit test sample to reflect the current
way of doing correct feature splits.

This is not final, as aapt2 will be gaining some improvements to
make access of private resources across feature splits valid by default.

Bug: 65096694
Test: manual
Change-Id: I4524dc161d46c5479b5abe340eb93844078ed316
2017-10-13 12:26:53 -07:00
Adam Lesinski
833f3ccbc8 AAPT support for feature splits
This change allows the developer to add a base package for
which to build a feature split. The generated resource types
will begin after the base APK's defined types so as not
to collide or override resources.

Multiple features can be generated by first choosing an
arbitrary order for the features. Then for each feature,
the base APK and any preceding features are specified
with the --feature-of flags.

So with a base APK 'A' and features, 'B', and 'C',
'B' would be built with

aapt package [...] --feature-of A [...]

and 'C' would be built with

aapt package [...] --feature-of A --feature-of B [...]

Change-Id: I1be66e3f8df9a737b21c71f8a93685376c7e6780
2014-08-04 18:48:14 -07:00