Modify the dependency mode of the third-party component

Signed-off-by: 王毅 <wangyi201@huawei.com>
Change-Id: Ic534f26b22998ebf06566739bec8a352c110958f
This commit is contained in:
王毅 2024-10-22 16:45:31 +08:00
parent 5d5d1069b1
commit c4a055a553
33 changed files with 405 additions and 86 deletions

View File

@ -19,13 +19,14 @@ config("security_guard_config") {
include_dirs = [
"${sg_root_dir}/interfaces/inner_api/classify/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/services/risk_classify/model_manager/include",
"${sg_root_dir}/services/config_manager/include",
]
}
ohos_shared_library("libsg_classify_sdk") {
innerapi_tags = [ "platformsdk" ]
innerapi_tags = [
"platformsdk",
"sasdk",
]
subsystem_name = "security"
part_name = "security_guard"
output_name = "libsg_classify_sdk"

View File

@ -29,13 +29,11 @@ ohos_unittest("libsg_classify_sdk_test") {
sources = [ "unittest/src/risk_classify_kit_test.cpp" ]
deps = [
"${sg_root_dir}/frameworks/common/classify:libsg_classify_sdk",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/frameworks/common/classify:libsg_classify_sdk" ]
external_deps = [
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
]
}

View File

@ -17,21 +17,19 @@ import("//build/ohos.gni")
config("security_guard_config") {
visibility = [ ":*" ]
include_dirs = [
"include",
"${sg_root_dir}/interfaces/inner_api/collect/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
"${sg_root_dir}/services/risk_collect/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/interfaces/inner_api/acquire/include",
]
}
ohos_shared_library("libsg_collect_sdk") {
innerapi_tags = [ "platformsdk" ]
innerapi_tags = [
"platformsdk",
"sasdk",
]
subsystem_name = "security"
part_name = "security_guard"
output_name = "libsg_collect_sdk"
@ -41,7 +39,6 @@ ohos_shared_library("libsg_collect_sdk") {
public_configs = [ ":security_guard_config" ]
include_dirs = [
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/interfaces/inner_api/collect/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",

View File

@ -24,21 +24,20 @@ ohos_unittest("libsg_collect_sdk_test") {
"${sg_root_dir}/services/risk_collect/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/collect/include",
]
sources = [ "unittest/src/data_collect_kit_test.cpp" ]
deps = [
"${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk" ]
external_deps = [
"access_token:libaccesstoken_sdk",
"access_token:libnativetoken",
"access_token:libtoken_setproc",
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
]
}

View File

@ -17,17 +17,17 @@ import("//build/ohos.gni")
config("security_guard_config") {
visibility = [ ":*" ]
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/services/security_collector/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
]
}
ohos_shared_library("libsg_collector_sdk") {
innerapi_tags = [ "platformsdk" ]
innerapi_tags = [
"platformsdk",
"sasdk",
]
subsystem_name = "security"
part_name = "security_guard"
output_name = "libsg_collector_sdk"
@ -38,7 +38,7 @@ ohos_shared_library("libsg_collector_sdk") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/common/include",

View File

@ -22,8 +22,6 @@ ohos_source_set("sg_collect_stamp") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
"${sg_root_dir}/interfaces/inner_api/collect/include",
"${sg_root_dir}/frameworks/common/log/include",
@ -59,7 +57,6 @@ config("security_guard_config") {
visibility = [ ":*" ]
include_dirs = [
"${sg_root_dir}/interfaces/inner_api/data_collect_manager/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
@ -67,7 +64,10 @@ config("security_guard_config") {
}
ohos_shared_library("libsg_data_collect_manager_sdk") {
innerapi_tags = [ "platformsdk" ]
innerapi_tags = [
"platformsdk",
"sasdk",
]
subsystem_name = "security"
part_name = "security_guard"
output_name = "libsg_data_collect_manager_sdk"
@ -78,7 +78,6 @@ ohos_shared_library("libsg_data_collect_manager_sdk") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/interfaces/inner_api/collect/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",

View File

@ -19,8 +19,6 @@ config("security_guard_config") {
include_dirs = [
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/interfaces/inner_api/acquire/include",
]
@ -38,7 +36,6 @@ ohos_shared_library("libsg_obtaindata_sdk") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
"${sg_root_dir}/interfaces/inner_api/collect/include",

View File

@ -24,6 +24,7 @@ ohos_unittest("libsg_obtaindata_sdk_test") {
"${sg_root_dir}/services/risk_collect/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
"${sg_root_dir}/interfaces/inner_api/acquire/include",
]
@ -33,13 +34,11 @@ ohos_unittest("libsg_obtaindata_sdk_test") {
"unittest/src/obtaindata_kit_test.cpp",
]
deps = [
"${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/frameworks/common/collect:libsg_collect_sdk" ]
external_deps = [
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
]
}

View File

@ -18,7 +18,6 @@ ohos_shared_library("securityguard_napi") {
include_dirs = [
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/utils/include",
"${sg_root_dir}/frameworks/js/napi",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",

View File

@ -0,0 +1,47 @@
/*
* 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.
*/
#ifndef SECURITY_GUARD_DATA_COLLECT_MANAGER_SERVICE_IPC_INTERFACE_CODE_H
#define SECURITY_GUARD_DATA_COLLECT_MANAGER_SERVICE_IPC_INTERFACE_CODE_H
#include <cstdint>
/* SAID: 3524 */
namespace OHOS::Security::SecurityGuard {
enum class DataCollectManagerInterfaceCode {
CMD_DATA_COLLECT = 1,
CMD_DATA_REQUEST = 2,
CMD_DATA_SUBSCRIBE = 3,
CMD_DATA_UNSUBSCRIBE = 4,
CMD_SECURITY_EVENT_QUERY = 5,
CMD_SECURITY_COLLECTOR_START = 6,
CMD_SECURITY_COLLECTOR_STOP = 7,
CMD_SECURITY_CONFIG_UPDATE = 8,
CMD_SECURITY_EVENT_CONFIG_QUERY = 9,
};
enum class DataCollectManagerCallbackInterfaceCode {
CMD_SET_REQUEST_DATA = 1,
CMD_DATA_SUBSCRIBE_CALLBACK = 2,
};
enum class SecurityEventQueryCallbackInterfaceCode {
CMD_ON_QUERY = 1,
CMD_ON_COMPLETE = 2,
CMD_ON_ERROR = 3,
};
} // namespace OHOS::Security::SecurityGuard
#endif // SECURITY_GUARD_DATA_COLLECT_MANAGER_SERVICE_IPC_INTERFACE_CODE_H

View File

@ -0,0 +1,104 @@
/*
* Copyright (c) 2022 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.
*/
#ifndef SECURITY_GUARD_I_DATA_COLLECT_MANAGER_H
#define SECURITY_GUARD_I_DATA_COLLECT_MANAGER_H
#include <cstdint>
#include "iremote_broker.h"
#include "data_collect_manager_service_ipc_interface_code.h"
#include "security_collector_subscribe_info.h"
#include "security_event_ruler.h"
#include "security_event.h"
#include "security_config_update_info.h"
#include "security_event_config.h"
namespace OHOS::Security::SecurityGuard {
constexpr int32_t DATA_COLLECT_MANAGER_SA_ID = 3524;
class IDataCollectManager : public IRemoteBroker {
public:
using InterfaceCode = DataCollectManagerInterfaceCode;
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.DataCollectManager");
enum {
CMD_DATA_COLLECT = static_cast<uint32_t>(InterfaceCode::CMD_DATA_COLLECT),
CMD_DATA_REQUEST = static_cast<uint32_t>(InterfaceCode::CMD_DATA_REQUEST),
CMD_DATA_SUBSCRIBE = static_cast<uint32_t>(InterfaceCode::CMD_DATA_SUBSCRIBE),
CMD_DATA_UNSUBSCRIBE = static_cast<uint32_t>(InterfaceCode::CMD_DATA_UNSUBSCRIBE),
CMD_SECURITY_EVENT_QUERY = static_cast<uint32_t>(InterfaceCode::CMD_SECURITY_EVENT_QUERY),
CMD_SECURITY_COLLECTOR_START = static_cast<uint32_t>(InterfaceCode::CMD_SECURITY_COLLECTOR_START),
CMD_SECURITY_COLLECTOR_STOP = static_cast<uint32_t>(InterfaceCode::CMD_SECURITY_COLLECTOR_STOP),
CMD_SECURITY_CONFIG_UPDATE = static_cast<uint32_t>(InterfaceCode::CMD_SECURITY_CONFIG_UPDATE),
CMD_SECURITY_EVENT_CONFIG_QUERY = static_cast<uint32_t>(InterfaceCode::CMD_SECURITY_EVENT_CONFIG_QUERY),
};
virtual int32_t RequestDataSubmit(int64_t eventId, std::string &version, std::string &time,
std::string &content) = 0;
virtual int32_t RequestRiskData(std::string &devId, std::string &eventList,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t Subscribe(const SecurityCollector::SecurityCollectorSubscribeInfo &subscribeInfo,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t Unsubscribe(const sptr<IRemoteObject> &callback) = 0;
virtual int32_t QuerySecurityEvent(std::vector<SecurityCollector::SecurityEventRuler> rulers,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t CollectorStart(const SecurityCollector::SecurityCollectorSubscribeInfo &subscribeInfo,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t CollectorStop(const SecurityCollector::SecurityCollectorSubscribeInfo &subscribeInfo,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t ConfigUpdate(const SecurityGuard::SecurityConfigUpdateInfo &updateInfo) = 0;
virtual int32_t QuerySecurityEventConfig(std::string &result) = 0;
};
class IDataCollectManagerCallback : public IRemoteBroker {
public:
using InterfaceCode = DataCollectManagerCallbackInterfaceCode;
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.DataCollectManager.Callback");
enum {
CMD_SET_REQUEST_DATA = static_cast<uint32_t>(InterfaceCode::CMD_SET_REQUEST_DATA),
};
virtual int32_t ResponseRiskData(std::string &devId, std::string &riskData, uint32_t status,
const std::string& errMsg = "") = 0;
};
class IAcquireDataCallback : public IRemoteBroker {
public:
using InterfaceCode = DataCollectManagerCallbackInterfaceCode;
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.AcquireData.Callback");
enum {
CMD_DATA_SUBSCRIBE_CALLBACK = static_cast<uint32_t>(InterfaceCode::CMD_DATA_SUBSCRIBE_CALLBACK),
};
virtual int32_t OnNotify(const SecurityCollector::Event &event) = 0;
};
class ISecurityEventQueryCallback : public IRemoteBroker {
public:
using InterfaceCode = SecurityEventQueryCallbackInterfaceCode;
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.SecurityEventQuery.Callback");
enum {
CMD_ON_QUERY = static_cast<uint32_t>(InterfaceCode::CMD_ON_QUERY),
CMD_ON_COMPLETE = static_cast<uint32_t>(InterfaceCode::CMD_ON_COMPLETE),
CMD_ON_ERROR = static_cast<uint32_t>(InterfaceCode::CMD_ON_ERROR),
};
virtual void OnQuery(const std::vector<SecurityCollector::SecurityEvent> &events) = 0;
virtual void OnComplete() = 0;
virtual void OnError(const std::string &message) = 0;
};
} // namespace OHOS::Security::SecurityGuard
#endif // SECURITY_GUARD_I_DATA_COLLECT_MANAGER_H

View File

@ -0,0 +1,56 @@
/*
* Copyright (c) 2022 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.
*/
#ifndef SECURITY_GUARD_IRISK_ANALYSIS_MANAGER_H
#define SECURITY_GUARD_IRISK_ANALYSIS_MANAGER_H
#include <cstdint>
#include <cstring>
#include "iremote_broker.h"
#include "message_parcel.h"
#include "risk_analysis_manager_service_ipc_interface_code.h"
namespace OHOS::Security::SecurityGuard {
constexpr int32_t RISK_ANALYSIS_MANAGER_SA_ID = 3523;
class IRiskAnalysisManager : public IRemoteBroker {
public:
using InterfaceCode = RiskAnalysisManagerInterfaceCode;
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.RiskAnalysisManager");
enum {
CMD_GET_SECURITY_MODEL_RESULT = static_cast<uint32_t>(InterfaceCode::CMD_GET_SECURITY_MODEL_RESULT),
CMD_SET_MODEL_STATE = static_cast<uint32_t>(InterfaceCode::CMD_SET_MODEL_STATE),
};
virtual int32_t RequestSecurityModelResult(const std::string &devId, uint32_t modelId,
const std::string &param, const sptr<IRemoteObject> &callback) = 0;
virtual int32_t SetModelState(uint32_t modelId, bool enable) = 0;
};
class IRiskAnalysisManagerCallback : public IRemoteBroker {
public:
using InterfaceCode = RiskAnalysisManagerCallbackInterfaceCode;
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.RiskAnalysisManager.Callback");
enum {
CMD_SET_SECURITY_MODEL_RESULT = static_cast<uint32_t>(InterfaceCode::CMD_SET_SECURITY_MODEL_RESULT),
};
virtual int32_t ResponseSecurityModelResult(const std::string &devId, uint32_t modelId, std::string &result) = 0;
};
} // namespace OHOS::Security::SecurityGuard
#endif // SECURITY_GUARD_IRISK_ANALYSIS_MANAGER_H

View File

@ -0,0 +1,69 @@
/*
* Copyright (c) 2022 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.
*/
#ifndef ISECURITY_COLLECTOR_MANAGER_H
#define ISECURITY_COLLECTOR_MANAGER_H
#include <cstdint>
#include <cstring>
#include "iremote_broker.h"
#include "event_define.h"
#include "security_collector_subscribe_info.h"
#include "security_collector_manager_service_ipc_interface_code.h"
#include "security_event.h"
#include "security_event_ruler.h"
namespace OHOS::Security::SecurityCollector {
constexpr int32_t SECURITY_COLLECTOR_MANAGER_SA_ID = 3525;
class ISecurityCollectorManager : public IRemoteBroker {
public:
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.SecurityCollectorManager");
using InterfaceCode = SecurityCollectManagerInterfaceCode;
enum {
CMD_COLLECTOR_SUBCRIBE = static_cast<uint32_t>(InterfaceCode::CMD_COLLECTOR_SUBCRIBE),
CMD_COLLECTOR_UNSUBCRIBE = static_cast<uint32_t>(InterfaceCode::CMD_COLLECTOR_UNSUBCRIBE),
CMD_COLLECTOR_START = static_cast<uint32_t>(InterfaceCode::CMD_COLLECTOR_START),
CMD_COLLECTOR_STOP = static_cast<uint32_t>(InterfaceCode::CMD_COLLECTOR_STOP),
CMD_SECURITY_EVENT_QUERY = static_cast<uint32_t>(InterfaceCode::CMD_SECURITY_EVENT_QUERY),
};
virtual int32_t Subscribe(const SecurityCollectorSubscribeInfo &subscribeInfo,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t Unsubscribe(const sptr<IRemoteObject> &callback) = 0;
virtual int32_t CollectorStart(const SecurityCollectorSubscribeInfo &subscribeInfo,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t CollectorStop(const SecurityCollectorSubscribeInfo &subscribeInfo,
const sptr<IRemoteObject> &callback) = 0;
virtual int32_t QuerySecurityEvent(const std::vector<SecurityEventRuler> rulers,
std::vector<SecurityEvent> &events) = 0;
};
class ISecurityCollectorManagerCallback : public IRemoteBroker {
public:
using InterfaceCode = SecurityCollectManagerCallbackInterfaceCode;
DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.Security.SecurityCollectorManager.Callback");
enum {
CMD_COLLECTOR_NOTIFY = static_cast<uint32_t>(InterfaceCode::CMD_COLLECTOR_CALLBACK)
};
virtual int32_t OnNotify(const Event &event) = 0;
};
} // namespace OHOS::Security::SecurityCollector
#endif // ISECURITY_COLLECTOR_MANAGER_H

View File

@ -0,0 +1,33 @@
/*
* 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.
*/
#ifndef SECURITY_GUARD_RISK_ANALYSIS_MANAGER_SERVICE_IPC_INTERFACE_CODE_H
#define SECURITY_GUARD_RISK_ANALYSIS_MANAGER_SERVICE_IPC_INTERFACE_CODE_H
#include <cstdint>
/* SAID: 3523 */
namespace OHOS::Security::SecurityGuard {
enum class RiskAnalysisManagerInterfaceCode {
CMD_GET_SECURITY_MODEL_RESULT = 2,
CMD_SET_MODEL_STATE = 3,
};
enum class RiskAnalysisManagerCallbackInterfaceCode {
CMD_SET_SECURITY_MODEL_RESULT = 1,
};
} // namespace OHOS::Security::SecurityGuard
#endif // SECURITY_GUARD_RISK_ANALYSIS_MANAGER_SERVICE_IPC_INTERFACE_CODE_H

View File

@ -0,0 +1,35 @@
/*
* 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.
*/
#ifndef SECURITY_COLLECTOR_MANAGER_SERVICE_IPC_INTERFACE_CODE_H
#define SECURITY_COLLECTOR_MANAGER_SERVICE_IPC_INTERFACE_CODE_H
#include <cstdint>
/* SAID: 3525 */
namespace OHOS::Security::SecurityCollector {
enum class SecurityCollectManagerInterfaceCode {
CMD_COLLECTOR_SUBCRIBE = 1,
CMD_COLLECTOR_UNSUBCRIBE = 2,
CMD_COLLECTOR_START = 3,
CMD_COLLECTOR_STOP = 4,
CMD_SECURITY_EVENT_QUERY = 5
};
enum class SecurityCollectManagerCallbackInterfaceCode {
CMD_COLLECTOR_CALLBACK = 10,
};
} // namespace OHOS::Security::SecurityCollector
#endif // SECURITY_COLLECTOR_MANAGER_SERVICE_IPC_INTERFACE_CODE_H

View File

@ -28,7 +28,7 @@ ohos_shared_library("sg_collect_service") {
"${sg_root_dir}/interfaces/inner_api/collect/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}//interfaces/inner_api/common/include",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/services/config_manager/include",
"${sg_root_dir}/services/data_collect/sa/include",

View File

@ -42,7 +42,6 @@ ohos_shared_library("sg_classify_service") {
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/utils/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
]

View File

@ -26,7 +26,6 @@ ohos_source_set("sg_model_manager_stamp") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",

View File

@ -19,7 +19,7 @@ ohos_shared_library("security_collector_service") {
part_name = "security_guard"
include_dirs = [
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/services/security_collector/include",
"${sg_root_dir}/frameworks/common/log/include",

View File

@ -24,6 +24,7 @@ ohos_fuzztest("ReportSecurityInfoFuzzTest") {
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/services/risk_collect/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
]
cflags = [
"-g",

View File

@ -27,7 +27,6 @@ ohos_fuzztest("DataCollectFuzzTest") {
"${sg_root_dir}/interfaces/inner_api/collect/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/interfaces/inner_api/obtaindata/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/services/config_manager/include",
"${sg_root_dir}/services/data_collect/sa/include",

View File

@ -20,7 +20,6 @@ ohos_fuzztest("InnerSdkFuzzTest") {
fuzz_config_file = "${sg_root_dir}/test/fuzztest/inner_sdk/innersdk_fuzzer"
include_dirs = [
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/common/include",

View File

@ -22,7 +22,7 @@ ohos_fuzztest("DataCollectManagerFuzzTest") {
include_dirs = [
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/data_collect_manager/include",
"${sg_root_dir}/services/config_manager/include",

View File

@ -22,7 +22,7 @@ ohos_fuzztest("RiskAnalysisManagerFuzzTest") {
include_dirs = [
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/classify/include",
"${sg_root_dir}/services/config_manager/include",

View File

@ -22,13 +22,14 @@ ohos_fuzztest("SecurityCollectorManagerFuzzTest") {
include_dirs = [
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/data_collect_manager/include",
"${sg_root_dir}/services/config_manager/include",
"${sg_root_dir}/services/data_collect/sa",
"${sg_root_dir}/services/risk_classify/model_manager/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/services/security_collector/include",
]
cflags = [

View File

@ -23,7 +23,6 @@ ohos_fuzztest("RiskCollectFuzzTest") {
include_dirs = [
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/utils/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/json/include",

View File

@ -21,7 +21,7 @@ ohos_fuzztest("SecurityCollectorFuzzTest") {
"${sg_root_dir}/test/fuzztest/security_collector/securitycollector_fuzzer"
include_dirs = [
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/interfaces/inner_api/collector/include",
"${sg_root_dir}/services/security_collector/include",
"${sg_root_dir}/frameworks/common/log/include",

View File

@ -26,7 +26,6 @@ ohos_unittest("SecurityGuardConfigManagerTest") {
"include",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -51,10 +50,7 @@ ohos_unittest("SecurityGuardConfigManagerTest") {
"src/security_guard_config_manager_test.cpp",
]
deps = [
"${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/services/bigdata:sg_bigdata_stamp" ]
external_deps = [
"ability_base:base",
@ -63,6 +59,7 @@ ohos_unittest("SecurityGuardConfigManagerTest") {
"access_token:libnativetoken",
"access_token:libtoken_setproc",
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"json:nlohmann_json_static",
@ -91,7 +88,7 @@ ohos_unittest("AppInfoDatabseTest") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -109,10 +106,7 @@ ohos_unittest("AppInfoDatabseTest") {
"src/app_info_database_test.cpp",
]
deps = [
"${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/services/bigdata:sg_bigdata_stamp" ]
external_deps = [
"ability_base:base",
@ -121,6 +115,7 @@ ohos_unittest("AppInfoDatabseTest") {
"access_token:libnativetoken",
"access_token:libtoken_setproc",
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"kv_store:distributeddata_inner",

View File

@ -22,8 +22,6 @@ ohos_unittest("data_collect_test") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/services/config_manager/include",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/services/data_collect/store/include",
@ -83,7 +81,7 @@ ohos_unittest("SecurityGuardDataCollectTest") {
"include",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -111,11 +109,12 @@ ohos_unittest("SecurityGuardDataCollectTest") {
"src/security_guard_data_collect_test.cpp",
]
deps = [ "//third_party/googletest:gmock" ]
deps = []
external_deps = [
"c_utils:utils",
"ffrt:libffrt",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"json:nlohmann_json_static",
@ -136,7 +135,7 @@ ohos_unittest("SecurityGuardDatabaseManagerTest") {
"database_manager",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -158,14 +157,12 @@ ohos_unittest("SecurityGuardDatabaseManagerTest") {
"database_manager/security_guard_database_manager_test.cpp",
]
deps = [
"${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/services/bigdata:sg_bigdata_stamp" ]
external_deps = [
"c_utils:utils",
"ffrt:libffrt",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"json:nlohmann_json_static",
@ -184,7 +181,7 @@ ohos_unittest("SecurityGuardDataCollectSaTest") {
"sa",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -230,13 +227,13 @@ ohos_unittest("SecurityGuardDataCollectSaTest") {
"${sg_root_dir}/frameworks/common/data_collect_manager:libsg_data_collect_manager_sdk",
"${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
"${sg_root_dir}/services/config_manager:sg_config_manager",
"//third_party/googletest:gmock",
]
external_deps = [
"c_utils:utils",
"device_manager:devicemanagersdk",
"ffrt:libffrt",
"googletest:gmock",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hisysevent:libhisyseventmanager",

View File

@ -22,7 +22,6 @@ ohos_unittest("inner_api_test") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/log/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
@ -62,10 +61,11 @@ ohos_unittest("inner_api_test") {
"src/inner_api_collector_test.cpp",
]
deps = [ "//third_party/googletest:gmock" ]
deps = []
external_deps = [
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"samgr:samgr_proxy",

View File

@ -26,7 +26,6 @@ ohos_unittest("SecurityGuardModelManagerTest") {
"include",
"${sg_root_dir}/services/data_collect/store/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -48,11 +47,11 @@ ohos_unittest("SecurityGuardModelManagerTest") {
deps = [
"${sg_root_dir}/services/config_manager:sg_config_manager",
"${sg_root_dir}/services/data_collect:sg_collect_service",
"//third_party/googletest:gmock",
]
external_deps = [
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"json:nlohmann_json_static",

View File

@ -25,7 +25,6 @@ ohos_unittest("SecurityGuardRiskAnalysisTest") {
include_dirs = [
"include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -58,7 +57,6 @@ ohos_unittest("SecurityGuardRiskAnalysisTest") {
"${sg_root_dir}/services/data_collect:sg_collect_service",
"${sg_root_dir}/services/data_collect:sg_collect_service_database",
"${sg_root_dir}/services/risk_classify/model_manager:sg_model_manager_stamp",
"//third_party/googletest:gmock",
]
external_deps = [
@ -70,6 +68,7 @@ ohos_unittest("SecurityGuardRiskAnalysisTest") {
"c_utils:utils",
"device_usage_statistics:usagestatsinner",
"ffrt:libffrt",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"json:nlohmann_json_static",

View File

@ -28,6 +28,8 @@ ohos_unittest("security_collector_test") {
"${sg_root_dir}/services/security_collector/include",
"${sg_root_dir}/services/kernel_collector/include",
"${sg_root_dir}/test/unittest/security_collector/interface_test/include",
"${sg_root_dir}/frameworks/common/utils/include",
"${sg_root_dir}/interfaces/inner_api/common/include",
]
sources = [ "${sg_root_dir}/test/unittest/security_collector/interface_test/src/collector_interface_test.cpp" ]
@ -35,11 +37,11 @@ ohos_unittest("security_collector_test") {
deps = [
"${sg_root_dir}/frameworks/common/collector:libsg_collector_sdk",
"${sg_root_dir}/services/security_collector:security_collector_service",
"//third_party/googletest:gmock",
]
external_deps = [
"c_utils:utils",
"googletest:gmock",
"hilog:libhilog",
"ipc:ipc_core",
"json:nlohmann_json_static",
@ -56,7 +58,7 @@ ohos_unittest("SecurityCollectorTest") {
"include",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -84,15 +86,13 @@ ohos_unittest("SecurityCollectorTest") {
"src/security_collector_test.cpp",
]
deps = [
"${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/services/bigdata:sg_bigdata_stamp" ]
external_deps = [
"c_utils:utils",
"device_manager:devicemanagersdk",
"ffrt:libffrt",
"googletest:gmock",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hisysevent:libhisyseventmanager",
@ -113,7 +113,7 @@ ohos_unittest("SecurityCollectorRunManagerTest") {
"include",
"${sg_root_dir}/services/bigdata/include",
"${sg_root_dir}/frameworks/common/constants/include",
"${sg_root_dir}/frameworks/common/interfaces",
"${sg_root_dir}/interfaces/inner_api/common/include",
"${sg_root_dir}/frameworks/common/json/include",
"${sg_root_dir}/frameworks/common/task_handler/include",
"${sg_root_dir}/frameworks/common/database/include",
@ -137,15 +137,13 @@ ohos_unittest("SecurityCollectorRunManagerTest") {
"src/security_collector_test.cpp",
]
deps = [
"${sg_root_dir}/services/bigdata:sg_bigdata_stamp",
"//third_party/googletest:gmock",
]
deps = [ "${sg_root_dir}/services/bigdata:sg_bigdata_stamp" ]
external_deps = [
"c_utils:utils",
"device_manager:devicemanagersdk",
"ffrt:libffrt",
"googletest:gmock",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hisysevent:libhisyseventmanager",
@ -180,11 +178,12 @@ ohos_unittest("DataCollectionTest") {
"data_collection/src/data_collection_test.cpp",
]
deps = [ "//third_party/googletest:gmock" ]
deps = []
external_deps = [
"c_utils:utils",
"device_manager:devicemanagersdk",
"googletest:gmock",
"hilog:libhilog",
"hisysevent:libhisysevent",
"hisysevent:libhisyseventmanager",