summaryrefslogtreecommitdiffstats
path: root/core/prebuilt_internal.mk
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2015-06-01 19:19:57 -0700
committerYing Wang <wangying@google.com>2015-06-01 19:19:57 -0700
commit226eb92321ef5b71a448b8e857eaedeb3dd0419e (patch)
tree46e26a5ab75b98074dd9ada45cb6f939bd9faa4f /core/prebuilt_internal.mk
parent1fb0152ff7bf24b565b44a57e51290f2a5430107 (diff)
downloadbuild-226eb92321ef5b71a448b8e857eaedeb3dd0419e.zip
build-226eb92321ef5b71a448b8e857eaedeb3dd0419e.tar.gz
build-226eb92321ef5b71a448b8e857eaedeb3dd0419e.tar.bz2
Uncompress .so files before signing the apk.
- In uncompress-shared-libs we may strip .so files not for the current TARGET_ARCH. So we need to strip first and then sign the apk. - For PRESIGNED apks, make sure we don't strip the .so files even if they are "fat". Bug: 21571418 Bug: 8076853 Change-Id: Ifd1193dda0c2cd52ac148064ce5a32bcdd03f75c
Diffstat (limited to 'core/prebuilt_internal.mk')
-rw-r--r--core/prebuilt_internal.mk8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/prebuilt_internal.mk b/core/prebuilt_internal.mk
index 19fdad6..0406353 100644
--- a/core/prebuilt_internal.mk
+++ b/core/prebuilt_internal.mk
@@ -197,6 +197,12 @@ include $(BUILD_SYSTEM)/dex_preopt_odex_install.mk
# Sign and align non-presigned .apks.
# The embedded prebuilt jni to uncompress.
+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'
+endif
ifndef embedded_prebuilt_jni_libs
# No LOCAL_PREBUILT_JNI_LIBS, uncompress all.
embedded_prebuilt_jni_libs := 'lib/*.so'
@@ -205,6 +211,7 @@ $(built_module): PRIVATE_EMBEDDED_JNI_LIBS := $(embedded_prebuilt_jni_libs)
$(built_module) : $(my_prebuilt_src_file) | $(ACP) $(ZIPALIGN) $(SIGNAPK_JAR)
$(transform-prebuilt-to-target)
+ $(uncompress-shared-libs)
ifneq ($(LOCAL_CERTIFICATE),PRESIGNED)
@# Only strip out files if we can re-sign the package.
ifdef LOCAL_DEX_PREOPT
@@ -214,7 +221,6 @@ endif
endif
$(sign-package)
endif
- $(uncompress-shared-libs)
$(align-package)
###############################