/* * Copyright (c) 2022-2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "bundle_test_tool.h" #include #include #include #include #include #include #include #include #include #include #include #include "accesstoken_kit.h" #include "app_log_wrapper.h" #include "appexecfwk_errors.h" #include "bundle_command_common.h" #include "bundle_death_recipient.h" #include "bundle_dir.h" #include "bundle_mgr_client.h" #include "bundle_mgr_ext_client.h" #include "bundle_mgr_proxy.h" #include "bundle_tool_callback_stub.h" #include "common_event_manager.h" #include "common_event_support.h" #include "permission_define.h" #include "iservice_registry.h" #include "data_group_info.h" #include "directory_ex.h" #include "parameter.h" #include "parameters.h" #include "process_cache_callback_host.h" #include "nativetoken_kit.h" #include "token_setproc.h" #include "system_ability_definition.h" #ifdef BUNDLE_FRAMEWORK_QUICK_FIX #include "quick_fix_status_callback_host_impl.h" #endif #include "status_receiver_impl.h" #include "string_ex.h" #include "json_util.h" namespace OHOS { namespace AppExecFwk { namespace { using OptionHandler = std::function; const std::string LINE_BREAK = "\n"; constexpr int32_t SLEEP_SECONDS = 20; // param const int32_t INDEX_OFFSET = 2; // quick fix error code const int32_t ERR_BUNDLEMANAGER_FEATURE_IS_NOT_SUPPORTED = 801; const int32_t INITIAL_SANDBOX_APP_INDEX = 1000; const int32_t CODE_PROTECT_UID = 7666; const int32_t MAX_WAITING_TIME = 600; const int32_t MAX_PARAMS_FOR_UNINSTALL = 4; // system param constexpr const char* IS_ENTERPRISE_DEVICE = "const.edm.is_enterprise_device"; // quick fix error message const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_INTERNAL_ERROR = "error: quick fix internal error.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_PARAM_ERROR = "error: param error.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_PROFILE_PARSE_FAILED = "error: profile parse failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_BUNDLE_NAME_NOT_SAME = "error: not same bundle name.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_VERSION_CODE_NOT_SAME = "error: not same version code.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_VERSION_NAME_NOT_SAME = "error: not same version name.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_PATCH_VERSION_CODE_NOT_SAME = "error: not same patch version code.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_PATCH_VERSION_NAME_NOT_SAME = "error: not same patch version name.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_PATCH_TYPE_NOT_SAME = "error: not same patch type.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_UNKNOWN_QUICK_FIX_TYPE = "error: unknown quick fix type.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_SO_INCOMPATIBLE = "error: patch so incompatible.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_MODULE_NAME_SAME = "error: same moduleName.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_BUNDLE_NAME_NOT_EXIST = "error: bundle name is not existed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_MODULE_NAME_NOT_EXIST = "error: module name is not existed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_SIGNATURE_INFO_NOT_SAME = "error: signature is not existed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_ADD_HQF_FAILED = "error: quick fix add hqf failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_SAVE_APP_QUICK_FIX_FAILED = "error: quick fix save innerAppQuickFix failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_VERSION_CODE_ERROR = "error: quick fix version code require greater than original hqf.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_NO_PATCH_IN_DATABASE = "error: no this quick fix info in database.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_INVALID_PATCH_STATUS = "error: wrong quick fix status.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_NOT_EXISTED_BUNDLE_INFO = "error: cannot obtain the bundleInfo from data mgr.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_REMOVE_PATCH_PATH_FAILED = "error: quick fix remove path failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_EXTRACT_DIFF_FILES_FAILED = "error: extract diff files failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_APPLY_DIFF_PATCH_FAILED = "error: apply diff patch failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_UNKOWN = "error: unknown.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_FEATURE_IS_NOT_SUPPORTED = "feature is not supported.\n"; const std::string MSG_ERR_BUNDLEMANAGER_OPERATION_TIME_OUT = "error: quick fix operation time out.\n"; const std::string MSG_ERR_BUNDLEMANAGER_FAILED_SERVICE_DIED = "error: bundleMgr service is dead.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_HOT_RELOAD_NOT_SUPPORT_RELEASE_BUNDLE = "error: hotreload not support release bundle.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_PATCH_ALREADY_EXISTED = "error: patch type already existed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_HOT_RELOAD_ALREADY_EXISTED = "error: hotreload type already existed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_NO_PATCH_INFO_IN_BUNDLE_INFO = "error: no patch info in bundleInfo.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_MOVE_PATCH_FILE_FAILED = "error: quick fix move hqf file failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_CREATE_PATCH_PATH_FAILED = "error: quick fix create path failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_OLD_PATCH_OR_HOT_RELOAD_IN_DB = "error: old patch or hot reload in db.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_SEND_REQUEST_FAILED = "error: send request failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_REAL_PATH_FAILED = "error: obtain realpath failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_INVALID_PATH = "error: input invalid path.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_OPEN_SOURCE_FILE_FAILED = "error: open source file failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_CREATE_FD_FAILED = "error: create file descriptor failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_INVALID_TARGET_DIR = "error: invalid designated target dir\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_CREATE_TARGET_DIR_FAILED = "error: create target dir failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_PERMISSION_DENIED = "error: quick fix permission denied.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_WRITE_FILE_FAILED = "error: write file to target dir failed.\n"; const std::string MSG_ERR_BUNDLEMANAGER_QUICK_FIX_RELEASE_HAP_HAS_RESOURCES_FILE_FAILED = "error: the hqf of release hap cannot contains resources/rawfile.\n"; const std::string MSG_ERR_BUNDLEMANAGER_SET_DEBUG_MODE_INVALID_PARAM = "error: invalid param for setting debug mode.\n"; const std::string MSG_ERR_BUNDLEMANAGER_SET_DEBUG_MODE_INTERNAL_ERROR = "error: internal error for setting debug mode.\n"; const std::string MSG_ERR_BUNDLEMANAGER_SET_DEBUG_MODE_PARCEL_ERROR = "error: parcel error for setting debug mode.\n"; const std::string MSG_ERR_BUNDLEMANAGER_SET_DEBUG_MODE_SEND_REQUEST_ERROR = "error: send request error.\n"; const std::string MSG_ERR_BUNDLEMANAGER_SET_DEBUG_MODE_UID_CHECK_FAILED = "error: uid check failed.\n"; static const std::string TOOL_NAME = "bundle_test_tool"; static const std::string HELP_MSG = "usage: bundle_test_tool \n" "These are common bundle_test_tool commands list:\n" " help list available commands\n" " setrm set module isRemovable by given bundle name and module name\n" " getrm obtain the value of isRemovable by given bundle name and module name\n" " installSandbox indicates install sandbox\n" " uninstallSandbox indicates uninstall sandbox\n" " uninstallPreInstallBundle indicates uninstall preinstall bundle\n" " dumpSandbox indicates dump sandbox info\n" " getStr obtain the value of label by given bundle name, module name and label id\n" " getIcon obtain the value of icon by given bundle name, module name, " "density and icon id\n" " addAppInstallRule obtain the value of install controlRule by given some app id " "control rule type, user id and euid\n" " getAppInstallRule obtain the value of install controlRule by given some app id " "rule type, user id and euid\n" " deleteAppInstallRule obtain the value of install controlRule by given some app id " "user id and euid\n" " cleanAppInstallRule obtain the value of install controlRule by given rule type " "user id and euid\n" " addAppRunningRule obtain the value of app running control rule " "by given controlRule user id and euidn\n" " deleteAppRunningRule obtain the value of app running control rule " "by given controlRule user id and euid\n" " cleanAppRunningRule obtain the value of app running control " "rule by given user id and euid\n" " getAppRunningControlRule obtain the value of app running control rule " "by given user id and euid and some app id\n" " getAppRunningControlRuleResult obtain the value of app running control rule " "by given bundleName user id, euid and controlRuleResult\n" " deployQuickFix deploy a quick fix patch of an already installed bundle\n" " switchQuickFix switch a quick fix patch of an already installed bundle\n" " deleteQuickFix delete a quick fix patch of an already installed bundle\n" " setDebugMode enable signature debug mode\n" " getBundleStats get bundle stats\n" " batchGetBundleStats batch get bundle stats\n" " getAppProvisionInfo get appProvisionInfo\n" " getDistributedBundleName get distributedBundleName\n" " eventCB register then unregister bundle event callback\n" " resetAOTCompileStatus reset AOTCompileStatus\n" " sendCommonEvent send common event\n" " queryDataGroupInfos obtain the data group infos of the application\n" " getGroupDir obtain the data group dir path by data group id\n" " getJsonProfile obtain the json string of the specified module\n" " getOdid obtain the odid of the application\n" " getUidByBundleName obtain the uid string of the specified bundle\n" " implicitQuerySkillUriInfo obtain the skill uri info of the implicit query ability\n" " queryAbilityInfoByContinueType get ability info by continue type\n" " cleanBundleCacheFilesAutomatic clear cache data of a specified size\n" " getContinueBundleName get continue bundle name list\n" " updateAppEncryptedStatus update app encrypted status\n" " getDirByBundleNameAndAppIndex obtain the dir by bundleName and appIndex\n" " getAllBundleDirs obtain all bundle dirs \n" " getAllBundleCacheStat obtain all bundle cache size \n" " cleanAllBundleCache clean all bundle cache \n" " isBundleInstalled determine whether the bundle is installed based on bundleName user " "and appIndex\n" " getCompatibleDeviceType obtain the compatible device type based on bundleName\n" " getSimpleAppInfoForUid get bundlename list and appIndex list by uid list\n" " getBundleNameByAppId get bundlename by appid or appIdentifier\n" " getAssetAccessGroups get asset access groups by bundlename\n" " getAppIdentifierAndAppIndex get appIdentifier and appIndex\n" " setAppDistributionTypes set white list of appDistributionType\n"; const std::string HELP_MSG_GET_REMOVABLE = "usage: bundle_test_tool getrm \n" "eg:bundle_test_tool getrm -m -n \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name get isRemovable by moduleNmae and bundleName\n" " -m, --module-name get isRemovable by moduleNmae and bundleName\n"; const std::string HELP_MSG_NO_REMOVABLE_OPTION = "error: you must specify a bundle name with '-n' or '--bundle-name' \n" "and a module name with '-m' or '--module-name' \n"; const std::string HELP_MSG_SET = "usage: bundle_test_tool setrm \n" "eg:bundle_test_tool setrm -m -n -i 1\n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name set isRemovable by moduleNmae and bundleName\n" " -i, --is-removable set isRemovable 0 or 1\n" " -m, --module-name set isRemovable by moduleNmae and bundleName\n"; const std::string HELP_MSG_INSTALL_SANDBOX = "usage: bundle_test_tool installSandbox \n" "options list:\n" " -h, --help list available commands\n" " -u, --user-id specify a user id\n" " -n, --bundle-name install a sandbox of a bundle\n" " -d, --dlp-type specify type of the sandbox application\n"; const std::string HELP_MSG_UNINSTALL_SANDBOX = "usage: bundle_test_tool uninstallSandbox \n" "options list:\n" " -h, --help list available commands\n" " -u, --user-id specify a user id\n" " -a, --app-index specify a app index\n" " -n, --bundle-name install a sandbox of a bundle\n"; const std::string HELP_MSG_DUMP_SANDBOX = "usage: bundle_test_tool dumpSandbox \n" "options list:\n" " -h, --help list available commands\n" " -u, --user-id specify a user id\n" " -a, --app-index specify a app index\n" " -n, --bundle-name install a sandbox of a bundle\n"; const std::string HELP_MSG_GET_STRING = "usage: bundle_test_tool getStr \n" "eg:bundle_test_tool getStr -m -n -u -i --id \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -m, --module-name specify module name of the application\n" " -u, --user-id specify a user id\n" " -i, --id specify a label id of the application\n"; const std::string HELP_MSG_GET_ICON = "usage: bundle_test_tool getIcon \n" "eg:bundle_test_tool getIcon -m -n -u -d --density -i --id \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -m, --module-name specify module name of the application\n" " -u, --user-id specify a user id\n" " -d, --density specify a density\n" " -i, --id specify a icon id of the application\n"; const std::string HELP_MSG_NO_GETSTRING_OPTION = "error: you must specify a bundle name with '-n' or '--bundle-name' \n" "and a module name with '-m' or '--module-name' \n" "and a userid with '-u' or '--user-id' \n" "and a labelid with '-i' or '--id' \n"; const std::string HELP_MSG_NO_GETICON_OPTION = "error: you must specify a bundle name with '-n' or '--bundle-name' \n" "and a module name with '-m' or '--module-name' \n" "and a userid with '-u' or '--user-id' \n" "and a density with '-d' or '--density' \n" "and a iconid with '-i' or '--id' \n"; const std::string HELP_MSG_ADD_INSTALL_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool addAppInstallRule -a -t -u \n" "options list:\n" " -h, --help list available commands\n" " -a, --app-id specify app id of the application\n" " -e, --euid default euid value is 3057\n" " -t, --control-rule-type specify control type of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_INSTALL_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool getAppInstallRule -t -u \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -t, --control-rule-type specify control type of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_DELETE_INSTALL_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool deleteAppInstallRule -a -t -u \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -a, --app-id specify app id of the application\n" " -t, --control-rule-type specify control type of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_CLEAN_INSTALL_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool cleanAppInstallRule -t -u \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -t, --control-rule-type specify control type of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_ADD_APP_RUNNING_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool addAppRunningRule -c -u \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -c, --control-rule specify control rule of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_DELETE_APP_RUNNING_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool deleteAppRunningRule -c -u \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -c, --control-rule specify control rule of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_CLEAN_APP_RUNNING_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool cleanAppRunningRule -u \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_APP_RUNNING_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool getAppRunningControlRule -u \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_APP_RUNNING_RESULT_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool getAppRunningControlRuleResult -n \n" "options list:\n" " -h, --help list available commands\n" " -e, --euid default euid value is 3057\n" " -n, --bundle-name specify bundle name of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_AUTO_CLEAN_CACHE_RULE = "usage: bundle_test_tool \n" "eg:bundle_test_tool cleanBundleCacheFilesAutomatic -s \n" "options list:\n" " -h, --help list available commands\n" " -s, --cache-size specify the cache size that needs to be cleaned\n"; const std::string HELP_MSG_NO_ADD_INSTALL_RULE_OPTION = "error: you must specify a app id with '-a' or '--app-id' \n" "and a control type with '-t' or '--control-rule-type' \n" "and a userid with '-u' or '--user-id' \n"; const std::string HELP_MSG_NO_GET_INSTALL_RULE_OPTION = "error: you must specify a control type with '-t' or '--control-rule-type' \n" "and a userid with '-u' or '--user-id' \n"; const std::string HELP_MSG_NO_DELETE_INSTALL_RULE_OPTION = "error: you must specify a control type with '-a' or '--app-id' \n" "and a userid with '-u' or '--user-id' \n"; const std::string HELP_MSG_NO_CLEAN_INSTALL_RULE_OPTION = "error: you must specify a control type with '-t' or '--control-rule-type' \n" "and a userid with '-u' or '--user-id' \n"; const std::string HELP_MSG_NO_APP_RUNNING_RULE_OPTION = "error: you must specify a app running type with '-c' or '--control-rule' \n" "and a userid with '-u' or '--user-id' \n"; const std::string HELP_MSG_NO_CLEAN_APP_RUNNING_RULE_OPTION = "error: you must specify a app running type with a userid '-u' or '--user-id \n"; const std::string HELP_MSG_NO_GET_ALL_APP_RUNNING_RULE_OPTION = "error: you must specify a app running type with '-a' or '--app-id' \n" "and a userid with '-u' or '--user-id' \n"; const std::string HELP_MSG_NO_GET_APP_RUNNING_RULE_OPTION = "error: you must specify a app running type with '-n' or '--bundle-name' \n" "and a userid with '-u' or '--user-id' \n"; const std::string HELP_MSG_NO_AUTO_CLEAN_CACHE_OPTION = "error: you must specify a cache size with '-s' or '--cache-size' \n"; const std::string HELP_MSG_DEPLOY_QUICK_FIX = "usage: bundle_test_tool deploy quick fix \n" "eg:bundle_test_tool deployQuickFix -p \n" "options list:\n" " -h, --help list available commands\n" " -p, --patch-path specify patch path of the patch\n" " -d, --debug specify deploy mode, 0 represents release, 1 represents debug\n"; const std::string HELP_MSG_SWITCH_QUICK_FIX = "usage: bundle_test_tool switch quick fix \n" "eg:bundle_test_tool switchQuickFix -n \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundleName of the patch\n" " -e, --enbale enable a deployed patch of disable an under using patch,\n" " 1 represents enable and 0 represents disable\n"; const std::string HELP_MSG_DELETE_QUICK_FIX = "usage: bundle_test_tool delete quick fix \n" "eg:bundle_test_tool deleteQuickFix -n \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundleName of the patch\n"; const std::string HELP_MSG_SET_DEBUG_MODE = "usage: bundle_test_tool setDebugMode \n" "eg:bundle_test_tool setDebugMode -e <0/1>\n" "options list:\n" " -h, --help list available commands\n" " -e, --enable enable signature debug mode, 1 represents enable debug mode and 0\n" " represents disable debug mode\n"; const std::string HELP_MSG_GET_BUNDLE_STATS = "usage: bundle_test_tool getBundleStats \n" "eg:bundle_test_tool getBundleStats -n \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -u, --user-id specify a user id\n" " -a, --app-index specify a app index\n"; const std::string HELP_MSG_BATCH_GET_BUNDLE_STATS = "usage: bundle_test_tool batchGetBundleStats \n" "eg:bundle_test_tool batchGetBundleStats -n , -u -s \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_APP_PROVISION_INFO = "usage: bundle_test_tool getAppProvisionInfo \n" "eg:bundle_test_tool getAppProvisionInfo -n \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_DISTRIBUTED_BUNDLE_NAME = "usage: bundle_test_tool getDistributedBundleName \n" "eg:bundle_test_tool getDistributedBundleName -n -a \n" "options list:\n" " -h, --help list available commands\n" " -n, --network-id specify networkId of the application\n" " -a, --access-token-id specify a accessTokenId of the application \n"; const std::string HELP_MSG_BUNDLE_EVENT_CALLBACK = "usage: bundle_test_tool eventCB \n" "options list:\n" " -h, --help list available commands\n" " -o, --onlyUnregister only call unregister, default will call register then unregister\n" " -u, --uid specify a uid, default is foundation uid\n"; const std::string HELP_MSG_RESET_AOT_COMPILE_StATUS = "usage: bundle_test_tool resetAOTCompileStatus \n" "options list:\n" " -h, --help list available commands\n" " -b, --bundle-name specify bundle name\n" " -m, --module-name specify module name\n" " -t, --trigger-mode specify trigger mode, default is 0\n" " -u, --uid specify a uid, default is bundleName's uid\n"; const std::string HELP_MSG_GET_PROXY_DATA = "usage: bundle_test_tool getProxyDataInfos \n" "eg:bundle_test_tool getProxyDataInfos -m -n -u \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -m, --module-name specify module name of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_ALL_PROXY_DATA = "usage: bundle_test_tool getAllProxyDataInfos \n" "eg:bundle_test_tool getProxyDataInfos -u \n" "options list:\n" " -h, --help list available commands\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_NO_BUNDLE_NAME_OPTION = "error: you must specify a bundle name with '-n' or '--bundle-name' \n"; const std::string HELP_MSG_NO_NETWORK_ID_OPTION = "error: you must specify a network id with '-n' or '--network-id' \n"; const std::string HELP_MSG_NO_ACCESS_TOKEN_ID_OPTION = "error: you must specify a access token id with '-n' or '--access-token-id' \n"; const std::string HELP_MSG_SET_EXT_NAME_OR_MIME_TYPE = "usage: bundle_test_tool setExtNameOrMimeTypeToApp \n" "eg:bundle_test_tool getProxyDataInfos -m -n -a \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -m, --module-name specify module name of the application\n" " -a, --ability-name specify ability name of the application\n" " -e, --ext-name specify the ext-name\n" " -t, --mime-type specify the mime-type\n"; const std::string HELP_MSG_DEL_EXT_NAME_OR_MIME_TYPE = "usage: bundle_test_tool setExtNameOrMimeTypeToApp \n" "eg:bundle_test_tool getProxyDataInfos -m -n -a \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -m, --module-name specify module name of the application\n" " -a, --ability-name specify ability name of the application\n" " -e, --ext-name specify the ext-name\n" " -t, --mime-type specify the mime-type\n"; const std::string HELP_MSG_QUERY_DATA_GROUP_INFOS = "usage: bundle_test_tool queryDataGroupInfos \n" "eg:bundle_test_tool queryDataGroupInfos -n -u \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_GROUP_DIR = "usage: bundle_test_tool getGroupDir \n" "eg:bundle_test_tool getGroupDir -d \n" "options list:\n" " -h, --help list available commands\n" " -d, --data-group-id specify bundle name of the application\n"; const std::string HELP_MSG_NO_GET_UID_BY_BUNDLENAME = "error: you must specify a bundle name with '-n' or '--bundle-name' \n" "and a userId with '-u' or '--user-id' \n" "and a appIndex with '-a' or '--app-index' \n"; const std::string HELP_MSG_GET_DIR_BY_BUNDLENAME_AND_APP_INDEX = "usage: bundle_test_tool getDirByBundleNameAndAppIndex \n" "eg:bundle_test_tool getDirByBundleNameAndAppIndex -n -a \n" "options list:\n" " -h, --help list available commands\n" " -n, --bundle-name specify bundle name of the application\n" " -a, --app-index specify a app index\n"; const std::string HELP_MSG_GET_ALL_BUNDLE_DIRS = "usage: bundle_test_tool getAllBundleDirs \n" "eg:bundle_test_tool getAllBundleDirs -u \n" "options list:\n" " -h, --help list available commands\n" " -u, --user-id specify a user id\n"; const std::string HELP_MSG_GET_ALL_BUNDLE_CACHE_STAT = "usage: bundle_test_tool getAllBundleCacheStat \n" "eg:bundle_test_tool getAllBundleCacheStat\n" "options list:\n" " -h, --help list available commands\n" " -u, --uid specify a uid\n"; const std::string HELP_MSG_CLEAN_ALL_BUNDLE_CACHE = "usage: bundle_test_tool cleanAllBundleCache \n" "eg:bundle_test_tool cleanAllBundleCache\n" "options list:\n" " -h, --help list available commands\n" " -u, --uid specify a uid\n"; const std::string HELP_MSG_UPDATE_APP_EXCRYPTED_STATUS = "error: you must specify a bundle name with '-n' or '--bundle-name' \n" "and a isExisted with '-e' or '--existed' \n" "and a appIndex with '-a' or '--app-index' \n"; const std::string HELP_MSG_NO_GET_JSON_PROFILE_OPTION = "error: you must specify a bundle name with '-n' or '--bundle-name' \n" "and a module name with '-m' or '--module-name' \n" "and a userId with '-u' or '--user-id' \n" "and a json profile type with '-p' or '--profile-type' \n"; const std::string HELP_MSG_NO_GET_UNINSTALLED_BUNDLE_INFO_OPTION = "error: you must specify a bundle name with '-n' or '--bundle-name' \n"; const std::string HELP_MSG_NO_IMPLICIT_QUERY_SKILL_URI_INFO = "error: you must specify a bundle name with '-n' or '--bundle-name' \n" "and a action with '-a' or '--action' \n" "and a entity with '-e' or '--entity' \n"; const std::string HELP_MSG_GET_ODID = "usage: bundle_test_tool getOdid \n" "eg:bundle_test_tool getOdid -u \n" "options list:\n" " -h, --help list available commands\n" " -u, --uid specify uid of the application\n"; const std::string HELP_MSG_GET_COMPATIBLE_DEVICE_TYPE = "usage: bundle_test_tool getCompatibleDeviceType