Updated README. Moved pretty_xml outside of class.
This commit is contained in:
parent
a643f90e62
commit
78d9005531
53
README.md
53
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).
|
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).
|
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/).
|
||||||
|
@ -11,6 +11,7 @@ import sys
|
|||||||
|
|
||||||
import tcllib
|
import tcllib
|
||||||
import tcllib.argparser
|
import tcllib.argparser
|
||||||
|
from tcllib.xmltools import pretty_xml
|
||||||
|
|
||||||
|
|
||||||
fc = tcllib.FotaCheck()
|
fc = tcllib.FotaCheck()
|
||||||
@ -73,16 +74,16 @@ print("Mode: {}".format(fc.mode.value))
|
|||||||
print("CLTP: {}".format(fc.cltp.value))
|
print("CLTP: {}".format(fc.cltp.value))
|
||||||
|
|
||||||
check_xml = fc.do_check()
|
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)
|
curef, fv, tv, fw_id, fileid, fn, fsize, fhash = fc.parse_check(check_xml)
|
||||||
|
|
||||||
req_xml = fc.do_request(curef, fv, tv, fw_id)
|
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)
|
fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml)
|
||||||
|
|
||||||
if encslaves:
|
if encslaves:
|
||||||
chksum_xml = fc.do_checksum(random.choice(encslaves), fileurl, fileurl)
|
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)
|
file_addr, sha1_body, sha1_enc_footer, sha1_footer = fc.parse_checksum(chksum_xml)
|
||||||
|
|
||||||
for s in slaves:
|
for s in slaves:
|
||||||
|
@ -10,7 +10,7 @@ import sys
|
|||||||
|
|
||||||
import tcllib
|
import tcllib
|
||||||
import tcllib.argparser
|
import tcllib.argparser
|
||||||
|
from tcllib.xmltools import pretty_xml
|
||||||
|
|
||||||
fc = tcllib.FotaCheck()
|
fc = tcllib.FotaCheck()
|
||||||
|
|
||||||
@ -39,5 +39,5 @@ fileurl = args.uri
|
|||||||
#fileurl = "/body/ce570ddc079e2744558f191895e524d02a60476f/2c23717bb747f3c321195419f451de52efa8ea51/263790/268932"
|
#fileurl = "/body/ce570ddc079e2744558f191895e524d02a60476f/2c23717bb747f3c321195419f451de52efa8ea51/263790/268932"
|
||||||
|
|
||||||
chksum_xml = fc.do_checksum(random.choice(encslaves), fileurl, fileurl)
|
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)
|
file_addr, sha1_body, sha1_enc_footer, sha1_footer = fc.parse_checksum(chksum_xml)
|
||||||
|
@ -11,6 +11,7 @@ import sys
|
|||||||
|
|
||||||
import tcllib
|
import tcllib
|
||||||
import tcllib.argparser
|
import tcllib.argparser
|
||||||
|
from tcllib.xmltools import pretty_xml
|
||||||
|
|
||||||
|
|
||||||
fc = tcllib.FotaCheck()
|
fc = tcllib.FotaCheck()
|
||||||
@ -70,7 +71,7 @@ fv = fc.fv
|
|||||||
tv = args.targetversion[0]
|
tv = args.targetversion[0]
|
||||||
fw_id = args.fwid[0]
|
fw_id = args.fwid[0]
|
||||||
req_xml = fc.do_request(fc.curef, fv, tv, fw_id)
|
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)
|
fileid, fileurl, slaves, encslaves, s3_fileurl, s3_slaves = fc.parse_request(req_xml)
|
||||||
|
|
||||||
for s in slaves:
|
for s in slaves:
|
||||||
|
@ -26,8 +26,7 @@ class FotaCheck(
|
|||||||
servervote.ServerVoteMixin,
|
servervote.ServerVoteMixin,
|
||||||
credentials.CredentialsMixin,
|
credentials.CredentialsMixin,
|
||||||
devlist.DevListMixin,
|
devlist.DevListMixin,
|
||||||
dumpmgr.DumpMgrMixin,
|
dumpmgr.DumpMgrMixin
|
||||||
xmltools.XmlToolsMixin
|
|
||||||
):
|
):
|
||||||
"""Main API handler class."""
|
"""Main API handler class."""
|
||||||
VDKEY = b"eJwdjwEOwDAIAr8kKFr//7HhmqXp8AIIDrYAgg8byiUXrwRJRXja+d6iNxu0AhUooDCN9rd6rDLxmGIakUVWo3IGCTRWqCAt6X4jGEIUAxgN0eYWnp+LkpHQAg/PsO90ELsy0Npm/n2HbtPndFgGEV31R9OmT4O4nrddjc3Qt6nWscx7e+WRHq5UnOudtjw5skuV09pFhvmqnOEIs4ljPeel1wfLYUF4\n"
|
VDKEY = b"eJwdjwEOwDAIAr8kKFr//7HhmqXp8AIIDrYAgg8byiUXrwRJRXja+d6iNxu0AhUooDCN9rd6rDLxmGIakUVWo3IGCTRWqCAt6X4jGEIUAxgN0eYWnp+LkpHQAg/PsO90ELsy0Npm/n2HbtPndFgGEV31R9OmT4O4nrddjc3Qt6nWscx7e+WRHq5UnOudtjw5skuV09pFhvmqnOEIs4ljPeel1wfLYUF4\n"
|
||||||
|
@ -8,10 +8,7 @@
|
|||||||
import xml.dom.minidom
|
import xml.dom.minidom
|
||||||
|
|
||||||
|
|
||||||
class XmlToolsMixin:
|
def pretty_xml(xmlstr):
|
||||||
"""A mixin component for XML tools."""
|
"""Prettify input XML with ``xml.dom.minidom``."""
|
||||||
@staticmethod
|
mdx = xml.dom.minidom.parseString(xmlstr)
|
||||||
def pretty_xml(xmlstr):
|
return mdx.toprettyxml(indent=" ")
|
||||||
"""Prettify input XML with ``xml.dom.minidom``."""
|
|
||||||
mdx = xml.dom.minidom.parseString(xmlstr)
|
|
||||||
return mdx.toprettyxml(indent=" ")
|
|
||||||
|
Reference in New Issue
Block a user