1
0
mirror of https://gitcode.com/gh_mirrors/re/react-native-pushy.git synced 2025-09-16 13:01:38 +08:00
Code Issues Packages Projects Releases Wiki Activity GitHub Gitee

build .so files ok

This commit is contained in:
sisong
2021-04-05 11:32:01 +08:00
parent e6a8855502
commit 9d9fbd3315
4 changed files with 26 additions and 13 deletions

View File

@@ -6,9 +6,11 @@
#include <stdlib.h>
#include "bzlib.h"
#include "bspatch.h"
#include "hpatch.h"
#include <string.h> //for memcmp
#include <android/log.h>
#include "hpatch.h"
static int64_t offtin(uint8_t *buf)
{
int64_t y;
@@ -129,7 +131,7 @@ JNIEXPORT jbyteArray JNICALL Java_cn_reactnative_modules_update_DownloadTask_hdi
hpatch_singleCompressedDiffInfo patInfo;
_check(((originLength==0)||originPtr) && patchPtr && (patchLength>0),"Corrupt patch");
_check(0!=hpatch_getInfo_by_mem(&patInfo,patchPtr,patchLength),"Error info in hpatch");
_check(0!=hpatch_getInfo_by_mem(&patInfo,(const uint8_t*)patchPtr,patchLength),"Error info in hpatch");
_check(originLength==patInfo.oldDataSize,"Error oldDataSize in hpatch");
newsize=(size_t)patInfo.newDataSize;
if (sizeof(size_t)!=sizeof(hpatch_StreamPos_t))
@@ -142,8 +144,8 @@ JNIEXPORT jbyteArray JNICALL Java_cn_reactnative_modules_update_DownloadTask_hdi
_check(outPtr,"Corrupt JNIEnv::GetByteArrayElements");
}
_check(0!=hpatch_by_mem(originPtr,originLength,outPtr,newsize,
pat,patsize,&patInfo),"hpacth");
_check(0!=hpatch_by_mem((const uint8_t*)originPtr,originLength,(uint8_t*)outPtr,newsize,
(const uint8_t*)patchPtr,patchLength,&patInfo),"hpacth");
_clear:
if (outPtr) (*env)->ReleaseByteArrayElements(env, ret, outPtr, (_isError?JNI_ABORT:0));
@@ -156,8 +158,8 @@ _clear:
ret = NULL;
}
newExcCls = (*env)->FindClass(env, "java/lang/Error");
if (newExcCls != NULL) /* Unable to find the new exception class, give up. */
if (newExcCls != NULL) // Unable to find the new exception class, give up.
(*env)->ThrowNew(env, newExcCls, _errInfo);
}
return ret;
}
}