From 04969a0160ac0ba716cd2bbbf5c80da9d0fc808f Mon Sep 17 00:00:00 2001 From: June <61218022+itsjunetime@users.noreply.github.com> Date: Sun, 20 Aug 2023 17:15:45 -0600 Subject: [PATCH] Iterate over references instead of indexes for identities --- proxy/proxy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proxy/proxy.py b/proxy/proxy.py index bd6562d..882a06d 100644 --- a/proxy/proxy.py +++ b/proxy/proxy.py @@ -103,9 +103,9 @@ class APNSProxy: # Replace public keys for r in resp["results"].keys(): - for i in range(len(resp["results"][r]["identities"])): - if "client-data" in resp["results"][r]["identities"][i]: - resp["results"][r]["identities"][i]["client-data"]["public-message-identity-key"] = b"REDACTED" + for identity in resp["results"][r]["identities"]: + if "client-data" in identity: + identity["client-data"]["public-message-identity-key"] = b"REDACTED" resp = gzip.compress(plistlib.dumps(resp, fmt=plistlib.FMT_BINARY), mtime=0) body["b"] = resp