Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- import requests
- from uuid import uuid4
- from os import urandom
- from random import randint
- from time import sleep
- APP_ID = str(uuid4())
- BOOT_ID = str(uuid4())
- SERIAL_ID = 'RM100-123-12345'
- URL = 'https://get-updates.cloud.remarkable.engineering/service/update2'
- def probe() -> bool:
- uuid1, uuid2 = str(uuid4()), str(uuid4())
- machineid = urandom(16).hex()
- data = '<?xml version="1.0" encoding="UTF-8"?>\n<request protocol="3.0" version="1.8.1.1" requestid="{%s}" sessionid="{%s}" updaterversion="0.4.2" installsource="ondemandupdate" ismachine="1">\n <os version="zg" platform="reMarkable" sp="1.8.1.1_armv7l" arch="armv7l"></os>\n <app appid="{%s}" version="1.8.1.1" track="Prod" ap="Prod" bootid="{%s}" oem="%s" oemversion="1.1" alephversion="1.8.1.1" machineid="%s" lang="en-US" board="" hardware_class="" delta_okay="false" nextversion="0.0.0" brand="" client="" >\n <ping active="1"></ping>\n <updatecheck></updatecheck>\n <event eventtype="3" eventresult="2" previousversion=""></event>\n </app>\n</request>\n' % (uuid1, uuid2, APP_ID, BOOT_ID, SERIAL_ID, machineid)
- response = requests.post(URL, data=data)
- assert(response.ok)
- #print(response.content)
- return machineid, b'<updatecheck status="noupdate"/>' not in response.content, response.content
- def autoprobe(delay=0.5, maxExtra=0.3):
- while 1:
- sleep(delay + (randint(1, int(maxExtra*1000)) / 1000))
- mid, success, content = probe()
- if not success:
- print('Failed: %s' % mid)
- else:
- print('SUCCESS!!!')
- print('MACHINE ID: %s' % mid)
- print('RESPONSE: ')
- print('%s' % content)
- exit(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement