当前位置: 首页 > article >正文

android12属性设置

ro.build.display.id

源码如下,可以看到ro.build.display.id是由其它属性值拼接成的。

# 文件路径: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

上面这几个属性都在下面的源码中设置

# 文件路径: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"
...

http://www.kler.cn/a/373671.html

相关文章:

  • 【热门主题】000015 大数据治理:开启数据价值新纪元
  • “要出国 找中信”“来中国 找中信”服务品牌正式发布 中信银行陪伴亿万人走出国门、走进中国
  • PPT制作新选择:本地部署PPTist结合内网穿透实现实时协作和远程使用
  • 基于SSM学生竞赛模拟系统的设计
  • 阿里云物联网的通信方式
  • 瑞芯微RK3566/RK3568 Android11下该如何默认屏蔽导航栏/状态栏?看这篇文章就懂了
  • 使用 NCC 和 PKG 打包 Node.js 项目为可执行文件(Linux ,macOS,Windows)
  • 设计一个灵活的RPC架构
  • AI代币是什么?AI与Web3结合的未来方向在哪里?
  • Transformer-BiGRU多特征输入时间序列预测(Pytorch)
  • WSGI、uwsgi与uWSGI
  • 【深度学习】用LSTM写诗,生成式的方式写诗系列之一
  • 下一代「自动化测试框架」WebdriverIO
  • STM32--STM32 微控制器详解
  • unity3d————Mathf.Lerp() 函数详解
  • 从0开始深度学习(21)——读写数据和GPU
  • 【Nas】X-DOC:Mac mini 安装 ZeroTier 并替换 planet 实现内网穿透
  • 人工智能中的机器学习和模型评价
  • RNN在训练中存在的问题
  • 常见的机器学习模型汇总
  • C++ 复习记录(个人记录)
  • 基于Multisim的四位抢答器设计与仿真
  • 数据结构,问题 A: 翻转字符串
  • 野火鲁班猫4 (RK3588)系统配置
  • Mybatis 统计sql运行时间
  • 嵌入式linux跨平台基于mongoose的TCP C++类的源码