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

Allow specifying custom IMEI number. Output used values.

This commit is contained in:
Markus Birth 2018-01-04 22:23:03 +01:00
parent d36f032943
commit 13c72b3458
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A

View File

@ -19,6 +19,7 @@ dp.description = """
""" """
dp.add_argument("prd", nargs=1, help="CU Reference #, e.g. PRD-63117-011") dp.add_argument("prd", nargs=1, help="CU Reference #, e.g. PRD-63117-011")
dp.add_argument("fvver", nargs="?", help="Firmware version to check for OTA updates, e.g. AAM481 (omit to run FULL check)", default="AAA000") dp.add_argument("fvver", nargs="?", help="Firmware version to check for OTA updates, e.g. AAM481 (omit to run FULL check)", default="AAA000")
dp.add_argument("-i", "--imei", help="use specified IMEI instead of default", type=str)
dp.add_argument("-m", "--mode", help="force type of update to check for", default="auto", type=str ,choices=["full", "ota"]) dp.add_argument("-m", "--mode", help="force type of update to check for", default="auto", type=str ,choices=["full", "ota"])
dp.add_argument("-t", "--type", help="force type of check to run", default="auto", type=str, choices=["desktop", "mobile"]) dp.add_argument("-t", "--type", help="force type of check to run", default="auto", type=str, choices=["desktop", "mobile"])
dp.add_argument("--rawmode", help="override --mode with raw value (2=OTA, 4=FULL)") dp.add_argument("--rawmode", help="override --mode with raw value (2=OTA, 4=FULL)")
@ -45,6 +46,10 @@ def sel_cltp(txtmode, autoval, rawval):
return fc.CLTP.DESKTOP return fc.CLTP.DESKTOP
return fc.CLTP.MOBILE return fc.CLTP.MOBILE
if args.imei:
print("Use specified IMEI: {}".format(args.imei))
fc.serid = args.imei
fc.curef = args.prd[0] fc.curef = args.prd[0]
fc.fv = args.fvver fc.fv = args.fvver
if args.fvver == "AAA000": if args.fvver == "AAA000":
@ -54,6 +59,9 @@ else:
fc.mode = sel_mode(args.mode, fc.MODE.OTA, args.rawmode) fc.mode = sel_mode(args.mode, fc.MODE.OTA, args.rawmode)
fc.cltp = sel_cltp(args.type, fc.CLTP.MOBILE, args.rawcltp) fc.cltp = sel_cltp(args.type, fc.CLTP.MOBILE, args.rawcltp)
print("Mode: {}".format(fc.mode.value))
print("CLTP: {}".format(fc.cltp.value))
check_xml = fc.do_check() check_xml = fc.do_check()
print(fc.pretty_xml(check_xml)) print(fc.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)