Created
April 12, 2013 22:10
-
-
Save abl/5375570 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Beginning after the blank line 685 of pebble/pebble.py | |
if restype == 1: | |
apps["banks"], apps_installed = unpack("!II", data[1:9]) | |
apps["apps"] = [] | |
appinfo_size = 78 | |
offset = 9 | |
for i in xrange(apps_installed): | |
app = {} | |
try: | |
app["id"], app["index"], app["name"], app["company"], app["flags"], app["version"] = \ | |
unpack("!II32s32sIH", data[offset:offset+appinfo_size]) | |
app["name"] = app["name"].replace("\x00", "") | |
app["company"] = app["company"].replace("\x00", "") | |
apps["apps"] += [app] | |
except: | |
if offset+appinfo_size > len(data): | |
log.warn("Couldn't load bank %d; remaining data = %s" % (i,repr(data[offset:]))) | |
else: | |
raise | |
offset += appinfo_size |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment