Preset 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;
- Get the target folder through the get_build_var TARGET_DEVICE_DIR command, eg:device/rockchip/rk356x/yjz.
- Add preinstall, preinstall_del_forever, and preinstall_del folders in this directory; corresponding to the above three methods respectively;
- 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;
- 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;
- 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;
- Create a Demo directory and place demo.ap in this directory.
- 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)
- Modify the apps.mk file and add Demo to the compilation. The path is vendor/rockchip/common/apps/apps.mk
/**省略代码**/
PRODUCT_PACKAGES += \
RKUpdateService \
Demo
/**省略代码**/
- Compile the project and flash the machine to verify.