Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 22 additions & 14 deletions src/building/openharmony.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,31 +133,39 @@ When using the `hvigor` tool, this can be accomplished by setting a static `sign
The `signingConfigs` property is an array of objects with the following structure:

```json
{
"name": "default",
"type": "<OpenHarmony or HarmonyOS>",
"material": {
"certpath": "/path/to/app-signing-certificate.cer",
"storePassword": "<encrypted password>",
"keyAlias": "debugKey",
"keyPassword": "<encrypted password>",
"profile": "/path/to/signed-profile-certificate.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/path/to/java-keystore-file.p12"
[
{
"name": "default",
"type": "<OpenHarmony or HarmonyOS>",
"material": {
"certpath": "/path/to/app-signing-certificate.cer",
"storePassword": "<encrypted password>",
"keyAlias": "debugKey",
"keyPassword": "<encrypted password>",
"profile": "/path/to/signed-profile-certificate.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/path/to/java-keystore-file.p12"
}
}
}
]
```

Here `<encrypted password>` is a hexadecimal string representation of the plaintext password after being encrypted.
The key and salt used to encrypt the passwords are generated by DevEco Studio IDE and are stored on-disk alongside the certificate files and keystore, usually under `<USER HOME>/.ohos/config/openharmony`.
The key and salt used to encrypt the passwords are generated by DevEco Studio IDE and are stored on-disk alongside the certificate files and keystore, usually under `<USER HOME>/.ohos`.

You can use the IDE to generate the information needed for password encryption, the required application and profile certificate files, and the keystore itself.
To generate the information needed for password encryption, the required application and profile certificate files, and the keystore itself, you can clone a [sample ArkTS app](https://github.com/jschwe/ServoDemo) and open it on DevEco Studio IDE. Note that since signing information is tied to the bundle name, not all ArkTS app will work, and therefore it is **highly** recommended to use the sample ArkTS app mentioned above.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To generate the information needed for password encryption, the required application and profile certificate files, and the keystore itself, you can clone a [sample ArkTS app](https://github.com/jschwe/ServoDemo) and open it on DevEco Studio IDE. Note that since signing information is tied to the bundle name, not all ArkTS app will work, and therefore it is **highly** recommended to use the sample ArkTS app mentioned above.
To generate the information needed for password encryption, the required application and profile certificate files, and the keystore itself, you can clone a [sample ArkTS app](https://github.com/jschwe/ServoDemo) and open it on DevEco Studio IDE.
Note that since signing information is tied to the bundle name, not all ArkTS app will work, and therefore it is **highly** recommended to use the sample ArkTS app mentioned above.


1. Open Project Structure dialog from `File > Project Structure` menu.
2. Under the 'Signing Config' tab, enable the 'Automatically generate signature' checkbox.

**NOTE: The signature autogenerated above is intended only for development and testing. For production builds and distribution via an App Store, the relevant configuration needs to be obtained from the App Store provider.**

>For Linux users, DevEco Studio is only available on Windows and MacOS. To proceed, **you will need another Windows / MacOS machine with DevEco Studio IDE installed** to create the signing keys. If you're developing for OpenHarmony boards (such as HopeRun development board), then you can name the `SigningConfigs` `default`. Otherwise, set it to `hos` if you're developing Servo for HarmonyOS devices (such as Huawei Mate series phones).
Copy link
Copy Markdown
Member

@jschwe jschwe Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
>For Linux users, DevEco Studio is only available on Windows and MacOS. To proceed, **you will need another Windows / MacOS machine with DevEco Studio IDE installed** to create the signing keys. If you're developing for OpenHarmony boards (such as HopeRun development board), then you can name the `SigningConfigs` `default`. Otherwise, set it to `hos` if you're developing Servo for HarmonyOS devices (such as Huawei Mate series phones).
>For Linux users, DevEco Studio is only available on Windows and MacOS. To proceed, **you will need another Windows / MacOS machine with DevEco Studio IDE installed** to create the signing keys.
If you're developing for OpenHarmony boards (such as HopeRun development board), then you can name the `SigningConfigs` `default`.
Otherwise, set it to `hos` if you're developing Servo for HarmonyOS devices.

>
> Once the keys have been generated, you will need to move the entire directory that stores the keys (usually under `<USER HOME>/.ohos/`) generated by DevEco Studio from your Windows / MacOS machine.
>
> Additionally, you also need to copy `SigningConfigs` from `build-profile.json5` generated by DevEco Studio from your Windows / MacOS machine to a `.json` file in your Linux machine. This will serve as a "signing material" `mach` can later refer.

Once generated, it is necessary to point `mach` to the above "signing material" configuration using the `SERVO_OHOS_SIGNING_CONFIG` environment variable.
The value of the variable must be a file path to a valid `.json` file with the same structure as the `signingConfigs` property given above, but with `certPath`, `storeFile` and `profile` given as *paths relative to the json file*, instead of absolute paths.

Expand Down