1 /* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_SERVICE_CONSTANTS_H 17 #define FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_SERVICE_CONSTANTS_H 18 19 #include <map> 20 #include <set> 21 #include <string> 22 #include <vector> 23 24 namespace OHOS { 25 namespace AppExecFwk { 26 namespace ServiceConstants { 27 constexpr const char* ASSETS_DIR = "assets"; 28 constexpr const char* RESOURCES_INDEX = "resources.index"; 29 constexpr int32_t INVALID_GID = -1; 30 const int32_t BUNDLE_RDB_VERSION = 1; 31 const std::string PATH_SEPARATOR = "/"; 32 const std::string LIBS = "libs/"; 33 const std::string AN = "an/"; 34 const std::string RES_FILE_PATH = "resources/resfile/"; 35 const std::string HNPS_FILE_PATH = "hnp_tmp_extract_dir/"; 36 const std::string HNPS = "hnp/"; 37 constexpr const char* DIR_EL1 = "el1"; 38 constexpr const char* DIR_EL2 = "el2"; 39 constexpr const char* DIR_EL3 = "el3"; 40 constexpr const char* DIR_EL4 = "el4"; 41 constexpr const char* DIR_EL5 = "el5"; 42 const std::vector<std::string> BUNDLE_EL = {DIR_EL1, DIR_EL2, DIR_EL3, DIR_EL4}; 43 constexpr const char* ARM_EABI = "armeabi"; 44 constexpr const char* ARM_EABI_V7A = "armeabi-v7a"; 45 constexpr const char* ARM64_V8A = "arm64-v8a"; 46 constexpr const char* ARM64 = "arm64"; 47 constexpr const char* X86 = "x86"; 48 constexpr const char* X86_64 = "x86_64"; 49 const std::map<std::string, std::string> ABI_MAP = { 50 {ARM_EABI, "arm"}, 51 {ARM_EABI_V7A, "arm"}, 52 {ARM64_V8A, "arm64"}, 53 {X86, "x86"}, 54 {X86_64, "x86_64"}, 55 }; 56 const std::string CLONE_BUNDLE_PREFIX = "clone_"; 57 constexpr const char* UNINSTALL_TMP_PREFIX = "=uninstall_tmp_"; 58 constexpr const char* INSTALL_FILE_SUFFIX = ".hap"; 59 constexpr const char* HSP_FILE_SUFFIX = ".hsp"; 60 constexpr const char* QUICK_FIX_FILE_SUFFIX = ".hqf"; 61 const char FILE_SEPARATOR_CHAR = '/'; 62 constexpr const char* CURRENT_DEVICE_ID = "PHONE-001"; 63 constexpr const char* HAP_COPY_PATH = "/data/service/el1/public/bms/bundle_manager_service"; 64 constexpr const char* TMP_SUFFIX = "_tmp"; 65 constexpr const char* BUNDLE_APP_DATA_BASE_DIR = "/data/app/"; 66 constexpr const char* BASE = "/base/"; 67 constexpr const char* CLONE = "clone"; 68 constexpr const char* PLUS_SIGN = "+"; 69 constexpr const char* MINUS_SIGN = "-"; 70 constexpr const char* DATABASE = "/database/"; 71 constexpr const char* LOG = "/log/"; 72 constexpr const char* HAPS = "/haps/"; 73 constexpr const char* EXTENSION_DIR = "+extension-"; 74 constexpr const char* FILE_SEPARATOR_LINE = "-"; 75 constexpr const char* FILE_SEPARATOR_PLUS = "+"; 76 constexpr const char* BUNDLE_MANAGER_SERVICE_PATH = "/data/service/el1/public/bms/bundle_manager_service"; 77 constexpr const char* SANDBOX_DATA_PATH = "/data/storage/el2/base"; 78 constexpr const char* REAL_DATA_PATH = "/data/app/el2"; 79 constexpr const char* DATA_GROUP_PATH = "/group/"; 80 constexpr const char* STREAM_INSTALL_PATH = "stream_install"; 81 constexpr const char* SECURITY_STREAM_INSTALL_PATH = "security_stream_install"; 82 constexpr const char* QUICK_FIX_PATH = "quick_fix"; 83 constexpr const char* SECURITY_QUICK_FIX_PATH = "security_quick_fix"; 84 constexpr const char* BUNDLE_ASAN_LOG_DIR = "/data/local/app-logs"; 85 constexpr const char* SCREEN_LOCK_FILE_DATA_PATH = "/data/app/el5"; 86 constexpr int NOT_EXIST_USERID = -5; 87 constexpr int PATH_MAX_SIZE = 256; 88 constexpr int32_t API_VERSION_NINE = 9; 89 constexpr int32_t API_VERSION_TWELVE = 12; 90 constexpr int32_t BACKUP_DEFAULT_APP_KEY = -2; 91 // native so 92 constexpr const char* ABI_DEFAULT = "default"; 93 constexpr const char* ABI_SEPARATOR = ","; 94 constexpr const char* MODULE_NAME_SEPARATOR = ","; 95 constexpr const char* AN_SUFFIX = ".an"; 96 constexpr const char* AP_SUFFIX = ".ap"; 97 constexpr const char* SYSTEM_LIB64 = "/system/lib64"; 98 constexpr const char* PATCH_PATH = "patch_"; 99 constexpr const char* HOT_RELOAD_PATH = "hotreload_"; 100 // uid and gid 101 constexpr int32_t BMS_UID = 1000; 102 constexpr int32_t SHELL_UID = 2000; 103 constexpr int32_t BACKU_HOME_GID = 1089; 104 constexpr int32_t ACCOUNT_UID = 3058; 105 constexpr int32_t BMS_GID = 1000; 106 constexpr int32_t DATABASE_DIR_GID = 3012; 107 constexpr int32_t DFS_GID = 1009; 108 constexpr int32_t LOG_DIR_GID = 1007; 109 // permissions 110 constexpr const char* PERMISSION_INSTALL_ENTERPRISE_BUNDLE = "ohos.permission.INSTALL_ENTERPRISE_BUNDLE"; 111 constexpr const char* PERMISSION_INSTALL_ENTERPRISE_NORMAL_BUNDLE = "ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE"; 112 constexpr const char* PERMISSION_INSTALL_ENTERPRISE_MDM_BUNDLE = "ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE"; 113 constexpr const char* PERMISSION_MANAGE_DISPOSED_APP_STATUS = "ohos.permission.MANAGE_DISPOSED_APP_STATUS"; 114 constexpr const char* PERMISSION_INSTALL_SELF_BUNDLE = "ohos.permission.INSTALL_SELF_BUNDLE"; 115 constexpr const char* PERMISSION_UNINSTALL_BUNDLE = "ohos.permission.UNINSTALL_BUNDLE"; 116 constexpr const char* PERMISSION_RECOVER_BUNDLE = "ohos.permission.RECOVER_BUNDLE"; 117 constexpr const char* PERMISSION_GET_BUNDLE_RESOURCES = "ohos.permission.GET_BUNDLE_RESOURCES"; 118 constexpr const char* PERMISSION_INSTALL_SANDBOX_BUNDLE = "ohos.permission.INSTALL_SANDBOX_BUNDLE"; 119 constexpr const char* PERMISSION_UNINSTALL_SANDBOX_BUNDLE = "ohos.permission.UNINSTALL_SANDBOX_BUNDLE"; 120 constexpr const char* PERMISSION_INSTALL_QUICK_FIX_BUNDLE = "ohos.permission.INSTALL_QUICK_FIX_BUNDLE"; 121 constexpr const char* PERMISSION_UNINSTALL_QUICK_FIX_BUNDLE = "ohos.permission.UNINSTALL_QUICK_FIX_BUNDLE"; 122 constexpr const char* PERMISSION_CHANGE_BUNDLE_UNINSTALL_STATE = "ohos.permission.CHANGE_BUNDLE_UNINSTALL_STATE"; 123 124 constexpr const char* FLAG_HOME_INTENT_FROM_SYSTEM = "flag.home.intent.from.system"; 125 // max number of haps under one direction 126 constexpr uint8_t MAX_HAP_NUMBER = 128; 127 constexpr const char* DATA_ABILITY_URI_PREFIX = "dataability://"; 128 // appFeature 129 constexpr const char* HOS_SYSTEM_APP = "hos_system_app"; 130 // rdb 131 constexpr const char* BUNDLE_RDB_NAME = "/bmsdb.db"; 132 // thread pool 133 constexpr const char* RELATIVE_PATH = "../"; 134 // app detail ability 135 constexpr const char* APP_DETAIL_ABILITY = "AppDetailAbility"; 136 // overlay installation 137 constexpr int32_t DEFAULT_OVERLAY_ENABLE_STATUS = 1; 138 constexpr int32_t DEFAULT_OVERLAY_DISABLE_STATUS = 0; 139 constexpr int32_t OVERLAY_MINIMUM_PRIORITY = 1; 140 // ark compile mode 141 constexpr const char* COMPILE_PARTIAL = "partial"; 142 constexpr const char* ARK_CACHE_PATH = "/data/local/ark-cache/"; 143 constexpr const char* ARK_PROFILE_PATH = "/data/local/ark-profile/"; 144 // code signature 145 constexpr const char* CODE_SIGNATURE_FILE_SUFFIX = ".sig"; 146 constexpr const char* CODE_SIGNATURE_HAP = "Hap"; 147 constexpr const char* SIGNATURE_FILE_PATH = "signature_files"; 148 constexpr const char* SECURITY_SIGNATURE_FILE_PATH = "security_signature_files"; 149 //pgo file 150 constexpr const char* PGO_FILE_SUFFIX = ".ap"; 151 // system param 152 constexpr const char* ALLOW_ENTERPRISE_BUNDLE = "const.bms.allowenterprisebundle"; 153 constexpr const char* IS_ENTERPRISE_DEVICE = "const.edm.is_enterprise_device"; 154 constexpr const char* DEVELOPERMODE_STATE = "const.security.developermode.state"; 155 //extResource 156 constexpr const char* EXT_RESOURCE_FILE_PATH = "ext_resource"; 157 // hmdfs and sharefs config 158 constexpr const char* HMDFS_CONFIG_PATH = "/config/hmdfs/"; 159 constexpr const char* SHAREFS_CONFIG_PATH = "/config/sharefs/"; 160 constexpr const char* SYSTEM_SERVICE_DIR = "/data/service/el1/public"; 161 constexpr const char* SYSTEM_UI_BUNDLE_NAME = "com.ohos.systemui"; 162 constexpr const char* LAUNCHER_BUNDLE_NAME = "com.ohos.launcher"; 163 // clone application 164 constexpr int32_t CLONE_APP_INDEX_MIN = 1; 165 constexpr int32_t CLONE_APP_INDEX_MAX = 5; 166 // shader 167 constexpr const char* SHADER_CACHE_PATH = "/data/local/shader_cache/local/"; 168 constexpr const char* CLOUD_SHADER_PATH = "/data/local/shader_cache/cloud/"; 169 constexpr const char* CLOUD_SHADER_OWNER = "const.appgallery.shaderowner.bundlename"; 170 // apiReleaseType 171 const std::string API_RELEASE_TYPE_RELEASE = "Release"; 172 const std::string API_RELEASE_TYPE_BETA = "Beta"; 173 const std::string API_RELEASE_TYPE_CANARY = "Canary"; 174 // allow multi icon bundle 175 const std::set<std::string> ALLOW_MULTI_ICON_BUNDLE = { 176 "com.ohos.contacts" 177 }; 178 constexpr const char* CALLER_NAME_BMS = "bms"; 179 } // namespace ServiceConstants 180 } // namespace AppExecFwk 181 } // namespace OHOS 182 #endif // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_SERVICE_CONSTANTS_H