Skip to content

Commit 828212f

Browse files
authored
fix harmony more than 2M issue (#470)
1 parent 23ccfcc commit 828212f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

harmony/src/main/cpp/pushy.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,18 @@ napi_value HdiffPatch(napi_env env, napi_callback_info info) {
7272
// 创建结果buffer
7373
napi_value resultBuffer;
7474
uint8_t* outPtr;
75-
status = napi_create_buffer(env, newsize, (void**)&outPtr, &resultBuffer);
75+
void* data;
76+
77+
status = napi_create_arraybuffer(env, newsize, &data, &resultBuffer);
7678
if (status != napi_ok) {
7779
napi_throw_error(env, NULL, "Failed to create result buffer");
7880
return NULL;
7981
}
82+
outPtr = (uint8_t*)data;
8083

8184
// 执行patch
8285
_check(kHPatch_ok==hpatch_by_mem(originPtr, originLength, outPtr, newsize,
8386
patchPtr, patchLength, &patInfo), "hpatch");
84-
8587
return resultBuffer;
8688

8789
_clear:

harmony/src/main/ets/DownloadTask.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,9 @@ export class DownloadTask {
288288
}
289289
}
290290

291-
await zip.decompressFile(entry.filename, params.unzipDirectory);
291+
if(entry.filename !== '.DS_Store'){
292+
await zip.decompressFile(entry.filename, params.unzipDirectory);
293+
}
292294
}
293295

294296
if (!foundDiff) {

0 commit comments

Comments
 (0)