![]()
Obsidian for HarmonyOS
Run the Obsidian note-taking experience you know and love on HarmonyOS devices — with multi-window support, one-tap Huawei Account sign-in, Huawei Cloud sync, and comprehensive native system integration.
OHsidian is an unofficial port of the Obsidian note-taking application for the HarmonyOS (HongMeng) platform. Rather than reimplementing Obsidian from scratch, it wraps the original Obsidian (obsidian.asar) inside a complete Electron compatibility layer running atop the HarmonyOS native runtime.
At its core, OHsidian shims the Electron API surface using HarmonyOS native capabilities. A C++ native library (libadapter.so), an ArkTS adapter layer, and a JSBind bridge work together to make Obsidian's Node.js/Electron runtime operate seamlessly on HarmonyOS. Meanwhile, deep integration with the Huawei ecosystem — Account Kit, Cloud Foundation Kit, Status Bar extensions — makes the experience feel truly native.
| Project Info | |
|---|---|
| App ID | com.mikannqaq.obsidian |
| Version | 1.0.0 (versionCode: 1000000) |
| Target SDK | HarmonyOS 6.0.2(22) / API 22 |
| Target Devices | 2in1 (foldable/tablet), Tablet |
| Language | ArkTS (TypeScript) |
| Build System | Hvigor |
| Obsidian Engine | 1.12.7 |
┌──────────────────────────────────────────────────────┐
│ Obsidian 1.12.7 │
│ (obsidian.asar) │
├──────────────────────────────────────────────────────┤
│ Electron API Compatibility │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ @electron/ │ │ Node.js │ │
│ │ remote │ │ Runtime │ │
│ └──────┬───────┘ └──────┬───────┘ │
├──────────┼──────────────────┼────────────────────────┤
│ │ JSBind Bridge │ │
│ ▼ ▼ │
│ ┌──────────────────────────────────────┐ │
│ │ C++ libadapter.so │ │
│ └──────────────────────────────────────┘ │
├──────────────────────────────────────────────────────┤
│ ArkTS Adapter Layer (~50 Adapters) │
│ CloudSync │ FileSys │ Notify │ IME │ Theme │ ... │
├──────────────────────────────────────────────────────┤
│ HarmonyOS Native Runtime │
│ Ability │ ArkUI │ AccountKit │ CloudFoundation │
└──────────────────────────────────────────────────────┘
Layer breakdown:
obsidian.asar, unmodified Obsidian 1.12.7 application code@electron/remote provides the remote module API; main.js handles asar loading and update managementlibadapter.so provides core system-level API bindingsChildProcess)LoginWithHuaweiIDButtonStatusBarViewExtensionAbility| Category | Adaptations |
|---|---|
| File System | File manager, file picker, native dialogs, trash compatibility layer |
| Input | IME framework, drag-and-drop, multi-touch |
| Display | Multi-monitor management, dark/light theme following, custom cursors |
| Notifications | System push notifications, screen lock event monitoring |
| Device | Battery status, Bluetooth (Classic + BLE), power management, screenshots |
| Security | Certificate management, biometric authentication, clipboard access |
| Other | Print service, text-to-speech, OCR recognition, geolocation, external protocol handling |
obsidian-{version}.asar update packagesThe project follows the standard HarmonyOS dual-module architecture:
web_engine (HAR Static Library)The core engine module providing all Electron compatibility functionality and adapters. Can be reused by other HarmonyOS applications.
// Public exports (Index.ets)
export { WebAbilityStage } from './src/main/ets/application/AbilityStage'
export { WebAbility } from './src/main/ets/ability/WebAbility'
export { WebEmbeddedAbility } from './src/main/ets/ability/WebEmbeddedAbility'
export { WebWindow, WebSubWindow, WebEmbeddedWindow, WebWindowNode } from './src/main/ets/components/...'
export { WebChildProcess } from './src/main/ets/process/WebChildProcess'
Dependency Injection — InversifyJS manages ~50 adapters registered as singletons:
CommonModule → AbilityManager, DragParamManager, SystemFloatingWindowManager
AdapterModule → ContextAdapter, DragDropAdapter, MultiInputAdapter,
NativeThemeAdapter, PermissionManagerAdapter, DialogAdapter,
TrashAdapter, CloudSyncAdapter ...
electron (HAP Entry Package)The executable application module containing all UI pages and application logic.
Ability Components:
| Ability | Page | Purpose |
|---|---|---|
EntryAbility |
Index.ets | Main entry point, initializes AGC |
BrowserAbility |
WindowNode.ets | Browser process window |
StatelessAbility |
Index.ets | Stateless windows |
BrowserEmbeddedAbility |
EmbeddedWindow.ets | Embedded UI |
StatusBarEntryAbility |
StatusBarPage.ets | Status bar extension |
UI Pages:
| Page | Description |
|---|---|
Index.ets |
Main view hosting the WebWindow component |
WindowNode.ets |
Browser window node |
SubWindow.ets |
Sub-window (popups, settings, etc.) |
EmbeddedWindow.ets |
Embedded window |
Login.ets |
Huawei Account sign-in page |
StatusBarPage.ets |
Status bar page |
WebPage.ets |
WebView page for privacy agreements, etc. |
The adapter layer is the most critical infrastructure in OHsidian — it wraps HarmonyOS native APIs as Electron-compatible interfaces, allowing Obsidian to run on HarmonyOS with zero awareness of the underlying platform.
Each adapter extends BaseAdapter, is registered as a singleton via InversifyJS, and comes with a corresponding JSBind binding class:
web_engine/src/main/ets/adapter/
├── Accessibility.ets # Accessibility features
├── AppLifecycle.ets # Application lifecycle
├── AppWindow.ets # Application window operations
├── Battery.ets # Battery status
├── Bluetooth.ets # Bluetooth Classic
├── BluetoothLowEnergy.ets # Bluetooth Low Energy
├── BrowserPolicy.ets # Browser security policies
├── CertManager.ets # Certificate management
├── CloudSync.ets # Huawei Cloud Sync ⭐
├── Context.ets # Application context
├── ContextPath.ets # File path resolution
├── Cursor.ets # Custom cursors
├── Device.ets # Device information
├── DeviceInfo.ets # Hardware information
├── DeviceUserAuth.ets # Biometric authentication
├── Dialog.ets # Native dialogs
├── Display.ets # Display/monitor management
├── DragDrop.ets # Drag-and-drop
├── ElectronApp.ets # Electron App API shim
├── ExternalProtocol.ets # External protocol handlers
├── FileManager.ets # File system operations
├── FilePicker.ets # File picker
├── Font.ets # System font enumeration
├── Geolocation.ets # Geolocation
├── I18n.ets # Internationalization
├── IMF.ets # Input Method Framework
├── Media.ets # Media playback
├── MimeType.ets # MIME type mapping
├── MultiInput.ets # Multi-window input
├── NativeTheme.ets # System theme (dark/light)
├── NetConnection.ets # Network connectivity
├── Notification.ets # System notifications
├── Ocr.ets # OCR recognition
├── PasteBoard.ets # Clipboard
├── PermissionManager.ets # Permission management
├── PopupWindow.ets # Popup windows
├── PowerMonitor.ets # Power monitoring
├── Print.ets # Print service
├── Process.ets # Process management
├── RunningLock.ets # Wake locks
├── ScreenlockMonitor.ets # Screen lock monitoring
├── Screenshot.ets # Screen capture
├── ShapeDetection.ets # Shape detection
├── Speech.ets # Text-to-speech
├── StatusBar.ets # Status bar control
├── SubWindow.ets # Sub-window management
├── SystemFloatingWindow.ets # System floating windows
└── Trash.ets # Trash/recycle bin operations
Each adapter has a corresponding Bind class that registers its methods with the JS runtime:
// Example: CloudSync adapter JSBind registration
JsBindingUtils.bindFunction("CloudSync.uploadFile", cloudSyncAdapter.uploadFile)
JsBindingUtils.bindFunction("CloudSync.downloadFile", cloudSyncAdapter.downloadFile)
JsBindingUtils.bindFunction("CloudSync.listCloudFiles", cloudSyncAdapter.listCloudFiles)
// ...
All bindings are activated at startup through JsBindingMethod.ets.
OHsidian implements Vault cloud synchronization based on Huawei Cloud Foundation Kit.
┌──────────────┐ ┌──────────────────┐ ┌─────────────────────┐
│ Obsidian │────▶│ CloudSyncAdapter │────▶│ CloudFoundation Kit │
│ triggers │ │ (ArkTS Adapter) │ │ (Huawei Cloud) │
│ writes │ │ │ │ │
└──────────────┘ └──────────────────┘ └─────────────────────┘
│
┌─────▼──────────┐
│ Bucket: │
│ ohsidian-vault │
│ -sync-75ued │
└────────────────┘
{userId}/
└── vaults/
└── {vaultName}/
├── file1.md
├── attachments/
│ └── image.png
└── ...
| Operation | Description |
|---|---|
uploadFile |
Upload local file to cloud |
downloadFile |
Download file from cloud |
listCloudFiles |
List files in cloud |
deleteCloudFile |
Delete cloud file |
getSyncStatus |
Get sync status |
.hcs-login-pending marker filehcs-login dialog appears with a one-tap Huawei Account sign-in buttonuserId is persisted to hcs-user.json for Obsidian to readuserId| Tool | Required Version |
|---|---|
| DevEco Studio | 5.0.0+ |
| HarmonyOS SDK | API 22 (6.0.2) |
| Node.js | 18.x+ |
| Hvigor | 5.0.0+ |
# 1. Clone the repository
git clone https://github.com/your-username/ohsidian.git
cd ohsidian
# 2. Install dependencies (automatically done in DevEco Studio)
# Or manually:
hvigorw install
# 3. Build the HAP
hvigorw assembleHap
# 4. Output artifact
# build/outputs/default/electron-default-signed.hap
Alternatively, open the project in DevEco Studio and click Build > Build HAP(s).
Configure signing in build-profile.json5:
Note: `build-profile.json
$ claude mcp add OHSidian \
-- python -m otcore.mcp_server <graph>