How to pack and pre-install a Prebuilt APK?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

How to pack and pre-install a Prebuilt APK?

5,305件の閲覧回数
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

ラベル(6)
3 返答(返信)

2,362件の閲覧回数
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 件の賞賛
返信

3,144件の閲覧回数
tony2_lee
Contributor I

I have same problem, anybody can help on this?

Tony Lee

0 件の賞賛
返信

3,144件の閲覧回数
tftu
Contributor III

Still looking for the solution, anybody?

-tftu

0 件の賞賛
返信