From 4d9863a83688ebcd5cc55a3dd707ce0049b9baae Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 11 Jul 2022 15:58:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?privacy=E7=8B=AC=E7=AB=8B=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- services/privacymanager/BUILD.gn | 7 +++++++ services/privacymanager/privacy.cfg | 19 ++++++++++++++++++ services/privacymanager/privacy.rc | 22 +++++++++++++++++++++ services/privacymanager/sa_profile/3505.xml | 2 +- 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 services/privacymanager/privacy.cfg create mode 100644 services/privacymanager/privacy.rc diff --git a/services/privacymanager/BUILD.gn b/services/privacymanager/BUILD.gn index 1a83e6a97..cbca2a8d4 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" diff --git a/services/privacymanager/privacy.cfg b/services/privacymanager/privacy.cfg new file mode 100644 index 000000000..3e9afdbc6 --- /dev/null +++ b/services/privacymanager/privacy.cfg @@ -0,0 +1,19 @@ +{ + "jobs" : [{ + "name" : "pre-init", + "cmds" : [ + "mkdir /data/service/el0/access_token 0750 root access_token", + "load_access_token_id " + ] + } + ], + "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 000000000..975763754 --- /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 af310ef90..6ccdf9775 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 -- Gitee From 504b14060646f30a2d4e5a816bc4ce2a7d44997f Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 11 Jul 2022 16:27:35 +0800 Subject: [PATCH 2/3] =?UTF-8?q?privacy=E7=8B=AC=E7=AB=8B=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- services/privacymanager/privacy.cfg | 8 -------- 1 file changed, 8 deletions(-) diff --git a/services/privacymanager/privacy.cfg b/services/privacymanager/privacy.cfg index 3e9afdbc6..30d01427c 100644 --- a/services/privacymanager/privacy.cfg +++ b/services/privacymanager/privacy.cfg @@ -1,12 +1,4 @@ { - "jobs" : [{ - "name" : "pre-init", - "cmds" : [ - "mkdir /data/service/el0/access_token 0750 root access_token", - "load_access_token_id " - ] - } - ], "services" : [{ "name" : "privacy_service", "path" : ["/system/bin/sa_main", "/system/profile/privacy_service.xml"], -- Gitee From b506224843073cbff1e152b810626e4e65f598d4 Mon Sep 17 00:00:00 2001 From: chennian Date: Mon, 11 Jul 2022 17:36:35 +0800 Subject: [PATCH 3/3] =?UTF-8?q?privacy=E7=8B=AC=E7=AB=8B=E8=BF=9B=E7=A8=8B?= =?UTF-8?q?=20Signed-off-by:chennian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chennian --- services/privacymanager/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/services/privacymanager/BUILD.gn b/services/privacymanager/BUILD.gn index cbca2a8d4..f6fc271d3 100644 --- a/services/privacymanager/BUILD.gn +++ b/services/privacymanager/BUILD.gn @@ -61,6 +61,7 @@ ohos_shared_library("privacy_manager_service") { "//base/security/access_token/frameworks/database:accesstoken_database_cxx", "//base/security/access_token/frameworks/privacy:privacy_communication_adapter_cxx", "//base/security/access_token/interfaces/innerkits/accesstoken:libaccesstoken_sdk", + "//base/security/access_token/services/privacymanager:privacy.rc", "//third_party/sqlite:sqlite", "//utils/native/base:utils", ] -- Gitee