summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2018-05-08 16:49:02 +0100
committerDavid Brazdil <dbrazdil@google.com>2018-05-08 17:12:38 +0100
commit4b34f79a35a6602962ed1df1accd9d6ea6e41e77 (patch)
tree5f4d8330a2141d2e367ea75ad403465b5553708e
parent185f00e6677cea3fb135648f4a19d22dec54bbb5 (diff)
Manualy blacklist certain hidden APIs
Previous CL introduced the concept of populating the dark greylist with remaining members of classes on the light greylist. This breaks the assumption that some methods/fields will always remain blacklisted. Introduce a new file which forces their blacklisting and adjust the build rules accordingly. Bug: 64382372 Test: make out/target/common/obj/PACKAGING/hiddenapi-blacklist.txt Change-Id: I8b20e03c50f4027a24d2a6081bedb08bc8a34011
-rw-r--r--Android.mk7
-rw-r--r--config/hiddenapi-force-blacklist.txt1
2 files changed, 7 insertions, 1 deletions
diff --git a/Android.mk b/Android.mk
index 218c5944f31d..ccf3894a3d02 100644
--- a/Android.mk
+++ b/Android.mk
@@ -877,12 +877,14 @@ LOCAL_BLACKLIST := $(INTERNAL_PLATFORM_HIDDENAPI_BLACKLIST)
# File names of source files we will use to generate the final API lists.
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_PRIVATE_API := $(INTERNAL_PLATFORM_PRIVATE_DEX_API_FILE)
LOCAL_SRC_REMOVED_API := $(INTERNAL_PLATFORM_REMOVED_DEX_API_FILE)
LOCAL_SRC_ALL := \
$(LOCAL_SRC_GREYLIST) \
$(LOCAL_SRC_VENDOR_LIST) \
+ $(LOCAL_SRC_FORCE_BLACKLIST) \
$(LOCAL_SRC_PRIVATE_API) \
$(LOCAL_SRC_REMOVED_API)
@@ -941,6 +943,7 @@ $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
> $@
$(call assert-has-no-duplicates,$@)
$(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
+ $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
# Generate dark greylist as remaining members of classes on the light greylist,
# as well as the members of their inner classes.
@@ -953,7 +956,7 @@ $(LOCAL_LIGHT_GREYLIST): $(LOCAL_SRC_ALL)
# '^Lpackage/class[;$]'
# (4) subtract entries shared with LOCAL_LIGHT_GREYLIST
$(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
- comm -13 $(LOCAL_LIGHT_GREYLIST) \
+ comm -13 <(sort $(LOCAL_LIGHT_GREYLIST) $(LOCAL_SRC_FORCE_BLACKLIST)) \
<(sed 's/;\->.*//' $(LOCAL_LIGHT_GREYLIST) | sed 's/$$.*//' | sort | uniq | \
while read CLASS_DESC; do \
grep -E "^$${CLASS_DESC}[;$$]" $(LOCAL_SRC_PRIVATE_API); \
@@ -962,6 +965,7 @@ $(LOCAL_DARK_GREYLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST)
$(call assert-is-subset,$@,$(LOCAL_SRC_PRIVATE_API))
$(call assert-has-no-duplicates,$@)
$(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
+ $(call assert-has-no-overlap,$@,$(LOCAL_SRC_FORCE_BLACKLIST))
# Generate blacklist as private API minus (light greylist plus dark greylist).
$(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLIST)
@@ -972,6 +976,7 @@ $(LOCAL_BLACKLIST): $(LOCAL_SRC_ALL) $(LOCAL_LIGHT_GREYLIST) $(LOCAL_DARK_GREYLI
$(call assert-has-no-duplicates,$@)
$(call assert-has-no-overlap,$@,$(LOCAL_LIGHT_GREYLIST))
$(call assert-has-no-overlap,$@,$(LOCAL_DARK_GREYLIST))
+ $(call assert-is-subset,$(LOCAL_SRC_FORCE_BLACKLIST),$@)
# Include subdirectory makefiles
# ============================================================
diff --git a/config/hiddenapi-force-blacklist.txt b/config/hiddenapi-force-blacklist.txt
new file mode 100644
index 000000000000..2a10f77b862f
--- /dev/null
+++ b/config/hiddenapi-force-blacklist.txt
@@ -0,0 +1 @@
+Ldalvik/system/VMRuntime;->setHiddenApiExemptions([Ljava/lang/String;)V