{"id":25736866,"url":"https://github.com/wisdomgardeninc/cloak","last_synced_at":"2026-05-16T08:40:37.863Z","repository":{"id":279390365,"uuid":"938604715","full_name":"WisdomGardenInc/cloak","owner":"WisdomGardenInc","description":"Cloak - A Hybrid Development Framework for HarmonyOS","archived":false,"fork":false,"pushed_at":"2025-02-25T10:22:35.000Z","size":237,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-25T10:36:05.724Z","etag":null,"topics":["capacitor","capacitor-plugin","cordova","cordova-plugin","h5","harmonyos","harmonyos-next","hybrid","hybrid-app","jsbridge","webview"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WisdomGardenInc.png","metadata":{"files":{"readme":"README-EN.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-25T08:07:06.000Z","updated_at":"2025-02-25T10:22:39.000Z","dependencies_parsed_at":"2025-02-25T10:47:17.842Z","dependency_job_id":null,"html_url":"https://github.com/WisdomGardenInc/cloak","commit_stats":null,"previous_names":["wisdomgardeninc/cloak"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WisdomGardenInc%2Fcloak","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WisdomGardenInc%2Fcloak/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WisdomGardenInc%2Fcloak/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WisdomGardenInc%2Fcloak/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WisdomGardenInc","download_url":"https://codeload.github.com/WisdomGardenInc/cloak/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240802635,"owners_count":19860022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["capacitor","capacitor-plugin","cordova","cordova-plugin","h5","harmonyos","harmonyos-next","hybrid","hybrid-app","jsbridge","webview"],"created_at":"2025-02-26T06:22:40.461Z","updated_at":"2026-05-16T08:40:37.858Z","avatar_url":"https://github.com/WisdomGardenInc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[**中文版**](./README.md) | [English Version](./README-EN.md)\n\n# **Cloak** - Hybrid Development Framework for HarmonyOS\n\n**Cloak** is a lightweight hybrid development framework for **HarmonyOS**, inspired by [Cordova](https://cordova.apache.org/) and [Capacitor](https://capacitorjs.com/), but with **simpler implementation** and **better performance**.\n\nEnables rapid conversion of web applications to native HarmonyOS apps with plugin-based native API access.\n\n---\n\n## Core Features\n\n- **Quick Packaging**\n  Compile H5/web apps into HarmonyOS applications within minutes\n\n- **Native API Access**\n  Extend functionality through HarmonyOS native plugins\n\n- **Optimized WebView**\n  High-performance WebView container with hardware acceleration\n\n- **Plugin Development**\n  Easily create HarmonyOS native plugins using TypeScript/ArkTS\n\n---\n\n## Important Notes\n\n- **No Compatibility** with existing Cordova/Capacitor plugins\n  All plugins must be **redeveloped** using HarmonyOS native APIs\n\n### Built-in Plugins\n\n- **[App](https://github.com/WisdomGardenInc/Cloak/blob/master/docs/plugins/App/README-EN.md)**\n\n  Provides app lifecycle and hardware event handling. No separate installation required.\n\n- **[Device](https://github.com/WisdomGardenInc/Cloak/blob/master/docs/plugins/Device/README-EN.md)**\n\n  Provides device information and system language. No separate installation required.\n  \n### Existing Plugins\n\n  Each plugin also has a corresponding `npm` package with the same name, making it convenient for `TypeScript` and frontend **extensions**.\n\n- **[CloakPluginPermission](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginPermission/README-EN.md)**\n  \n  Used to check and request HarmonyOS permissions.\n\n  ```bash\n  ohpm i @wisdomgarden/cloak-plugin-permission\n  npm i @wisdomgarden/cloak-plugin-permission # optional\n  ```\n\n- **[CloakPluginHttp](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginHttp/README-EN.md)**\n  \n  Used to make Native HTTP requests within Cloak applications.\n\n  ```bash\n  ohpm i @wisdomgarden/cloak-plugin-http\n  npm i @wisdomgarden/cloak-plugin-http # optional\n  ```\n\n- **[CloakPluginInAppBrowser](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginInAppBrowser/README-EN.md)**\n  \n  Used to open internal browsers in Cloak applications and perform operations.\n\n  ```bash\n  ohpm i @wisdomgarden/cloak-plugin-inappbrowser\n  npm i @wisdomgarden/cloak-plugin-inappbrowser # optional\n  ```\n\n- **[CloakPluginOpenNativeSettings](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginOpenNativeSettings/README-EN.md)**\n\n  used for opening native settings pages within Cloak applications\n\n  ```bash\n  ohpm i @wisdomgarden/cloak-plugin-open-native-settings\n  npm i @wisdomgarden/cloak-plugin-open-native-settings # optional\n  ```\n\n- **[CloakPluginJpush](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginJpush/README-EN.md)**\n\n  Used to integrate JPush in Cloak applications to receive notifications.\n\n  ```bash\n  ohpm install @wisdomgarden/cloak-plugin-jpush\n  npm install @wisdomgarden/cloak-plugin-jpush # optional\n  ```\n\n\n- **[CloakPluginCodeScanner](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginCodeScanner/README-EN.md)**\n\n  Used for QR code scanning in Cloak applications.\n\n  ```bash\n  ohpm install @wisdomgarden/cloak-plugin-code-scanner\n  npm install @wisdomgarden/cloak-plugin-code-scanner # optional\n  ```\n\n- **[CloakPluginDarkMode](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginDarkMode/README.md)**\n  \n  Monitor system dark mode state and switch themes dynamically in Cloak apps.\n\n  ```bash\n  ohpm install @wisdomgarden/cloak-plugin-darkmode\n  npm install @wisdomgarden/cloak-plugin-darkmode # optional\n  ```\n\n***✨✨✨ More plugins are coming soon, stay tuned. ✨✨✨***\n\n---\n\n## Getting Started\n\n### Run Demo App\n1. **Create EmptyAbility Project**\n  \n   Follow official guide: [Building the First ArkTS Application in Stage Model](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/start-with-ets-stage-V5)\n\n\n2. **Install Cloak Framework**\n   ```bash\n   ohpm install @wisdomgarden/cloak\n   ```\n   The built-in demo will be automatically available.\n\n---\n\n### Integrate Your Web App\n3. **Create Config File**\n  Add `entry/src/main/resources/rawfile/config.json`:\n   ```json\n   {\n     \"APP_FOLDER\": \"www\",\n     \"APP_HOST\": \"http://localhost\",\n     \"APP_IDENTITY_USER_AGENT\": \"YourAppName/HarmonyOS\",\n     \"IS_DEBUG\": false,\n     \"WEB_VIEW_USE_APP_PERMISSION\": true,\n     \"APP_USE_REAL_HOST_RESOURCE\": false\n   }\n   ```\n\n\n4. **Deploy Web Assets**\n\n   Copy your web app (must contain **index.html**) to `entry/src/main/resources/rawfile/www`\n\n\n5. **Initialize Framework**\n   \n   Modify `entry/src/main/ets/entryability/EntryAbility.ets`, add following code to `onCreate` method:\n   \n   ```typescript\n   import { Cloak } from '@wisdomgarden/cloak';\n   \n   onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {\n      // ...\n      \n      const cloak = new Cloak(this)\n      // cloak.addPlugins([\n      //   new CloakPluginPermission(),\n      //   new CloakPluginDevice(),\n      //   new CloakPluginGeolocation(),\n      //   new CloakPluginInAppBrowser(),\n      // ])\n   }\n   ```\n   \n   Modify `entry/src/main/ets/pages/Index.ets`, show the webview:\n   \n   ```typescript\n   import { CloakWebview } from \"@wisdomgarden/cloak\"\n   \n   @Entry\n   @Component\n   struct CloakIndex {\n      build() {\n         Column() {\n            CloakWebview()\n         }\n      }\n   }\n   ```\n\n\n6. **Debug \u0026 Run**\n\n   Use DevEco Studio for real-time debugging\n\n\n7. **Adapting H5 Capabilities**\n\n   At this point, with the help of **[CloakPluginPermission](https://github.com/WisdomGardenInc/CloakPlugins/blob/master/plugins/CloakPluginPermission/README-EN.md)** to obtain system permissions, Cloak can now adapt to the majority of capabilities required by H5 applications. For example, `navigator.mediaDevices`, `input (capture, file)`, `navigator.geolocation`, `indexedDB`, etc. Please refer to the [Demo](https://github.com/WisdomGardenInc/Cloak/tree/master/entry/src/main/resources/rawfile/www) for more details.\n\n\n8. **Plugin Development**\n\n   Develop custom plugins or find community plugins via [OHPM registry](https://ohpm.openharmony.cn)\n\n## Example\n\nComplete the [Getting Started](#getting-started) steps, and refer to: https://github.com/WisdomGardenInc/Cloak for more details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisdomgardeninc%2Fcloak","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwisdomgardeninc%2Fcloak","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwisdomgardeninc%2Fcloak/lists"}