1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-11-09 22:06:47 +00:00

Also output download links for Amazon S3 servers.

This commit is contained in:
Markus Birth 2018-01-12 00:31:39 +01:00
parent cf04ba53df
commit 4917b87741
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
3 changed files with 12 additions and 3 deletions

View File

@ -68,11 +68,14 @@ curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml)
req_xml = fc.do_request(curef, fv, tv, fw_id)
print(fc.pretty_xml(req_xml))
fileid, fileurl, slaves, encslaves = fc.parse_request(req_xml)
fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml)
for s in slaves:
print("http://{}{}".format(s, fileurl))
for s in s3_slaves:
print("http://{}{}".format(s, s3_fileurl))
if fc.mode == fc.MODE.FULL:
header = fc.do_encrypt_header(random.choice(encslaves), fileurl)
headname = "header_{}.bin".format(tv)

View File

@ -61,11 +61,14 @@ tv = args.targetversion[0]
fw_id = args.fwid[0]
req_xml = fc.do_request(fc.curef, fv, tv, fw_id)
print(fc.pretty_xml(req_xml))
fileid, fileurl, slaves, encslaves = fc.parse_request(req_xml)
fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml)
for s in slaves:
print("http://{}{}".format(s, fileurl))
for s in s3_slaves:
print("http://{}{}".format(s, s3_fileurl))
if fc.mode == fc.MODE.FULL:
header = fc.do_encrypt_header(random.choice(encslaves), fileurl)
headname = "header_{}.bin".format(tv)

View File

@ -367,11 +367,14 @@ class FotaCheck:
file = root.find("FILE_LIST").find("FILE")
fileid = file.find("FILE_ID").text
fileurl = file.find("DOWNLOAD_URL").text
s3_fileurl = file.find("S3_DOWNLOAD_URL").text
slave_list = root.find("SLAVE_LIST").findall("SLAVE")
enc_list = root.find("SLAVE_LIST").findall("ENCRYPT_SLAVE")
s3_slave_list = root.find("SLAVE_LIST").findall("S3_SLAVE")
slaves = [s.text for s in slave_list]
encslaves = [s.text for s in enc_list]
return fileid, fileurl, slaves, encslaves
s3_slaves = [s.text for s in s3_slave_list]
return fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves
def do_encrypt_header(self, encslave, address):
params = self.get_creds()