Emvironment
・Deivce : Khadas VIM4
・OS : Android 11
Process
・Execute commands which are written below
adb root
adb remount
adb shell mkdir -p /system/priv-app/{Directory Name}
adb shell chmod 755 /system/priv-app/{Directory Name}
adb push {Absolutley path of APK file} /system/priv-app/{Directory Name}
adb shell chmod 644 /system/priv-app/{Directory Name}/{APK file name}
adb reboot
Details
Launching Android OS stoped in the middle of it.
After uninstalling the App from /system/priv-app, Android OS launched successfully without any problem.
The App was installed as it needs to be installed as System App, so I’d like to know how to install an App as System App, without occurring any problem when launching Android OS successfully.
Is there a person who experienced the same issue of it?
And does anyone know the way to solve it?
PS
I confirmed VIM4 authorised adb command successfully although Launching Android OS stopped in the middle of it.
@goenjoy
Thank you for telling me the way to install an App as System App.
I found the other way to solve it.
I’d written the process of it.
・Create xml file which is written the permissions for system app.
detail : Privileged permission allowlist | Android Open Source Project
・Execute the commands which is written below
adb root
adb remount
adb push {absolutely directory to xml file} /etc/permissions
1 Like
if we want to build the source come with the system app bundled in it, what is the procedure?
@horyzon
===== System Permissions for APP =====
If a third-party application wants to obtain system permissions, it needs to declare its UID as a system process in the ‘‘AndroidManifest.xml’’ file, and the application needs to be signed with the platform key (signature).
===== Declare UID as a System Process =====
The third-party application’s AndroidManifest.xml must include:
android:sharedUserid="android.uid.system"
===== Sign APP with Platform Key =====
==== APP Signing for SDK Source Code ====
- Put the APK in the application directory, and create an ‘‘Android.mk’’ file containing the following contents:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
# module name should match the apk name
LOCAL_MODULE := XXXX
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_PRIVILEGED_MODULE := true
# use the application's own signature
# LOCAL_CERTIFICATE := PRESIGNED
# sign with the platform key
LOCAL_CERTIFICATE := platform
include $(BUILD_PREBUILT)
- Add the name of your APK ‘‘XXXX’’ into the compile file.
PRODUCT_PACKAGES +=\
Bluetooth \
XXXX
- Recompile the SDK, and the APK file will be generated in the ‘‘out’’ directory, containing the platform key.