diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-10-09 22:35:26 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-10-09 22:35:26 +0000 |
commit | 0443b46066e3a062111f28f823ebd012f1c76a62 (patch) | |
tree | 1bcd58803a97501c76c96524ab6bc437b520d5c1 | |
parent | 9cb5cfad6dd1e057c9be00799c2a59c3f4af59b7 (diff) | |
parent | 0e8a2ee17209bb858c09a0c9d858191e9b2ccb2e (diff) | |
download | build-0443b46066e3a062111f28f823ebd012f1c76a62.tar.gz |
Merge "Remove extra JNI libs from prebuilt APKs"
-rw-r--r-- | core/definitions.mk | 11 | ||||
-rw-r--r-- | core/prebuilt_internal.mk | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/core/definitions.mk b/core/definitions.mk index 0347157030..5a14826e14 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -2416,11 +2416,14 @@ define uncompress-dexs fi endef -# Uncompress shared libraries embedded in an apk. +# Uncompress shared JNI libraries embedded in an apk. # -define uncompress-shared-libs - if (zipinfo $@ $(PRIVATE_EMBEDDED_JNI_LIBS) 2>/dev/null | grep -v ' stor ' >/dev/null) ; then \ - $(ZIP2ZIP) -i $@ -o $@.tmp $(addprefix -0 ,$(patsubst 'lib/*.so','lib/**/*.so',$(PRIVATE_EMBEDDED_JNI_LIBS))) && \ +define uncompress-prebuilt-embedded-jni-libs + if (zipinfo $@ 'lib/*.so' 2>/dev/null | grep -v ' stor ' >/dev/null) ; then \ + $(ZIP2ZIP) -i $@ -o $@.tmp -0 'lib/**/*.so' \ + $(if $(PRIVATE_EMBEDDED_JNI_LIBS), \ + -x 'lib/**/*.so' \ + $(addprefix -X ,$(PRIVATE_EMBEDDED_JNI_LIBS))) && \ mv -f $@.tmp $@ ; \ fi endef diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk index 30a9c37fe6..809c572f31 100644 --- a/core/prebuilt_internal.mk +++ b/core/prebuilt_internal.mk @@ -335,11 +335,11 @@ ifeq ($(LOCAL_CERTIFICATE),PRESIGNED) # For PRESIGNED apks we must uncompress every .so file: # even if the .so file isn't for the current TARGET_ARCH, # we can't strip the file. -embedded_prebuilt_jni_libs := 'lib/*.so' +embedded_prebuilt_jni_libs := endif ifndef embedded_prebuilt_jni_libs # No LOCAL_PREBUILT_JNI_LIBS, uncompress all. -embedded_prebuilt_jni_libs := 'lib/*.so' +embedded_prebuilt_jni_libs := endif $(built_module): PRIVATE_EMBEDDED_JNI_LIBS := $(embedded_prebuilt_jni_libs) $(built_module): $(ZIP2ZIP) @@ -358,7 +358,7 @@ $(built_module) : .KATI_IMPLICIT_OUTPUTS := $(dir $(LOCAL_BUILT_MODULE))package. endif $(built_module) : $(my_prebuilt_src_file) | $(ZIPALIGN) $(SIGNAPK_JAR) $(transform-prebuilt-to-target) - $(uncompress-shared-libs) + $(uncompress-prebuilt-embedded-jni-libs) ifeq (true, $(LOCAL_UNCOMPRESS_DEX)) $(uncompress-dexs) endif # LOCAL_UNCOMPRESS_DEX |