Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5c47569 authored by Ying Wang's avatar Ying Wang Committed by Android Git Automerger
Browse files

am f943e811: am e421b10f: am e8ecab8d: Merge "Don\'t uncompress/page-align the...

am f943e811: am e421b10f: am e8ecab8d: Merge "Don\'t uncompress/page-align the jni libraries in apps_only build." into mnc-dev

* commit 'f943e811':
  Don't uncompress/page-align the jni libraries in apps_only build.
parents 17ca1f5d f943e811
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -2028,13 +2028,23 @@ $(hide) cp $(2) $(dir $@)lib/$(1)

endef

# For apps_only build, don't uncompress/page-align the jni libraries,
# because the apk may be run on older platforms that don't support loading jni directly from apk.
ifdef TARGET_BUILD_APPS
JNI_COMPRESS_FLAGS :=
ZIPALIGN_PAGE_ALIGN_FLAGS :=
else
JNI_COMPRESS_FLAGS := -0
ZIPALIGN_PAGE_ALIGN_FLAGS := -p
endif

define add-jni-shared-libs-to-package
$(hide) rm -rf $(dir $@)lib
$(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 -0 $(notdir $@) lib)
$(hide) (cd $(dir $@) && zip -r $(JNI_COMPRESS_FLAGS) $(notdir $@) lib)
$(hide) rm -rf $(dir $@)lib
endef

@@ -2080,7 +2090,8 @@ endef
define align-package
$(hide) mv $@ $@.unaligned
$(hide) $(ZIPALIGN) \
    -f -p \
    -f \
    $(ZIPALIGN_PAGE_ALIGN_FLAGS) \
    4 \
    $@.unaligned $@.aligned
$(hide) mv $@.aligned $@