diff --git a/core/config.mk b/core/config.mk index 89bcdb26c..b0805fc27 100644 --- a/core/config.mk +++ b/core/config.mk @@ -1226,9 +1226,8 @@ ifndef INTERNAL_PLATFORM_SYSTEM_PRIVATE_DEX_API_FILE INTERNAL_PLATFORM_SYSTEM_PRIVATE_DEX_API_FILE := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/system-private-dex.txt endif -INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-public-list.txt -INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-private-list.txt INTERNAL_PLATFORM_HIDDENAPI_FLAGS := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-flags.csv +INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-stub-flags.txt INTERNAL_PLATFORM_HIDDENAPI_GREYLIST_METADATA := $(TARGET_OUT_COMMON_INTERMEDIATES)/PACKAGING/hiddenapi-greylist.csv # Missing optional uses-libraries so that the platform doesn't create build rules that depend on diff --git a/core/definitions.mk b/core/definitions.mk index 153ff8998..2be9a926f 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2679,8 +2679,8 @@ $(2): $(1) $(HIDDENAPI) $(INTERNAL_PLATFORM_HIDDENAPI_FLAGS) echo "--output-dex=$(dir $(2))/`basename $$$${INPUT_DEX}`"; \ done | xargs $(HIDDENAPI) encode --api-flags=$(INTERNAL_PLATFORM_HIDDENAPI_FLAGS) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): $(1) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_DEX_INPUTS := $$(PRIVATE_DEX_INPUTS) $(1) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): $(1) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_DEX_INPUTS := $$(PRIVATE_DEX_INPUTS) $(1) endef else # UNSAFE_DISABLE_HIDDENAPI_FLAGS define hiddenapi-copy-dex-files @@ -2696,12 +2696,12 @@ endif # UNSAFE_DISABLE_HIDDENAPI_FLAGS define hiddenapi-generate-csv ifneq (,$(wildcard frameworks/base)) # Only generate this target if we're in a tree with frameworks/base present. -$(2): $(1) $(CLASS2GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) - $(CLASS2GREYLIST) --public-api-list $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) $(1) \ +$(2): $(1) $(CLASS2GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS) + $(CLASS2GREYLIST) --stub-api-flags $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS) $(1) \ --write-flags-csv $(2) -$(3): $(1) $(CLASS2GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) - $(CLASS2GREYLIST) --public-api-list $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) $(1) \ +$(3): $(1) $(CLASS2GREYLIST) $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS) + $(CLASS2GREYLIST) --stub-api-flags $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS) $(1) \ --write-metadata-csv $(3) $(INTERNAL_PLATFORM_HIDDENAPI_FLAGS): $(2) diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk index 102fb7570..19cffda9a 100644 --- a/core/dex_preopt.mk +++ b/core/dex_preopt.mk @@ -62,29 +62,22 @@ endif # Singleton rule which applies $(HIDDENAPI) on all boot class path dex files. # Additional inputs are filled with `hiddenapi-copy-dex-files` rules. -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): $(SOONG_HIDDENAPI_DEX_INPUTS) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_DEX_INPUTS := $(SOONG_HIDDENAPI_DEX_INPUTS) - -.KATI_RESTAT: \ - $(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST) \ - $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_HIDDENAPI_STUBS := $(HIDDENAPI_STUBS) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_HIDDENAPI_STUBS_SYSTEM := $(HIDDENAPI_STUBS_SYSTEM) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): PRIVATE_HIDDENAPI_STUBS_TEST := $(HIDDENAPI_STUBS_TEST) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): \ - .KATI_IMPLICIT_OUTPUTS := $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST) -$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST): $(HIDDENAPI) $(HIDDENAPI_STUBS) \ - $(HIDDENAPI_STUBS_SYSTEM) $(HIDDENAPI_STUBS_TEST) +.KATI_RESTAT: $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): $(SOONG_HIDDENAPI_DEX_INPUTS) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_DEX_INPUTS := $(SOONG_HIDDENAPI_DEX_INPUTS) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_HIDDENAPI_STUBS := $(HIDDENAPI_STUBS) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_HIDDENAPI_STUBS_SYSTEM := $(HIDDENAPI_STUBS_SYSTEM) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): PRIVATE_HIDDENAPI_STUBS_TEST := $(HIDDENAPI_STUBS_TEST) +$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS): $(HIDDENAPI) $(HIDDENAPI_STUBS) \ + $(HIDDENAPI_STUBS_SYSTEM) $(HIDDENAPI_STUBS_TEST) for INPUT_DEX in $(PRIVATE_DEX_INPUTS); do \ find `dirname $${INPUT_DEX}` -maxdepth 1 -name "classes*.dex"; \ done | sort | sed 's/^/--boot-dex=/' | xargs $(HIDDENAPI) list \ - --stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS)) \ - --stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_SYSTEM)) \ - --stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_TEST)) \ - --out-public=$(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST).tmp \ - --out-private=$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST).tmp - $(call commit-change-for-toc,$(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST)) - $(call commit-change-for-toc,$(INTERNAL_PLATFORM_HIDDENAPI_PRIVATE_LIST)) + --public-stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS)) \ + --public-stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_SYSTEM)) \ + --public-stub-classpath=$(call normalize-path-list, $(PRIVATE_HIDDENAPI_STUBS_TEST)) \ + --out-api-flags=$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS).tmp + $(call commit-change-for-toc,$(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS)) # Inputs to singleton rules located in frameworks/base # Additional inputs are filled with `hiddenapi-generate-csv` diff --git a/core/soong_config.mk b/core/soong_config.mk index 1b6b9d3f4..5201a62a2 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -152,7 +152,7 @@ $(call add_json_list, ManifestPackageNameOverrides, $(PRODUCT_MANIFEST_PACK $(call add_json_bool, EnforceSystemCertificate, $(ENFORCE_SYSTEM_CERTIFICATE)) $(call add_json_list, EnforceSystemCertificateWhitelist, $(ENFORCE_SYSTEM_CERTIFICATE_WHITELIST)) -$(call add_json_str, HiddenAPIPublicList, $(INTERNAL_PLATFORM_HIDDENAPI_PUBLIC_LIST)) +$(call add_json_str, HiddenAPIStubFlags, $(INTERNAL_PLATFORM_HIDDENAPI_STUB_FLAGS)) $(call add_json_str, HiddenAPIFlags, $(INTERNAL_PLATFORM_HIDDENAPI_FLAGS)) $(call add_json_list, HiddenAPIExtraAppUsageJars, $(HIDDENAPI_EXTRA_APP_USAGE_JARS))