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:
parent
ee508560cc
commit
0dbda7e1c5
2 changed files with 8 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue