OSDN Git Service

Make uncompressing jni libs in prebuilt APKs reproducible
authorDan Willemsen <dwillemsen@google.com>
Thu, 12 Nov 2015 02:20:37 +0000 (18:20 -0800)
committerDan Willemsen <dwillemsen@google.com>
Thu, 12 Nov 2015 02:26:38 +0000 (18:26 -0800)
This was extracting the shared libraries into a temporary directory,
then adding them back into the zip file using the raw filesystem
ordering. Fix that by passing a sorted list to zip.

Bug: 24201956
Change-Id: I59c41151968be6faf289e04719a9992157eb405d

core/definitions.mk

index 1c8f41a..eba3a3e 100644 (file)
@@ -2161,7 +2161,7 @@ $(hide) if unzip -l $@ $(PRIVATE_EMBEDDED_JNI_LIBS) >/dev/null ; then \
   rm -rf $(dir $@)uncompressedlibs && mkdir $(dir $@)uncompressedlibs; \
   unzip $@ $(PRIVATE_EMBEDDED_JNI_LIBS) -d $(dir $@)uncompressedlibs && \
   zip -d $@ 'lib/*.so' && \
-  ( cd $(dir $@)uncompressedlibs && zip -D -r -X -0 ../$(notdir $@) lib ) && \
+  ( cd $(dir $@)uncompressedlibs && find lib -type f | sort | zip -D -X -0 ../$(notdir $@) -@ ) && \
   rm -rf $(dir $@)uncompressedlibs; \
   fi
 endef