Build.prop generation process Analysis of Android properties (reproduced)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.