
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
@wisdomgarden/cloak
Advanced tools
Cloak is a hybrid development framework for HarmonyOS, enabling quick packaging of H5 applications and native capability access
Cloak 是专为 HarmonyOS 设计的混合开发框架,类似 Cordova 和 Capacitor,但具备 更轻量、更高性能 的特性。
该框架可将 Web 应用快速转换为原生应用,同时通过插件机制访问 HarmonyOS 原生能力。
CloakPluginPermission ohpm i @wisdomgarden/cloak-plugin-permission
用于检查、请求 HarmonyOS 权限。
创建 EmptyAbility 应用
参考华为官方文档:构建第一个ArkTS应用(Stage模型)
安装 Cloak 框架
ohpm install @wisdomgarden/cloak
安装完成后即可运行内置示例应用。
创建配置文件
在资源目录新建 entry/src/main/resources/rawfile/config.json:
{
"APP_FOLDER": "www",
"APP_HOST": "http://localhost",
"APP_IDENTITY_USER_AGENT": "YourAppName/HarmonyOS",
"IS_DEBUG": false,
"WEB_VIEW_USE_APP_PERMISSION": true,
"APP_USE_REAL_HOST_RESOURCE": false
}
部署 H5 资源
将 H5 应用文件(以 index.html 为入口)复制至 entry/src/main/resources/rawfile/www
调试与运行
通过 DevEco Studio 进行编译和实时调试。
适配 H5 能力
至此,配合 CloakPluginPermission 获得系统权限,
Cloak 已经可以适配绝大多数 H5 应用所需的能力。比如 navigator.mediaDevices, input (capture, file), navigator.geolocation, indexedDB 等。可参见 Demo
插件开发
根据需求开发自定义插件,或通过社区获取适配 HarmonyOS 的插件。
完成使用方法步骤,其他可参照: https://github.com/WisdomGardenInc/Cloak
FAQs
Cloak is a hybrid development framework for HarmonyOS, enabling quick packaging of H5 applications and native capability access
The npm package @wisdomgarden/cloak receives a total of 9 weekly downloads. As such, @wisdomgarden/cloak popularity was classified as not popular.
We found that @wisdomgarden/cloak demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.