1/* 2 * Copyright (c) 2022 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/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import { AsyncCallback } from './@ohos.base'; 22 23/** 24 * Support install, upgrade, remove and recover bundles on the devices. 25 * 26 * @namespace installer 27 * @syscap SystemCapability.BundleManager.BundleFramework.Core 28 * @systemapi 29 * @since 9 30 */ 31declare namespace installer { 32 /** 33 * Obtains the interface used to install bundle. 34 * 35 * @param { AsyncCallback<BundleInstaller> } callback - The callback of BundleInstaller object. 36 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 37 * @throws { BusinessError } 401 - Input parameters check failed. 38 * @syscap SystemCapability.BundleManager.BundleFramework.Core 39 * @systemapi 40 * @since 9 41 */ 42 function getBundleInstaller(callback: AsyncCallback<BundleInstaller>): void; 43 44 /** 45 * Obtains the interface used to install bundle. 46 * 47 * @returns { Promise<BundleInstaller> } BundleInstaller object. 48 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 49 * @syscap SystemCapability.BundleManager.BundleFramework.Core 50 * @systemapi 51 * @since 9 52 */ 53 function getBundleInstaller(): Promise<BundleInstaller>; 54 55 /** 56 * Obtains the interface used to install bundle. 57 * 58 * @returns { BundleInstaller } BundleInstaller object. 59 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 60 * @syscap SystemCapability.BundleManager.BundleFramework.Core 61 * @systemapi 62 * @since 10 63 */ 64 function getBundleInstallerSync(): BundleInstaller; 65 66 /** 67 * Bundle installer interface, include install uninstall recover. 68 * 69 * @interface BundleInstaller 70 * @syscap SystemCapability.BundleManager.BundleFramework.Core 71 * @systemapi 72 * @since 9 73 */ 74 interface BundleInstaller { 75 /** 76 * Install haps for an application. 77 * 78 * @permission ohos.permission.INSTALL_BUNDLE 79 * @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored. 80 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 81 * @param { AsyncCallback<void> } callback - The callback of installing haps result. 82 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 83 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 84 * @throws { BusinessError } 401 - Input parameters check failed. 85 * @throws { BusinessError } 17700004 - The specified user ID is not found. 86 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 87 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 88 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 89 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 90 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 91 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 92 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 93 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 94 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 95 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 96 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 97 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 98 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 99 * (required APL: system_basic or system_core). 100 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 101 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 102 * @syscap SystemCapability.BundleManager.BundleFramework.Core 103 * @systemapi 104 * @since 9 105 */ 106 /** 107 * Install HAPs for an application. 108 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 109 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 110 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 111 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 112 * 113 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE 114 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 115 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 116 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 117 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 118 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 119 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 120 * @throws { BusinessError } 401 - Input parameters check failed. 121 * @throws { BusinessError } 17700004 - The specified user ID is not found. 122 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 123 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 124 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 125 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 126 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 127 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 128 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 129 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 130 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 131 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 132 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 133 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 134 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 135 * (required APL: system_basic or system_core). 136 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 137 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 138 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 139 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 140 * @syscap SystemCapability.BundleManager.BundleFramework.Core 141 * @systemapi 142 * @since 10 143 */ 144 /** 145 * Install HAPs for an application. 146 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 147 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 148 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 149 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 150 * 151 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE 152 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 153 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 154 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 155 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 156 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 157 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 158 * @throws { BusinessError } 401 - Input parameters check failed. 159 * @throws { BusinessError } 17700004 - The specified user ID is not found. 160 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 161 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 162 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 163 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 164 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 165 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 166 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 167 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 168 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 169 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 170 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 171 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 172 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 173 * (required APL: system_basic or system_core). 174 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 175 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 176 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 177 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 178 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 179 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 180 * @syscap SystemCapability.BundleManager.BundleFramework.Core 181 * @systemapi 182 * @since 11 183 */ 184 install(hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>): void; 185 186 /** 187 * Install haps for an application. 188 * 189 * @permission ohos.permission.INSTALL_BUNDLE 190 * @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored. 191 * @param { AsyncCallback<void> } callback - The callback of installing haps result. 192 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 193 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 194 * @throws { BusinessError } 401 - Input parameters check failed. 195 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 196 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 197 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 198 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 199 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 200 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 201 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 202 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 203 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 204 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 205 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 206 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 207 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 208 * (required APL: system_basic or system_core). 209 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 210 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 211 * @syscap SystemCapability.BundleManager.BundleFramework.Core 212 * @systemapi 213 * @since 9 214 */ 215 /** 216 * Install HAPs for an application. 217 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 218 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 219 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 220 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 221 * 222 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE 223 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 224 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 225 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 226 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 227 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 228 * @throws { BusinessError } 401 - Input parameters check failed. 229 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 230 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 231 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 232 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 233 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 234 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 235 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 236 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 237 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 238 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 239 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 240 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 241 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 242 * (required APL: system_basic or system_core). 243 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 244 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 245 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 246 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 247 * @syscap SystemCapability.BundleManager.BundleFramework.Core 248 * @systemapi 249 * @since 10 250 */ 251 /** 252 * Install HAPs for an application. 253 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 254 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 255 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 256 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 257 * 258 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE 259 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 260 * @param { AsyncCallback<void> } callback - The callback of installing HAPs result. 261 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 262 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 263 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 264 * @throws { BusinessError } 401 - Input parameters check failed. 265 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 266 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 267 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 268 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 269 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 270 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 271 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 272 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 273 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 274 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 275 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 276 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 277 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 278 * (required APL: system_basic or system_core). 279 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 280 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 281 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 282 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 283 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 284 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 285 * @syscap SystemCapability.BundleManager.BundleFramework.Core 286 * @systemapi 287 * @since 11 288 */ 289 install(hapFilePaths: Array<string>, callback: AsyncCallback<void>): void; 290 291 /** 292 * Install haps for an application. 293 * 294 * @permission ohos.permission.INSTALL_BUNDLE 295 * @param { Array<string> } hapFilePaths - Indicates the path where the hap of the application is stored. 296 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 297 * @returns { Promise<void> } 298 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE'. 299 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 300 * @throws { BusinessError } 401 - Input parameters check failed. 301 * @throws { BusinessError } 17700004 - The specified user ID is not found. 302 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 303 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 304 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 305 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 306 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 307 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 308 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 309 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 310 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 311 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 312 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 313 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 314 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 315 * (required APL: system_basic or system_core). 316 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 317 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 318 * @syscap SystemCapability.BundleManager.BundleFramework.Core 319 * @systemapi 320 * @since 9 321 */ 322 /** 323 * Install haps for an application. 324 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 325 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 326 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 327 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 328 * 329 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE 330 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 331 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 332 * @returns { Promise<void> } 333 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 334 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 335 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 336 * @throws { BusinessError } 401 - Input parameters check failed. 337 * @throws { BusinessError } 17700004 - The specified user ID is not found. 338 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 339 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 340 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 341 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 342 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 343 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 344 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 345 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 346 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 347 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 348 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 349 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 350 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 351 * (required APL: system_basic or system_core). 352 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 353 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 354 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 355 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 356 * @syscap SystemCapability.BundleManager.BundleFramework.Core 357 * @systemapi 358 * @since 10 359 */ 360 /** 361 * Install haps for an application. 362 * To install a non-enterprise application, you must have the permission ohos.permission.INSTALL_BUNDLE. 363 * To install an enterprise application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_BUNDLE. 364 * To install an enterprise administrator application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE. 365 * To install an enterprise normal application, you must have the permission ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE. 366 * 367 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE or ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE 368 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 369 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 370 * @returns { Promise<void> } 371 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_BUNDLE' or 372 * 'ohos.permission.INSTALL_ENTERPRISE_MDM_BUNDLE' or 'ohos.permission.INSTALL_ENTERPRISE_NORMAL_BUNDLE'. 373 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 374 * @throws { BusinessError } 401 - Input parameters check failed. 375 * @throws { BusinessError } 17700004 - The specified user ID is not found. 376 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 377 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 378 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 379 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 380 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 381 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 382 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 383 * @throws { BusinessError } 17700031 - Failed to install the HAP because the overlay check of the HAP is failed. 384 * @throws { BusinessError } 17700036 - Failed to install the HSP because lacks appropriate permissions. 385 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 386 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 387 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 388 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy 389 * (required APL: system_basic or system_core). 390 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 391 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 392 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 393 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 394 * @throws { BusinessError } 17700052 - Failed to install the HAP because debug bundle cannot be installed under non-developer mode. 395 * @throws { BusinessError } 17700054 - Failed to install the HAP because the HAP requests wrong permissions. 396 * @syscap SystemCapability.BundleManager.BundleFramework.Core 397 * @systemapi 398 * @since 11 399 */ 400 install(hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>; 401 402 /** 403 * Uninstall an application. 404 * 405 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 406 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 407 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 408 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 409 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 410 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 411 * @throws { BusinessError } 401 - Input parameters check failed. 412 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 413 * @throws { BusinessError } 17700004 - The specified user ID is not found. 414 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 415 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled. 416 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 417 * @syscap SystemCapability.BundleManager.BundleFramework.Core 418 * @systemapi 419 * @since 9 420 */ 421 uninstall(bundleName: string, installParam: InstallParam, callback: AsyncCallback<void>): void; 422 423 /** 424 * Uninstall an application. 425 * 426 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 427 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 428 * @param { AsyncCallback<void> } callback - The callback of uninstalling application result. 429 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 430 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 431 * @throws { BusinessError } 401 - Input parameters check failed. 432 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 433 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 434 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled. 435 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 436 * @syscap SystemCapability.BundleManager.BundleFramework.Core 437 * @systemapi 438 * @since 9 439 */ 440 uninstall(bundleName: string, callback: AsyncCallback<void>): void; 441 442 /** 443 * Uninstall an application. 444 * 445 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 446 * @param { string } bundleName - Indicates the bundle name of the application to be uninstalled. 447 * @param { InstallParam } installParam - Indicates other parameters required for the uninstall. 448 * @returns { Promise<void> } 449 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 450 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 451 * @throws { BusinessError } 401 - Input parameters check failed. 452 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 453 * @throws { BusinessError } 17700004 - The specified user ID is not found. 454 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 455 * @throws { BusinessError } 17700040 - The specified bundle is a shared bundle which cannot be uninstalled. 456 * @throws { BusinessError } 17700045 - Failed to uninstall because enterprise device management disallow uninstall. 457 * @syscap SystemCapability.BundleManager.BundleFramework.Core 458 * @systemapi 459 * @since 9 460 */ 461 uninstall(bundleName: string, installParam?: InstallParam): Promise<void>; 462 463 /** 464 * Recover an application. 465 * 466 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 467 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 468 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 469 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 470 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 471 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 472 * @throws { BusinessError } 401 - Input parameters check failed. 473 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 474 * @throws { BusinessError } 17700004 - The specified user ID is not found. 475 * @syscap SystemCapability.BundleManager.BundleFramework.Core 476 * @systemapi 477 * @since 9 478 */ 479 recover(bundleName: string, installParam: InstallParam, callback: AsyncCallback<void>): void; 480 481 /** 482 * Recover an application. 483 * 484 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 485 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 486 * @param { AsyncCallback<void> } callback - The callback of recovering application result. 487 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 488 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 489 * @throws { BusinessError } 401 - Input parameters check failed. 490 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 491 * @syscap SystemCapability.BundleManager.BundleFramework.Core 492 * @systemapi 493 * @since 9 494 */ 495 recover(bundleName: string, callback: AsyncCallback<void>): void; 496 497 /** 498 * Recover an application. 499 * 500 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.RECOVER_BUNDLE 501 * @param { string } bundleName - Indicates the bundle name of the application to be recovered. 502 * @param { InstallParam } installParam - Indicates other parameters required for the recover. 503 * @returns { Promise<void> } 504 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.RECOVER_BUNDLE'. 505 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 506 * @throws { BusinessError } 401 - Input parameters check failed. 507 * @throws { BusinessError } 17700001 - The specified bundle name is not found. 508 * @throws { BusinessError } 17700004 - The specified user ID is not found. 509 * @syscap SystemCapability.BundleManager.BundleFramework.Core 510 * @systemapi 511 * @since 9 512 */ 513 recover(bundleName: string, installParam?: InstallParam): Promise<void>; 514 515 /** 516 * Uninstall a shared bundle. 517 * 518 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 519 * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. 520 * @param { AsyncCallback<void> } callback - The callback of uninstalling shared bundle result. 521 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 522 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 523 * @throws { BusinessError } 401 - Input parameters check failed. 524 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 525 * @throws { BusinessError } 17700037 - The version of shared bundle is dependent on other applications. 526 * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. 527 * @syscap SystemCapability.BundleManager.BundleFramework.Core 528 * @systemapi 529 * @since 10 530 */ 531 uninstall(uninstallParam: UninstallParam, callback: AsyncCallback<void>): void; 532 533 /** 534 * Uninstall a shared bundle. 535 * 536 * @permission ohos.permission.INSTALL_BUNDLE or ohos.permission.UNINSTALL_BUNDLE 537 * @param { UninstallParam } uninstallParam - Indicates parameters required for the uninstall. 538 * @returns { Promise<void> } 539 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_BUNDLE' or 'ohos.permission.UNINSTALL_BUNDLE'. 540 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 541 * @throws { BusinessError } 401 - Input parameters check failed. 542 * @throws { BusinessError } 17700020 - The specified bundle is pre-installed bundle which cannot be uninstalled. 543 * @throws { BusinessError } 17700037 - The version of shared bundle is dependent on other applications. 544 * @throws { BusinessError } 17700038 - The specified shared bundle does not exist. 545 * @syscap SystemCapability.BundleManager.BundleFramework.Core 546 * @systemapi 547 * @since 10 548 */ 549 uninstall(uninstallParam: UninstallParam): Promise<void>; 550 551 /** 552 * Updates this enterprise application. 553 * 554 * @permission ohos.permission.INSTALL_SELF_BUNDLE 555 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 556 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 557 * @param { AsyncCallback<void> } callback - Indicates the callback used to return the HAP installation result. 558 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 559 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 560 * @throws { BusinessError } 401 - Input parameters check failed. 561 * @throws { BusinessError } 17700004 - The specified user ID is not found. 562 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 563 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 564 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 565 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 566 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 567 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 568 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 569 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 570 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 571 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 572 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). 573 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 574 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 575 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 576 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 577 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 578 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 579 * @syscap SystemCapability.BundleManager.BundleFramework.Core 580 * @systemapi 581 * @since 10 582 */ 583 updateBundleForSelf(hapFilePaths: Array<string>, installParam: InstallParam, callback: AsyncCallback<void>): void; 584 585 /** 586 * Updates this enterprise application. 587 * 588 * @permission ohos.permission.INSTALL_SELF_BUNDLE 589 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 590 * @param { AsyncCallback<void> } callback - Indicates the callback used to return the HAP installation result. 591 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 592 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 593 * @throws { BusinessError } 401 - Input parameters check failed. 594 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 595 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 596 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 597 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 598 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 599 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 600 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 601 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 602 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 603 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 604 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). 605 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 606 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 607 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 608 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 609 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 610 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 611 * @syscap SystemCapability.BundleManager.BundleFramework.Core 612 * @systemapi 613 * @since 10 614 */ 615 updateBundleForSelf(hapFilePaths: Array<string>, callback: AsyncCallback<void>): void; 616 617 /** 618 * Updates this enterprise application. 619 * 620 * @permission ohos.permission.INSTALL_SELF_BUNDLE 621 * @param { Array<string> } hapFilePaths - Indicates the path where the HAP of the application is stored. 622 * @param { InstallParam } installParam - Indicates other parameters required for the installation. 623 * @returns { Promise<void> } 624 * @throws { BusinessError } 201 - Calling interface without permission 'ohos.permission.INSTALL_SELF_BUNDLE'. 625 * @throws { BusinessError } 202 - Permission denied, non-system app called system api. 626 * @throws { BusinessError } 401 - Input parameters check failed. 627 * @throws { BusinessError } 17700004 - The specified user ID is not found. 628 * @throws { BusinessError } 17700010 - Failed to install the HAP because the HAP fails to be parsed. 629 * @throws { BusinessError } 17700011 - Failed to install the HAP because the HAP signature fails to be verified. 630 * @throws { BusinessError } 17700012 - Failed to install the HAP because the HAP path is invalid or the HAP is too large. 631 * @throws { BusinessError } 17700015 - Failed to install the HAPs because they have different configuration information. 632 * @throws { BusinessError } 17700016 - Failed to install the HAP because of insufficient system disk space. 633 * @throws { BusinessError } 17700017 - Failed to install the HAP since the version of the HAP to install is too early. 634 * @throws { BusinessError } 17700018 - Failed to install because the dependent module does not exist. 635 * @throws { BusinessError } 17700039 - Failed to install because disallow install a shared bundle by hapFilePaths. 636 * @throws { BusinessError } 17700041 - Failed to install because enterprise device management disallow install. 637 * @throws { BusinessError } 17700042 - Failed to install the HAP because of incorrect URI in the data proxy. 638 * @throws { BusinessError } 17700043 - Failed to install the HAP because of low APL in the non-system data proxy (required APL: system_basic or system_core). 639 * @throws { BusinessError } 17700044 - Failed to install the HAP because the isolationMode configured is not supported. 640 * @throws { BusinessError } 17700047 - Failed to install the HAP because the VersionCode to be updated is not greater than the current VersionCode. 641 * @throws { BusinessError } 17700048 - Failed to install the HAP because the code signature verification is failed. 642 * @throws { BusinessError } 17700049 - Failed to install the HAP because the bundleName is different from the bundleName of the caller application. 643 * @throws { BusinessError } 17700050 - Failed to install the HAP because enterprise normal/MDM bundle cannot be installed on non-enterprise device. 644 * @throws { BusinessError } 17700051 - Failed to install the HAP because the distribution type of caller application is not enterprise_mdm. 645 * @syscap SystemCapability.BundleManager.BundleFramework.Core 646 * @systemapi 647 * @since 10 648 */ 649 updateBundleForSelf(hapFilePaths: Array<string>, installParam?: InstallParam): Promise<void>; 650 } 651 652 /** 653 * Provides parameters required for hashParam. 654 * 655 * @typedef HashParam 656 * @syscap SystemCapability.BundleManager.BundleFramework.Core 657 * @systemapi 658 * @since 9 659 */ 660 export interface HashParam { 661 /** 662 * Indicates the moduleName 663 * 664 * @syscap SystemCapability.BundleManager.BundleFramework.Core 665 * @systemapi 666 * @since 9 667 */ 668 moduleName: string; 669 670 /** 671 * Indicates the hash value 672 * 673 * @syscap SystemCapability.BundleManager.BundleFramework.Core 674 * @systemapi 675 * @since 9 676 */ 677 hashValue: string; 678 } 679 680 /** 681 * Provides parameters required for VerifyCodeParam. 682 * 683 * @typedef VerifyCodeParam 684 * @syscap SystemCapability.BundleManager.BundleFramework.Core 685 * @systemapi 686 * @since 10 687 * @deprecated since 11 688 */ 689 export interface VerifyCodeParam { 690 /** 691 * Indicates the moduleName which hopes to be processed with code signature. 692 * 693 * @type { string } 694 * @syscap SystemCapability.BundleManager.BundleFramework.Core 695 * @systemapi 696 * @since 10 697 * @deprecated since 11 698 */ 699 moduleName: string; 700 701 /** 702 * Indicates the path where the code signature file of the corresponding HAP is stored. 703 * 704 * @type { string } 705 * @syscap SystemCapability.BundleManager.BundleFramework.Core 706 * @systemapi 707 * @since 10 708 * @deprecated since 11 709 */ 710 signatureFilePath: string; 711 } 712 713 /** 714 * Provides parameters required for PGOParam. 715 * 716 * @typedef PGOParam 717 * @syscap SystemCapability.BundleManager.BundleFramework.Core 718 * @systemapi 719 * @since 11 720 */ 721 export interface PGOParam { 722 /** 723 * Indicates the moduleName that need to store profile-guided optimization(PGO) file. 724 * 725 * @type { string } 726 * @syscap SystemCapability.BundleManager.BundleFramework.Core 727 * @systemapi 728 * @since 11 729 */ 730 moduleName: string; 731 732 /** 733 * Indicates the path where the profile-guided optimization(PGO) file is stored. 734 * 735 * @type { string } 736 * @syscap SystemCapability.BundleManager.BundleFramework.Core 737 * @systemapi 738 * @since 11 739 */ 740 pgoFilePath: string; 741 } 742 743 /** 744 * Provides parameters required for installing or uninstalling an application. 745 * 746 * @typedef InstallParam 747 * @syscap SystemCapability.BundleManager.BundleFramework.Core 748 * @systemapi 749 * @since 9 750 */ 751 export interface InstallParam { 752 /** 753 * Indicates the user id 754 * 755 * @syscap SystemCapability.BundleManager.BundleFramework.Core 756 * @systemapi 757 * @since 9 758 */ 759 userId?: number; 760 761 /** 762 * Indicates the installation type. The value 0x00 means normal installation, 0x01 means overwrite installation, and 0x10 means installation-free. 763 * 764 * @syscap SystemCapability.BundleManager.BundleFramework.Core 765 * @systemapi 766 * @since 9 767 */ 768 installFlag?: number; 769 770 /** 771 * Indicates whether the param has data 772 * 773 * @syscap SystemCapability.BundleManager.BundleFramework.Core 774 * @systemapi 775 * @since 9 776 */ 777 isKeepData?: boolean; 778 779 /** 780 * Indicates the hash params 781 * 782 * @syscap SystemCapability.BundleManager.BundleFramework.Core 783 * @systemapi 784 * @since 9 785 */ 786 hashParams?: Array<HashParam>; 787 788 /** 789 * Indicates the deadline of the crowdtesting bundle 790 * 791 * @syscap SystemCapability.BundleManager.BundleFramework.Core 792 * @systemapi 793 * @since 9 794 */ 795 crowdtestDeadline?: number; 796 797 /** 798 * Indicates the shared bundle dir paths. 799 * 800 * @syscap SystemCapability.BundleManager.BundleFramework.Core 801 * @systemapi 802 * @since 10 803 */ 804 sharedBundleDirPaths?: Array<String>; 805 806 /** 807 * Indicates the distribution type specified during bundle installation. 808 * 809 * @syscap SystemCapability.BundleManager.BundleFramework.Core 810 * @systemapi 811 * @since 10 812 */ 813 specifiedDistributionType?: string; 814 815 /** 816 * Indicates the additional information during bundle installation. 817 * 818 * @syscap SystemCapability.BundleManager.BundleFramework.Core 819 * @systemapi 820 * @since 10 821 */ 822 additionalInfo?: string; 823 824 /** 825 * Indicates the verification code param. 826 * 827 * @type { ?Array<VerifyCodeParam> } 828 * @syscap SystemCapability.BundleManager.BundleFramework.Core 829 * @systemapi 830 * @since 10 831 * @deprecated since 11 832 */ 833 verifyCodeParams?: Array<VerifyCodeParam>; 834 835 /** 836 * Indicates the profile-guided optimization(PGO) params. 837 * 838 * @type { ?Array<PGOParam> } 839 * @syscap SystemCapability.BundleManager.BundleFramework.Core 840 * @systemapi 841 * @since 11 842 */ 843 pgoParams?: Array<PGOParam>; 844 } 845 846 /** 847 * Provides parameters required for uninstalling shared bundle. 848 * 849 * @typedef UninstallParam 850 * @syscap SystemCapability.BundleManager.BundleFramework.Core 851 * @systemapi 852 * @since 10 853 */ 854 export interface UninstallParam { 855 /** 856 * Indicates the shared bundle name 857 * 858 * @syscap SystemCapability.BundleManager.BundleFramework.Core 859 * @systemapi 860 * @since 10 861 */ 862 bundleName: string; 863 864 /** 865 * Indicates the shared version code. If default, indicates that all version sharing bundles are uninstalled 866 * 867 * @syscap SystemCapability.BundleManager.BundleFramework.Core 868 * @systemapi 869 * @since 10 870 */ 871 versionCode?: number; 872 } 873} 874 875export default installer; 876