This commit is contained in:
JJTech0130 2023-09-02 19:48:10 -04:00
parent 91f9d7900e
commit 1aabd4e221
No known key found for this signature in database
GPG key ID: 23C92EBCCF8F93D6

View file

@ -11,8 +11,10 @@ PHONE_IP = "192.168.5.120"
API_PORT = 8080
GATEWAY = "22223333"
def register(push_token: bytes, no_parse = False, gateway = GATEWAY) -> tuple[str, bytes]:
def register(push_token: bytes, no_parse = False, gateway = None) -> tuple[str, bytes]:
"""Forwards a registration request to the phone and returns the phone number, signature for the provided push token"""
if gateway is None:
gateway = GATEWAY
token = push_token.hex().upper()
req_id = random.randint(0, 2**32)
sms = f"REG-REQ?v=3;t={token};r={req_id};"