Transferred from: http://www.cnblogs.com/myitm/archive/2011/12/01/2271032.html
This article briefly analyzes how Build.prop is generated. Android Build.prop files are the various property collected at the time of Android compilation (LCD density/language/compile time, etc), after compilation, the file is generated in out/target/product/< The board>/system/directory. These property values can be read at Android runtime by Property_get () [c/C + + domain]/systemproperties_get* () [Java domain].
The generation of Build.prop is done by the make system parsing build/core/Makefile .
1) The variables are defined first in Makefile , which is used when the next step is performed. Like what:
... Product_default_language="$ (calldefault-locale-language,$ (product_locales))" \ Product_default_region="$ (calldefault-locale-region,$ (product_locales))" \ ...
2) Call build/tools/buildinfo.sh execute script in makefile and output to Build.prop
Buildinfo.sh is very simple, just echo some properties, such as:
... echo"ro.product.locale.language= $PRODUCT _default_language" Echo " ro.product.locale.region= $PRODUCT _default_region " ...
Instead, Ro.product.locale.language/ro.product.locale.region is a property, followed by a value.
3) Add the contents of $ (target_device_dir)/System.prop to Build.prop directly in makefile.
4) Collect the attributes from the additional_build_properties and append them to the Build.prop.
Additional_build_properties also collects the properties defined in the product_property_overrides
additional_build_properties:= \ $ (additional_build_properties) \
Through the analysis of the Build.prop generation process, we can know where to modify the original properties or add their own definition of attributes, that is 2) buildinfo.sh; 3) System.prop; 4) additional_build_properties or product_property_overrides. However, personal advice is changed to System.prop or product_property_overrides, which corresponds to specific platform or product modifications.
Build.prop generation process Analysis of Android properties (reproduced)