def t512(cls, data: bytes) -> Dict[str, Any]: data_ = Packet(data) offset = 0 length = data_.read_uint16() offset += 2 ps_key_map: Dict[str, bytes] = {} pt4_token_map: Dict[str, bytes] = {} for _ in range(length): domain_length = data_.read_uint16(offset) offset += 2 domain = data_.read_bytes(domain_length, offset).decode() offset += domain_length key_length = data_.read_uint16(offset) offset += 2 ps_key = data_.read_bytes(key_length, offset) offset += key_length token_length = data_.read_uint16(offset) offset += 2 ps4_token = data_.read_bytes(token_length, offset) offset += token_length ps_key_map[domain] = ps_key pt4_token_map[domain] = ps4_token return {"ps_key_map": ps_key_map, "pt4_token_map": pt4_token_map}
def t199(cls, data: bytes) -> Dict[str, Any]: """Decode tlv 199 data. Data: * open_id (bytes) * pay_token (bytes) Note: Source: oicq.wlogin_sdk.tlv_type.tlv_t199 """ data_ = Packet(data) offset = 0 id_length = data_.read_uint16(offset) offset += 2 + id_length token_length = data_.read_uint16(offset) return { "open_id": data_.read_bytes(id_length, 2), "pay_token": data_.read_bytes(token_length, offset + 2), }
def t200(cls, data: bytes) -> Dict[str, Any]: """Decode tlv 200 data. Data: * pf (bytes) * pf_key (bytes) Note: Source: oicq.wlogin_sdk.tlv_type.tlv_t200 """ data_ = Packet(data) offset = 0 pf_length = data_.read_uint16(offset) offset += 2 + pf_length key_length = data_.read_uint16(offset) return { "pf": data_.read_bytes(pf_length, 2), "pf_key": data_.read_bytes(key_length, offset + 2), }
def t125(cls, data: bytes) -> Dict[str, Any]: """Decode tlv 125 data. Data: * open_id (bytes) * open_key (bytes) Note: Source: oicq.wlogin_sdk.tlv_type.tlv_t125 """ data_ = Packet(data) offset = 0 id_length = data_.read_uint16(offset) offset += 2 + id_length key_length = data_.read_uint16(offset) return { "open_id": data_.read_bytes(id_length, 2), "open_key": data_.read_bytes(key_length, offset + 2), }