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 const std::vector<std::string> FULL_BUNDLE_EL = {DIR_EL1, DIR_EL2, DIR_EL3, DIR_EL4, DIR_EL5}; 44 constexpr const char* ARM_EABI = "armeabi"; 45 constexpr const char* ARM_EABI_V7A = "armeabi-v7a"; 46 constexpr const char* ARM64_V8A = "arm64-v8a"; 47 constexpr const char* ARM64 = "arm64"; 48 constexpr const char* X86 = "x86"; 49 constexpr const char* X86_64 = "x86_64"; 50 const std::map<std::string, std::string> ABI_MAP = { 51 {ARM_EABI, "arm"}, 52 {ARM_EABI_V7A, "arm"}, 53 {ARM64_V8A, "arm64"}, 54 {X86, "x86"}, 55 {X86_64, "x86_64"}, 56 }; 57 const std::string CLONE_BUNDLE_PREFIX = "clone_"; 58 constexpr const char* UNINSTALL_TMP_PREFIX = "=uninstall_tmp_"; 59 constexpr const char* INSTALL_FILE_SUFFIX = ".hap"; 60 constexpr const char* HSP_FILE_SUFFIX = ".hsp"; 61 constexpr const char* QUICK_FIX_FILE_SUFFIX = ".hqf"; 62 const char FILE_SEPARATOR_CHAR = '/'; 63 constexpr const char* CURRENT_DEVICE_ID = "PHONE-001"; 64 constexpr const char* HAP_COPY_PATH = "/data/service/el1/public/bms/bundle_manager_service"; 65 constexpr const char* TMP_SUFFIX = "_tmp"; 66 constexpr const char* BUNDLE_APP_DATA_BASE_DIR = "/data/app/"; 67 constexpr const char* BASE = "/base/"; 68 constexpr const char* CLONE = "clone"; 69 constexpr const char* PLUS_SIGN = "+"; 70 constexpr const char* MINUS_SIGN = "-"; 71 constexpr const char* DATABASE = "/database/"; 72 constexpr const char* LOG = "/log/"; 73 constexpr const char* HAPS = "/haps/"; 74 constexpr const char* EXTENSION_DIR = "+extension-"; 75 constexpr const char* FILE_SEPARATOR_LINE = "-"; 76 constexpr const char* FILE_SEPARATOR_PLUS = "+"; 77 constexpr const char* BUNDLE_MANAGER_SERVICE_PATH = "/data/service/el1/public/bms/bundle_manager_service"; 78 constexpr const char* SANDBOX_DATA_PATH = "/data/storage/el2/base"; 79 constexpr const char* APP_INSTALL_SANDBOX_PATH = "/data/bms_app_install"; 80 constexpr const char* REAL_DATA_PATH = "/data/app/el2"; 81 constexpr const char* DATA_GROUP_PATH = "/group/"; 82 constexpr const char* STREAM_INSTALL_PATH = "stream_install"; 83 constexpr const char* SECURITY_STREAM_INSTALL_PATH = "security_stream_install"; 84 constexpr const char* QUICK_FIX_PATH = "quick_fix"; 85 constexpr const char* SECURITY_QUICK_FIX_PATH = "security_quick_fix"; 86 constexpr const char* BUNDLE_ASAN_LOG_DIR = "/data/local/app-logs"; 87 constexpr const char* SCREEN_LOCK_FILE_DATA_PATH = "/data/app/el5"; 88 constexpr const char* GALLERY_DOWNLOAD_PATH = "/app_install/"; 89 constexpr int NOT_EXIST_USERID = -5; 90 constexpr int PATH_MAX_SIZE = 256; 91 constexpr int32_t API_VERSION_NINE = 9; 92 constexpr int32_t API_VERSION_TWELVE = 12; 93 constexpr int32_t BACKUP_DEFAULT_APP_KEY = -2; 94 // native so 95 constexpr const char* ABI_DEFAULT = "default"; 96 constexpr const char* ABI_SEPARATOR = ","; 97 constexpr const char* MODULE_NAME_SEPARATOR = ","; 98 constexpr const char* AN_SUFFIX = ".an"; 99 constexpr const char* AP_SUFFIX = ".ap"; 100 constexpr const char* SYSTEM_LIB64 = "/system/lib64"; 101 constexpr const char* PATCH_PATH = "patch_"; 102 constexpr const char* HOT_RELOAD_PATH = "hotreload_"; 103 // uid and gid 104 constexpr int32_t BMS_UID = 1000; 105 constexpr int32_t SHELL_UID = 2000; 106 constexpr int32_t BACKU_HOME_GID = 1089; 107 constexpr int32_t ACCOUNT_UID = 3058; 108 constexpr int32_t BMS_GID = 1000; 109 constexpr int32_t DATABASE_DIR_GID = 3012; 110 constexpr int32_t DFS_GID = 1009; 111 constexpr int32_t LOG_DIR_GID = 1007; 112 constexpr int32_t APP_INSTALL_GID = 2002; 113 // permissions 114 constexpr const char* PERMISSION_INSTALL_ENTERPRISE_BUNDLE = "ohos.permission.INSTALL_ENTERPRISE_BUNDLE"; 115 constexpr const char* PERMISSION_INSTALL_ENTERPRISE_NORMAL_BUNDLE = "ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE"; 116 constexpr const char* PERMISSION_INSTALL_ENTERPRISE_MDM_BUNDLE = "ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE"; 117 constexpr const char* PERMISSION_INSTALL_INTERNALTESTING_BUNDLE = "ohos.permission.INSTALL_INTERNALTESTING_BUNDLE"; 118 constexpr const char* PERMISSION_MANAGE_DISPOSED_APP_STATUS = "ohos.permission.MANAGE_DISPOSED_APP_STATUS"; 119 constexpr const char* PERMISSION_INSTALL_SELF_BUNDLE = "ohos.permission.INSTALL_SELF_BUNDLE"; 120 constexpr const char* PERMISSION_UNINSTALL_BUNDLE = "ohos.permission.UNINSTALL_BUNDLE"; 121 constexpr const char* PERMISSION_RECOVER_BUNDLE = "ohos.permission.RECOVER_BUNDLE"; 122 constexpr const char* PERMISSION_GET_BUNDLE_RESOURCES = "ohos.permission.GET_BUNDLE_RESOURCES"; 123 constexpr const char* PERMISSION_INSTALL_SANDBOX_BUNDLE = "ohos.permission.INSTALL_SANDBOX_BUNDLE"; 124 constexpr const char* PERMISSION_UNINSTALL_SANDBOX_BUNDLE = "ohos.permission.UNINSTALL_SANDBOX_BUNDLE"; 125 constexpr const char* PERMISSION_INSTALL_QUICK_FIX_BUNDLE = "ohos.permission.INSTALL_QUICK_FIX_BUNDLE"; 126 constexpr const char* PERMISSION_UNINSTALL_QUICK_FIX_BUNDLE = "ohos.permission.UNINSTALL_QUICK_FIX_BUNDLE"; 127 constexpr const char* PERMISSION_CHANGE_BUNDLE_UNINSTALL_STATE = "ohos.permission.CHANGE_BUNDLE_UNINSTALL_STATE"; 128 constexpr const char* PERMISSION_PROTECT_SCREEN_LOCK_DATA = "ohos.permission.PROTECT_SCREEN_LOCK_DATA"; 129 130 constexpr const char* FLAG_HOME_INTENT_FROM_SYSTEM = "flag.home.intent.from.system"; 131 // max number of haps under one direction 132 constexpr uint8_t MAX_HAP_NUMBER = 128; 133 constexpr const char* DATA_ABILITY_URI_PREFIX = "dataability://"; 134 // appFeature 135 constexpr const char* HOS_SYSTEM_APP = "hos_system_app"; 136 // rdb 137 constexpr const char* BUNDLE_RDB_NAME = "/bmsdb.db"; 138 // thread pool 139 constexpr const char* RELATIVE_PATH = "../"; 140 // app detail ability 141 constexpr const char* APP_DETAIL_ABILITY = "AppDetailAbility"; 142 // overlay installation 143 constexpr int32_t DEFAULT_OVERLAY_ENABLE_STATUS = 1; 144 constexpr int32_t DEFAULT_OVERLAY_DISABLE_STATUS = 0; 145 constexpr int32_t OVERLAY_MINIMUM_PRIORITY = 1; 146 // ark compile mode 147 constexpr const char* COMPILE_PARTIAL = "partial"; 148 constexpr const char* ARK_CACHE_PATH = "/data/local/ark-cache/"; 149 constexpr const char* ARK_PROFILE_PATH = "/data/local/ark-profile/"; 150 // code signature 151 constexpr const char* CODE_SIGNATURE_FILE_SUFFIX = ".sig"; 152 constexpr const char* CODE_SIGNATURE_HAP = "Hap"; 153 constexpr const char* SIGNATURE_FILE_PATH = "signature_files"; 154 constexpr const char* SECURITY_SIGNATURE_FILE_PATH = "security_signature_files"; 155 //pgo file 156 constexpr const char* PGO_FILE_SUFFIX = ".ap"; 157 // system param 158 constexpr const char* ALLOW_ENTERPRISE_BUNDLE = "const.bms.allowenterprisebundle"; 159 constexpr const char* IS_ENTERPRISE_DEVICE = "const.edm.is_enterprise_device"; 160 constexpr const char* DEVELOPERMODE_STATE = "const.security.developermode.state"; 161 //extResource 162 constexpr const char* EXT_RESOURCE_FILE_PATH = "ext_resource"; 163 // hmdfs and sharefs config 164 constexpr const char* HMDFS_CONFIG_PATH = "/config/hmdfs/"; 165 constexpr const char* SHAREFS_CONFIG_PATH = "/config/sharefs/"; 166 constexpr const char* SYSTEM_SERVICE_DIR = "/data/service/el1/public"; 167 constexpr const char* SYSTEM_UI_BUNDLE_NAME = "com.ohos.systemui"; 168 constexpr const char* LAUNCHER_BUNDLE_NAME = "com.ohos.launcher"; 169 // clone application 170 constexpr int32_t CLONE_APP_INDEX_MIN = 1; 171 constexpr int32_t CLONE_APP_INDEX_MAX = 5; 172 // shader 173 constexpr const char* SHADER_CACHE_PATH = "/data/local/shader_cache/local/"; 174 constexpr const char* CLOUD_SHADER_PATH = "/data/local/shader_cache/cloud/"; 175 constexpr const char* CLOUD_SHADER_OWNER = "const.appgallery.shaderowner.bundlename"; 176 // apiReleaseType 177 const std::string API_RELEASE_TYPE_RELEASE = "Release"; 178 const std::string API_RELEASE_TYPE_BETA = "Beta"; 179 const std::string API_RELEASE_TYPE_CANARY = "Canary"; 180 // allow multi icon bundle 181 const std::set<std::string> ALLOW_MULTI_ICON_BUNDLE = { 182 "com.ohos.contacts" 183 }; 184 constexpr const char* CALLER_NAME_BMS = "bms"; 185 // group 186 constexpr int16_t DATA_GROUP_DIR_MODE = 02770; 187 //install source 188 constexpr const char* INSTALL_SOURCE_PREINSTALL = "pre-installed"; 189 constexpr const char* INSTALL_SOURCE_OTA = "ota"; 190 constexpr const char* INSTALL_SOURCE_RECOVERY = "recovery"; 191 192 // app temp path 193 constexpr const char* BMS_APP_TEMP_PATH = "/data/service/el1/public/bms/bundle_manager_service/app_temp"; 194 } // namespace ServiceConstants 195 } // namespace AppExecFwk 196 } // namespace OHOS 197 #endif // FOUNDATION_APPEXECFWK_SERVICES_BUNDLEMGR_INCLUDE_BUNDLE_SERVICE_CONSTANTS_H