Android--build.prop parsing "Go"

Source: Internet
Author: User

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?
  1. Buildinfo_sh : = build/tools/buildinfo.sh
  2. $ (Installed_build_prop_target): $ (buildinfo_sh) $ (internal_build_id_makefile) $ (build_system)/version_defaults.mk $ (wildcard $ (target_device_dir)/system.prop)
  3. @echo Target buildinfo: [Email protected]
  4. @mkdir-P $ (dir [email protected])
  5. $ (hide) target_build_type="$ (target_build_variant)" \
  6. target_device="$ (target_device)" \
  7. product_name="$ (target_product)" \
  8. product_brand="$ (product_brand)" \
  9. product_default_language="$ (call default-locale-language,$ (product_locales))" \
  10. product_default_region="$ (call default-locale-region,$ (product_locales))" \
  11. product_default_wifi_channels="$ (product_default_wifi_channels)" \
  12. product_model="$ (product_model)" \
  13. product_manufacturer="$ (product_manufacturer)" \
  14. private_build_desc="$ (private_build_desc)" \
  15. build_id="$ (build_id)" \
  16. build_display_id="$ (build_display_id)" \
  17. build_number="$ (build_number)" \
  18. platform_version="$ (platform_version)" \
  19. platform_sdk_version="$ (platform_sdk_version)" \
  20. platform_version_codename="$ (platform_version_codename)" \
  21. build_version_tags="$ (build_version_tags)" \
  22. target_bootloader_board_name="$ (target_bootloader_board_name)" \
  23. build_fingerprint="$ (build_fingerprint)" \
  24. target_board_platform="$ (target_board_platform)" \
  25. target_cpu_abi="$ (target_cpu_abi)" \
  26. target_cpu_abi2="$ (TARGET_CPU_ABI2)" \
  27. target_aapt_characteristics="$ (target_aapt_characteristics)" \
  28. bash $ (buildinfo_sh) > [email protected]
  29. $ (hide) if [-F $ (target_device_dir)/system.prop]; Then \
  30. Cat $ (target_device_dir)/system.prop >> [email protected];
  31. Fi
  32. $ (if $ (additional_build_properties), \
  33. $ (hide) echo >> [email protected]; \
  34. echo "#" >> [email protected]; \
  35. echo "# additional_build_properties" >> [email protected]; \
  36. echo "#" >> [email protected];)
  37. $ (hide) $ (foreach line,$ (additional_build_properties), \
  38. echo "$ (line)" >> [email protected];)
  39. $ (hide) build/tools/post_process_props.py [email protected]
  40. Build_desc : =


1. The target installed_build_prop_target is

[HTML]View Plain copy print?
    1. 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?
    1. bash $ (buildinfo_sh) > [email protected]

Output the variable to Build.prop:

[HTML]View Plain copy print?
  1. echo "# Begin Build Properties"
  2. echo "# Autogenerated by buildinfo.sh"
  3. echo "ro.build.id= $BUILD _id"
  4. echo "ro.build.display.id= $BUILD _display_id"
  5. echo "ro.build.version.incremental= $BUILD _number"
  6. echo "ro.build.version.sdk= $PLATFORM _sdk_version"
  7. echo "ro.build.version.codename= $PLATFORM _version_codename"
  8. echo "ro.build.version.release= $PLATFORM _version"
  9. echo "ro.build.date= ' Date '"
  10. echo "ro.build.date.utc= ' date +%s '"
  11. echo "ro.build.type= $TARGET _build_type"
  12. echo "ro.build.user= $USER"
  13. echo "ro.build.host= ' hostname '"
  14. echo "ro.build.tags= $BUILD _version_tags"
  15. echo "ro.product.model= $PRODUCT _model"
  16. echo "ro.product.brand= $PRODUCT _brand"
  17. echo "ro.product.name= $PRODUCT _name"
  18. echo "ro.product.device= $TARGET _device"
  19. echo "ro.product.board= $TARGET _bootloader_board_name"
  20. echo "ro.product.cpu.abi= $TARGET _cpu_abi"
  21. If [-N "$TARGET _cpu_abi2"]; Then
  22. echo "ro.product.cpu.abi2= $TARGET _cpu_abi2"
  23. Fi
  24. echo "ro.product.manufacturer= $PRODUCT _manufacturer"
  25. If [-N "$PRODUCT _default_language"]; Then
  26. echo "ro.product.locale.language= $PRODUCT _default_language"
  27. Fi
  28. If [-N "$PRODUCT _default_region"]; Then
  29. echo "ro.product.locale.region= $PRODUCT _default_region"
  30. Fi
  31. echo "ro.wifi.channels= $PRODUCT _default_wifi_channels"
  32. echo "ro.board.platform= $TARGET _board_platform"
  33. echo "# ro.build.product is obsolete; Use Ro.product.device "
  34. echo "ro.build.product= $TARGET _device"
  35. echo "# Do not try to parse ro.build.description or. Fingerprint"
  36. echo "ro.build.description= $PRIVATE _build_desc"
  37. echo "ro.build.fingerprint= $BUILD _fingerprint"
  38. echo "ro.build.characteristics= $TARGET _aapt_characteristics"
  39. 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?
    1. # ADD The product-defined properties to the build properties.
    2. Additional_build_properties : = \
    3. $ (additional_build_properties) \
    4. $ (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"

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.