aboutsummaryrefslogtreecommitdiffstats
path: root/java/hiddenapi.go
Commit message (Collapse)AuthorAgeFilesLines
* soong: Give priority to modules in exported namespaces for bootjarsSam Mortimer2019-12-111-1/+8
| | | | | | | | | | | | | | | * Looking for modules that provide a boot jar is currently done by module name match only. This breaks when you have multiple copies of the same module in your build tree (eg in another device). * Add a new mutator that marks the modules that should be used for bootjar content. * The logic is simple: give priority to modules that are in exported soong namespace. Change-Id: I2476174b892475c14a9f10b5e66b8496186f81c0
* Improve hiddenapi processing so it does not require white listPaul Duffin2019-02-281-9/+29
| | | | | | | | | | | | Rather than have a special white list to contain the names of modules that provide additional hiddenapi for modules on the bootclasspath this defines a convention that such modules must have a name which is of the format <x>-hiddenapi, where <x> is the name of the module on the bootclasspath. Bug: 73711752 Test: make droid && flashall -w && atest -p cts/tests/signature Change-Id: Ib2d69dea9541b60a9bb81496f00edb65036d1ebb
* Revert "Support libraries (not just boot jars) that have hiddenapi"Paul Duffin2019-02-271-12/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e5b5657f875be27cc8f8fcf3a1e6fa814d794c95. The reverted change was added in order to gather the information about the hiddenapi that is needed for the runtime to enforce the hiddenapi accessibility rules. Without it the build broke with the following error when the android.test.base library was not in the PRODUCT_BOOT_JARS list: AssertionError: Error processing: frameworks/base/config/hiddenapi-greylist.txt The following entries were unexpected: Ljunit/framework/TestSuite;->isPublicTestMethod(Ljava/lang/reflect/Method;)Z Landroid/test/AndroidTestCase;->setTestContext(Landroid/content/Context;)V Landroid/test/InstrumentationTestCase;->runMethod(Ljava/lang/reflect/Method;I)V Landroid/test/AndroidTestCase;->getTestContext()Landroid/content/Context; Ljunit/framework/TestCase;->fName:Ljava/lang/String; Ljunit/framework/TestSuite;->isTestMethod(Ljava/lang/reflect/Method;)Z Please visit go/hiddenapi for more information. However, it turns out that the runtime does not currently enforce access to the hiddenapi of libraries that are not on the PRODUCT_BOOT_JARS list. Gathering hiddenapi information for a library not on the PRODUCT_BOOT_JARS list breaks the CtsHiddenApiBlacklistApi27TestCases and CtsHiddenApiBlacklistApi28TestCases test modules which use that information to ensure that correct runtime behavior. This change is being reverted simply because it does not work. Bug: 126519737 Bug: 73711752 Test: make REMOVE_ATB_FROM_BCP=true droid and make droid Change-Id: I1b4a7786b1061effa0e2d37832afa8570953a06e
* Make RuleBuilder methods take PathsColin Cross2019-02-201-13/+0
| | | | | | | | | | | | | | There are no more Make paths being used in Soong now that dexpreopting and hiddenapi are in Soong. Use the Path types in the inputs to RuleBuilder, and fix all users of RuleBuilder. This reapplies I886f803d9a3419a43b2cae412537645f94c5dfbf with fixes to disable preopt for Soong-only builds when the global dexpreopt.config doesn't exist. Test: all soong tests Test: m checkbuild Change-Id: I4dae9ecd5de22f062f9478ec8f0747f099cf8190
* Revert "Make RuleBuilder methods take Paths"Colin Cross2019-02-211-0/+13
| | | | | | | | This reverts commit acdd6940719125104dfd2f692990c99682f95f05. Reason for revert: broke ndk build Change-Id: I5655e48c15eb8f5f0267afdd853fbc25765b8623
* Make RuleBuilder methods take PathsColin Cross2019-02-201-13/+0
| | | | | | | | | | There are no more Make paths being used in Soong now that dexpreopting and hiddenapi are in Soong. Use the Path types in the inputs to RuleBuilder, and fix all users of RuleBuilder. Test: all soong tests Test: m checkbuild Change-Id: I886f803d9a3419a43b2cae412537645f94c5dfbf
* Support libraries (not just boot jars) that have hiddenapiPaul Duffin2019-02-151-2/+12
| | | | | | | | | | | | | | | | | | | The build assumes (apart from one minor exception) that only modules that are in the PRODUCT_BOOT_JARS list require processing as part of the hiddenapi. Unfortunately, that is not true for android.test.base, at least not when REMOVE_ATB_FROM_BCP=true. This change adds a white list (containing android.test.base) of additional modules that should be processed as part of the hiddenapi and updates the hiddenapi.go file to use it. It does not matter that android.test.base is a boot jar and in the white list, the behavior is the same as it would be if it was only in one. Bug: 73711752 Test: make REMOVE_ATB_FROM_BCP=true droid and make droid Change-Id: I1c64272f444e6866136c65fb7c48910d55811844
* Move hiddenapi singleton rules to SoongColin Cross2019-02-061-63/+59
| | | | | | | | | | Move the rules that build hiddenapi-stubs-flags.txt, hiddenapi-flags.csv and hiddenapi-greylist.csv into Soong. Bug: 123645297 Test: m checkbuild Test: m UNSAFE_DISABLE_HIDDEN_API_FLAGS=true Change-Id: I90bf58710f6153ee8565994f799d3ec5699bc7fa
* Prepare for a type-safe OnceKeyColin Cross2019-02-061-1/+1
| | | | | | | | | Add an opaque OnceKey type and use it for all calls to Once in build/soong. A future patch will convert the arguments to Once* to OnceKey once users outside build/soong have been updated. Test: onceper_test.go Change-Id: Ifcb338e6e603e804e507203c9508d30ffb2df966
* Move dexpreopt.Script to android.RuleBuilderColin Cross2019-02-051-2/+14
| | | | | | | | Move dexpreopt.Script to android.RuleBuilder so that the builder style can be used in more places. Also add tests for it. Test: rule_builder_test.go Change-Id: I92a963bd112bf033b08899e930094b908acfcdfd
* Disable all-assigned check in hiddenapi on master-artDavid Brazdil2019-01-231-7/+14
| | | | | | | | | | | | Master-art configurations do not have frameworks/base and therefore do not have hidden API flags. Pass --no-force-assign-all to `hiddenapi` when frameworks/base does not exist to disable the corresponding assertion. This enables us to enforce the assertion on non-master-art builds and also get rid of logspam about missing flags on ART buildbots. Test: art/tools/buildbot-build.sh on master-art Bug: 123143676 Change-Id: I074d9554fb11dab3eef904016375730520107ec2
* Always do zipalign with uncompressDex.Nicolas Geoffray2019-01-231-2/+10
| | | | | | | Also preserve the alignment with hiddenapi. Test: conscrypt apex has its conscrypt.jar zipaligned. Change-Id: I43cc0eadb9548c3d8055e12c077fb7bbe1935fe6
* Replace hiddenapi-{public,private}-list.txt with a CSV fileDavid Brazdil2019-01-211-9/+9
| | | | | | | | | | | `hiddenapi` is being refactored to work with a single CSV file as opposued to a multitude of text files (one per flag). This patch changes the singleton rule for listing public/private APIs from stubs to expect a CSV as an output. Bug: 119068555 Test: compiles, hiddenapi-flags.csv unchanged Change-Id: I622521d59979a6b01ecc8065a278412fedf7b9bc
* Maintain uncompressed dex through hiddenapi encodeColin Cross2019-01-191-5/+15
| | | | | | | | | | | hiddenapi encode unzips and rezips the dex jar. Pass uncompressDex into it so that it doesn't make classes.dex compressed in the dex jar when it was previously uncompressed. Bug: 123100239 Test: m checkbuild Test: zipinfo $OUT/system/framework/conscrypt.jar shows uncompressed classes.dex Change-Id: If36cde330eb0bcb1e1db3c582452c5faebc8ff29
* Restore UNSAFE_DISABLE_HIDDENAPI_FLAGS functionality.David Brazdil2019-01-181-5/+0
| | | | | | | It got broken with the move to hiddenapi to Soong. Test: UNSAFE_DISABLE_HIDDENAPI_FLAGS=true m -j32 Change-Id: Id369bfae8e118907b1f12faa7e4207494904edda
* Move hiddenapi to SoongColin Cross2019-01-171-0/+150
Perform hiddenapi CSV generation and dex encoding for Soong modules in Soong. This fixes an issue where dexpreopting was happening on a different jar than was being installed. Bug: 122856783 Test: m checkbuild Test: no change out/target/common/obj/PACKAGING/hiddenapi-flags.csv Test: only ordering change to out/target/common/obj/PACKAGING/hiddenapi-greylist.csv Test: cts/tests/signature/runSignatureTests.sh Change-Id: I4fc481efc29e73cb2bdaacf672e86d5f6f0075ae