android修改getprop读取到的ro.build.fingerprint属性

在build/tools/buildinfo.sh中定义ro.build.fingerprint=$BUILD_FINGERPRINT.

然后在build/core/Makefile中给BUILD_FINGERPRINT赋值

但这里确定的是手机system/build.prop中的ro.build.fingerprint,是编译时决定的

 

getprop读取到的ro.build.fingerprint的值,是运行时决定的,在frameworks/base/core/java/android/os/Build.java 中:

923 /** A string that uniquely identifies this build.  Do not attempt to parse this value. */
924    public static final String FINGERPRINT = deriveFingerprint();
925
926    /**
927     * Some devices split the fingerprint components between multiple
928     * partitions, so we might derive the fingerprint at runtime.
929     */
930    private static String deriveFingerprint() {
931        Stringfinger = SystemProperties.get("ro.build.fingerprint");
932        if (TextUtils.isEmpty(finger)) {
933            finger = getString("ro.product.brand") + '/' +
934                    getString("ro.product.name") + '/' +
935                    getString("ro.product.device") + ':' +
936                    getString("ro.build.version.release") + '/' +
937                    getString("ro.build.id") + '/' +
938                    getString("ro.build.version.incremental") + ':' +
939                    getString("ro.build.type") + '/' +
940                    getString("ro.build.tags");
941        }
942        return finger;
943    }
 

转载于:https://www.cnblogs.com/codeking100/p/10340934.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值