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

Commit 3edeb4e9 authored by Sami Tolvanen's avatar Sami Tolvanen Committed by Android Git Automerger
Browse files

am 045d817c: am 497b74d5: am d21d1d27: am 00e1f003: Merge "Check partition...

am 045d817c: am 497b74d5: am d21d1d27: am 00e1f003: Merge "Check partition hash before resorting to block_image_verify"

* commit '045d817c':
  Check partition hash before resorting to block_image_verify
parents b126ae9e 045d817c
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -1147,10 +1147,13 @@ class BlockDifference(object):
      script.Print("Image %s will be patched unconditionally." % (partition,))
    else:
      if self.version >= 3:
        script.AppendExtra(('if block_image_verify("%s", '
        script.AppendExtra(('if (range_sha1("%s", "%s") == "%s" || '
                            'block_image_verify("%s", '
                            'package_extract_file("%s.transfer.list"), '
                            '"%s.new.dat", "%s.patch.dat") then') %
                           (self.device, partition, partition, partition))
                            '"%s.new.dat", "%s.patch.dat")) then') % (
                            self.device, self.src.care_map.to_string_raw(),
                            self.src.TotalSha1(),
                            self.device, partition, partition, partition))
      else:
        script.AppendExtra('if range_sha1("%s", "%s") == "%s" then' % (
            self.device, self.src.care_map.to_string_raw(),