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    }
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM