diff --git a/yowsup/layers/coder/test_decoder.py b/yowsup/layers/coder/test_decoder.py index e429ea306..a6bc04e3c 100644 --- a/yowsup/layers/coder/test_decoder.py +++ b/yowsup/layers/coder/test_decoder.py @@ -8,8 +8,8 @@ def setUp(self): self.decoder.streamStarted = True def test_decode(self): - data = bytearray([0, 248, 6, 95, 179, 252, 3, 120, 121, 122, 252, 4, 102, 111, 114, 109, 252, 3, 97, 98, 99, 248, 1, 248, 4, 93, - 236, 104, 255, 130, 18, 63, 252, 6, 49, 50, 51, 52, 53, 54]) + data = bytearray([0, 248, 6, 9, 11, 252, 3, 120, 121, 122, 5, 252, 3, 97, 98, 99, 248, 1, 248, 4, 50, 238, 86, 255, 130, 18, 63, + 252, 6, 49, 50, 51, 52, 53, 54]) node = self.decoder.getProtocolTreeNode(data) - targetNode = ProtocolTreeNode("message", {"form": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")]) + targetNode = ProtocolTreeNode("message", {"from": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")]) self.assertEqual(node, targetNode) diff --git a/yowsup/layers/coder/test_encoder.py b/yowsup/layers/coder/test_encoder.py index 5d6ef5c9b..4c45e6c28 100644 --- a/yowsup/layers/coder/test_encoder.py +++ b/yowsup/layers/coder/test_encoder.py @@ -9,14 +9,14 @@ def setUp(self): self.encoder = WriteEncoder(TokenDictionary()) def test_encode(self): - node = ProtocolTreeNode("message", {"form": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")]) + node = ProtocolTreeNode("message", {"from": "abc", "to":"xyz"}, [ProtocolTreeNode("media", {"width" : "123"}, data=b"123456")]) result = self.encoder.protocolTreeNodeToBytes(node) self.assertTrue(result in ( - [0, 248, 6, 95, 179, 252, 3, 120, 121, 122, 252, 4, 102, 111, 114, 109, 252, 3, 97, 98, 99, 248, 1, 248, 4, 93, - 236, 104, 255, 130, 18, 63, 252, 6, 49, 50, 51, 52, 53, 54], - [0, 248, 6, 95, 252, 4, 102, 111, 114, 109, 252, 3, 97, 98, 99, 179, 252, 3, 120, 121, 122, 248, 1, 248, 4, 93, - 236, 104, 255, 130, 18, 63, 252, 6, 49, 50, 51, 52, 53, 54] + [0, 248, 6, 9, 11, 252, 3, 120, 121, 122, 5, 252, 3, 97, 98, 99, 248, 1, 248, 4, 50, 238, 86, 255, 130, 18, 63, + 252, 6, 49, 50, 51, 52, 53, 54], + [0, 248, 6, 9, 5, 252, 3, 97, 98, 99, 11, 252, 3, 120, 121, 122, 248, 1, 248, 4, 50, 238, 86, 255, 130, 18, 63, + 252, 6, 49, 50, 51, 52, 53, 54] ) ) diff --git a/yowsup/layers/coder/test_tokendictionary.py b/yowsup/layers/coder/test_tokendictionary.py index 7fe40c243..3422caec1 100644 --- a/yowsup/layers/coder/test_tokendictionary.py +++ b/yowsup/layers/coder/test_tokendictionary.py @@ -5,16 +5,16 @@ def setUp(self): self.tokenDictionary = TokenDictionary() def test_getToken(self): - self.assertEqual(self.tokenDictionary.getToken(80), "iq") + self.assertEqual(self.tokenDictionary.getToken(10), "iq") def test_getIndex(self): - self.assertEqual(self.tokenDictionary.getIndex("iq"), (80, False)) + self.assertEqual(self.tokenDictionary.getIndex("iq"), (10, False)) def test_getSecondaryToken(self): - self.assertEqual(self.tokenDictionary.getToken(238), "amrnb") + self.assertEqual(self.tokenDictionary.getToken(238), "lc") def test_getSecondaryTokenExplicit(self): - self.assertEqual(self.tokenDictionary.getToken(11, True), "wmv") + self.assertEqual(self.tokenDictionary.getToken(11, True), "reject") def test_getSecondaryIndex(self): - self.assertEqual(self.tokenDictionary.getIndex("wmv"), (11, True)) \ No newline at end of file + self.assertEqual(self.tokenDictionary.getIndex("reject"), (11, True)) \ No newline at end of file diff --git a/yowsup/layers/coder/tokendictionary.py b/yowsup/layers/coder/tokendictionary.py index 0f348aa29..c261dc27e 100644 --- a/yowsup/layers/coder/tokendictionary.py +++ b/yowsup/layers/coder/tokendictionary.py @@ -4,549 +4,1269 @@ class TokenDictionary: def __init__(self): self.dictionary = [ - '', - '', - '', - 'account', - 'ack', - 'action', - 'active', - 'add', - 'after', - 'all', - 'allow', - 'apple', - 'audio', - 'auth', - 'author', - 'available', - 'bad-protocol', - 'bad-request', - 'before', - 'bits', - 'body', - 'broadcast', - 'cancel', - 'category', - 'challenge', - 'chat', - 'clean', - 'code', - 'composing', - 'config', - 'contacts', - 'count', - 'create', - 'creation', - 'debug', - 'default', - 'delete', - 'delivery', - 'delta', - 'deny', - 'digest', - 'dirty', - 'duplicate', - 'elapsed', - 'enable', - 'encoding', - 'encrypt', - 'error', - 'event', - 'expiration', - 'expired', - 'fail', - 'failure', - 'false', - 'favorites', - 'feature', - 'features', - 'feature-not-implemented', - 'field', - 'file', - 'filehash', - 'first', - 'free', - 'from', - 'g.us', - 'gcm', - 'get', - 'google', - 'group', - 'groups', - 'groups_v2', - 'http://etherx.jabber.org/streams', - 'http://jabber.org/protocol/chatstates', - 'ib', - 'id', - 'image', - 'img', - 'index', - 'internal-server-error', - 'ip', - 'iq', - 'item-not-found', - 'item', - 'jabber:iq:last', - 'jabber:iq:privacy', - 'jabber:x:event', - 'jid', - 'kind', - 'last', - 'leave', - 'list', - 'max', - 'mechanism', - 'media', - 'message_acks', - 'message', - 'method', - 'microsoft', - 'mimetype', - 'missing', - 'modify', - 'msg', - 'mute', - 'name', - 'nokia', - 'none', - 'not-acceptable', - 'not-allowed', - 'not-authorized', - 'notification', - 'notify', - 'off', - 'offline', - 'order', - 'owner', - 'owning', - 'p_o', - 'p_t', - 'paid', - 'participant', - 'participants', - 'participating', - 'paused', - 'picture', - 'pin', - 'ping', - 'pkmsg', - 'platform', - 'port', - 'presence', - 'preview', - 'probe', - 'prop', - 'props', - 'qcount', - 'query', - 'raw', - 'read', - 'readreceipts', - 'reason', - 'receipt', - 'relay', - 'remote-server-timeout', - 'remove', - 'request', - 'required', - 'resource-constraint', - 'resource', - 'response', - 'result', - 'retry', - 'rim', - 's_o', - 's_t', - 's.us', - 's.whatsapp.net', - 'seconds', - 'server-error', - 'server', - 'service-unavailable', - 'set', - 'show', - 'silent', - 'size', - 'skmsg', - 'stat', - 'state', - 'status', - 'stream:error', - 'stream:features', - 'subject', - 'subscribe', - 'success', - 'sync', - 't', - 'text', - 'timeout', - 'timestamp', - 'tizen', - 'to', - 'true', - 'type', - 'unavailable', - 'unsubscribe', - 'upgrade', - 'uri', - 'url', - 'urn:ietf:params:xml:ns:xmpp-sasl', - 'urn:ietf:params:xml:ns:xmpp-stanzas', - 'urn:ietf:params:xml:ns:xmpp-streams', - 'urn:xmpp:ping', - 'urn:xmpp:whatsapp:account', - 'urn:xmpp:whatsapp:dirty', - 'urn:xmpp:whatsapp:mms', - 'urn:xmpp:whatsapp:push', - 'urn:xmpp:whatsapp', - 'user', - 'user-not-found', - 'v', - 'value', - 'version', - 'voip', - 'w:g', - 'w:p:r', - 'w:p', - 'w:profile:picture', - 'w', - 'wait', - 'WAUTH-2', - 'xmlns:stream', - 'xmlns', - '1', - 'chatstate', - 'crypto', - 'phash', - 'enc', - 'class', - 'off_cnt', - 'w:g2', - 'promote', - 'demote', - 'creator', - 'background', - 'backoff', - 'chunked', - 'context', - 'full', - 'in', - 'interactive', - 'out', - 'registration', - 'sid', - 'urn:xmpp:whatsapp:sync', - 'flt', - 's16', - 'u8', + '', + 'xmlstreamstart', + 'xmlstreamend', + 'type', + 'id', + 'from', + 'receipt', + 't', + 's.whatsapp.net', + 'message', + 'iq', + 'to', + 'participant', + 'ack', + 'enc', + 'plaintext_size', + 'compressed_size', + 'class', + 'v', + 'user', + 'jid', + 'notify', + 'host', + 'off_cnt', + 'value', + '1', + 'xmlns', + 'result', + 'media_conn', + 'read', + 'offline', + 'mediatype', + 'presence', + 'edit', + 'notification', + 'get', + 'item', + 'phash', + 'skmsg', + 'text', + 'status', + 'broadcast', + 'g.us', + 'hostname', + 'contact', + 'image', + 'set', + 'participants', + '0', + 'chatstate', + 'media', + 'success', + 'ib', + 'subject', + 'picture', + 'seen', + 'ping', + 'w', + 'retry', + 'unavailable', + 'config', + 'msg', + 'ip6', + 'ip4', + 'video', + 'ttl', + 'auth_ttl', + 'max_buckets', + 'count', + 'composing', + 'call', + 'w:p', + 'auth', + 'call-creator', + 'props', + 'last', + 'creation', + 'location', + 'hash', + 'bits', + 'list', + 'gcm', + 'deny', + 'call-id', + 'pop', + 'subscribe', + 'te', + 'preview', + 'multicast', + 'gif', + 'code', + 'relaylatency', + 'download', + 'primary', + 'pkmsg', + 'action', + 'order', + 'add', + 'delivery', + 'routing_info', + 'edge_routing', + 'dns_domain', + 'w:m', + 'available', + 'mmg.whatsapp.net', + 'contacts', + 'fallback', + 'download_buckets', + 'name', + 'audio', + 'in', + 'played', + 'fail', + 'platform', + 'urn:xmpp:ping', + 'fna', + 'upload', + 'ptt', + 'urn:xmpp:whatsapp:push', + 'verified_name', + 'paused', + 'update', + 'key', + 'out', + 'error', + 'query', + 'true', + 'business', + 'atn', + '401', + 'usync', + 'delete', + 'unread', + 'w:stats', + 'w:profile:picture', + 'url', + 'sidelist', + 'net', + 'medium', + 'state', + 'sticker', + 'active', + 'frc', + 'prop', + 'web', + 'encrypt', + 'identity', + 'verified_level', + 'document', + 'w:compress', + 'w:gp2', + 'latency', + 'mode', + 'transport', + 'registration', + 'opus', + 'rate', + 'keygen', + 'encopt', + 'profile', + 'priority', + 'orientation', + 'mute', + 'unknown', + 'none', + 'resume', + 'offer', + 'ver', + 'capability', + 'sid', + 'index', + 'context', + 'terminate', + 'transaction-id', + 'false', + 'default', + 'business_hours_config', + 'serial', + 'reason', + 'side_list', + 'version', + 'screen_width', + 'stream:error', + 'tsoffline', + 'features', + 'token', + 'relay', + 'videostate', + 'contact_remove', + 'contact_add', + 'remove', + 'tag', + 'refresh', + 'protocol', + 'e', + 'resume_check', + 'media_type', + 'w:web', + 'invite', + 'group', + 'readreceipts', + 'note.m4r', + 'jabber:iq:privacy', + 'disable', + 'background', + 'delta', + 'direct_path', + 'conflict', + 'skey', + 'preaccept', + 'admin', + 'signature', + '404', + 'item-not-found', + 'day_of_week', + 'accept', + 'interactive', + 'timeoffline', + 'apple', + 'sync', + 'open_time', + 'close_time', + 'user_add', + 'full', + 'screen_height', + 'timeout', + 'duration', + 'audio_duration', + 'voip_settings', + 'callee_updated_payload', + 'description', + 'rte', + 'not-authorized', + 'groups', + 'voip', + 'uploadfieldstat' ] self.secondaryDictionary = [ - 'adpcm', - 'amrnb', - 'amrwb', - 'mp3', - 'pcm', - 'qcelp', - 'wma', - 'h263', - 'h264', - 'jpeg', - 'mpeg4', - 'wmv', - 'audio/3gpp', - 'audio/aac', - 'audio/amr', - 'audio/mp4', - 'audio/mpeg', - 'audio/ogg', - 'audio/qcelp', - 'audio/wav', - 'audio/webm', - 'audio/x-caf', - 'audio/x-ms-wma', - 'image/gif', - 'image/jpeg', - 'image/png', - 'video/3gpp', - 'video/avi', - 'video/mp4', - 'video/mpeg', - 'video/quicktime', - 'video/x-flv', - 'video/x-ms-asf', - '302', - '400', - '401', - '402', - '403', - '404', - '405', - '406', - '407', - '409', - '410', - '500', - '501', - '503', - '504', - 'abitrate', - 'acodec', - 'app_uptime', - 'asampfmt', - 'asampfreq', - 'clear', - 'conflict', - 'conn_no_nna', - 'cost', - 'currency', - 'duration', - 'extend', - 'fps', - 'g_notify', - 'g_sound', - 'gone', - 'google_play', - 'hash', - 'height', - 'invalid', - 'jid-malformed', - 'latitude', - 'lc', - 'lg', - 'live', - 'location', - 'log', - 'longitude', - 'max_groups', - 'max_participants', - 'max_subject', - 'mode', - 'napi_version', - 'normalize', - 'orighash', - 'origin', - 'passive', - 'password', - 'played', - 'policy-violation', - 'pop_mean_time', - 'pop_plus_minus', - 'price', - 'pricing', - 'redeem', - 'Replaced by new connection', - 'resume', - 'signature', - 'sound', - 'source', - 'system-shutdown', - 'username', - 'vbitrate', - 'vcard', - 'vcodec', - 'video', - 'width', - 'xml-not-well-formed', - 'checkmarks', - 'image_max_edge', - 'image_max_kbytes', - 'image_quality', - 'ka', - 'ka_grow', - 'ka_shrink', - 'newmedia', - 'library', - 'caption', - 'forward', - 'c0', - 'c1', - 'c2', - 'c3', - 'clock_skew', - 'cts', - 'k0', - 'k1', - 'login_rtt', - 'm_id', - 'nna_msg_rtt', - 'nna_no_off_count', - 'nna_offline_ratio', - 'nna_push_rtt', - 'no_nna_con_count', - 'off_msg_rtt', - 'on_msg_rtt', - 'stat_name', - 'sts', - 'suspect_conn', - 'lists', - 'self', - 'qr', - 'web', - 'w:b', - 'recipient', - 'w:stats', - 'forbidden', - 'max_list_recipients', - 'en-AU', - 'en-GB', - 'es-MX', - 'pt-PT', - 'zh-Hans', - 'zh-Hant', - 'relayelection', - 'relaylatency', - 'interruption', - 'Bell.caf', - 'Boing.caf', - 'Glass.caf', - 'Harp.caf', - 'TimePassing.caf', - 'Tri-tone.caf', - 'Xylophone.caf', - 'aurora.m4r', - 'bamboo.m4r', - 'chord.m4r', - 'circles.m4r', - 'complete.m4r', - 'hello.m4r', - 'input.m4r', - 'keys.m4r', - 'note.m4r', - 'popcorn.m4r', - 'pulse.m4r', - 'synth.m4r', - 'Apex.m4r', - 'Beacon.m4r', - 'Bulletin.m4r', - 'By The Seaside.m4r', - 'Chimes.m4r', - 'Circuit.m4r', - 'Constellation.m4r', - 'Cosmic.m4r', - 'Crystals.m4r', - 'Hillside.m4r', - 'Illuminate.m4r', - 'Night Owl.m4r', - 'Opening.m4r', - 'Playtime.m4r', - 'Presto.m4r', - 'Radar.m4r', - 'Radiate.m4r', - 'Ripples.m4r', - 'Sencha.m4r', - 'Signal.m4r', - 'Silk.m4r', - 'Slow Rise.m4r', - 'Stargaze.m4r', - 'Summit.m4r', - 'Twinkle.m4r', - 'Uplift.m4r', - 'Waves.m4r', - 'eligible', - 'planned', - 'current', - 'future', - 'disable', - 'expire', - 'start', - 'stop', - 'accuracy', - 'speed', - 'bearing', - 'recording', - 'key', - 'identity', - 'w:gp2', - 'admin', - 'locked', - 'unlocked', - 'new', - 'battery', - 'archive', - 'adm', - 'plaintext_size', - 'plaintext_disabled', - 'plaintext_reenable_threshold', - 'compressed_size', - 'delivered', - 'everyone', - 'transport', - 'mspes', - 'e2e_groups', - 'e2e_images', - 'encr_media', - 'encrypt_v2', - 'encrypt_image', - 'encrypt_sends_push', - 'force_long_connect', - 'audio_opus', - 'video_max_edge', - 'call-id', - 'call', - 'preaccept', - 'accept', - 'offer', - 'reject', - 'busy', - 'te', - 'terminate', - 'begin', - 'end', - 'opus', - 'rtt', - 'token', - 'priority', - 'p2p', - 'rate', - 'amr', - 'ptt', - 'srtp', - 'os', - 'browser', - 'encrypt_group_gen2', - "encrypt_audio", - "encrypt_blist", - "encrypt_contact", - "encrypt_location", - "encrypt_url", - "encrypt_video", - "doc_types", - "upload_oom_hprof_enabled", - "tos", - "client", - "e2e_audio", - "e2e_blists", - "e2e_video", - "document", - "contact", - "file_max_size", - "small_call_btn", - "enable_mp4_operations_mux", - "android_vacuuming_enabled", - "android_vacuum_experiment_enabled", - "aec", - "agc", - "options", - "encode", - "bwe", - "rc", - "ns", - "ec_threshold", - "ec_off_threshold", - "algorithm", - "targetlevel", - "compressiongain", - "limiterenable", - "cbr", - "complexity", - "minfpp", - "maxrtt", - "low_data_usage_bitrate", - "usync", - "refresh", - "media_max_autodownload" + 'lg', + 'lc', + 's_t', + 's_o', + 'Opening.m4r', + 'feature', + 'complete', + 'allow', + 'from_ip', + 'to_ip', + 'creator', + 'reject', + 'video_duration', + 'maxfpp', + 'rc_dyn', + 'privacy', + 'ip_config', + 'enable_ssrc_demux', + 're', + 'proto', + 'latency_update_threshold', + 'category', + 'timestamp', + 'specific_hours', + 'options', + 'url_text', + 'nack', + 'aud_pkt_reorder_pct', + 'server-error', + 'invalid', + 'cond_net_medium', + 'vertical', + 'canonical', + 'passive', + 'is_biz', + 'w:g2', + 'cond_range_rtt', + 'encode', + 'dtx', + 'group_info', + 'ts', + 'business_hours', + 'timezone', + 'target_bitrate', + 'end', + 'modify', + 'en', + 'user_remove', + 'minfpp', + 'superadmin', + 'request', + 'enable_audio_oob_fec_feature', + 'log', + 'userrate', + 'vid_rc', + 'max_bitrate', + 'init_bwe', + 'test_flags', + 'max_tx_rott_based_bitrate', + 'max_bytes', + 'init_bitrate', + 'use_local_probing_rx_bitrate', + 'open_24h', + 'mtu_size', + 'enable_audio_pkt_piggyback_for_sender', + 'enable_audio_piggyback_feature', + 'enable_audio_oob_fec_for_sender', + 'audio_piggyback_timeout_msec', + 'audio_oob_fec_max_pkts', + 'cond_range_packet_loss_pct', + 'video_codec_priority', + 'source_action', + 'rows_seen', + 'ad_position', + 'event', + 'Tri-tone.caf', + 'rc', + 'promote', + 'off', + 'enable_periodical_aud_rr_processing', + 'cond_range_target_total_bitrate', + 'cond_congestion_signal_mask', + 'cond_congestion_no_rtcp_thr', + 'cond_congestion_no_init_rtt_thr', + 'group_update', + 'author', + 'interruption', + 'keys', + 'address', + '403', + 'identity_verification', + 'chord.m4r', + 'forbidden', + 'enc_supported', + 'enc_rekey', + 'body', + 'email', + 'thu', + 'begin', + 'wed', + 'tue', + 'busy', + 'mon', + 'fri', + 'all', + 'website', + 'bamboo.m4r', + 'live', + 'battery', + 'os', + 'browser', + 'encrypt_video', + 'encrypt_v2', + 'encrypt_url', + 'encrypt_location', + 'encrypt_image', + 'encrypt_group_gen2', + 'encrypt_contact', + 'encrypt_blist', + 'encrypt_audio', + 'client', + 'aurora.m4r', + 'connected', + 'Glass.caf', + 'sat', + 'recipient', + 'create', + 'rotate', + 'popcorn.m4r', + 'fbip', + 'caller_bad_asn', + 'sonar', + 'mediaretry', + 'dirty', + 'longitude', + 'latitude', + '405', + 'callee_bad_asn', + 'source', + 'elapsed', + 'circles.m4r', + 'final', + 'not-allowed', + 'new', + 'complete.m4r', + 'status_session_summary', + 'event_seq', + 'locked', + 'hello.m4r', + 'xor_cipher', + 'p2', + 'p1', + 'enabled', + 'vcard', + 'vid_rc_dyn', + 'sun', + 'demote', + 'required', + 'video_max_edge', + 'video_max_bitrate', + 'status_video_max_duration', + 'status_video_max_bitrate', + 'status_image_quality', + 'status_image_max_edge', + 'media_max_autodownload', + 'max_subject', + 'max_participants', + 'max_keys', + 'image_quality', + 'image_max_kbytes', + 'image_max_edge', + 'file_max_size', + 'lists', + 'gif_provider', + 'payments_disable_switch_psp', + 'keys.m4r', + 'microsoft', + 'old', + 'p256dh', + 'kaios', + 'endpoint', + 'appointment_only', + 'attestation', + 'w:biz', + 'status_entry', + 'low', + 'small_call_btn', + 'force_long_connect', + 'qcount', + 'leave', + 'flowcontrol', + 'clear', + 'pulse.m4r', + 'Boing.caf', + 'participating', + 'Bell.caf', + 'synth.m4r', + 'w:ads', + 'crypto', + 'response', + 'powersave', + 'test', + 'Chrome', + 'input.m4r', + 'start', + 'announcement', + 'cond_range_target_bitrate', + 'other', + '2fa', + 'digest', + 'prof-services', + 'America/Sao_Paulo', + 'cond_peer_net_medium', + 'bank', + 'clean', + 'Harp.caf', + 'te2', + 'fanout', + 'livelocation', + 'maxbwe', + 'jb_max_playout_dist', + 'TimePassing.caf', + 'urn:xmpp:whatsapp:account', + 'Windows 10', + 'Xylophone.caf', + 'size', + 'nonce', + '501', + 'expiration', + 'Desktop', + 'google', + 'w:b', + 'relay_id', + 'blacklist', + 'locales', + 'outgoing', + 'password', + 'url_number', + 'mms_vcache_aggregation_enabled', + 'unsubscribe', + 'jws', + 'business_profile', + 'relayelection', + 'bitrate', + 'retail', + 'not_announcement', + 'raw', + 'ot', + 'oid', + 'Asia/Calcutta', + 'Asia/Kolkata', + 'cond_range_remb_minus_peer_rx_br', + 'sender_inc_ratio', + 'enable_cc_bwe_slow_ramp_up', + 'cc_bwe_slow_ramp_up_peer_rx_bitrate', + 'cc_bwe_slow_ramp_up_ceiling_multiplier', + 'wa_zero_rate_sig', + 'terminated', + 'batterystate', + '[]', + 'apparel', + 'urn:xmpp:whatsapp:dirty', + 'Asia/Jakarta', + '409', + 'target_bitrate_upper_bound', + 'peer_state', + 'whitelist', + 'rekey', + '406', + 'Windows 7', + 'cache', + 'edu', + '400', + 'spam_list', + 'spam_flow', + 'wns', + 'contact_array', + '302', + '410', + 'languagepack', + 'mms_media_key_ttl', + 'challenge', + 'health', + 'max_encode_width', + 'bank-ref-id', + 'cc', + 'max_fps', + 'codec_type', + 'entertain', + 'paid_message', + '407', + 'auto', + 'psa', + 'beauty', + 'failure', + 'stop', + 'bypassed', + '402', + 'aec', + '500', + 'portpredicting', + 'travel', + 'max_target_bitrate', + 'comb_psnr_sample_interval', + 'govt', + 'not-a-biz', + 'video_frame_crc_sample_interval', + 'enable_pli_for_crc_mismatch', + 'gdpr', + 'grocery', + 'min_target_bitrate', + 'enable_frame_dropper', + 'normalize', + 'ns', + 'Mac OS 10.13.6', + 'America/Belem', + 'ad', + 'hsm', + 'after', + 'key_frame_interval', + '503', + 'event-plan', + 'additive_sender_bwe_inc_near_max', + 'Asia/Kuala_Lumpur', + 'finance', + 'gone', + 'Firefox', + 'force_additive_sender_bwe_inc', + 'America/Bogota', + 'c0', + 'c1', + 'c2', + '504', + 'c3', + 'vpx_max_intra_bitrate_pct', + 'pli_key_frame_pct', + 'Mac OS 10.14.0', + 'psnr_resolution_ctrl_sample_size', + 'overshoot_rate_sample_interval', + 'overshoot_rate_ema_sample_size', + 'overshoot_rate_downgrade_threshold_pct', + 'enc_psnr_downgrade_threshold', + 'restaurant', + 'vp8_cpu', + 'agc', + 'spam', + 'high', + 'bwe', + 'Mac OS 10.14.1', + 'expiration_ts', + 'Africa/Lagos', + 'codec_sub_type', + 'vid_rc_battery', + 'Mac OS 10.10.1', + 'Windows 8.1', + 'bank-phone-number', + 'Safari', + 'status_v2', + 'gif_search', + 'use_audio_packet_rate', + 'audio_encode_offload', + 'offset', + 'transport_stats_p2p_threshold', + 'spam_call_threshold_seconds', + 'enable_upnp', + 'enable_preaccept_received_update', + 'enable_new_transport_stats', + 'connected_if_received_data', + 'vad_threshold', + 'precise_rx_timestamps_mask', + 'p2p_request_timeout', + 'non_speech_bitrate', + 'maxfpp_duration', + 'echo_detector_mode', + 'echo_detector_impl', + 'disable_agc', + 'caller_end_call_threshold', + 'call_start_delay', + 'android_call_connected_toast', + 'aecm_adapt_step_size', + 'cancel_offer', + 'wa_log_time_series', + 'waLogTimeSeries', + 'account', + 'delay_based_bwe_trendline_filter_enabled', + 'delay_based_bwe_bitrate_estimator_enabled', + 'bwe_impl', + 'hotel', + 'Mac OS 10.12.6', + 'America/Mexico_City', + 'on_rtp', + '#resource-limit', + 'nonprofit', + 'Asia/Karachi', + 'Asia/Riyadh', + 'en-GB', + 'rejected', + 'chat', + 'unlocked', + 'America/Manaus', + 'block_dialog', + 'America/Argentina/Buenos_Aires', + 'not-acceptable', + 'cbr', + 'maxrtt', + 'low_data_usage_bitrate', + 'complexity', + 'algorithm', + 'targetlevel', + 'limiterenable', + 'ec_threshold', + 'ec_off_threshold', + 'compressiongain', + 'use_udp_relay', + 'use_tcp_relay', + 'use_new_ping_format', + 'tcp_relay_bind_timeout_in_msec', + 'username', + 'unsigned_mode', + 'biz_status', + 'America/Recife', + 'audience', + 'internal', + 'create_certificate', + 'Opera', + 'Europe/Istanbul', + 'min_packet_loss_pct', + 'Linux x86_64', + 'setup_failed', + 'enc_rekey_retry', + 'Mac OS 10.11.6', + 'max_packet_loss_pct', + 'low_threshold', + 'Africa/Johannesburg', + 'America/Araguaina', + 'prev', + '420', + 'max_capture_width', + 'cond_rtt_ema_alpha', + 'cond_range_ema_rtt', + 'America/Noronha', + 'Apex.m4r', + 'invisible', + 'Africa/Harare', + 'Asia/Makassar', + 'internal-server-error', + 'Europe/Rome', + 'p2p_pay', + 'x', + 'Europe/Madrid', + 'America/Lima', + 'net_medium', + 'Africa/Cairo', + 'force_logout', + 'Asia/Dubai', + 'max', + 'Africa/Nairobi', + 'Mac OS 10.13.3', + 'Edge', + 'Africa/Accra', + 'aecm', + 'favorites', + 'America/Guayaquil', + 'biz', + 'America/Asuncion', + 'Beacon.m4r', + '408', + 'rusr', + 'rexp', + 'rproc', + 'rusrreg', + 'vp8_static_threshold', + 'packet_loss_mode', + 'no_rtcp_received_threshold', + 'no_data_received_threshold', + 'min_decrease_factor_on_congestion', + 'max_key_frame_mode_bitrate', + 'low_battery_notify_threshold', + 'initial_rtt_congestion_threshold', + 'equalize_packet_sizes', + 'drop_threshold', + 'cellular_bitrate', + 'rtt_congestion_step', + 'account_info', + 'America/La_Paz', + 'nack_rtt_interactive_threshold', + 'America/Fortaleza', + 'transaction', + 'Mac OS 10.13.4', + 'ka', + 'Europe/Moscow', + 'Mac OS 10.10.5', + 'vpx_min_qp', + 'Asia/Jerusalem', + 'America/Santo_Domingo', + 'vpa', + 'relay_bind_failed', + 'America/Campo_Grande', + 'Asia/Aden', + 'America/Caracas', + 'Asia/Hong_Kong', + 'Asia/Almaty', + 'America/Santiago', + 'Windows 8', + 'es-MX', + 'Pacific/Midway', + 'Africa/Dar_es_Salaam', + 'Europe/Berlin', + 'Mac OS 10.13.5', + 'America/Costa_Rica', + 'Asia/Beirut', + 'America/New_York', + 'Africa/Porto-Novo', + 'Linux i686', + 'Mac OS 10.10.4', + 'logout', + 'America/Montevideo', + 'ack_smb', + 'Mac OS 10.14', + 'Europe/Amsterdam', + '460', + 'tos2', + 'Asia/Kuwait', + 'accept_smb', + 'optout', + 'America/Guatemala', + 'Asia/Amman', + 'Africa/Casablanca', + 'Africa/Lome', + 'backoff', + 'psp-routing', + 'Windows XP', + 'America/Panama', + 'America/Tegucigalpa', + 'amr', + 'Europe/London', + 'no-raw-e2e', + 'Asia/Muscat', + 'upi', + 'havehash', + 'Africa/Douala', + 'psp', + 'Ubuntu', + 'min', + 'adm', + 'Mac OS 10.13.2', + 'Mac OS 10.13.1', + 'America/Buenos_Aires', + 'Asia/Singapore', + 'Asia/Damascus', + 'meta', + 'rtcp_vid_plr_max_disorder_dist', + 'rtcp_use_new_plr', + 'rtcp_aud_plr_max_disorder_dist', + 'min_elastic_disorder_buf_size_in_frames', + 'max_audio_frame_disorder_distance', + 'aud_disorder_dist_hist_reset_interv_in_sec', + 'Mac OS 10.11', + 'Asia/Shanghai', + 'Africa/Kampala', + 'Mac OS 10.13', + 'Asia/Baku', + 'America/Chihuahua', + 'provider-type', + 'product_catalog', + 'ICICI', + 'Asia/Bishkek', + 'GMT', + 'Asia/Bahrain', + 'Asia/Qatar', + 'Asia/Bangkok', + 'Africa/Brazzaville', + 'America/El_Salvador', + 'US', + 'max_rtt', + 'builtin', + 'credential-id', + 'America/Jamaica', + 'Mac OS 10.12.5', + 'Unauthorized', + '427', + 'iOS 8.2', + 'Mac OS 10.9.5', + 'pay', + 'encr_media', + 'device-id', + 'Asia/Colombo', + 'stage', + 'Brazil/East', + 'w:pay', + 'accept2', + 'Mac OS 10.11.1', + 'page', + 'bad-request', + 'height', + 'expires', + 'transaction-prefix', + 'America/Cancun', + 'width', + 'xml-not-well-formed', + 'Africa/Khartoum', + 'rim', + 'es', + 'Mac OS 10.14.2', + 'pt', + 'wa-support-phone-number', + 'push', + 'silent', + 'BR', + 'nodal', + 'Africa/Kigali', + 'counter', + 'amount', + 'Chromium OS 11021.56.0', + 'Asia/Brunei', + 'Africa/Maputo', + 'Africa/Abidjan', + 'Pacific/Majuro', + 'Africa/Dakar', + 'max_audio_ts_jitter_ms', + 'Chromium', + 'accept_pay', + 'Europe/Brussels', + 'Africa/Lusaka', + 'Mac OS 10.12', + 'Africa/Blantyre', + 'seq-no', + 'Asia/Tehran', + 'pt-PT', + 'Ubuntu Chromium', + 'policy', + 'America/Managua', + 'Europe/Andorra', + 'smb_tos', + 'enable', + 'Europe/Bucharest', + 'android_record_preset', + 'ex', + 'America/Boa_Vista', + 'en-AU', + 'GB', + 'sms-prefix', + 'sms-gateways', + 'providers', + 'upi-bank-info', + 'Mac OS 10.12.3', + 'free', + 'sender-alias', + 'receiver-alias', + 'is_vpa', + 'bank-transaction-id', + 'America/Eirunepe', + 'Asia/Yekaterinburg', + 'Mac OS 10.11.5', + 'receiver', + 'America/Tijuana', + 'America/Port_of_Spain', + 'currency', + 'America/Port-au-Prince', + 'uri', + 'Asia/Baghdad', + 'Africa/Ouagadougou', + 'sender', + 'Mac OS 10.13.0', + 'android_audio_engine', + 'limit', + 'pin-format-version', + 'otp-length', + 'mpin-length', + 'is-mpin-set', + 'bank-name', + 'atm-pin-length', + 'account-number', + 'account-name', + 'America/Chicago', + 'America/Los_Angeles', + 'upi-batch', + 'message-id', + 'default-debit', + 'default-credit', + 'price', + 'Mac OS 10.12.0', + 'Asia/Vladivostok', + 'America/Barbados', + 'Europe/Paris', + 'Asia/Krasnoyarsk', + 'w:biz:catalog', + 'w:auth:token', + 'Mac OS 10.11.4', + 'Asia/Yakutsk', + 'Mac OS 10.12.4', + 'America/Bahia', + 'ip', + 'cond_min_packet_loss_pct', + 'cond_max_rtt', + 'America/Toronto', + 'Africa/Luanda', + 'Asia/Dhaka', + 'America/Hermosillo', + 'visible', + 'Europe/Zurich', + 'provider', + 'mmid', + 'Africa/Libreville', + 'Africa/Addis_Ababa', + 'self', + 'Africa/Ceuta', + 'caller_timeout', + 'lang', + 'total', + 'Windows Vista', + 'limited', + 'Africa/Niamey', + 'ifsc-code', + 'created', + 'account-ref-id', + 'Africa/Windhoek', + 'America/Bahia_Banderas', + 'status_ad', + 'call_info', + 'ICIWC', + '304', + 'pin', + 'Mac OS 10.11.3', + 'banks', + 'ads', + 'Asia/Jayapura', + 'audio_fps_threshold', + 'Atlantic/Azores', + 'delay', + 'Atlantic/Canary', + 'verification-data', + 'notif-allowed', + 'nodal-allowed', + 'Atlantic/South_Georgia', + 'iOS Messenger', + 'terminator', + 'mpin', + 'America/Godthab', + 'sms-phone-number', + 'mcc', + 'Asia/Oral', + 'Africa/Kinshasa', + 'fbid', + 'Europe/Lisbon', + 'Mac OS 10.12.1', + 'Linux', + 'Mac OS 10.12.2', + 'server', + 'Europe/Athens', + 'Asia/Taipei', + 'Europe/Vienna', + 'receiver-vpa', + 'future', + 'Mac OS 10.11.0', + 'vpas', + 'Vivaldi', + 'Africa/Gaborone', + 'America/Monterrey', + 'first', + 'Europe/Kiev', + 'token-type', + 'min_media', + 'valid', + 'psp-config', + 'Mac OS 10.10', + 'Africa/Bamako', + 'ar', + 'Africa/Mogadishu', + 'owner', + 'Chromium OS 10895.78.0', + 'America/Puerto_Rico', + 'Africa/Bujumbura', + 'upi-get-vpa', + 'sender-vpa', + 'feature-not-implemented', + 'Africa/Mbabane', + 'America/Phoenix', + '428', + 'Poland', + 'America/Guadeloupe', + 'k1', + 'America/Cordoba', + 'America/Anguilla', + 'Asia/Ho_Chi_Minh', + 'INR', + 'America/Nassau', + 'fr', + 'SUCCESS', + 'Europe/Minsk', + 'US/Indiana-Starke', + 'America/Atikokan', + 'Indian/Mauritius', + 'sts', + 'link', + 'Europe/Kaliningrad', + 'America/Mazatlan', + 'Europe/Helsinki', + 'Mac OS 10.10.3', + 'Africa/Freetown', + 'Europe/Sarajevo', + 'Mac OS 10.11.2', + 'Europe/Tirane', + 'upi-get-token', + 'speed', + 'Australia/Perth', + 'paid', + 'America/Denver', + 'America/Paramaribo', + 'tos', + 'ru', + 'America/Detroit', + 'Asia/Tbilisi', + 'sound', + 'sufficient-balance', + 'Europe/Dublin', + 'Asia/Seoul', + 'Australia/Sydney', + 'iOS 12.0.1', + 'get-methods', + 'Indian/Christmas', + 'Asia/Magadan', + 'Europe/Warsaw', + 'America/Halifax', + 'upi-get-accounts', + 'uncallable', + 'element_name', + 'Turkey', + 'ES', + 'Atlantic/Madeira', + 'show', + 'before', + 'MX', + 'tracking_token', + 'Africa/Algiers', + '#pay-tos-not-accepted', + 'undefined', + 'Mac OS 10.6.8', + 'violation', + 'actor', + 'America/Antigua', + 'Mac OS 10.9', + 'Mac OS 10.8.5', + 'Africa/Maseru', + 'cancel', + 'Asia/Manila', + 'America/Merida', + 'Africa/Tripoli', + 'iOS 12.1', + 'Mac OS 10.7.5', + 'upi-bind-device', + 'wait', + 'upi-intent-to-send', + 'upi-get-blocked-vpas', + 'pcm', + 'missing', + 'America/St_Johns', + 'sender_loss_high', + 'Mac OS 10.10.2', + 'Mac OS 10.7.3', + 'Atlantic/Cape_Verde', + 'get-transactions', + 'Etc/GMT+3', + 'Fedora', + 'America/Indiana/Indianapolis', + 'Africa/Nouakchott', + 'upi-check-mpin', + 'mp3', + 'Mac OS 10.10.0', + 'Asia/Tokyo', + 'kind', + 'k0', + 'expired', + 'America/Anchorage', + 'tr', + 'Asia/Novosibirsk', + 'upi-register-vpa', + 'otp', + 'cts', + 'Indian/Mayotte', + 'America/Dawson', + 'pid-setup', + 'America/Regina', + 'America/Maceio', + 'Africa/Lubumbashi', + 'US/Michigan', + 'America/Cuiaba', + 'Asia/Kamchatka', + 'upgrade', + 'iOS 11.4.1', + 'Asia/Omsk', + 'Asia/Katmandu', + 'policy-violation', + 'Pacific/Honolulu', + 'Europe/Riga', + 'Asia/Vientiane', + 'Africa/Banjul', + 'Android 8.0.0', + 'Europe/Zagreb', + 'Europe/Samara', + 'Europe/Belgrade', + 'upi-list-keys', + 'hi', + 'should_monitor_audio_health', + 'cost', + 'Asia/Pontianak', + 'Antarctica/Davis', + 'America/Guyana', + 'Europe/Stockholm', + 'America/Vancouver', + 'America/Porto_Velho', + 'file', + 'Africa/Tunis', + 'wallet-balance', + 'ent_load_test', + 'Pacific/Auckland', + 'State Bank Of India', + 'Europe/Prague', + 'de', + 'Indian/Maldives', + 'Asia/Kabul', + 'Asia/Aqtau', + 'it', + 'Asia/Phnom_Penh', + 'Africa/Conakry', + 'error-text', + 'error-code', + 'balance', + 'Zulu', + 'Mac OS 10.8', + 'America/Belize', + 'method', + 'arch 64', + 'Unexpected wa_fb_api error', + 'INITIAL', + 'Etc/GMT+4', + 'Asia/Tashkent', + 'America/Rio_Branco', + 'send', + 'W-SU', + 'Asia/Nicosia', + 'Asia/Irkutsk', + 'America/Punta_Arenas', + 'America/Aruba', + 'iOS 10.3.1', + 'Chromium OS 11151.17.0', + 'upi-vpa-sync', + 'America/Edmonton', + 'nl', + 'Asia/Yerevan', + 'Android 7.0', + 'ad_invalidated', + 'Libya', + 'Asia/Kathmandu', + 'tizen', + 'note', + 'iOS 11.4', + 'Pacific/Fiji', + 'Europe/Budapest', + 'Asia/Rangoon', + 'http://etherx.jabber.org/streams', + 'WET', + 'Africa/Malabo', + 'urn:xmpp:whatsapp:sync', + 'srtp', + 'catalog_status', + 'Chromium OS 10895.56.0', + 'Australia/Brisbane', + 'Asia/Qyzylorda', + 'Asia/Aqtobe', + 'everyone', + 'Africa/Ndjamena', + 'rtt', + 'lsp', + 'Jamaica', + 'Europe/Bratislava', + 'Canada/Atlantic', + 'Asia/Dushanbe', + 'wma', + 'view_slot_total', + 'view_slot', + 'view_media_total', + 'view_media', + 'time_gap', + 'request_time_gap', + 'min_total', + 'Singapore', + 'Pacific/Guam', + 'Mac OS 10.6', + 'Europe/Malta', + 'Europe/Chisinau', + 'Asia/Saigon', + 'qr', + 'nokia', + 'Mac OS 10.9.4', + 'Europe/Sofia', + 'Europe/Monaco', + 'Chile/Continental', + 'Africa/Monrovia', + '#pay-tos-v2-not-accepted', + 'jabber:iq:last', + 'cta', + 'WebKit', + 'Asia/Dili', + 'America/Ojinaga', + 'upi-user-set-up', + 'received', + 'owning', + 'iOS 12.0', + 'field', + 'advertising_id', + 'adder', + 'GMT+05:30', + 'Chromium OS 10718.88.2', + 'America/St_Kitts', + 'America/Grand_Turk', + 'America/Dominica', + 'whatsapp:hsm:facebook:alerts', + 'stat', + 'port', + 'device', + 'creative', + 'Pacific/Tongatapu', + 'Europe/Copenhagen' ] diff --git a/yowsup/layers/noise/layer.py b/yowsup/layers/noise/layer.py index 321ce83d5..7423f6f38 100644 --- a/yowsup/layers/noise/layer.py +++ b/yowsup/layers/noise/layer.py @@ -29,14 +29,14 @@ class YowNoiseLayer(YowLayer): DEFAULT_PUSHNAME = "yowsup" - HEADER = b'WA\x02\x01' + HEADER = b'WA\x03\x00' EDGE_HEADER = b'ED\x00\x01' EVENT_HANDSHAKE_FAILED = "org.whatsapp.yowsup.layer.noise.event.handshake_failed" def __init__(self): super(YowNoiseLayer, self).__init__() self._wa_noiseprotocol = WANoiseProtocol( - 2, 1, protocol_state_callbacks=self._on_protocol_state_changed + 3, 0, protocol_state_callbacks=self._on_protocol_state_changed ) # type: WANoiseProtocol self._handshake_worker = None