Rohit Rokde Rohit Rokde - 1 month ago 12
Android Question

Difference between LOCAL_CERTIFICATE values in Android.mk

What is the difference between the different values of the variable LOCAL_CERTIFICATE ?

I know of two values platform and shared. What are the other possible values in Android build system ? How does it effect our application's behavior.

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

LOCAL_MODULE_TAGS := optional

LOCAL_SRC_FILES := $(call all-java-files-under, src)

LOCAL_PACKAGE_NAME := abc
LOCAL_CERTIFICATE := shared

LOCAL_JNI_STATIC_LIBRARIES := abcjni

LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)

include $(call all-makefiles-under,$(LOCAL_PATH))

Answer

Besides the value platform and shared, there are other two values called media and releasekey. The following list illustrate their differences which was copy from Android build system from here.

  • platform: a key for packages that are part of the core platform.
  • shared: a key for things that are shared in the home/contacts process.
  • media: a key for packages that are part of the media/download system.
  • releasekey: the default key to sign with if not otherwise specified

Those are the signatures used by Android security system to ensure the core component and the framework of the system's security is under the control of manufacture.

The link about Android build system I gave above is not official, but it's a good material for references.