Skip to content

Commit

Permalink
Do not copy miui app if vendor app is added
Browse files Browse the repository at this point in the history
N/A

Change-Id: I9dfcac4b35e03783a8b32ea790519881b589893c
Signed-off-by: mochangming <[email protected]>
  • Loading branch information
mochangming committed Nov 14, 2016
1 parent 2457b2c commit 6a8103e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 24 deletions.
7 changes: 5 additions & 2 deletions apps.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ ALL_MIUI_PRIV_APPS :=
$(foreach app, $(subst .apk,,$(shell find $(PREBUILT_PRIV_APP_APK_DIR) -name "*.apk" -exec basename {} \;)), \
$(eval ALL_MIUI_PRIV_APPS += $(app)))

MIUI_PRIV_APPS := $(filter-out $(MIUI_APP_BLACKLIST),$(ALL_MIUI_PRIV_APPS))
MIUI_PRIV_APPS := $(filter-out $(MIUI_APP_BLACKLIST) $(VENDOR_APPS),$(ALL_MIUI_PRIV_APPS))


ALL_MIUI_APPS :=
$(foreach app, $(subst .apk,,$(shell find $(PREBUILT_APP_APK_DIR) -name "*.apk" -exec basename {} \;)), \
$(eval ALL_MIUI_APPS += $(app)))

MIUI_APPS := $(filter-out $(MIUI_APP_BLACKLIST),$(ALL_MIUI_APPS))
MIUI_APPS := $(filter-out $(MIUI_APP_BLACKLIST) $(VENDOR_PRIV_APPS),$(ALL_MIUI_APPS))

$(call copy-apks-to-target, $(MIUI_APPS), $(PREBUILT_APP_APK_DIR), $(TARGET_APP_DIR))
$(call copy-apks-to-target, $(MIUI_PRIV_APPS), $(PREBUILT_PRIV_APP_APK_DIR), $(TARGET_PRIV_APP_DIR))

TARGET_APPS := $(foreach app_name, $(MIUI_APPS),$(TARGET_APP_DIR)/$(app_name)/$(app_name).apk) \
$(foreach app_name, $(MIUI_PRIV_APPS),$(TARGET_PRIV_APP_DIR)/$(app_name)/$(app_name).apk) \
Expand Down
20 changes: 6 additions & 14 deletions localvar.mk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# local-miui-removed-apps
# local-miui-modified-apps
# local-phone-apps
# local-remove-apps
# local-phone-priv-apps
# local-pre-zip
# local-after-zip
# local-density
Expand Down Expand Up @@ -55,10 +55,14 @@ endif

MOD_APPS := $(strip $(local-modified-apps))
MOD_MIUI_APPS := $(strip $(local-miui-modified-apps))
MIUI_APP_BLACKLIST := $(MOD_MIUI_APPS) $(strip $(local-miui-removed-apps))
MIUI_APP_BLACKLIST := $(MOD_MIUI_APPS) $(strip $(local-miui-removed-apps)) \
$(strip $(local-phone-apps)) $(strip $(local-phone-priv-apps))

PHONE_JARS := $(strip $(local-modified-jars))

VENDOR_APPS := $(strip $(local-phone-apps))
VENDOR_PRIV_APPS := $(strip $(local-phone-priv-apps))


ACT_PRE_ZIP := $(strip $(local-pre-zip))
ACT_PRE_ZIP += pre-zip-misc
Expand All @@ -69,18 +73,6 @@ else
REWRITE_SKIA_LIB := true
endif

# if local-phone-apps is set, local-remove-apps would not be used,
# and the apps could be removed at target $(ZIP_DIR)
ifeq ($(strip $(local-phone-apps)),)
RUNDAPKS := $(strip $(local-remove-apps))
ifneq ($(RUNDAPKS),)
ACT_PRE_ZIP += remove-rund-apks
endif
else
local-remove-apps :=
RUNDAPKS :=
endif

ACT_PRE_ZIP += $(VERIFY_OTA)

ACT_AFTER_ZIP := $(strip $(local-after-zip))
Expand Down
8 changes: 0 additions & 8 deletions porting.mk
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ $(foreach jar, $(MIUI_JARS), \
$(foreach jar, $(PHONE_JARS), \
$(eval $(call JAR_PHONE_template,$(jar))))

$(call copy-apks-to-target, $(MIUI_APPS), $(PREBUILT_APP_APK_DIR), $(TARGET_APP_DIR))
$(call copy-apks-to-target, $(MIUI_PRIV_APPS), $(PREBUILT_PRIV_APP_APK_DIR), $(TARGET_PRIV_APP_DIR))
$(eval $(call copy-one-file,$(TARGET_OUT_DIR)/framework-ext-res.apk,$(TARGET_FRAMEWORK_DIR)/framework-ext-res/framework-ext-res.apk))
$(eval $(call copy-one-file,$(TARGET_OUT_DIR)/framework-res.apk,$(TARGET_FRAMEWORK_DIR)/framework-res.apk))

Expand Down Expand Up @@ -249,12 +247,6 @@ $(APKTOOL_INCLUDE_MIUI_RES): $(PREBUILT_RES_DIR)/framework-res.apk $(MIUI_EXT_RE
$(APKTOOL) if -p $(TARGET_OUT_DIR)/apktool $$res_file; \
done

remove-rund-apks:
@echo ">>> remove all unnecessary apks from original ZIP file..."
$(hide) rm -rf $(addprefix $(ZIP_DIR)/system/app/, $(RUNDAPKS))
$(hide) rm -rf $(addprefix $(ZIP_DIR)/system/priv-app/, $(RUNDAPKS))
@echo "<<< remove done!"

pre-zip-misc: set-build-prop add-device-feature
pre-zip-misc: merge-preloaded-classes insertkeys-mac_permissions
pre-zip-misc: patch-bootimg
Expand Down

0 comments on commit 6a8103e

Please sign in to comment.