Allow target to specify LOCAL_PREFER_INTEGRITY
The option will:
- Produce APK with uncompressed dex
- Declare to prefer integrity in manifest
Test: unzip -vl, dex compression looks correct with the option provided
or not.
Test: similarly, aapt dump correct attribute
Bug: None
Change-Id: I16b9a37255150c2ad84af84087dfabb536a3b07a
diff --git a/core/dex_preopt_odex_install.mk b/core/dex_preopt_odex_install.mk
index 62597d1..ff49fe8 100644
--- a/core/dex_preopt_odex_install.mk
+++ b/core/dex_preopt_odex_install.mk
@@ -3,6 +3,12 @@
# Output variables: LOCAL_DEX_PREOPT, LOCAL_UNCOMPRESS_DEX, built_odex,
# dexpreopt_boot_jar_module
+ifeq (true,$(LOCAL_PREFER_INTEGRITY))
+ LOCAL_UNCOMPRESS_DEX := true
+else
+ LOCAL_UNCOMPRESS_DEX :=
+endif
+
# We explicitly uncompress APKs of privileged apps, and used by
# privileged apps
ifneq (true,$(DONT_UNCOMPRESS_PRIV_APPS_DEXS))