Android 9.x 安兔兔/鲁大师参数修改

引言

记录某行招标安兔兔参数修改
硬件,CPU型号,Build Fingerprint

修改记录

diff --git a/build/make/core/Makefile b/build/make/core/Makefile
index 18e6de8c5f..f8bfd5a76f 100755
--- a/build/make/core/Makefile
+++ b/build/make/core/Makefile
@@ -240,7 +240,8 @@ ifeq (,$(strip $(BUILD_FINGERPRINT)))
   else
     BF_BUILD_NUMBER := $(file <$(BUILD_NUMBER_FILE))
   endif
-  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
+  #BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
+  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/full_tb6771p1_64_bsp/tb6771p1_64_bsp:$(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):user/$(BUILD_VERSION_TAGS)
 endif
 # unset it for safety.
 BF_BUILD_NUMBER :=
diff --git a/frameworks/base/core/java/android/os/Build.java b/frameworks/base/core/java/android/os/Build.java
index cf5bb39fb3..0952314d40 100755
--- a/frameworks/base/core/java/android/os/Build.java
+++ b/frameworks/base/core/java/android/os/Build.java
@@ -108,7 +108,7 @@ public class Build {
     public static final String RADIO = getString(TelephonyProperties.PROPERTY_BASEBAND_VERSION);

     /** The name of the hardware (from the kernel command line or /proc). */
-    public static final String HARDWARE = getString("ro.hardware");
+    public static final String HARDWARE = getHardware("ro.hardware");

     /**
      * Whether this build was for an emulator device.
@@ -1119,6 +1119,10 @@ public class Build {
         return SystemProperties.get(property, UNKNOWN);
     }

+       private static String getHardware(String property) {
+        return "mt6771";
+    }
+
     private static String[] getStringList(String property, String separator) {
         String value = SystemProperties.get(property);
         if (value.isEmpty()) {
diff --git a/kernel-4.4/arch/arm64/kernel/cpuinfo.c b/kernel-4.4/arch/arm64/kernel/cpuinfo.c
index 55dec3b305..a0ea78a49f 100644
--- a/kernel-4.4/arch/arm64/kernel/cpuinfo.c
+++ b/kernel-4.4/arch/arm64/kernel/cpuinfo.c
@@ -173,7 +173,7 @@ static int c_show(struct seq_file *m, void *v)
        }

        /* backward-compatibility for thrid-party applications */
-       seq_printf(m, "Hardware\t: %s\n", machine_desc_str);
+       seq_printf(m, "Hardware\t: %s\n", "MT6771");

        return 0;
 }

编译刷机之后,发现鲁大师cpu信息有一半不对MT6771(mt8788)
adb shell getprop ro.hardware ,输出mt8788,直接修改SystemProperties.java的get方法即可。

diff --git a/frameworks/base/core/java/android/os/SystemProperties.java b/frameworks/base/core/java/android/os/SystemProperties.java
old mode 100644
new mode 100755
index 7d3ba6a3cf..82b71f5576
--- a/frameworks/base/core/java/android/os/SystemProperties.java
+++ b/frameworks/base/core/java/android/os/SystemProperties.java
@@ -115,6 +115,10 @@ public class SystemProperties {
     @TestApi
     public static String get(@NonNull String key, @Nullable String def) {
         if (TRACK_KEY_ACCESS) onKeyAccess(key);
+               //add by djw
+               if ("ro.hardware".equals(key)){
+                       return "mt6771";
+               }
         return native_get(key, def);
     }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值