summaryrefslogtreecommitdiffstats
path: root/core/definitions.mk
diff options
context:
space:
mode:
authorDimitry Ivanov <dimitry@google.com>2015-06-04 18:32:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-04 18:33:00 +0000
commit72bced8a758a3a8427768d97e6d763f6a706d2b1 (patch)
tree67eb9ea9b83e94c08ef514156664a32b1ddd3ee9 /core/definitions.mk
parentcf7fbcd03d9f13d1c2fe6e65f02247feadec136d (diff)
parent226eb92321ef5b71a448b8e857eaedeb3dd0419e (diff)
downloadbuild-72bced8a758a3a8427768d97e6d763f6a706d2b1.zip
build-72bced8a758a3a8427768d97e6d763f6a706d2b1.tar.gz
build-72bced8a758a3a8427768d97e6d763f6a706d2b1.tar.bz2
Merge changes from topic 'prebuilt-open-from-apk' into mnc-dev
* changes: Uncompress .so files before signing the apk. Don't extract jni from prebuilt apks.
Diffstat (limited to 'core/definitions.mk')
-rw-r--r--core/definitions.mk22
1 files changed, 11 insertions, 11 deletions
diff --git a/core/definitions.mk b/core/definitions.mk
index 6b9abd8..474a4e6 100644
--- a/core/definitions.mk
+++ b/core/definitions.mk
@@ -2030,8 +2030,7 @@ $(hide) mkdir -p $(addprefix $(dir $@)lib/,$(PRIVATE_JNI_SHARED_LIBRARIES_ABI))
$(foreach abi,$(PRIVATE_JNI_SHARED_LIBRARIES_ABI),\
$(call _add-jni-shared-libs-to-package-per-abi,$(abi),\
$(patsubst $(abi):%,%,$(filter $(abi):%,$(PRIVATE_JNI_SHARED_LIBRARIES)))))
-$(hide) (cd $(dir $@) && zip -r \
- $(if $(filter true, $(PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES)),-0,) $(notdir $@) lib)
+$(hide) (cd $(dir $@) && zip -r -0 $(notdir $@) lib)
$(hide) rm -rf $(dir $@)lib
endef
@@ -2077,21 +2076,22 @@ endef
define align-package
$(hide) mv $@ $@.unaligned
$(hide) $(ZIPALIGN) \
- -f \
- $(if $(filter true, $(PRIVATE_PAGE_ALIGN_JNI_SHARED_LIBRARIES)),-p,) \
+ -f -p \
4 \
$@.unaligned $@.aligned
$(hide) mv $@.aligned $@
endef
+# Uncompress shared libraries embedded in an apk.
+#
define uncompress-shared-libs
-$(hide) rm -rf $(dir $@)/tmpworkdir
-$(hide) mv $@ $@.compressed
-$(hide) mkdir $(dir $@)/tmpworkdir
-$(hide) unzip $@.compressed 'lib/*.so' -d $(dir $@)/tmpworkdir
-$(hide) ( cd $(dir $@)/tmpworkdir && zip -D -r -0 ../$(notdir $@).compressed lib )
-$(hide) mv $@.compressed $@
-$(hide) rm -rf $(dir $@)/tmpworkdir
+$(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 -0 ../$(notdir $@) lib ) && \
+ rm -rf $(dir $@)uncompressedlibs; \
+ fi
endef
define install-dex-debug