ro.build.display.id
源码如下,可以看到ro.build.display.id
是由其它属性值拼接成的。
shell
# 文件路径:system/core/init/property_service.cpp
// If the ro.build.display.id property has not been set, derive it from constituent pieces
static void property_derive_build_display_id() {
std::string build_display_id = GetProperty("ro.build.display.id", "");
if (!build_display_id.empty()) {
return;
}
const std::string UNKNOWN = "unknown";
std::string build_type = GetProperty("ro.build.type", "");
if (build_type == "user") {
std::string display_build_number = GetProperty("ro.build.display_build_number", "");
if (display_build_number == "true") {
build_display_id = GetProperty("ro.build.id", UNKNOWN);
build_display_id += '.';
build_display_id += GetProperty("ro.build.version.incremental", UNKNOWN);
build_display_id += ' ';
build_display_id += GetProperty("ro.build.keys", UNKNOWN);
} else {
build_display_id = GetProperty("ro.build.id", UNKNOWN);
build_display_id += ' ';
build_display_id += GetProperty("ro.build.keys", UNKNOWN);
}
} else {
build_display_id = GetProperty("ro.product.name", UNKNOWN);
build_display_id += '-';
build_display_id += GetProperty("ro.build.type", UNKNOWN);
build_display_id += ' ';
build_display_id += GetProperty("ro.build.version.release", UNKNOWN);
build_display_id += ' ';
build_display_id += GetProperty("ro.build.id", UNKNOWN);
build_display_id += ' ';
build_display_id += GetProperty("ro.build.version.incremental", UNKNOWN);
build_display_id += ' ';
build_display_id += GetProperty("ro.build.tags", UNKNOWN);
}
LOG(INFO) << "Setting property 'ro.build.display.id' to '" << build_display_id << "'";
std::string error;
uint32_t res = PropertySet("ro.build.display.id", build_display_id, &error);
if (res != PROP_SUCCESS) {
LOG(ERROR) << "Error setting property 'ro.build.display.id': err=" << res << " (" << error
<< ")";
}
}
ro.build.id
build/make/tools/buildinfo.sh
ro.build.tags
ro.build.type
ro.build.version.release
ro.build.version.incremental
上面这几个属性都在下面的源码中设置
shell
# 文件路径:build/make/tools/buildinfo.sh
#!/bin/bash
echo "# begin build properties"
echo "# autogenerated by buildinfo.sh"
# The ro.build.id will be set dynamically by init, by appending the unique vbmeta digest.
if [ "$BOARD_USE_VBMETA_DIGTEST_IN_FINGERPRINT" = "true" ] ; then
echo "ro.build.legacy.id=$BUILD_ID"
else
echo "ro.build.id=$BUILD_ID"
fi
echo "ro.build.keys=$BUILD_KEYS"
if [ -n "$DISPLAY_BUILD_NUMBER" ] ; then
echo "ro.build.display_build_number=$DISPLAY_BUILD_NUMBER"
fi
echo "ro.build.version.incremental=$BUILD_NUMBER"
echo "ro.build.version.sdk=$PLATFORM_SDK_VERSION"
echo "ro.build.version.preview_sdk=$PLATFORM_PREVIEW_SDK_VERSION"
echo "ro.build.version.preview_sdk_fingerprint=$PLATFORM_PREVIEW_SDK_FINGERPRINT"
echo "ro.build.version.codename=$PLATFORM_VERSION_CODENAME"
echo "ro.build.version.all_codenames=$PLATFORM_VERSION_ALL_CODENAMES"
echo "ro.build.version.release=$PLATFORM_VERSION_LAST_STABLE"
echo "ro.build.version.release_or_codename=$PLATFORM_VERSION"
echo "ro.build.version.security_patch=$PLATFORM_SECURITY_PATCH"
echo "ro.build.version.base_os=$PLATFORM_BASE_OS"
echo "ro.build.version.min_supported_target_sdk=$PLATFORM_MIN_SUPPORTED_TARGET_SDK_VERSION"
echo "ro.build.date=`$DATE`"
echo "ro.build.date.utc=`$DATE +%s`"
echo "ro.build.type=$TARGET_BUILD_TYPE"
echo "ro.build.user=$BUILD_USERNAME"
echo "ro.build.host=$BUILD_HOSTNAME"
echo "ro.build.tags=$BUILD_VERSION_TAGS"
echo "ro.build.flavor=$TARGET_BUILD_FLAVOR"
...