summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2018-05-31 13:58:41 +0100
committerDavid Brazdil <dbrazdil@google.com>2018-06-07 09:45:01 +0000
commit6f6a126b9c64e49abcabcb6ea7b563535d22b04e (patch)
tree0a66c223a4e2e963ecd6f15e10a234f0648d4ec9
parentb62aa315d1d9d27c716964930205ed0681e8997b (diff)
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
-rw-r--r--Android.bp1
-rw-r--r--Android.mk5
2 files changed, 5 insertions, 1 deletions
diff --git a/Android.bp b/Android.bp
index 57d03b6daf98..58cb9afa06bf 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1037,6 +1037,7 @@ droiddoc {
"core/java/overview.html",
":current-support-api",
],
+ dex_api_filename: "public-dex.txt",
private_dex_api_filename: "private-dex.txt",
removed_dex_api_filename: "removed-dex.txt",
args: framework_docs_args +
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) \