# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #####################hydra-fuzz################### import("//build/config/features.gni") import("//build/ohos.gni") import("//build/test.gni") import("../../../../appexecfwk.gni") import("../../../../services/bundlemgr/appexecfwk_bundlemgr.gni") module_output_path = fuzz_test_path ##############################fuzztest########################################## ohos_fuzztest("BundleInstalldHostFuzzTest") { module_out_path = module_output_path fuzz_config_file = "../../../fuzztest/fuzztest_application/bundleinstalldhost_fuzzer" cflags = [ "-g", "-O0", "-Wno-unused-variable", "-fno-omit-frame-pointer", ] use_exceptions = true sources = bundle_mgr_source sources -= [ "${services_path}/bundlemgr/src/system_ability_helper.cpp" ] sources += [ "${services_path}/bundlemgr/src/aot/aot_executor.cpp", "${services_path}/bundlemgr/src/installd/installd_host_impl.cpp", "${services_path}/bundlemgr/src/installd/installd_operator.cpp", "${services_path}/bundlemgr/test/mock/src/installd_service.cpp", ] sources += [ "${services_path}/bundlemgr/test/mock/src/installd_permission_mgr.cpp", "${services_path}/bundlemgr/test/mock/src/mock_bundle_status.cpp", "${services_path}/bundlemgr/test/mock/src/system_ability_helper.cpp", ] sources += bundle_install_sources configs = [ "${services_path}/bundlemgr/test:bundlemgr_test_config" ] deps = bundle_install_deps deps += [ "${base_path}:appexecfwk_base", "${core_path}:appexecfwk_core", ] external_deps = [ "ability_runtime:ability_manager", "access_token:el5_filekey_manager_sdk", "access_token:libprivacy_sdk", "access_token:libtokenid_sdk", "appspawn:hnpapi", "appverify:libhapverify", "bounds_checking_function:libsec_shared", "c_utils:utils", "common_event_service:cesfwk_innerkits", "eventhandler:libeventhandler", "hilog:libhilog", "hitrace:hitrace_meter", "init:libbegetutil", "ipc:ipc_core", "safwk:system_ability_fwk", "samgr:samgr_proxy", "selinux_adapter:librestorecon", ] external_deps += [ "ability_runtime:ability_manager", "ability_runtime:app_manager", "battery_manager:batterysrv_client", "device_usage_statistics:usagestatsinner", "display_manager:displaymgr", "ffrt:libffrt", "power_manager:powermgr_client", "syscap_codec:syscap_interface_shared", ] external_deps += bundle_install_external_deps if (bundle_framework_power_mgr_enable) { external_deps += aot_external_deps } configs += [ "../../../../services/bundlemgr:rdb_config" ] external_deps += [ "relational_store:native_rdb" ] sources += [ "${services_path}/bundlemgr/src/bundle_data_storage_rdb.cpp", "${services_path}/bundlemgr/src/preinstall_data_storage_rdb.cpp", "${services_path}/bundlemgr/src/rdb/bms_rdb_open_callback.cpp", "${services_path}/bundlemgr/src/rdb/rdb_data_manager.cpp", ] defines = [] include_dirs = [] if (code_signature_enable) { sources += [ "${services_path}/bundlemgr/src/aot/aot_sign_data_cache_mgr.cpp", "${services_path}/bundlemgr/src/code_sign_helper.cpp", ] include_dirs += [ "${services_path}/bundlemgr/include" ] external_deps += [ "bounds_checking_function:libsec_shared", "code_signature:libcode_sign_utils", "ets_runtime:libcompiler_service", ] defines += [ "CODE_SIGNATURE_ENABLE" ] } if (current_cpu == "arm64") { defines += [ "ON_64BIT_SYSTEM" ] } if (bundle_framework_app_control) { defines += [ "BUNDLE_FRAMEWORK_APP_CONTROL" ] sources += [ "${services_path}/bundlemgr/src/app_control/app_control_manager.cpp", "${services_path}/bundlemgr/src/app_control/app_control_manager_host_impl.cpp", "${services_path}/bundlemgr/src/app_control/app_control_manager_rdb.cpp", "${services_path}/bundlemgr/src/app_control/app_jump_interceptor_event_subscriber.cpp", "${services_path}/bundlemgr/src/app_control/app_jump_interceptor_manager_rdb.cpp", ] include_dirs += [ "${services_path}/bundlemgr/include/app_control" ] external_deps += [ "c_utils:utils" ] } if (udmf_enabled) { defines += [ "BUNDLE_FRAMEWORK_UDMF_ENABLED" ] external_deps += [ "udmf:utd_client" ] } sources += [ "bundleinstalldhost_fuzzer.cpp" ] }