MTK Android 自定义版本号[笔记]

添加开关KCM_HIDE_CUSTOM_BUILD_VERSION,控制之定义版本号隐藏,KCM_CUSTOM_BUILD_DISPLAY_ID 控制系统版本号自定义

packages/apps/Settings/src/com/android/settings/DeviceInfoSettings.java

@@ -64,6 +64,8 @@ import java.util.regex.Pattern;
 import android.content.SharedPreferences;
 import android.content.pm.PackageInfo;
 //fota end
+import android.os.SystemProperties;// CUSTOM_BUILD_DISPLAY_ID

 public class DeviceInfoSettings extends SettingsPreferenceFragment implements Indexable {
 
@@ -133,7 +135,10 @@ public class DeviceInfoSettings extends SettingsPreferenceFragment implements In
         setStringSummary(KEY_DEVICE_MODEL, Build.MODEL + getMsvSuffix());
         setValueSummary(KEY_EQUIPMENT_ID, PROPERTY_EQUIPMENT_ID);
         setStringSummary(KEY_DEVICE_MODEL, Build.MODEL);
-        setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
+               // CUSTOM_BUILD_DISPLAY_ID
+        //setStringSummary(KEY_BUILD_NUMBER, Build.DISPLAY);
+               setStringSummary(KEY_BUILD_NUMBER, SystemProperties.get("ro.custom_kernel_version",Build.DISPLAY));
+               //modify end
         findPreference(KEY_BUILD_NUMBER).setEnabled(true);
         findPreference(KEY_KERNEL_VERSION).setSummary(getFormattedKernelVersion());

packages/apps/Settings/src/com/mediatek/settings/deviceinfo/DeviceInfoSettingsExts.java

@@ -107,6 +107,10 @@ public class DeviceInfoSettingsExts {
         if (FeatureOption.MTK_A1_FEATURE) {
             removePreference(findPreference(KEY_CUSTOM_BUILD_VERSION));
         }
+               // KCM_HIDE_CUSTOM_BUILD_VERSION
+               if (SystemProperties.get("ro.hide_custom_build_version").equals("1")){
+                       removePreference(findPreference(KEY_CUSTOM_BUILD_VERSION));
+               }
     }
 
     private void updateTitleToActivityLabel(String key) {


device/along/common/device.mk

#KCM added by cyl hide custom build version
+ifeq ($(strip $(KCM_HIDE_CUSTOM_BUILD_VERSION)), yes)
+  PRODUCT_PROPERTY_OVERRIDES += ro.hide_custom_build_version=1
+endif
+
+#KCM custom build version
+ifeq ($(strip $(KCM_CUSTOM_BUILD_DISPLAY_ID)), yes)
+  PRODUCT_PROPERTY_OVERRIDES += ro.custom_build_display_id=1
+endif

device/along/common/ProjectConfig.mk

#KCM  custom build version
+KCM_HIDE_CUSTOM_BUILD_VERSION = no
+
+#KCM custom Build number 在项目的system.prop中添加ro.custom_kernel_version=xxx
+KCM_CUSTOM_BUILD_DISPLAY_ID = no



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

旧时旅人

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值