Omnimaga

Calculator Community => Other Calculators => Topic started by: Jim Bauwens on November 10, 2011, 12:15:14 pm

Title: TI-Nspire update request method
Post by: Jim Bauwens on November 10, 2011, 12:15:14 pm
I've made a little script to requests TI's servers for updates. It uses the method as the students software (I 'reverse engineered' it :p)
Code: [Select]
#!/usr/bin/python
import httplib2
from xml.etree import ElementTree as ET

REQUEST_URL = "http://education.ti.com/ws/webUpdate/queryForUpdate"

root = ET.Element("QueryUpdates")
Request = ET.SubElement(root, "Request")
WebUpdateClientName = ET.SubElement(Request, "WebUpdateClientName")
WebUpdateClientVersion = ET.SubElement(Request, "WebUpdateClientVersion")
WebUpdateClientOS = ET.SubElement(Request, "WebUpdateClientOS")
CurrentVersion = ET.SubElement(Request, "CurrentVersion")
LanguageCode = ET.SubElement(Request, "LanguageCode")
WebUpdateClientEncoding = ET.SubElement(Request, "WebUpdateClientEncoding")
RequestType = ET.SubElement(Request, "RequestType")
CalculatorModel = ET.SubElement(Request, "CalculatorModel")

WebUpdateClientName.text = "TI-Nspire Computer Link Software"
WebUpdateClientVersion.text = "1.4.0.539"
WebUpdateClientOS.text = "Linux"
CurrentVersion.text = "3.1.0.392"
LanguageCode.text = "NL"
WebUpdateClientEncoding.text = "ISO-8859-1"
RequestType.text = "OS"
CalculatorModel.text = "TI-Nspire"

bodyrequest=ET.tostring(root)

h = httplib2.Http(".cache")
resp, content = h.request(REQUEST_URL,"POST", body=bodyrequest)
root = ET.XML(content)


Response = root[1]
ProductInfo = Response[1]

for node in ProductInfo:
name = node.__str__().split("\'")[1]
if node.text:
print(name + ": " + node.text)


Now, here is the response:

ProductID: 7953
ProductName: TI-Nspire Handheld Operating System
ProductFileSize: 10867233
ProductType: OS
ProductRevision: 3.1.0.392
ProductCalculator: TI-Nspire
Name: TI-Nspire
ParentProduct: TI-Nspire™ Handheld Operating System
ForceUpdate: N
UpToDate: Y

I highlighted something creepy, "ForceUpdate". Does this mean that TI can update your calculator without asking you?
Image TI makes a fix for Ndless 3, and they are able to update the calculators of unknowing people just because they connected it with their computer (to send a game for example).

Scary...
Title: Re: TI-Nspire update request method
Post by: Adriweb on November 10, 2011, 02:12:18 pm
Very nice !

I wanted to do the same kind of thing before, with a network packet sniffer but I .... forgot to do it ?  lol

Still, interesting :)
Title: Re: TI-Nspire update request method
Post by: Lionel Debroux on November 11, 2011, 02:14:10 am
Very interesting, indeed :)
If executed as a cron job, your tool will provide the community an early warning when TI decides to use ForceUpdate: Y.
Title: Re: TI-Nspire update request method
Post by: Jim Bauwens on November 11, 2011, 08:15:18 am
I'll put it like a cron job, and let it mail some guys when it detects a change :)
Title: Re: TI-Nspire update request method
Post by: Adriweb on November 11, 2011, 08:16:27 am
How often is that "cronjob-like" event firing, jim ?

Watchout, maybe TI blacklists automated requests ?

(I have no idea)
Title: Re: TI-Nspire update request method
Post by: Jim Bauwens on November 11, 2011, 08:17:53 am
I didn't put it in a cronjob yet, I was just going to ask you guys for your emails ^^
I was thinking of every 1-2 hours, not too bad
Title: Re: TI-Nspire update request method
Post by: Lionel Debroux on November 11, 2011, 09:29:46 am
6 times a day, every 4 hours ?
Title: Re: TI-Nspire update request method
Post by: Levak on November 11, 2011, 09:31:50 am
Every mid-days is sufficient I guess
Title: Re: TI-Nspire update request method
Post by: Lionel Debroux on November 11, 2011, 09:52:54 am
Wouldn't 12h or 24h be somewhat infrequent, for such important news as a new, possibly forced, OS upgrade ?

BTW, I think that the set of persons to whom the e-mail is sent should contain persons living on both sides of the Atlantic Ocean :)
Title: Re: TI-Nspire update request method
Post by: Jim Bauwens on November 11, 2011, 10:40:01 am
Alright, will update the Cron entry :)