Build.prop file parsing can be seen--->:http://my.oschina.net/f839903061/blog/145403
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:
[Plain] view plaincopy
-
...
-
product_default_language= "$ (calldefault-locale-language,$ (product_locales))" &NBSP;\&NBSP;&NBSP;
-
PRODUCT _default_region= "$ (calldefault-locale-region,$ (product_locales))" &NBSP;\&NBSP;&NBSP;
-
Span style= "margin:0px; padding:0px; Border:none; Color:black; Background-color:inherit; " >...
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:
[Plain] view plaincopy
-
...
-
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
[Plain] view plaincopy
-
additional_build_properties:= \
-
$ (additional_build_properties) \
-
$ (product_property_overrides)
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.
Analysis of the Build.prop generation process of Android properties