OpenHarmony开发者论坛

标题: 【安装失败】msg:error: failed to install bundle. error: verify signature failed. [打印本页]

作者: leon    时间: 2024-2-29 15:48
标题: 【安装失败】msg:error: failed to install bundle. error: verify signature failed.
[md]1. 参照 https://gitee.com/openharmony/do ... ntool-guidelines.md 步骤
   1. java -jar hap-sign-tool.jar generate-keypair -keyAlias "oh-app1-key-v1" -keyAlg "ECC"  -keySize "NIST-P-256" -keystoreFile "OpenHarmony.p12" -keyPwd "123456" -keystorePwd "123456"
   2. java -jar hap-sign-tool.jar generate-app-cert -keyAlias "oh-app1-key-v1" -signAlg "SHA256withECDSA"  -issuer "C=CN,O=OpenHarmony,OU=OpenHarmony Team,CN= OpenHarmony Application CA" -issuerKeyAlias "openharmony application ca" -subject "C=CN,O=OpenHarmony,OU=OpenHarmony Team,CN=OpenHarmony Application Release" -keystoreFile "OpenHarmony.p12" -subCaCertFile "subCA.cer" -rootCaCertFile "rootCA.cer" -outForm "certChain" -outFile "app1.pem" -keyPwd "123456" -keystorePwd "123456" -issuerKeyPwd "123456" -validity "365"
   3. java -jar hap-sign-tool.jar  sign-profile -keyAlias "openharmony application profile release" -signAlg "SHA256withECDSA" -mode "localSign" -profileCertFile "OpenHarmonyProfileRelease.pem" -inFile "UnsgnedReleasedProfileTemplate.json" -keystoreFile "OpenHarmony.p12" -outFile "app1-profile.p7b" -keyPwd "123456" -keystorePwd "123456"
   4. java -jar hap-sign-tool.jar sign-app -keyAlias "oh-app1-key-v1" -signAlg "SHA256withECDSA" -mode "localSign" -appCertFile "app1.pem" -profileFile "app1-profile.p7b" -inFile "app1-unsigned.zip" -keystoreFile "OpenHarmony.p12" -outFile "app1-signed.hap" -keyPwd "123456" -keystorePwd "123456"
2. hdc app install app1-signed.hap 安装报错
   [Info]App install path:\Huawei\ohos\apps\build\.\about-signed_leon.hap, queuesize:0, msg:error: failed to install bundle. error: verify signature failed.
[/md]
作者: 论坛小助手    时间: 2024-3-6 14:46
可否提供一下hap包或者安装日志
作者: mgd112    时间: 2024-4-1 12:09
回复 论坛小助手: 你好,我遇到了相同的问题,求助,我的hap包可以在gitee仓库里下载:https://gitee.com/Guangdie/openharmony.git
详细报错如下:
DeploymentOperationFailedException: [Info]App install path:\TuanjieProjects\PastoralPeace/entry-default-signed.hap, queuesize:0, msg:error: failed to install bundle. code:9568329 error: verify signature failed.
AppMod finish
UnityEditor.OpenHarmony.OpenHarmonyDeploymentTargetsExtension+<>c__DisplayClass14_1.<LaunchBuildOnTarget>b__0 () (at <38ff3eadb62046499fa0e205ff1635ed>:0)
UnityEditor.ProgressTaskManager.Run () (at <7f409071f7d348838885b60c6a676e71>:0)
UnityEditor.OpenHarmony.OpenHarmonyDeploymentTargetsExtension.LaunchBuildOnTarget (UnityEditor.DeploymentTargets.IDeploymentTargetsMainThreadContext context, UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <38ff3eadb62046499fa0e205ff1635ed>:0)
UnityEditor.DeploymentTargets.DeploymentTargetManager.LaunchBuildOnTarget (UnityEditor.BuildProperties buildProperties, UnityEditor.DeploymentTargets.DeploymentTargetId targetId, UnityEditor.ProgressHandler progressHandler) (at <7f409071f7d348838885b60c6a676e71>:0)
UnityEditor.PostprocessBuildPlayer+<>c__DisplayClass22_1.<LaunchOnTargets>b__1 () (at <7f409071f7d348838885b60c6a676e71>:0)
UnityEngine.GUIUtilityrocessEvent(Int32, IntPtr, Boolean&)

作者: mgd112    时间: 2024-4-1 12:10
回复 论坛小助手: 遇到了相同问题,求助
作者: 论坛小助手    时间: 2024-4-1 16:02
回复 mgd112: 已经找相关领域的技术求助啦,有消息会立刻回复
作者: s_hao    时间: 2024-4-1 16:49
标题: 【安装失败】msg:error: failed to install bundle. error: verify signature failed.
[md]是自己签名的吗,一般签名都是用ide的签名工具,是不会有这个问题的,这个问题,就在于自己用签名工具签的名,然后签名的证书里的包名还跟hap不一致,可以尝试:1.用ide签名工具,或者2.如果你是自己签名,下图的json文件需要修改与包名一致。

![20240401-164856WeLinkPC.png](https://forums-obs.openharmony.c ... u99h9hgp0usp0px.png "20240401-164856(WeLinkPC).png")

![](file:///E:/WelinkDownload/image/originalImgfiles/E7731D1B-94EF-4590-AD61-6B46CBA051A1.png)
[/md]




欢迎光临 OpenHarmony开发者论坛 (https://forums.openharmony.cn/) Powered by Discuz! X3.5