|
|
#531 (permalink) |
|
Senior Member
Join Date: Mar 2008
Location: Detroitish
Posts: 1,659
|
This isn't done and it's barely passable as workable code, but it runs and gives you the device tokens from the feedback service.
Code:
#!/usr/bin/env python2.6
import socket, ssl, json, struct
def uniquify(seq):
set = {}
map(set.__setitem__, seq, [])
return set.keys()
theCertfile = 'dist_cert.pem'
theHost = ('feedback.push.apple.com', 2196)
#theCertfile = 'dev_cert.pem'
#theHost = ('feedback.sandbox.push.apple.com', 2196)
ssl_sock = ssl.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM), certfile=theCertfile)
ssl_sock.connect(theHost)
f = ssl_sock.read(2048) #Not sure what size this should be, I think 2 MB should be enough
ssl_sock.close()
array = f.split(' ')
array.pop(0)
tokenstring = ''
tokenarray = []
for hextoken in array:
if len(hextoken) == 37:
unpacked = struct.unpack('!BH34B', hextoken)
for value in unpacked:
converted = hex(value)[2:]
if (len(converted) % 2) == 1:
converted = '0' + converted
tokenstring = tokenstring + converted
tokenstring = tokenstring[0:64]
elif len(hextoken) == 32:
unpacked = struct.unpack('!BH29B', hextoken)
for value in unpacked:
converted = hex(value)[2:]
if (len(converted) % 2) == 1:
converted = '0' + converted
tokenstring = tokenstring + converted
tokenarray.append(tokenstring)
tokenstring = ''
print uniquify(tokenarray)
Last edited by hayroob; 06-22-2009 at 11:51 AM. |
| (Offline) |
|
|
|
#532 (permalink) |
|
Senior Member
Join Date: Jan 2006
Posts: 132
|
Haha alright. I never meant to be a douche or anything. I was thinking maybe $2 or $5. But alright, I'll wait for the actual release. I'm sorry for wasting time, it's my fault for typing my udid wrong, I didn't know about those apps that could email them for you.
|
| (Offline) |
|
|
|
#533 (permalink) | |
|
Senior Member
Join Date: Aug 2006
Location: Melbourne, Australia
Posts: 571
|
Quote:
|
|
| (Offline) |
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|