Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions harmony/src/main/cpp/pushy.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ napi_value HdiffPatch(napi_env env, napi_callback_info info) {
// 创建结果buffer
napi_value resultBuffer;
uint8_t* outPtr;
status = napi_create_buffer(env, newsize, (void**)&outPtr, &resultBuffer);
void* data;

status = napi_create_arraybuffer(env, newsize, &data, &resultBuffer);
if (status != napi_ok) {
napi_throw_error(env, NULL, "Failed to create result buffer");
return NULL;
}
outPtr = (uint8_t*)data;

// 执行patch
_check(kHPatch_ok==hpatch_by_mem(originPtr, originLength, outPtr, newsize,
patchPtr, patchLength, &patInfo), "hpatch");

return resultBuffer;

_clear:
Expand Down
4 changes: 3 additions & 1 deletion harmony/src/main/ets/DownloadTask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ export class DownloadTask {
}
}

await zip.decompressFile(entry.filename, params.unzipDirectory);
if(entry.filename !== '.DS_Store'){
await zip.decompressFile(entry.filename, params.unzipDirectory);
}
}

if (!foundDiff) {
Expand Down