Skip to content

带hnp(HarmonyOS Native Package)的hap包无法正常安装 #63

Open
@SwimmingTiger

Description

@SwimmingTiger

hnp是一种在hap中打包原生ELF可执行文件的方法,最早由鸿蒙PC上的 CodeArts IDE 使用。hnp中的ELF可供应用程序内部使用(private模式)或供鸿蒙终端调用(public模式,安装到/data/service/hnp/bin中)。

随后 https://github.com/jiegec/Termony 项目也开始使用 hnp 来打包可供终端运行的命令行程序。

我移植的鸿蒙版 Aria2 命令也正在转向 hnp 打包:https://github.com/SwimmingTiger/aria2-ohos/tree/hnp

不过我发现目前的小白调试助手无法正确安装带 hnp 包的应用:

Image

Image

怀疑是签名的问题。

这是我从 Termony 项目拷贝的 hnp 打包代码,以下是我从 Termony 项目拷贝的 hnp 签名代码:

https://github.com/SwimmingTiger/aria2-ohos/blob/hnp/build-macos.sh#L17
https://github.com/SwimmingTiger/aria2-ohos/blob/hnp/sign.py
https://github.com/SwimmingTiger/aria2-ohos/blob/hnp/sign.js

顺便附带签名前和签名后的hap包:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions