Introduction
This article introduces the method of pre-installing APKs on the Rockchip Android platform based on the RK PX30 Android 8.1 platform. It is suitable for our IDO-EVB3020 development board, which is based on the RK PX30 quad-core development board with a clock speed of up to 1.5 GHz, using the Mali-G31 MP2 GPU, supporting H.265 and other formats for 1080P 60fps video decoding; supports MIPI-CSI camera interface, supports 10.1-inch MIPI screen, 7/8/10.1-inch LVDS screen; supports Ethernet, 4G/WIFI/Bluetooth wireless communication; onboard 4 RS232 + 2 RS485; reserved 1 CAN bus, 4 microphone arrays. Suitable for industrial HMI, smart device display control, smart home.
Product Features:
-
MIPI/LVDS direct screen drive, quad-core A35 fully functional ultra-thin size motherboard;
-
Supports multiple communication interfaces such as Ethernet/4G/WIFI/Bluetooth;
-
6 serial ports + 6 USB + 1 CAN bus + multiple GPIO expansions;
-
Supports multiple systems including Android, Debian, Ubuntu, Buildroot;
Product specification: IDO-EVB3020 Product Manual
The RK APK pre-installation mainly consists of two situations: one is using the native Android method, and the other is using the pre-installation method implemented by Rockchip.
Rockchip Pre-Installation Method
Rockchip’s custom pre-installation method has three types:
preinstall — pre-installed non-uninstallable APK
preinstall_del — pre-installed uninstallable APK (can be restored after factory reset)
preinstall_del_forever — pre-installed uninstallable APK (cannot be restored after factory reset)
Taking preinstall as an example, add test-app.apk in the Android source code device/rockchip/rk3326/px30_evb/preinstall/ directory:
Re-execute the following command to compile the source code:
make installclean && make -j30 && ./mkimage.sh
The system will automatically generate a directory for the APK named test-app, which contains Android.mk and test-app.apk files.
After re-flashing the system, you can see that test-app.apk is pre-installed in the system.
test-app.apk is added to the /oem/bundled_persist-app directory:
Dragging the APK icon does not prompt for uninstalling the icon, and it cannot be uninstalled.
Native Android Pre-Installation Method
Similarly, taking test-app.apk as an example, create a test-app folder in the source code’s packages/apps directory, and add test-app.apk and Android.mk in the folder. The mk content is as follows:
LOCAL_PATH := $(my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test-app
LOCAL_MODULE_CLASS := APPS
LOCAL_SRC_FILES := $(LOCAL_MODULE)$(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_CERTIFICATE := PRESIGNED
#LOCAL_DEX_PREOPT := false
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)
Add the compiled test-app in device/rockchip/rk3326/device-common.mk.
PRODUCT_PACKAGES += test-app

