Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f56ff1a2 authored by Felix's avatar Felix Committed by Michael Bestas
Browse files

core/Build: ro.system when comparing fingerprint



ro.build.fingerprint is dynamically generated by deriveFingerprint(),
but its output does not match ro.{system,vendor}.build.fingerprint.

Fixes:
======
E Build   : Mismatched fingerprints; system reported \
  Sony/aosp_f8331/kagura:10/QP1A.191005.007/eng.builde.20191020.005112:user/test-keys \
  but vendor reported Sony/aosp_f8331/kagura:10/QP1A.191005.007/builder10200050:user/test-keys

Example:
========
ro.system.build.fingerprint = Sony/aosp_f8331/kagura:10/QP1A.191005.007/builder10200050:user/test-keys
ro.build.fingerprint        = Sony/aosp_f8331/kagura:10/QP1A.191005.007/eng.builde.20191020.005112:user/test-keys

The critical difference is that deriveFingerprint() inserts the value of
"ro.build.version.incremental", while the actual fingerprint produced by
build/make/core/Makefile is:
  BUILD_FINGERPRINT := $(PRODUCT_BRAND)/$(TARGET_PRODUCT)/$(TARGET_DEVICE):\
  $(PLATFORM_VERSION)/$(BUILD_ID)/$(BF_BUILD_NUMBER):$(TARGET_BUILD_VARIANT)/$(BUILD_VERSION_TAGS)
Where:
  BF_BUILD_NUMBER := $(BUILD_USERNAME)$$($(DATE_FROM_FILE) +%m%d%H%M)

Fix:
====
Use ro.system.build.fingerprint instead, which will match
ro.vendor.build.fingerprint.

Test:
=====
make otapackage, flash, boot, verify no warning message is shown in UI.

Change-Id: Ie5e972047d7983b411004a3f0d67c4636a205162
Signed-off-by: default avatarFelix <google@ix5.org>
parent 0ed2452e
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -1081,7 +1081,7 @@ public class Build {
            return result == 0;
            return result == 0;
        }
        }


        final String system = SystemProperties.get("ro.build.fingerprint");
        final String system = SystemProperties.get("ro.system.build.fingerprint");
        final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
        final String vendor = SystemProperties.get("ro.vendor.build.fingerprint");
        final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
        final String bootimage = SystemProperties.get("ro.bootimage.build.fingerprint");
        final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
        final String requiredBootloader = SystemProperties.get("ro.build.expect.bootloader");
@@ -1090,7 +1090,7 @@ public class Build {
        final String currentRadio = SystemProperties.get("gsm.version.baseband");
        final String currentRadio = SystemProperties.get("gsm.version.baseband");


        if (TextUtils.isEmpty(system)) {
        if (TextUtils.isEmpty(system)) {
            Slog.e(TAG, "Required ro.build.fingerprint is empty!");
            Slog.e(TAG, "Required ro.system.build.fingerprint is empty!");
            return false;
            return false;
        }
        }