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

Commit cb3fd694 authored by Andres Morales's avatar Andres Morales
Browse files

Check bootimage build fingerprint against vendor

Prevents image mismatch issues

Change-Id: Ibd972cbcedf1000bfe2a8ceed7696a229365dc25
parent dbf22ccd
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;
    }
    }