androidandroid-sourceprebuild

When i add app priv-app phone not booting


I have been trying to add a apk to priv-app.

Following are the steps i did:

Made a folder named Testapk in packages/apps Copied apk to folder with name Testapk.apk In same directory, created an Android.mk file with following contents:

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := Testapk
LOCAL_CERTIFICATE := PRESIGNED
LOCAL_SRC_FILES := Testapk.apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_PRIVILEGED_MODULE := true
TARGET_OUT_DATA_APPS_PRIVILEGED := $(TARGET_OUT_DATA)/priv-app

include $(BUILD_PREBUILT)

Then, added Testapk to /build/target/product/base_system.mk

Build is successful and i can see my apk in priv-app folder in out/target/product/sdm660_64/system/priv-app. After flashing, the device wont boot up. Its stuck on Android logo.

I am using Qualcom SDM660, the branch is android-10

If I add the apk to system/apps, i can boot and the apk works fine.

Can someone help me on this???


Solution

  • You haven't shared the Crash Stack here. Its difficult to tell.

    I could see here that Are you requesting any privileged permissions from the app side ? if yes, device will not boot until you whitelist those permissions in privileged permissions xml file which will be stored at either system/etc/permissions