码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2019-01-31 12:55:44      阅读:876      评论:0      收藏:0      [点我收藏+]

标签:sys   rop   not   some   system   erp   androi   nbsp   手机   

在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    }
 

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

标签:sys   rop   not   some   system   erp   androi   nbsp   手机   

原文地址:https://www.cnblogs.com/codeking100/p/10340934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!