Loading tools/releasetools/common.py +2 −1 Original line number Diff line number Diff line Loading @@ -1211,10 +1211,11 @@ class DeviceSpecificParams(object): return self._DoCall("VerifyOTA_Assertions") class File(object): def __init__(self, name, data): def __init__(self, name, data, compress_size = None): self.name = name self.data = data self.size = len(data) self.compress_size = compress_size or self.size self.sha1 = sha1(data).hexdigest() @classmethod Loading tools/releasetools/ota_from_target_files.py +2 −2 Original line number Diff line number Diff line Loading @@ -748,7 +748,7 @@ def LoadPartitionFiles(z, partition): basefilename = info.filename[len(prefix):] fn = partition + "/" + basefilename data = z.read(info.filename) out[fn] = common.File(fn, data) out[fn] = common.File(fn, data, info.compress_size) return out Loading Loading @@ -1392,7 +1392,7 @@ class FileDifference(object): for diff in diffs: tf, sf, d = diff.GetPatch() path = "/".join(tf.name.split("/")[:-1]) if d is None or len(d) > tf.size * OPTIONS.patch_threshold or \ if d is None or len(d) > tf.compress_size * OPTIONS.patch_threshold or \ path not in known_paths: # patch is almost as big as the file; don't bother patching # or a patch + rename cannot take place due to the target Loading Loading
tools/releasetools/common.py +2 −1 Original line number Diff line number Diff line Loading @@ -1211,10 +1211,11 @@ class DeviceSpecificParams(object): return self._DoCall("VerifyOTA_Assertions") class File(object): def __init__(self, name, data): def __init__(self, name, data, compress_size = None): self.name = name self.data = data self.size = len(data) self.compress_size = compress_size or self.size self.sha1 = sha1(data).hexdigest() @classmethod Loading
tools/releasetools/ota_from_target_files.py +2 −2 Original line number Diff line number Diff line Loading @@ -748,7 +748,7 @@ def LoadPartitionFiles(z, partition): basefilename = info.filename[len(prefix):] fn = partition + "/" + basefilename data = z.read(info.filename) out[fn] = common.File(fn, data) out[fn] = common.File(fn, data, info.compress_size) return out Loading Loading @@ -1392,7 +1392,7 @@ class FileDifference(object): for diff in diffs: tf, sf, d = diff.GetPatch() path = "/".join(tf.name.split("/")[:-1]) if d is None or len(d) > tf.size * OPTIONS.patch_threshold or \ if d is None or len(d) > tf.compress_size * OPTIONS.patch_threshold or \ path not in known_paths: # patch is almost as big as the file; don't bother patching # or a patch + rename cannot take place due to the target Loading