This article was reproduced from: http://blog.csdn.net/lengyue1084/article/details/77637354
I. Concept
In the Android device Shell Terminal can see the/system directory of Build.prop files, Android Build.prop files are collected at the time of Android compile various property (LCD density/language/compile time , etc.), the file is generated in the out/target/product/<board>/system/directory after the compilation is complete. These attribute values can be read from the Property_get () [C + + domain]/systemproperties_get* () [Java domain] at the time of Android runtime, referring to the android--systemproperties application
Two. Build
The Build.prop generation is done by the make system parsing build/core/makefile:
[HTML]View Plain copy print?
- Buildinfo_sh : = build/tools/buildinfo.sh
- $ (Installed_build_prop_target): $ (buildinfo_sh) $ (internal_build_id_makefile) $ (build_system)/version_defaults.mk $ (wildcard $ (target_device_dir)/system.prop)
- @echo Target buildinfo: [Email protected]
- @mkdir-P $ (dir [email protected])
- $ (hide) target_build_type="$ (target_build_variant)" \
- target_device="$ (target_device)" \
- product_name="$ (target_product)" \
- product_brand="$ (product_brand)" \
- product_default_language="$ (call default-locale-language,$ (product_locales))" \
- product_default_region="$ (call default-locale-region,$ (product_locales))" \
- product_default_wifi_channels="$ (product_default_wifi_channels)" \
- product_model="$ (product_model)" \
- product_manufacturer="$ (product_manufacturer)" \
- private_build_desc="$ (private_build_desc)" \
- build_id="$ (build_id)" \
- build_display_id="$ (build_display_id)" \
- build_number="$ (build_number)" \
- platform_version="$ (platform_version)" \
- platform_sdk_version="$ (platform_sdk_version)" \
- platform_version_codename="$ (platform_version_codename)" \
- build_version_tags="$ (build_version_tags)" \
- target_bootloader_board_name="$ (target_bootloader_board_name)" \
- build_fingerprint="$ (build_fingerprint)" \
- target_board_platform="$ (target_board_platform)" \
- target_cpu_abi="$ (target_cpu_abi)" \
- target_cpu_abi2="$ (TARGET_CPU_ABI2)" \
- target_aapt_characteristics="$ (target_aapt_characteristics)" \
- bash $ (buildinfo_sh) > [email protected]
- $ (hide) if [-F $ (target_device_dir)/system.prop]; Then \
- Cat $ (target_device_dir)/system.prop >> [email protected];
- Fi
- $ (if $ (additional_build_properties), \
- $ (hide) echo >> [email protected]; \
- echo "#" >> [email protected]; \
- echo "# additional_build_properties" >> [email protected]; \
- echo "#" >> [email protected];)
- $ (hide) $ (foreach line,$ (additional_build_properties), \
- echo "$ (line)" >> [email protected];)
- $ (hide) build/tools/post_process_props.py [email protected]
- Build_desc : =
1. The target installed_build_prop_target is
[HTML]View Plain copy print?
- Installed_build_prop_target : = $ (target_out)/build.prop
You can see that the values that define some variables, such as Product_default_language, are used in later scripts. Then call build/tools/buildinfo.sh this script
[HTML]View Plain copy print?
- bash $ (buildinfo_sh) > [email protected]
Output the variable to Build.prop:
[HTML]View Plain copy print?
- echo "# Begin Build Properties"
- echo "# Autogenerated by buildinfo.sh"
- echo "ro.build.id= $BUILD _id"
- echo "ro.build.display.id= $BUILD _display_id"
- echo "ro.build.version.incremental= $BUILD _number"
- echo "ro.build.version.sdk= $PLATFORM _sdk_version"
- echo "ro.build.version.codename= $PLATFORM _version_codename"
- echo "ro.build.version.release= $PLATFORM _version"
- echo "ro.build.date= ' Date '"
- echo "ro.build.date.utc= ' date +%s '"
- echo "ro.build.type= $TARGET _build_type"
- echo "ro.build.user= $USER"
- echo "ro.build.host= ' hostname '"
- echo "ro.build.tags= $BUILD _version_tags"
- echo "ro.product.model= $PRODUCT _model"
- echo "ro.product.brand= $PRODUCT _brand"
- echo "ro.product.name= $PRODUCT _name"
- echo "ro.product.device= $TARGET _device"
- echo "ro.product.board= $TARGET _bootloader_board_name"
- echo "ro.product.cpu.abi= $TARGET _cpu_abi"
- If [-N "$TARGET _cpu_abi2"]; Then
- echo "ro.product.cpu.abi2= $TARGET _cpu_abi2"
- Fi
- echo "ro.product.manufacturer= $PRODUCT _manufacturer"
- If [-N "$PRODUCT _default_language"]; Then
- echo "ro.product.locale.language= $PRODUCT _default_language"
- Fi
- If [-N "$PRODUCT _default_region"]; Then
- echo "ro.product.locale.region= $PRODUCT _default_region"
- Fi
- echo "ro.wifi.channels= $PRODUCT _default_wifi_channels"
- echo "ro.board.platform= $TARGET _board_platform"
- echo "# ro.build.product is obsolete; Use Ro.product.device "
- echo "ro.build.product= $TARGET _device"
- echo "# Do not try to parse ro.build.description or. Fingerprint"
- echo "ro.build.description= $PRIVATE _build_desc"
- echo "ro.build.fingerprint= $BUILD _fingerprint"
- echo "ro.build.characteristics= $TARGET _aapt_characteristics"
- echo "# End Build Properties"
After the buildinfo.sh script is finished, the contents of $ (target_device_dir)/system.prop and
[HTML]View Plain copy print?
- # ADD The product-defined properties to the build properties.
- Additional_build_properties : = \
- $ (additional_build_properties) \
- $ (product_property_overrides)
The properties of the additional_build_properties are appended to Build.prop.
At this point, the build Build.prop is complete!
Three. Properties
# Begin build Properties (start building system attributes)
# Autogenerated by buildinfo.sh (currently this section is automatically generated by Build.info)
RO.BUILD.ID=IML74K (Version ID)
ro.build.display.id=t40-mg-s2-v1.0 (version number)
ro.build.version.incremental=eng.root.20130428.234356 (version increment)
Ro.build.version.sdk=15 (SDK Version)
Ro.build.version.codename=rel (Version code)
ro.build.version.release=4.0.3 (Android version)
ro.build.date=2013 April 28 Sunday 23:46:27 CST (compile time)
ro.build.date.utc=1367163987 (UTC representation of compile time)
Ro.build.type=eng (Compilation type: Eng/user)
Ro.build.user=root (compiler)
Ro.build.host=alex-natty-dell (compile host name)
Ro.build.tags=debug,test-keys
RO.PRODUCT.MODEL=S2 (mobile phone model)--
Ro.product.brand=spreadtrum (mobile brand)
Ro.product.name=sp6825eb_7661plus (official name of mobile phone)
ro.product.device=sp6825eb_7661 (equipment used)
ro.product.board=sp6825eb_7661 (motherboard used)
RO.PRODUCT.CPU.ABI=ARMEABI-V7A (version of CPU)
Ro.product.cpu.abi2=armeabi (CPU Brand)
Ro.product.manufacturer=spreadtrum (handset manufacturer)
ro.wifi.channels= (WiFi connection channel)
ro.board.platform=sc8825 (Motherboard platform)
ro.sf.lcd_density=240 (display density)
ro.sf.hwrotation = 180 (upper data rotation 180 degrees)
Ro.gpu=mali (Image processor with Mali)
ro.opengles.version=131072 (OpenGL for Embedded Systems)
Ro.device.support.mmc=1
Hwui.render_dirty_regions=false
ro.hwui.text_cache_width=2048
Persist.ttydev=ttyvuart0
Ro.device.support.vt=0 (Videophone support)
Ro.device.support.gps=0 (GPS supported)
Keyguard.no_require_sim=true (Mobile card protection settings. True: No SIM card is required to operate the phone)
Ro.com.android.dataroaming=false (Roaming settings)
persist.msms.phone_count=2 (Dual sim)
Persist.blcr.enable=0
Persist.msms.phone_default=0 (Dual sim default first card)
dalvik.vm.heapsize=128m (Virtual memory size: 16m/24m/32m/48m, etc.)
RO.COM.ANDROID.DATEFORMAT=MM-DD-YYYY (Default time format: YYYY-MM-DD, etc.)
Ro.config.ringtone=beatplucker.ogg (default ringtone settings, file in/system/media/audio/ringtones put the favorite ringtone here, such as 123. MP3 into the ringtones folder, where the code is changed to Ro.config.ringtone=123.mp3)
Ro.config.notification_sound=pixiedust.ogg (default beep:/system/media/audio/notifications)
Ro.config.alarm_alert=alarm_classic.ogg (Default alarm tone:/system/media/audio/alarms)
Ro.product.locale.language=zh (phone default language, e.g. En/zh)
RO.PRODUCT.LOCALE.REGION=CN (regional languages, such as: US/CN)
(Product specific MK file (e.g. Prod_sp6825_7661base.mk) scope since this end)
Ro.kernel.android.checkjni=1
Ro.setupwizard.mode=optional (Setup Wizard mode)
Net.bt.name=android
Dalvik.vm.stack-trace-file=/data/anr/traces.txt (This parameter controls the stack record debug file for the Dalvik virtual machine.) For system debugging, the general user does not make sense to its adjustment)
Ro.logappslow=0
Ro.build.product.lowmem=0
Ro.floatkey.show=false (true: support small green dot function, click the small green point on the interface can jump out of the Menu/home/back three virtual keys)
Persist.sys.kb.auto=1
Device.support.face.smile=1 (whether to support smiley-face photography and facial recognition)
Device.support.pano=1 (whether the camera supports panoramic photography)
Android--build.prop parsing "Go"