diff --git a/laphone/bundle.json b/laphone/bundle.json index eb004970816aee7caf2462ebe03e8078d211d560..dd4b895a67df2b48c085e209eeca4ce255a5297e 100644 --- a/laphone/bundle.json +++ b/laphone/bundle.json @@ -86,7 +86,8 @@ "//vendor/hys/laphone/camera/npi/v4l2camera:camv4l2adapter", "//vendor/hys/laphone/camera/npi/v4l2camera:v4l2camera", "//vendor/hys/laphone/camera/npi/v4l2camera:dual-cam", - "//vendor/hys/laphone/hdf_config/uhdf:hdf_config" + "//vendor/hys/laphone/hdf_config/uhdf:hdf_config", + "//vendor/hys/laphone/log_catcher:service" ], "test": [] } diff --git a/laphone/log_catcher/BUILD.gn b/laphone/log_catcher/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..56fa594392139fd5d1418a2bad6a182a3f32f85c --- /dev/null +++ b/laphone/log_catcher/BUILD.gn @@ -0,0 +1,24 @@ +# Copyright (c) 2021 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. + +import("//build/ohos.gni") + +group("service") { + deps = [ + "libs:log_catcher_client_main", + "libs:logcatcherservice", + "libs:logcatcher", + "etc:log_catcher_service.rc", + "etc:log_catcher_service_sa_profile" + ] +} diff --git a/laphone/log_catcher/etc/1299.json b/laphone/log_catcher/etc/1299.json new file mode 100644 index 0000000000000000000000000000000000000000..ce40d57a8462d24e7955d42237eb06f88cff3a23 --- /dev/null +++ b/laphone/log_catcher/etc/1299.json @@ -0,0 +1,12 @@ +{ + "process": "log_catcher_service", + "systemability": [ + { + "name": 1299, + "libpath": "liblogcatcherservice.z.so", + "run-on-create": false, + "distributed": false, + "dump_level": 1 + } + ] +} \ No newline at end of file diff --git a/laphone/log_catcher/etc/BUILD.gn b/laphone/log_catcher/etc/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..db2afa93fd885f2974630df47164c17cb069f5f5 --- /dev/null +++ b/laphone/log_catcher/etc/BUILD.gn @@ -0,0 +1,28 @@ +# Copyright (c) 2021 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. + +import("//build/ohos.gni") +import("//build/ohos/sa_profile/sa_profile.gni") + +ohos_sa_profile("log_catcher_service_sa_profile") { + sources = [ "1299.json" ] + part_name = "product_laphone" +} + +ohos_prebuilt_etc("log_catcher_service.rc") { + source = "log_catcher_service.cfg" + + relative_install_dir = "init" + + part_name = "product_laphone" +} \ No newline at end of file diff --git a/laphone/log_catcher/etc/log_catcher_service.cfg b/laphone/log_catcher/etc/log_catcher_service.cfg new file mode 100644 index 0000000000000000000000000000000000000000..251a2d33aea474bb6f713ef042e22c930ad6e6e2 --- /dev/null +++ b/laphone/log_catcher/etc/log_catcher_service.cfg @@ -0,0 +1,12 @@ +{ + "services" : [{ + "name" : "log_catcher_service", + "path" : ["/system/bin/sa_main", "/system/profile/log_catcher_service.json"], + "uid" : "root", + "gid" : ["root", "system", "appspawn", "shell", "log", "access_token", "console"], + "apl" : "system_basic", + "secon" : "u:r:log_catcher_service:s0", + "ondemand" : true + } + ] +} diff --git a/laphone/log_catcher/libs/BUILD.gn b/laphone/log_catcher/libs/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..2bc330504d59cf6520e243c7f8c4c69444934438 --- /dev/null +++ b/laphone/log_catcher/libs/BUILD.gn @@ -0,0 +1,32 @@ +import("//build/ohos.gni") + +ohos_prebuilt_shared_library("log_catcher_client_main") { + source = "./liblog_catcher_client_main.z.so" + install_images = [ system_base_dir ] + + install_enable = true + + part_name = "product_laphone" + subsystem_name = "product_laphone" +} + +ohos_prebuilt_shared_library("logcatcherservice") { + source = "./liblogcatcherservice.z.so" + install_images = [ system_base_dir ] + + install_enable = true + + part_name = "product_laphone" + subsystem_name = "product_laphone" +} + +ohos_prebuilt_shared_library("logcatcher") { + source = "./liblogcatcher.z.so" + install_images = [ system_base_dir ] + + relative_install_dir = "module" + install_enable = true + + part_name = "product_laphone" + subsystem_name = "product_laphone" +} \ No newline at end of file diff --git a/laphone/log_catcher/libs/liblog_catcher_client_main.z.so b/laphone/log_catcher/libs/liblog_catcher_client_main.z.so new file mode 100644 index 0000000000000000000000000000000000000000..7508938be92d40b2166499921807d0daa7b815e6 Binary files /dev/null and b/laphone/log_catcher/libs/liblog_catcher_client_main.z.so differ diff --git a/laphone/log_catcher/libs/liblogcatcher.z.so b/laphone/log_catcher/libs/liblogcatcher.z.so new file mode 100644 index 0000000000000000000000000000000000000000..0f8e87b399c2b3009c6fe277790959fb29bc832e Binary files /dev/null and b/laphone/log_catcher/libs/liblogcatcher.z.so differ diff --git a/laphone/log_catcher/libs/liblogcatcherservice.z.so b/laphone/log_catcher/libs/liblogcatcherservice.z.so new file mode 100644 index 0000000000000000000000000000000000000000..7530fd7af9d5268a42a137511f947e0acd4dc6be Binary files /dev/null and b/laphone/log_catcher/libs/liblogcatcherservice.z.so differ diff --git a/laphone/security_config/high_privilege_process_list.json b/laphone/security_config/high_privilege_process_list.json index 0fe7964b73d9c5afa064410867ef56d5384f54b5..36548dea29f1a0ff92b798577552da2e853471b4 100644 --- a/laphone/security_config/high_privilege_process_list.json +++ b/laphone/security_config/high_privilege_process_list.json @@ -88,6 +88,11 @@ "name": "key_enable", "uid": "root", "gid": "root" + }, + { + "name": "log_catcher_service", + "uid": "root", + "gid": "root" } ] } \ No newline at end of file