sisong / HDiffPatch

a C\C++ library and command-line tools for Diff & Patch between binary files or directories(folder); cross-platform; runs fast; create small delta/differential; support large files and limit memory requires when diff & patch.
Other
1.52k stars 280 forks source link

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

Closed tclock closed 3 months ago

tclock commented 3 months ago

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

sisong commented 3 months ago

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

tclock commented 3 months ago

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

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

sisong commented 3 months ago

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

tclock commented 3 months ago

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

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

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

sisong commented 3 months ago

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

tclock commented 3 months ago

补丁如果是文件夹类型的补丁需要调用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 commented 3 months ago

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

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

tclock commented 3 months ago

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

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

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