HarmonyOS 鸿蒙Next UnrecoverableKeyException:failed to decrypt safe contents entry问题求助

HarmonyOS 鸿蒙Next UnrecoverableKeyException:failed to decrypt safe contents entry问题求助 UnrecoverableKeyException: failed to decrypt safe contents entry问题求助

环境:DevEco Studio 3.1.1 Release,Build Version: 3.1.0.501, built on June 20, 2023,Build #DS-223.8617.56.36.310501,Runtime version: 17.0.6+10-b829.5 amd64,VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.,Windows 11 10.0

问题:半年前运行程序没有问题,上周打开项目在新的手机上运行失败,提示如下信息:

Caused by: java.security.UnrecoverableKeyException: failed to decrypt safe contents entry: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

查了论坛有多个网友遇到同样的问题,收到的答复是密码不对,具体是指什么密码,在哪里设置,还请清楚的人详细说明下,谢谢!


更多关于HarmonyOS 鸿蒙Next UnrecoverableKeyException:failed to decrypt safe contents entry问题求助的实战教程也可以访问 https://www.itying.com/category-93-b0.html

3 回复

签名问题嘛,尝试删除签名文件和material文件后重新签名试下!

更多关于HarmonyOS 鸿蒙Next UnrecoverableKeyException:failed to decrypt safe contents entry问题求助的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html


删除.ohos/config目录下的四个文件(cer/csr/p7b/p12)和material文件夹,执行程序前选择自动生成签名,运行程序提示如下错误,此时检查.ohos/config目录,四个文件和material文件夹均已生成。

Execution failed for task ':entry:signDebugShell'.
> An error happened while decrypt the signing information. Verify that the material path exists and the password is correct.
Decrypt failed
UnrecoverableKeyException: failed to decrypt safe contents entry 是鸿蒙Next系统中与密钥管理相关的异常。通常发生在尝试解密安全内容时,系统无法恢复或使用所需的密钥。可能的原因包括密钥存储损坏、密钥丢失或权限问题。鸿蒙Next的密钥管理机制依赖硬件安全模块(如TEE)来保护密钥,若硬件或软件层面的密钥管理出现故障,可能导致该异常。建议检查密钥存储状态、系统日志以及相关的安全模块配置,确保密钥生成、存储和使用流程正常。
回到顶部