Add a JNI wrapper over libziparchive.
All functions delegate directly to the native code. We
do not perform any sort of central directory or local file
related lookups in the java layer.
For each entry, libziparchive gives us an offset to the start
of data for the entry and the compressed size. We use a
RandomAccessFile to seek to that offset and then construct an
InputStream that's bounded between [offset, offset + compressed_size).
We reuse existing code (JarVerifier / Manifest) for certificate
validation & collection.
bug: 10193060
Change-Id: I21eb4e6dc6aa8749e3f63830f9799e1f621d26e6
diff --git a/NativeCode.mk b/NativeCode.mk
index f8312ae..ec9aca5 100644
--- a/NativeCode.mk
+++ b/NativeCode.mk
@@ -83,7 +83,7 @@
LOCAL_SRC_FILES += $(core_src_files)
LOCAL_C_INCLUDES += $(core_c_includes)
LOCAL_SHARED_LIBRARIES += $(core_shared_libraries) libcrypto libexpat libicuuc libicui18n libnativehelper libz
-LOCAL_STATIC_LIBRARIES += $(core_static_libraries)
+LOCAL_STATIC_LIBRARIES += $(core_static_libraries) libziparchive
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := libjavacore
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/NativeCode.mk
@@ -123,7 +123,7 @@
LOCAL_MODULE := libjavacore
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/NativeCode.mk
LOCAL_SHARED_LIBRARIES += $(core_shared_libraries) libexpat-host libicuuc-host libicui18n-host libcrypto-host libz-host
- LOCAL_STATIC_LIBRARIES += $(core_static_libraries)
+ LOCAL_STATIC_LIBRARIES += $(core_static_libraries) libziparchive-host
include $(BUILD_HOST_SHARED_LIBRARY)
ifeq ($(LIBCORE_SKIP_TESTS),)