How to pack and pre-install a Prebuilt APK?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to pack and pre-install a Prebuilt APK?

5,073 Views
tftu
Contributor III

Hi All,

    Our project is based on Andorid ICS(i.MX6 Solo). All hardware/software development is almost done and now we are preparing to finalize the firmware image for mp.

    However, we are stuck in packing and pre-installing a Prebuilt APK which is provided by a software partner. After making whole BSP, we can see the APK file is existing in /myandroid/out/target/product/sabresd_6dq/data/app folder, but NOT in the installed-files.txt, neither in the system.img.

    Below is the content of the Android.mk:

LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE := myAPP

LOCAL_SRC_FILES := $(LOCAL_MODULE).apk

LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)

LOCAL_MODULE_CLASS := APPS

LOCAL_CERTIFICATE := PRESIGNED

#LOCAL_MODULE_PATH := $(TARGET_OUT)/app

LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS)

LOCAL_MODULE_TAGS := optional

include $(BUILD_PREBUILT)

    And we have added below into /myandroid/devices/fsl/imx6/imx6.mk:

PRODUCT_PACKAGES += \

    myAPP

    The same APK file can be manually installed after enabling Android setup->security->unknown source, not sure if we should enable this feature by default, if so, how can we do it in Android BSP?

    And due to the privilege reason, we cannot put the APK into /system/app level. All opinions and comments are more than welcome.

    BTW, we are going to apply the same on another product line which is based on Andorid 4.3 (i.MX6 Sololite), please also kind advise us if the configuration is different for ICS and JB!

    Thanks in advance!

-tftu

Labels (6)
3 Replies

2,130 Views
skrishnan08
Contributor I

Hi

We were also facing the same. When we looked into the frameworks side there are some changes which prevents installing the apps from /data/app, (// If we don't allow this change, any newer,
// user-installed version of the application will be ignored.)

file name: services/core/java/com/android/server/pm/PackageManagerService.java

else {
12221 throw new PackageManagerException(INSTALL_FAILED_INVALID_INSTALL_LOCATION,
12222 "Application package " + pkg.packageName
12223 + " not found; ignoring.");
12224 }

 

we can try neglect this part and try installing the data apps

0 Kudos
Reply

2,912 Views
tony2_lee
Contributor I

I have same problem, anybody can help on this?

Tony Lee

0 Kudos
Reply

2,912 Views
tftu
Contributor III

Still looking for the solution, anybody?

-tftu

0 Kudos
Reply