mirror of
https://github.com/Sneed-Group/pypush-plus-plus
synced 2024-12-24 03:42:43 -06:00
Use walrus operator for ease of reading
This commit is contained in:
parent
c9664c1ce1
commit
4baff08ce5
1 changed files with 1 additions and 2 deletions
|
@ -95,8 +95,7 @@ class APNSProxy:
|
||||||
def tamper_lookup_keys(self, payload: apns.APNSPayload) -> apns.APNSPayload:
|
def tamper_lookup_keys(self, payload: apns.APNSPayload) -> apns.APNSPayload:
|
||||||
if payload.id == 0xA: # Notification
|
if payload.id == 0xA: # Notification
|
||||||
if payload.fields_with_id(2)[0].value == sha1(b"com.apple.madrid").digest(): # Topic
|
if payload.fields_with_id(2)[0].value == sha1(b"com.apple.madrid").digest(): # Topic
|
||||||
if payload.fields_with_id(3)[0].value is not None: # Body
|
if body := payload.fields_with_id(3)[0].value is not None:
|
||||||
body = payload.fields_with_id(3)[0].value
|
|
||||||
body = plistlib.loads(body)
|
body = plistlib.loads(body)
|
||||||
if body['c'] == 97: # Lookup response
|
if body['c'] == 97: # Lookup response
|
||||||
resp = gzip.decompress(body["b"]) # HTTP body
|
resp = gzip.decompress(body["b"]) # HTTP body
|
||||||
|
|
Loading…
Reference in a new issue