Skip to content

Android Boot APK

Property Configuration Method

Tip

The property configuration method is a KICKPI Android system customization feature (some system images may not support it; if it doesn't work properly, please consult KICKPI official technical support).

Configuration via ADB

1. Install the app that needs to boot up (via USB drive, ADB, etc.).

2. Obtain the package name and activity class name of the corresponding app; Click here to view the method for obtaining and testing.

3. Property configuration:

Note

$packname: Package Name
$classname: Activity Class Name

adb shell
setprop persist.sys.bootAppPack $packname
setprop persist.sys.bootAppClass $classname
Operation Example: Set the properties to the package name and activity class name of the app that needs to boot up.

adb shell
setprop persist.sys.bootAppPack com.android.settings
setprop persist.sys.bootAppClass com.android.settings.Settings

4. Reboot:

adb reboot

SDK Configuration (Modify Source Code to Customize Image)

Main Control Models Compilation Configuration Path
A133 K5/K5C android/device/softwinner/ceres-c3/ceres_c3.mk
H618 K2B/K2C device/softwinner/apollo/apollo_p2.mk
RK3562/RK3568/RK3576/RK3588 K1/K1B/K3/K7/K7C/K8 device/rockchip/common/device.mk

1. Preinstall the APK, e.g., TestLauncher; Click to view the preinstallation method.

2. Obtain the package name and activity class name of the corresponding app; Click here to view the method for obtaining and testing.

3. Add the app named TestLauncher to the compilation:

+PRODUCT_PACKAGES += \
+       TestLauncher

4. Add property configuration for package name and class name:

+ PRODUCT_PROPERTY_OVERRIDES += \
+   persist.sys.bootAppPack=com.android.TestLauncher \
+   persist.sys.bootAppClass=com.android.TestLauncher.Activity

5. Compile the SDK and flash the image.

Launcher Method

Android will start the app with the HOME attribute by default on boot. This section describes how to modify an app to have the HOME attribute.

App Modification

1. Add two categories in the app's AndroidManifest.xml:

<activity android:name=".MainActivity">
    <intent-filter>
        <category android:name="android.intent.category.HOME"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</activity>

2. Recompile to generate the app with the HOME attribute, Sign the APK.

3. Install the app, and go to Settings > Apps > Default apps > Home app to change it to your app.

SDK Modification (Modify Source Code to Customize Image)

Main Control Models Launchers Compilation Configuration Path
A133 K5/K5C Launcher2
Launcher3
Launcher3QuickStep
Launcher3QuickStepGo
android/device/softwinner/ceres-c3/ceres_c3.mk
H618 K2B/K2C Launcher2
Launcher3
Launcher3QuickStep
Launcher3QuickStepGo
TvLauncher
vendor/aw/homlet/homlet.mk
RK3562/RK3568/RK3576/RK3588 K1/K1B/K3/K7/K7C/K8 Launcher2
Launcher3
Launcher3QuickStep
Launcher3QuickStepGo
device/rockchip/common/device.mk

1. Preinstall the APK, for example, TestLauncher.

2. Add launcher priority override in the compilation configuration file:

Warning

K2B/K2C require overriding TvLauncher as well!

Android.mk method:

    LOCAL_OVERRIDES_PACKAGES := \
        Launcher2 \
        Launcher3 \
        Launcher3QuickStep \
        Launcher3QuickStepGo

Android.bp method:

    overrides: [
        "Launcher2",
        "Launcher3",
        "Launcher3QuickStep",
        "Launcher3QuickStepGo",
    ],

3. Compile the SDK and flash the image.

Starting an App via Command Line

am start

am start is a command-line tool in the Android system used to start Activities, part of the Activity Manager (am). It allows you to directly launch a specific interface of an application from the command line, often used for testing, automation scripts, or debugging scenarios.

Operation Example: Manually start Settings

adb shell am start com.android.settings/com.android.settings.Settings

Note

com.android.settings: The app's package name.
com.android.settings.Settings: The class name of the app's interface.
Once you have the app's package name and activity class name, you can start it using am start.

Obtaining the Package Name and Activity Class Name for a Specific App Page

1. Manually open the corresponding interface, then execute the command to get the currently active Activity:

adb shell dumpsys window | grep mCurrentFocus

Operation Example: Get the package name and class name of the Settings interface.

The command output will contain information like com.android.settings/com.android.settings.Settings, where the part before / is the package name and the part after is the Activity class name. Replace these directly in the am start -n command.

Obtaining the Package Name and Activity Class Name of an App

View installed applications:

adb shell pm list packages

View Activity information for an application:

adb shell
dumpsys package $packname | grep -i activity

Operation Example:

adb shell
dumpsys package com.android.settings | grep -i activity

Q&A

  • Special Permissions for the App?

Launcher-level apps are special applications. Adding special permissions might prevent the system from starting. It's necessary to capture relevant log logs for the app:

# logcat | grep LauncherTest
09-14 10:36:06.662  3826  3826 W PackageManager: Privileged permission android.permission.INSTALL_PACKAGES for package com.example.myapplication (/system/priv-app/LauncherTest) not in privapp-permissions allowlist
09-14 10:36:08.437  3826  3826 W PackageManager: Privileged permission android.permission.INSTALL_PACKAGES for package com.example.myapplication (/system/priv-app/LauncherTest) not in privapp-permissions allowlist
  • How to Modify Special Permissions in the SDK Source Code?

Based on the log, modify the content for android.permission.INSTALL_PACKAGES as follows. For other errors, add similar entries:

--- a/frameworks/base/data/etc/privapp-permissions-platform.xml
+++ b/frameworks/base/data/etc/privapp-permissions-platform.xml
@@ -550,4 +550,8 @@ applications that come with the platform
     <privapp-permissions package="com.android.calllogbackup">
         <permission name="com.android.voicemail.permission.READ_VOICEMAIL"/>
     </privapp-permissions>
+
+    <privapp-permissions package="com.example.myapplication">
+        <permission name="android.permission.INSTALL_PACKAGES"/>
+    </privapp-permissions>

Path on the board:

/etc/permissions/privapp-permissions-platform.xml
  • Compilation Failure?

Compilation failures can manifest differently depending on the app, such as missing libraries, incorrect app paths, etc.

General solution: Copy the compilation error log and provide it to an AI for answers; usually, you can get the correct solution. It generally involves adding corresponding configurations to Android.mk or Android.bp.