mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-23 11:22:42 -06:00
begin dissecting imessage
This commit is contained in:
parent
bc02cebc86
commit
7a9d8c3466
2 changed files with 13 additions and 14 deletions
3
demo.py
3
demo.py
File diff suppressed because one or more lines are too long
24
printer.py
24
printer.py
|
@ -152,21 +152,17 @@ def pretty_print_payload(prefix, payload: tuple[int, list[tuple[int, bytes]]]) -
|
|||
elif id == 0xa:
|
||||
# if it has apsd -> APNs in the prefix, it's an outgoing notification
|
||||
if "apsd -> APNs" in prefix:
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.OKBLUE}OUTGOING Notification{bcolors.ENDC}")
|
||||
# Duplicate the payload to send it twice, but with a different ID
|
||||
payload1 = apns._serialize_payload(payload[0], payload[1])
|
||||
for i in range(len(payload[1])):
|
||||
if payload[1][i][0] == 0x4:
|
||||
payload[1][i] = (0x4, (int.from_bytes(payload[1][i][1]) + 1).to_bytes(4, "big"))
|
||||
#payload[1][i] = (None, None)
|
||||
payload2 = apns._serialize_payload(payload[0], payload[1])
|
||||
for i in range(len(payload[1])):
|
||||
if payload[1][i][0] == 0x4:
|
||||
payload[1][i] = (0x4, (int.from_bytes(payload[1][i][1]) + 1).to_bytes(4, "big"))
|
||||
payload3 = apns._serialize_payload(payload[0], payload[1])
|
||||
#return (payload1 + payload2 + payload3)
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.OKBLUE}OUTGOING Notification{bcolors.ENDC}", end="")
|
||||
if b"bplist" in _get_field(payload[1], 3):
|
||||
print(f" {bcolors.OKCYAN}Binary{bcolors.ENDC}", end="")
|
||||
print(f" {bcolors.WARNING}Topic{bcolors.ENDC}: {_lookup_topic(_get_field(payload[1], 1))}")
|
||||
|
||||
else:
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.OKCYAN}Notification{bcolors.ENDC}")
|
||||
print(f"{bcolors.OKGREEN}{prefix}{bcolors.ENDC}: {bcolors.OKCYAN}Notification{bcolors.ENDC}", end="")
|
||||
if b"bplist" in _get_field(payload[1], 3):
|
||||
print(f" {bcolors.OKBLUE}Binary{bcolors.ENDC}", end="")
|
||||
print(f" {bcolors.WARNING}Topic{bcolors.ENDC}: {_lookup_topic(_get_field(payload[1], 2))}")
|
||||
|
||||
#for field in payload[1]:
|
||||
# print(f"Field ID: {field[0]}")
|
||||
# print(f"Field Value: {field[1]}")
|
||||
|
|
Loading…
Reference in a new issue