1/*
2 * Copyright (c) 2022-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#include "bundle_command_common.h"
16
17#include "app_log_wrapper.h"
18#include "appexecfwk_errors.h"
19#include "bundle_mgr_proxy.h"
20#ifdef DISTRIBUTED_BUNDLE_FRAMEWORK
21#include "distributed_bms_proxy.h"
22#endif
23#ifdef ACCOUNT_ENABLE
24#include "os_account_info.h"
25#include "os_account_manager.h"
26#endif
27#include "if_system_ability_manager.h"
28#include "iservice_registry.h"
29#include "status_receiver_interface.h"
30#include "system_ability_definition.h"
31
32namespace OHOS {
33namespace AppExecFwk {
34sptr<IBundleMgr> BundleCommandCommon::GetBundleMgrProxy()
35{
36    sptr<ISystemAbilityManager> systemAbilityManager =
37        SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
38    if (systemAbilityManager == nullptr) {
39        APP_LOGE("failed to get system ability mgr.");
40        return nullptr;
41    }
42
43    sptr<IRemoteObject> remoteObject = systemAbilityManager->GetSystemAbility(BUNDLE_MGR_SERVICE_SYS_ABILITY_ID);
44    if (remoteObject == nullptr) {
45        APP_LOGE("failed to get bundle manager proxy.");
46        return nullptr;
47    }
48
49    APP_LOGD("get bundle manager proxy success.");
50    return iface_cast<IBundleMgr>(remoteObject);
51}
52
53#ifdef DISTRIBUTED_BUNDLE_FRAMEWORK
54sptr<IDistributedBms> BundleCommandCommon::GetDistributedBundleMgrService()
55{
56    auto saMgr = OHOS::SystemAbilityManagerClient::GetInstance().GetSystemAbilityManager();
57    if (saMgr == nullptr) {
58        APP_LOGE("saMgr is nullptr");
59        return nullptr;
60    }
61    OHOS::sptr<OHOS::IRemoteObject> remoteObject =
62        saMgr->CheckSystemAbility(OHOS::DISTRIBUTED_BUNDLE_MGR_SERVICE_SYS_ABILITY_ID);
63    if (remoteObject == nullptr) {
64        APP_LOGE("failed to get distributed bms proxy.");
65        return nullptr;
66    }
67    return OHOS::iface_cast<IDistributedBms>(remoteObject);
68}
69#endif
70
71int32_t BundleCommandCommon::GetCurrentUserId(int32_t userId)
72{
73    if (userId == Constants::UNSPECIFIED_USERID) {
74#ifdef ACCOUNT_ENABLE
75        std::int32_t localId;
76        int32_t ret = AccountSA::OsAccountManager::GetForegroundOsAccountLocalId(localId);
77        if (ret != 0) {
78            APP_LOGW("GetForegroundOsAccountLocalId failed! ret = %{public}d.", ret);
79            return userId;
80        }
81        return localId;
82#endif
83    }
84    return userId;
85}
86
87std::map<int32_t, std::string> BundleCommandCommon::bundleMessageMap_ = {
88    //  error + message
89    {
90        IStatusReceiver::ERR_INSTALL_INTERNAL_ERROR,
91        "error: install internal error.",
92    },
93    {
94        IStatusReceiver::ERR_INSTALL_HOST_INSTALLER_FAILED,
95        "error: install host installer failed.",
96    },
97    {
98        IStatusReceiver::ERR_INSTALL_PARSE_FAILED,
99        "error: install parse failed.",
100    },
101    {
102        IStatusReceiver::ERR_INSTALL_VERSION_DOWNGRADE,
103        "error: install version downgrade.",
104    },
105    {
106        IStatusReceiver::ERR_INSTALL_VERIFICATION_FAILED,
107        "error: install verification failed.",
108    },
109    {
110        IStatusReceiver::ERR_INSTALL_FAILED_INVALID_SIGNATURE_FILE_PATH,
111        "error: signature file path is invalid.",
112    },
113    {
114        IStatusReceiver::ERR_INSTALL_FAILED_BAD_BUNDLE_SIGNATURE_FILE,
115        "error: cannot open signature file.",
116    },
117    {
118        IStatusReceiver::ERR_INSTALL_FAILED_NO_BUNDLE_SIGNATURE,
119        "error: no signature file.",
120    },
121    {
122        IStatusReceiver::ERR_INSTALL_FAILED_VERIFY_APP_PKCS7_FAIL,
123        "error: fail to verify pkcs7 file.",
124    },
125    {
126        IStatusReceiver::ERR_INSTALL_FAILED_PROFILE_PARSE_FAIL,
127        "error: fail to parse signature file.",
128    },
129    {
130        IStatusReceiver::ERR_INSTALL_FAILED_APP_SOURCE_NOT_TRUESTED,
131        "error: signature verification failed due to not trusted app source.",
132    },
133    {
134        IStatusReceiver::ERR_INSTALL_FAILED_BAD_DIGEST,
135        "error: signature verification failed due to not bad digest.",
136    },
137    {
138        IStatusReceiver::ERR_INSTALL_FAILED_BUNDLE_INTEGRITY_VERIFICATION_FAILURE,
139        "error: signature verification failed due to out of integrity.",
140    },
141    {
142        IStatusReceiver::ERR_INSTALL_FAILED_FILE_SIZE_TOO_LARGE,
143        "error: signature verification failed due to oversize file.",
144    },
145    {
146        IStatusReceiver::ERR_INSTALL_FAILED_BAD_PUBLICKEY,
147        "error: signature verification failed due to bad public key.",
148    },
149    {
150        IStatusReceiver::ERR_INSTALL_FAILED_BAD_BUNDLE_SIGNATURE,
151        "error: signature verification failed due to bad bundle signature.",
152    },
153    {
154        IStatusReceiver::ERR_INSTALL_FAILED_NO_PROFILE_BLOCK_FAIL,
155        "error: signature verification failed due to no profile block.",
156    },
157    {
158        IStatusReceiver::ERR_INSTALL_FAILED_BUNDLE_SIGNATURE_VERIFICATION_FAILURE,
159        "error: verify signature failed.",
160    },
161    {
162        IStatusReceiver::ERR_INSTALL_FAILED_VERIFY_SOURCE_INIT_FAIL,
163        "error: signature verification failed due to init source failed.",
164    },
165    {
166        IStatusReceiver::ERR_INSTALL_FAILED_INCOMPATIBLE_SIGNATURE,
167        "error: install incompatible signature info.",
168    },
169    {
170        IStatusReceiver::ERR_INSTALL_FAILED_INCONSISTENT_SIGNATURE,
171        "error: install sign info inconsistent.",
172    },
173    {
174        IStatusReceiver::ERR_INSTALL_FAILED_MODULE_NAME_EMPTY,
175        "error: install failed due to hap moduleName is empty.",
176    },
177    {
178        IStatusReceiver::ERR_INSTALL_FAILED_MODULE_NAME_DUPLICATE,
179        "error: install failed due to hap moduleName duplicate.",
180    },
181    {
182        IStatusReceiver::ERR_INSTALL_FAILED_CHECK_HAP_HASH_PARAM,
183        "error: install failed due to check hap hash param failed.",
184    },
185    {
186        IStatusReceiver::ERR_INSTALL_PARAM_ERROR,
187        "error: install param error.",
188    },
189    {
190        IStatusReceiver::ERR_INSTALL_PERMISSION_DENIED,
191        "error: install permission denied.",
192    },
193    {
194        IStatusReceiver::ERR_INSTALL_ENTRY_ALREADY_EXIST,
195        "error: install entry already exist.",
196    },
197    {
198        IStatusReceiver::ERR_INSTALL_STATE_ERROR,
199        "error: install state error.",
200    },
201    {
202        IStatusReceiver::ERR_INSTALL_FILE_PATH_INVALID,
203        "error: install file path invalid.",
204    },
205    {
206        IStatusReceiver::ERR_INSTALL_INVALID_HAP_NAME,
207        "error: install invalid hap name.",
208    },
209    {
210        IStatusReceiver::ERR_INSTALL_INVALID_BUNDLE_FILE,
211        "error: install invalid bundle file.",
212    },
213    {
214        IStatusReceiver::ERR_INSTALL_INVALID_HAP_SIZE,
215        "error: install invalid hap size.",
216    },
217    {
218        IStatusReceiver::ERR_INSTALL_GENERATE_UID_ERROR,
219        "error: install generate uid error.",
220    },
221    {
222        IStatusReceiver::ERR_INSTALL_INSTALLD_SERVICE_ERROR,
223        "error: install installd service error.",
224    },
225    {
226        IStatusReceiver::ERR_INSTALL_BUNDLE_MGR_SERVICE_ERROR,
227        "error: install bundle mgr service error.",
228    },
229    {
230        IStatusReceiver::ERR_INSTALL_ALREADY_EXIST,
231        "error: install already exist.",
232    },
233    {
234        IStatusReceiver::ERR_INSTALL_BUNDLENAME_NOT_SAME,
235        "error: install bundle name not same.",
236    },
237    {
238        IStatusReceiver::ERR_INSTALL_VERSIONCODE_NOT_SAME,
239        "error: install version code not same.",
240    },
241    {
242        IStatusReceiver::ERR_INSTALL_VERSIONNAME_NOT_SAME,
243        "error: install version name not same.",
244    },
245    {
246        IStatusReceiver::ERR_INSTALL_MINCOMPATIBLE_VERSIONCODE_NOT_SAME,
247        "error: install min compatible version code not same.",
248    },
249    {
250        IStatusReceiver::ERR_INSTALL_VENDOR_NOT_SAME,
251        "error: install vendor not same.",
252    },
253    {
254        IStatusReceiver::ERR_INSTALL_RELEASETYPE_TARGET_NOT_SAME,
255        "error: install releaseType target not same.",
256    },
257    {
258        IStatusReceiver::ERR_INSTALL_RELEASETYPE_NOT_SAME,
259        "error: install releaseType not same.",
260    },
261    {
262        IStatusReceiver::ERR_INSTALL_RELEASETYPE_COMPATIBLE_NOT_SAME,
263        "error: install releaseType compatible not same.",
264    },
265    {
266        IStatusReceiver::ERR_INSTALL_VERSION_NOT_COMPATIBLE,
267        "error: install version not compatible.",
268    },
269    {
270        IStatusReceiver::ERR_INSTALL_APP_DISTRIBUTION_TYPE_NOT_SAME,
271        "error: install distribution type not same.",
272    },
273    {
274        IStatusReceiver::ERR_INSTALL_APP_PROVISION_TYPE_NOT_SAME,
275        "error: install provision type not same.",
276    },
277    {
278        IStatusReceiver::ERR_INSTALL_INVALID_NUMBER_OF_ENTRY_HAP,
279        "error: install invalid number of entry hap.",
280    },
281    {
282        IStatusReceiver::ERR_INSTALL_DISK_MEM_INSUFFICIENT,
283        "error: install failed due to insufficient disk memory.",
284    },
285    {
286        IStatusReceiver::ERR_INSTALL_GRANT_REQUEST_PERMISSIONS_FAILED,
287        "error: install failed due to grant request permissions failed.",
288    },
289    {
290        IStatusReceiver::ERR_INSTALL_UPDATE_HAP_TOKEN_FAILED,
291        "error: install failed due to update hap token failed.",
292    },
293    {
294        IStatusReceiver::ERR_INSTALL_SINGLETON_NOT_SAME,
295        "error: install failed due to singleton not same.",
296    },
297    {
298        IStatusReceiver::ERR_INSTALL_ZERO_USER_WITH_NO_SINGLETON,
299        "error: install failed due to zero user can only install singleton app.",
300    },
301    {
302        IStatusReceiver::ERR_INSTALL_CHECK_SYSCAP_FAILED,
303        "error: install failed due to check syscap filed.",
304    },
305    {
306        IStatusReceiver::ERR_INSTALL_APPTYPE_NOT_SAME,
307        "error: install failed due to apptype not same",
308    },
309    {
310        IStatusReceiver::ERR_INSTALL_TYPE_ERROR,
311        "error: install failed due to error bundle type"
312    },
313    {
314        IStatusReceiver::ERR_INSTALL_SDK_INCOMPATIBLE,
315        "error: install failed due to older sdk version in the device"
316    },
317    {
318        IStatusReceiver::ERR_INSTALL_SO_INCOMPATIBLE,
319        "error: install failed due to native so is incompatible"
320    },
321    {
322        IStatusReceiver::ERR_INSTALL_AN_INCOMPATIBLE,
323        "error: install failed due to ark native file is incompatible"
324    },
325    {
326        IStatusReceiver::ERR_INSTALL_URI_DUPLICATE,
327        "error: install failed due to uri prefix duplicate",
328    },
329    {
330        IStatusReceiver::ERR_INSTALL_PARSE_UNEXPECTED,
331        "error: install parse unexpected.",
332    },
333    {
334        IStatusReceiver::ERR_INSTALL_PARSE_MISSING_BUNDLE,
335        "error: install parse missing bundle.",
336    },
337    {
338        IStatusReceiver::ERR_INSTALL_PARSE_MISSING_ABILITY,
339        "error: install parse missing ability.",
340    },
341    {
342        IStatusReceiver::ERR_INSTALL_PARSE_NO_PROFILE,
343        "error: install parse no profile.",
344    },
345    {
346        IStatusReceiver::ERR_INSTALL_PARSE_BAD_PROFILE,
347        "error: install parse bad profile.",
348    },
349    {
350        IStatusReceiver::ERR_INSTALL_PARSE_PROFILE_PROP_TYPE_ERROR,
351        "error: install parse profile prop type error.",
352    },
353    {
354        IStatusReceiver::ERR_INSTALL_PARSE_PROFILE_MISSING_PROP,
355        "error: install parse profile missing prop.",
356    },
357    {
358        IStatusReceiver::ERR_INSTALL_PARSE_PROFILE_PROP_CHECK_ERROR,
359        "error: install parse profile prop check error.",
360    },
361    {
362        IStatusReceiver::ERR_INSTALL_PARSE_PERMISSION_ERROR,
363        "error: install parse permission error.",
364    },
365    {
366        IStatusReceiver::ERR_INSTALL_PARSE_RPCID_FAILED,
367        "error: install parse syscap error.",
368    },
369    {
370        IStatusReceiver::ERR_INSTALL_PARSE_NATIVE_SO_FAILED,
371        "error: install parse native so failed.",
372    },
373    {
374        IStatusReceiver::ERR_INSTALL_PARSE_AN_FAILED,
375        "error: install parse ark native file failed.",
376    },
377    {
378        IStatusReceiver::ERR_INSTALLD_PARAM_ERROR,
379        "error: installd param error.",
380    },
381    {
382        IStatusReceiver::ERR_INSTALLD_GET_PROXY_ERROR,
383        "error: installd get proxy error.",
384    },
385    {
386        IStatusReceiver::ERR_INSTALLD_CREATE_DIR_FAILED,
387        "error: installd create dir failed.",
388    },
389    {
390        IStatusReceiver::ERR_INSTALLD_CREATE_DIR_EXIST,
391        "error: installd create dir exist.",
392    },
393    {
394        IStatusReceiver::ERR_INSTALLD_CHOWN_FAILED,
395        "error: installd chown failed.",
396    },
397    {
398        IStatusReceiver::ERR_INSTALLD_REMOVE_DIR_FAILED,
399        "error: installd remove dir failed.",
400    },
401    {
402        IStatusReceiver::ERR_INSTALLD_EXTRACT_FILES_FAILED,
403        "error: installd extract files failed.",
404    },
405    {
406        IStatusReceiver::ERR_INSTALLD_RNAME_DIR_FAILED,
407        "error: installd rename dir failed.",
408    },
409    {
410        IStatusReceiver::ERR_INSTALLD_CLEAN_DIR_FAILED,
411        "error: installd clean dir failed.",
412    },
413    {
414        IStatusReceiver::ERR_INSTALLD_SET_SELINUX_LABEL_FAILED,
415        "error: installd set selinux label failed."
416    },
417    {
418        IStatusReceiver::ERR_UNINSTALL_SYSTEM_APP_ERROR,
419        "error: uninstall system app error.",
420    },
421    {
422        IStatusReceiver::ERR_UNINSTALL_KILLING_APP_ERROR,
423        "error: uninstall killing app error.",
424    },
425    {
426        IStatusReceiver::ERR_UNINSTALL_INVALID_NAME,
427        "error: uninstall invalid name.",
428    },
429    {
430        IStatusReceiver::ERR_UNINSTALL_PARAM_ERROR,
431        "error: uninstall param error.",
432    },
433    {
434        IStatusReceiver::ERR_UNINSTALL_PERMISSION_DENIED,
435        "error: uninstall permission denied.",
436    },
437    {
438        IStatusReceiver::ERR_UNINSTALL_BUNDLE_MGR_SERVICE_ERROR,
439        "error: uninstall bundle mgr service error.",
440    },
441    {
442        IStatusReceiver::ERR_UNINSTALL_MISSING_INSTALLED_BUNDLE,
443        "error: uninstall missing installed bundle.",
444    },
445    {
446        IStatusReceiver::ERR_UNINSTALL_MISSING_INSTALLED_MODULE,
447        "error: uninstall missing installed module.",
448    },
449    {
450        IStatusReceiver::ERR_FAILED_SERVICE_DIED,
451        "error: bundle manager service is died.",
452    },
453    {
454        IStatusReceiver::ERR_FAILED_GET_INSTALLER_PROXY,
455        "error: failed to get installer proxy.",
456    },
457    {
458        IStatusReceiver::ERR_USER_NOT_EXIST,
459        "error: user not exist.",
460    },
461    {
462        IStatusReceiver::ERR_USER_NOT_INSTALL_HAP,
463        "error: user does not install the hap.",
464    },
465    {
466        IStatusReceiver::ERR_OPERATION_TIME_OUT,
467        "error: operation time out.",
468    },
469    {
470        IStatusReceiver::ERR_INSTALL_NOT_UNIQUE_DISTRO_MODULE_NAME,
471        "error: moduleName is not unique.",
472    },
473    {
474        IStatusReceiver::ERR_INSTALL_INCONSISTENT_MODULE_NAME,
475        "error: moduleName is inconsistent.",
476    },
477    {
478        IStatusReceiver::ERR_INSTALL_SINGLETON_INCOMPATIBLE,
479        "error: singleton is incompatible with installed app.",
480    },
481    {
482        IStatusReceiver::ERR_INSTALL_DISALLOWED,
483        "error: Failed to install the HAP because the installation is forbidden by enterprise device management.",
484    },
485    {
486        IStatusReceiver::ERR_UNINSTALL_DISALLOWED,
487        "error: Failed to uninstall the HAP because the uninstall is forbidden by enterprise device management.",
488    },
489    {
490        IStatusReceiver::ERR_INSTALL_DEVICE_TYPE_NOT_SUPPORTED,
491        "error: device type is not supported.",
492    },
493    {
494        IStatusReceiver::ERR_INSTALL_CHECK_SYSCAP_FAILED_AND_DEVICE_TYPE_NOT_SUPPORTED,
495        "error: check syscap filed and device type is not supported.",
496    },
497    {
498        IStatusReceiver::ERR_INSTALL_PARSE_PROFILE_PROP_SIZE_CHECK_ERROR,
499        "error: too large size of string or array type element in the profile.",
500    },
501    {
502        IStatusReceiver::ERR_INSTALL_DEPENDENT_MODULE_NOT_EXIST,
503        "error: Failed to install the HAP or HSP because the dependent module does not exist.",
504    },
505    {
506        IStatusReceiver::ERR_INSTALL_SHARE_APP_LIBRARY_NOT_ALLOWED,
507        "error: Failed to install the HSP due to the lack of required permission.",
508    },
509    {
510        IStatusReceiver::ERR_INSTALL_COMPATIBLE_POLICY_NOT_SAME,
511        "error: compatible policy not same.",
512    },
513    {
514        IStatusReceiver::ERR_INSTALL_FILE_IS_SHARED_LIBRARY,
515        "error: Failed to install the HSP because installing a shared bundle specified by hapFilePaths is not allowed.",
516    },
517    {
518        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_INTERNAL_ERROR,
519        "error: internal error of overlay installation.",
520    },
521    {
522        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_INVALID_BUNDLE_NAME,
523        "error: invalid bundle name of overlay installation.",
524    },
525    {
526        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_INVALID_MODULE_NAME,
527        "error: invalid module name of overlay installation.",
528    },
529    {
530        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_ERROR_HAP_TYPE,
531        "error: invalid hap type of overlay installation.",
532    },
533    {
534        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_ERROR_BUNDLE_TYPE,
535        "error: service bundle is not supported of overlay installation.",
536    },
537    {
538        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_TARGET_BUNDLE_NAME_MISSED,
539        "error: target bundleName is missed of overlay installation.",
540    },
541    {
542        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_TARGET_MODULE_NAME_MISSED,
543        "error: target module name is missed of overlay installation.",
544    },
545    {
546        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_TARGET_BUNDLE_NAME_NOT_SAME,
547        "error: target bundle name is not same when replace external overlay.",
548    },
549    {
550        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_INTERNAL_EXTERNAL_OVERLAY_EXISTED_SIMULTANEOUSLY,
551        "error: internal and external overlay installation cannot be supported.",
552    },
553    {
554        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_TARGET_PRIORITY_NOT_SAME,
555        "error: target priority is not same when replace external overlay.",
556    },
557    {
558        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_INVALID_PRIORITY,
559        "error: invalid priority of overlay hap.",
560    },
561    {
562        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_INCONSISTENT_VERSION_CODE,
563        "error: inconsistent version code of internal overlay installation.",
564    },
565    {
566        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_SERVICE_EXCEPTION,
567        "error: service is exception.",
568    },
569    {
570        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_BUNDLE_NAME_SAME_WITH_TARGET_BUNDLE_NAME,
571        "error: target bundle name cannot be same with bundle name.",
572    },
573    {
574        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_NO_SYSTEM_APPLICATION_FOR_EXTERNAL_OVERLAY,
575        "error: external overlay installation only support preInstall bundle.",
576    },
577    {
578        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_DIFFERENT_SIGNATURE_CERTIFICATE,
579        "error:target bundle has different signature certificate with current bundle.",
580    },
581    {
582        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_TARGET_BUNDLE_IS_OVERLAY_BUNDLE,
583        "error: target bundle cannot be overlay bundle of external overlay installation.",
584    },
585    {
586        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_TARGET_MODULE_IS_OVERLAY_MODULE,
587        "error: target module cannot be overlay module of overlay installation",
588    },
589    {
590        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_OVERLAY_TYPE_NOT_SAME,
591        "error: overlay type is not same.",
592    },
593    {
594        IStatusReceiver::ERR_OVERLAY_INSTALLATION_FAILED_INVALID_BUNDLE_DIR,
595        "error: bundle dir is invalid.",
596    },
597    {
598        IStatusReceiver::ERR_INSTALL_ASAN_ENABLED_NOT_SAME,
599        "error: install asanEnabled not same",
600    },
601    {
602        IStatusReceiver::ERR_INSTALL_ASAN_ENABLED_NOT_SUPPORT,
603        "error: install asan enabled is not support",
604    },
605    {
606        IStatusReceiver::ERR_INSTALL_BUNDLE_TYPE_NOT_SAME,
607        "error: install bundleType not same",
608    },
609    {
610        IStatusReceiver::ERR_APPEXECFWK_UNINSTALL_SHARE_APP_LIBRARY_IS_NOT_EXIST,
611        "error: shared bundle is not exist",
612    },
613    {
614        IStatusReceiver::ERR_APPEXECFWK_UNINSTALL_SHARE_APP_LIBRARY_IS_RELIED,
615        "error: The version of the shared bundle is dependent on other applications.",
616    },
617    {
618        IStatusReceiver::ERR_INSATLL_CHECK_PROXY_DATA_URI_FAILED,
619        "error: uri in proxy data is wrong",
620    },
621    {
622        IStatusReceiver::ERR_INSATLL_CHECK_PROXY_DATA_PERMISSION_FAILED,
623        "error: apl of required permission in proxy data is too low",
624    },
625    {
626        IStatusReceiver::ERR_INSTALL_FAILED_DEBUG_NOT_SAME,
627        "error: install debug type not same",
628    },
629    {
630        IStatusReceiver::ERR_INSTALL_ISOLATION_MODE_FAILED,
631        "error: isolationMode does not match the system.",
632    },
633    {
634        IStatusReceiver::ERR_INSTALL_CODE_SIGNATURE_FAILED,
635        "error: verify code signature failed.",
636    },
637    {
638        IStatusReceiver::ERR_UNINSTALL_FROM_BMS_EXTENSION_FAILED,
639        "error: uninstall bundle from extension failed",
640    },
641    {
642        IStatusReceiver::ERR_INSTALL_ENTERPRISE_BUNDLE_NOT_ALLOWED,
643        "error: Failed to install the HAP because an enterprise normal/MDM bundle cannot be installed on \
644        non-enterprise device.",
645    },
646    {
647        IStatusReceiver::ERR_INSTALLD_COPY_FILE_FAILED,
648        "error: copy file failed",
649    },
650    {
651        IStatusReceiver::ERR_INSTALL_GWP_ASAN_ENABLED_NOT_SAME,
652        "error: install GWPAsanEnabled not same",
653    },
654    {
655        IStatusReceiver::ERR_INSTALL_DEBUG_BUNDLE_NOT_ALLOWED,
656        "error: debug bundle can only be installed in developer mode",
657    },
658    {
659        IStatusReceiver::ERR_INSTALL_CHECK_ENCRYPTION_FAILED,
660        "error: check encryption failed",
661    },
662    {
663        IStatusReceiver::ERR_INSTALL_CODE_SIGNATURE_DELIVERY_FILE_FAILED,
664        "error: delivery sign profile failed",
665    },
666    {
667        IStatusReceiver::ERR_INSTALL_CODE_SIGNATURE_REMOVE_FILE_FAILED,
668        "error: remove sign profile failed",
669    },
670    {
671        IStatusReceiver::ERR_INSTALL_CODE_APP_CONTROLLED_FAILED,
672        "error: failed to install because the device be controlled",
673    },
674    {
675        IStatusReceiver::ERR_UNKNOWN,
676        "error: unknown.",
677    },
678    {
679        IStatusReceiver::ERR_INSTALL_NATIVE_FAILED,
680        "error: Failed to install the HAP because installing the native package failed.",
681    },
682    {
683        IStatusReceiver::ERR_UNINSTALL_NATIVE_FAILED,
684        "error: Failed to uninstall the HAP because uninstalling the native package failed.",
685    },
686    {
687        IStatusReceiver::ERR_NATIVE_HNP_EXTRACT_FAILED,
688        "error: Failed to install the HAP because the extract of the native package failed.",
689    },
690    {
691        IStatusReceiver::ERR_UNINSTALL_CONTROLLED,
692        "error: The uninstall request is rejected by the application."
693    },
694    {
695        IStatusReceiver::ERR_INSTALL_DEBUG_ENCRYPTED_BUNDLE_FAILED,
696        "error: debug encrypted bundle is not allowed to install."
697    }
698};
699} // AppExecFwk
700} // OHOS