assert recovery finger/thumbprints, not system
Block OTAs don't have the system partition mounted and so can't use file_getprop on the system partition. Make assertions look at the recovery system finger/thumbprints, which should be the same as the ones on the system partition (even for sprout devices). Change-Id: Ie5d329d13beab4b428e37f75da9b9e1b8ceb35bc
This commit is contained in:
@@ -82,12 +82,11 @@ class EdifyGenerator(object):
|
|||||||
self.script.append(cmd)
|
self.script.append(cmd)
|
||||||
|
|
||||||
def AssertSomeFingerprint(self, *fp):
|
def AssertSomeFingerprint(self, *fp):
|
||||||
"""Assert that the current system build fingerprint is one of *fp."""
|
"""Assert that the current recovery build fingerprint is one of *fp."""
|
||||||
if not fp:
|
if not fp:
|
||||||
raise ValueError("must specify some fingerprints")
|
raise ValueError("must specify some fingerprints")
|
||||||
cmd = (
|
cmd = (
|
||||||
' ||\n '.join([('file_getprop("/system/build.prop", '
|
' ||\n '.join([('getprop("ro.build.fingerprint") == "%s"')
|
||||||
'"ro.build.fingerprint") == "%s"')
|
|
||||||
% i for i in fp]) +
|
% i for i in fp]) +
|
||||||
' ||\n abort("Package expects build fingerprint of %s; this '
|
' ||\n abort("Package expects build fingerprint of %s; this '
|
||||||
'device has " + getprop("ro.build.fingerprint") + ".");'
|
'device has " + getprop("ro.build.fingerprint") + ".");'
|
||||||
@@ -95,12 +94,11 @@ class EdifyGenerator(object):
|
|||||||
self.script.append(cmd)
|
self.script.append(cmd)
|
||||||
|
|
||||||
def AssertSomeThumbprint(self, *fp):
|
def AssertSomeThumbprint(self, *fp):
|
||||||
"""Assert that the current system build thumbprint is one of *fp."""
|
"""Assert that the current recovery build thumbprint is one of *fp."""
|
||||||
if not fp:
|
if not fp:
|
||||||
raise ValueError("must specify some thumbprints")
|
raise ValueError("must specify some thumbprints")
|
||||||
cmd = (
|
cmd = (
|
||||||
' ||\n '.join([('file_getprop("/system/build.prop", '
|
' ||\n '.join([('getprop(ro.build.thumbprint") == "%s"')
|
||||||
'"ro.build.thumbprint") == "%s"')
|
|
||||||
% i for i in fp]) +
|
% i for i in fp]) +
|
||||||
' ||\n abort("Package expects build thumbprint of %s; this '
|
' ||\n abort("Package expects build thumbprint of %s; this '
|
||||||
'device has " + getprop("ro.build.thumbprint") + ".");'
|
'device has " + getprop("ro.build.thumbprint") + ".");'
|
||||||
|
Reference in New Issue
Block a user