diff --git a/README.md b/README.md index ead87c9..ee66120 100644 --- a/README.md +++ b/README.md @@ -56,3 +56,56 @@ As you can see, our `PRD-63117-003` variant doesn't have the update yet, but oth You can use this info, to [install the update for a different variant](http://wiki.mbirth.de/know-how/hardware/blackberry-keyone/bb-keyone-ota-updates-for-different-variants.html). Just make sure to use a variant that has the same model number (`63117` = BBB100-2). + +What do those other scripts do? +------------------------------- + +(All commands support the `--help` parameter to print out the expected syntax.) + + +### tclcheck_allfull.py + +Checks for the latest FULL (i.e. complete firmwares to install manually) versions available for all +different models and variants. + + +### tclcheck_allota.py + +Checks for the latest OTA (i.e. partial updates for over-the-air installation) versions available +for all different models and variants. + + +### tclcheck_findprd.py + +Scans for not yet known variants of a model. + + +### tclcheck_findprd2.py + +Scans for not yet known models. + + +### tclcheck_findver.py + +Scans for not yet known firmware versions. + + +### tclcheck_gapfill.py + +Queries the [database server](https://tclota.birth-online.de/) for known versions and tries to find +OTA files not yet in the database. + + +### tclcheck.py + +Universal tool to query TCL's servers in different ways to manually check for a specific update. + + +### tclchksum.py + +Queries the checksum for a specific FULL file. + + +### upload_logs.py + +Uploads all collected server answers to the [database server](https://tclota.birth-online.de/). diff --git a/tclcheck.py b/tclcheck.py index 73b8e70..8287499 100755 --- a/tclcheck.py +++ b/tclcheck.py @@ -11,6 +11,7 @@ import sys import tcllib import tcllib.argparser +from tcllib.xmltools import pretty_xml fc = tcllib.FotaCheck() @@ -73,16 +74,16 @@ print("Mode: {}".format(fc.mode.value)) print("CLTP: {}".format(fc.cltp.value)) check_xml = fc.do_check() -print(fc.pretty_xml(check_xml)) +print(pretty_xml(check_xml)) 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)) +print(pretty_xml(req_xml)) fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml) if encslaves: chksum_xml = fc.do_checksum(random.choice(encslaves), fileurl, fileurl) - print(fc.pretty_xml(chksum_xml)) + print(pretty_xml(chksum_xml)) file_addr, sha1_body, sha1_enc_footer, sha1_footer = fc.parse_checksum(chksum_xml) for s in slaves: diff --git a/tclchksum.py b/tclchksum.py index b9fed70..f9c7557 100644 --- a/tclchksum.py +++ b/tclchksum.py @@ -10,7 +10,7 @@ import sys import tcllib import tcllib.argparser - +from tcllib.xmltools import pretty_xml fc = tcllib.FotaCheck() @@ -39,5 +39,5 @@ fileurl = args.uri #fileurl = "/body/ce570ddc079e2744558f191895e524d02a60476f/2c23717bb747f3c321195419f451de52efa8ea51/263790/268932" chksum_xml = fc.do_checksum(random.choice(encslaves), fileurl, fileurl) -print(fc.pretty_xml(chksum_xml)) +print(pretty_xml(chksum_xml)) file_addr, sha1_body, sha1_enc_footer, sha1_footer = fc.parse_checksum(chksum_xml) diff --git a/tcldown.py b/tcldown.py index 78be921..37ab6d8 100644 --- a/tcldown.py +++ b/tcldown.py @@ -11,6 +11,7 @@ import sys import tcllib import tcllib.argparser +from tcllib.xmltools import pretty_xml fc = tcllib.FotaCheck() @@ -70,7 +71,7 @@ fv = fc.fv 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)) +print(pretty_xml(req_xml)) fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml) for s in slaves: diff --git a/tcllib/__init__.py b/tcllib/__init__.py index 23f855e..709facf 100644 --- a/tcllib/__init__.py +++ b/tcllib/__init__.py @@ -26,8 +26,7 @@ class FotaCheck( servervote.ServerVoteMixin, credentials.CredentialsMixin, devlist.DevListMixin, - dumpmgr.DumpMgrMixin, - xmltools.XmlToolsMixin + dumpmgr.DumpMgrMixin ): """Main API handler class.""" VDKEY = b"eJwdjwEOwDAIAr8kKFr//7HhmqXp8AIIDrYAgg8byiUXrwRJRXja+d6iNxu0AhUooDCN9rd6rDLxmGIakUVWo3IGCTRWqCAt6X4jGEIUAxgN0eYWnp+LkpHQAg/PsO90ELsy0Npm/n2HbtPndFgGEV31R9OmT4O4nrddjc3Qt6nWscx7e+WRHq5UnOudtjw5skuV09pFhvmqnOEIs4ljPeel1wfLYUF4\n" diff --git a/tcllib/xmltools.py b/tcllib/xmltools.py index 66758ab..5933a19 100644 --- a/tcllib/xmltools.py +++ b/tcllib/xmltools.py @@ -8,10 +8,7 @@ import xml.dom.minidom -class XmlToolsMixin: - """A mixin component for XML tools.""" - @staticmethod - def pretty_xml(xmlstr): - """Prettify input XML with ``xml.dom.minidom``.""" - mdx = xml.dom.minidom.parseString(xmlstr) - return mdx.toprettyxml(indent=" ") +def pretty_xml(xmlstr): + """Prettify input XML with ``xml.dom.minidom``.""" + mdx = xml.dom.minidom.parseString(xmlstr) + return mdx.toprettyxml(indent=" ")