* Copyright (c) 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.
*/
#ifndef FOUNDATION_ABILITY_RUNTIME_SIMULATOR_COMMON_BUNDLE_INFO_H
#define FOUNDATION_ABILITY_RUNTIME_SIMULATOR_COMMON_BUNDLE_INFO_H
#include <string>
#include <vector>
#include "ability_info.h"
#include "application_info.h"
#include "extension_ability_info.h"
#include "hap_module_info.h"
#include "overlay_bundle_info.h"
namespace OHOS {
namespace AppExecFwk {
enum BundleFlag {
GET_BUNDLE_DEFAULT = 0x00000000,
GET_BUNDLE_WITH_ABILITIES = 0x00000001,
GET_BUNDLE_WITH_REQUESTED_PERMISSION = 0x00000010,
GET_BUNDLE_WITH_EXTENSION_INFO = 0x00000020,
GET_BUNDLE_WITH_HASH_VALUE = 0x00000030,
GET_BUNDLE_WITH_MENU = 0x00000040,
GET_BUNDLE_WITH_ROUTER_MAP = 0x00000080,
GET_BUNDLE_WITH_SKILL = 0x00000800,
};
enum class GetBundleInfoFlag {
GET_BUNDLE_INFO_DEFAULT = 0x00000000,
GET_BUNDLE_INFO_WITH_APPLICATION = 0x00000001,
GET_BUNDLE_INFO_WITH_HAP_MODULE = 0x00000002,
GET_BUNDLE_INFO_WITH_ABILITY = 0x00000004,
GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY = 0x00000008,
GET_BUNDLE_INFO_WITH_REQUESTED_PERMISSION = 0x00000010,
GET_BUNDLE_INFO_WITH_METADATA = 0x00000020,
GET_BUNDLE_INFO_WITH_DISABLE = 0x00000040,
GET_BUNDLE_INFO_WITH_SIGNATURE_INFO = 0x00000080,
GET_BUNDLE_INFO_WITH_MENU = 0x00000100,
GET_BUNDLE_INFO_WITH_ROUTER_MAP = 0x00000200,
GET_BUNDLE_INFO_WITH_SKILL = 0x00000800,
GET_BUNDLE_INFO_ONLY_WITH_LAUNCHER_ABILITY = 0x00001000,
GET_BUNDLE_INFO_OF_ANY_USER = 0x00002000,
GET_BUNDLE_INFO_EXCLUDE_CLONE = 0x00004000,
};
struct RequestPermissionUsedScene {
std::string when;
std::vector<std::string> abilities;
};
struct RequestPermission {
uint32_t reasonId = 0;
std::string name;
std::string moduleName;
std::string reason;
RequestPermissionUsedScene usedScene;
};
struct SignatureInfo {
std::string appId;
std::string fingerprint;
std::string appIdentifier;
std::string certificate;
};
struct BundleInfo {
bool isNewVersion = false;
bool isKeepAlive = false;
bool singleton = false;
bool isPreInstallApp = false;
bool isNativeApp = false;
bool entryInstallationFree = false;
bool isDifferentName = false;
bool hasPlugin = false;
uint32_t versionCode = 0;
uint32_t minCompatibleVersionCode = 0;
uint32_t compatibleVersion = 0;
uint32_t targetVersion = 0;
int32_t appIndex = 0;
int32_t minSdkVersion = -1;
int32_t maxSdkVersion = -1;
int32_t overlayType = NON_OVERLAY_TYPE;
int uid = -1;
int gid = -1;
int64_t installTime = 0;
int64_t updateTime = 0;
int64_t firstInstallTime = 0;
std::string name;
std::string versionName;
std::string vendor;
std::string releaseType;
std::string mainEntry;
std::string entryModuleName;
std::string appId;
std::string cpuAbi;
std::string seInfo;
std::string label;
std::string description;
std::string jointUserId;
SignatureInfo signatureInfo;
std::vector<std::string> oldAppIds;
std::vector<AbilityInfo> abilityInfos;
std::vector<ExtensionAbilityInfo> extensionInfos;
std::vector<HapModuleInfo> hapModuleInfos;
std::vector<std::string> hapModuleNames;
std::vector<std::string> moduleNames;
std::vector<std::string> modulePublicDirs;
std::vector<std::string> moduleDirs;
std::vector<std::string> moduleResPaths;
std::vector<std::string> reqPermissions;
std::vector<std::string> defPermissions;
std::vector<int32_t> reqPermissionStates;
std::vector<RequestPermission> reqPermissionDetails;
std::vector<OverlayBundleInfo> overlayBundleInfos;
std::vector<RouterItem> routerArray;
ApplicationInfo applicationInfo;
};
}
}
#endif