mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-27 05:47:38 +00:00
24 lines
570 B
C
24 lines
570 B
C
|
//
|
||
|
// Java entry point
|
||
|
//
|
||
|
|
||
|
#include <jni.h>
|
||
|
#include <stdlib.h>
|
||
|
#include "zipadjust.h"
|
||
|
|
||
|
JNIEXPORT jbyteArray JNICALL
|
||
|
Java_com_topjohnwu_magisk_utils_ZipUtils_zipAdjust(JNIEnv *env, jclass type, jbyteArray jbytes, jint size) {
|
||
|
fin = (*env)->GetPrimitiveArrayCritical(env, jbytes, NULL);
|
||
|
insize = (size_t) size;
|
||
|
|
||
|
zipadjust(0);
|
||
|
|
||
|
(*env)->ReleasePrimitiveArrayCritical(env, jbytes, fin, 0);
|
||
|
|
||
|
jbyteArray ret = (*env)->NewByteArray(env, outsize);
|
||
|
(*env)->SetByteArrayRegion(env, ret, 0, outsize, (const jbyte*) fout);
|
||
|
free(fout);
|
||
|
|
||
|
return ret;
|
||
|
}
|