diff --git a/src/building/openharmony.md b/src/building/openharmony.md index f4739ac..afa75d0 100644 --- a/src/building/openharmony.md +++ b/src/building/openharmony.md @@ -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": "", - "material": { - "certpath": "/path/to/app-signing-certificate.cer", - "storePassword": "", - "keyAlias": "debugKey", - "keyPassword": "", - "profile": "/path/to/signed-profile-certificate.p7b", - "signAlg": "SHA256withECDSA", - "storeFile": "/path/to/java-keystore-file.p12" +[ + { + "name": "default", + "type": "", + "material": { + "certpath": "/path/to/app-signing-certificate.cer", + "storePassword": "", + "keyAlias": "debugKey", + "keyPassword": "", + "profile": "/path/to/signed-profile-certificate.p7b", + "signAlg": "SHA256withECDSA", + "storeFile": "/path/to/java-keystore-file.p12" + } } -} +] ``` Here `` 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 `/.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 `/.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. 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). +> +> Once the keys have been generated, you will need to move the entire directory that stores the keys (usually under `/.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.