Monday, August 8, 2016

pre-built apk and shared library to sign platform key

1. (working folder example 'PreApp')
create a working folder under ./packages/apps/PreApp

2.
copy PreApp.apk and libpreapp.so to ./packages/apps/PreApp

3.
Create Android.mk under PreApp folder and compose like below
----------------------- Android.mk ------------------------------------
LOCAL_PATH := $(call my-dir)

include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := PreApp
LOCAL_CERTIFICATE := platform
LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
LOCAL_MODULE_CLASS := APPS
LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
LOCAL_REQUIRED_MODULES := libpreapp

include $(BUILD_PREBUILT)

include $(CLEAR_VARS)

LOCAL_MODULE := libpreapp
LOCAL_IS_HOST_MODULE :=
LOCAL_MODULE_CLASS := SHARED_LIBRARIES
LOCAL_MODULE_TAGS := optional
OVERRIDE_BUILT_MODULE_PATH := $(PRODUCT_OUT)/obj/lib
LOCAL_UNINSTALLABLE_MODULE :=
LOCAL_SRC_FILES := libpreapp.so
LOCAL_BUILT_MODULE_STEM := libpreapp.so
LOCAL_STRIP_MODULE :=
LOCAL_MODULE_STEM := libpreapp.so
LOCAL_CERTIFICATE :=
LOCAL_MODULE_PATH := $(PRODUCT_OUT)/system/lib
LOCAL_REQUIRED_MODULES :=
LOCAL_SHARED_LIBRARIES :=

include $(BUILD_PREBUILT)
------------------------------------------------------------------------------
4.
run "mmm ./packages/apps/PreApp" on android root or "mm" under "./packages/apps/PreApp".

5. /* To Do */
Check shared library's module path.
Installing PreApp.apk built from above script extracts libpreapp.so under /data/app/com.package.name/lib/arm.

No comments:

Post a Comment