HarmonyOS 使用hap-sign-tool.jar对hvigorw构建的app进行签名有一个警告是否正常
java -jar hap-sign-tool.jar sign-app -keyAlias “key0” -signAlg “SHxxx6withECDSA” -mode “localSign” -appCertFile “test.cer” -profileFile “test.p7b” -inFile “hap-unsigned.app” -keystoreFile “test.p12” -outFile “hap-signed.app” -keyPwd “123456” -keystorePwd “123456”
04-25 09:29:03 INFO - Start sign-app
04-25 09:29:03 INFO - certificate in profile: xxx(137316xxx16631873)\
04-25 09:29:03 WARN - no need to sign code for :app
04-25 09:29:03 INFO - /Users/xx/Desktop/harmonyos_package/cjyun.p12 is exist. Try to load it with given passwd
04-25 09:29:03 INFO - Add sign data in sign info list success.
04-25 09:29:03 INFO - Generate signing block success, begin write it to output file
04-25 09:29:03 INFO - Sign Hap success!
04-25 09:29:03 INFO - sign-app success
有这样一条警告 04-25 09:29:03 WARN - no need to sign code for :app
hap-sign-tool.jar支持给app签名,和hap包用法相同。出现警告WARN - no need to sign code for :app属于正常现象,符合预期,app主要作于是上架时核对签名信息的,对app签名就可以上架了,后期应用上架后,会将app拆包对所有har包部分重新签名。
整个app,的确是不支持hdc推送(出于安全考虑),
如果想要安装整个app,除了走正常上架流程外,还可以:
1.需要对每一个hap包 hsp包签名
2.将所有签完名的hsp与hap包放在一个单独的英文名字文件夹下(例如sign),
3.运行 hdc file send path\singn data/local/tmp
4.再运行 hdc shell bm install -p data/local/tmp/singn