Add an APK to the AOSP build

fabiodelorenzo
Posts: 65
Joined: Thu Oct 03, 2013 5:54 pm

Add an APK to the AOSP build

Postby fabiodelorenzo » Mon Sep 10, 2018 5:38 pm

APKs and APPs with source code go to the same place; the package/app folder.

Adding a new APK to the build in /system/app
In the AOSP root add the folder:

<aosp root>/package/app/< yourappfolder >

Then inside this folder add:

empty Android.mk
< yourapp.apk >

The android make file should have the reference to your apk, add this to your Android.mk:

Code: Select all

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := < your app folder name >
LOCAL_CERTIFICATE := < desired key >
LOCAL_SRC_FILES := < app apk filename >
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
include $(BUILD_PREBUILT)


Create an entry in the commons.mk (usually in build/target/product) for your apk add the line (check where all the others are)

PRODUCT_PACKAGES += < what you have defined in LOCAL_MODULE, it should be your app folder name >

READ THIS:
If you wish to install the APK in /data/app you will need to add the following the line to Android.mk before line include $(BUILD_PREBUILT)

LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)

Return to “AOSP”

Who is online

Users browsing this forum: No registered users and 1 guest