From 6f6a126b9c64e49abcabcb6ea7b563535d22b04e Mon Sep 17 00:00:00 2001 From: David Brazdil Date: Thu, 31 May 2018 13:58:41 +0100 Subject: Build dark greylist from public + light grey API The dark greylist is meant to contain non-SDK APIs which are "related" to APIs accessible to apps without restrictions. The list used to be built as all non-SDK APIs in the same package as those on the light greylist. That is not sufficient and should include the public SDK API packages too. This patch modifies the makefile to generate a list of public API DEX signatures with Doclava and then use that as a basis for the dark greylist generation. Bug: 80461842 Bug: 64382372 Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt Change-Id: I4b1588013f26661207126b4006cdef0a0fc8ae2c --- Android.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Android.mk') diff --git a/Android.mk b/Android.mk index a6566ebc79d6..eddcadae456b 100644 --- a/Android.mk +++ b/Android.mk @@ -594,6 +594,7 @@ LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST) LOCAL_SRC_GREYLIST := frameworks/base/config/hiddenapi-light-greylist.txt LOCAL_SRC_VENDOR_LIST := frameworks/base/config/hiddenapi-vendor-list.txt LOCAL_SRC_FORCE_BLACKLIST := frameworks/base/config/hiddenapi-force-blacklist.txt +LOCAL_SRC_PUBLIC_API := $(INTERNAL_PLATFORM_DEX_API_FILE) LOCAL_SRC_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE) LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE) @@ -601,6 +602,7 @@ LOCAL_SRC_ALL := \ $(LOCAL_SRC_GREYLIST) \ $(LOCAL_SRC_VENDOR_LIST) \ $(LOCAL_SRC_FORCE_BLACKLIST) \ + $(LOCAL_SRC_PUBLIC_API) \ $(LOCAL_SRC_PRIVATE_API) \ $(LOCAL_SRC_REMOVED_API) @@ -673,7 +675,8 @@ $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL) # (4) subtract entries shared with LOCAL_LIGHT_GREYLIST $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \ - <(sed 's/\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/\(.*\/\).*/\1/' | sort | uniq | \ + <(cat $(LOCAL_SRC_PUBLIC_API) $(LOCAL_LIGHT_GREYLIST) | \ + sed 's/\->.*//' | sed 's/\(.*\/\).*/\1/' | sort | uniq | \ while read PKG_NAME; do \ grep -E "^$${PKG_NAME}[^/;]*;" $(LOCAL_SRC_PRIVATE_API); \ done | sort | uniq) \ -- cgit v1.2.3