Pre-made third-party apk in Android11.0 system

Pre-made third-party applications

This article describes prefabricating third-party apk in the Android11 ​​system of RK3568.

RK prefabrication method

RK provides three pre-installation methods:
a. Install applications that cannot be uninstalled;
b. Install applications that can be permanently uninstalled;
c. Install and uninstall applications that automatically restore to factory settings;

  1. Get the target folder through the get_build_var TARGET_DEVICE_DIR command, eg:device/rockchip/rk356x/yjz.
  2. Add preinstall, preinstall_del_forever, and preinstall_del folders in this directory; corresponding to the above three methods respectively;
  3. Put the applications that need to be preset into the corresponding folders. Please note that the apk file name should be in English as much as possible and avoid spaces;
  4. After the compilation project is completed, three folders, bundled_persist-app, bundled_uninstall_gone-app, and bundled_uninstall_back-app, will be generated in the /out/target/product/product model/odm directory;
  5. Flash verification.
    Note: This method does not support prefabrication of applications with systemuid;

Native prefabrication method

The App placement directory can choose packages/apps or vendor/rockchip/common/apps. This article is placed in the vendor/rockchip/common/apps directory;

  1. Create a Demo directory and place demo.ap in this directory.
  2. Add Android.mk file;

# Demo
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := Demo
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
#安装目录
LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/app
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
include $(BUILD_PREBUILT)

  1. Modify the apps.mk file and add Demo to the compilation. The path is vendor/rockchip/common/apps/apps.mk
/**省略代码**/

PRODUCT_PACKAGES += \
    RKUpdateService \
    Demo
    
/**省略代码**/
  1. Compile the project and flash the machine to verify.

Guess you like

Origin blog.csdn.net/yjz_0314/article/details/133775167