From cc9a4418086f68d3aa699e0c3ef9e28a5a452ed2 Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 19:17:33 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/accesstoken/include/hap_policy_parcel.h | 3 +-- frameworks/accesstoken/src/hap_info_parcel.cpp | 3 +++ frameworks/accesstoken/src/hap_policy_parcel.cpp | 12 ++++++++++++ .../src/hap_token_info_for_sync_parcel.cpp | 6 ++++++ frameworks/accesstoken/src/hap_token_info_parcel.cpp | 6 ++++++ .../src/native_token_info_for_sync_parcel.cpp | 6 ++++++ .../accesstoken/src/native_token_info_parcel.cpp | 8 ++++++++ frameworks/accesstoken/src/permission_def_parcel.cpp | 4 ++++ .../accesstoken/src/permission_list_state_parcel.cpp | 1 + .../accesstoken/src/permission_state_full_parcel.cpp | 6 ++++++ frameworks/common/include/constant_common.h | 4 ++-- frameworks/common/include/data_validator.h | 2 +- frameworks/common/src/constant_common.cpp | 1 + frameworks/common/src/data_validator.cpp | 2 ++ frameworks/common/src/random_mbedtls.cpp | 4 ++++ frameworks/privacy/src/bundle_used_record_parcel.cpp | 4 ++++ .../privacy/src/permission_used_record_parcel.cpp | 5 +++++ .../privacy/src/permission_used_request_parcel.cpp | 6 ++++++ .../privacy/src/permission_used_result_parcel.cpp | 4 ++++ frameworks/privacy/src/used_record_detail_parcel.cpp | 1 + .../accesstoken/src/accesstoken_death_recipient.cpp | 3 +++ .../innerkits/accesstoken/src/accesstoken_kit.cpp | 10 ++++++++++ .../innerkits/nativetoken/include/nativetoken.h | 10 ---------- .../nativetoken/include/nativetoken_json_oper.h | 4 ---- interfaces/innerkits/nativetoken/src/nativetoken.c | 11 +++++++++++ .../nativetoken/src/nativetoken_json_oper.c | 5 +++++ .../test/unittest/src/nativetoken_kit_test.cpp | 3 +++ .../innerkits/token_setproc/src/token_setproc.c | 4 ++-- 28 files changed, 117 insertions(+), 21 deletions(-) diff --git a/frameworks/accesstoken/include/hap_policy_parcel.h b/frameworks/accesstoken/include/hap_policy_parcel.h index 43562c09c..ceafe550f 100644 --- a/frameworks/accesstoken/include/hap_policy_parcel.h +++ b/frameworks/accesstoken/include/hap_policy_parcel.h @@ -17,8 +17,7 @@ #define HAP_POLICY_PARCEL_H #include "hap_token_info.h" -#include "permission_def_parcel.h" -#include "permission_state_full_parcel.h" +#include "parcel.h" namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_info_parcel.cpp b/frameworks/accesstoken/src/hap_info_parcel.cpp index 8168de392..3124948a5 100644 --- a/frameworks/accesstoken/src/hap_info_parcel.cpp +++ b/frameworks/accesstoken/src/hap_info_parcel.cpp @@ -15,6 +15,9 @@ #include "hap_info_parcel.h" #include "parcel_utils.h" +#include +#include +#include namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_policy_parcel.cpp b/frameworks/accesstoken/src/hap_policy_parcel.cpp index 7d4ed108c..ded5a9687 100644 --- a/frameworks/accesstoken/src/hap_policy_parcel.cpp +++ b/frameworks/accesstoken/src/hap_policy_parcel.cpp @@ -16,6 +16,18 @@ #include "hap_policy_parcel.h" #include "parcel_utils.h" +#include +#include "access_token.h" +#include +#include +#include "permission_def.h" +#include "permission_def_parcel.h" +#include "permission_state_full.h" +#include "permission_state_full_parcel.h" +#include "refbase.h" +#include +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp index 769bf4046..c586ae227 100644 --- a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp @@ -18,6 +18,12 @@ #include "parcel_utils.h" #include "permission_state_full_parcel.h" +#include +#include +#include "permission_state_full.h" +#include "refbase.h" +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/hap_token_info_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_parcel.cpp index 414587d82..c3a8ade9c 100644 --- a/frameworks/accesstoken/src/hap_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_parcel.cpp @@ -16,6 +16,12 @@ #include "hap_token_info_parcel.h" #include "parcel_utils.h" +#include +#include "access_token.h" +#include +#include +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp index cfbddc9f7..1f221cf01 100644 --- a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp @@ -18,6 +18,12 @@ #include "parcel_utils.h" #include "permission_state_full_parcel.h" +#include +#include +#include "permission_state_full.h" +#include "refbase.h" +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/native_token_info_parcel.cpp b/frameworks/accesstoken/src/native_token_info_parcel.cpp index ce55f5f57..b55db8aa7 100644 --- a/frameworks/accesstoken/src/native_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_parcel.cpp @@ -16,6 +16,14 @@ #include "native_token_info_parcel.h" #include "parcel_utils.h" +#include +#include "access_token.h" +#include +#include +#include "stdint.h" +#include +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/permission_def_parcel.cpp b/frameworks/accesstoken/src/permission_def_parcel.cpp index 4ca7b3d2a..11184c008 100644 --- a/frameworks/accesstoken/src/permission_def_parcel.cpp +++ b/frameworks/accesstoken/src/permission_def_parcel.cpp @@ -18,6 +18,10 @@ #include "access_token.h" #include "parcel_utils.h" +#include +#include +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/permission_list_state_parcel.cpp b/frameworks/accesstoken/src/permission_list_state_parcel.cpp index 5fe05d917..687da0d5b 100644 --- a/frameworks/accesstoken/src/permission_list_state_parcel.cpp +++ b/frameworks/accesstoken/src/permission_list_state_parcel.cpp @@ -14,6 +14,7 @@ */ #include "permission_list_state_parcel.h" +#include #include "parcel_utils.h" namespace OHOS { diff --git a/frameworks/accesstoken/src/permission_state_full_parcel.cpp b/frameworks/accesstoken/src/permission_state_full_parcel.cpp index 1919f9d52..b2b86e14e 100644 --- a/frameworks/accesstoken/src/permission_state_full_parcel.cpp +++ b/frameworks/accesstoken/src/permission_state_full_parcel.cpp @@ -16,6 +16,12 @@ #include "permission_state_full_parcel.h" #include "parcel_utils.h" +#include +#include +#include +#include +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/common/include/constant_common.h b/frameworks/common/include/constant_common.h index f520054fc..7fb6e0021 100644 --- a/frameworks/common/include/constant_common.h +++ b/frameworks/common/include/constant_common.h @@ -15,8 +15,8 @@ #ifndef FRAMEWORK_CONSTANT_COMMON_H #define FRAMEWORK_CONSTANT_COMMON_H -#include -#include +#include +#include namespace OHOS { namespace Security { diff --git a/frameworks/common/include/data_validator.h b/frameworks/common/include/data_validator.h index bea3c582a..365987108 100644 --- a/frameworks/common/include/data_validator.h +++ b/frameworks/common/include/data_validator.h @@ -16,8 +16,8 @@ #ifndef DATA_VALIDATOR_H #define DATA_VALIDATOR_H -#include #include "access_token.h" +#include namespace OHOS { namespace Security { diff --git a/frameworks/common/src/constant_common.cpp b/frameworks/common/src/constant_common.cpp index 35a9fbf08..477899bce 100644 --- a/frameworks/common/src/constant_common.cpp +++ b/frameworks/common/src/constant_common.cpp @@ -14,6 +14,7 @@ */ #include "constant_common.h" #include "parameter.h" +#include namespace OHOS { namespace Security { diff --git a/frameworks/common/src/data_validator.cpp b/frameworks/common/src/data_validator.cpp index 80fde5efa..2f2f1b10d 100644 --- a/frameworks/common/src/data_validator.cpp +++ b/frameworks/common/src/data_validator.cpp @@ -14,7 +14,9 @@ */ #include "data_validator.h" +#include #include "access_token.h" +#include namespace OHOS { namespace Security { diff --git a/frameworks/common/src/random_mbedtls.cpp b/frameworks/common/src/random_mbedtls.cpp index 1a6ad4013..4b5371695 100644 --- a/frameworks/common/src/random_mbedtls.cpp +++ b/frameworks/common/src/random_mbedtls.cpp @@ -16,6 +16,10 @@ #include "random_mbedtls.h" #include "access_token.h" +#include +#include "ctr_drbg.h" +#include "entropy.h" + using OHOS::Security::AccessToken::RandomMbedtls; using OHOS::Security::AccessToken::RET_SUCCESS; diff --git a/frameworks/privacy/src/bundle_used_record_parcel.cpp b/frameworks/privacy/src/bundle_used_record_parcel.cpp index 179ea569a..6aba6b4fa 100644 --- a/frameworks/privacy/src/bundle_used_record_parcel.cpp +++ b/frameworks/privacy/src/bundle_used_record_parcel.cpp @@ -16,6 +16,10 @@ #include "bundle_used_record_parcel.h" #include "parcel_utils.h" #include "permission_used_record_parcel.h" +#include +#include +#include "refbase.h" +#include namespace OHOS { namespace Security { diff --git a/frameworks/privacy/src/permission_used_record_parcel.cpp b/frameworks/privacy/src/permission_used_record_parcel.cpp index a2a7a1e94..1e128edd2 100644 --- a/frameworks/privacy/src/permission_used_record_parcel.cpp +++ b/frameworks/privacy/src/permission_used_record_parcel.cpp @@ -17,6 +17,11 @@ #include "parcel_utils.h" #include "used_record_detail_parcel.h" +#include +#include +#include "refbase.h" +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/privacy/src/permission_used_request_parcel.cpp b/frameworks/privacy/src/permission_used_request_parcel.cpp index e4eac2bce..149f03a0d 100644 --- a/frameworks/privacy/src/permission_used_request_parcel.cpp +++ b/frameworks/privacy/src/permission_used_request_parcel.cpp @@ -16,6 +16,12 @@ #include "permission_used_request_parcel.h" #include "parcel_utils.h" +#include +#include +#include +#include +#include + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/privacy/src/permission_used_result_parcel.cpp b/frameworks/privacy/src/permission_used_result_parcel.cpp index 88f9abf57..ba6d2763b 100644 --- a/frameworks/privacy/src/permission_used_result_parcel.cpp +++ b/frameworks/privacy/src/permission_used_result_parcel.cpp @@ -16,6 +16,10 @@ #include "permission_used_result_parcel.h" #include "bundle_used_record_parcel.h" #include "parcel_utils.h" +#include +#include +#include "refbase.h" +#include namespace OHOS { namespace Security { diff --git a/frameworks/privacy/src/used_record_detail_parcel.cpp b/frameworks/privacy/src/used_record_detail_parcel.cpp index d59512b67..aa9cc2e7a 100644 --- a/frameworks/privacy/src/used_record_detail_parcel.cpp +++ b/frameworks/privacy/src/used_record_detail_parcel.cpp @@ -15,6 +15,7 @@ #include "used_record_detail_parcel.h" #include "parcel_utils.h" +#include namespace OHOS { namespace Security { diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp index cd00a5477..9e80d92d8 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp @@ -17,6 +17,9 @@ #include "accesstoken_log.h" #include "accesstoken_manager_client.h" +#include "hilog/log_c.h" +#include "hilog/log_cpp.h" + namespace OHOS { namespace Security { namespace AccessToken { diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp index a20496aa7..d80bf0b1f 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp @@ -23,6 +23,11 @@ #include "constant_common.h" #include "data_validator.h" +#include "hap_token_info.h" +#include "hilog/log_c.h" +#include "hilog/log_cpp.h" +#include "permission_def.h" + namespace OHOS { namespace Security { namespace AccessToken { @@ -30,6 +35,11 @@ namespace { static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_ACCESSTOKEN, "AccessTokenKit"}; } // namespace +class NativeTokenInfo; +class NativeTokenInfoForSync; +class PermissionListState; +class PermissionStateFull; + AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { AccessTokenIDEx res = {0}; diff --git a/interfaces/innerkits/nativetoken/include/nativetoken.h b/interfaces/innerkits/nativetoken/include/nativetoken.h index dc71d3888..7c3c9f9be 100644 --- a/interfaces/innerkits/nativetoken/include/nativetoken.h +++ b/interfaces/innerkits/nativetoken/include/nativetoken.h @@ -13,17 +13,7 @@ * limitations under the License. */ -#include -#include #include -#include -#include -#include -#include - -#include "cJSON.h" -#include "securec.h" -#include "nativetoken_log.h" #ifndef NATIVE_TOKEN_H #define NATIVE_TOKEN_H diff --git a/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h b/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h index ef2146922..71ab6cf6a 100644 --- a/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h +++ b/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h @@ -14,13 +14,9 @@ */ #include -#include -#include #include "cJSON.h" -#include "securec.h" #include "nativetoken.h" -#include "nativetoken_log.h" #ifndef NATIVETOKEN_JSON_OPER_H #define NATIVETOKEN_JSON_OPER_H diff --git a/interfaces/innerkits/nativetoken/src/nativetoken.c b/interfaces/innerkits/nativetoken/src/nativetoken.c index 89c507868..5bc228acd 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken.c @@ -20,6 +20,17 @@ #include "nativetoken_json_oper.h" #include "nativetoken_kit.h" +#include +#include +#include "bits/errno.h" +#include "bits/fcntl.h" +#include "errno.h" +#include "fcntl.h" +#include "nativetoken_log.h" +#include "securec.h" +#include +#include "sys/stat.h" +#include "unistd.h" NativeTokenList *g_tokenListHead; int32_t g_isNativeTokenInited = 0; diff --git a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c index 7921b36ce..15a033eaf 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c @@ -14,6 +14,11 @@ */ #include "nativetoken_json_oper.h" +#include +#include "nativetoken_log.h" +#include +#include + void FreeStrArray(char **arr, int32_t num) { for (int32_t i = 0; i <= num; i++) { diff --git a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp index f13cf2b45..d4062a319 100644 --- a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp +++ b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp @@ -17,6 +17,9 @@ #include #include "nativetoken.h" #include "nativetoken_kit.h" +#include "securec.h" +#include +#include using namespace testing::ext; using namespace OHOS::Security; diff --git a/interfaces/innerkits/token_setproc/src/token_setproc.c b/interfaces/innerkits/token_setproc/src/token_setproc.c index da5dd2a1a..6307c1933 100644 --- a/interfaces/innerkits/token_setproc/src/token_setproc.c +++ b/interfaces/innerkits/token_setproc/src/token_setproc.c @@ -15,9 +15,9 @@ #include "token_setproc.h" +#include "bits/ioctl.h" + #include -#include -#include #include #include #include -- Gitee From 5b7d10993ebc2ac323a53f780814395db33fe9ba Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 20:17:01 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/accesstoken/src/hap_policy_parcel.cpp | 5 ----- .../accesstoken/src/hap_token_info_for_sync_parcel.cpp | 4 ---- frameworks/accesstoken/src/hap_token_info_parcel.cpp | 5 ----- .../accesstoken/src/native_token_info_for_sync_parcel.cpp | 3 --- frameworks/accesstoken/src/native_token_info_parcel.cpp | 2 -- frameworks/accesstoken/src/permission_def_parcel.cpp | 4 ---- frameworks/accesstoken/src/permission_list_state_parcel.cpp | 1 - frameworks/accesstoken/src/permission_state_full_parcel.cpp | 6 ------ frameworks/common/include/constant_common.h | 2 +- frameworks/common/include/data_validator.h | 2 +- frameworks/common/src/constant_common.cpp | 3 ++- frameworks/common/src/data_validator.cpp | 1 - frameworks/common/src/random_mbedtls.cpp | 1 - frameworks/privacy/src/bundle_used_record_parcel.cpp | 3 --- frameworks/privacy/src/permission_used_record_parcel.cpp | 4 ---- frameworks/privacy/src/permission_used_request_parcel.cpp | 6 ------ frameworks/privacy/src/permission_used_result_parcel.cpp | 3 --- frameworks/privacy/src/used_record_detail_parcel.cpp | 1 - interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp | 5 ----- 19 files changed, 4 insertions(+), 57 deletions(-) diff --git a/frameworks/accesstoken/src/hap_policy_parcel.cpp b/frameworks/accesstoken/src/hap_policy_parcel.cpp index ded5a9687..ff2e22de1 100644 --- a/frameworks/accesstoken/src/hap_policy_parcel.cpp +++ b/frameworks/accesstoken/src/hap_policy_parcel.cpp @@ -16,17 +16,12 @@ #include "hap_policy_parcel.h" #include "parcel_utils.h" -#include #include "access_token.h" -#include -#include #include "permission_def.h" #include "permission_def_parcel.h" #include "permission_state_full.h" #include "permission_state_full_parcel.h" #include "refbase.h" -#include -#include namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp index c586ae227..fa86d3629 100644 --- a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp @@ -17,12 +17,8 @@ #include "hap_token_info_parcel.h" #include "parcel_utils.h" #include "permission_state_full_parcel.h" - -#include -#include #include "permission_state_full.h" #include "refbase.h" -#include namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_token_info_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_parcel.cpp index c3a8ade9c..01f997c88 100644 --- a/frameworks/accesstoken/src/hap_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_parcel.cpp @@ -15,12 +15,7 @@ #include "hap_token_info_parcel.h" #include "parcel_utils.h" - -#include #include "access_token.h" -#include -#include -#include namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp index 1f221cf01..e8b286f5a 100644 --- a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp @@ -18,11 +18,8 @@ #include "parcel_utils.h" #include "permission_state_full_parcel.h" -#include -#include #include "permission_state_full.h" #include "refbase.h" -#include namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/native_token_info_parcel.cpp b/frameworks/accesstoken/src/native_token_info_parcel.cpp index b55db8aa7..4dd00a0eb 100644 --- a/frameworks/accesstoken/src/native_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_parcel.cpp @@ -16,11 +16,9 @@ #include "native_token_info_parcel.h" #include "parcel_utils.h" -#include #include "access_token.h" #include #include -#include "stdint.h" #include #include diff --git a/frameworks/accesstoken/src/permission_def_parcel.cpp b/frameworks/accesstoken/src/permission_def_parcel.cpp index 11184c008..4ca7b3d2a 100644 --- a/frameworks/accesstoken/src/permission_def_parcel.cpp +++ b/frameworks/accesstoken/src/permission_def_parcel.cpp @@ -18,10 +18,6 @@ #include "access_token.h" #include "parcel_utils.h" -#include -#include -#include - namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/permission_list_state_parcel.cpp b/frameworks/accesstoken/src/permission_list_state_parcel.cpp index 687da0d5b..5fe05d917 100644 --- a/frameworks/accesstoken/src/permission_list_state_parcel.cpp +++ b/frameworks/accesstoken/src/permission_list_state_parcel.cpp @@ -14,7 +14,6 @@ */ #include "permission_list_state_parcel.h" -#include #include "parcel_utils.h" namespace OHOS { diff --git a/frameworks/accesstoken/src/permission_state_full_parcel.cpp b/frameworks/accesstoken/src/permission_state_full_parcel.cpp index b2b86e14e..1919f9d52 100644 --- a/frameworks/accesstoken/src/permission_state_full_parcel.cpp +++ b/frameworks/accesstoken/src/permission_state_full_parcel.cpp @@ -16,12 +16,6 @@ #include "permission_state_full_parcel.h" #include "parcel_utils.h" -#include -#include -#include -#include -#include - namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/common/include/constant_common.h b/frameworks/common/include/constant_common.h index 7fb6e0021..8651f5d4e 100644 --- a/frameworks/common/include/constant_common.h +++ b/frameworks/common/include/constant_common.h @@ -15,7 +15,7 @@ #ifndef FRAMEWORK_CONSTANT_COMMON_H #define FRAMEWORK_CONSTANT_COMMON_H -#include +#include #include namespace OHOS { diff --git a/frameworks/common/include/data_validator.h b/frameworks/common/include/data_validator.h index 365987108..2e9a0f0f6 100644 --- a/frameworks/common/include/data_validator.h +++ b/frameworks/common/include/data_validator.h @@ -16,8 +16,8 @@ #ifndef DATA_VALIDATOR_H #define DATA_VALIDATOR_H -#include "access_token.h" #include +#include "access_token.h" namespace OHOS { namespace Security { diff --git a/frameworks/common/src/constant_common.cpp b/frameworks/common/src/constant_common.cpp index 477899bce..ed2209e21 100644 --- a/frameworks/common/src/constant_common.cpp +++ b/frameworks/common/src/constant_common.cpp @@ -12,8 +12,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "constant_common.h" + #include "parameter.h" +#include "constant_common.h" #include namespace OHOS { diff --git a/frameworks/common/src/data_validator.cpp b/frameworks/common/src/data_validator.cpp index 2f2f1b10d..4972937a3 100644 --- a/frameworks/common/src/data_validator.cpp +++ b/frameworks/common/src/data_validator.cpp @@ -14,7 +14,6 @@ */ #include "data_validator.h" -#include #include "access_token.h" #include diff --git a/frameworks/common/src/random_mbedtls.cpp b/frameworks/common/src/random_mbedtls.cpp index 4b5371695..1df11ac04 100644 --- a/frameworks/common/src/random_mbedtls.cpp +++ b/frameworks/common/src/random_mbedtls.cpp @@ -16,7 +16,6 @@ #include "random_mbedtls.h" #include "access_token.h" -#include #include "ctr_drbg.h" #include "entropy.h" diff --git a/frameworks/privacy/src/bundle_used_record_parcel.cpp b/frameworks/privacy/src/bundle_used_record_parcel.cpp index 6aba6b4fa..bd143af65 100644 --- a/frameworks/privacy/src/bundle_used_record_parcel.cpp +++ b/frameworks/privacy/src/bundle_used_record_parcel.cpp @@ -16,10 +16,7 @@ #include "bundle_used_record_parcel.h" #include "parcel_utils.h" #include "permission_used_record_parcel.h" -#include -#include #include "refbase.h" -#include namespace OHOS { namespace Security { diff --git a/frameworks/privacy/src/permission_used_record_parcel.cpp b/frameworks/privacy/src/permission_used_record_parcel.cpp index 1e128edd2..8d4a87347 100644 --- a/frameworks/privacy/src/permission_used_record_parcel.cpp +++ b/frameworks/privacy/src/permission_used_record_parcel.cpp @@ -16,11 +16,7 @@ #include "permission_used_record_parcel.h" #include "parcel_utils.h" #include "used_record_detail_parcel.h" - -#include -#include #include "refbase.h" -#include namespace OHOS { namespace Security { diff --git a/frameworks/privacy/src/permission_used_request_parcel.cpp b/frameworks/privacy/src/permission_used_request_parcel.cpp index 149f03a0d..e4eac2bce 100644 --- a/frameworks/privacy/src/permission_used_request_parcel.cpp +++ b/frameworks/privacy/src/permission_used_request_parcel.cpp @@ -16,12 +16,6 @@ #include "permission_used_request_parcel.h" #include "parcel_utils.h" -#include -#include -#include -#include -#include - namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/privacy/src/permission_used_result_parcel.cpp b/frameworks/privacy/src/permission_used_result_parcel.cpp index ba6d2763b..33ca0e491 100644 --- a/frameworks/privacy/src/permission_used_result_parcel.cpp +++ b/frameworks/privacy/src/permission_used_result_parcel.cpp @@ -16,10 +16,7 @@ #include "permission_used_result_parcel.h" #include "bundle_used_record_parcel.h" #include "parcel_utils.h" -#include -#include #include "refbase.h" -#include namespace OHOS { namespace Security { diff --git a/frameworks/privacy/src/used_record_detail_parcel.cpp b/frameworks/privacy/src/used_record_detail_parcel.cpp index aa9cc2e7a..d59512b67 100644 --- a/frameworks/privacy/src/used_record_detail_parcel.cpp +++ b/frameworks/privacy/src/used_record_detail_parcel.cpp @@ -15,7 +15,6 @@ #include "used_record_detail_parcel.h" #include "parcel_utils.h" -#include namespace OHOS { namespace Security { diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp index d80bf0b1f..8137e83a6 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp @@ -35,11 +35,6 @@ namespace { static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_ACCESSTOKEN, "AccessTokenKit"}; } // namespace -class NativeTokenInfo; -class NativeTokenInfoForSync; -class PermissionListState; -class PermissionStateFull; - AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { AccessTokenIDEx res = {0}; -- Gitee From a9733bc70f914bc473abcd784cde68f3134450d8 Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 20:37:44 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/accesstoken/src/hap_info_parcel.cpp | 5 +---- .../accesstoken/src/hap_token_info_for_sync_parcel.cpp | 1 + frameworks/accesstoken/src/hap_token_info_parcel.cpp | 1 + .../accesstoken/src/native_token_info_for_sync_parcel.cpp | 1 - frameworks/accesstoken/src/native_token_info_parcel.cpp | 2 +- frameworks/common/include/data_validator.h | 2 +- frameworks/common/src/constant_common.cpp | 2 +- frameworks/common/src/data_validator.cpp | 1 - interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp | 5 +++++ interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c | 5 ++--- .../nativetoken/test/unittest/src/nativetoken_kit_test.cpp | 4 ++-- 11 files changed, 15 insertions(+), 14 deletions(-) diff --git a/frameworks/accesstoken/src/hap_info_parcel.cpp b/frameworks/accesstoken/src/hap_info_parcel.cpp index 3124948a5..58372bed2 100644 --- a/frameworks/accesstoken/src/hap_info_parcel.cpp +++ b/frameworks/accesstoken/src/hap_info_parcel.cpp @@ -13,11 +13,8 @@ * limitations under the License. */ -#include "hap_info_parcel.h" #include "parcel_utils.h" -#include -#include -#include +#include "hap_info_parcel.h" namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp index fa86d3629..d06cfa685 100644 --- a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp @@ -17,6 +17,7 @@ #include "hap_token_info_parcel.h" #include "parcel_utils.h" #include "permission_state_full_parcel.h" + #include "permission_state_full.h" #include "refbase.h" diff --git a/frameworks/accesstoken/src/hap_token_info_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_parcel.cpp index 01f997c88..05987a923 100644 --- a/frameworks/accesstoken/src/hap_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_parcel.cpp @@ -15,6 +15,7 @@ #include "hap_token_info_parcel.h" #include "parcel_utils.h" + #include "access_token.h" namespace OHOS { diff --git a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp index e8b286f5a..1077fd0d2 100644 --- a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp @@ -17,7 +17,6 @@ #include "native_token_info_parcel.h" #include "parcel_utils.h" #include "permission_state_full_parcel.h" - #include "permission_state_full.h" #include "refbase.h" diff --git a/frameworks/accesstoken/src/native_token_info_parcel.cpp b/frameworks/accesstoken/src/native_token_info_parcel.cpp index 4dd00a0eb..5d6cae27a 100644 --- a/frameworks/accesstoken/src/native_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_parcel.cpp @@ -16,11 +16,11 @@ #include "native_token_info_parcel.h" #include "parcel_utils.h" -#include "access_token.h" #include #include #include #include +#include "access_token.h" namespace OHOS { namespace Security { diff --git a/frameworks/common/include/data_validator.h b/frameworks/common/include/data_validator.h index 2e9a0f0f6..bea3c582a 100644 --- a/frameworks/common/include/data_validator.h +++ b/frameworks/common/include/data_validator.h @@ -16,7 +16,7 @@ #ifndef DATA_VALIDATOR_H #define DATA_VALIDATOR_H -#include +#include #include "access_token.h" namespace OHOS { diff --git a/frameworks/common/src/constant_common.cpp b/frameworks/common/src/constant_common.cpp index ed2209e21..736a66ce0 100644 --- a/frameworks/common/src/constant_common.cpp +++ b/frameworks/common/src/constant_common.cpp @@ -13,9 +13,9 @@ * limitations under the License. */ -#include "parameter.h" #include "constant_common.h" #include +#include "parameter.h" namespace OHOS { namespace Security { diff --git a/frameworks/common/src/data_validator.cpp b/frameworks/common/src/data_validator.cpp index 4972937a3..80fde5efa 100644 --- a/frameworks/common/src/data_validator.cpp +++ b/frameworks/common/src/data_validator.cpp @@ -15,7 +15,6 @@ #include "data_validator.h" #include "access_token.h" -#include namespace OHOS { namespace Security { diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp index 8137e83a6..7814f3ba7 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp @@ -35,6 +35,11 @@ namespace { static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_ACCESSTOKEN, "AccessTokenKit"}; } // namespace +// class NativeTokenInfo; +// class NativeTokenInfoForSync; +// class PermissionListState; +// class PermissionStateFull; + AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { AccessTokenIDEx res = {0}; diff --git a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c index 15a033eaf..3560b9612 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c @@ -12,12 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include "nativetoken_json_oper.h" - #include -#include "nativetoken_log.h" #include #include +#include "nativetoken_json_oper.h" +#include "nativetoken_log.h" void FreeStrArray(char **arr, int32_t num) { diff --git a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp index d4062a319..3f1925e81 100644 --- a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp +++ b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp @@ -15,11 +15,11 @@ #include "nativetoken_kit_test.h" #include -#include "nativetoken.h" -#include "nativetoken_kit.h" #include "securec.h" #include #include +#include "nativetoken.h" +#include "nativetoken_kit.h" using namespace testing::ext; using namespace OHOS::Security; -- Gitee From 8ee82c6976884f4f697a71c75772c3cfe7f3399e Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 20:46:25 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp | 5 ----- interfaces/innerkits/nativetoken/src/nativetoken.c | 6 +++--- .../innerkits/nativetoken/src/nativetoken_json_oper.c | 2 +- .../nativetoken/test/unittest/src/nativetoken_kit_test.cpp | 4 ++-- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp index 7814f3ba7..8137e83a6 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp @@ -35,11 +35,6 @@ namespace { static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, SECURITY_DOMAIN_ACCESSTOKEN, "AccessTokenKit"}; } // namespace -// class NativeTokenInfo; -// class NativeTokenInfoForSync; -// class PermissionListState; -// class PermissionStateFull; - AccessTokenIDEx AccessTokenKit::AllocHapToken(const HapInfoParams& info, const HapPolicyParams& policy) { AccessTokenIDEx res = {0}; diff --git a/interfaces/innerkits/nativetoken/src/nativetoken.c b/interfaces/innerkits/nativetoken/src/nativetoken.c index 5bc228acd..b72864b6b 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken.c @@ -18,19 +18,19 @@ #include #endif // WITH_SELINUX -#include "nativetoken_json_oper.h" -#include "nativetoken_kit.h" #include #include #include "bits/errno.h" #include "bits/fcntl.h" #include "errno.h" #include "fcntl.h" -#include "nativetoken_log.h" #include "securec.h" #include #include "sys/stat.h" #include "unistd.h" +#include "nativetoken_log.h" +#include "nativetoken_kit.h" +#include "nativetoken_json_oper.h" NativeTokenList *g_tokenListHead; int32_t g_isNativeTokenInited = 0; diff --git a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c index 3560b9612..38bb2cf9f 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c @@ -15,8 +15,8 @@ #include #include #include -#include "nativetoken_json_oper.h" #include "nativetoken_log.h" +#include "nativetoken_json_oper.h" void FreeStrArray(char **arr, int32_t num) { diff --git a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp index 3f1925e81..3a4a60959 100644 --- a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp +++ b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ -#include "nativetoken_kit_test.h" #include -#include "securec.h" #include #include +#include "securec.h" #include "nativetoken.h" #include "nativetoken_kit.h" +#include "nativetoken_kit_test.h" using namespace testing::ext; using namespace OHOS::Security; -- Gitee From 491025c75425b052a8b42ed8a3aa4ab4b56af3b3 Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 20:53:45 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- interfaces/innerkits/nativetoken/src/nativetoken.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/innerkits/nativetoken/src/nativetoken.c b/interfaces/innerkits/nativetoken/src/nativetoken.c index b72864b6b..93c2e0a31 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken.c @@ -20,12 +20,12 @@ #include #include +#include #include "bits/errno.h" #include "bits/fcntl.h" #include "errno.h" #include "fcntl.h" #include "securec.h" -#include #include "sys/stat.h" #include "unistd.h" #include "nativetoken_log.h" -- Gitee From 02da18176c289fecd0de15966ce82d14b6f6164b Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 22:20:58 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/accesstoken/src/hap_info_parcel.cpp | 2 +- frameworks/accesstoken/src/hap_policy_parcel.cpp | 3 +-- .../accesstoken/src/hap_token_info_for_sync_parcel.cpp | 5 ++--- frameworks/accesstoken/src/hap_token_info_parcel.cpp | 2 -- .../src/native_token_info_for_sync_parcel.cpp | 6 +++--- frameworks/accesstoken/src/native_token_info_parcel.cpp | 3 +-- frameworks/common/src/random_mbedtls.cpp | 3 --- frameworks/privacy/src/bundle_used_record_parcel.cpp | 2 +- frameworks/privacy/src/permission_used_record_parcel.cpp | 2 +- .../accesstoken/src/accesstoken_death_recipient.cpp | 4 ---- interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp | 4 ---- .../nativetoken/include/nativetoken_json_oper.h | 1 - interfaces/innerkits/nativetoken/src/nativetoken.c | 9 +++++---- .../innerkits/nativetoken/src/nativetoken_json_oper.c | 4 ++-- .../test/unittest/src/nativetoken_kit_test.cpp | 4 ++-- interfaces/innerkits/token_setproc/src/token_setproc.c | 4 +--- 16 files changed, 20 insertions(+), 38 deletions(-) diff --git a/frameworks/accesstoken/src/hap_info_parcel.cpp b/frameworks/accesstoken/src/hap_info_parcel.cpp index 58372bed2..8168de392 100644 --- a/frameworks/accesstoken/src/hap_info_parcel.cpp +++ b/frameworks/accesstoken/src/hap_info_parcel.cpp @@ -13,8 +13,8 @@ * limitations under the License. */ -#include "parcel_utils.h" #include "hap_info_parcel.h" +#include "parcel_utils.h" namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_policy_parcel.cpp b/frameworks/accesstoken/src/hap_policy_parcel.cpp index ff2e22de1..9a3fb12b3 100644 --- a/frameworks/accesstoken/src/hap_policy_parcel.cpp +++ b/frameworks/accesstoken/src/hap_policy_parcel.cpp @@ -15,13 +15,12 @@ #include "hap_policy_parcel.h" #include "parcel_utils.h" - +#include "refbase.h" #include "access_token.h" #include "permission_def.h" #include "permission_def_parcel.h" #include "permission_state_full.h" #include "permission_state_full_parcel.h" -#include "refbase.h" namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp index d06cfa685..17b04b3a5 100644 --- a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp @@ -14,12 +14,11 @@ */ #include "hap_token_info_for_sync_parcel.h" +#include "refbase.h" #include "hap_token_info_parcel.h" #include "parcel_utils.h" -#include "permission_state_full_parcel.h" - #include "permission_state_full.h" -#include "refbase.h" +#include "permission_state_full_parcel.h" namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/hap_token_info_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_parcel.cpp index 05987a923..414587d82 100644 --- a/frameworks/accesstoken/src/hap_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_parcel.cpp @@ -16,8 +16,6 @@ #include "hap_token_info_parcel.h" #include "parcel_utils.h" -#include "access_token.h" - namespace OHOS { namespace Security { namespace AccessToken { diff --git a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp index 1077fd0d2..67608e4ff 100644 --- a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp @@ -14,11 +14,11 @@ */ #include "native_token_info_for_sync_parcel.h" -#include "native_token_info_parcel.h" #include "parcel_utils.h" -#include "permission_state_full_parcel.h" -#include "permission_state_full.h" #include "refbase.h" +#include "native_token_info_parcel.h" +#include "permission_state_full.h" +#include "permission_state_full_parcel.h" namespace OHOS { namespace Security { diff --git a/frameworks/accesstoken/src/native_token_info_parcel.cpp b/frameworks/accesstoken/src/native_token_info_parcel.cpp index 5d6cae27a..92b906618 100644 --- a/frameworks/accesstoken/src/native_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_parcel.cpp @@ -14,12 +14,11 @@ */ #include "native_token_info_parcel.h" -#include "parcel_utils.h" - #include #include #include #include +#include "parcel_utils.h" #include "access_token.h" namespace OHOS { diff --git a/frameworks/common/src/random_mbedtls.cpp b/frameworks/common/src/random_mbedtls.cpp index 1df11ac04..1a6ad4013 100644 --- a/frameworks/common/src/random_mbedtls.cpp +++ b/frameworks/common/src/random_mbedtls.cpp @@ -16,9 +16,6 @@ #include "random_mbedtls.h" #include "access_token.h" -#include "ctr_drbg.h" -#include "entropy.h" - using OHOS::Security::AccessToken::RandomMbedtls; using OHOS::Security::AccessToken::RET_SUCCESS; diff --git a/frameworks/privacy/src/bundle_used_record_parcel.cpp b/frameworks/privacy/src/bundle_used_record_parcel.cpp index bd143af65..7bff90b61 100644 --- a/frameworks/privacy/src/bundle_used_record_parcel.cpp +++ b/frameworks/privacy/src/bundle_used_record_parcel.cpp @@ -15,8 +15,8 @@ #include "bundle_used_record_parcel.h" #include "parcel_utils.h" -#include "permission_used_record_parcel.h" #include "refbase.h" +#include "permission_used_record_parcel.h" namespace OHOS { namespace Security { diff --git a/frameworks/privacy/src/permission_used_record_parcel.cpp b/frameworks/privacy/src/permission_used_record_parcel.cpp index 8d4a87347..1b01aee57 100644 --- a/frameworks/privacy/src/permission_used_record_parcel.cpp +++ b/frameworks/privacy/src/permission_used_record_parcel.cpp @@ -15,8 +15,8 @@ #include "permission_used_record_parcel.h" #include "parcel_utils.h" -#include "used_record_detail_parcel.h" #include "refbase.h" +#include "used_record_detail_parcel.h" namespace OHOS { namespace Security { diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp index 9e80d92d8..d0608aacc 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_death_recipient.cpp @@ -13,13 +13,9 @@ * limitations under the License. */ #include "accesstoken_death_recipient.h" - #include "accesstoken_log.h" #include "accesstoken_manager_client.h" -#include "hilog/log_c.h" -#include "hilog/log_cpp.h" - namespace OHOS { namespace Security { namespace AccessToken { diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp index 8137e83a6..748e54463 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp @@ -14,7 +14,6 @@ */ #include "accesstoken_kit.h" - #include #include @@ -22,10 +21,7 @@ #include "accesstoken_manager_client.h" #include "constant_common.h" #include "data_validator.h" - #include "hap_token_info.h" -#include "hilog/log_c.h" -#include "hilog/log_cpp.h" #include "permission_def.h" namespace OHOS { diff --git a/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h b/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h index 71ab6cf6a..820f56581 100644 --- a/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h +++ b/interfaces/innerkits/nativetoken/include/nativetoken_json_oper.h @@ -14,7 +14,6 @@ */ #include - #include "cJSON.h" #include "nativetoken.h" diff --git a/interfaces/innerkits/nativetoken/src/nativetoken.c b/interfaces/innerkits/nativetoken/src/nativetoken.c index 93c2e0a31..51fe8fcf1 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken.c @@ -21,16 +21,17 @@ #include #include #include -#include "bits/errno.h" -#include "bits/fcntl.h" +// #include "bits/errno.h" +// #include "bits/fcntl.h" #include "errno.h" #include "fcntl.h" #include "securec.h" #include "sys/stat.h" #include "unistd.h" -#include "nativetoken_log.h" -#include "nativetoken_kit.h" #include "nativetoken_json_oper.h" +#include "nativetoken_kit.h" +#include "nativetoken_log.h" + NativeTokenList *g_tokenListHead; int32_t g_isNativeTokenInited = 0; diff --git a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c index 38bb2cf9f..189483fe9 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c @@ -12,11 +12,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#include +#include "nativetoken_json_oper.h" #include +#include #include #include "nativetoken_log.h" -#include "nativetoken_json_oper.h" void FreeStrArray(char **arr, int32_t num) { diff --git a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp index 3a4a60959..d9f9827e0 100644 --- a/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp +++ b/interfaces/innerkits/nativetoken/test/unittest/src/nativetoken_kit_test.cpp @@ -13,13 +13,13 @@ * limitations under the License. */ -#include +#include "nativetoken_kit_test.h" #include #include +#include #include "securec.h" #include "nativetoken.h" #include "nativetoken_kit.h" -#include "nativetoken_kit_test.h" using namespace testing::ext; using namespace OHOS::Security; diff --git a/interfaces/innerkits/token_setproc/src/token_setproc.c b/interfaces/innerkits/token_setproc/src/token_setproc.c index 6307c1933..fb7b1515b 100644 --- a/interfaces/innerkits/token_setproc/src/token_setproc.c +++ b/interfaces/innerkits/token_setproc/src/token_setproc.c @@ -14,13 +14,11 @@ */ #include "token_setproc.h" - #include "bits/ioctl.h" - #include #include -#include #include +#include #define ACCESS_TOKEN_ID_IOCTL_BASE 'A' -- Gitee From d1657ae678257688d0e1eb8de19fc4bf9f4ad363 Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 22:29:30 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp | 2 +- interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp | 1 - interfaces/innerkits/token_setproc/src/token_setproc.c | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp index 17b04b3a5..c9a7bf9d2 100644 --- a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp @@ -14,9 +14,9 @@ */ #include "hap_token_info_for_sync_parcel.h" +#include "parcel_utils.h" #include "refbase.h" #include "hap_token_info_parcel.h" -#include "parcel_utils.h" #include "permission_state_full.h" #include "permission_state_full_parcel.h" diff --git a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp index 748e54463..8168fcb95 100644 --- a/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp +++ b/interfaces/innerkits/accesstoken/src/accesstoken_kit.cpp @@ -16,7 +16,6 @@ #include "accesstoken_kit.h" #include #include - #include "accesstoken_log.h" #include "accesstoken_manager_client.h" #include "constant_common.h" diff --git a/interfaces/innerkits/token_setproc/src/token_setproc.c b/interfaces/innerkits/token_setproc/src/token_setproc.c index fb7b1515b..8ca00b881 100644 --- a/interfaces/innerkits/token_setproc/src/token_setproc.c +++ b/interfaces/innerkits/token_setproc/src/token_setproc.c @@ -14,10 +14,10 @@ */ #include "token_setproc.h" -#include "bits/ioctl.h" + #include -#include #include +#include #include #define ACCESS_TOKEN_ID_IOCTL_BASE 'A' -- Gitee From 5e5a11e54b120edb5086d7ad0bdf596029794fec Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 22:32:39 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- interfaces/innerkits/nativetoken/src/nativetoken.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/interfaces/innerkits/nativetoken/src/nativetoken.c b/interfaces/innerkits/nativetoken/src/nativetoken.c index 51fe8fcf1..3dd4c8b3c 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken.c @@ -21,8 +21,6 @@ #include #include #include -// #include "bits/errno.h" -// #include "bits/fcntl.h" #include "errno.h" #include "fcntl.h" #include "securec.h" -- Gitee From 71b5a660920c3b0cc6e402faf94d431207951426 Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Thu, 14 Jul 2022 22:40:06 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/privacy/src/permission_used_result_parcel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/privacy/src/permission_used_result_parcel.cpp b/frameworks/privacy/src/permission_used_result_parcel.cpp index 33ca0e491..32b40d747 100644 --- a/frameworks/privacy/src/permission_used_result_parcel.cpp +++ b/frameworks/privacy/src/permission_used_result_parcel.cpp @@ -15,8 +15,8 @@ #include "permission_used_result_parcel.h" #include "bundle_used_record_parcel.h" -#include "parcel_utils.h" #include "refbase.h" +#include "parcel_utils.h" namespace OHOS { namespace Security { -- Gitee From caf07626f5223aead77d3f01505045c3cc4c35af Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Fri, 15 Jul 2022 09:44:33 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/accesstoken/src/hap_policy_parcel.cpp | 2 +- frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp | 2 +- .../accesstoken/src/native_token_info_for_sync_parcel.cpp | 2 +- frameworks/privacy/src/bundle_used_record_parcel.cpp | 2 +- frameworks/privacy/src/permission_used_record_parcel.cpp | 2 +- frameworks/privacy/src/permission_used_result_parcel.cpp | 2 +- interfaces/innerkits/nativetoken/src/nativetoken.c | 2 +- interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frameworks/accesstoken/src/hap_policy_parcel.cpp b/frameworks/accesstoken/src/hap_policy_parcel.cpp index 9a3fb12b3..a437e4614 100644 --- a/frameworks/accesstoken/src/hap_policy_parcel.cpp +++ b/frameworks/accesstoken/src/hap_policy_parcel.cpp @@ -14,9 +14,9 @@ */ #include "hap_policy_parcel.h" -#include "parcel_utils.h" #include "refbase.h" #include "access_token.h" +#include "parcel_utils.h" #include "permission_def.h" #include "permission_def_parcel.h" #include "permission_state_full.h" diff --git a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp index c9a7bf9d2..17b04b3a5 100644 --- a/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/hap_token_info_for_sync_parcel.cpp @@ -14,9 +14,9 @@ */ #include "hap_token_info_for_sync_parcel.h" -#include "parcel_utils.h" #include "refbase.h" #include "hap_token_info_parcel.h" +#include "parcel_utils.h" #include "permission_state_full.h" #include "permission_state_full_parcel.h" diff --git a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp index 67608e4ff..6b0f65ed6 100644 --- a/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_for_sync_parcel.cpp @@ -14,9 +14,9 @@ */ #include "native_token_info_for_sync_parcel.h" -#include "parcel_utils.h" #include "refbase.h" #include "native_token_info_parcel.h" +#include "parcel_utils.h" #include "permission_state_full.h" #include "permission_state_full_parcel.h" diff --git a/frameworks/privacy/src/bundle_used_record_parcel.cpp b/frameworks/privacy/src/bundle_used_record_parcel.cpp index 7bff90b61..529c386e1 100644 --- a/frameworks/privacy/src/bundle_used_record_parcel.cpp +++ b/frameworks/privacy/src/bundle_used_record_parcel.cpp @@ -14,8 +14,8 @@ */ #include "bundle_used_record_parcel.h" -#include "parcel_utils.h" #include "refbase.h" +#include "parcel_utils.h" #include "permission_used_record_parcel.h" namespace OHOS { diff --git a/frameworks/privacy/src/permission_used_record_parcel.cpp b/frameworks/privacy/src/permission_used_record_parcel.cpp index 1b01aee57..135e4a918 100644 --- a/frameworks/privacy/src/permission_used_record_parcel.cpp +++ b/frameworks/privacy/src/permission_used_record_parcel.cpp @@ -14,8 +14,8 @@ */ #include "permission_used_record_parcel.h" -#include "parcel_utils.h" #include "refbase.h" +#include "parcel_utils.h" #include "used_record_detail_parcel.h" namespace OHOS { diff --git a/frameworks/privacy/src/permission_used_result_parcel.cpp b/frameworks/privacy/src/permission_used_result_parcel.cpp index 32b40d747..8dec895ab 100644 --- a/frameworks/privacy/src/permission_used_result_parcel.cpp +++ b/frameworks/privacy/src/permission_used_result_parcel.cpp @@ -14,8 +14,8 @@ */ #include "permission_used_result_parcel.h" -#include "bundle_used_record_parcel.h" #include "refbase.h" +#include "bundle_used_record_parcel.h" #include "parcel_utils.h" namespace OHOS { diff --git a/interfaces/innerkits/nativetoken/src/nativetoken.c b/interfaces/innerkits/nativetoken/src/nativetoken.c index 3dd4c8b3c..98a319aee 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken.c @@ -23,9 +23,9 @@ #include #include "errno.h" #include "fcntl.h" -#include "securec.h" #include "sys/stat.h" #include "unistd.h" +#include "securec.h" #include "nativetoken_json_oper.h" #include "nativetoken_kit.h" #include "nativetoken_log.h" diff --git a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c index 189483fe9..25062d1b7 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken_json_oper.c @@ -13,9 +13,9 @@ * limitations under the License. */ #include "nativetoken_json_oper.h" -#include #include #include +#include #include "nativetoken_log.h" void FreeStrArray(char **arr, int32_t num) -- Gitee From 64588d3f3e8c8fadcfb9bf40397ab3229586c13d Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Fri, 15 Jul 2022 10:03:13 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- interfaces/innerkits/nativetoken/src/nativetoken.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces/innerkits/nativetoken/src/nativetoken.c b/interfaces/innerkits/nativetoken/src/nativetoken.c index 98a319aee..8a58d5fb5 100644 --- a/interfaces/innerkits/nativetoken/src/nativetoken.c +++ b/interfaces/innerkits/nativetoken/src/nativetoken.c @@ -18,13 +18,13 @@ #include #endif // WITH_SELINUX +#include +#include #include #include #include -#include "errno.h" -#include "fcntl.h" -#include "sys/stat.h" -#include "unistd.h" +#include +#include #include "securec.h" #include "nativetoken_json_oper.h" #include "nativetoken_kit.h" -- Gitee From 9dd23116d3f59e6f8a5d018394153f6a53cc96b4 Mon Sep 17 00:00:00 2001 From: cc_ggboy Date: Fri, 15 Jul 2022 10:09:48 +0800 Subject: [PATCH 12/12] =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=95=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cc_ggboy --- frameworks/accesstoken/src/native_token_info_parcel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/accesstoken/src/native_token_info_parcel.cpp b/frameworks/accesstoken/src/native_token_info_parcel.cpp index 92b906618..d48c7fbd8 100644 --- a/frameworks/accesstoken/src/native_token_info_parcel.cpp +++ b/frameworks/accesstoken/src/native_token_info_parcel.cpp @@ -18,8 +18,8 @@ #include #include #include -#include "parcel_utils.h" #include "access_token.h" +#include "parcel_utils.h" namespace OHOS { namespace Security { -- Gitee