diff --git a/services/privacymanager/BUILD.gn b/services/privacymanager/BUILD.gn index cd04e2fd750d703d7784d374ba4bb6e8fa3dfeae..5a98012890bd6944f6f56f046038ce0e0e432b02 100644 --- a/services/privacymanager/BUILD.gn +++ b/services/privacymanager/BUILD.gn @@ -13,6 +13,13 @@ import("//build/ohos.gni") +ohos_prebuilt_etc("privacy.rc") { + source = "privacy.cfg" + relative_install_dir = "init" + subsystem_name = "security" + part_name = "access_token" +} + ohos_shared_library("privacy_manager_service") { subsystem_name = "security" part_name = "access_token" @@ -54,6 +61,7 @@ ohos_shared_library("privacy_manager_service") { "//base/security/access_token/frameworks/privacy:privacy_communication_adapter_cxx", "//base/security/access_token/interfaces/innerkits/accesstoken:libaccesstoken_sdk", "//base/security/access_token/services/common/database:accesstoken_database_cxx", + "//base/security/access_token/services/privacymanager:privacy.rc", "//third_party/sqlite:sqlite", "//utils/native/base:utils", ] diff --git a/services/privacymanager/privacy.cfg b/services/privacymanager/privacy.cfg new file mode 100644 index 0000000000000000000000000000000000000000..30d01427cab02273c043be171670f6ce81a61aa6 --- /dev/null +++ b/services/privacymanager/privacy.cfg @@ -0,0 +1,11 @@ +{ + "services" : [{ + "name" : "privacy_service", + "path" : ["/system/bin/sa_main", "/system/profile/privacy_service.xml"], + "importance" : -20, + "uid" : "access_token", + "gid" : ["access_token"], + "secon" : "u:r:privacy_service:s0" + } + ] +} diff --git a/services/privacymanager/privacy.rc b/services/privacymanager/privacy.rc new file mode 100644 index 0000000000000000000000000000000000000000..9757637549b395e7ba088daf158e5a75af787ebc --- /dev/null +++ b/services/privacymanager/privacy.rc @@ -0,0 +1,22 @@ +# 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. + +on late-fs + start privacy_service + +service privacy_service /system/bin/sa_main /system/profile/privacy_service.xml + class privacy_service + priority -20 + user access_token + group access_token + seclabel u:r:privacy_service:s0 diff --git a/services/privacymanager/sa_profile/3505.xml b/services/privacymanager/sa_profile/3505.xml index f6aecb62e88d21ef7cddcdd6c431966068270c62..60b5eae50adee6518181101826cda8b7f4b6e8a3 100644 --- a/services/privacymanager/sa_profile/3505.xml +++ b/services/privacymanager/sa_profile/3505.xml @@ -13,7 +13,7 @@ limitations under the License. --> - accesstoken_service + privacy_service 3505 libprivacy_manager_service.z.so