diff options
| author | 2018-01-22 22:23:13 +0000 | |
|---|---|---|
| committer | 2018-01-24 20:48:37 +0000 | |
| commit | 0649c8d5b3d73d8f4f3c5283707518bf60cc86da (patch) | |
| tree | b856c16ef0eb4dba8fdcd14578f6b7b0b6269ed3 | |
| parent | 2a8c24be18dfc3d7cb3f405bee898613b23a212e (diff) | |
Create hidden API lists
Android is beginning to put restrictions on the usage of private APIs.
In order to facilitate a transitionary period, some APIs will remain
accessible but issue a warning (greylist), other will see restrictions
right away (blacklist).
This patch create two new text files which will be used to store manual
lists of dex signatures of hidden APIs. These are the blacklist and
dark greylist. They should be mutually exclusive and both be subsets of
INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE. The last list, light greylist,
is generated as INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE minus the two
manual lists.
Bug: 64382372
Test: m
Change-Id: Ia694ef79bece819c87db853ccaea5e95f38d3e84
| -rw-r--r-- | Android.mk | 22 | ||||
| -rw-r--r-- | config/hiddenapi-blacklist.txt | 0 | ||||
| -rw-r--r-- | config/hiddenapi-dark-greylist.txt | 0 |
3 files changed, 22 insertions, 0 deletions
diff --git a/Android.mk b/Android.mk index 5dfa81c581a2..0e7c087c939c 100644 --- a/Android.mk +++ b/Android.mk @@ -697,6 +697,28 @@ LOCAL_SRC_FILES := \ include $(BUILD_HOST_JAVA_LIBRARY) +# ==== hiddenapi lists ======================================= + +# Generate light greylist as private API minus (blacklist plus dark greylist). + +$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) +$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) +$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): DARK_GREYLIST := $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) +$(INTERNAL_PLATFORM_HIDDENAPI_LIGHT_GREYLIST): $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) \ + $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) \ + $(INTERNAL_PLATFORM_HIDDENAPI_DARK_GREYLIST) + if [ ! -z "`comm -12 <(sort $(BLACKLIST)) <(sort $(DARK_GREYLIST))`" ]; then \ + echo "There should be no overlap between $(BLACKLIST) and $(DARK_GREYLIST)" 1>&2; \ + exit 1; \ + elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST))`" ]; then \ + echo "$(BLACKLIST) must be a subset of $(PRIVATE_API)" 1>&2; \ + exit 2; \ + elif [ ! -z "`comm -13 <(sort $(PRIVATE_API)) <(sort $(DARK_GREYLIST))`" ]; then \ + echo "$(DARK_GREYLIST) must be a subset of $(PRIVATE_API)" 1>&2; \ + exit 3; \ + fi + comm -23 <(sort $(PRIVATE_API)) <(sort $(BLACKLIST) $(DARK_GREYLIST)) > $@ + # Include subdirectory makefiles # ============================================================ diff --git a/config/hiddenapi-blacklist.txt b/config/hiddenapi-blacklist.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/config/hiddenapi-blacklist.txt diff --git a/config/hiddenapi-dark-greylist.txt b/config/hiddenapi-dark-greylist.txt new file mode 100644 index 000000000000..e69de29bb2d1 --- /dev/null +++ b/config/hiddenapi-dark-greylist.txt |