Don't read /data/local.prop on user builds

Creating a root owned /data/local.prop is one of the most common
ways to root an Android device. /data/local.prop is only intended
to assist developers on debuggable devices, and is never
intended to be used on production devices.

Change-Id: Ifcfa21c2ee9914b0b54445218b4cf0fea0a98e9c
This commit is contained in:
Nick Kralevich 2012-01-18 13:38:34 -08:00
parent ee508560cc
commit 0dbda7e1c5
2 changed files with 8 additions and 0 deletions

View file

@ -22,6 +22,10 @@ LOCAL_SRC_FILES += bootchart.c
LOCAL_CFLAGS += -DBOOTCHART=1
endif
ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
LOCAL_CFLAGS += -DALLOW_LOCAL_PROP_OVERRIDE=1
endif
LOCAL_MODULE:= init
LOCAL_FORCE_STATIC_EXECUTABLE := true

View file

@ -512,7 +512,9 @@ int properties_inited(void)
*/
void load_persist_props(void)
{
#ifdef ALLOW_LOCAL_PROP_OVERRIDE
load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE);
#endif /* ALLOW_LOCAL_PROP_OVERRIDE */
/* Read persistent properties after all default values have been loaded. */
load_persistent_properties();
}
@ -523,7 +525,9 @@ void start_property_service(void)
load_properties_from_file(PROP_PATH_SYSTEM_BUILD);
load_properties_from_file(PROP_PATH_SYSTEM_DEFAULT);
#ifdef ALLOW_LOCAL_PROP_OVERRIDE
load_properties_from_file(PROP_PATH_LOCAL_OVERRIDE);
#endif /* ALLOW_LOCAL_PROP_OVERRIDE */
/* Read persistent properties after all default values have been loaded. */
load_persistent_properties();