mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-23 11:22:42 -06:00
getting ready for imessage decryption...
This commit is contained in:
parent
7a9d8c3466
commit
ed9eb28097
2 changed files with 15 additions and 1 deletions
|
@ -153,8 +153,15 @@ def pretty_print_payload(prefix, payload: tuple[int, list[tuple[int, bytes]]]) -
|
|||
# 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}", end="")
|
||||
topic = _lookup_topic(_get_field(payload[1], 1))
|
||||
if b"bplist" in _get_field(payload[1], 3):
|
||||
print(f" {bcolors.OKCYAN}Binary{bcolors.ENDC}", end="")
|
||||
if topic == "com.apple.madrid":
|
||||
print(f" {bcolors.FAIL}Madrid{bcolors.ENDC}", end="")
|
||||
import plistlib
|
||||
plist = plistlib.loads(_get_field(payload[1], 3))
|
||||
for key in plist:
|
||||
print(f" {bcolors.OKBLUE}{key}{bcolors.ENDC}: {plist[key]}", end="")
|
||||
print(f" {bcolors.WARNING}Topic{bcolors.ENDC}: {_lookup_topic(_get_field(payload[1], 1))}")
|
||||
|
||||
else:
|
||||
|
|
|
@ -61,7 +61,14 @@ def proxy(conn1: tlslite.TLSConnection, conn2: tlslite.TLSConnection, prefix: st
|
|||
print(prefix, "Connection closed due to no data")
|
||||
break
|
||||
|
||||
override = printer.pretty_print_payload(prefix, apns._deserialize_payload_from_buffer(data))
|
||||
try:
|
||||
override = printer.pretty_print_payload(prefix, apns._deserialize_payload_from_buffer(data))
|
||||
except Exception as e:
|
||||
if e == "Buffer is too short":
|
||||
print("Buffer is too short to parse, ignoring")
|
||||
# print("Buffer is too short, trying to read more")
|
||||
# data += conn1.read()
|
||||
pass
|
||||
if override is not None:
|
||||
data = override
|
||||
print("OVERRIDE: ", end="")
|
||||
|
|
Loading…
Reference in a new issue