/*
* Copyright (c) 2023 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 "inner_bundle_info.h"
#include <algorithm>
#include <deque>
#include <regex>
#include "common_profile.h"
#include "hilog.h"
namespace OHOS {
namespace AppExecFwk {
namespace ProfileReader {
thread_local int32_t parseResult;
}
namespace {
const std::string APP_TYPE = "appType";
const std::string UID = "uid";
const std::string GID = "gid";
const std::string BASE_DATA_DIR = "baseDataDir";
const std::string BUNDLE_STATUS = "bundleStatus";
const std::string BASE_APPLICATION_INFO = "baseApplicationInfo";
const std::string BASE_BUNDLE_INFO = "baseBundleInfo";
const std::string BASE_ABILITY_INFO = "baseAbilityInfos";
const std::string INNER_MODULE_INFO = "innerModuleInfos";
const std::string SKILL_INFOS = "skillInfos";
const std::string USER_ID = "userId_";
const std::string APP_FEATURE = "appFeature";
const std::string CAN_UNINSTALL = "canUninstall";
const std::string NAME = "name";
const std::string MODULE_PACKAGE = "modulePackage";
const std::string MODULE_PATH = "modulePath";
const std::string MODULE_NAME = "moduleName";
const std::string MODULE_DESCRIPTION = "description";
const std::string MODULE_DESCRIPTION_ID = "descriptionId";
const std::string MODULE_ICON = "icon";
const std::string MODULE_ICON_ID = "iconId";
const std::string MODULE_LABEL = "label";
const std::string MODULE_LABEL_ID = "labelId";
const std::string MODULE_DESCRIPTION_INSTALLATION_FREE = "installationFree";
const std::string MODULE_IS_REMOVABLE = "isRemovable";
const std::string MODULE_UPGRADE_FLAG = "upgradeFlag";
const std::string MODULE_IS_ENTRY = "isEntry";
const std::string MODULE_METADATA = "metaData";
const std::string MODULE_COLOR_MODE = "colorMode";
const std::string MODULE_DISTRO = "distro";
const std::string MODULE_REQ_CAPABILITIES = "reqCapabilities";
const std::string MODULE_DATA_DIR = "moduleDataDir";
const std::string MODULE_RES_PATH = "moduleResPath";
const std::string MODULE_HAP_PATH = "hapPath";
const std::string MODULE_ABILITY_KEYS = "abilityKeys";
const std::string MODULE_SKILL_KEYS = "skillKeys";
const std::string MODULE_FORMS = "formInfos";
const std::string MODULE_SHORTCUT = "shortcutInfos";
const std::string MODULE_COMMON_EVENT = "commonEvents";
const std::string MODULE_MAIN_ABILITY = "mainAbility";
const std::string MODULE_ENTRY_ABILITY_KEY = "entryAbilityKey";
const std::string MODULE_DEPENDENCIES = "dependencies";
const std::string MODULE_IS_LIB_ISOLATED = "isLibIsolated";
const std::string MODULE_NATIVE_LIBRARY_PATH = "nativeLibraryPath";
const std::string MODULE_CPU_ABI = "cpuAbi";
const std::string NEW_BUNDLE_NAME = "newBundleName";
const std::string MODULE_SRC_PATH = "srcPath";
const std::string MODULE_HASH_VALUE = "hashValue";
const std::string SCHEME_SEPARATOR = "://";
const std::string PORT_SEPARATOR = ":";
const std::string PATH_SEPARATOR = "/";
const std::string IS_PREINSTALL_APP = "isPreInstallApp";
const std::string INSTALL_MARK = "installMark";
const char WILDCARD = '*';
const std::string TYPE_WILDCARD = "*/*";
const std::string INNER_BUNDLE_USER_INFOS = "innerBundleUserInfos";
const std::string MODULE_PROCESS = "process";
const std::string MODULE_SRC_ENTRANCE = "srcEntrance";
const std::string MODULE_DEVICE_TYPES = "deviceTypes";
const std::string MODULE_VIRTUAL_MACHINE = "virtualMachine";
const std::string MODULE_UI_SYNTAX = "uiSyntax";
const std::string MODULE_PAGES = "pages";
const std::string MODULE_META_DATA = "metadata";
const std::string MODULE_REQUEST_PERMISSIONS = "requestPermissions";
const std::string MODULE_DEFINE_PERMISSIONS = "definePermissions";
const std::string MODULE_EXTENSION_KEYS = "extensionKeys";
const std::string MODULE_EXTENSION_SKILL_KEYS = "extensionSkillKeys";
const std::string MODULE_IS_MODULE_JSON = "isModuleJson";
const std::string MODULE_IS_STAGE_BASED_MODEL = "isStageBasedModel";
const std::string BUNDLE_IS_NEW_VERSION = "isNewVersion";
const std::string BUNDLE_IS_NEED_UPDATE = "upgradeFlag";
const std::string BUNDLE_BASE_EXTENSION_INFOS = "baseExtensionInfos";
const std::string BUNDLE_EXTENSION_SKILL_INFOS = "extensionSkillInfos";
const std::string BUNDLE_PACK_INFO = "bundlePackInfo";
const std::string ALLOWED_ACLS = "allowedAcls";
const std::string META_DATA_SHORTCUTS_NAME = "ohos.ability.shortcuts";
const std::string APP_INDEX = "appIndex";
const std::string BUNDLE_IS_SANDBOX_APP = "isSandboxApp";
const std::string BUNDLE_SANDBOX_PERSISTENT_INFO = "sandboxPersistentInfo";
const std::string DISPOSED_STATUS = "disposedStatus";
const std::string MODULE_COMPILE_MODE = "compileMode";
const std::string BUNDLE_HQF_INFOS = "hqfInfos";
const std::string MODULE_TARGET_MODULE_NAME = "targetModuleName";
const std::string MODULE_TARGET_PRIORITY = "targetPriority";
const std::string MODULE_OVERLAY_MODULE_INFO = "overlayModuleInfo";
const std::string OVERLAY_BUNDLE_INFO = "overlayBundleInfo";
const std::string OVERLAY_TYPE = "overlayType";
const std::string APPLY_QUICK_FIX_FREQUENCY = "applyQuickFixFrequency";
const std::string MODULE_ATOMIC_SERVICE_MODULE_TYPE = "atomicServiceModuleType";
const std::string MODULE_PRELOADS = "preloads";
const std::string HAS_ATOMIC_SERVICE_CONFIG = "hasAtomicServiceConfig";
const std::string MAIN_ATOMIC_MODULE_NAME = "mainAtomicModuleName";
inline CompileMode ConvertCompileMode(const std::string& compileMode)
{
if (compileMode == Profile::COMPILE_MODE_ES_MODULE) {
return CompileMode::ES_MODULE;
} else {
return CompileMode::JS_BUNDLE;
}
}
const std::string NameAndUserIdToKey(const std::string& bundleName, int32_t userId)
{
return bundleName + Constants::FILE_UNDERLINE + std::to_string(userId);
}
} // namespace
bool Skill::MatchAction(const std::string& action) const
{
// config actions empty, no match
if (actions.empty()) {
return false;
}
// config actions not empty, param empty, match
if (action.empty()) {
return true;
}
auto actionMatcher = [action](const std::string& configAction) {
if (action == configAction) {
return true;
}
if (action == Constants::ACTION_HOME && configAction == Constants::WANT_ACTION_HOME) {
return true;
}
if (action == Constants::WANT_ACTION_HOME && configAction == Constants::ACTION_HOME) {
return true;
}
return false;
};
// config actions not empty, param not empty, if config actions contains param action, match
return std::find_if(actions.cbegin(), actions.cend(), actionMatcher) != actions.cend();
}
bool Skill::MatchEntities(const std::vector<std::string>& paramEntities) const
{
// param entities empty, match
if (paramEntities.empty()) {
return true;
}
// config entities empty, param entities not empty, not match
if (entities.empty()) {
return false;
}
// config entities not empty, param entities not empty, if every param entity in config entities, match
std::vector<std::string>::size_type size = paramEntities.size();
for (std::vector<std::string>::size_type i = 0; i < size; i++) {
bool ret = std::find(entities.cbegin(), entities.cend(), paramEntities[i]) == entities.cend();
if (ret) {
return false;
}
}
return true;
}
bool Skill::MatchUriAndType(const std::string& uriString, const std::string& type) const
{
if (uriString.empty() && type.empty()) {
// case1 : param uri
没有合适的资源?快使用搜索试试~ 我知道了~
ArkUI-X应用框架适配层
共306个文件
h:128个
cpp:117个
gn:35个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 167 浏览量
2023-11-11
09:42:47
上传
评论
收藏 529KB ZIP 举报
温馨提示
ArkUI-X 应用框架(AppFramework)适配层是在不同平台上模拟OpenHarmony应用框架的运行环境,将应用的生命周期以及开发模型适配到对应的系统平台上,确保应用的开发模式保持兼容
资源推荐
资源详情
资源评论
收起资源包目录
ArkUI-X应用框架适配层 (306个子文件)
.clang-format 3KB
inner_bundle_info.cpp 90KB
resource_manager_addon.cpp 67KB
module_profile.cpp 49KB
js_ability_delegator.cpp 44KB
js_window.cpp 40KB
application_info.cpp 25KB
want.cpp 23KB
ability_info.cpp 23KB
js_application_context_utils.cpp 22KB
ability_delegator.cpp 21KB
event_queue.cpp 19KB
js_window_stage.cpp 18KB
js_ability.cpp 18KB
bundle_info.cpp 17KB
event_runner.cpp 17KB
rs_marshalling_helper.cpp 17KB
rs_marshalling_helper.cpp 17KB
js_window_utils.cpp 16KB
platform_event_runner.cpp 15KB
js_runtime.cpp 15KB
js_context_utils.cpp 15KB
hap_module_info.cpp 14KB
js_window_manager.cpp 14KB
js_ability_context.cpp 14KB
app_main.cpp 13KB
render_context.cpp 13KB
event_handler.cpp 12KB
js_data_struct_converter.cpp 11KB
js_runtime_utils.cpp 10KB
connect_server_manager.cpp 10KB
js_ability_stage.cpp 9KB
js_display_manager.cpp 9KB
js_worker.cpp 9KB
application_context.cpp 9KB
ability_business_error.cpp 9KB
epoll_io_waiter.cpp 8KB
ability_runtime_error_util.cpp 8KB
rs_render_service_client.cpp 7KB
ability_lifecycle_callback.cpp 7KB
js_window_register_manager.cpp 7KB
js_test_runner.cpp 7KB
ability_stage_context.cpp 7KB
ability_stage.cpp 7KB
inner_event.cpp 6KB
application.cpp 6KB
napi_common_want.cpp 6KB
json_want.cpp 6KB
platform_event_runner.cpp 6KB
ability_context_impl.cpp 6KB
ability.cpp 5KB
js_timer.cpp 5KB
native_implement_eventhandler.cpp 5KB
js_ability_delegator_registry.cpp 5KB
js_display.cpp 5KB
napi_common_util.cpp 5KB
js_ability_delegator_utils.cpp 5KB
bundle_container.cpp 5KB
display_manager.cpp 4KB
js_console_log.cpp 4KB
inner_bundle_user_info.cpp 4KB
js_ability_monitor.cpp 4KB
rs_surface_android.cpp 4KB
bundle_user_info.cpp 3KB
configuration_constant_module.cpp 3KB
js_window_listener.cpp 3KB
js_ability_stage_context.cpp 3KB
ability_constant_module.cpp 3KB
iability_monitor.cpp 3KB
singleton_container.cpp 3KB
stage_asset_manager.cpp 3KB
rs_vsync_client_android.cpp 3KB
configuration.cpp 3KB
rs_system_properties.cpp 3KB
rs_system_properties.cpp 3KB
ability_monitor.cpp 3KB
window_stage.cpp 3KB
iability_stage_monitor.cpp 3KB
none_io_waiter.cpp 3KB
ability_delegator_args.cpp 2KB
ability_stage_context_module.cpp 2KB
application_context_module.cpp 2KB
ability_context_module.cpp 2KB
rs_ashmem_helper.cpp 2KB
rs_ashmem_helper.cpp 2KB
declarative_module_preloader.cpp 2KB
ability_stage_module.cpp 2KB
window_stage_module.cpp 2KB
rs_surface_frame_ios.cpp 2KB
rs_surface_frame_android.cpp 2KB
log_aosp.cpp 2KB
js_error_utils.cpp 2KB
ability_module.cpp 2KB
context_module.cpp 2KB
ui_content.cpp 2KB
test_runner.cpp 2KB
display.cpp 2KB
window_option.cpp 2KB
color_parser.cpp 2KB
module_info.cpp 2KB
共 306 条
- 1
- 2
- 3
- 4
资源评论
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6834
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功