This article briefly analyzes how build. Prop is generated. Android build. the prop file is a variety of properties (LCD density/Language/Compilation Time, etc.) collected during Android compilation .), after compilation, the file is generated in the out/target/product/<board>/system/directory. During Android runtime, you can use property_get () [C/C ++ domain]/systemproperties_get * () [Java domain] to read these attribute values.
Build. PropThe build/CORE/MakefileComplete.
1)MakefileDefine various variables first, which will be used in the next step. For example:
View plain
- ...
- Product_default_language = "$ (calldefault-locale-language, $ (product_locales ))"\
- Product_default_region = "$ (calldefault-locale-region, $ (product_locales ))"\
- ...
2) Call build/tools/In makefile/Buildinfo. ShRun the script and output it to build. Prop.
Buildinfo. Sh is simple, just echo some attributes, such:
View plain
- ...
- Echo "Ro. Product. locale. Language = $ product_default_language"
- Echo "Ro. Product. locale. region = $ product_default_region"
- ...
Ro. Product. locale. Language/Ro. Product. locale. region are some attributes, and values are followed by equal signs.
3) In makefile, directly add $ (target_device_dir )/System. PropContent to build. Prop.
4) CollectionAdditional_build_propertiesAnd append it to build. Prop.
Additional_build_properties will be collected againProduct_property_overridesProperties defined in
View plain
- Additional_build_properties: = \
- $ (Additional_build_properties )\
- $ (Product_property_overrides)
Use build. the analysis of the prop generation process shows where to modify the original attributes or add custom attributes, that is, 2) buildinfo. SH; 3) system. prop; 4) additional_build_properties or product_property_overrides. However, it is recommended that you change it to system. Prop or product_property_overrides, which corresponds to the modification of a specific platform or product.