Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

安卓合并文件夹的patch包报错 “is hdiff file? get diffInfo ERROR!” #383

Closed
tclock opened this issue May 23, 2024 · 8 comments
Closed

Comments

@tclock
Copy link

tclock commented May 23, 2024

作者你好,我在安卓端用你提供的so合并文件级别的patch包是成功的,合并文件夹级别的patch包报这个错:“is hdiff file? get diffInfo ERROR!”,patch包在Mac上都是能合并成功的。这个可能是什么原因呢,或者是你提供的so不支持文件夹级别的合并吗?

@sisong
Copy link
Owner

sisong commented May 23, 2024

是的,手机上默认没有开启 文件夹 支持,需要 重新设置和编译

@tclock
Copy link
Author

tclock commented May 23, 2024

是的,手机上默认没有开启 文件夹 支持,需要 重新设置和编译

好的,要支持 文件夹 需要修改哪些配置能告知下不,对c不是很熟悉,谢谢了

@sisong
Copy link
Owner

sisong commented May 23, 2024

#define _IS_NEED_DIR_DIFF_PATCH 0 将0改为1,然后还需要添加几个代码文件到安卓mk文件中。

@tclock
Copy link
Author

tclock commented May 23, 2024

#define _IS_NEED_DIR_DIFF_PATCH 0 将0改为1,然后还需要添加几个代码文件到安卓mk文件中。

具体还有哪几个文件呢,我现在就加了这个文件
2024-05-23 at 3 45 PM

另外jni里调用的hpatchz方法需要改吗,还是这个方法已经兼容了文件夹的合并了,麻烦了!

@sisong
Copy link
Owner

sisong commented May 24, 2024

补丁如果是文件夹类型的补丁需要调用hpatch_dir()来完成打补丁。
(另外getDirDiffInfoByFile()可以获知一个补丁是否是一个文件夹补丁)
HDiffPatch\dirDiffPatch\dir_patch 目录中的.c文件都需要包含

@tclock
Copy link
Author

tclock commented May 24, 2024

补丁如果是文件夹类型的补丁需要调用hpatch_dir()来完成打补丁。 (另外getDirDiffInfoByFile()可以获知一个补丁是否是一个文件夹补丁) HDiffPatch\dirDiffPatch\dir_patch 目录中的.c文件都需要包含

你好,我按你说的改完编译后调用报这个错:“dir_patch check oldPathType==kPathType_file error!”。我调用getIsDirDiffFile()方法返回的是true,请问下可能是什么原因呢?

编译包含的文件有这些:
2024-05-24 at 5 02 PM

hpatchz()方法实现我改成这样了:
2024-05-24 at 5 13 PM

@sisong
Copy link
Owner

sisong commented May 24, 2024

(源代码中搜索“oldPathType==kPathType_file” 可以找到该报错出现位置)

“dir_patch check oldPathType==kPathType_file error!” 这个错误,说明的是:
用系统文件API函数stat获取old目录中的某个具体子文件的时候,没有找到该文件。

@tclock
Copy link
Author

tclock commented May 25, 2024

(源代码中搜索“oldPathType==kPathType_file” 可以找到该报错出现位置)

“dir_patch check oldPathType==kPathType_file error!” 这个错误,说明的是: 用系统文件API函数stat获取old目录中的某个具体子文件的时候,没有找到该文件。

好的,谢谢,我重新走了一遍diff、patch流程现在已经可以了

@sisong sisong closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants