Skip to content

Commit 067e20d

Browse files
RichardTjokroutomojschwejdm
authored
Add some notes on signing configuration while building Servo on OpenHarmony platform (#217)
Added some additional notes on signing configuration step for those who intend to use Linux to develop Servo for OpenHarmony platform. This will be helpful since the signing configuration step needs `DevEco Studio` to complete (at least if you're developing Servo for HarmonyOS devices), meanwhile `DevEco Studio` is presently only available on `Windows` & `MacOS`. --------- Signed-off-by: Richard Tjokroutomo <richard.tjokro2@gmail.com> Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Co-authored-by: Josh Matthews <josh@joshmatthews.net>
1 parent 8bdabd3 commit 067e20d

1 file changed

Lines changed: 23 additions & 14 deletions

File tree

src/building/openharmony.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -133,31 +133,40 @@ When using the `hvigor` tool, this can be accomplished by setting a static `sign
133133
The `signingConfigs` property is an array of objects with the following structure:
134134

135135
```json
136-
{
137-
"name": "default",
138-
"type": "<OpenHarmony or HarmonyOS>",
139-
"material": {
140-
"certpath": "/path/to/app-signing-certificate.cer",
141-
"storePassword": "<encrypted password>",
142-
"keyAlias": "debugKey",
143-
"keyPassword": "<encrypted password>",
144-
"profile": "/path/to/signed-profile-certificate.p7b",
145-
"signAlg": "SHA256withECDSA",
146-
"storeFile": "/path/to/java-keystore-file.p12"
136+
[
137+
{
138+
"name": "default",
139+
"type": "<OpenHarmony or HarmonyOS>",
140+
"material": {
141+
"certpath": "/path/to/app-signing-certificate.cer",
142+
"storePassword": "<encrypted password>",
143+
"keyAlias": "debugKey",
144+
"keyPassword": "<encrypted password>",
145+
"profile": "/path/to/signed-profile-certificate.p7b",
146+
"signAlg": "SHA256withECDSA",
147+
"storeFile": "/path/to/java-keystore-file.p12"
148+
}
147149
}
148-
}
150+
]
149151
```
150152

151153
Here `<encrypted password>` is a hexadecimal string representation of the plaintext password after being encrypted.
152-
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`.
154+
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`.
153155

154-
You can use the IDE to generate the information needed for password encryption, the required application and profile certificate files, and the keystore itself.
156+
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.
157+
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.
155158

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

159162
**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.**
160163

164+
>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).
165+
>
166+
> 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.
167+
>
168+
> 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.
169+
161170
Once generated, it is necessary to point `mach` to the above "signing material" configuration using the `SERVO_OHOS_SIGNING_CONFIG` environment variable.
162171
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.
163172

0 commit comments

Comments
 (0)