Loading core/app_prebuilt_internal.mk +26 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,32 @@ my_preopt_for_extracted_apk := true endif endif # Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES # If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or # LOCAL_OPTIONAL_USES_LIBRARIES are specified. # Will change the default to true unconditionally in the future. ifndef LOCAL_ENFORCE_USES_LIBRARIES ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES))) LOCAL_ENFORCE_USES_LIBRARIES := true endif endif my_enforced_uses_libraries := ifdef LOCAL_ENFORCE_USES_LIBRARIES my_enforced_uses_libraries := $(intermediates.COMMON)/enforce_uses_libraries.timestamp $(my_enforced_uses_libraries): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES) $(my_enforced_uses_libraries): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES) $(my_enforced_uses_libraries): $(BUILD_SYSTEM)/verify_uses_libraries.sh $(AAPT) $(my_enforced_uses_libraries): $(my_prebuilt_src_file) @echo Verifying uses-libraries: $< aapt_binary=$(AAPT) \ uses_library_names="$(strip $(PRIVATE_USES_LIBRARIES))" \ optional_uses_library_names="$(strip $(PRIVATE_OPTIONAL_USES_LIBRARIES))" \ $(BUILD_SYSTEM)/verify_uses_libraries.sh $< touch $@ $(built_module) : $(my_enforced_uses_libraries) endif dex_preopt_profile_src_file := $(my_prebuilt_src_file) rs_compatibility_jni_libs := Loading core/construct_context.sh +5 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ set -e # class_loader_context_arg: final class loader conext arg # stored_class_loader_context_arg: final stored class loader context arg if [ -z "${target_sdk_version}" ]; then echo "ERROR: target_sdk_version not set" exit 2 fi # The hidl.manager shared library has a dependency on hidl.base. We'll manually # add that information to the class loader context if we see those libraries. hidl_manager="android.hidl.manager-V1.0-java" Loading core/dex_preopt_config.mk +1 −3 Original line number Diff line number Diff line Loading @@ -116,7 +116,6 @@ ifeq ($(WRITE_SOONG_VARIABLES),true) $(call add_json_bool, NeverSystemServerDebugInfo, $(filter false,$(PRODUCT_SYSTEM_SERVER_DEBUG_INFO))) $(call add_json_bool, AlwaysOtherDebugInfo, $(filter true,$(PRODUCT_OTHER_JAVA_DEBUG_INFO))) $(call add_json_bool, NeverOtherDebugInfo, $(filter false,$(PRODUCT_OTHER_JAVA_DEBUG_INFO))) $(call add_json_list, MissingUsesLibraries, $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES)) $(call add_json_bool, IsEng, $(filter eng,$(TARGET_BUILD_VARIANT))) $(call add_json_bool, SanitizeLite, $(SANITIZE_LITE)) $(call add_json_bool, DefaultAppImages, $(WITH_DEX_PREOPT_APP_IMAGE)) Loading Loading @@ -152,7 +151,7 @@ ifeq ($(WRITE_SOONG_VARIABLES),true) $(call add_json_str, Aapt, $(SOONG_HOST_OUT_EXECUTABLES)/aapt) $(call add_json_str, SoongZip, $(SOONG_ZIP)) $(call add_json_str, Zip2zip, $(ZIP2ZIP)) $(call add_json_str, VerifyUsesLibraries, $(BUILD_SYSTEM)/verify_uses_libraries.sh) $(call add_json_str, ManifestCheck, $(SOONG_HOST_OUT_EXECUTABLES)/manifest_check) $(call add_json_str, ConstructContext, $(BUILD_SYSTEM)/construct_context.sh) $(call end_json_map) Loading @@ -175,7 +174,6 @@ DEXPREOPT_GEN_DEPS := \ $(SOONG_HOST_OUT_EXECUTABLES)/aapt \ $(SOONG_ZIP) \ $(ZIP2ZIP) \ $(BUILD_SYSTEM)/verify_uses_libraries.sh \ $(BUILD_SYSTEM)/construct_context.sh \ DEXPREOPT_STRIP_DEPS := \ Loading core/dex_preopt_odex_install.mk +2 −13 Original line number Diff line number Diff line Loading @@ -103,18 +103,6 @@ ifeq (true,$(my_process_profile)) endif endif # If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or # LOCAL_OPTIONAL_USES_LIBRARIES are specified. ifeq (,$(LOCAL_ENFORCE_USES_LIBRARIES)) # Will change the default to true unconditionally in the future. ifneq (,$(LOCAL_OPTIONAL_USES_LIBRARIES)) LOCAL_ENFORCE_USES_LIBRARIES := true endif ifneq (,$(LOCAL_USES_LIBRARIES)) LOCAL_ENFORCE_USES_LIBRARIES := true endif endif my_dexpreopt_archs := my_dexpreopt_images := my_dexpreopt_infix := boot Loading Loading @@ -218,6 +206,7 @@ ifdef LOCAL_DEX_PREOPT $(call add_json_str, Name, $(LOCAL_MODULE)) $(call add_json_str, DexLocation, $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))) $(call add_json_str, BuildPath, $(LOCAL_BUILT_MODULE)) $(call add_json_str, ManifestPath, $(full_android_manifest)) $(call add_json_str, ExtrasOutputPath, $$2) $(call add_json_bool, Privileged, $(filter true,$(LOCAL_PRIVILEGED_MODULE))) $(call add_json_bool, UncompressedDex, $(filter true,$(LOCAL_UNCOMPRESS_DEX))) Loading @@ -226,7 +215,7 @@ ifdef LOCAL_DEX_PREOPT $(call add_json_str, ProfileClassListing, $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE))) $(call add_json_bool, ProfileIsTextListing, $(my_profile_is_text_listing)) $(call add_json_bool, EnforceUsesLibraries, $(LOCAL_ENFORCE_USES_LIBRARIES)) $(call add_json_list, OptionalUsesLibraries, $(LOCAL_OPTIONAL_USES_LIBRARIES)) $(call add_json_list, OptionalUsesLibraries, $(my_filtered_optional_uses_libraries)) $(call add_json_list, UsesLibraries, $(LOCAL_USES_LIBRARIES)) $(call add_json_map, LibraryPaths) $(foreach lib,$(my_dexpreopt_libs),\ Loading core/package_internal.mk +25 −0 Original line number Diff line number Diff line Loading @@ -483,6 +483,31 @@ PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate) $(LOCAL_BUILT_MODULE): $(additional_certificates) $(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(additional_certificates) # Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES # If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or # LOCAL_OPTIONAL_USES_LIBRARIES are specified. # Will change the default to true unconditionally in the future. ifndef LOCAL_ENFORCE_USES_LIBRARIES ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES))) LOCAL_ENFORCE_USES_LIBRARIES := true endif endif my_enforced_uses_libraries := ifdef LOCAL_ENFORCE_USES_LIBRARIES my_manifest_check := $(intermediates.COMMON)/manifest/AndroidManifest.xml.check $(my_manifest_check): $(MANIFEST_CHECK) $(my_manifest_check): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES) $(my_manifest_check): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES) $(my_manifest_check): $(full_android_manifest) @echo Checking manifest: $< $(MANIFEST_CHECK) --enforce-uses-libraries \ $(addprefix --uses-library ,$(PRIVATE_USES_LIBRARIES)) \ $(addprefix --optional-uses-library ,$(PRIVATE_OPTIONAL_USES_LIBRARIES)) \ $< -o $@ $(LOCAL_BUILT_MODULE): $(my_manifest_check) endif # Define the rule to build the actual package. # PRIVATE_JNI_SHARED_LIBRARIES is a list of <abi>:<path_of_built_lib>. $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis) Loading Loading
core/app_prebuilt_internal.mk +26 −0 Original line number Diff line number Diff line Loading @@ -92,6 +92,32 @@ my_preopt_for_extracted_apk := true endif endif # Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES # If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or # LOCAL_OPTIONAL_USES_LIBRARIES are specified. # Will change the default to true unconditionally in the future. ifndef LOCAL_ENFORCE_USES_LIBRARIES ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES))) LOCAL_ENFORCE_USES_LIBRARIES := true endif endif my_enforced_uses_libraries := ifdef LOCAL_ENFORCE_USES_LIBRARIES my_enforced_uses_libraries := $(intermediates.COMMON)/enforce_uses_libraries.timestamp $(my_enforced_uses_libraries): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES) $(my_enforced_uses_libraries): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES) $(my_enforced_uses_libraries): $(BUILD_SYSTEM)/verify_uses_libraries.sh $(AAPT) $(my_enforced_uses_libraries): $(my_prebuilt_src_file) @echo Verifying uses-libraries: $< aapt_binary=$(AAPT) \ uses_library_names="$(strip $(PRIVATE_USES_LIBRARIES))" \ optional_uses_library_names="$(strip $(PRIVATE_OPTIONAL_USES_LIBRARIES))" \ $(BUILD_SYSTEM)/verify_uses_libraries.sh $< touch $@ $(built_module) : $(my_enforced_uses_libraries) endif dex_preopt_profile_src_file := $(my_prebuilt_src_file) rs_compatibility_jni_libs := Loading
core/construct_context.sh +5 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,11 @@ set -e # class_loader_context_arg: final class loader conext arg # stored_class_loader_context_arg: final stored class loader context arg if [ -z "${target_sdk_version}" ]; then echo "ERROR: target_sdk_version not set" exit 2 fi # The hidl.manager shared library has a dependency on hidl.base. We'll manually # add that information to the class loader context if we see those libraries. hidl_manager="android.hidl.manager-V1.0-java" Loading
core/dex_preopt_config.mk +1 −3 Original line number Diff line number Diff line Loading @@ -116,7 +116,6 @@ ifeq ($(WRITE_SOONG_VARIABLES),true) $(call add_json_bool, NeverSystemServerDebugInfo, $(filter false,$(PRODUCT_SYSTEM_SERVER_DEBUG_INFO))) $(call add_json_bool, AlwaysOtherDebugInfo, $(filter true,$(PRODUCT_OTHER_JAVA_DEBUG_INFO))) $(call add_json_bool, NeverOtherDebugInfo, $(filter false,$(PRODUCT_OTHER_JAVA_DEBUG_INFO))) $(call add_json_list, MissingUsesLibraries, $(INTERNAL_PLATFORM_MISSING_USES_LIBRARIES)) $(call add_json_bool, IsEng, $(filter eng,$(TARGET_BUILD_VARIANT))) $(call add_json_bool, SanitizeLite, $(SANITIZE_LITE)) $(call add_json_bool, DefaultAppImages, $(WITH_DEX_PREOPT_APP_IMAGE)) Loading Loading @@ -152,7 +151,7 @@ ifeq ($(WRITE_SOONG_VARIABLES),true) $(call add_json_str, Aapt, $(SOONG_HOST_OUT_EXECUTABLES)/aapt) $(call add_json_str, SoongZip, $(SOONG_ZIP)) $(call add_json_str, Zip2zip, $(ZIP2ZIP)) $(call add_json_str, VerifyUsesLibraries, $(BUILD_SYSTEM)/verify_uses_libraries.sh) $(call add_json_str, ManifestCheck, $(SOONG_HOST_OUT_EXECUTABLES)/manifest_check) $(call add_json_str, ConstructContext, $(BUILD_SYSTEM)/construct_context.sh) $(call end_json_map) Loading @@ -175,7 +174,6 @@ DEXPREOPT_GEN_DEPS := \ $(SOONG_HOST_OUT_EXECUTABLES)/aapt \ $(SOONG_ZIP) \ $(ZIP2ZIP) \ $(BUILD_SYSTEM)/verify_uses_libraries.sh \ $(BUILD_SYSTEM)/construct_context.sh \ DEXPREOPT_STRIP_DEPS := \ Loading
core/dex_preopt_odex_install.mk +2 −13 Original line number Diff line number Diff line Loading @@ -103,18 +103,6 @@ ifeq (true,$(my_process_profile)) endif endif # If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or # LOCAL_OPTIONAL_USES_LIBRARIES are specified. ifeq (,$(LOCAL_ENFORCE_USES_LIBRARIES)) # Will change the default to true unconditionally in the future. ifneq (,$(LOCAL_OPTIONAL_USES_LIBRARIES)) LOCAL_ENFORCE_USES_LIBRARIES := true endif ifneq (,$(LOCAL_USES_LIBRARIES)) LOCAL_ENFORCE_USES_LIBRARIES := true endif endif my_dexpreopt_archs := my_dexpreopt_images := my_dexpreopt_infix := boot Loading Loading @@ -218,6 +206,7 @@ ifdef LOCAL_DEX_PREOPT $(call add_json_str, Name, $(LOCAL_MODULE)) $(call add_json_str, DexLocation, $(patsubst $(PRODUCT_OUT)%,%,$(LOCAL_INSTALLED_MODULE))) $(call add_json_str, BuildPath, $(LOCAL_BUILT_MODULE)) $(call add_json_str, ManifestPath, $(full_android_manifest)) $(call add_json_str, ExtrasOutputPath, $$2) $(call add_json_bool, Privileged, $(filter true,$(LOCAL_PRIVILEGED_MODULE))) $(call add_json_bool, UncompressedDex, $(filter true,$(LOCAL_UNCOMPRESS_DEX))) Loading @@ -226,7 +215,7 @@ ifdef LOCAL_DEX_PREOPT $(call add_json_str, ProfileClassListing, $(if $(my_process_profile),$(LOCAL_DEX_PREOPT_PROFILE))) $(call add_json_bool, ProfileIsTextListing, $(my_profile_is_text_listing)) $(call add_json_bool, EnforceUsesLibraries, $(LOCAL_ENFORCE_USES_LIBRARIES)) $(call add_json_list, OptionalUsesLibraries, $(LOCAL_OPTIONAL_USES_LIBRARIES)) $(call add_json_list, OptionalUsesLibraries, $(my_filtered_optional_uses_libraries)) $(call add_json_list, UsesLibraries, $(LOCAL_USES_LIBRARIES)) $(call add_json_map, LibraryPaths) $(foreach lib,$(my_dexpreopt_libs),\ Loading
core/package_internal.mk +25 −0 Original line number Diff line number Diff line Loading @@ -483,6 +483,31 @@ PACKAGES.$(LOCAL_PACKAGE_NAME).CERTIFICATE := $(certificate) $(LOCAL_BUILT_MODULE): $(additional_certificates) $(LOCAL_BUILT_MODULE): PRIVATE_ADDITIONAL_CERTIFICATES := $(additional_certificates) # Verify LOCAL_USES_LIBRARIES/LOCAL_OPTIONAL_USES_LIBRARIES # If LOCAL_ENFORCE_USES_LIBRARIES is not set, default to true if either of LOCAL_USES_LIBRARIES or # LOCAL_OPTIONAL_USES_LIBRARIES are specified. # Will change the default to true unconditionally in the future. ifndef LOCAL_ENFORCE_USES_LIBRARIES ifneq (,$(strip $(LOCAL_USES_LIBRARIES)$(LOCAL_OPTIONAL_USES_LIBRARIES))) LOCAL_ENFORCE_USES_LIBRARIES := true endif endif my_enforced_uses_libraries := ifdef LOCAL_ENFORCE_USES_LIBRARIES my_manifest_check := $(intermediates.COMMON)/manifest/AndroidManifest.xml.check $(my_manifest_check): $(MANIFEST_CHECK) $(my_manifest_check): PRIVATE_USES_LIBRARIES := $(LOCAL_USES_LIBRARIES) $(my_manifest_check): PRIVATE_OPTIONAL_USES_LIBRARIES := $(LOCAL_OPTIONAL_USES_LIBRARIES) $(my_manifest_check): $(full_android_manifest) @echo Checking manifest: $< $(MANIFEST_CHECK) --enforce-uses-libraries \ $(addprefix --uses-library ,$(PRIVATE_USES_LIBRARIES)) \ $(addprefix --optional-uses-library ,$(PRIVATE_OPTIONAL_USES_LIBRARIES)) \ $< -o $@ $(LOCAL_BUILT_MODULE): $(my_manifest_check) endif # Define the rule to build the actual package. # PRIVATE_JNI_SHARED_LIBRARIES is a list of <abi>:<path_of_built_lib>. $(LOCAL_BUILT_MODULE): PRIVATE_JNI_SHARED_LIBRARIES := $(jni_shared_libraries_with_abis) Loading