Add sprout support to signing tools
Bug: 15379701 Change-Id: Ied8329e1162250cc5509b65ef8bf0b5a9ddda3c3
This commit is contained in:
parent
4f12fceead
commit
dc2661afe2
1 changed files with 12 additions and 5 deletions
|
@ -142,6 +142,7 @@ def SignApk(data, keyname, pw):
|
|||
|
||||
def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info,
|
||||
apk_key_map, key_passwords):
|
||||
|
||||
maxsize = max([len(os.path.basename(i.filename))
|
||||
for i in input_tf_zip.infolist()
|
||||
if i.filename.endswith('.apk')])
|
||||
|
@ -188,7 +189,7 @@ def ProcessTargetFiles(input_tf_zip, output_tf_zip, misc_info,
|
|||
elif info.filename in ("SYSTEM/build.prop",
|
||||
"RECOVERY/RAMDISK/default.prop"):
|
||||
print "rewriting %s:" % (info.filename,)
|
||||
new_data = RewriteProps(data)
|
||||
new_data = RewriteProps(data, misc_info)
|
||||
output_tf_zip.writestr(out_info, new_data)
|
||||
if info.filename == "RECOVERY/RAMDISK/default.prop":
|
||||
write_to_temp(info.filename, info.external_attr, new_data)
|
||||
|
@ -270,14 +271,20 @@ def EditTags(tags):
|
|||
return ",".join(sorted(tags))
|
||||
|
||||
|
||||
def RewriteProps(data):
|
||||
def RewriteProps(data, misc_info):
|
||||
output = []
|
||||
for line in data.split("\n"):
|
||||
line = line.strip()
|
||||
original_line = line
|
||||
if line and line[0] != '#':
|
||||
if line and line[0] != '#' and "=" in line:
|
||||
key, value = line.split("=", 1)
|
||||
if key == "ro.build.fingerprint":
|
||||
if (key == "ro.build.fingerprint"
|
||||
and misc_info.get("oem_fingerprint_properties") is None):
|
||||
pieces = value.split("/")
|
||||
pieces[-1] = EditTags(pieces[-1])
|
||||
value = "/".join(pieces)
|
||||
elif (key == "ro.build.thumbprint"
|
||||
and misc_info.get("oem_fingerprint_properties") is not None):
|
||||
pieces = value.split("/")
|
||||
pieces[-1] = EditTags(pieces[-1])
|
||||
value = "/".join(pieces)
|
||||
|
@ -291,7 +298,7 @@ def RewriteProps(data):
|
|||
elif key == "ro.build.display.id":
|
||||
# change, eg, "JWR66N dev-keys" to "JWR66N"
|
||||
value = value.split()
|
||||
if len(value) > 1 and value[-1].endswith("-keys"):
|
||||
if len(value) > 1 and value[-1].endswith("-keys"):
|
||||
value.pop()
|
||||
value = " ".join(value)
|
||||
line = key + "=" + value
|
||||
|
|
Loading…
Reference in a new issue