Android 9 禁用 framework.jar 优化

修改 build/make/core/dex_preopt.mk

1、DEX_PREOPT_DEFAULT 设置为 false,修改:

DEX_PREOPT_DEFAULT ?= true

 为

DEX_PREOPT_DEFAULT ?= false

 2、WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY 设置为FALSE,修改:

WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true

WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false

 3、将修改后的错误禁用:

-  ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT)))
-    ifneq (true,$(WITH_DEXPREOPT))
-      ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
-        $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds)
-      endif
-    endif
-  endif

4、完整修改: 

diff --git a/core/dex_preopt.mk b/core/dex_preopt.mk
index 7298bdee09..7e846892bb 100644
--- a/core/dex_preopt.mk
+++ b/core/dex_preopt.mk
@@ -17,7 +17,7 @@ DEXPREOPT_BOOT_JAR_DIR := system/framework
 DEXPREOPT_BOOT_JAR_DIR_FULL_PATH := $(DEXPREOPT_PRODUCT_DIR_FULL_PATH)/$(DEXPREOPT_BOOT_JAR_DIR)
 
 # The default value for LOCAL_DEX_PREOPT
-DEX_PREOPT_DEFAULT ?= true
+DEX_PREOPT_DEFAULT ?= false
 
 # The default filter for which files go into the system_other image (if it is
 # being used). To bundle everything one should set this to '%'
@@ -40,7 +40,7 @@ ifeq ($(HOST_OS),linux)
     DEX_PREOPT_DEFAULT := nostripping
     # For an eng build only pre-opt the boot image and system server. This gives reasonable performance
     # and still allows a simple workflow: building in frameworks/base and syncing.
-    WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= true
+    WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY ?= false
   endif
   # Add mini-debug-info to the boot classpath unless explicitly asked not to.
   ifneq (false,$(WITH_DEXPREOPT_DEBUG_INFO))
@@ -49,13 +49,13 @@ ifeq ($(HOST_OS),linux)
 
   # Non eng linux builds must have preopt enabled so that system server doesn't run as interpreter
   # only. b/74209329
-  ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT)))
-    ifneq (true,$(WITH_DEXPREOPT))
-      ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
-        $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds)
-      endif
-    endif
-  endif
+  #ifeq (,$(filter eng, $(TARGET_BUILD_VARIANT)))
+  #  ifneq (true,$(WITH_DEXPREOPT))
+  #    ifneq (true,$(WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY))
+  #      $(call pretty-error, DEXPREOPT must be enabled for user and userdebug builds)
+  #    endif
+  #  endif
+  #endif
 endif
 
 GLOBAL_DEXPREOPT_FLAGS :=

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

清风12123

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值