Remove unused system apps

1

There are two methods here: the first is to modify the compiled makefile to use the anti-filter function filter-out, which is the opposite of the "filter" function, and the usage is as follows:

$(filter-out PATTERN…,TEXT) `
  • Function:
    Filter out all words that match the pattern "PATTERN" in the string "TEXT", and keep all words that do not match this pattern. There can be multiple patterns. When there are multiple patterns, the pattern expressions are separated by spaces.

  • Return value:
    All strings in the space-separated "TEXT" string that do not match the pattern "PATTERN".

  • Function description:

  • The "filter-out" function can also be used to remove certain strings from a variable (the implementation is the opposite of the "filter" function).
    The second way is to directly kill the .mk file or .bp file that compiles the app

2.

First add the following content in build/core/main.mk:

define product-installed-files
  $(eval _pif_modules := \
    $(call get-product-var,$(1),PRODUCT_PACKAGES) \
    $(if $(filter eng,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_ENG)) \
    $(if $(filter debug,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_DEBUG)) \
    $(if $(filter tests,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_TESTS)) \
    $(if $(filter asan,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_DEBUG_ASAN)) \
    $(if $(filter java_coverage,$(tags_to_install)),$(call get-product-var,$(1),PRODUCT_PACKAGES_DEBUG_JAVA_COVERAGE)) \
    $(call auto-included-modules) \
  ) \
  $(eval ### Filter out the overridden packages and executables before doing expansion) \
  $(eval _pif_overrides := $(call module-overrides,$(_pif_modules))) \
  $(eval _pif_modules := $(filter-out $(_pif_overrides), $(_pif_modules))) \
+  $(eval ### remove package not needed) \
+  $(eval _pif_modules := $(filter-out $(PRODUCT_REMOVE_PACKAGES), $(_pif_modules))) \

Then add the following content in device/rockchip/rk3566/xxx/device.mk:

PRODUCT_PACKAGES += thermasol
#add sensor hal
PRODUCT_PACKAGES += sensors.$(TARGET_BOARD_PLATFORM)
#add dfu-util
PRODUCT_PACKAGES += dfu_util
+ #packges needed to be removed
+ PRODUCT_REMOVE_PACKAGES += Camera2

I am here to remove the camera app, then compile and burn it to the board and it will be OK.

3

Directly remove the Android.mk that compiles Camer2, and then compile and burn it to the board.

Guess you like

Origin blog.csdn.net/weixin_68294039/article/details/129932569