android6.0 如何修改BUILD_ID

過程及步驟記錄:

1、在device-commom.mk裏重寫:

BUILD_NUMBER := 0.0.1
BUILD_ID := flying123123123

重新編譯後發現system/build.prop 裏面ro.build.id沒有改變還是默認值


2、嘗試直接修改build\core\build_id.mk

export BUILD_ID=MRA58K

修改爲export BUILD_ID=flying123123123

編譯錯誤error: ro.build.fingerprint cannot exceed 91 bytes

網上找到對應方法:

diff --git a/tools/post_process_props.py b/tools/post_process_props.py
index 2237707..df13699 100755
--- a/tools/post_process_props.py
+++ b/tools/post_process_props.py
@@ -23,7 +23,7 @@ import sys
 # The constants in system_properties.h includes the termination NUL,
 # so we decrease the values by 1 here.
 PROP_NAME_MAX = 32
-PROP_VALUE_MAX = 91
+PROP_VALUE_MAX = 149


diff --git a/libc/include/sys/system_properties.h b/libc/include/sys/system_properties.h
index 01c3db3..023b28e 100644
--- a/libc/include/sys/system_properties.h
+++ b/libc/include/sys/system_properties.h
@@ -36,7 +36,7 @@ __BEGIN_DECLS
 typedef struct prop_info prop_info;
 
 #define PROP_NAME_MAX   32
-#define PROP_VALUE_MAX  92
+#define PROP_VALUE_MAX  150


3、編譯成功後升級發現開機後彈出窗口:

ANDROID系統

您的設備內部出現了問題,請聯繫您的設備製造商瞭解詳情

從打印信息中發現:

init: property_set("ro.bootimage.build.fingerprint", "Mstar/aosp_almond_dtmb/almond:6.0/LED33051510000/TVOS-04.19.011.02.10.Mooney:userdebug/test-keys") failed

12-23 13:52:11.289  1854  1854 E Build   : Required ro.build.fingerprint is empty!
12-23 13:52:11.289  1854  1854 E ActivityManager: Build fingerprint is not consistent, warning user

4、

frameworks\base\core\java\android\os\SystemProperties.java

public static final int PROP_VALUE_MAX = 91;//149;//91;            

system\core\debuggerd\test\sys\system_properties.h

#define PROP_VALUE_MAX  92//150//92 



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章