1
0
mirror of https://github.com/mbirth/tcl_ota_check.git synced 2024-09-19 22:33:25 +01:00

Updated README. Moved pretty_xml outside of class.

This commit is contained in:
Markus Birth 2018-02-05 13:20:15 +01:00
parent a643f90e62
commit 78d9005531
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
6 changed files with 66 additions and 15 deletions

View File

@ -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/).

View File

@ -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:

View File

@ -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)

View File

@ -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:

View File

@ -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"

View File

@ -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=" ")