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

Commit 349c504c authored by Andres Morales's avatar Andres Morales Committed by Android (Google) Code Review
Browse files

Merge "Check bootimage build fingerprint against vendor"

parents b4b04ea3 cb3fd694
Loading
Loading
Loading
Loading
+26 −17
Original line number Original line Diff line number Diff line
@@ -653,6 +653,7 @@ public class Build {
    public static boolean isFingerprintConsistent() {
    public static boolean isFingerprintConsistent() {
        final String system = SystemProperties.get("ro.build.fingerprint");
        final String system = SystemProperties.get("ro.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");


        if (TextUtils.isEmpty(system)) {
        if (TextUtils.isEmpty(system)) {
            Slog.e(TAG, "Required ro.build.fingerprint is empty!");
            Slog.e(TAG, "Required ro.build.fingerprint is empty!");
@@ -667,6 +668,14 @@ public class Build {
            }
            }
        }
        }


        if (!TextUtils.isEmpty(bootimage)) {
            if (!Objects.equals(vendor, bootimage)) {
                Slog.e(TAG, "Mismatched fingerprints; system and vendor reported " + system
                        + " but bootimage reported " + bootimage);
                return false;
            }
        }

        return true;
        return true;
    }
    }