diff --git a/en/application-dev/quick-start/configuring-the-openharmony-app-signature.md b/en/application-dev/quick-start/configuring-the-openharmony-app-signature.md index 1be080cceda7a5f1f030530827dadb303d55502c..2b1dfeea0f2bb2c7dce81a7bd3d51b1d32bef7fa 100644 --- a/en/application-dev/quick-start/configuring-the-openharmony-app-signature.md +++ b/en/application-dev/quick-start/configuring-the-openharmony-app-signature.md @@ -20,7 +20,7 @@ Use the CSR generated in [Generating a Key Store and CSR](#section153146467405) Go to the **Sdk\\toolchains\\lib** directory where the OpenHarmony SDK is saved \(see [Configuring the OpenHarmony SDK](configuring-the-openharmony-sdk.md) for details\) in the DevEco Studio installation directory, and run the following command in the CLI. If the **keytool** command cannot be executed, add the JDK environment variables to the system environment variables. You only need to modify the input and output to quickly generate a certificate. That is, modify **-infile** to specify the path of the CSR and **-outfile** to specify the name and path of the output certificate. ``` -keytool -gencert -alias "OpenHarmony Application CA" -infile myApplication_debug.csr -outfile myApplication_debug.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc +keytool -gencert -alias "OpenHarmony Application CA" -infile myApplication_ohos.csr -outfile myApplication_ohos.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc ``` Refer to the following descriptions about the parameters in the command: @@ -42,7 +42,7 @@ The profile contains the package name of the OpenHarmony app, digital certificat Go to the **Sdk\\toolchains\\lib** directory, open the command-line tool, and run the following command. ``` -java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out myApplication_debug_Provision.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name package name --permission restricted permission name (optional) --permission restricted permission name (optional) --distribution-certificate myApplication_debug.cer +java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out myApplication_ohos_Provision.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name package name --permission restricted permission name (optional) --permission restricted permission name (optional) --distribution-certificate myApplication_ohos.cer ``` Refer to the following descriptions about the parameters in the command: diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001144606358.png b/en/application-dev/quick-start/figures/en-us_image_0000001144606358.png index 96e764bfce13d3720f180060b40403fbc69f2357..99330a4f3ef2978dd6736d96e00c88cea8d25f32 100644 Binary files a/en/application-dev/quick-start/figures/en-us_image_0000001144606358.png and b/en/application-dev/quick-start/figures/en-us_image_0000001144606358.png differ diff --git a/en/application-dev/quick-start/figures/en-us_image_0000001144765960.png b/en/application-dev/quick-start/figures/en-us_image_0000001144765960.png index 8aac40ccf2d2dc3d22ee6e652ad4ba8ba45e71a2..9e3afd2b96c1a01b3e966c37e60755d1f179363c 100644 Binary files a/en/application-dev/quick-start/figures/en-us_image_0000001144765960.png and b/en/application-dev/quick-start/figures/en-us_image_0000001144765960.png differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117638220.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117638220.png deleted file mode 100644 index 52c5bcf093ba6f623b89a846827c834be27937b0..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117638220.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117638526.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117638526.png deleted file mode 100644 index bc96dd6e4e4f13971d10eb0d59288544b42eca6e..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001117638526.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001144606358.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001144606358.png deleted file mode 100644 index 96e764bfce13d3720f180060b40403fbc69f2357..0000000000000000000000000000000000000000 Binary files a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001144606358.png and /dev/null differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001155643492.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001155643492.png new file mode 100644 index 0000000000000000000000000000000000000000..9e3afd2b96c1a01b3e966c37e60755d1f179363c Binary files /dev/null and b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001155643492.png differ diff --git a/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001202722349.png b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001202722349.png new file mode 100644 index 0000000000000000000000000000000000000000..99330a4f3ef2978dd6736d96e00c88cea8d25f32 Binary files /dev/null and b/zh-cn/application-dev/quick-start/figures/zh-cn_image_0000001202722349.png differ diff --git "a/zh-cn/application-dev/quick-start/\351\205\215\347\275\256OpenHarmony\345\272\224\347\224\250\347\255\276\345\220\215\344\277\241\346\201\257.md" "b/zh-cn/application-dev/quick-start/\351\205\215\347\275\256OpenHarmony\345\272\224\347\224\250\347\255\276\345\220\215\344\277\241\346\201\257.md" index 53d31bd33c213225e147dcffe545fc9a21deb3e0..e7eab4d4015f27d2aba93ab08de86e89957bff26 100644 --- "a/zh-cn/application-dev/quick-start/\351\205\215\347\275\256OpenHarmony\345\272\224\347\224\250\347\255\276\345\220\215\344\277\241\346\201\257.md" +++ "b/zh-cn/application-dev/quick-start/\351\205\215\347\275\256OpenHarmony\345\272\224\347\224\250\347\255\276\345\220\215\344\277\241\346\201\257.md" @@ -20,7 +20,7 @@ OpenHarmony应用通过数字证书(.cer文件)和Profile文件(.p7b文件 进入DevEco Studio安装目录的**Sdk\\toolchains\\lib**文件夹下(该SDK目录只能是OpenHarmony SDK,配置方法可参考[配置OpenHarmony SDK](配置OpenHarmony-SDK.md)),打开命令行工具,执行如下命令(如果keytool命令不能执行,请在系统环境变量中添加JDK的环境变量)。其中,只需要修改输入和输出即可快速生成证书文件,即修改**-infile**指定证书请求文件csr文件路径,**-outfile**指定输出证书文件名及路径。 ``` -keytool -gencert -alias "OpenHarmony Application CA" -infile myApplication_debug.csr -outfile myApplication_debug.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc +keytool -gencert -alias "OpenHarmony Application CA" -infile myApplication_ohos.csr -outfile myApplication_ohos.cer -keystore OpenHarmony.p12 -sigalg SHA384withECDSA -storepass 123456 -ext KeyUsage:"critical=digitalSignature" -validity 3650 -rfc ``` 关于该命令的参数说明如下: @@ -42,7 +42,7 @@ Profile文件包含OpenHarmony应用的包名、数字证书信息、描述应 进入**Sdk\\toolchains\\lib**目录下,打开命令行工具,执行如下命令。 ``` -java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out myApplication_debug_Provision.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name 包名 --permission 受限权限名(可选) --permission 受限权限名(可选) --distribution-certificate myApplication_debug.cer +java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --out myApplication_ohos_Provision.p7b --keystore OpenHarmony.p12 --storepass 123456 --alias "OpenHarmony Application Profile Release" --sigAlg SHA256withECDSA --cert OpenHarmonyProfileRelease.pem --validity 365 --developer-id ohosdeveloper --bundle-name 包名 --permission 受限权限名(可选) --permission 受限权限名(可选) --distribution-certificate myApplication_ohos.cer ``` 关于该命令的参数说明如下: @@ -75,11 +75,11 @@ java -jar provisionsigtool.jar sign --in UnsgnedReleasedProfileTemplate.json --o - **Profile File**:选择[生成应用Profile文件](#section2048641015325)中生成的Profile文件,文件后缀为.p7b。 - **Certpath File**:选择[生成应用证书文件](#section136609429562)中生成的数字证书文件,文件后缀为.cer。 -![](figures/zh-cn_image_0000001144765960.png) +![](figures/zh-cn_image_0000001155643492.png) 设置完签名信息后,点击**OK**进行保存,然后可以在工程下的build.gradle中查看签名的配置信息。 -![](figures/zh-cn_image_0000001144606358.png) +![](figures/zh-cn_image_0000001202722349.png) 默认情况下,DevEco Studio编译hap包的类型为debug类型,如果需要编译release类型的hap包,请打开工程左下角的OhosBuild Variants,设置模块的编译构建类型为release。关于编译构建hap的详细说明请参考[HUAWEI DevEco Studio使用指南](https://developer.harmonyos.com/cn/docs/documentation/doc-guides/build_hap-0000001053342418)。