diff options
author | David Brazdil <dbrazdil@google.com> | 2018-04-25 11:15:07 +0100 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2018-05-02 14:29:20 +0000 |
commit | 0585533a85c2d366650f7be3fac10f1473806956 (patch) | |
tree | 50cb1862d7f2068e61b63c9b1492d76b038c0be7 /Android.mk | |
parent | 839cec4478c8354eb0cd87bd95547079e5a091a7 (diff) |
Merge non-SDK @removed API and light greylist
@removed APIs are not part of the public SDK but we do not want
to block access to them. Use the recently added removed-dex.txt
list of @removed API signatures and merge it into the hidden API
light greylist programmatically.
Note that due to Doclava's rule precedence, @removed APIs which
override a public SDK method are considered public and are
whitelisted. We have to intersect removed-dex.txt with private-dex.txt
to satisfy the rule that light greylist is a subset of private-dex.txt.
Bug: 78182899
Test: make out/target/common/obj/PACKAGING/removed-dex.txt
Change-Id: I44e54c405fc667d54a990b9ded1de8456802545e
Diffstat (limited to 'Android.mk')
-rw-r--r-- | Android.mk | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/Android.mk b/Android.mk index 6a827b07d013..bb37fa21c463 100644 --- a/Android.mk +++ b/Android.mk @@ -873,9 +873,16 @@ include $(BUILD_STATIC_JAVA_LIBRARY) # rules for building them. Other rules in the build system should depend on the # files in the build folder. -# Automatically add all methods which match the following signatures. -# These need to be greylisted in order to allow applications to write their -# own serializers. +# Merge light greylist from multiple files: +# (1) manual light greylist +# (2) list of usages from vendor apps +# (3) list of removed APIs +# @removed does not imply private in Doclava. We must take the subset also +# in PRIVATE_API. +# (4) list of serialization APIs +# Automatically adds all methods which match the signatures in +# REGEX_SERIALIZATION. These are greylisted in order to allow applications +# to write their own serializers. $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "readObject\(Ljava/io/ObjectInputStream;\)V" \ "readObjectNoData\(\)V" \ @@ -885,14 +892,15 @@ $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REGEX_SERIALIZATION := \ "writeObject\(Ljava/io/ObjectOutputStream;\)V" \ "writeReplace\(\)Ljava/lang/Object;" $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) -# Temporarily merge light greylist from two files. Vendor list will become dark -# grey once we remove the UI toast. +$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) $(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ - $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) + $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ + $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) sort frameworks/base/config/hiddenapi-light-greylist.txt \ frameworks/base/config/hiddenapi-vendor-list.txt \ <(grep -E "\->("$(subst $(space),"|",$(REGEX_SERIALIZATION))")$$" $(PRIVATE_API)) \ + <(comm -12 <(sort $(REMOVED_API)) <(sort $(PRIVATE_API))) \ > $@ $(eval $(call copy-one-file,frameworks/base/config/hiddenapi-dark-greylist.txt,\ |